9cb59d723e
Real bugs found by actually compiling the Tauri crate for the first time: - Cargo.toml declared a [lib] with no src/lib.rs (cargo refused to parse the manifest) — added the standard Tauri 2 main.rs/lib.rs split. - generate_context!() needs real icon files; icons/ only had a .gitkeep. Added placeholder PNG/ICO/ICNS icons. Also simplified: dropped the tray icon + menu (one more moving part not needed yet), and the telemetry store's exponential backoff is now a fixed 3s retry, matching the same simplification made to continuum-proxy's uplink client. Fixed two real TS bugs while typechecking apps/web for the first time (missing @types/node for nuxt.config.ts's process.env access, untyped useFetch call inferring 'never'). Verified: cargo check (desktop), vue-tsc --noEmit (web + ui packages) all clean.
43 lines
952 B
Vue
43 lines
952 B
Vue
<script setup lang="ts">
|
|
import { PrinterCard } from "@continuum/ui";
|
|
import { useTelemetryStore } from "~/stores/telemetry";
|
|
|
|
interface Printer {
|
|
id: string;
|
|
name: string;
|
|
model: string;
|
|
farmId: string;
|
|
}
|
|
|
|
const telemetry = useTelemetryStore();
|
|
const config = useRuntimeConfig();
|
|
|
|
const { data: printers } = await useFetch<Printer[]>(`${config.public.apiBase}/printers`, {
|
|
headers: useRequestHeaders(["cookie"]),
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="fleet">
|
|
<h1>Fleet overview</h1>
|
|
<div class="fleet__grid">
|
|
<PrinterCard
|
|
v-for="printer in printers ?? []"
|
|
:key="printer.id"
|
|
:printer="printer"
|
|
:live="telemetry.printers[printer.id]"
|
|
/>
|
|
</div>
|
|
<p v-if="!printers?.length">No printers registered yet.</p>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.fleet__grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
gap: 1rem;
|
|
margin-top: 1rem;
|
|
}
|
|
</style>
|