Files
BetterDesk/web-nodejs/public/css/server-management.css
T
UNITRONIX a8d3259d43 feat(server-management): add server management service and terminal proxy
- Implemented server management service providing resource snapshots, file browser, service control, and audit logging.
- Added terminal proxy for WebSocket-backed PTY, allowing browser-based shell access with user authentication and role-based access control.
- Created server management view with tabs for overview, terminal, file management, and services, including UI elements for displaying system metrics and managing files/services.

Co-authored-by: Copilot <copilot@github.com>
2026-05-07 03:09:03 +02:00

570 lines
11 KiB
CSS

/* BetterDesk Console — Server Management page (BETA) */
.server-mgmt-page {
padding: 0;
}
/* btn-tertiary — used heavily on this page; not defined in main.css/tokens.css */
.server-mgmt-page .btn-tertiary,
.btn.btn-tertiary {
background: transparent;
color: var(--color-text, #e6edf3);
border: 1px solid var(--color-border, #30363d);
padding: 6px 10px;
border-radius: 6px;
cursor: pointer;
font-size: 12.5px;
display: inline-flex;
align-items: center;
gap: 4px;
line-height: 1;
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.server-mgmt-page .btn-tertiary:hover:not(:disabled),
.btn.btn-tertiary:hover:not(:disabled) {
background: var(--color-surface-hover, #1f2933);
border-color: #58a6ff;
color: #58a6ff;
}
.server-mgmt-page .btn-tertiary:disabled,
.btn.btn-tertiary:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.server-mgmt-page .btn-tertiary .material-icons,
.btn.btn-tertiary .material-icons {
font-size: 16px;
}
.server-mgmt-header h1 {
display: flex;
align-items: center;
gap: 0.5rem;
}
.server-mgmt-header h1 .material-icons {
font-size: 28px;
color: var(--color-primary, #58a6ff);
}
.beta-badge {
display: inline-block;
padding: 2px 8px;
margin-left: 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.05em;
background: linear-gradient(135deg, #ff7b72, #d29922);
color: #fff;
vertical-align: middle;
}
.server-mgmt-notice {
display: flex;
align-items: flex-start;
gap: 0.75rem;
padding: 12px 16px;
margin: 0 0 16px 0;
border-radius: 8px;
background: rgba(210, 153, 34, 0.08);
border: 1px solid rgba(210, 153, 34, 0.4);
color: var(--color-text, #e6edf3);
}
.server-mgmt-notice .material-icons {
color: #d29922;
flex-shrink: 0;
}
.server-mgmt-notice strong {
display: block;
margin-bottom: 2px;
font-size: 13px;
}
.server-mgmt-notice p {
margin: 0;
font-size: 12.5px;
color: var(--color-text-muted, #8b949e);
line-height: 1.45;
}
/* Full-width page. Main navigation lives in the sidebar flyout. */
.server-mgmt-layout {
display: block;
width: 100%;
}
.server-mgmt-tabs {
display: none;
}
.server-mgmt-content {
width: 100%;
min-width: 0;
}
.sm-tab-btn {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border-radius: 6px;
background: transparent;
border: 1px solid transparent;
color: var(--color-text, #e6edf3);
cursor: pointer;
font-size: 13.5px;
font-weight: 500;
text-align: left;
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sm-tab-btn:hover {
background: var(--color-surface-hover, #1f2933);
}
.sm-tab-btn.active {
background: rgba(88, 166, 255, 0.12);
border-color: rgba(88, 166, 255, 0.4);
color: var(--color-primary, #58a6ff);
}
.sm-tab-btn .material-icons {
font-size: 20px;
}
.sm-tab-panel {
animation: smFadeIn 0.18s ease;
}
@keyframes smFadeIn {
from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}
/* ── Overview ── */
.sm-overview-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14px;
}
.sm-card {
padding: 14px 16px;
border-radius: 8px;
background: var(--color-surface, #161b22);
border: 1px solid var(--color-border, #30363d);
min-width: 0;
}
.sm-card-wide {
grid-column: span 3;
}
.sm-card-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
}
.sm-card-header h3 {
margin: 0;
font-size: 14px;
font-weight: 600;
}
.sm-card-header .material-icons {
color: var(--color-text-muted, #8b949e);
font-size: 20px;
}
.sm-gauge {
margin-bottom: 8px;
}
.sm-gauge-bar {
height: 10px;
border-radius: 5px;
background: var(--color-surface-alt, #0d1117);
overflow: hidden;
}
.sm-gauge-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #3fb950, #d29922 60%, #ff7b72);
transition: width 0.4s ease;
}
.sm-gauge-value {
margin-top: 6px;
font-size: 22px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.sm-meta {
font-size: 12px;
color: var(--color-text-muted, #8b949e);
}
.sm-load-row {
display: flex;
gap: 16px;
margin-bottom: 6px;
font-size: 18px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.sm-load-row .sm-stat-label {
display: block;
font-size: 11px;
font-weight: 400;
color: var(--color-text-muted, #8b949e);
margin-bottom: 2px;
}
.sm-info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 6px 18px;
font-size: 13px;
}
.sm-info-grid .sm-info-key {
color: var(--color-text-muted, #8b949e);
margin-right: 6px;
}
.sm-info-grid .sm-info-val {
font-family: 'Cascadia Code', 'Fira Code', monospace;
}
.sm-disk-row {
display: grid;
grid-template-columns: 1fr 1fr 110px;
gap: 12px;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid var(--color-border, #30363d);
}
.sm-disk-row:last-child { border-bottom: none; }
.sm-disk-mount {
font-family: 'Cascadia Code', monospace;
font-size: 13px;
}
.sm-disk-bar {
height: 8px;
border-radius: 4px;
background: var(--color-surface-alt, #0d1117);
overflow: hidden;
}
.sm-disk-bar-fill {
height: 100%;
background: linear-gradient(90deg, #3fb950, #d29922 70%, #ff7b72);
}
.sm-disk-stat {
text-align: right;
font-variant-numeric: tabular-nums;
font-size: 12.5px;
color: var(--color-text-muted, #8b949e);
}
.sm-history-wrap {
width: 100%;
}
.sm-history-wrap canvas {
width: 100%;
height: 120px;
display: block;
}
.sm-history-legend {
display: flex;
gap: 16px;
margin-top: 6px;
font-size: 12px;
color: var(--color-text-muted, #8b949e);
}
.sm-history-legend .dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 2px;
margin-right: 4px;
vertical-align: middle;
}
.sm-history-legend .dot-cpu { background: #58a6ff; }
.sm-history-legend .dot-mem { background: #d29922; }
/* ── Terminal ── */
.sm-terminal-toolbar {
display: flex;
gap: 8px;
align-items: center;
margin-bottom: 8px;
}
.sm-term-status {
margin-left: auto;
font-size: 12.5px;
color: var(--color-text-muted, #8b949e);
}
.sm-term-status.connected { color: #3fb950; }
.sm-term-status.error { color: #ff7b72; }
.sm-terminal-warning {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 6px;
background: rgba(255, 123, 114, 0.08);
border: 1px solid rgba(255, 123, 114, 0.3);
color: var(--color-text, #e6edf3);
font-size: 12.5px;
margin-bottom: 8px;
}
.sm-terminal-warning .material-icons {
color: #ff7b72;
}
.sm-terminal-host {
width: 100%;
height: 520px;
border-radius: 8px;
background: #0d1117;
padding: 8px;
border: 1px solid var(--color-border, #30363d);
}
.sm-term-hint {
margin-top: 6px;
font-size: 12px;
color: var(--color-text-muted, #8b949e);
}
/* ── Files ── */
.sm-files-toolbar {
display: flex;
gap: 6px;
align-items: center;
margin-bottom: 10px;
}
.sm-files-toolbar .spacer { flex: 1; }
.sm-files-path {
flex: 1;
min-width: 200px;
font-family: 'Cascadia Code', monospace;
font-size: 13px;
}
.sm-files-table-wrapper {
border-radius: 8px;
border: 1px solid var(--color-border, #30363d);
overflow: auto;
max-height: 540px;
}
.sm-files-table {
width: 100%;
border-collapse: collapse;
}
.sm-files-table tbody tr {
cursor: pointer;
}
.sm-files-table tbody tr:hover {
background: var(--color-surface-hover, #1f2933);
}
.sm-files-table .material-icons {
color: var(--color-text-muted, #8b949e);
font-size: 20px;
vertical-align: middle;
}
.sm-files-table .sm-file-icon-dir { color: #58a6ff; }
.sm-files-table .sm-file-icon-link { color: #d29922; }
.sm-files-table .sm-file-actions {
display: flex;
gap: 4px;
justify-content: flex-end;
}
.sm-files-table .sm-file-actions .btn {
padding: 4px 8px;
font-size: 12px;
}
.sm-files-table .sm-file-actions .material-icons {
font-size: 16px;
}
.sm-file-editor {
margin-top: 12px;
border-radius: 8px;
border: 1px solid var(--color-border, #30363d);
background: var(--color-surface, #161b22);
overflow: hidden;
}
.sm-file-editor-header {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border-bottom: 1px solid var(--color-border, #30363d);
background: var(--color-surface-alt, #0d1117);
}
.sm-file-editor-header .spacer { flex: 1; }
.sm-file-editor-path {
font-family: 'Cascadia Code', monospace;
font-size: 13px;
color: var(--color-text, #e6edf3);
}
.sm-file-textarea {
width: 100%;
min-height: 380px;
padding: 10px 12px;
background: #0d1117;
color: #e6edf3;
border: none;
resize: vertical;
font-family: 'Cascadia Code', 'Fira Code', monospace;
font-size: 13px;
line-height: 1.5;
outline: none;
}
.sm-file-meta {
margin: 0;
padding: 6px 12px;
border-top: 1px solid var(--color-border, #30363d);
font-size: 11.5px;
color: var(--color-text-muted, #8b949e);
}
/* ── Services ── */
.sm-services-toolbar {
display: flex;
gap: 8px;
align-items: center;
margin-bottom: 10px;
}
.sm-services-search {
flex: 1;
min-width: 240px;
}
.sm-services-count {
font-size: 12.5px;
color: var(--color-text-muted, #8b949e);
}
.sm-services-table-wrapper {
border-radius: 8px;
border: 1px solid var(--color-border, #30363d);
overflow: auto;
max-height: 620px;
}
.sm-services-table {
width: 100%;
border-collapse: collapse;
}
.sm-services-table .sm-svc-name {
font-family: 'Cascadia Code', monospace;
font-size: 13px;
word-break: break-all;
}
.sm-svc-state {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12.5px;
padding: 2px 8px;
border-radius: 12px;
background: rgba(110, 118, 129, 0.2);
color: var(--color-text-muted, #8b949e);
}
.sm-svc-state.active {
background: rgba(63, 185, 80, 0.15);
color: #3fb950;
}
.sm-svc-state.failed {
background: rgba(255, 123, 114, 0.15);
color: #ff7b72;
}
.sm-svc-actions {
display: flex;
gap: 4px;
flex-wrap: wrap;
}
.sm-svc-actions .btn {
padding: 3px 8px;
font-size: 12px;
}
.sm-svc-actions .material-icons {
font-size: 14px;
}
/* ── Responsive ── */
@media (max-width: 980px) {
.sm-overview-grid {
grid-template-columns: 1fr 1fr;
}
.sm-card-wide {
grid-column: span 2;
}
}
@media (max-width: 640px) {
.sm-overview-grid {
grid-template-columns: 1fr;
}
.sm-card-wide {
grid-column: span 1;
}
.sm-tab-btn .sm-tab-label {
display: none;
}
.sm-tab-btn {
padding: 8px;
}
}