P0: scaffold Vite + Vue 3 + Tauri v2
- pnpm + TS + Tailwind 3 + Pinia + Vue Router with hash history - 6 placeholder views (Status, Peers, Routes, Messages, Topics, Settings) rendered via lucide-icon sidebar in App.vue - Tauri v2: shell, store, log, dialog plugins; bundle targets deb + appimage; sidecar wired via externalBin = binaries/mycelium - scripts/fetch-mycelium.sh pins v0.6.1, maps musl asset onto gnu target triple expected by Tauri bundler - CI: pnpm typecheck + cargo fmt/clippy/test
This commit is contained in:
61
src/App.vue
Normal file
61
src/App.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { RouterLink, RouterView, useRoute } from "vue-router";
|
||||
import {
|
||||
Activity,
|
||||
Users,
|
||||
Route as RouteIcon,
|
||||
MessageSquare,
|
||||
Hash,
|
||||
Settings as SettingsIcon,
|
||||
} from "lucide-vue-next";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const navItems = [
|
||||
{ to: "/status", label: "Status", icon: Activity },
|
||||
{ to: "/peers", label: "Peers", icon: Users },
|
||||
{ to: "/routes", label: "Routes", icon: RouteIcon },
|
||||
{ to: "/messages", label: "Messages", icon: MessageSquare },
|
||||
{ to: "/topics", label: "Topics", icon: Hash },
|
||||
{ to: "/settings", label: "Settings", icon: SettingsIcon },
|
||||
];
|
||||
|
||||
const currentTitle = computed(() => (route.meta?.title as string) ?? "Mycellium");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-screen w-screen overflow-hidden bg-background text-foreground">
|
||||
<aside
|
||||
class="flex w-56 shrink-0 flex-col border-r border-border bg-card"
|
||||
>
|
||||
<div class="flex h-14 items-center px-4 border-b border-border">
|
||||
<span class="font-semibold text-base">Mycellium</span>
|
||||
</div>
|
||||
<nav class="flex-1 overflow-y-auto px-2 py-3 space-y-1">
|
||||
<RouterLink
|
||||
v-for="item in navItems"
|
||||
:key="item.to"
|
||||
:to="item.to"
|
||||
class="flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors"
|
||||
active-class="bg-secondary text-secondary-foreground"
|
||||
exact-active-class="bg-secondary text-secondary-foreground"
|
||||
>
|
||||
<component :is="item.icon" class="h-4 w-4" />
|
||||
<span>{{ item.label }}</span>
|
||||
</RouterLink>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<main class="flex flex-1 flex-col overflow-hidden">
|
||||
<header
|
||||
class="flex h-14 items-center border-b border-border px-6 shrink-0"
|
||||
>
|
||||
<h1 class="text-lg font-semibold">{{ currentTitle }}</h1>
|
||||
</header>
|
||||
<div class="flex-1 overflow-y-auto p-6">
|
||||
<RouterView />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user