feat: redesign the web console with Vue and isolated account workspaces

This commit is contained in:
AttilaNet
2026-11-11 09:35:54 +08:00
parent 99aff423d8
commit ff6a828f58
46 changed files with 4549 additions and 748 deletions
+15 -2
View File
@@ -111,11 +111,21 @@ export class PageView {
clearError() { this.errorBox.hidden = true; }
setQuery(key, value) {
if (this.query[key] === value) return;
if (this.destroyed || this.query[key] === value) return;
this.query[key] = value;
this.generation = (this.generation || 0) + 1;
clearTimeout(this.queryTimer);
this.queryTimer = setTimeout(() => this.options.load(this, true), key === 'search' ? 220 : 0);
this.queryTimer = setTimeout(() => { if (!this.destroyed) this.options.load(this, true); }, key === 'search' ? 220 : 0);
}
destroy() {
this.destroyed = true;
clearTimeout(this.queryTimer);
this.generation = (this.generation || 0) + 1;
this.table?.destroy?.();
this.statisticsTable?.destroy();
this.login?.clearPassword();
this.root.remove();
}
updateFilters(filters) {
@@ -197,6 +207,7 @@ export class PageView {
}
render(data, loading = false) {
if (this.destroyed) return;
if (!data) { this.loading.textContent = '正在读取…'; this.loading.dataset.loading = 'true'; return; }
this.data = data;
this.loading.dataset.loading = String(loading);
@@ -224,6 +235,8 @@ export class PageView {
const mode = this.key === 'statistics' ? 'statistics' : grouped ? 'grouped' : 'table';
if (this.contentMode !== mode) {
if (this.content.contains(document.activeElement)) return;
this.table?.destroy?.();
this.statisticsTable?.destroy();
this.content.replaceChildren();
this.contentMode = mode;
this.table = mode === 'grouped' ? new GroupedTables(this.content, this.context, {collapsed: this.key === 'maps'}) : mode === 'table' ? new DataTable(this.content, this.context, {emptyMessage: this.key === 'plans' ? '当前没有执行计划。请配置策略并刷新 / 预览,查看下一步或等待原因。' : '当前筛选下没有条目。可调整筛选,或登录后刷新状态。'}) : null;