add ui, new config opts

This commit is contained in:
2026-07-16 16:32:44 -04:00
parent 8effff311b
commit df01e060e4
33 changed files with 1104 additions and 37 deletions
+151
View File
@@ -0,0 +1,151 @@
/* Layout + components for the EcoNet admin UI. Colors come from Pico's CSS
custom properties so light and dark themes both work without overrides. */
body {
max-width: 1100px;
margin: 0 auto;
padding: 2.5rem 2rem;
}
.app-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 2.5rem;
}
.app-header hgroup { margin-bottom: 0; }
.theme-toggle {
flex: 0 0 auto;
width: 3rem;
height: 3rem;
padding: 0;
border-radius: 50%;
font-size: 1.25rem;
line-height: 1;
}
/* Comfortable, capped card width that wraps and centers, so a single device
sits in a tidy card surrounded by whitespace rather than stretching wide or
getting crammed. min(100%, 420px) keeps it fluid on narrow screens. */
.device-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 460px));
justify-content: center;
gap: 2rem;
}
.device-card {
margin: 0;
padding: 2rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.card-head {
display: flex;
align-items: center;
gap: 1rem;
}
.device-icon {
flex: 0 0 auto;
width: 56px;
height: 56px;
color: var(--pico-primary);
}
.card-title { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.card-title strong { display: block; font-size: 1.2rem; }
.card-title small { color: var(--pico-muted-color); word-break: break-all; }
.bug-btn {
flex: 0 0 auto;
padding: 0.25rem 0.4rem;
background: none;
border: none;
border-radius: var(--pico-border-radius);
font-size: 1.1rem;
line-height: 1;
cursor: pointer;
opacity: 0.55;
transition: opacity 0.15s ease;
}
.bug-btn:hover { opacity: 1; }
.dot {
flex: 0 0 auto;
width: 0.8rem;
height: 0.8rem;
border-radius: 50%;
display: inline-block;
}
.dot-ok { background: var(--pico-color-green-500, #22c55e); }
.dot-off { background: var(--pico-color-red-500, #ef4444); }
.stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem 1.5rem;
}
.stats > div { display: flex; flex-direction: column; gap: 0.2rem; }
.stats span { color: var(--pico-muted-color); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stats b { font-size: 1.1rem; }
.fill { display: flex; flex-direction: column; gap: 0.45rem; }
.fill-head { display: flex; justify-content: space-between; align-items: baseline; }
.fill-head span { color: var(--pico-muted-color); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.fill-meter {
height: 0.6rem;
border-radius: 999px;
overflow: hidden;
background: color-mix(in srgb, var(--pico-muted-color) 22%, transparent);
}
.fill-bar { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.fill-high { background: var(--pico-color-green-500, #22c55e); }
.fill-mid { background: var(--pico-color-amber-500, #f59e0b); }
.fill-low { background: var(--pico-color-red-500, #ef4444); }
.card-foot {
display: flex;
flex-direction: column;
gap: 0.6rem;
}
.mode-label { margin: 0; font-size: 0.85rem; color: var(--pico-muted-color); }
.mode-label select { margin-top: 0.35rem; margin-bottom: 0; }
.mode-fixed { color: var(--pico-muted-color); }
.badge {
align-self: flex-start;
padding: 0.2rem 0.55rem;
border-radius: var(--pico-border-radius);
font-size: 0.8rem;
}
.badge-pending {
background: var(--pico-primary-background);
color: var(--pico-primary-inverse);
}
.badge-error {
background: var(--pico-color-red-500, #ef4444);
color: #fff;
}
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; }
.debug-modal pre {
max-height: 65vh;
overflow: auto;
margin: 0;
}
.debug-modal code { white-space: pre; }
/* Mobile: tighten spacing; the grid already collapses to a single full-width
column via minmax(min(100%, 420px), …). */
@media (max-width: 480px) {
body { padding: 1.25rem 1rem; }
.app-header { margin-bottom: 1.5rem; }
.app-header h1 { font-size: 1.6rem; }
.device-grid { gap: 1.25rem; }
.device-card { padding: 1.5rem; gap: 1.25rem; }
.device-icon { width: 48px; height: 48px; }
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="14" y="8" width="20" height="32" rx="4"/>
<line x1="18" y1="40" x2="18" y2="43"/>
<line x1="30" y1="40" x2="30" y2="43"/>
<path d="M25 15l-5 7h4l-1 7 6-8h-4z" fill="currentColor" stroke="none"/>
</svg>

After

Width:  |  Height:  |  Size: 397 B

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="14" y="6" width="20" height="28" rx="4"/>
<line x1="18" y1="34" x2="18" y2="37"/>
<line x1="30" y1="34" x2="30" y2="37"/>
<path d="M24 38c-3 0-5 2-5 4.5S21 46 24 46s5-1.5 5-3.5c0-3-3-3.5-2-6.5-2 1-3 2.5-3 4.5z"/>
</svg>

After

Width:  |  Height:  |  Size: 415 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="14" y="12" width="20" height="30" rx="4"/>
<line x1="18" y1="42" x2="18" y2="45"/>
<line x1="30" y1="42" x2="30" y2="45"/>
<circle cx="24" cy="9" r="6"/>
<path d="M24 5.5v7M20.5 9h7M21.5 6.5l5 5M26.5 6.5l-5 5"/>
</svg>

After

Width:  |  Height:  |  Size: 416 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="12" y="10" width="24" height="22" rx="3"/>
<line x1="18" y1="32" x2="18" y2="40"/>
<line x1="30" y1="32" x2="30" y2="40"/>
<line x1="17" y1="17" x2="31" y2="17"/>
<circle cx="24" cy="25" r="3"/>
</svg>

After

Width:  |  Height:  |  Size: 399 B

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<rect x="14" y="8" width="20" height="32" rx="4"/>
<line x1="18" y1="40" x2="18" y2="43"/>
<line x1="30" y1="40" x2="30" y2="43"/>
<path d="M21 20a3 3 0 1 1 4 2.8c-1 .5-1 1.2-1 2.2"/>
<line x1="24" y1="30" x2="24" y2="30.5"/>
</svg>

After

Width:  |  Height:  |  Size: 421 B

File diff suppressed because one or more lines are too long