fix: 线程说明收进提示并上移首页代理按钮

This commit is contained in:
2026-11-15 05:26:20 +08:00
parent 5acbea35fb
commit f9ccb7bfd6
4 changed files with 65 additions and 32 deletions
+34 -21
View File
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
import { NAlert, NButton, NForm, NFormItem, NIcon, NInput, NInputNumber, NModal, NProgress, NSelect, NTimePicker, NTooltip } from "naive-ui";
import { GlobeOutline, PlayOutline, RefreshOutline, StopOutline, WarningOutline } from "@vicons/ionicons5";
import { dayOptions, workerOptions } from "../../shared/studyFields";
import { GlobeOutline, HelpCircleOutline, PlayOutline, RefreshOutline, StopOutline, WarningOutline } from "@vicons/ionicons5";
import { dayOptions, workerHint, workerOptions } from "../../shared/studyFields";
interface HomeSummary {
name: string;
@@ -551,17 +551,23 @@ onUnmounted(() => {
<section class="panel-card study-card">
<header class="panel-card-head">
<h3>自动学习</h3>
<n-button
:type="studyControl.started ? 'error' : 'primary'"
size="small"
:loading="studyBusy"
@click="toggleStudy"
>
<template #icon>
<n-icon><StopOutline v-if="studyControl.started" /><PlayOutline v-else /></n-icon>
</template>
{{ studyControl.started ? "停止" : "立即开始" }}
</n-button>
<div class="study-head-actions">
<n-button v-if="proxyLoaded" size="small" quaternary @click="proxyOpen = true">
<template #icon><n-icon><GlobeOutline /></n-icon></template>
代理
</n-button>
<n-button
:type="studyControl.started ? 'error' : 'primary'"
size="small"
:loading="studyBusy"
@click="toggleStudy"
>
<template #icon>
<n-icon><StopOutline v-if="studyControl.started" /><PlayOutline v-else /></n-icon>
</template>
{{ studyControl.started ? "停止" : "立即开始" }}
</n-button>
</div>
</header>
<n-alert v-if="studyError" class="summary-error" type="error">{{ studyError }}</n-alert>
<n-form class="compact-nform" label-placement="left" label-align="left" :label-width="96" :show-feedback="false" size="small">
@@ -591,8 +597,21 @@ onUnmounted(() => {
<n-time-picker v-model:formatted-value="startTime" value-format="HH:mm:ss" size="small" :actions="null" />
</div>
</n-form-item>
<n-form-item v-if="workersLoaded" label="线程数量">
<n-select id="course-workers" v-model:value="courseWorkers" size="small" :options="workerOptions" />
<n-form-item v-if="workersLoaded">
<template #label>
<span class="field-title">
<span>线程数量</span>
<n-tooltip placement="top">
<template #trigger>
<button type="button" class="hint-icon" aria-label="说明">
<n-icon><HelpCircleOutline /></n-icon>
</button>
</template>
{{ workerHint }}
</n-tooltip>
</span>
</template>
<n-select id="course-workers" class="worker-select" v-model:value="courseWorkers" size="small" :options="workerOptions" />
</n-form-item>
</n-form>
<div class="home-study-status">
@@ -612,12 +631,6 @@ onUnmounted(() => {
</div>
</li>
</ul>
<div class="study-card-foot">
<n-button v-if="proxyLoaded" size="small" quaternary @click="proxyOpen = true">
<template #icon><n-icon><GlobeOutline /></n-icon></template>
代理
</n-button>
</div>
</section>
</div>
<n-modal