feat(liveview): header View link opens active design as read-only canvas

Add an authenticated GET /api/v1/liveview/config endpoint exposing the
configured LIVEVIEW_KEY to logged-in admins, so the UI builds a
ready-to-use share link. The header View button opens
/view?key=...&design=<activeDesignId>; LiveView forwards ?design=<id>
to the public endpoint, which renders that design's canvas.

ha-relevant: maybe
This commit is contained in:
Pouzor
2026-06-04 14:10:29 +02:00
parent 1a426f6301
commit 05fb67e7f0
8 changed files with 161 additions and 7 deletions
+3 -1
View File
@@ -53,7 +53,9 @@ export const edgesApi = {
}
export const liveviewApi = {
load: (key: string) => publicApi.get('/liveview', { params: { key } }),
load: (key: string, design?: string) =>
publicApi.get('/liveview', { params: { key, ...(design ? { design_id: design } : {}) } }),
getConfig: () => api.get<{ enabled: boolean; key: string | null }>('/liveview/config'),
}
export const scanApi = {