mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-27 16:09:58 -07:00
wip
This commit is contained in:
40
bin/web/src/lib/components/AnalysisStatus.svelte
Normal file
40
bin/web/src/lib/components/AnalysisStatus.svelte
Normal file
@@ -0,0 +1,40 @@
|
||||
<script lang="ts">
|
||||
import { AnalysisStatus } from "$lib/analysisManager";
|
||||
import { EventType } from "$lib/analysis";
|
||||
import type { ManifestEntry } from "$lib/manifest";
|
||||
let { entry }: {
|
||||
entry: ManifestEntry,
|
||||
} = $props();
|
||||
|
||||
let summary = $state('Loading...');
|
||||
if (entry.analysis_status === AnalysisStatus.Queued) {
|
||||
summary = 'Queued...';
|
||||
} else if (entry.analysis_status === AnalysisStatus.Running) {
|
||||
summary = 'Running...';
|
||||
} else if (entry.analysis_status === AnalysisStatus.Finished) {
|
||||
if (entry.analysis_report === undefined) {
|
||||
summary = 'Loading...';
|
||||
} else if (typeof(entry.analysis_report) === 'string') {
|
||||
summary = entry.analysis_report;
|
||||
} else {
|
||||
let num_warnings = 0;
|
||||
for (let row of entry.analysis_report.rows) {
|
||||
for (let analysis of row.analysis) {
|
||||
for (let event of analysis.events) {
|
||||
if (event.type === EventType.Warning) {
|
||||
num_warnings += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
summary = `${num_warnings} warnings`;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<p>
|
||||
{summary}
|
||||
</p>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { ManifestEntry } from "$lib/manifest";
|
||||
import DownloadLink from '$lib/components/DownloadLink.svelte';
|
||||
import AnalysisStatus from "./AnalysisStatus.svelte";
|
||||
let { entry, current }: {
|
||||
entry: ManifestEntry;
|
||||
current: boolean;
|
||||
@@ -16,7 +17,7 @@
|
||||
<td>{entry.qmdl_size_bytes}</td>
|
||||
<td><DownloadLink url={entry.getPcapUrl()} text="pcap" /></td>
|
||||
<td><DownloadLink url={entry.getQmdlUrl()} text="qmdl" /></td>
|
||||
<td>N/A</td>
|
||||
<td><AnalysisStatus entry={entry} /></td>
|
||||
</tr>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user