mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
css, pluginsCore, less verbose debug fixes
Some checks are pending
docker / docker_dev (push) Waiting to run
Some checks are pending
docker / docker_dev (push) Waiting to run
This commit is contained in:
@@ -1300,6 +1300,11 @@ input[readonly] {
|
|||||||
min-width: 40px;
|
min-width: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.iconPreview svg{
|
||||||
|
min-width: 20px;
|
||||||
|
max-width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.dummyDevice
|
.dummyDevice
|
||||||
{
|
{
|
||||||
@@ -1465,6 +1470,8 @@ input[readonly] {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#panDetails #NEWDEV_devCustomProps_label
|
#panDetails #NEWDEV_devCustomProps_label
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
data: ["devMac", "devLastIP", "devName", "devOwner", "devType", "devVendor", "devGroup", "devIcon", "devLocation", "devComments"],
|
data: ["devMac", "devLastIP", "devName", "devOwner", "devType", "devVendor", "devGroup", "devIcon", "devLocation", "devComments"],
|
||||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_MANAGEMENT.md",
|
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_MANAGEMENT.md",
|
||||||
iconClass: "fa fa-pencil",
|
iconClass: "fa fa-pencil",
|
||||||
inputGroupClasses: "field-group col-lg-4 col-sm-6 col-xs-12",
|
inputGroupClasses: "field-group main-group col-lg-4 col-sm-6 col-xs-12",
|
||||||
labelClasses: "col-sm-4 col-xs-12 control-label",
|
labelClasses: "col-sm-4 col-xs-12 control-label",
|
||||||
inputClasses: "col-sm-8 col-xs-12 input-group"
|
inputClasses: "col-sm-8 col-xs-12 input-group"
|
||||||
},
|
},
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
data: ["devStatus", "devLastConnection", "devFirstConnection"],
|
data: ["devStatus", "devLastConnection", "devFirstConnection"],
|
||||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/SESSION_INFO.md",
|
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/SESSION_INFO.md",
|
||||||
iconClass: "fa fa-calendar",
|
iconClass: "fa fa-calendar",
|
||||||
inputGroupClasses: "field-group col-lg-4 col-sm-6 col-xs-12",
|
inputGroupClasses: "field-group session-group col-lg-4 col-sm-6 col-xs-12",
|
||||||
labelClasses: "col-sm-4 col-xs-12 control-label",
|
labelClasses: "col-sm-4 col-xs-12 control-label",
|
||||||
inputClasses: "col-sm-8 col-xs-12 input-group"
|
inputClasses: "col-sm-8 col-xs-12 input-group"
|
||||||
},
|
},
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
data: ["devAlertEvents", "devAlertDown", "devSkipRepeated"],
|
data: ["devAlertEvents", "devAlertDown", "devSkipRepeated"],
|
||||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
|
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
|
||||||
iconClass: "fa fa-bell",
|
iconClass: "fa fa-bell",
|
||||||
inputGroupClasses: "field-group col-lg-4 col-sm-6 col-xs-12",
|
inputGroupClasses: "field-group alert-group col-lg-4 col-sm-6 col-xs-12",
|
||||||
labelClasses: "col-sm-4 col-xs-12 control-label",
|
labelClasses: "col-sm-4 col-xs-12 control-label",
|
||||||
inputClasses: "col-sm-8 col-xs-12 input-group"
|
inputClasses: "col-sm-8 col-xs-12 input-group"
|
||||||
},
|
},
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
data: ["devParentMAC", "devParentPort", "devSSID", "devSite", "devSyncHubNode"],
|
data: ["devParentMAC", "devParentPort", "devSSID", "devSite", "devSyncHubNode"],
|
||||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md",
|
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md",
|
||||||
iconClass: "fa fa-network-wired",
|
iconClass: "fa fa-network-wired",
|
||||||
inputGroupClasses: "field-group col-lg-4 col-sm-6 col-xs-12",
|
inputGroupClasses: "field-group network-group col-lg-4 col-sm-6 col-xs-12",
|
||||||
labelClasses: "col-sm-4 col-xs-12 control-label",
|
labelClasses: "col-sm-4 col-xs-12 control-label",
|
||||||
inputClasses: "col-sm-8 col-xs-12 input-group"
|
inputClasses: "col-sm-8 col-xs-12 input-group"
|
||||||
},
|
},
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
data: ["devStaticIP", "devIsNew", "devFavorite", "devIsArchived"],
|
data: ["devStaticIP", "devIsNew", "devFavorite", "devIsArchived"],
|
||||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_DISPLAY_SETTINGS.md",
|
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_DISPLAY_SETTINGS.md",
|
||||||
iconClass: "fa fa-list-check",
|
iconClass: "fa fa-list-check",
|
||||||
inputGroupClasses: "field-group col-lg-4 col-sm-6 col-xs-12",
|
inputGroupClasses: "field-group display-group col-lg-4 col-sm-6 col-xs-12",
|
||||||
labelClasses: "col-sm-4 col-xs-12 control-label",
|
labelClasses: "col-sm-4 col-xs-12 control-label",
|
||||||
inputClasses: "col-sm-8 col-xs-12 input-group"
|
inputClasses: "col-sm-8 col-xs-12 input-group"
|
||||||
},
|
},
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
data: ["devCustomProps"],
|
data: ["devCustomProps"],
|
||||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/CUSTOM_PROPERTIES.md",
|
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/CUSTOM_PROPERTIES.md",
|
||||||
iconClass: "fa fa-list",
|
iconClass: "fa fa-list",
|
||||||
inputGroupClasses: "field-group col-lg-12 col-sm-12 col-xs-12",
|
inputGroupClasses: "field-group cutprop-group col-lg-12 col-sm-12 col-xs-12",
|
||||||
labelClasses: "col-sm-12 col-xs-12 control-label",
|
labelClasses: "col-sm-12 col-xs-12 control-label",
|
||||||
inputClasses: "col-sm-12 col-xs-12 input-group"
|
inputClasses: "col-sm-12 col-xs-12 input-group"
|
||||||
}
|
}
|
||||||
|
|||||||
0
front/php/templates/language/fr_fr.json
Normal file → Executable file
0
front/php/templates/language/fr_fr.json
Normal file → Executable file
0
front/php/templates/language/uk_ua.json
Normal file → Executable file
0
front/php/templates/language/uk_ua.json
Normal file → Executable file
@@ -27,9 +27,7 @@ Logger(get_setting_value('LOG_LEVEL'))
|
|||||||
pluginName = "PUSHOVER"
|
pluginName = "PUSHOVER"
|
||||||
|
|
||||||
LOG_PATH = logPath + '/plugins'
|
LOG_PATH = logPath + '/plugins'
|
||||||
RESULT_FILE = os.path.join(LOG_PATH, "last_result.log")
|
RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# Based on the work of https://github.com/leiweibau/Pi.Alert
|
# Based on the work of https://github.com/leiweibau/Pi.Alert
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@@ -15,6 +16,8 @@ from logger import mylog, Logger
|
|||||||
from helper import timeNowTZ, get_setting_value
|
from helper import timeNowTZ, get_setting_value
|
||||||
import conf
|
import conf
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
from const import logPath
|
||||||
|
|
||||||
|
|
||||||
# Make sure the TIMEZONE for logging is correct
|
# Make sure the TIMEZONE for logging is correct
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
@@ -22,10 +25,16 @@ conf.tz = timezone(get_setting_value('TIMEZONE'))
|
|||||||
# Make sure log level is initialized correctly
|
# Make sure log level is initialized correctly
|
||||||
Logger(get_setting_value('LOG_LEVEL'))
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
|
pluginName = 'DHCPSRVS'
|
||||||
|
|
||||||
|
LOG_PATH = logPath + '/plugins'
|
||||||
|
LOG_FILE = os.path.join(LOG_PATH, f'script.{pluginName}.log')
|
||||||
|
RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
mylog('verbose', ['[DHCPSRVS] In script'])
|
mylog('verbose', ['[DHCPSRVS] In script'])
|
||||||
RESULT_FILE = 'last_result.log'
|
|
||||||
last_run_logfile = open(RESULT_FILE, 'a')
|
last_run_logfile = open(RESULT_FILE, 'a')
|
||||||
last_run_logfile.write("")
|
last_run_logfile.write("")
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ def main():
|
|||||||
foreignKey = entry.mac
|
foreignKey = entry.mac
|
||||||
)
|
)
|
||||||
|
|
||||||
# generate last_result.log file
|
|
||||||
plugin_objects.write_result_file()
|
plugin_objects.write_result_file()
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -368,10 +368,16 @@ function getObjectData(prefix, colDefinitions, pluginObj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getHistoryData(prefix, colDefinitions, pluginObj) {
|
function getHistoryData(prefix, colDefinitions, pluginObj) {
|
||||||
// Extract history data for the plugin, limiting to the first 50 entries for performance
|
|
||||||
return pluginHistory
|
return pluginHistory
|
||||||
.filter((history, index) => history.Plugin === prefix && index < 50) // Filter history for the specific plugin
|
.filter(history => history.Plugin === prefix) // First, filter based on the plugin prefix
|
||||||
.map(object => colDefinitions.map(colDef => getFormControl(colDef, object[colDef.column], object["Index"], colDefinitions, object)));
|
.sort((a, b) => b.Index - a.Index) // Then, sort by the Index field in descending order
|
||||||
|
.slice(0, 50) // Limit the result to the first 50 entries
|
||||||
|
.map(object =>
|
||||||
|
colDefinitions.map(colDef =>
|
||||||
|
getFormControl(colDef, object[colDef.column], object["Index"], colDefinitions, object)
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateTabNavigation(prefix, objectCount, eventCount, historyCount) {
|
function generateTabNavigation(prefix, objectCount, eventCount, historyCount) {
|
||||||
|
|||||||
@@ -151,9 +151,9 @@ class api_endpoint_class:
|
|||||||
execution_log.finalize_event("update_api")
|
execution_log.finalize_event("update_api")
|
||||||
self.is_ad_hoc_user_event = False
|
self.is_ad_hoc_user_event = False
|
||||||
|
|
||||||
else:
|
# else:
|
||||||
# Debugging if write is skipped
|
# # Debugging if write is skipped
|
||||||
mylog('trace', [f'[API] api_endpoint_class: Skipping write for {self.fileName}, debounce time not passed.'])
|
# mylog('trace', [f'[API] api_endpoint_class: Skipping write for {self.fileName}, debounce time not passed.'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,15 @@ from collections import namedtuple
|
|||||||
# Register NetAlertX modules
|
# Register NetAlertX modules
|
||||||
import conf
|
import conf
|
||||||
from const import pluginsPath, logPath, applicationPath, reportTemplatesPath
|
from const import pluginsPath, logPath, applicationPath, reportTemplatesPath
|
||||||
from logger import mylog
|
from logger import mylog, Logger
|
||||||
from helper import timeNowTZ, updateState, get_file_content, write_file, get_setting, get_setting_value
|
from helper import timeNowTZ, updateState, get_file_content, write_file, get_setting, get_setting_value
|
||||||
from api import update_api
|
from api import update_api
|
||||||
from plugin_utils import logEventStatusCounts, get_plugin_string, get_plugin_setting_obj, print_plugin_info, list_to_csv, combine_plugin_objects, resolve_wildcards_arr, handle_empty, custom_plugin_decoder, decode_and_rename_files
|
from plugin_utils import logEventStatusCounts, get_plugin_string, get_plugin_setting_obj, print_plugin_info, list_to_csv, combine_plugin_objects, resolve_wildcards_arr, handle_empty, custom_plugin_decoder, decode_and_rename_files
|
||||||
from notification import Notification_obj, write_notification
|
from notification import Notification_obj, write_notification
|
||||||
from execution_log import ExecutionLog
|
from execution_log import ExecutionLog
|
||||||
|
|
||||||
|
# Make sure log level is initialized correctly
|
||||||
|
Logger(get_setting_value('LOG_LEVEL'))
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
class plugin_param:
|
class plugin_param:
|
||||||
@@ -316,7 +318,7 @@ def execute_plugin(db, all_plugins, plugin, pluginsState = plugins_state() ):
|
|||||||
|
|
||||||
# keep current instance log file, delete all from other nodes
|
# keep current instance log file, delete all from other nodes
|
||||||
if filename != 'last_result.log' and os.path.exists(full_path):
|
if filename != 'last_result.log' and os.path.exists(full_path):
|
||||||
os.remove(full_path)
|
os.remove(full_path) # DEBUG:TODO uncomment 🐛
|
||||||
mylog('verbose', [f'[Plugins] Processed and deleted file: {full_path} '])
|
mylog('verbose', [f'[Plugins] Processed and deleted file: {full_path} '])
|
||||||
|
|
||||||
|
|
||||||
@@ -453,7 +455,6 @@ def execute_plugin(db, all_plugins, plugin, pluginsState = plugins_state() ):
|
|||||||
sqlParams.append(tuple(base_params))
|
sqlParams.append(tuple(base_params))
|
||||||
else:
|
else:
|
||||||
mylog('none', ['[Plugins] Skipped invalid sql result'])
|
mylog('none', ['[Plugins] Skipped invalid sql result'])
|
||||||
|
|
||||||
|
|
||||||
# check if the subprocess / SQL query failed / there was no valid output
|
# check if the subprocess / SQL query failed / there was no valid output
|
||||||
if len(sqlParams) == 0:
|
if len(sqlParams) == 0:
|
||||||
@@ -461,7 +462,7 @@ def execute_plugin(db, all_plugins, plugin, pluginsState = plugins_state() ):
|
|||||||
return pluginsState
|
return pluginsState
|
||||||
else:
|
else:
|
||||||
mylog('verbose', ['[Plugins] SUCCESS, received ', len(sqlParams), ' entries'])
|
mylog('verbose', ['[Plugins] SUCCESS, received ', len(sqlParams), ' entries'])
|
||||||
mylog('debug', ['[Plugins] sqlParam entries: ', sqlParams])
|
# mylog('debug', ['[Plugins] sqlParam entries: ', sqlParams]) # not working for som reason
|
||||||
|
|
||||||
# process results if any
|
# process results if any
|
||||||
if len(sqlParams) > 0:
|
if len(sqlParams) > 0:
|
||||||
@@ -605,7 +606,6 @@ def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
|
|||||||
|
|
||||||
# combine all DB insert and update events into one for history
|
# combine all DB insert and update events into one for history
|
||||||
history_to_insert.append(values)
|
history_to_insert.append(values)
|
||||||
|
|
||||||
|
|
||||||
mylog('debug', ['[Plugins] pluginEvents count: ', len(pluginEvents)])
|
mylog('debug', ['[Plugins] pluginEvents count: ', len(pluginEvents)])
|
||||||
mylog('debug', ['[Plugins] pluginObjects count: ', len(pluginObjects)])
|
mylog('debug', ['[Plugins] pluginObjects count: ', len(pluginObjects)])
|
||||||
@@ -614,6 +614,10 @@ def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
|
|||||||
mylog('debug', ['[Plugins] history_to_insert count: ', len(history_to_insert)])
|
mylog('debug', ['[Plugins] history_to_insert count: ', len(history_to_insert)])
|
||||||
mylog('debug', ['[Plugins] objects_to_insert count: ', len(objects_to_insert)])
|
mylog('debug', ['[Plugins] objects_to_insert count: ', len(objects_to_insert)])
|
||||||
mylog('debug', ['[Plugins] objects_to_update count: ', len(objects_to_update)])
|
mylog('debug', ['[Plugins] objects_to_update count: ', len(objects_to_update)])
|
||||||
|
|
||||||
|
mylog('trace', ['[Plugins] objects_to_update: ', objects_to_update])
|
||||||
|
mylog('trace', ['[Plugins] events_to_insert: ', events_to_insert])
|
||||||
|
mylog('trace', ['[Plugins] history_to_insert: ', history_to_insert])
|
||||||
|
|
||||||
logEventStatusCounts('pluginEvents', pluginEvents)
|
logEventStatusCounts('pluginEvents', pluginEvents)
|
||||||
logEventStatusCounts('pluginObjects', pluginObjects)
|
logEventStatusCounts('pluginObjects', pluginObjects)
|
||||||
|
|||||||
Reference in New Issue
Block a user