Add WLED health monitoring, calibration test mode, and UI improvements
Some checks failed
Validate / validate (push) Failing after 8s

- Add background health checks (GET /json/info) with configurable interval per device
- Auto-detect LED count from WLED device on add (remove led_count from create API)
- Add calibration test mode: toggle edges on/off with colored LEDs via PUT endpoint
- Show WLED firmware version badge and LED count badge on device cards
- Add modal dirty tracking with discard confirmation on close/backdrop click
- Fix layout jump when modals open by compensating for scrollbar width
- Add state_check_interval to settings API and UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 23:44:29 +03:00
parent 579821a69b
commit d4261d76d8
10 changed files with 1047 additions and 315 deletions

View File

@@ -63,6 +63,12 @@ header {
margin-bottom: 30px;
}
.header-title {
display: flex;
align-items: center;
gap: 10px;
}
h1 {
font-size: 2rem;
color: var(--primary-color);
@@ -80,6 +86,16 @@ h2 {
gap: 15px;
}
#server-version {
font-size: 0.75rem;
font-weight: 400;
color: var(--text-secondary);
background: var(--border-color);
padding: 2px 8px;
border-radius: 10px;
letter-spacing: 0.03em;
}
.status-badge {
font-size: 1.5rem;
animation: pulse 2s infinite;
@@ -98,6 +114,45 @@ h2 {
50% { opacity: 0.5; }
}
/* WLED device health indicator */
.health-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 8px;
vertical-align: middle;
flex-shrink: 0;
}
.health-dot.health-online {
background-color: #4CAF50;
box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}
.health-dot.health-offline {
background-color: var(--danger-color);
box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}
.health-dot.health-unknown {
background-color: #9E9E9E;
animation: pulse 2s infinite;
}
.health-latency {
font-size: 0.7rem;
font-weight: 400;
color: #4CAF50;
margin-left: auto;
padding-left: 8px;
opacity: 0.85;
}
.health-latency.offline {
color: var(--danger-color);
}
section {
margin-bottom: 40px;
}
@@ -118,7 +173,6 @@ section {
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
@@ -129,9 +183,35 @@ section {
margin-bottom: 15px;
}
.card-header-badges {
display: flex;
align-items: center;
gap: 8px;
}
.display-badge,
.led-count-badge {
font-size: 0.8rem;
color: var(--info-color);
opacity: 0.8;
}
.card-title {
font-size: 1.2rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 6px;
}
.wled-version {
font-size: 0.65rem;
font-weight: 400;
color: var(--text-secondary);
background: var(--border-color);
padding: 1px 6px;
border-radius: 8px;
letter-spacing: 0.03em;
}
.badge {
@@ -254,14 +334,9 @@ section {
color: var(--info-color);
}
.badge-primary {
background: var(--primary-color);
color: white;
}
.badge-secondary {
background: var(--border-color);
color: var(--text-secondary);
.primary-star {
color: var(--primary-color);
font-size: 1.2rem;
}
/* Display Layout Visualization */
@@ -324,6 +399,22 @@ section {
background: linear-gradient(135deg, rgba(128, 128, 128, 0.1), rgba(128, 128, 128, 0.05));
}
.layout-position-label {
position: absolute;
top: 4px;
left: 6px;
font-size: 0.7rem;
color: var(--text-secondary);
}
.layout-index-label {
position: absolute;
bottom: 4px;
left: 6px;
font-size: 0.7rem;
color: var(--text-secondary);
}
.layout-display-label {
text-align: center;
padding: 5px;
@@ -386,6 +477,16 @@ section {
background: rgba(128, 128, 128, 0.2);
}
/* Card brightness slider */
.brightness-control {
padding: 0;
margin-bottom: 12px;
}
.brightness-slider {
width: 100%;
}
.add-device-section {
background: var(--card-bg);
border: 1px solid var(--border-color);
@@ -668,6 +769,193 @@ input:-webkit-autofill:focus {
text-decoration: underline;
}
/* Interactive Calibration Preview Edges */
.calibration-preview {
position: relative;
width: 100%;
max-width: 500px;
aspect-ratio: 16 / 10;
margin: 0 auto;
background: var(--card-bg);
border: 2px solid var(--border-color);
border-radius: 8px;
}
.preview-screen {
position: absolute;
top: 37px;
left: 57px;
right: 57px;
bottom: 37px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 4px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
color: white;
font-size: 14px;
}
.preview-edge {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
color: var(--text-secondary);
background: rgba(128, 128, 128, 0.15);
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s;
z-index: 2;
user-select: none;
}
.preview-edge:hover {
background: rgba(128, 128, 128, 0.3);
}
.preview-edge.active {
color: white;
font-weight: 600;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.edge-top {
top: 0;
left: 56px;
right: 56px;
height: 36px;
border-radius: 6px 6px 0 0;
flex-direction: row;
gap: 8px;
}
.edge-bottom {
bottom: 0;
left: 56px;
right: 56px;
height: 36px;
border-radius: 0 0 6px 6px;
flex-direction: row;
gap: 8px;
}
.edge-left {
left: 0;
top: 36px;
bottom: 36px;
width: 56px;
flex-direction: column;
border-radius: 6px 0 0 6px;
gap: 4px;
}
.edge-right {
right: 0;
top: 36px;
bottom: 36px;
width: 56px;
flex-direction: column;
border-radius: 0 6px 6px 0;
gap: 4px;
}
.edge-led-input {
width: 46px;
padding: 3px 2px;
font-size: 12px;
text-align: center;
background: rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 3px;
color: inherit;
}
.edge-led-input:focus {
border-color: var(--primary-color);
outline: none;
}
.edge-top .edge-led-input,
.edge-bottom .edge-led-input {
width: 56px;
}
/* Hide spinner arrows on edge inputs to save space */
.edge-led-input::-webkit-outer-spin-button,
.edge-led-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.edge-led-input[type=number] {
-moz-appearance: textfield;
}
/* Corner start-position buttons */
.preview-corner {
position: absolute;
width: 56px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: rgba(128, 128, 128, 0.4);
cursor: pointer;
z-index: 5;
transition: color 0.2s, transform 0.2s, text-shadow 0.2s;
user-select: none;
}
.preview-corner:hover {
color: rgba(76, 175, 80, 0.6);
transform: scale(1.2);
}
.preview-corner.active {
color: #4CAF50;
text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
font-size: 22px;
}
.corner-top-left { top: 0; left: 0; }
.corner-top-right { top: 0; right: 0; }
.corner-bottom-left { bottom: 0; left: 0; }
.corner-bottom-right { bottom: 0; right: 0; }
/* Direction toggle inside screen */
.direction-toggle {
display: flex;
align-items: center;
gap: 4px;
padding: 4px 10px;
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 12px;
color: white;
font-size: 12px;
cursor: pointer;
transition: background 0.2s;
user-select: none;
}
.direction-toggle:hover {
background: rgba(255, 255, 255, 0.25);
}
.direction-toggle #direction-icon {
font-size: 16px;
}
.preview-hint {
text-align: center;
font-size: 0.8rem;
color: var(--text-secondary);
margin-top: 8px;
}
@media (max-width: 768px) {
.displays-grid,
.devices-grid {