switch to all zhcn

This commit is contained in:
Julian Freeman
2025-12-08 09:38:38 -04:00
parent f23b37a581
commit 52344892d5
5 changed files with 68 additions and 70 deletions

View File

@@ -1,4 +1,3 @@
// filepath: src/views/Logs.vue
<script setup lang="ts">
import { ref, computed, nextTick, watch, onMounted } from 'vue'
import { useLogsStore } from '../stores/logs'
@@ -65,8 +64,8 @@ function formatTime(ts: number) {
<!-- Header -->
<div class="flex justify-between items-center mb-6">
<div>
<h1 class="text-3xl font-bold text-zinc-900 dark:text-white">Execution Logs</h1>
<p class="text-gray-500 dark:text-gray-400 mt-2">Real-time output from download processes.</p>
<h1 class="text-3xl font-bold text-zinc-900 dark:text-white">运行日志</h1>
<p class="text-gray-500 dark:text-gray-400 mt-2">下载任务的实时输出</p>
</div>
<div class="flex items-center gap-3">
@@ -76,7 +75,7 @@ function formatTime(ts: number) {
<input
v-model="searchQuery"
type="text"
placeholder="Search logs..."
placeholder="搜索日志..."
class="pl-9 pr-4 py-2 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-zinc-800 rounded-xl text-sm outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-white w-48"
/>
</div>
@@ -87,23 +86,23 @@ function formatTime(ts: number) {
@click="filterLevel = 'all'"
class="px-3 py-1.5 rounded-lg text-xs font-medium transition-colors"
:class="filterLevel === 'all' ? 'bg-gray-100 dark:bg-zinc-800 text-zinc-900 dark:text-white' : 'text-gray-500 hover:text-zinc-900 dark:hover:text-white'"
>All</button>
>全部</button>
<button
@click="filterLevel = 'info'"
class="px-3 py-1.5 rounded-lg text-xs font-medium transition-colors"
:class="filterLevel === 'info' ? 'bg-gray-100 dark:bg-zinc-800 text-zinc-900 dark:text-white' : 'text-gray-500 hover:text-zinc-900 dark:hover:text-white'"
>Info</button>
>信息</button>
<button
@click="filterLevel = 'error'"
class="px-3 py-1.5 rounded-lg text-xs font-medium transition-colors"
:class="filterLevel === 'error' ? 'bg-gray-100 dark:bg-zinc-800 text-zinc-900 dark:text-white' : 'text-gray-500 hover:text-zinc-900 dark:hover:text-white'"
>Error</button>
>错误</button>
</div>
<button
@click="logsStore.clearLogs"
class="p-2 text-gray-500 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20 rounded-xl transition-colors border border-gray-200 dark:border-zinc-800 bg-white dark:bg-zinc-900"
title="Clear Logs"
title="清空日志"
>
<Trash2 class="w-4 h-4" />
</button>
@@ -118,7 +117,7 @@ function formatTime(ts: number) {
@scroll="handleScroll"
>
<div v-if="filteredLogs.length === 0" class="h-full flex items-center justify-center text-gray-400 dark:text-gray-600">
No logs to display
暂无日志
</div>
<div v-for="log in filteredLogs" :key="log.id" class="flex gap-4 hover:bg-gray-50 dark:hover:bg-zinc-800/50 px-2 py-1 rounded transition-colors">
<span class="text-gray-400 dark:text-zinc-600 shrink-0 select-none w-36">{{ formatTime(log.timestamp) }}</span>
@@ -135,7 +134,7 @@ function formatTime(ts: number) {
@click="() => { if(logsContainer) { logsContainer.scrollTop = logsContainer.scrollHeight; logsStore.autoScroll = true; } }"
class="bg-blue-600 hover:bg-blue-700 text-white text-xs px-3 py-1.5 rounded-full shadow-lg transition-colors"
>
Resume Auto-scroll
恢复自动滚动
</button>
</div>
</div>