mirror of
https://github.com/bastienwirtz/homer.git
synced 2026-05-06 17:56:53 +02:00
Scrutiny - show only device not archived and not deleted
This commit is contained in:
committed by
Bastien Wirtz
parent
98f446fd85
commit
ccc64cb7db
@@ -50,17 +50,22 @@ export default {
|
||||
fetchSummary: function () {
|
||||
this.fetch(`/api/summary`)
|
||||
.then((scrutinyData) => {
|
||||
const devices = Object.values(scrutinyData.data.summary);
|
||||
const devices = Object.values(scrutinyData.data.summary);
|
||||
const availableDevices = devices.filter(
|
||||
(device) =>
|
||||
device.device.archived === false &&
|
||||
!device.device.DeletedAt
|
||||
);
|
||||
this.passed =
|
||||
devices.filter((device) => device.device.device_status === 0)
|
||||
?.length || 0;
|
||||
availableDevices.filter(
|
||||
(device) =>
|
||||
device.device.device_status === 0)?.length || 0;
|
||||
this.failed =
|
||||
devices.filter(
|
||||
availableDevices.filter(
|
||||
(device) =>
|
||||
device.device.device_status > 0 &&
|
||||
device.device.device_status <= 3,
|
||||
)?.length || 0;
|
||||
this.unknown = devices.length - (this.passed + this.failed) || 0;
|
||||
device.device.device_status <= 3)?.length || 0;
|
||||
this.unknown = availableDevices.length - (this.passed + this.failed) || 0;
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
|
||||
Reference in New Issue
Block a user