diff --git a/back/pialert.py b/back/pialert.py index 57463df6..9767a7b6 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -2900,7 +2900,9 @@ def mqtt_start(): # Get all devices devices = get_all_devices() - file_print(" Estimated delay: ", (len(devices) * int(MQTT_DELAY_SEC)*5), 's ', '(', round((len(devices) * int(MQTT_DELAY_SEC))/60,1) , 'min)' ) + sec_delay = len(devices) * int(MQTT_DELAY_SEC)*5 + + file_print(" Estimated delay: ", (sec_delay), 's ', '(', round(sec_delay/60,1) , 'min)' ) for device in devices: @@ -3589,8 +3591,10 @@ def get_form_control(setting): return 'boolean' if type in ['TIMEOUT', 'RUN_TIMEOUT']: return 'integer' - if type in ['WATCH', 'LIST']: + if type in ['WATCH']: return 'multiselect' + if type in ['LIST']: + return 'text' return 'text' @@ -3630,7 +3634,7 @@ def run_plugin_scripts(runType): print_plugin_info(plugin, ['display_name']) file_print(' [Plugins] CMD: ', get_plugin_setting(plugin, "CMD")["value"]) - + #------------------------------------------------------------------------------- def get_plugin_setting(plugin, key): diff --git a/front/php/server/util.php b/front/php/server/util.php index 4c7c4eb3..4a14e435 100755 --- a/front/php/server/util.php +++ b/front/php/server/util.php @@ -275,24 +275,24 @@ function saveSettings() { if($group == $setting[0]) { - if($setting[3] == 'text' or $setting[3] == 'password' or $setting[3] == 'readonly' or $setting[3] == 'selecttext') + if($setting[2] == 'text' or $setting[2] == 'password' or $setting[2] == 'readonly' or $setting[2] == 'selecttext') { - $txt = $txt.$setting[1]."='".$setting[2]."'\n" ; - } elseif($setting[3] == 'integer' or $setting[3] == 'selectinteger') + $txt = $txt.$setting[1]."='".$setting[3]."'\n" ; + } elseif($setting[2] == 'integer' or $setting[2] == 'selectinteger') { - $txt = $txt.$setting[1]."=".$setting[2]."\n" ; - } elseif($setting[3] == 'boolean') + $txt = $txt.$setting[1]."=".$setting[3]."\n" ; + } elseif($setting[2] == 'boolean') { $val = "False"; - if($setting[2] == 'true') + if($setting[3] == 'true') { $val = "True"; } $txt = $txt.$setting[1]."=".$val."\n" ; - }elseif($setting[3] == 'multiselect' or $setting[3] == 'subnets') + }elseif($setting[2] == 'multiselect' or $setting[2] == 'subnets') { $temp = '['; - foreach($setting[2] as $val) + foreach($setting[3] as $val) { $temp = $temp."'". $val."',"; } diff --git a/front/plugins/website_monitoring/config.json b/front/plugins/website_monitoring/config.json index aa8cef2a..29ec2757 100755 --- a/front/plugins/website_monitoring/config.json +++ b/front/plugins/website_monitoring/config.json @@ -56,7 +56,7 @@ "localized": ["name", "description"], "name" :[{ "language_code":"en_us", - "string" : "Run condition" + "string" : "When to run" }], "description": [{ "language_code":"en_us", diff --git a/front/settings.php b/front/settings.php index bd1c01a6..5ebcdb4b 100755 --- a/front/settings.php +++ b/front/settings.php @@ -30,6 +30,7 @@ global $db; $result = $db->query("SELECT * FROM Settings"); // array +$lists = array(); $settings = array(); while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { // Push row data @@ -232,6 +233,37 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { // Remove all interfaces button $input = $input.'
'; + } + // list + elseif ($set['Type'] == 'list') + { + + $lists[] = array($set['Code_Name']); + + $input = $input. + '
+
+ +
'; + // Add interface button + $input = $input. + '
+
'; + + // list all interfaces as options + $input = $input.'
+
'; + // Remove all interfaces button + $input = $input.'
'; + } $html = $html.$input; @@ -301,6 +333,13 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { { showModalOk('WARNING', ""); } + + // --------------------------------------------------------- function addInterface() @@ -340,17 +379,17 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { // generate javascript to collect values fetchArray (SQLITE3_ASSOC)) { }); "; - echo 'settingsArray.push(["'.$set["Group"].'", "'.$set["Code_Name"].'", temps, "'.$set["Type"].'" ]);'; + echo 'settingsArray.push(["'.$set["Group"].'", "'.$set["Code_Name"].'", "'.$set["Type"].'", temps ]);'; } }