mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
webmon fixes + breakup plugins.py
This commit is contained in:
@@ -12,7 +12,7 @@ from const import pluginsPath, logPath
|
||||
from logger import mylog
|
||||
from helper import timeNowTZ, updateState, get_file_content, write_file, get_setting, get_setting_value
|
||||
from api import update_api
|
||||
from plugin_utils import logEventStatusCounts, get_plugin_string, get_plugin_setting, print_plugin_info, flatten_array, combine_plugin_objects, resolve_wildcards_arr
|
||||
from plugin_utils import logEventStatusCounts, get_plugin_string, get_plugin_setting, print_plugin_info, flatten_array, combine_plugin_objects, resolve_wildcards_arr, get_plugin_setting_value, handle_empty, custom_plugin_decoder
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -296,17 +296,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
|
||||
return pluginsState
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
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
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -341,26 +331,6 @@ def passable_string_from_setting(globalSetting):
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Check if watched values changed for the given plugin
|
||||
def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
|
||||
|
||||
Reference in New Issue
Block a user