Working state after implementing dark theme.

This commit is contained in:
Kalzu Rekku
2025-06-11 16:29:40 +03:00
parent d4c71e7d2c
commit d93b0ee4ee
6 changed files with 453 additions and 165 deletions

View File

@ -1,156 +1,275 @@
/* Nord Polar Night Palette */
:root {
--nord0: #2E3440; /* Darkest background */
--nord1: #3B4252; /* Dark background */
--nord2: #434C5E; /* Medium background */
--nord3: #4C566A; /* Light background */
--nord4: #D8DEE9; /* Lightest text */
--nord5: #E5E9F0; /* Light text */
--nord6: #ECEFF4; /* Brightest text */
--nord7: #8FBCBB; /* Teal accent */
--nord8: #88C0D0; /* Cyan accent */
--nord9: #81A1C1; /* Blue accent (unavailable) */
--nord10: #5E81AC; /* Darker blue */
--nord11: #BF616A; /* Red (critical/high latency) */
--nord12: #D08770; /* Orange (warning/medium latency) */
--nord13: #A3BE8C; /* Green (healthy/low latency) */
--nord14: #B48EAD; /* Purple */
--nord15: #D08770; /* Coral */
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
display: flex;
flex-direction: column; /* Changed to column for header + grid */
flex-direction: column;
align-items: center;
min-height: 100vh; /* Use min-height to allow content to push body height */
min-height: 100vh;
margin: 0;
background-color: #f4f7f6;
color: #333;
padding: 20px; /* Add some padding */
box-sizing: border-box; /* Include padding in element's total width and height */
background-color: var(--nord0);
color: var(--nord4);
padding: 20px;
box-sizing: border-box;
}
.header-container {
text-align: center;
padding: 20px;
background-color: white;
background-color: var(--nord1);
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
margin-bottom: 20px;
width: 90%; /* Adjust width */
max-width: 800px; /* Max width for header */
width: 80vw;
max-width: 1200px;
}
h1 {
color: #0b2d48;
color: var(--nord6);
margin-bottom: 10px;
}
p {
font-size: 1rem;
color: #555;
color: var(--nord5);
margin: 5px 0;
}
code {
background-color: #e8e8e8;
background-color: var(--nord2);
padding: 3px 8px;
border-radius: 4px;
font-family: "Courier New", Courier, monospace;
font-size: 0.9rem;
color: var(--nord6);
}
#node-grid-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
gap: 15px; /* Space between grid items */
width: 90%; /* Adjust width */
max-width: 1200px; /* Max width for grid */
#node-grid-container, #log-table-container {
width: 80vw;
max-width: 1200px;
min-width: 400px;
padding: 20px;
background-color: white;
background-color: var(--nord3);
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.loading-message {
grid-column: 1 / -1; /* Span across all columns */
text-align: center;
font-style: italic;
color: #888;
.connection-grid {
display: grid;
grid-template-columns: minmax(15%, 1fr) repeat(4, minmax(15%, 1fr));
gap: 8px;
}
.node-cell {
border: 1px solid #ddd;
.grid-row {
display: contents;
}
.grid-cell {
border: 1px solid var(--nord2);
border-radius: 6px;
padding: 15px;
padding: 8px;
text-align: center;
font-size: 0.9rem;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
font-size: clamp(0.8rem, 1.5vw, 0.9rem);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.1s ease;
cursor: pointer;
position: relative; /* For tooltip positioning */
overflow: hidden; /* Hide overflow for truncated UUID */
position: relative;
overflow: hidden;
min-height: clamp(80px, 15vw, 120px);
}
.node-cell:hover {
.grid-cell:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.header-cell {
background-color: var(--nord2);
font-weight: bold;
color: var(--nord6);
}
.empty-cell {
background-color: transparent;
border: none;
box-shadow: none;
}
.node-uuid {
font-weight: bold;
margin-bottom: 5px;
color: #333;
color: var(--nord6);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; /* Truncate long UUIDs */
text-overflow: ellipsis;
}
.node-status-text {
font-size: 0.8rem;
color: #666;
.node-status-text, .conn-status-text {
font-size: clamp(0.7rem, 1.2vw, 0.8rem);
color: var(--nord5);
}
/* Health Status Colors */
.node-healthy {
background-color: #e6ffe6; /* Light green */
border-color: #4CAF50; /* Green */
background-color: rgba(163, 190, 140, 0.2); /* --nord13 */
border-color: var(--nord13);
}
.node-warning {
background-color: #fffacd; /* Light yellow */
border-color: #FFC107; /* Orange */
background-color: rgba(208, 135, 112, 0.2); /* --nord12 */
border-color: var(--nord12);
}
.node-critical {
background-color: #ffe6e6; /* Light red */
border-color: #F44336; /* Red */
background-color: rgba(191, 97, 106, 0.2); /* --nord11 */
border-color: var(--nord11);
}
.node-unknown {
background-color: #f0f0f0; /* Light gray */
border-color: #9E9E9E; /* Gray */
background-color: rgba(129, 161, 193, 0.2); /* --nord9 */
border-color: var(--nord9);
}
/* Latency Colors */
.latency-low {
background-color: rgba(163, 190, 140, 0.2); /* --nord13, green for <=200ms */
border-color: var(--nord13);
}
.latency-medium {
background-color: rgba(208, 135, 112, 0.2); /* --nord12, orange for <=1000ms */
border-color: var(--nord12);
}
.latency-high {
background-color: rgba(191, 97, 106, 0.2); /* --nord11, red for >1000ms */
border-color: var(--nord11);
}
.latency-unavailable {
background-color: rgba(129, 161, 193, 0.2); /* --nord9, blue for N/A */
border-color: var(--nord9);
}
/* Tooltip styles */
.node-tooltip {
visibility: hidden;
opacity: 0;
width: 200px;
background-color: #333;
color: #fff;
width: clamp(180px, 20vw, 220px);
background-color: var(--nord1);
color: var(--nord4);
text-align: left;
border-radius: 6px;
padding: 10px;
position: absolute;
z-index: 1;
bottom: 100%; /* Position above the node cell */
bottom: 100%;
left: 50%;
margin-left: -100px; /* Center the tooltip */
margin-left: clamp(-90px, -10vw, -110px);
transition: opacity 0.3s;
font-size: 0.8rem;
white-space: normal; /* Allow text to wrap */
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
font-size: clamp(0.7rem, 1.2vw, 0.8rem);
white-space: normal;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.node-tooltip::after {
content: " ";
position: absolute;
top: 100%; /* At the bottom of the tooltip */
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #333 transparent transparent transparent;
border-color: var(--nord1) transparent transparent transparent;
}
.node-cell:hover .node-tooltip {
.grid-cell:hover .node-tooltip {
visibility: visible;
opacity: 1;
}
.node-tooltip p {
margin: 2px 0;
color: #eee;
}
color: var(--nord4);
}
/* Log Table Styles */
.log-table {
width: 100%;
border-collapse: collapse;
background-color: var(--nord2);
border-radius: 6px;
overflow: hidden;
}
.log-table th, .log-table td {
padding: 10px;
text-align: left;
border-bottom: 1px solid var(--nord3);
font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}
.log-table th {
background-color: var(--nord1);
color: var(--nord6);
cursor: pointer;
}
.log-table th.sortable:hover {
background-color: var(--nord10);
}
.log-table tr:hover {
background-color: var(--nord3);
}
.log-table .log-level {
font-weight: bold;
}
.log-level-info {
color: var(--nord13); /* Green */
}
.log-level-warning {
color: var(--nord12); /* Orange */
}
.log-level-error {
color: var(--nord11); /* Red */
}
.json-toggle {
color: var(--nord8);
cursor: pointer;
text-decoration: underline;
}
.json-content {
background-color: var(--nord1);
padding: 8px;
border-radius: 4px;
font-family: "Courier New", Courier, monospace;
font-size: 0.8rem;
color: var(--nord5);
margin-top: 5px;
white-space: pre-wrap;
}