feat: WebUI 重构与更新

This commit is contained in:
2025-10-12 13:06:05 +08:00
parent fc7eeb3696
commit 7ac4b99a9e
37 changed files with 2779 additions and 2874 deletions

View File

@@ -0,0 +1,31 @@
import { html } from 'htm/preact';
import { TableItem } from './TableItem.js';
export function Sidebar({ tables, selectedTable, onSelectTable, loading }) {
if (loading) {
return html`
<div class="loading">
<p>加载中...</p>
</div>
`;
}
if (tables.length === 0) {
return html`
<div class="empty">
<p>暂无数据表</p>
</div>
`;
}
return html`
${tables.map(table => html`
<${TableItem}
key=${table.name}
table=${table}
isSelected=${selectedTable === table.name}
onSelect=${() => onSelectTable(table.name)}
/>
`)}
`;
}