Dashboard Studio 2.0.0: Admin, Builder and Dashboard screens, roles, Haven
- Home Assistant administrators are admins: Dashboard, Builder and Admin screens - Everyone else only sees the dashboards an admin chose, always in kiosk mode; the server enforces it (saving, people, devices, history are admin-only, and the websocket only allows reading states and controlling devices) - Admin screen: dashboards, people and what each sees (with preview), devices, messages to the screens, the Haven app, activity, about - Haven: new Android app (haven/) that only shows dashboards; replaces the Dashboard Studio Android app and signs in through Home Assistant's page - Screens pick up dashboard and access changes within a minute - Version history records who made each change; panel visible to all users Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1418,3 +1418,111 @@ body.kiosk.idle, body.kiosk.idle * { cursor: none !important; }
|
||||
.hist-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--separator); }
|
||||
.hist-row:last-child { border-bottom: 0; }
|
||||
.hist-when { font-weight: 500; }
|
||||
|
||||
/* ============================================================ screens: Dashboard, Builder, Admin */
|
||||
.mode-seg { display: flex; gap: 2px; padding: 2px; border-radius: 11px; background: var(--fill); }
|
||||
.mode-seg[hidden] { display: none; }
|
||||
.mode-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 9px; min-height: 32px; padding: 0 12px; cursor: pointer; font-weight: 500; color: var(--text-2); }
|
||||
.mode-seg button .i { font-size: 17px; }
|
||||
.mode-seg button:hover { color: var(--text); }
|
||||
.mode-seg button.on { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
|
||||
.mode-seg button[data-mode="builder"].on { background: var(--accent); color: var(--on-accent); }
|
||||
@media (max-width: 760px) { .mode-seg button span { display: none; } .mode-seg button { padding: 0 9px; } }
|
||||
|
||||
body.admin-mode #workspace, body.admin-mode #topbar .picker, body.admin-mode #btn-new, body.admin-mode #topbar .view-only, body.admin-mode #topbar .edit-only { display: none !important; }
|
||||
body.admin-mode #topbar::before { content: "Dashboard Studio"; font-weight: 650; font-size: 17px; padding-left: 8px; }
|
||||
|
||||
/* ============================================================ admin */
|
||||
#admin { position: absolute; inset: 0; display: flex; padding-top: 72px; background: var(--canvas); }
|
||||
#admin[hidden] { display: none; }
|
||||
.adm-nav { flex: none; width: 220px; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--separator); background: var(--surface); overflow-y: auto; }
|
||||
.adm-nav button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; border-radius: 10px; padding: 9px 12px; min-height: 40px; cursor: pointer; font-size: 15px; text-align: left; color: var(--text); }
|
||||
.adm-nav button .i { font-size: 19px; color: var(--text-2); }
|
||||
.adm-nav button:hover { background: var(--fill); }
|
||||
.adm-nav button.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 650; }
|
||||
.adm-nav button.on .i { color: var(--accent); }
|
||||
.adm-body { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 28px 60px; }
|
||||
.adm-body > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
|
||||
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
|
||||
.adm-head h2 { font-size: 28px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
|
||||
.adm-head p { margin: 0; max-width: 640px; }
|
||||
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
|
||||
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
|
||||
.adm-card { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); border: 1px solid var(--separator); }
|
||||
.ac-top { display: flex; gap: 12px; align-items: center; }
|
||||
.ac-top h3 { margin: 0 0 2px; font-size: 17px; overflow-wrap: anywhere; }
|
||||
.ac-swatch { width: 52px; height: 52px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
|
||||
.ac-swatch .i { font-size: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
|
||||
.ac-who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
|
||||
.ac-who .i { font-size: 16px; flex: none; }
|
||||
.ac-actions { display: flex; gap: 8px; margin-top: auto; }
|
||||
.ac-actions .btn:not(.icon) { flex: 1; }
|
||||
.adm-list { display: flex; flex-direction: column; gap: 10px; }
|
||||
#admin .grow { flex: 1; min-width: 0; }
|
||||
.person { background: var(--surface); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--separator); }
|
||||
.person.everyone { border-style: dashed; }
|
||||
.p-head { display: flex; align-items: center; gap: 12px; }
|
||||
.p-name { font-weight: 650; font-size: 16px; }
|
||||
.p-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); vertical-align: 2px; margin-left: 4px; }
|
||||
.adm-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--fill); font-weight: 700; color: var(--text-2); }
|
||||
.adm-avatar.admin { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
|
||||
.adm-avatar .i { font-size: 19px; }
|
||||
.p-access { margin: 12px 0 0 52px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.p-access .seg { max-width: 460px; }
|
||||
.p-access .field { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--text-2); }
|
||||
.p-access .field .input { max-width: 240px; }
|
||||
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.chip-check { position: relative; }
|
||||
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
|
||||
.chip-check span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border-radius: 99px; background: var(--fill); font-size: 13px; font-weight: 500; cursor: pointer; }
|
||||
.chip-check input:checked + span { background: var(--accent); color: var(--on-accent); }
|
||||
.chip-check input:checked + span::before { content: "✓"; margin-right: 6px; font-weight: 700; }
|
||||
.chip-check input:disabled + span { opacity: .55; cursor: default; }
|
||||
.chip-check input:focus-visible + span { box-shadow: var(--focus); }
|
||||
.dev-row, .act-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 10px 14px; border: 1px solid var(--separator); }
|
||||
.dev-row .grow .input { max-width: 320px; font-weight: 600; }
|
||||
.dev-row select.input { width: 200px; flex: none; }
|
||||
.dev-gap { width: 36px; flex: none; }
|
||||
.adm-panel { background: var(--surface); border-radius: 16px; padding: 18px; border: 1px solid var(--separator); margin-top: 18px; }
|
||||
.adm-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 17px; }
|
||||
.adm-panel h3 .i { color: var(--accent); }
|
||||
.an-form { display: grid; grid-template-columns: 1fr 2fr 180px auto; gap: 8px; margin-top: 12px; }
|
||||
.haven-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
|
||||
.haven-grid .adm-panel { margin-top: 0; display: flex; flex-direction: column; gap: 6px; }
|
||||
.haven-step .btn { align-self: flex-start; }
|
||||
.hs-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; }
|
||||
.act-list { display: flex; flex-direction: column; gap: 6px; }
|
||||
.act-list .btn { justify-content: flex-start; }
|
||||
.kp-dashes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 6px 0 4px; }
|
||||
.kp-dashes .btn { min-height: 56px; justify-content: flex-start; font-size: 16px; font-weight: 600; }
|
||||
@media (max-width: 760px) {
|
||||
#admin { flex-direction: column; }
|
||||
.adm-nav { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--separator); padding: 8px; }
|
||||
.adm-nav button { flex: none; padding: 8px 12px; }
|
||||
.adm-body { padding: 18px 14px 60px; }
|
||||
.adm-head h2 { font-size: 24px; }
|
||||
.p-access { margin-left: 0; }
|
||||
.dev-row { flex-wrap: wrap; }
|
||||
.dev-row .grow { flex-basis: calc(100% - 52px); }
|
||||
.dev-row select.input { flex: 1; width: auto; }
|
||||
.an-form { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
/* preview as someone else, and nothing to show */
|
||||
#preview-bar { position: fixed; z-index: 70; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
|
||||
padding: 8px 8px 8px 16px; border-radius: 14px; background: rgba(28, 28, 30, .9); color: #fff; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 30px rgba(0, 0, 0, .3); max-width: calc(100% - 24px); font-size: 14px; }
|
||||
#preview-bar[hidden] { display: none; }
|
||||
#preview-bar .btn { background: rgba(255, 255, 255, .16); color: #fff; flex: none; }
|
||||
body.previewing #btn-new { display: none; }
|
||||
#empty-note { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
|
||||
#empty-note[hidden] { display: none; }
|
||||
.en-card { max-width: 420px; text-align: center; }
|
||||
.en-ico { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: var(--fill); }
|
||||
.en-ico .i { font-size: 34px; color: var(--text-2); }
|
||||
.en-card h2 { margin: 0 0 8px; }
|
||||
.en-card p { color: var(--text-2); margin: 0; }
|
||||
body.empty #app { display: none; }
|
||||
body.in-haven #btn-new { display: none; }
|
||||
.haven-head { justify-content: flex-start; align-items: center; }
|
||||
.haven-head img { width: 64px; height: 64px; border-radius: 16px; flex: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
|
||||
.haven-head > div { flex: 1; min-width: 240px; }
|
||||
|
||||
Reference in New Issue
Block a user