Add profiles UI, dashboard improvements, and AmbiLED support

- Profile management tab with cards, condition editor, process browser
- Dashboard: add profiles section, compact layout, type subtitles
- AmbiLED serial device support (raw RGB + 0xFF show command)
- Unified serial device handling (isSerialDevice helper)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 15:12:45 +03:00
parent 29d9b95885
commit aa105f3958
5 changed files with 914 additions and 59 deletions

View File

@@ -3225,32 +3225,34 @@ input:-webkit-autofill:focus {
/* ── Dashboard ── */
.dashboard-section {
margin-bottom: 24px;
margin-bottom: 16px;
}
.dashboard-section-header {
font-size: 1rem;
font-size: 0.8rem;
font-weight: 600;
margin-bottom: 10px;
margin-bottom: 6px;
color: var(--text-secondary);
display: flex;
align-items: center;
gap: 8px;
gap: 6px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.dashboard-section-count {
background: var(--border-color);
color: var(--text-secondary);
border-radius: 10px;
padding: 1px 8px;
font-size: 0.8rem;
padding: 0 6px;
font-size: 0.75rem;
font-weight: 600;
}
.dashboard-stop-all {
margin-left: auto;
padding: 3px 10px;
font-size: 0.75rem;
padding: 2px 8px;
font-size: 0.7rem;
white-space: nowrap;
flex: 0 0 auto;
}
@@ -3259,35 +3261,36 @@ input:-webkit-autofill:focus {
display: grid;
grid-template-columns: 1fr auto auto;
align-items: center;
gap: 16px;
padding: 12px 16px;
gap: 12px;
padding: 8px 12px;
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 8px;
margin-bottom: 8px;
border-radius: 6px;
margin-bottom: 4px;
}
.dashboard-target-info {
display: flex;
align-items: center;
gap: 8px;
gap: 6px;
min-width: 0;
overflow: hidden;
}
.dashboard-target-icon {
font-size: 1.2rem;
font-size: 1rem;
flex-shrink: 0;
}
.dashboard-target-name {
font-size: 0.85rem;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
align-items: center;
gap: 6px;
gap: 4px;
}
.dashboard-target-name .health-dot {
@@ -3296,7 +3299,7 @@ input:-webkit-autofill:focus {
}
.dashboard-target-subtitle {
font-size: 0.75rem;
font-size: 0.7rem;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
@@ -3304,24 +3307,25 @@ input:-webkit-autofill:focus {
}
.dashboard-target-metrics {
display: grid;
grid-template-columns: 90px 80px 60px;
display: flex;
gap: 12px;
align-items: center;
}
.dashboard-metric {
text-align: center;
min-width: 48px;
}
.dashboard-metric-value {
font-size: 1.05rem;
font-size: 0.85rem;
font-weight: 700;
color: var(--primary-color);
line-height: 1.2;
}
.dashboard-metric-label {
font-size: 0.7rem;
font-size: 0.6rem;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.3px;
@@ -3330,11 +3334,11 @@ input:-webkit-autofill:focus {
.dashboard-target-actions {
display: flex;
align-items: center;
gap: 8px;
gap: 4px;
}
.dashboard-status-dot {
font-size: 1.2rem;
font-size: 1rem;
line-height: 1;
}
@@ -3345,24 +3349,39 @@ input:-webkit-autofill:focus {
.dashboard-no-targets {
text-align: center;
padding: 40px 20px;
padding: 32px 16px;
color: var(--text-secondary);
font-size: 1rem;
font-size: 0.9rem;
}
.dashboard-badge-stopped {
padding: 3px 10px;
padding: 2px 8px;
border-radius: 10px;
font-size: 0.75rem;
font-size: 0.7rem;
font-weight: 600;
background: var(--border-color);
color: var(--text-secondary);
flex-shrink: 0;
}
.dashboard-badge-active {
padding: 2px 8px;
border-radius: 10px;
font-size: 0.7rem;
font-weight: 600;
background: var(--success-color, #28a745);
color: #fff;
flex-shrink: 0;
}
.dashboard-profile .dashboard-target-metrics {
min-width: 48px;
}
@media (max-width: 768px) {
.dashboard-target {
grid-template-columns: 1fr;
gap: 10px;
gap: 6px;
}
.dashboard-target-actions {
@@ -3370,3 +3389,189 @@ input:-webkit-autofill:focus {
}
}
/* ===== PROFILES ===== */
.badge-profile-active {
background: var(--success-color, #28a745);
color: #fff;
}
.badge-profile-inactive {
background: var(--border-color);
color: var(--text-color);
}
.badge-profile-disabled {
background: var(--border-color);
color: var(--text-muted);
opacity: 0.7;
}
.profile-status-disabled {
opacity: 0.6;
}
.profile-logic-label {
font-size: 0.7rem;
font-weight: 600;
color: var(--text-muted);
padding: 0 4px;
}
/* Profile condition editor rows */
.profile-condition-row {
border: 1px solid var(--border-color);
border-radius: 6px;
padding: 10px;
margin-bottom: 8px;
background: var(--bg-secondary, var(--bg-color));
}
.condition-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.condition-type-label {
font-weight: 600;
font-size: 0.9rem;
}
.btn-remove-condition {
background: none;
border: none;
color: var(--danger-color, #dc3545);
cursor: pointer;
font-size: 1rem;
padding: 2px 6px;
}
.condition-fields {
display: flex;
flex-direction: column;
gap: 8px;
}
.condition-field label {
display: block;
font-size: 0.85rem;
margin-bottom: 3px;
color: var(--text-muted);
}
.condition-field select,
.condition-field textarea {
width: 100%;
padding: 6px 8px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--bg-color);
color: var(--text-color);
font-size: 0.9rem;
font-family: inherit;
}
.condition-apps {
resize: vertical;
min-height: 60px;
}
.condition-apps-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.btn-browse-apps {
background: none;
border: 1px solid var(--border-color);
color: var(--text-color);
font-size: 0.75rem;
padding: 2px 8px;
border-radius: 4px;
cursor: pointer;
transition: border-color 0.2s, background 0.2s;
}
.btn-browse-apps:hover {
border-color: var(--primary-color);
background: rgba(33, 150, 243, 0.1);
}
.process-picker {
margin-top: 6px;
border: 1px solid var(--border-color);
border-radius: 4px;
overflow: hidden;
}
.process-picker-search {
width: 100%;
padding: 6px 8px;
border: none;
border-bottom: 1px solid var(--border-color);
background: var(--bg-color);
color: var(--text-color);
font-size: 0.85rem;
font-family: inherit;
outline: none;
box-sizing: border-box;
}
.process-picker-list {
max-height: 160px;
overflow-y: auto;
}
.process-picker-item {
padding: 4px 8px;
font-size: 0.8rem;
cursor: pointer;
transition: background 0.1s;
}
.process-picker-item:hover {
background: rgba(33, 150, 243, 0.15);
}
.process-picker-item.added {
color: var(--text-muted);
cursor: default;
opacity: 0.6;
}
.process-picker-loading {
padding: 8px;
font-size: 0.8rem;
color: var(--text-muted);
text-align: center;
}
/* Profile target checklist */
.profile-targets-checklist {
max-height: 200px;
overflow-y: auto;
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 6px;
}
.profile-target-item {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 6px;
cursor: pointer;
border-radius: 3px;
}
.profile-target-item:hover {
background: var(--bg-secondary, var(--bg-color));
}
.profile-target-item input[type="checkbox"] {
margin: 0;
}