MalwareMultiScan/MalwareMultiScan.Ui/models/scan-result-entry-flattened.ts

32 lines
750 B
TypeScript
Raw Permalink Normal View History

import ScanResultEntry from '~/models/scan-result-entry';
import {ScanResultStatus} from '~/models/scan-result-status';
export default class ScanResultEntryFlattened implements ScanResultEntry {
readonly id: string;
readonly status: ScanResultStatus;
2020-10-27 21:40:34 +02:00
readonly duration: number;
readonly threats: string[];
constructor(id: string, status: ScanResultStatus, duration: number, threats: string[]) {
this.id = id;
this.status = status;
2020-10-27 21:40:34 +02:00
this.duration = duration;
this.threats = threats;
}
2020-10-27 21:40:34 +02:00
get completed()
{
return this.status != ScanResultStatus.Queued
}
get succeeded()
{
return this.status === ScanResultStatus.Succeeded;
}
2020-10-27 21:40:34 +02:00
get failed()
{
return this.status === ScanResultStatus.Failed;
}
}