P1: sidecar lifecycle and HTTP bridge
Backend - sidecar.rs supervises the bundled `mycelium` binary launched via pkexec; locates it in resource_dir or CARGO_MANIFEST_DIR/binaries matching $TAURI_ENV_TARGET_TRIPLE - ephemeral port via portpicker, key + config persisted in app_data_dir, kill_on_drop with explicit start_kill on stop - health-check loop calls /api/v1/admin until 2xx (timeout 20s); emits sidecar://ready and sidecar://exited - 500-line ring buffer of stdout/stderr surfaced via sidecar_logs command for the upcoming Settings page - elevation::is_auth_failure(126|127) maps pkexec cancel to a dedicated AppError variant - AppError uses thiserror, Serialize impl renders messages as plain strings for the JS side Frontend - typed `api` wrapper around invoke() in src/lib/api.ts - node store (Pinia) bootstraps on mount, listens on sidecar://ready and sidecar://exited - StartupOverlay covers the whole window for idle/starting/error phases; sidebar status dot + start/stop button - Status view renders subnet, pubkey, api endpoint and key path with one-click clipboard copy
This commit is contained in:
32
src/components/InfoCard.vue
Normal file
32
src/components/InfoCard.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import { Copy, Check } from "lucide-vue-next";
|
||||
|
||||
defineProps<{
|
||||
label: string;
|
||||
value: string;
|
||||
copied?: boolean;
|
||||
}>();
|
||||
|
||||
defineEmits<{ (e: "copy"): void }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="flex items-start justify-between gap-4 rounded-lg border border-border bg-card p-4"
|
||||
>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="text-xs uppercase tracking-wide text-muted-foreground">
|
||||
{{ label }}
|
||||
</div>
|
||||
<div class="mt-1 break-all font-mono text-sm">{{ value }}</div>
|
||||
</div>
|
||||
<button
|
||||
class="shrink-0 rounded-md border border-border p-2 hover:bg-secondary"
|
||||
:title="copied ? 'Copied' : 'Copy'"
|
||||
@click="$emit('copy')"
|
||||
>
|
||||
<Check v-if="copied" class="h-4 w-4 text-emerald-500" />
|
||||
<Copy v-else class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user