diff --git a/web/src/features/admin/SourcesView.vue b/web/src/features/admin/SourcesView.vue index 3ac5293..0e7c9d2 100644 --- a/web/src/features/admin/SourcesView.vue +++ b/web/src/features/admin/SourcesView.vue @@ -134,6 +134,37 @@ function scheduleText(source: Source) { return `每${label} ${clockText}`; } +function timeText(source: Source) { + const mode = source.config.timeMode || ""; + const found = timeOptions.find((item) => item.value === mode); + const count = Number(source.config.timeCount || 1); + if (!found) return "未设置"; + if (mode === "prev_weeks") return `前 ${count} 周`; + if (mode === "prev_months") return `前 ${count} 月`; + if (mode === "prev_days") return `前 ${count} 天`; + return found.label; +} + +function tableItems(source: Source) { + return Array.isArray(source.config.tables) ? source.config.tables : []; +} + +function tablesText(source: Source) { + const tables = tableItems(source); + if (!tables.length) return "未选择"; + const first = tables[0].name || tables[0].tablename; + if (tables.length === 1) return first; + return `${first} 等 ${tables.length} 张`; +} + +function tablesTitle(source: Source) { + return tableItems(source).map((item) => item.name || item.tablename).join("、"); +} + +function cityText(source: Source) { + return String(source.config.city || "").trim() || "不限"; +} + function reset(source?: Source) { editing.value = source || null; name.value = source?.name || ""; @@ -267,6 +298,9 @@ onMounted(load); 名称 + 数据表 + 数据时间 + 城市 周期 状态 操作 @@ -275,6 +309,9 @@ onMounted(load); {{ source.name }} + {{ tablesText(source) }} + {{ timeText(source) }} + {{ cityText(source) }} {{ scheduleText(source) }} {{ source.lastError }} diff --git a/web/src/styles.css b/web/src/styles.css index 4328352..54f4616 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -202,7 +202,8 @@ button, input, select { font: inherit; } /* tables */ .admin-table { width: 100%; - border-collapse: collapse; + border-collapse: separate; + border-spacing: 0; } .admin-table th, .admin-table td { @@ -214,12 +215,19 @@ button, input, select { font: inherit; } .admin-table th { position: sticky; top: 0; - z-index: 1; + z-index: 2; background: var(--panel-2); - color: var(--muted); + color: var(--ink); font-size: 12px; - font-weight: 550; + font-weight: 650; letter-spacing: 0.01em; + box-shadow: inset 0 -1px 0 var(--line); +} +.admin-table .cell-clip { + max-width: 280px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .admin-table tbody tr:last-child td { border-bottom: 0; } .admin-table tbody tr:hover td { background: var(--hover); }