mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 09:35:39 +00:00
bbf839754e
Add multiple security hardenings across the server and web console: enforce proof-of-possession for /ws/bd-mgmt using Ed25519-signed headers with timestamp/nonce and replay protection (public key binding, canonicalization, storage, verification, and tests); remove legacy API key query param and config-table fallback in favor of scoped api_keys (migrate bootstrap key into api_keys); tighten WebSocket origin handling for relay and signal servers to allow only localhost origins by default unless an explicit allowlist is set; update auth middleware public paths and test helpers to use X-API-Key header; add ensureScopedAPIKey migration and related helpers; add a GitHub Secret Scan workflow and an audit report. Misc: propagate audit logging on bd-mgmt connect/disconnect and validate enrollment public keys during device register.
523 lines
12 KiB
CSS
523 lines
12 KiB
CSS
/* ═══════════════════════════════════════════════════════════════════════════
|
|
BetterDesk Console — Toolkit Page Styles
|
|
═══════════════════════════════════════════════════════════════════════════ */
|
|
|
|
/* ── Page header ────────────────────────────────────────────────────────── */
|
|
|
|
.page-title {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
.page-title .material-icons {
|
|
font-size: 28px;
|
|
color: var(--accent);
|
|
}
|
|
.page-subtitle {
|
|
color: var(--text-secondary);
|
|
margin-top: 4px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* ── Tool grid ──────────────────────────────────────────────────────────── */
|
|
|
|
.tool-grid {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
/* ── Tool card ──────────────────────────────────────────────────────────── */
|
|
|
|
.tool-card {
|
|
background: var(--card-bg, #161b22);
|
|
border: 1px solid var(--border, #30363d);
|
|
border-radius: 10px;
|
|
overflow: hidden;
|
|
transition: border-color 0.2s;
|
|
}
|
|
.tool-card:hover {
|
|
border-color: var(--border-hover, #484f58);
|
|
}
|
|
.tool-card.expanded {
|
|
border-color: var(--accent, #58a6ff);
|
|
}
|
|
|
|
/* ── Card header (toggle) ───────────────────────────────────────────────── */
|
|
|
|
.tool-card-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 14px;
|
|
padding: 14px 18px;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
transition: background 0.15s;
|
|
}
|
|
.tool-card-header:hover {
|
|
background: var(--hover-bg, rgba(255,255,255,0.04));
|
|
}
|
|
|
|
.tool-icon {
|
|
font-size: 24px;
|
|
color: var(--accent, #58a6ff);
|
|
flex-shrink: 0;
|
|
width: 40px;
|
|
height: 40px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--accent-subtle, rgba(88,166,255,0.1));
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.tool-meta {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
.tool-meta h3 {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--text-primary, #e6edf3);
|
|
margin: 0;
|
|
line-height: 1.3;
|
|
}
|
|
.tool-meta p {
|
|
font-size: 12px;
|
|
color: var(--text-secondary, #8b949e);
|
|
margin: 2px 0 0;
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.expand-icon {
|
|
color: var(--text-secondary, #8b949e);
|
|
transition: transform 0.25s ease;
|
|
flex-shrink: 0;
|
|
}
|
|
.tool-card.expanded .expand-icon {
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
/* ── Card body (collapsible) ────────────────────────────────────────────── */
|
|
|
|
.tool-card-body {
|
|
display: none;
|
|
padding: 0 18px 18px;
|
|
border-top: 1px solid var(--border, #30363d);
|
|
animation: toolSlideDown 0.2s ease;
|
|
}
|
|
.tool-card.expanded .tool-card-body {
|
|
display: block;
|
|
}
|
|
|
|
@keyframes toolSlideDown {
|
|
from { opacity: 0; transform: translateY(-8px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
/* ── Form elements ──────────────────────────────────────────────────────── */
|
|
|
|
.tool-form {
|
|
padding-top: 14px;
|
|
}
|
|
|
|
.form-row {
|
|
display: flex;
|
|
gap: 12px;
|
|
align-items: flex-end;
|
|
flex-wrap: wrap;
|
|
}
|
|
.flex-1 {
|
|
flex: 1;
|
|
min-width: 180px;
|
|
}
|
|
|
|
.tool-run-btn {
|
|
height: 38px;
|
|
white-space: nowrap;
|
|
flex-shrink: 0;
|
|
}
|
|
.tool-run-btn .material-icons {
|
|
font-size: 18px;
|
|
}
|
|
|
|
.chip-group {
|
|
display: flex;
|
|
gap: 6px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.chip {
|
|
padding: 5px 14px;
|
|
border-radius: 16px;
|
|
border: 1px solid var(--border, #30363d);
|
|
background: transparent;
|
|
color: var(--text-secondary, #8b949e);
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.15s;
|
|
}
|
|
.chip:hover {
|
|
border-color: var(--accent, #58a6ff);
|
|
color: var(--text-primary, #e6edf3);
|
|
}
|
|
.chip.active {
|
|
background: var(--accent, #58a6ff);
|
|
border-color: var(--accent, #58a6ff);
|
|
color: #fff;
|
|
}
|
|
|
|
.check-row {
|
|
display: flex;
|
|
gap: 14px;
|
|
flex-wrap: wrap;
|
|
padding-top: 4px;
|
|
}
|
|
.check-label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
font-size: 13px;
|
|
color: var(--text-secondary, #8b949e);
|
|
cursor: pointer;
|
|
}
|
|
.check-label input[type="checkbox"] {
|
|
accent-color: var(--accent, #58a6ff);
|
|
}
|
|
|
|
/* ── Result area ────────────────────────────────────────────────────────── */
|
|
|
|
.tool-result {
|
|
margin-top: 14px;
|
|
min-height: 0;
|
|
}
|
|
.tool-result:empty {
|
|
display: none;
|
|
}
|
|
|
|
.tool-result-box {
|
|
background: var(--bg-secondary, #0d1117);
|
|
border: 1px solid var(--border, #30363d);
|
|
border-radius: 8px;
|
|
padding: 14px;
|
|
font-family: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', monospace;
|
|
font-size: 13px;
|
|
line-height: 1.6;
|
|
color: var(--text-primary, #e6edf3);
|
|
overflow-x: auto;
|
|
word-break: break-all;
|
|
}
|
|
|
|
.result-row {
|
|
display: flex;
|
|
gap: 8px;
|
|
padding: 3px 0;
|
|
}
|
|
.result-label {
|
|
color: var(--text-secondary, #8b949e);
|
|
min-width: 110px;
|
|
flex-shrink: 0;
|
|
font-weight: 500;
|
|
}
|
|
.result-value {
|
|
color: var(--text-primary, #e6edf3);
|
|
word-break: break-all;
|
|
}
|
|
|
|
.result-status {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 3px 10px;
|
|
border-radius: 12px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
}
|
|
.result-status.success {
|
|
background: rgba(63,185,80,0.15);
|
|
color: #3fb950;
|
|
}
|
|
.result-status.error {
|
|
background: rgba(248,81,73,0.15);
|
|
color: #f85149;
|
|
}
|
|
.result-status.warning {
|
|
background: rgba(210,153,34,0.15);
|
|
color: #d29922;
|
|
}
|
|
|
|
/* Copy button inside result */
|
|
.result-copy-btn {
|
|
float: right;
|
|
padding: 3px 10px;
|
|
border: 1px solid var(--border, #30363d);
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
color: var(--text-secondary, #8b949e);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
transition: all 0.15s;
|
|
}
|
|
.result-copy-btn:hover {
|
|
background: var(--hover-bg, rgba(255,255,255,0.06));
|
|
color: var(--text-primary, #e6edf3);
|
|
}
|
|
.result-copy-btn .material-icons {
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* Password result */
|
|
.password-display {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
background: var(--bg-secondary, #0d1117);
|
|
border: 1px solid var(--border, #30363d);
|
|
border-radius: 8px;
|
|
padding: 10px 14px;
|
|
}
|
|
.password-value {
|
|
flex: 1;
|
|
font-family: 'SF Mono', 'Cascadia Code', monospace;
|
|
font-size: 16px;
|
|
letter-spacing: 1px;
|
|
color: var(--accent, #58a6ff);
|
|
word-break: break-all;
|
|
user-select: all;
|
|
}
|
|
.password-meta {
|
|
display: flex;
|
|
gap: 16px;
|
|
margin-top: 8px;
|
|
font-size: 12px;
|
|
color: var(--text-secondary, #8b949e);
|
|
}
|
|
.entropy-bar {
|
|
height: 4px;
|
|
border-radius: 2px;
|
|
margin-top: 8px;
|
|
background: var(--border, #30363d);
|
|
overflow: hidden;
|
|
}
|
|
.entropy-fill {
|
|
height: 100%;
|
|
border-radius: 2px;
|
|
transition: width 0.3s;
|
|
}
|
|
|
|
/* SSL cert fields */
|
|
.ssl-chain {
|
|
margin-top: 10px;
|
|
padding-left: 0;
|
|
list-style: none;
|
|
}
|
|
.ssl-chain li {
|
|
position: relative;
|
|
padding: 6px 0 6px 24px;
|
|
font-size: 13px;
|
|
}
|
|
.ssl-chain li::before {
|
|
content: '→';
|
|
position: absolute;
|
|
left: 4px;
|
|
color: var(--accent, #58a6ff);
|
|
}
|
|
|
|
/* DNS record table */
|
|
.dns-records {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
.dns-records th {
|
|
text-align: left;
|
|
padding: 6px 10px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: var(--text-secondary, #8b949e);
|
|
border-bottom: 1px solid var(--border, #30363d);
|
|
}
|
|
.dns-records td {
|
|
padding: 5px 10px;
|
|
font-size: 13px;
|
|
color: var(--text-primary, #e6edf3);
|
|
border-bottom: 1px solid var(--border-subtle, rgba(48,54,61,0.5));
|
|
}
|
|
|
|
/* Process table */
|
|
.proc-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: 12px;
|
|
}
|
|
.proc-table th {
|
|
text-align: left;
|
|
padding: 5px 8px;
|
|
font-weight: 600;
|
|
color: var(--text-secondary, #8b949e);
|
|
border-bottom: 1px solid var(--border, #30363d);
|
|
white-space: nowrap;
|
|
}
|
|
.proc-table td {
|
|
padding: 4px 8px;
|
|
color: var(--text-primary, #e6edf3);
|
|
border-bottom: 1px solid var(--border-subtle, rgba(48,54,61,0.5));
|
|
white-space: nowrap;
|
|
max-width: 250px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
/* Log output */
|
|
.log-output {
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
font-size: 12px;
|
|
line-height: 1.5;
|
|
white-space: pre-wrap;
|
|
word-break: break-all;
|
|
}
|
|
.log-line-error {
|
|
color: #f85149;
|
|
}
|
|
.log-line-warning {
|
|
color: #d29922;
|
|
}
|
|
.log-line-info {
|
|
color: #8b949e;
|
|
}
|
|
|
|
/* Disk usage bars */
|
|
.disk-bar-wrapper {
|
|
margin-bottom: 12px;
|
|
}
|
|
.disk-bar-label {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-size: 13px;
|
|
margin-bottom: 4px;
|
|
}
|
|
.disk-bar-name {
|
|
font-weight: 500;
|
|
color: var(--text-primary, #e6edf3);
|
|
}
|
|
.disk-bar-size {
|
|
color: var(--text-secondary, #8b949e);
|
|
}
|
|
.disk-bar {
|
|
height: 8px;
|
|
border-radius: 4px;
|
|
background: var(--border, #30363d);
|
|
overflow: hidden;
|
|
}
|
|
.disk-bar-fill {
|
|
height: 100%;
|
|
border-radius: 4px;
|
|
transition: width 0.3s;
|
|
}
|
|
|
|
/* Spinner */
|
|
.tool-spinner {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 12px;
|
|
color: var(--text-secondary, #8b949e);
|
|
font-size: 13px;
|
|
}
|
|
.tool-spinner .material-icons {
|
|
animation: spin 1s linear infinite;
|
|
font-size: 20px;
|
|
color: var(--accent, #58a6ff);
|
|
}
|
|
@keyframes spin {
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
|
|
/* Speed test gauge */
|
|
.speed-gauge {
|
|
text-align: center;
|
|
padding: 20px 0;
|
|
}
|
|
.speed-value {
|
|
font-size: 48px;
|
|
font-weight: 700;
|
|
color: var(--accent, #58a6ff);
|
|
line-height: 1;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
.speed-unit {
|
|
font-size: 16px;
|
|
color: var(--text-secondary, #8b949e);
|
|
margin-left: 4px;
|
|
}
|
|
.speed-latency {
|
|
font-size: 14px;
|
|
color: var(--text-secondary, #8b949e);
|
|
margin-top: 6px;
|
|
}
|
|
|
|
/* Docker container pills */
|
|
.docker-container {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid var(--border-subtle, rgba(48,54,61,0.5));
|
|
font-size: 13px;
|
|
}
|
|
.docker-container:last-child {
|
|
border-bottom: none;
|
|
}
|
|
.docker-status-dot {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
}
|
|
.docker-status-dot.running { background: #3fb950; }
|
|
.docker-status-dot.stopped { background: #f85149; }
|
|
.docker-name {
|
|
font-weight: 600;
|
|
color: var(--text-primary, #e6edf3);
|
|
min-width: 140px;
|
|
}
|
|
.docker-image {
|
|
color: var(--text-secondary, #8b949e);
|
|
flex: 1;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.docker-ports {
|
|
color: var(--accent, #58a6ff);
|
|
font-family: monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
/* ── Responsive ─────────────────────────────────────────────────────────── */
|
|
|
|
@media (max-width: 768px) {
|
|
.form-row {
|
|
flex-direction: column;
|
|
}
|
|
.form-row .form-group {
|
|
width: 100% !important;
|
|
}
|
|
.tool-run-btn {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
.check-row {
|
|
gap: 10px;
|
|
}
|
|
.result-label {
|
|
min-width: 90px;
|
|
}
|
|
.speed-value {
|
|
font-size: 36px;
|
|
}
|
|
}
|