mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-01-06 13:58:23 -05:00
better check for available device #1132
This commit is contained in:
@@ -784,7 +784,7 @@ function initSelect2() {
|
||||
function renderDeviceLink(data, container, useName = false) {
|
||||
// If no valid MAC, return placeholder text
|
||||
if (!data.id || !isValidMac(data.id)) {
|
||||
return data.text;
|
||||
return `<span>${data.text}<span/>`;
|
||||
}
|
||||
|
||||
const device = getDevDataByMac(data.id);
|
||||
@@ -792,6 +792,13 @@ function renderDeviceLink(data, container, useName = false) {
|
||||
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
|
||||
$(container)
|
||||
.addClass(`${badge.cssClass} hover-node-info`)
|
||||
|
||||
Reference in New Issue
Block a user