mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
better check for available device #1132
This commit is contained in:
@@ -784,7 +784,7 @@ function initSelect2() {
|
|||||||
function renderDeviceLink(data, container, useName = false) {
|
function renderDeviceLink(data, container, useName = false) {
|
||||||
// If no valid MAC, return placeholder text
|
// If no valid MAC, return placeholder text
|
||||||
if (!data.id || !isValidMac(data.id)) {
|
if (!data.id || !isValidMac(data.id)) {
|
||||||
return data.text;
|
return `<span>${data.text}<span/>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const device = getDevDataByMac(data.id);
|
const device = getDevDataByMac(data.id);
|
||||||
@@ -792,6 +792,13 @@ function renderDeviceLink(data, container, useName = false) {
|
|||||||
return data.text;
|
return data.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Build and return badge parts
|
||||||
|
const badge = getStatusBadgeParts(
|
||||||
|
device.devPresentLastScan,
|
||||||
|
device.devAlertDown,
|
||||||
|
device.devMac
|
||||||
|
);
|
||||||
|
|
||||||
// badge class and hover-info class to container
|
// badge class and hover-info class to container
|
||||||
$(container)
|
$(container)
|
||||||
.addClass(`${badge.cssClass} hover-node-info`)
|
.addClass(`${badge.cssClass} hover-node-info`)
|
||||||
|
|||||||
Reference in New Issue
Block a user