fix: 修正清单进度文字折行,默认最多翻 99 页

进度数字固定在进度条左侧,不再被挤出窗口。
This commit is contained in:
Nixevol
2026-10-24 23:16:08 +08:00
parent cea741eead
commit 7253217e18
4 changed files with 27 additions and 19 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ from server.services.dramabox.client import client
from server.services.dramabox.covers import covers
ROOT = Path(__file__).resolve().parents[3]
DEFAULT_MAX_PAGES = 300
DEFAULT_MAX_PAGES = 99
MAX_MAX_PAGES = 999
+3 -3
View File
@@ -422,9 +422,9 @@ def test_catalog_page_limit_defaults_and_clamps() -> None:
with tempfile.TemporaryDirectory() as tmp:
path = Path(tmp) / "catalog-settings.json"
with patch.object(cat, "settings_path", lambda: path), patch.object(cat, "_drop_catalog_cache"):
assert cat.page_limit() == 300
assert cat.set_page_limit(0) == 300
assert cat.set_page_limit(-8) == 300
assert cat.page_limit() == 99
assert cat.set_page_limit(0) == 99
assert cat.set_page_limit(-8) == 99
assert cat.set_page_limit(12) == 12
assert cat.page_limit() == 12
assert cat.set_page_limit(5000) == 999
+3 -3
View File
@@ -164,7 +164,7 @@ const downloadRef = ref<{
loadDirectory: () => Promise<void>;
} | null>(null);
const catalogQuery = ref("");
const catalogMaxPages = ref(300);
const catalogMaxPages = ref(99);
let catalogPagesTimer: number | null = null;
const mainMenu = computed(() => [
{ label: "视频清单", key: "download" },
@@ -402,7 +402,7 @@ function normalizeWorkers(value: unknown) {
function normalizeCatalogPages(value: unknown) {
const count = Number(value);
if (!Number.isInteger(count) || count < 1) return 300;
if (!Number.isInteger(count) || count < 1) return 99;
return Math.min(count, 999);
}
@@ -414,7 +414,7 @@ async function loadCatalogSettings() {
const payload = await response.json();
catalogMaxPages.value = normalizeCatalogPages(payload.max_pages);
} catch {
catalogMaxPages.value = 300;
catalogMaxPages.value = 99;
}
}
+20 -12
View File
@@ -732,15 +732,16 @@ async function startDownload() {
<template>
<div class="download-page">
<div v-if="showProgress" class="load-strip">
<n-progress
class="load-strip-bar"
type="line"
:percentage="progress"
:show-indicator="false"
:processing="busy || coverPending"
:height="8"
/>
<n-text class="load-strip-text" depth="3">{{ progressText }}</n-text>
<n-text class="load-strip-text">{{ progressText }}</n-text>
<div class="load-strip-bar">
<n-progress
type="line"
:percentage="progress"
:show-indicator="false"
:processing="busy || coverPending"
:height="8"
/>
</div>
<n-tooltip v-if="busy">
<template #trigger>
<n-button size="small" secondary @click="stopLoad">停止</n-button>
@@ -856,19 +857,26 @@ async function startDownload() {
</template>
<style>
.download-page { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.download-page { width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.load-strip {
flex: none;
display: flex;
align-items: center;
gap: 12px;
min-width: 0;
min-height: 44px;
padding: 8px 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
background: #18181c;
box-sizing: border-box;
}
.load-strip-bar { width: 180px; flex: none; }
.load-strip-text { flex: 1; min-width: 0; }
.load-strip-text {
flex: none;
white-space: nowrap;
line-height: 22px;
}
.load-strip-bar { flex: 1; min-width: 0; }
.load-strip-bar .n-progress { width: 100%; }
.download-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.download-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; }
.download-foot {