webmon fixes + breakup plugins.py

This commit is contained in:
Jokob-sk
2023-08-22 14:50:21 +10:00
parent 57f508f15c
commit c3982bf747
5 changed files with 30 additions and 35 deletions

View File

@@ -160,4 +160,29 @@ def get_plugins_configs():
# Load the contents of the config.json file as a JSON object and append it to pluginsList
pluginsList.append(json.loads(get_file_content(config_path)))
return pluginsList # Return the list of plugin configurations
return pluginsList # Return the list of plugin configurations
#-------------------------------------------------------------------------------
# Gets the setting value
def get_plugin_setting_value(plugin, function_key):
resultObj = get_plugin_setting(plugin, function_key)
if resultObj != None:
return resultObj["value"]
return None
#-------------------------------------------------------------------------------
def custom_plugin_decoder(pluginDict):
return namedtuple('X', pluginDict.keys())(*pluginDict.values())
#-------------------------------------------------------------------------------
# Handle empty value
def handle_empty(value):
if value == '' or value is None:
value = 'null'
return value