fix: 修复日志页面自动滚动问题 (#382)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2025-07-09 23:34:50 +08:00
committed by GitHub
parent ce60838244
commit 74a45526f0
13 changed files with 43 additions and 35 deletions

View File

@@ -170,7 +170,7 @@
<SheetTitle class="text-lg">编辑状态</SheetTitle>
<SheetDescription class="text-muted-foreground space-y-1 text-sm">
<div>修改视频和分页的下载状态。可以将任务重置为未开始状态,或者标记为已完成。</div>
<div class="font-medium text-red-600">
<div class="font-medium text-rose-600">
⚠️ 已完成任务被重置为未开始,任务重新执行时会覆盖现存文件。
</div>
</SheetDescription>

View File

@@ -11,10 +11,11 @@
// 获取状态显示信息
function getStatusInfo(value: number) {
if (value === 7) return { label: '已完成', class: 'text-green-600', dotClass: 'bg-green-500' };
if (value === 7)
return { label: '已完成', class: 'text-emerald-600', dotClass: 'bg-emerald-600' };
if (value >= 1 && value <= 4)
return { label: `失败${value}次`, class: 'text-red-600', dotClass: 'bg-red-500' };
return { label: '未开始', class: 'text-yellow-600', dotClass: 'bg-yellow-500' };
return { label: `失败${value}次`, class: 'text-rose-600', dotClass: 'bg-rose-600' };
return { label: '未开始', class: 'text-yellow-600', dotClass: 'bg-yellow-600' };
}
$: statusInfo = getStatusInfo(currentStatus);
@@ -71,8 +72,8 @@
onclick={() => onStatusChange(7)}
{disabled}
class="h-7 min-w-[60px] cursor-pointer px-3 text-xs {currentStatus === 7
? 'border-green-600 bg-green-600 font-medium text-white hover:bg-green-700'
: 'hover:border-green-400 hover:bg-green-50 hover:text-green-700'}"
? 'border-emerald-600 bg-emerald-600 font-medium text-white hover:bg-emerald-700'
: 'hover:border-emerald-400 hover:bg-emerald-50 hover:text-emerald-700'}"
>
已完成
</Button>

View File

@@ -33,11 +33,11 @@
function getSegmentColor(status: number): string {
if (status === 7) {
return 'bg-emerald-500'; // 恢复更高对比度的绿色
return 'bg-emerald-500';
} else if (status === 0) {
return 'bg-slate-400'; // 恢复更清晰的灰色 - 未开始
return 'bg-yellow-500';
} else {
return 'bg-rose-500'; // 恢复更清晰的红色 - 失败
return 'bg-rose-500';
}
}
@@ -50,7 +50,7 @@
const failed = downloadStatus.filter((status) => status !== 7 && status !== 0).length;
if (completed === total) {
return { text: '完成', color: 'outline' }; // 更简洁的文案
return { text: '完成', color: 'outline' };
} else if (failed > 0) {
return { text: '失败', color: 'destructive' };
} else {
@@ -136,7 +136,7 @@
<div
class="h-1.5 w-full cursor-help rounded-full transition-all {getSegmentColor(
status
)} hover:opacity-80"
)}"
></div>
</Tooltip.Trigger>
<Tooltip.Content>