From 90ff2efbfbadb85021f8a165e400319eab086a5a Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sun, 5 Jan 2025 09:50:19 +1100 Subject: [PATCH] devSite to dropdown #930 --- front/css/app.css | 1 + front/plugins/newdev_template/config.json | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/front/css/app.css b/front/css/app.css index 8240eb80..1dbdd6c7 100755 --- a/front/css/app.css +++ b/front/css/app.css @@ -894,6 +894,7 @@ height: 50px; #settingsPage #add_option_NEWDEV_devOwner, #settingsPage #copy_icons_NEWDEV_devIcon, #settingsPage #add_icon_NEWDEV_devIcon, +#settingsPage #add_option_NEWDEV_devSite, #settingsPage #add_option_NEWDEV_devType { display: none; diff --git a/front/plugins/newdev_template/config.json b/front/plugins/newdev_template/config.json index 49f1f2b0..92d32fdb 100755 --- a/front/plugins/newdev_template/config.json +++ b/front/plugins/newdev_template/config.json @@ -1446,18 +1446,30 @@ }, { "function": "devSite", + "events": [ + "add_option" + ], "type": { "dataType": "string", "elements": [ { - "elementType": "input", + "elementType": "select", "elementOptions": [], "transformers": [] } ] }, "default_value": "", - "options": [], + "options": [ + "{value}" + ], + "options_params": [ + { + "name": "value", + "type": "sql", + "value": "SELECT DISTINCT '' AS id, '❌None' AS name UNION SELECT devSite AS id, devSite AS name FROM Devices WHERE devSite NOT IN ('', 'null') AND devSite IS NOT NULL UNION SELECT 'default' AS id, 'default' AS name UNION SELECT 'home', 'home' ORDER BY id;" + } + ], "localized": [ "name", "description" @@ -1488,7 +1500,7 @@ "columns": [ { "settingKey": "CUSTPROP_icon", - "optionsOverride":"setting.CUSTPROP_icon", + "optionsOverride": "setting.CUSTPROP_icon", "typeOverride": { "dataType": "string", "elements": [ @@ -1528,7 +1540,7 @@ }, { "settingKey": "CUSTPROP_type", - "optionsOverride":"setting.CUSTPROP_type", + "optionsOverride": "setting.CUSTPROP_type", "typeOverride": { "dataType": "string", "elements": [ @@ -1539,7 +1551,7 @@ } ] } - }, + }, { "settingKey": "CUSTPROP_name" },