Files
tdc-rs/static/style.css
T
xstudio 885b108fe0 init: TDC 连接器 Rust MVP(pglite-rs 内嵌 + 静态 HTML 控制台)
从 ssw-mvp/boot/ssw-tdc(Spring Boot/JNPF,37 Controller)剥离重底座的本地优先实现:
- axum 单进程承担控制面/数据面/静态托管/TDC→TDS HTTP 契约网关
- pglite-rs 0.2 内嵌原生 PostgreSQL(进程内,非浏览器 WASM),19 张 tdc_* 表
- 静态 HTML + 原生 JS 控制台:schema 自省驱动 CRUD + 按表生命周期动作
- 红线:TDC↔TDS 只走 HTTP 契约,未配 SSW_TDS_BASE_URL 时 Noop 降级
- AGENTS.md 记录架构红线、命令速查与踩坑清单;docs/ 记录跨方契约细节
2026-10-24 10:31:06 +08:00

97 lines
5.2 KiB
CSS

:root {
--bg: #0f1419;
--panel: #161c24;
--panel-2: #1d2530;
--line: #2a3340;
--text: #e6edf3;
--muted: #8b97a7;
--accent: #3b82f6;
--accent-2: #22c55e;
--warn: #f59e0b;
--danger: #ef4444;
--radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
background: var(--bg); color: var(--text); font-size: 14px;
}
#app { display: grid; grid-template-columns: 260px 1fr; height: 100vh; }
/* sidebar */
#sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { padding: 16px; border-bottom: 1px solid var(--line); }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.identity-card { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.id-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--accent-2); }
.dot.off { background: var(--danger); }
.id-code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin: 6px 0; color: var(--text); word-break: break-all; }
.id-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#table-nav { flex: 1; overflow-y: auto; padding: 8px; }
#table-nav a {
display: block; padding: 8px 10px; border-radius: 6px; color: var(--text);
text-decoration: none; cursor: pointer; font-size: 13px;
}
#table-nav a:hover { background: var(--panel-2); }
#table-nav a.active { background: var(--accent); color: #fff; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
.health-text { color: var(--muted); font-size: 11px; margin-top: 6px; white-space: pre-wrap; }
/* main */
#main { display: flex; flex-direction: column; min-width: 0; }
#topbar {
display: flex; align-items: center; justify-content: space-between;
padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.crumb { font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.search { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 10px; width: 200px; }
#content { flex: 1; overflow: auto; padding: 16px; }
#grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
position: sticky; top: 0; background: var(--panel-2); text-align: left;
padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--muted);
}
tbody td { padding: 7px 10px; border-bottom: 1px solid var(--line); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:hover { background: var(--panel-2); }
td .row-actions { display: flex; gap: 4px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.tag.ok { color: var(--accent-2); }
.tag.warn { color: var(--warn); }
.tag.bad { color: var(--danger); }
.empty { color: var(--muted); padding: 40px; text-align: center; }
/* buttons */
.btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 720px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
border-radius: 6px; padding: 7px 9px; font-size: 13px; font-family: inherit;
}
.field textarea { min-height: 64px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.readonly { color: var(--muted); font-style: italic; }
#statusbar { padding: 6px 16px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; }
.lifecycle { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }