authen
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
fn_prop_params_js
Parameters
Name
Type
Mode
prop_id
integer
IN
param_group
citext
IN (DEFAULT NULL)
Definition
DECLARE /*query text = 'select param_group, param_name, param_value from sys_params';*/ query text = $$select system_params::jsonb #- '{DEBUG}' as obj_params from property_info$$; res_json jsonb; interfaces jsonb; -- subscription_expire date; -- remaining_days int; -- subscription_active boolean; BEGIN if param_group is not null then query = query||' where param_group = '||QUOTE_LITERAL(param_group); end if; SELECT * FROM dblink(fn_prop_connection($1), $$select jsonb_object_agg(code, enabled) as intf from interfaces$$) as A(intf jsonb) into interfaces; select obj_params from dblink(fn_prop_connection($1), query) as params(obj_params jsonb) into res_json; res_json := res_json || jsonb_build_object('DASHBOARD_URL', fn_dashboard_url(prop_id, 0)) || jsonb_build_object('LOCAL_SERVICE_DOWNLOAD_URL', fn_get_config(prop_id,'LOCAL_SERVICE_DOWNLOAD_URL')) || jsonb_build_object('interfaces', interfaces); /* subscription_expire := sys.get_subscription_expire($1); remaining_days := (subscription_expire - current_date); subscription_active := subscription_expire > current_date; res_json := res_json || jsonb_build_object('DASHBOARD_URL', fn_dashboard_url(prop_id, 0)) || jsonb_build_object('LOCAL_SERVICE_DOWNLOAD_URL', fn_get_config(prop_id,'LOCAL_SERVICE_DOWNLOAD_URL')) || jsonb_build_object('interfaces', interfaces); || jsonb_build_object('license_info', jsonb_build_object( 'active', subscription_active, 'expire_date', subscription_expire, 'warning', remaining_days < 7, 'warning_message', case when remaining_days < 7 then 'Subscription will expire in '||remaining_days::text||' days' when not subscription_active then 'Subscription expired' else '' end ) );*/ return res_json::json; END