Files
git-hook/static/app.css
T
2026-09-03 15:11:15 +08:00

334 lines
8.7 KiB
CSS

:root {
--bg: #0f1115;
--surface: #161a22;
--surface-2: #1d2230;
--border: #262c3a;
--text: #e6e8ee;
--text-dim: #9aa3b2;
--muted: #6f7787;
--accent: #5b8def;
--accent-2: #3a6fd1;
--success: #3ec07a;
--warn: #e0a458;
--danger: #e26a6a;
--skipped: #9aa3b2;
--mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
--shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.55;
min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
/* ============ Topbar ============ */
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 18px 28px;
border-bottom: 1px solid var(--border);
background: linear-gradient(180deg, #161a22 0%, #11141b 100%);
position: sticky;
top: 0;
z-index: 10;
backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px; height: 40px;
border-radius: 10px;
background: linear-gradient(135deg, var(--accent), var(--accent-2));
font-size: 22px;
box-shadow: var(--shadow);
}
.brand h1 { margin: 0; font-size: 18px; font-weight: 600; }
.subtitle { margin: 2px 0 0; color: var(--text-dim); font-size: 12px; }
.status { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot-green { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-red { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.dot-grey { background: var(--muted); }
/* ============ Layout ============ */
.layout {
display: grid;
grid-template-columns: 1fr 1.4fr;
grid-template-rows: auto auto;
gap: 18px;
padding: 22px;
max-width: 1400px;
margin: 0 auto;
}
#queue-card { grid-column: 1; grid-row: 1; }
#running-card { grid-column: 2; grid-row: 1; }
#history-card { grid-column: 1 / span 2; grid-row: 2; }
@media (max-width: 980px) {
.layout { grid-template-columns: 1fr; }
#queue-card, #running-card, #history-card {
grid-column: 1; grid-row: auto;
}
}
/* ============ Cards ============ */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: var(--shadow);
display: flex;
flex-direction: column;
min-height: 200px;
overflow: hidden;
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid var(--border);
background: var(--surface-2);
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.card-body { padding: 14px 16px; flex: 1; min-height: 0; }
.card-foot {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 16px;
border-top: 1px solid var(--border);
background: var(--surface-2);
font-size: 12px;
}
.empty { color: var(--muted); text-align: center; padding: 20px 0; margin: 0; }
.badge {
display: inline-flex;
align-items: center;
font-size: 12px;
padding: 2px 10px;
border-radius: 999px;
background: var(--accent);
color: #fff;
}
.badge-grey { background: var(--muted); }
.badge-success { background: var(--success); }
.badge-failed { background: var(--danger); }
.badge-warn { background: var(--warn); color: #2b1d05; }
.badge-skipped { background: var(--skipped); }
.muted { color: var(--text-dim); }
.small { font-size: 12px; }
/* ============ Pending ============ */
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item {
border: 1px solid var(--border);
border-left: 3px solid var(--warn);
background: var(--surface-2);
border-radius: 8px;
padding: 10px 12px;
}
.pending-item .row { display: flex; justify-content: space-between; gap: 8px; }
.pending-item .script { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.pending-item .meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.pending-item .meta code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
/* ============ Running ============ */
.running-body { display: flex; flex-direction: column; gap: 10px; }
.running-meta {
display: grid;
grid-template-columns: max-content 1fr;
gap: 4px 14px;
font-size: 13px;
}
.running-meta dt { color: var(--text-dim); }
.running-meta dd { margin: 0; font-family: var(--mono); font-size: 12px; }
.log-box {
background: #0a0c12;
border: 1px solid var(--border);
border-radius: 8px;
padding: 10px 12px;
height: 360px;
overflow: auto;
font-family: var(--mono);
font-size: 12.5px;
white-space: pre-wrap;
word-break: break-all;
color: #cdd3df;
scroll-behavior: smooth;
}
.log-box .placeholder { color: var(--muted); }
/* ============ History ============ */
.history-list { display: flex; flex-direction: column; gap: 18px; }
.history-group h3 {
margin: 0 0 8px;
font-size: 13px;
font-weight: 600;
color: var(--text-dim);
display: flex;
align-items: center;
gap: 8px;
}
.history-group h3 code {
background: var(--bg);
padding: 2px 8px;
border-radius: 4px;
color: var(--text);
font-family: var(--mono);
font-size: 12px;
}
.history-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
border: 1px solid var(--border);
border-radius: 8px;
overflow: hidden;
}
.history-table th,
.history-table td {
padding: 8px 12px;
text-align: left;
border-bottom: 1px solid var(--border);
vertical-align: middle;
}
.history-table th {
background: var(--surface-2);
color: var(--text-dim);
font-weight: 500;
font-size: 12px;
}
.history-table tr:last-child td { border-bottom: 0; }
.history-table tr.row-running td { background: rgba(91, 141, 239, 0.08); }
.history-table .toggle-log {
background: none;
border: 1px solid var(--border);
color: var(--text-dim);
font-size: 12px;
padding: 2px 8px;
border-radius: 4px;
cursor: pointer;
}
.history-table .toggle-log:hover { color: var(--text); border-color: var(--accent); }
.history-table .log-cell {
padding: 0;
}
.history-table .log-cell .log-box {
border-radius: 0;
border: none;
height: auto;
max-height: 320px;
}
/* ============ Buttons ============ */
.btn-ghost {
background: transparent;
border: 1px solid var(--border);
color: var(--text-dim);
padding: 4px 10px;
font-size: 12px;
border-radius: 6px;
cursor: pointer;
transition: all 0.15s ease;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-ghost.active {
color: var(--accent);
border-color: var(--accent);
background: rgba(91, 141, 239, 0.08);
}
/* ============ Status dot in row ============ */
.status-pill {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12px;
padding: 2px 8px;
border-radius: 4px;
font-weight: 500;
}
.status-pill .dot { width: 7px; height: 7px; }
.status-success { color: var(--success); background: rgba(62, 192, 122, 0.10); }
.status-failed { color: var(--danger); background: rgba(226, 106, 106, 0.10); }
.status-timeout { color: var(--warn); background: rgba(224, 164, 88, 0.12); }
.status-skipped { color: var(--skipped); background: rgba(154, 163, 178, 0.12); }
.status-running { color: var(--accent); background: rgba(91, 141, 239, 0.12); }
/* ============ Running actions + Modal ============ */
.running-actions { margin-top: 12px; display: flex; gap: 8px; }
.modal {
position: fixed;
inset: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.6);
}
.modal-dialog {
position: relative;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: var(--shadow);
width: min(900px, 92vw);
height: min(72vh, 720px);
display: flex;
flex-direction: column;
overflow: hidden;
}
.modal-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
border-bottom: 1px solid var(--border);
background: var(--surface-2);
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.modal-log {
flex: 1;
height: auto;
border: none;
border-radius: 0;
}
.modal-foot {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 16px;
border-top: 1px solid var(--border);
background: var(--surface-2);
font-size: 12px;
}