Files
ssh_panel/src/renderer/src/pages/overview/Overview.css
T
AKAxedx e929d4842e refactor: 全面重构前端 UI 样式
- 重构 theme.css:替换刺眼青色背景为柔和灰蓝(#eef1f6),品牌色改为靛蓝(#5b6ef5)
- 统一按钮体系:主按钮36px固定高度,菜单按钮30px,表格按钮28px,尺寸协调
- 登录页:服务器地址与端口并排布局,输入框40px高度统一,卡片阴影加深
- 面板页:导航栏56px高度,内容区居中限宽1400px,滚动条美化
- 概览页:auto-fit网格+340px最小宽度防止卡片不均,进程表全宽跨列
- 进程表格:table-layout:fixed + 列宽分配 + nowrap 防止串行溢出
- 所有文字元素加 white-space:nowrap 防止换行串行
- 更新 Electron 窗口背景色匹配新主题
2026-09-06 20:10:33 +08:00

325 lines
5.9 KiB
CSS

/* ============================================================
概览页 —— 卡片网格 + 各类指标卡片
============================================================ */
.overview-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
gap: 20px;
align-items: start;
}
/* ---- 卡片外壳 ---- */
.metric-card {
background: var(--card-bg);
border: 1px solid var(--hairline);
border-radius: var(--radius-card);
box-shadow: var(--shadow-card);
padding: 22px 24px;
min-height: 180px;
display: flex;
flex-direction: column;
transition: box-shadow 0.2s ease, border-color 0.2s ease;
overflow: hidden;
}
.metric-card:hover {
box-shadow: var(--shadow-card-hover);
border-color: var(--hairline-strong);
}
.metric-card header {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
margin-bottom: 14px;
}
.metric-card h3 {
font-size: 14px;
font-weight: 600;
color: var(--ink-secondary);
letter-spacing: 0.02em;
white-space: nowrap;
}
.metric-card .sub {
font-size: 12px;
color: var(--ink-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.metric-card .body {
flex: 1;
min-width: 0;
}
.placeholder {
color: var(--ink-muted);
font-size: 14px;
padding-top: 20px;
}
.error-text {
color: var(--status-critical);
font-size: 14px;
padding-top: 20px;
}
/* ---- 大数字 ---- */
.big-value {
font-size: 36px;
font-weight: 700;
color: var(--ink-strong);
letter-spacing: -0.01em;
line-height: 1.15;
font-variant-numeric: tabular-nums;
}
.detail {
font-size: 13px;
color: var(--ink-secondary);
margin-top: 6px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* ---- 仪表条 ---- */
.meter {
height: 8px;
background: var(--track);
border-radius: 999px;
margin-top: 18px;
overflow: hidden;
}
.meter-fill {
height: 100%;
border-radius: 999px;
transition: width 0.6s ease, background-color 0.3s ease;
}
.meter-fill.good {
background: var(--status-good);
}
.meter-fill.warning {
background: var(--status-warning);
}
.meter-fill.serious {
background: var(--status-serious);
}
.meter-fill.critical {
background: var(--status-critical);
}
/* ---- 缺少依赖的置灰卡片 ---- */
.metric-card.missing {
background: var(--surface-dim);
border: 1px dashed var(--hairline-strong);
box-shadow: none;
}
.metric-card.missing:hover {
box-shadow: none;
border-color: var(--hairline-strong);
}
.metric-card.missing h3,
.metric-card.missing .body {
color: var(--ink-muted);
}
.missing-box,
.error-box {
text-align: center;
padding: 24px 0 8px;
font-size: 14px;
color: var(--ink-muted);
line-height: 1.6;
}
.missing-box .btn,
.error-box .btn {
margin-top: 16px;
}
.error-box {
color: var(--status-critical);
}
/* ============================================================
网络速率卡片
============================================================ */
.net-row {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 0;
}
.net-row + .net-row {
border-top: 1px solid var(--divider);
}
.net-dot {
width: 10px;
height: 10px;
border-radius: 50%;
flex-shrink: 0;
}
.net-dot.dot-1 {
background: var(--series-1);
}
.net-dot.dot-2 {
background: var(--series-2);
}
.net-row .label {
font-size: 14px;
color: var(--ink-secondary);
white-space: nowrap;
}
.net-row .rate {
margin-left: auto;
font-size: 16px;
font-weight: 600;
color: var(--ink-strong);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
/* ============================================================
进程表格 —— 全宽跨列
============================================================ */
.overview-grid > section:last-child {
grid-column: 1 / -1;
}
.proc-table {
width: 100%;
font-size: 13px;
border-collapse: collapse;
table-layout: fixed;
}
.proc-table th {
text-align: left;
color: var(--ink-muted);
font-weight: 500;
font-size: 12px;
letter-spacing: 0.02em;
padding: 4px 10px 10px;
border-bottom: 1px solid var(--divider);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.proc-table td {
padding: 8px 10px;
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
color: var(--ink);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 列宽分配 */
.proc-table th:nth-child(1),
.proc-table td:nth-child(1) {
width: auto;
}
.proc-table th:nth-child(2),
.proc-table td:nth-child(2) {
width: 70px;
}
.proc-table th:nth-child(3),
.proc-table td:nth-child(3) {
width: 90px;
}
.proc-table th:nth-child(4),
.proc-table td:nth-child(4),
.proc-table th:nth-child(5),
.proc-table td:nth-child(5) {
width: 70px;
}
.proc-table td.num {
text-align: right;
font-variant-numeric: tabular-nums;
}
.proc-table tbody tr {
transition: background 0.12s ease;
}
.proc-table tbody tr:hover {
background: var(--surface-hover);
}
/* 杀死进程按钮 */
.proc-table .kill-cell {
text-align: right;
width: 90px;
}
.kill-btn {
display: inline-flex;
align-items: center;
justify-content: center;
height: 28px;
padding: 0 12px;
border: 1px solid var(--hairline-strong);
background: transparent;
color: var(--ink-secondary);
border-radius: var(--radius-sm);
font-size: 12px;
font-weight: 500;
cursor: pointer;
font-family: inherit;
white-space: nowrap;
transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.kill-btn:hover {
color: var(--status-critical);
border-color: rgba(239, 68, 68, 0.4);
background: rgba(239, 68, 68, 0.06);
}
.kill-btn.confirm {
background: var(--status-critical);
border-color: var(--status-critical);
color: #ffffff;
}
.kill-btn.confirm:hover {
background: #dc2626;
border-color: #dc2626;
}
.kill-feedback {
margin-top: 12px;
font-size: 13px;
}
.kill-feedback.ok {
color: var(--success-text);
}
.kill-feedback.fail {
color: var(--status-critical);
}