优化流式传输&fix bugs
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
<div class="w-full overflow-x-auto scrollbar-hide">
|
||||
<div role="tablist" class="relative inline-flex h-10 items-center justify-center inset-shadow-sm/25 rounded-lg bg-zinc-800/50 dark:bg-zinc-950 p-1" data-sliding-tabs-container>
|
||||
<div class="absolute left-0 h-[calc(100%-0.5rem)] rounded-md bg-white dark:bg-zinc-700 shadow-sm" data-tab-indicator style="transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);"></div>
|
||||
<a href="#" role="tab" class="tab-item tab-active" data-tab-item>错误日志</a>
|
||||
<a href="#" role="tab" class="tab-item" data-tab-item>系统日志</a>
|
||||
<a href="#" role="tab" class="tab-item tab-active" data-tab-item data-tab-target="error">错误日志</a>
|
||||
<a href="#" role="tab" class="tab-item" data-tab-item data-tab-target="system">系统日志</a>
|
||||
<a href="#" role="tab" class="tab-item" data-tab-item>保留标签</a>
|
||||
<a href="#" role="tab" class="tab-item" data-tab-item>保留标签</a>
|
||||
</div>
|
||||
@@ -35,9 +35,9 @@
|
||||
</div>
|
||||
|
||||
<!-- =================================================================== -->
|
||||
<!-- 3. 主内容区:过滤器 + 表格 (精确复刻版) -->
|
||||
<!-- 3. 主内容区:过滤器 + 表格 -->
|
||||
<!-- =================================================================== -->
|
||||
<div class="flex items-center justify-between shrink-0 py-4">
|
||||
<div id="error-logs-filters" class="flex items-center justify-between shrink-0 py-4">
|
||||
|
||||
<div class="flex flex-1 items-center space-x-2">
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- [应用] .btn .btn-outline, 并覆盖高度/字体 -->
|
||||
<button class="btn btn-outline hidden lg:flex h-8 px-3 text-xs">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="mr-2 h-4 w-4">
|
||||
<path d="M20 7h-9"></path><path d="M14 17H5"></path><circle cx="17" cy="17" r="3"></circle><circle cx="7" cy="7" r="3"></circle>
|
||||
@@ -72,20 +71,55 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 3.2 数据表格容器 (带边框和圆角) -->
|
||||
<div class="rounded-lg border border-zinc-200 dark:border-zinc-700 flex-grow overflow-hidden flex flex-col">
|
||||
<!-- 容器需要 overflow-auto 以便表格内容超出时滚动 -->
|
||||
<!-- [新增] 3.2 系统日志的快捷操作栏 (默认隐藏) -->
|
||||
<div id="system-logs-controls" class="hidden flex items-center justify-between shrink-0 py-4">
|
||||
<div class="flex flex-1 items-center space-x-2">
|
||||
<button data-action="clear-terminal" class="btn btn-outline h-8 px-3 text-xs">
|
||||
<i class="fas fa-trash-alt mr-2 h-4 w-4"></i>
|
||||
清屏
|
||||
</button>
|
||||
<button data-action="toggle-pause-terminal" class="btn btn-outline h-8 px-3 text-xs">
|
||||
<i class="fas fa-pause mr-2 h-4 w-4"></i>
|
||||
<span>暂停</span>
|
||||
</button>
|
||||
<button data-action="toggle-scroll-terminal" class="btn btn-outline h-8 px-3 text-xs">
|
||||
<i class="fas fa-arrow-down mr-2 h-4 w-4"></i>
|
||||
<span>自动滚动</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex items-center space-x-3">
|
||||
<div id="terminal-status-indicator" class="flex items-center text-xs text-zinc-500 dark:text-zinc-400">
|
||||
<span class="relative flex h-2 w-2 mr-2">
|
||||
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-zinc-400 dark:bg-zinc-500 opacity-75"></span>
|
||||
<span class="relative inline-flex rounded-full h-2 w-2 bg-zinc-500 dark:bg-zinc-600"></span>
|
||||
</span>
|
||||
未连接
|
||||
</div>
|
||||
<button data-action="disconnect-terminal" class="btn btn-danger h-8 px-3 text-xs">
|
||||
<i class="fas fa-times-circle mr-2 h-4 w-4"></i>
|
||||
关闭
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- [修改] 3.3 核心内容容器,它的 *内部* 将被动态替换 -->
|
||||
<div id="log-content-container" class="rounded-lg border border-zinc-200 dark:border-zinc-700 flex-grow overflow-hidden flex flex-col">
|
||||
<!-- template 在这里切换 -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<template id="error-logs-template">
|
||||
<div class="relative w-full overflow-auto flex-grow main-content-scroll">
|
||||
<table class="table">
|
||||
<thead class="table-header">
|
||||
<tr class="table-row">
|
||||
<!-- [修正] 恢复全选复选框 -->
|
||||
<th class="table-head-cell w-4">
|
||||
<input type="checkbox" class="h-4 w-4 rounded border-zinc-300 text-blue-600 focus:ring-blue-500">
|
||||
</th>
|
||||
<th class="table-head-cell w-16">序号</th>
|
||||
<th class="table-head-cell">Gemini 密钥</th>
|
||||
<!-- [新增] 群组名称列 -->
|
||||
<th class="table-head-cell">群组名称</th>
|
||||
<th class="table-head-cell">错误类型</th>
|
||||
<th class="table-head-cell">状态码</th>
|
||||
@@ -131,7 +165,6 @@
|
||||
<div class="flex w-[100px] items-center justify-center text-sm font-medium">
|
||||
第 1 / 1 页
|
||||
</div>
|
||||
<!-- [修正 1.2] 为分页按钮组添加一个稳定的 data 属性,用于 JS 选择 -->
|
||||
<div class="flex items-center space-x-2" data-pagination-controls>
|
||||
<button class="btn btn-secondary h-8 w-8 p-0 hidden lg:flex" disabled>
|
||||
<span class="sr-only">Go to first page</span>
|
||||
@@ -152,9 +185,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="system-logs-template">
|
||||
<div id="log-terminal-output" class="w-full h-full overflow-y-auto main-content-scroll p-4 font-mono text-sm text-zinc-200 bg-zinc-900 dark:bg-black whitespace-pre-wrap break-all">
|
||||
<!-- WebSocket 日志将在此处实时渲染 -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
{% endblock %}
|
||||
|
||||
{% block modals %}
|
||||
|
||||
Reference in New Issue
Block a user