fix: 调整登录居中、输入提示和标签图标
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<title>DecomEval</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<rect width="32" height="32" rx="7" fill="#1F6FEB"/>
|
||||
<path fill="#fff" d="M11 8.5h6.4c4.15 0 6.85 2.45 6.85 7.5s-2.7 7.5-6.85 7.5H11V8.5zm3.05 2.55v10h3.25c2.55 0 4-1.7 4-5s-1.45-5-4-5h-3.25z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 267 B |
+13
-2
@@ -1,9 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from "vue";
|
||||
import { darkTheme, dateZhCN, NConfigProvider, NDialogProvider, NMessageProvider, zhCN } from "naive-ui";
|
||||
import { createLocale, darkTheme, dateZhCN, NConfigProvider, NDialogProvider, NMessageProvider, zhCN } from "naive-ui";
|
||||
import type { GlobalThemeOverrides } from "naive-ui";
|
||||
import { isDark } from "./shared/theme";
|
||||
|
||||
const locale = createLocale({
|
||||
Input: { placeholder: "" },
|
||||
InputNumber: { placeholder: "" },
|
||||
Select: { placeholder: "" },
|
||||
DatePicker: {
|
||||
datePlaceholder: "",
|
||||
datetimePlaceholder: "",
|
||||
selectDate: "",
|
||||
},
|
||||
}, zhCN);
|
||||
|
||||
const palette = computed(() => isDark.value
|
||||
? { bg: "#0D1117", panel: "#161A22", ink: "#E6EDF3", muted: "#9AA4AE", line: "#262C36", accent: "#79C0FF", sidebar: "#0D1117", danger: "#F85149" }
|
||||
: { bg: "#F6F8FA", panel: "#FFFFFF", ink: "#0D1117", muted: "#57606A", line: "#D0D7DE", accent: "#0969DA", sidebar: "#FFFFFF", danger: "#CF222E" });
|
||||
@@ -88,7 +99,7 @@ const overrides = computed<GlobalThemeOverrides>(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-config-provider class="app-root" :locale="zhCN" :date-locale="dateZhCN" :theme="isDark ? darkTheme : null" :theme-overrides="overrides">
|
||||
<n-config-provider class="app-root" :locale="locale" :date-locale="dateZhCN" :theme="isDark ? darkTheme : null" :theme-overrides="overrides">
|
||||
<n-message-provider>
|
||||
<n-dialog-provider>
|
||||
<div class="app-root">
|
||||
|
||||
@@ -19,6 +19,7 @@ const captchaUrl = ref("");
|
||||
const captchaLoading = ref(false);
|
||||
const captchaBroken = ref(false);
|
||||
const captchaSrc = computed(() => captchaBroken.value || !captchaUrl.value ? "/__captcha_broken__" : captchaUrl.value);
|
||||
const accountPlaceholder = computed(() => mode.value === "nqi" ? "请输入大数据平台账号" : "请输入账号");
|
||||
|
||||
function markCaptchaBroken(event: Event) {
|
||||
const img = event.target as HTMLImageElement;
|
||||
@@ -247,7 +248,7 @@ async function finishNqi() {
|
||||
<div v-if="purpose !== 'pool'" class="lv-brand"><div class="lv-mark" aria-hidden="true">D</div><h1>DecomEval</h1></div>
|
||||
<form class="lv-fields" @submit.prevent="submitLogin">
|
||||
<label for="login-account">账号</label>
|
||||
<n-input :input-props="{ id: 'login-account', autocomplete: 'username' }" v-model:value="username" @keyup.enter="submitLogin" />
|
||||
<n-input :placeholder="accountPlaceholder" :input-props="{ id: 'login-account', autocomplete: 'username' }" v-model:value="username" @keyup.enter="submitLogin" />
|
||||
<label for="login-password">密码</label>
|
||||
<n-input :input-props="{ id: 'login-password', autocomplete: 'current-password' }" v-model:value="password" type="password" show-password-on="click" @keyup.enter="submitLogin" />
|
||||
<template v-if="mode === 'nqi'">
|
||||
@@ -264,7 +265,7 @@ async function finishNqi() {
|
||||
</form>
|
||||
</section>
|
||||
<n-modal v-model:show="smsRequired" class="app-dialog" :mask-closable="false" preset="card" title="短信认证">
|
||||
<n-input v-model:value="smsCode" placeholder="输入短信验证码" @keyup.enter="finishNqi" />
|
||||
<n-input v-model:value="smsCode" placeholder="请输入短信验证码" @keyup.enter="finishNqi" />
|
||||
<div class="sms-actions">
|
||||
<n-button @click="backFromSms">返回</n-button>
|
||||
<n-button :disabled="smsSending || countdown > 0" @click="sendSms">{{ countdown > 0 ? `重新发送(${countdown})` : "发送验证码" }}</n-button>
|
||||
|
||||
@@ -72,7 +72,7 @@ async function submit() {
|
||||
</div>
|
||||
<p class="form-section">数据库</p>
|
||||
<div class="form-row"><label>主机</label><n-input v-model:value="host" /></div>
|
||||
<div class="form-row"><label>端口</label><n-input v-model:value="port" :allow-input="allowPort" placeholder="5432" :input-props="{ inputmode: 'numeric', autocomplete: 'off' }" /></div>
|
||||
<div class="form-row"><label>端口</label><n-input v-model:value="port" :allow-input="allowPort" :input-props="{ inputmode: 'numeric', autocomplete: 'off' }" /></div>
|
||||
<div class="form-row"><label>数据库名</label><n-input v-model:value="database" /></div>
|
||||
<div class="form-row"><label>用户</label><n-input v-model:value="username" /></div>
|
||||
<div class="form-row"><label>密码</label><n-input v-model:value="password" type="password" show-password-on="click" /></div>
|
||||
|
||||
+7
-3
@@ -298,7 +298,7 @@ button, input, select { font: inherit; }
|
||||
.lv-side .lv-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
@@ -336,15 +336,19 @@ button, input, select { font: inherit; }
|
||||
.lv-side .n-button,
|
||||
.lv-embed .n-button { grid-column: 2; width: 100%; }
|
||||
.lv-side .lv-go,
|
||||
.lv-embed .lv-go,
|
||||
.gate-submit.n-button {
|
||||
.lv-embed .lv-go {
|
||||
grid-column: 1 / -1;
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
margin-top: 8px;
|
||||
font-weight: 600;
|
||||
justify-self: center;
|
||||
}
|
||||
.gate-submit.n-button {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
margin-top: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.lv-captcha { display: flex; gap: 8px; align-items: center; min-width: 0; }
|
||||
.lv-captcha .n-input { flex: 1; min-width: 0; }
|
||||
|
||||
Reference in New Issue
Block a user