fix: 任务写清进度,设置和采集更好填
This commit is contained in:
@@ -1,17 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { NButton, NInputNumber, NRadio, NRadioGroup } from "naive-ui";
|
||||
import { NButton, NIcon, NInputNumber, NRadio, NRadioGroup, NTooltip, useDialog } from "naive-ui";
|
||||
import { HelpCircleOutline } from "@vicons/ionicons5";
|
||||
import Shell from "../../shell/Shell.vue";
|
||||
import { api } from "../../shared/http";
|
||||
import { useToast } from "../../shared/toast";
|
||||
|
||||
const toast = useToast();
|
||||
const dialog = useDialog();
|
||||
const mode = ref("local");
|
||||
const seconds = ref(300);
|
||||
const concurrency = ref(4);
|
||||
const saving = ref(false);
|
||||
const loaded = ref(false);
|
||||
|
||||
function askMode(next: string) {
|
||||
if (next === mode.value) return;
|
||||
const toPlatform = next === "nqi";
|
||||
dialog.warning({
|
||||
title: "更换登录方式",
|
||||
content: toPlatform
|
||||
? "换成大数据平台账号后,登录页会显示图形验证码,登录失败会换一张。管理员仍只校验本系统密码。"
|
||||
: "换成自有账号后,登录页不再显示验证码。",
|
||||
positiveText: "更换",
|
||||
negativeText: "取消",
|
||||
onPositiveClick: () => { mode.value = next; },
|
||||
});
|
||||
}
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const result = await api<{ loginMode: string; credentialRefreshSeconds: number; workerConcurrency: number }>("/api/admin/settings");
|
||||
@@ -55,21 +71,21 @@ onMounted(load);
|
||||
<p v-if="!loaded" class="admin-status">正在获取</p>
|
||||
<div v-else class="settings-fields">
|
||||
<div class="form-row">
|
||||
<label for="login-mode">方式</label>
|
||||
<n-radio-group id="login-mode" v-model:value="mode">
|
||||
<label for="login-mode">登录方式<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>自有账号登录不显示验证码。大数据平台登录会显示图形验证码,失败后换一张。管理员始终只校验本系统密码。</n-tooltip></label>
|
||||
<n-radio-group id="login-mode" :value="mode" @update:value="askMode">
|
||||
<n-radio value="local">自有账号</n-radio>
|
||||
<n-radio value="nqi">大数据平台账号</n-radio>
|
||||
</n-radio-group>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="refresh-seconds">刷新间隔</label>
|
||||
<label for="refresh-seconds">凭证刷新间隔<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>账号池里的平台凭证按这个间隔刷新。</n-tooltip></label>
|
||||
<div class="setting-control">
|
||||
<n-input-number id="refresh-seconds" v-model:value="seconds" button-placement="both" :min="60" :max="86400" :precision="0" />
|
||||
<span class="setting-unit">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="worker-concurrency">并行数量</label>
|
||||
<label for="worker-concurrency">同时运行的任务数<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>采集和导出共用。调大后马上多领任务。调小后不打断正在运行的任务。</n-tooltip></label>
|
||||
<div class="setting-control">
|
||||
<n-input-number id="worker-concurrency" v-model:value="concurrency" button-placement="both" :min="1" :max="32" :precision="0" />
|
||||
<span class="setting-unit">个</span>
|
||||
|
||||
Reference in New Issue
Block a user