Files
htop-web/frontend/src/app/dashboard/dashboard.scss
T
2026-10-27 22:04:28 +01:00

768 lines
11 KiB
SCSS

:host {
display: block;
min-height: 100vh;
background: #0b1120;
color: #e5e7eb;
font-family: Inter, "Segoe UI", sans-serif;
}
.dashboard {
max-width: 1440px;
margin: 0 auto;
padding: 32px;
}
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
margin-bottom: 24px;
h1 {
margin: 0;
font-size: 30px;
font-weight: 700;
letter-spacing: -1px;
}
p {
margin: 8px 0 0;
color: #94a3b8;
}
}
.header-actions {
display: flex;
align-items: center;
justify-content: flex-end;
flex-wrap: wrap;
gap: 12px;
}
.view-switcher {
display: inline-flex;
gap: 4px;
padding: 4px;
border: 1px solid #263449;
border-radius: 10px;
background: #111c2e;
button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 9px 13px;
border: 1px solid transparent;
border-radius: 7px;
background: transparent;
color: #94a3b8;
font: inherit;
font-size: 13px;
cursor: pointer;
transition: background 150ms ease, color 150ms ease;
&:hover {
color: #e5e7eb;
}
&.active {
border-color: #334155;
background: #243449;
color: #93c5fd;
}
}
}
.live-indicator {
display: inline-flex;
align-items: center;
gap: 9px;
padding: 9px 13px;
border: 1px solid #23483c;
border-radius: 20px;
background: #10271f;
color: #86efac;
font-size: 13px;
white-space: nowrap;
}
.live-dot {
width: 8px;
height: 8px;
flex-shrink: 0;
border-radius: 50%;
background: #4ade80;
box-shadow: 0 0 10px #4ade8080;
}
.system-info {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px;
margin-bottom: 20px;
> div {
display: flex;
flex-direction: column;
gap: 8px;
min-width: 0;
padding: 20px;
border: 1px solid #263449;
border-radius: 12px;
background: #111c2e;
}
strong {
overflow-wrap: anywhere;
font-size: 14px;
font-weight: 600;
}
}
.label {
color: #8292aa;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
}
.muted {
color: #94a3b8;
font-size: 13px;
}
.metrics-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
}
.metric-card {
padding: 24px;
border: 1px solid #263449;
border-radius: 14px;
background: #111c2e;
}
.card-heading {
display: flex;
align-items: center;
gap: 12px;
}
.metric-icon {
display: grid;
place-items: center;
width: 42px;
height: 42px;
border-radius: 10px;
font-size: 12px;
font-weight: 800;
}
.cpu-icon {
background: #172e4d;
color: #60a5fa;
}
.memory-icon {
background: #40251e;
color: #fb923c;
}
.metric-value {
margin: 24px 0 18px;
font-size: clamp(36px, 5vw, 52px);
font-weight: 700;
letter-spacing: -2px;
span {
margin-left: 4px;
color: #94a3b8;
font-size: 24px;
}
}
.progress-track {
height: 8px;
overflow: hidden;
border-radius: 8px;
background: #263449;
}
.progress-fill {
height: 100%;
border-radius: inherit;
transition: width 400ms ease;
}
.cpu-fill {
background: #60a5fa;
}
.memory-fill {
background: #fb923c;
}
.memory-details {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 8px;
margin-top: 18px;
color: #cbd5e1;
font-size: 12px;
}
.card-footer {
margin: 18px 0 0;
color: #8292aa;
font-size: 12px;
}
.loading {
display: grid;
justify-items: center;
gap: 16px;
padding: 80px 20px;
color: #94a3b8;
}
.spinner {
width: 32px;
height: 32px;
border: 3px solid #263449;
border-top-color: #60a5fa;
border-radius: 50%;
animation: spin 800ms linear infinite;
}
/* htop system panel */
.htop-system-panel {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 22px 32px;
margin-bottom: 20px;
padding: 22px;
border: 1px solid #294438;
border-radius: 10px;
background: #101b19;
color: #d1fae5;
font-family: Consolas, "Courier New", monospace;
}
.htop-system-heading {
grid-column: 1 / -1;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding-bottom: 16px;
border-bottom: 1px solid #294438;
h2 {
margin: 6px 0 0;
overflow-wrap: anywhere;
color: #ecfdf5;
font-size: 20px;
}
}
.htop-brand {
color: #4ade80;
font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
}
.htop-os {
color: #86a99a;
font-size: 12px;
text-align: right;
}
.htop-resource {
min-width: 0;
}
.htop-resource-label {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
margin-bottom: 9px;
color: #86efac;
font-size: 13px;
strong {
color: #ecfdf5;
font-variant-numeric: tabular-nums;
}
}
.htop-bar {
height: 14px;
overflow: hidden;
border: 1px solid #315344;
border-radius: 3px;
background: #07110e;
}
.htop-bar-fill {
height: 100%;
transition: width 400ms ease;
}
.htop-cpu-fill {
background: repeating-linear-gradient(
90deg,
#4ade80 0,
#4ade80 8px,
#166534 8px,
#166534 10px
);
}
.htop-memory-fill {
background: repeating-linear-gradient(
90deg,
#34d399 0,
#34d399 8px,
#065f46 8px,
#065f46 10px
);
}
.htop-resource-meta {
margin-top: 8px;
overflow-wrap: anywhere;
color: #86a99a;
font-size: 11px;
line-height: 1.6;
}
/* Process table */
.processes-section {
margin-top: 28px;
padding: 24px;
border: 1px solid #29313d;
border-radius: 12px;
background: #151a22;
color: #e5e7eb;
}
.processes-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 20px;
h2 {
margin: 0 0 6px;
font-size: 20px;
}
p {
margin: 0;
}
}
.process-count {
padding: 6px 10px;
border: 1px solid #374151;
border-radius: 6px;
color: #a5b4fc;
font-size: 12px;
white-space: nowrap;
}
.process-search {
display: flex;
flex-direction: column;
gap: 8px;
max-width: 380px;
margin-bottom: 18px;
color: #9ca3af;
font-size: 12px;
input {
width: 100%;
box-sizing: border-box;
padding: 11px 12px;
border: 1px solid #374151;
border-radius: 7px;
outline: none;
background: #0d1117;
color: #e5e7eb;
font: inherit;
font-size: 14px;
&:focus {
border-color: #6366f1;
}
}
}
.table-scroll {
overflow-x: auto;
}
.process-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
white-space: nowrap;
th,
td {
padding: 12px 14px;
border-bottom: 1px solid #252d38;
text-align: left;
}
th {
background: #1b222d;
color: #9ca3af;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
}
th button {
padding: 0;
border: 0;
background: transparent;
color: inherit;
font: inherit;
cursor: pointer;
text-transform: inherit;
&:hover {
color: #c7d2fe;
}
}
tbody tr:hover {
background: #1d2531;
}
.numeric {
text-align: right;
font-variant-numeric: tabular-nums;
}
.pid-cell {
color: #9ca3af;
font-variant-numeric: tabular-nums;
}
.process-name {
max-width: 240px;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 600;
}
}
.process-state {
display: inline-block;
padding: 3px 7px;
border-radius: 4px;
background: #163629;
color: #86efac;
font-size: 11px;
}
.cpu-value {
display: inline-block;
min-width: 60px;
font-variant-numeric: tabular-nums;
}
.cpu-high {
color: #fca5a5;
}
.mini-progress {
width: 60px;
height: 3px;
margin: 5px 0 0 auto;
overflow: hidden;
border-radius: 3px;
background: #303846;
}
.mini-progress-fill {
height: 100%;
border-radius: inherit;
background: #818cf8;
transition: width 200ms ease;
}
.empty-processes {
padding: 30px !important;
color: #9ca3af;
text-align: center !important;
}
.dashboard-footer {
display: flex;
justify-content: space-between;
gap: 12px;
margin-top: 28px;
padding-top: 18px;
border-top: 1px solid #263449;
color: #8292aa;
font-size: 12px;
}
/* Terminal-style htop mode */
.dashboard.htop-mode {
max-width: none;
min-height: 100vh;
background: #080f0d;
color: #c7f9d4;
font-family: Consolas, "Courier New", monospace;
.page-header {
h1 {
color: #4ade80;
font-size: 26px;
letter-spacing: 0;
}
> div > p {
color: #86a99a;
}
}
.view-switcher {
border-color: #294438;
background: #101b19;
button {
color: #86a99a;
&.active {
border-color: #326449;
background: #183326;
color: #86efac;
}
}
}
.live-indicator {
border-color: #294438;
background: #101b19;
color: #86efac;
}
.system-info {
> div {
border-color: #294438;
border-radius: 6px;
background: #101b19;
}
.label,
.muted {
color: #86a99a;
}
strong {
color: #d1fae5;
}
}
.processes-section {
border-color: #294438;
border-radius: 8px;
background: #101b19;
color: #d1fae5;
}
.processes-header {
h2 {
color: #4ade80;
}
.muted {
color: #86a99a;
}
}
.process-count {
border-color: #326449;
color: #86efac;
}
.process-search {
color: #86a99a;
input {
border-color: #294438;
border-radius: 4px;
background: #080f0d;
color: #d1fae5;
font-family: inherit;
&:focus {
border-color: #4ade80;
}
}
}
.process-table {
font-family: Consolas, "Courier New", monospace;
font-size: 12px;
th,
td {
border-bottom-color: #20352a;
}
th {
background: #183326;
color: #86efac;
}
th button:hover {
color: #d1fae5;
}
tbody tr:hover {
background: #183326;
}
.pid-cell {
color: #86a99a;
}
.process-name {
color: #d1fae5;
}
}
.process-state {
border-radius: 3px;
background: #183326;
color: #86efac;
}
.cpu-value {
color: #a7f3d0;
}
.cpu-high {
color: #fca5a5;
}
.mini-progress {
background: #20352a;
}
.mini-progress-fill {
background: #4ade80;
}
.empty-processes {
color: #86a99a;
}
.dashboard-footer {
border-top-color: #294438;
color: #86a99a;
}
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@media (max-width: 900px) {
.page-header {
align-items: flex-start;
}
.header-actions {
align-items: flex-end;
flex-direction: column;
}
.system-info {
grid-template-columns: 1fr;
}
.htop-system-panel {
grid-template-columns: 1fr;
}
.htop-system-heading {
grid-column: auto;
}
}
@media (max-width: 760px) {
.dashboard {
padding: 20px 14px;
}
.page-header {
flex-direction: column;
align-items: stretch;
}
.header-actions {
align-items: flex-start;
flex-direction: row;
justify-content: space-between;
}
.metrics-grid {
grid-template-columns: 1fr;
}
.live-indicator {
font-size: 11px;
}
.processes-section {
padding: 14px;
}
.processes-header {
align-items: flex-start;
}
.process-table th,
.process-table td {
padding: 10px;
}
.htop-system-panel {
padding: 16px;
}
.htop-system-heading {
align-items: flex-start;
flex-direction: column;
}
.htop-os {
text-align: left;
}
.dashboard-footer {
flex-wrap: wrap;
}
}