mirror of
https://github.com/bastienwirtz/homer.git
synced 2026-07-17 16:38:59 +00:00
Scrutiny - show only device not archived and not deleted
This commit is contained in:
parent
98f446fd85
commit
ccc64cb7db
1 changed files with 12 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue