feat: 用安装页和编排完成部署,并整理登录页
This commit is contained in:
@@ -3,7 +3,7 @@ import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { NAlert, NButton, NInput } from "naive-ui";
|
||||
import { api, saveSession } from "../../shared/http";
|
||||
import { setThemeChoice, themeChoice, type ThemeChoice } from "../../shared/theme";
|
||||
import ThemeButton from "../../shell/ThemeButton.vue";
|
||||
|
||||
const props = defineProps<{ purpose?: "login" | "pool" }>();
|
||||
const emit = defineEmits<{ done: [] }>();
|
||||
@@ -18,11 +18,6 @@ const smsCode = ref("");
|
||||
const smsRequired = ref(false);
|
||||
const errorText = ref("");
|
||||
const busy = ref(false);
|
||||
const themes = [
|
||||
{ label: "跟随系统", value: "system" },
|
||||
{ label: "深色", value: "dark" },
|
||||
{ label: "浅色", value: "light" },
|
||||
];
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.purpose === "pool") {
|
||||
@@ -132,23 +127,16 @@ async function finishNqi() {
|
||||
busy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function chooseTheme(value: ThemeChoice) {
|
||||
setThemeChoice(value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="purpose === 'pool' ? '' : 'gate'">
|
||||
<div class="gate-card">
|
||||
<h1 style="margin: 0 0 16px; font-size: 20px; display: flex; justify-content: space-between; align-items: center;">
|
||||
<span>{{ purpose === "pool" ? "添加账号" : "DecomEval" }}</span>
|
||||
<select v-if="purpose !== 'pool'" :value="themeChoice" @change="chooseTheme(($event.target as HTMLSelectElement).value as ThemeChoice)">
|
||||
<option value="system">跟随系统</option>
|
||||
<option value="dark">深色</option>
|
||||
<option value="light">浅色</option>
|
||||
</select>
|
||||
</h1>
|
||||
<ThemeButton v-if="purpose !== 'pool'" />
|
||||
<section class="gate-card">
|
||||
<div class="gate-brand">
|
||||
<div class="brand-mark" aria-hidden="true">D</div>
|
||||
<h1>{{ purpose === "pool" ? "添加账号" : "DecomEval" }}</h1>
|
||||
</div>
|
||||
<n-alert v-if="errorText" type="error" style="margin-bottom: 12px">{{ errorText }}</n-alert>
|
||||
<div class="form-grid">
|
||||
<label>账号</label>
|
||||
@@ -175,6 +163,6 @@ function chooseTheme(value: ThemeChoice) {
|
||||
<n-button v-if="captchaUrl" type="primary" :loading="busy" @click="finishNqi">登录</n-button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user