diff --git a/bin/web/src/lib/components/AnalysisStatus.svelte b/bin/web/src/lib/components/AnalysisStatus.svelte index b318ba6..86ea7d0 100644 --- a/bin/web/src/lib/components/AnalysisStatus.svelte +++ b/bin/web/src/lib/components/AnalysisStatus.svelte @@ -2,13 +2,12 @@ import { AnalysisStatus } from "$lib/analysisManager.svelte"; import { EventType } from "$lib/analysis.svelte"; import type { ManifestEntry } from "$lib/manifest.svelte"; - let { entry, analysis_status }: { + let { entry }: { entry: ManifestEntry, - analysis_status: AnalysisStatus | undefined, } = $props(); let summary = $derived.by(() => { - if (analysis_status === AnalysisStatus.Queued) { + if (entry.analysis_status === AnalysisStatus.Queued) { return 'Queued...'; } else if (entry.analysis_status === AnalysisStatus.Running) { return 'Running...'; diff --git a/bin/web/src/lib/components/ControlBar.svelte b/bin/web/src/lib/components/ControlBar.svelte new file mode 100644 index 0000000..a920c98 --- /dev/null +++ b/bin/web/src/lib/components/ControlBar.svelte @@ -0,0 +1,23 @@ + + +
+ + +
diff --git a/bin/web/src/lib/components/DeleteButton.svelte b/bin/web/src/lib/components/DeleteButton.svelte new file mode 100644 index 0000000..af08e16 --- /dev/null +++ b/bin/web/src/lib/components/DeleteButton.svelte @@ -0,0 +1,28 @@ + + + diff --git a/bin/web/src/lib/components/DownloadLink.svelte b/bin/web/src/lib/components/DownloadLink.svelte index 00ce5ef..0a1fc79 100644 --- a/bin/web/src/lib/components/DownloadLink.svelte +++ b/bin/web/src/lib/components/DownloadLink.svelte @@ -3,12 +3,14 @@ url: string; text: string; } = $props(); + + function download() { + window.location.href = url; + } -📥 {text} - - + diff --git a/bin/web/src/lib/components/ManifestTable.svelte b/bin/web/src/lib/components/ManifestTable.svelte index f266738..9377942 100644 --- a/bin/web/src/lib/components/ManifestTable.svelte +++ b/bin/web/src/lib/components/ManifestTable.svelte @@ -10,7 +10,7 @@ - + @@ -18,6 +18,7 @@ + diff --git a/bin/web/src/lib/components/ManifestTableRow.svelte b/bin/web/src/lib/components/ManifestTableRow.svelte index e682909..f306199 100644 --- a/bin/web/src/lib/components/ManifestTableRow.svelte +++ b/bin/web/src/lib/components/ManifestTableRow.svelte @@ -1,23 +1,37 @@ - - - + + + - + + {#if current} + + {:else} + + {/if} diff --git a/bin/web/src/lib/components/RecordingControls.svelte b/bin/web/src/lib/components/RecordingControls.svelte index 0c45168..0522264 100644 --- a/bin/web/src/lib/components/RecordingControls.svelte +++ b/bin/web/src/lib/components/RecordingControls.svelte @@ -1,11 +1,11 @@
{#if waiting_for_server} - - {:else if currently_recording} + {:else if server_is_recording} {:else} diff --git a/bin/web/src/lib/components/SystemStatsTable.svelte b/bin/web/src/lib/components/SystemStatsTable.svelte new file mode 100644 index 0000000..8265b9a --- /dev/null +++ b/bin/web/src/lib/components/SystemStatsTable.svelte @@ -0,0 +1,31 @@ + + +
+

System Stats

+
Name Date Started Date of Last MessagePCAP QMDL Analysis ResultDelete
{entry.name}{entry.start_time}{entry.last_message_time}{entry.name}{date_formatter.format(entry.start_time)}{date_formatter.format(entry.last_message_time)} {entry.qmdl_size_bytes} + +
+ + + + + + + + + + +
+ Storage + + {stats.disk_stats.used_percent} used ({stats.disk_stats.used_size} / {stats.disk_stats.available_size}) +
+ Memory (RAM) + + Free: {stats.memory_stats.free}, Used: {stats.memory_stats.used} +
+ diff --git a/bin/web/src/lib/manifest.svelte.ts b/bin/web/src/lib/manifest.svelte.ts index 55d6c08..f8f0ea8 100644 --- a/bin/web/src/lib/manifest.svelte.ts +++ b/bin/web/src/lib/manifest.svelte.ts @@ -80,4 +80,8 @@ export class ManifestEntry { getAnalysisReportUrl(): string { return `/api/analysis-report/${this.name}`; } + + getDeleteUrl(): string { + return `/api/delete-recording/${this.name}`; + } } diff --git a/bin/web/src/routes/+page.svelte b/bin/web/src/routes/+page.svelte index b34acf3..f4da74a 100644 --- a/bin/web/src/routes/+page.svelte +++ b/bin/web/src/routes/+page.svelte @@ -2,11 +2,10 @@ import { Manifest, ManifestEntry } from "$lib/manifest.svelte"; import { get_manifest, get_system_stats } from "$lib/utils.svelte"; import ManifestTable from "$lib/components/ManifestTable.svelte"; - import { onMount } from "svelte"; import type { SystemStats } from "$lib/systemStats"; import { AnalysisManager } from "$lib/analysisManager.svelte"; - import { writable, readable, type Readable, type Writable } from "svelte/store"; - import RecordingControls from "$lib/components/RecordingControls.svelte"; + import SystemStatsTable from "$lib/components/SystemStatsTable.svelte"; + import ControlBar from "$lib/components/ControlBar.svelte"; let manager: AnalysisManager = new AnalysisManager(); let loaded = $state(false); @@ -16,7 +15,6 @@ let system_stats: SystemStats | undefined = $state(undefined); $effect(() => { const interval = setInterval(async () => { - loaded = true; await manager.update(); let new_manifest = await get_manifest(); await new_manifest.set_analysis_status(manager); @@ -25,16 +23,18 @@ recording = current_entry !== undefined; system_stats = await get_system_stats(); + loaded = true; }, 3000); return () => clearInterval(interval); }) -
+
{#if loaded} - + + {:else}

Loading...

{/if} diff --git a/bin/web/src/routes/entry/[name]/+page.svelte b/bin/web/src/routes/entry/[name]/+page.svelte new file mode 100644 index 0000000..e69de29