feat: 用安装页和编排完成部署,并整理登录页

This commit is contained in:
2026-10-30 09:49:20 +08:00
parent 7ed299bbf6
commit 3fa4f83180
30 changed files with 635 additions and 121 deletions
+2 -12
View File
@@ -1,8 +1,7 @@
<script setup lang="ts">
import { useRoute, useRouter } from "vue-router";
import { NSelect } from "naive-ui";
import { api, clearSession, token } from "../shared/http";
import { setThemeChoice, themeChoice, type ThemeChoice } from "../shared/theme";
import ThemeButton from "./ThemeButton.vue";
const route = useRoute();
const router = useRouter();
@@ -16,15 +15,6 @@ const items = role === "admin"
{ label: "采集", path: "/admin/sources" },
]
: [{ label: "任务", path: "/tasks" }];
const themes = [
{ label: "跟随系统", value: "system" },
{ label: "深色", value: "dark" },
{ label: "浅色", value: "light" },
];
function chooseTheme(value: ThemeChoice) {
setThemeChoice(value);
}
async function logout() {
if (token()) {
@@ -48,7 +38,7 @@ async function logout() {
</nav>
<div class="sider-foot">
<div class="who">{{ name }}</div>
<n-select :value="themeChoice" :options="themes" size="small" @update:value="chooseTheme" />
<ThemeButton />
<button class="text-button" @click="logout">退出</button>
</div>
</aside>
+31
View File
@@ -0,0 +1,31 @@
<script setup lang="ts">
import { NButton, NIcon, NTooltip } from "naive-ui";
import { cycleTheme, themeChoice } from "../shared/theme";
const label = { system: "跟随系统", dark: "深色", light: "浅色" } as const;
</script>
<template>
<n-tooltip>
<template #trigger>
<n-button class="theme-switch" quaternary circle :aria-label="label[themeChoice]" @click="cycleTheme">
<template #icon>
<n-icon>
<svg v-if="themeChoice === 'system'" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8">
<rect x="3" y="4" width="18" height="12" rx="1.5" />
<path d="M8 20h8M12 16v4" />
</svg>
<svg v-else-if="themeChoice === 'dark'" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8">
<path d="M16 3.2A8.5 8.5 0 1 0 20.8 14 7 7 0 0 1 16 3.2z" />
</svg>
<svg v-else viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8">
<circle cx="12" cy="12" r="4" />
<path d="M12 2.5v2.2M12 19.3v2.2M2.5 12h2.2M19.3 12h2.2M5 5l1.6 1.6M17.4 17.4 19 19M19 5l-1.6 1.6M6.6 17.4 5 19" />
</svg>
</n-icon>
</template>
</n-button>
</template>
{{ label[themeChoice] }}
</n-tooltip>
</template>