Scrutiny - show only device not archived and not deleted

This commit is contained in:
Nicolas RIGNAULT
2026-01-21 22:24:26 +01:00
committed by Bastien Wirtz
parent 98f446fd85
commit ccc64cb7db

View File

@@ -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);