Setting template work + vendors fix

This commit is contained in:
Jokob-sk
2023-08-05 09:37:32 +10:00
parent 4fbaccc0f2
commit d5f8cdda7d
7 changed files with 115 additions and 51 deletions

View File

@@ -336,4 +336,8 @@ class noti_struc:
def __init__(self, json, text, html):
self.json = json
self.text = text
self.html = html
self.html = html
#-------------------------------------------------------------------------------
def isJsonObject(value):
return isinstance(value, dict)

View File

@@ -9,7 +9,7 @@ import json
import conf
from const import fullConfPath
from helper import collect_lang_strings, updateSubnets, initOrSetParam
from helper import collect_lang_strings, updateSubnets, initOrSetParam, isJsonObject
from logger import mylog
from api import update_api
from scheduler import schedule_class
@@ -18,13 +18,13 @@ from plugin import get_plugins_configs, print_plugin_info
#===============================================================================
# Initialise user defined values
#===============================================================================
# We need access to the DB to save new values so need to define DB access methods first
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Import user values
# Check config dictionary
def ccd(key, default, config_dir, name, inputtype, options, group, events=[], desc = "", regex = "", setJsonMetadata = {}):
def ccd(key, default, config_dir, name, inputtype, options, group, events=[], desc = "", regex = "", setJsonMetadata = {}, overrideTemplate = {}):
# use default inintialization value
result = default
if events is None:
@@ -222,7 +222,7 @@ def importConfigs (db):
events = set.get("events"),
desc = set["description"][0]["string"],
regex = "",
setJsonMetadata = set)
setJsonMetadata = set)
# Save the user defined value into the object
set["value"] = v

View File

@@ -21,7 +21,7 @@ def update_devices_MAC_vendors (db, pArg = ''):
# Update vendors DB (iab oui)
mylog('verbose', [' Updating vendors DB (iab & oui)'])
update_args = ['sh', pialertPath + '/update_vendors.sh', pArg]
update_args = ['sh', pialertPath + '/back/update_vendors.sh', pArg]
# Execute command
if conf.LOG_LEVEL == 'debug':