diff --git a/front/css/pialert.css b/front/css/pialert.css index 2d62d69f2..1268b6b7d 100755 --- a/front/css/pialert.css +++ b/front/css/pialert.css @@ -903,8 +903,7 @@ input[readonly] { { display: block; position: absolute; - margin-left: 170px; - top: 5px; + margin-left: 170px; font-size: large; left: -15px; } diff --git a/front/network.php b/front/network.php index 62080327b..59455c469 100755 --- a/front/network.php +++ b/front/network.php @@ -597,18 +597,19 @@ function attachTreeEvents() } // --------------------------------------------------------------------------- + // Handle network node click - select correct tab in teh bottom table function handleNodeClick(event) { - - console.log(event.target.offsetParent) - - const targetTabMAC = $(event.target.offsetParent).attr("data-mytreemacmain"); + console.log(event.target.offsetParent.offsetParent) + + const targetTabMAC = $(event.target.offsetParent.offsetParent).attr("data-mytreemacmain"); var targetTab = $(`a[data-mytabmac="${targetTabMAC}"]`); // Simulate a click event on the target tab targetTab.click(); } + // --------------------------------------------------------------------------- var myTree; var treeAreaHeight = 800; @@ -637,16 +638,37 @@ function initTree(myHierarchy) (port == "" || port == 0 ) ? portBckgIcon = `` : portBckgIcon = ``; - // Build HTML for individual nodes in the network diagram - deviceIcon = (!emptyArr.includes(nodeData.data.icon )) ? `
` : ""; - devicePort = `
${port}
${portBckgIcon}
`; - collapseExpandIcon = nodeData.data.hiddenChildren ? "square-plus" : "square-minus"; - collapseExpandHtml = nodeData.data.hasChildren ? `
` : ""; - statusCss = ` netStatus-${nodeData.data.status}`; + // Build HTML for individual nodes in the network diagram + deviceIcon = (!emptyArr.includes(nodeData.data.icon )) ? + `
+ +
` : ""; + devicePort = `
+ ${port}
+
+ ${portBckgIcon} +
`; + collapseExpandIcon = nodeData.data.hiddenChildren ? + "square-plus" : "square-minus"; + + // generate +/- icon if node has children nodes + collapseExpandHtml = nodeData.data.hasChildren ? + `
+ +
` : ""; selectedNodeMac = $(".nav-tabs-custom .active a").attr('data-mytabmac') - highlightedCss = nodeData.data.mac == selectedNodeMac ? " highlightedNode" : ""; + highlightedCss = nodeData.data.mac == selectedNodeMac ? + " highlightedNode" : ""; + + // css indicating online/offline status + statusCss = ` netStatus-${nodeData.data.status}`; return result = `
error log if you envounter issues).

Execution queue:", + "general_event_description" : " The event you nove triggered might take a while until background processes finish. The execution ended once the below execution queue empties (Check the error log if you encounter issues).

Execution queue:", "Plugins_Unprocessed_Events" : "Unprocessed Events", "Plugins_Objects" : "Plugin Objects", "Plugins_DeleteAll" : "Delete all (filters are ignored)", diff --git a/front/plugins/db_cleanup/script.py b/front/plugins/db_cleanup/script.py index 57125b03b..6fb1fa403 100755 --- a/front/plugins/db_cleanup/script.py +++ b/front/plugins/db_cleanup/script.py @@ -17,7 +17,7 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64 from logger import mylog, append_line_to_file -from helper import timeNowTZ +from helper import timeNowTZ, get_setting_value from const import logPath, pialertPath @@ -92,8 +92,12 @@ def cleanup_database (dbPath, DAYS_TO_KEEP_EVENTS, PHOLUS_DAYS_DATA, HRS_TO_KEEP cursor.execute(delete_query) + # Trim Notifications entries to less than DBCLNP_NOTIFI_HIST setting - mylog('verbose', [f'[DBCLNP] Plugins_History: Trim Notifications entries to less than {str(get_setting_value('DBCLNP_NOTIFI_HIST'))} )']) + + histCount = get_setting_value('DBCLNP_NOTIFI_HIST') + + mylog('verbose', [f'[DBCLNP] Plugins_History: Trim Notifications entries to less than {histCount}']) # Build the SQL query to delete entries delete_query = f"""DELETE FROM Notifications @@ -104,7 +108,7 @@ def cleanup_database (dbPath, DAYS_TO_KEEP_EVENTS, PHOLUS_DAYS_DATA, HRS_TO_KEEP ROW_NUMBER() OVER(PARTITION BY "Notifications" ORDER BY DateTimeCreated DESC) AS row_num FROM Notifications ) AS ranked_objects - WHERE row_num <= {str(get_setting_value('DBCLNP_NOTIFI_HIST'))} + WHERE row_num <= {histCount} );""" cursor.execute(delete_query)