This commit is contained in:
Jokob-sk
2024-02-12 23:13:31 +11:00
parent 42594c0602
commit e99d26b044
2 changed files with 48 additions and 27 deletions

View File

@@ -357,35 +357,20 @@ function filterDataByStatus(data, status) {
return data.filter(function(item) {
switch (status) {
case 'my':
to_display = getSetting('UI_MY_DEVICES')
console.log(to_display)
result = false;
if (to_display.includes('online') && item.dev_PresentLastScan === 1)
{
result = true;
}
to_display = getSetting('UI_MY_DEVICES');
if (to_display.includes('offline') && item.dev_PresentLastScan === 0)
{
result = true;
}
let result = false;
if (to_display.includes('archived') && item.dev_Archived === 1)
{
result = true;
}
if (to_display.includes('new') && item.dev_NewDevice === 1)
{
result = true;
}
if (to_display.includes('down') && item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown !== 0)
{
result = true;
if (to_display.includes('online') && item.dev_PresentLastScan === 1) {
result = true;
} else if (to_display.includes('offline') && item.dev_PresentLastScan === 0) {
result = true;
} else if (to_display.includes('archived') && item.dev_Archived === 1) {
result = true;
} else if (to_display.includes('new') && item.dev_NewDevice === 1) {
result = true;
} else if (to_display.includes('down') && item.dev_PresentLastScan === 0 && item.dev_AlertDeviceDown !== 0) {
result = true;
}
return result; // Include all items for 'my' status