mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-31 07:12:23 -07:00
Merge branch 'main' of https://github.com/netalertx/NetAlertX
This commit is contained in:
@@ -17,10 +17,10 @@ function loadNetworkNodes() {
|
||||
const rawSql = `
|
||||
SELECT
|
||||
parent.devName AS node_name,
|
||||
parent.devMac AS node_mac,
|
||||
LOWER(parent.devMac) AS node_mac,
|
||||
parent.devPresentLastScan AS online,
|
||||
parent.devType AS node_type,
|
||||
parent.devParentMAC AS parent_mac,
|
||||
LOWER(parent.devParentMAC) AS parent_mac,
|
||||
parent.devIcon AS node_icon,
|
||||
parent.devAlertDown AS node_alert,
|
||||
COUNT(child.devMac) AS node_ports_count
|
||||
@@ -116,6 +116,7 @@ function loadDeviceTable({ sql, containerSelector, tableId, wrapperHtml = null,
|
||||
orderable: false,
|
||||
width: '5%',
|
||||
render: function (mac) {
|
||||
// mac = mac.toLowerCase()
|
||||
const label = assignMode ? 'assign' : 'unassign';
|
||||
const btnClass = assignMode ? 'btn-primary' : 'btn-primary bg-red';
|
||||
const btnText = assignMode ? getString('Network_ManageAssign') : getString('Network_ManageUnassign');
|
||||
@@ -204,7 +205,7 @@ function loadUnassignedDevices() {
|
||||
SELECT devMac, devPresentLastScan, devName, devLastIP, devVendor, devAlertDown, devParentPort
|
||||
FROM Devices
|
||||
WHERE (devParentMAC IS NULL OR devParentMAC IN ("", " ", "undefined", "null"))
|
||||
AND devMac NOT LIKE "%internet%"
|
||||
AND LOWER(devMac) NOT LIKE "%internet%"
|
||||
AND devIsArchived = 0
|
||||
ORDER BY devName ASC`;
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@ function initNetworkTopology() {
|
||||
// Always get all devices
|
||||
const rawSql = `
|
||||
SELECT *,
|
||||
LOWER(devMac) AS devMac,
|
||||
LOWER(devParentMAC) AS devParentMAC,
|
||||
CASE
|
||||
WHEN devAlertDown != 0 AND devPresentLastScan = 0 THEN "Down"
|
||||
WHEN devPresentLastScan = 1 THEN "On-line"
|
||||
ELSE "Off-line"
|
||||
WHEN devAlertDown != 0 AND devPresentLastScan = 0 THEN 'Down'
|
||||
WHEN devPresentLastScan = 1 THEN 'On-line'
|
||||
ELSE 'Off-line'
|
||||
END AS devStatus,
|
||||
CASE
|
||||
WHEN devType IN (${networkDeviceTypes}) THEN 1
|
||||
@@ -33,6 +35,7 @@ function initNetworkTopology() {
|
||||
FROM Devices a
|
||||
`;
|
||||
|
||||
|
||||
const { token: apiToken, apiBase, authHeader } = getAuthContext();
|
||||
|
||||
// Verify token is available before making API call
|
||||
|
||||
@@ -49,7 +49,7 @@ function renderNetworkTabContent(nodes) {
|
||||
$('.tab-content').empty();
|
||||
|
||||
nodes.forEach((node, i) => {
|
||||
const id = node.node_mac.replace(/:/g, '_');
|
||||
const id = node.node_mac.replace(/:/g, '_').toLowerCase();
|
||||
|
||||
const badge = getStatusBadgeParts(
|
||||
node.online,
|
||||
|
||||
Reference in New Issue
Block a user