css, pluginsCore, less verbose debug fixes
Some checks are pending
docker / docker_dev (push) Waiting to run

This commit is contained in:
jokob-sk
2025-01-19 15:05:26 +11:00
parent b18ee70b8a
commit e766b19d8c
10 changed files with 45 additions and 22 deletions

View File

@@ -1300,6 +1300,11 @@ input[readonly] {
min-width: 40px;
}
.iconPreview svg{
min-width: 20px;
max-width: 20px;
}
.dummyDevice
{
@@ -1465,6 +1470,8 @@ input[readonly] {
display: none;
}
#panDetails #NEWDEV_devCustomProps_label
{
display: none;

View File

@@ -79,7 +79,7 @@
data: ["devMac", "devLastIP", "devName", "devOwner", "devType", "devVendor", "devGroup", "devIcon", "devLocation", "devComments"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_MANAGEMENT.md",
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",
inputClasses: "col-sm-8 col-xs-12 input-group"
},
@@ -88,7 +88,7 @@
data: ["devStatus", "devLastConnection", "devFirstConnection"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/SESSION_INFO.md",
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",
inputClasses: "col-sm-8 col-xs-12 input-group"
},
@@ -97,7 +97,7 @@
data: ["devAlertEvents", "devAlertDown", "devSkipRepeated"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
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",
inputClasses: "col-sm-8 col-xs-12 input-group"
},
@@ -106,7 +106,7 @@
data: ["devParentMAC", "devParentPort", "devSSID", "devSite", "devSyncHubNode"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md",
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",
inputClasses: "col-sm-8 col-xs-12 input-group"
},
@@ -115,7 +115,7 @@
data: ["devStaticIP", "devIsNew", "devFavorite", "devIsArchived"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_DISPLAY_SETTINGS.md",
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",
inputClasses: "col-sm-8 col-xs-12 input-group"
},
@@ -124,7 +124,7 @@
data: ["devCustomProps"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/CUSTOM_PROPERTIES.md",
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",
inputClasses: "col-sm-12 col-xs-12 input-group"
}

0
front/php/templates/language/fr_fr.json Normal file → Executable file
View File

0
front/php/templates/language/uk_ua.json Normal file → Executable file
View File

View File

@@ -27,9 +27,7 @@ Logger(get_setting_value('LOG_LEVEL'))
pluginName = "PUSHOVER"
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():

View File

@@ -2,6 +2,7 @@
# Based on the work of https://github.com/leiweibau/Pi.Alert
import subprocess
import os
from datetime import datetime
import sys
@@ -15,6 +16,8 @@ from logger import mylog, Logger
from helper import timeNowTZ, get_setting_value
import conf
from pytz import timezone
from const import logPath
# Make sure the TIMEZONE for logging is correct
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
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():
mylog('verbose', ['[DHCPSRVS] In script'])
RESULT_FILE = 'last_result.log'
last_run_logfile = open(RESULT_FILE, 'a')
last_run_logfile.write("")

View File

@@ -75,7 +75,6 @@ def main():
foreignKey = entry.mac
)
# generate last_result.log file
plugin_objects.write_result_file()
#-------------------------------------------------------------------------------

View File

@@ -368,10 +368,16 @@ function getObjectData(prefix, colDefinitions, pluginObj) {
}
function getHistoryData(prefix, colDefinitions, pluginObj) {
// Extract history data for the plugin, limiting to the first 50 entries for performance
return pluginHistory
.filter((history, index) => history.Plugin === prefix && index < 50) // Filter history for the specific plugin
.map(object => colDefinitions.map(colDef => getFormControl(colDef, object[colDef.column], object["Index"], colDefinitions, object)));
.filter(history => history.Plugin === prefix) // First, filter based on the plugin prefix
.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) {

View File

@@ -151,9 +151,9 @@ class api_endpoint_class:
execution_log.finalize_event("update_api")
self.is_ad_hoc_user_event = False
else:
# Debugging if write is skipped
mylog('trace', [f'[API] api_endpoint_class: Skipping write for {self.fileName}, debounce time not passed.'])
# else:
# # Debugging if write is skipped
# mylog('trace', [f'[API] api_endpoint_class: Skipping write for {self.fileName}, debounce time not passed.'])

View File

@@ -11,13 +11,15 @@ from collections import namedtuple
# Register NetAlertX modules
import conf
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 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 notification import Notification_obj, write_notification
from execution_log import ExecutionLog
# Make sure log level is initialized correctly
Logger(get_setting_value('LOG_LEVEL'))
#-------------------------------------------------------------------------------
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
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} '])
@@ -454,14 +456,13 @@ def execute_plugin(db, all_plugins, plugin, pluginsState = plugins_state() ):
else:
mylog('none', ['[Plugins] Skipped invalid sql result'])
# check if the subprocess / SQL query failed / there was no valid output
if len(sqlParams) == 0:
mylog('none', [f'[Plugins] No output received from the plugin "{plugin["unique_prefix"]}"'])
return pluginsState
else:
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
if len(sqlParams) > 0:
@@ -606,7 +607,6 @@ def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
# combine all DB insert and update events into one for history
history_to_insert.append(values)
mylog('debug', ['[Plugins] pluginEvents count: ', len(pluginEvents)])
mylog('debug', ['[Plugins] pluginObjects count: ', len(pluginObjects)])
@@ -615,6 +615,10 @@ def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
mylog('debug', ['[Plugins] objects_to_insert count: ', len(objects_to_insert)])
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('pluginObjects', pluginObjects)