added documentation and polishing UI around GPS mode

This commit is contained in:
Carlos Guerra
2026-03-29 17:44:39 +02:00
committed by Will Greenberg
parent 66f0c2a336
commit 5451e23293
11 changed files with 68 additions and 59 deletions
@@ -70,6 +70,12 @@
>
</p>
{/if}
{#if entry.gps_mode !== undefined}
<p>
<b>GPS Mode:</b>
{entry.gps_mode === 0 ? 'Disabled' : entry.gps_mode === 1 ? 'Fixed coordinates' : 'API endpoint'}
</p>
{/if}
</div>
{#if metadata && metadata.analyzers}
<div>
@@ -86,6 +86,11 @@
{entry.stop_reason}
</div>
{/if}
{#if entry.gps_mode !== undefined}
<div class="text-sm text-gray-500">
GPS: {entry.gps_mode === 0 ? 'Disabled' : entry.gps_mode === 1 ? 'Fixed coordinates' : 'API endpoint'}
</div>
{/if}
<div class="flex flex-row justify-between lg:justify-end gap-1 mt-2 overflow-x-auto">
<DownloadLink url={entry.get_pcap_url()} text="pcap" full_button />
<DownloadLink url={entry.get_qmdl_url()} text="qmdl" full_button />
+5
View File
@@ -13,6 +13,7 @@ interface JsonManifestEntry {
qmdl_size_bytes: number;
stop_reason: string | null;
upload_time: string | null;
gps_mode: number | null;
}
export class Manifest {
@@ -61,6 +62,7 @@ export class ManifestEntry {
public analysis_report: AnalysisReport | string | undefined = $state(undefined);
public stop_reason: string | undefined = $state(undefined);
public upload_time: Date | undefined = $state(undefined);
public gps_mode: number | undefined = $state(undefined);
constructor(json: JsonManifestEntry) {
this.name = json.name;
@@ -75,6 +77,9 @@ export class ManifestEntry {
if (json.upload_time) {
this.upload_time = new Date(json.upload_time);
}
if (json.gps_mode !== null) {
this.gps_mode = json.gps_mode;
}
}
get_readable_qmdl_size(): string {
+2 -1
View File
@@ -160,7 +160,8 @@ export async function get_daemon_time(): Promise<TimeResponse> {
export interface GpsData {
latitude: number;
longitude: number;
timestamp: string;
/** Unix timestamp in seconds (0 = fixed/no real time). */
timestamp: number;
}
export async function get_gps(): Promise<GpsData | null> {
+6 -1
View File
@@ -299,6 +299,7 @@
GPS Status
</span>
{#if gps_data}
{@const gps_date_formatter = new Intl.DateTimeFormat(undefined, { timeStyle: 'long', dateStyle: 'short' })}
<table class="w-full text-sm">
<tbody>
<tr class="border-b border-gray-100">
@@ -311,7 +312,11 @@
</tr>
<tr>
<td class="py-1 pr-4 text-gray-500 font-medium">GPS Timestamp</td>
<td class="py-1 font-mono">{gps_data.timestamp}</td>
<td class="py-1 font-mono">
{gps_data.timestamp > 0
? gps_date_formatter.format(new Date(gps_data.timestamp * 1000))
: 'Fixed'}
</td>
</tr>
</tbody>
</table>