BetterFrame/nodered/src/bf-layout-switch.html
Mitchell R b83782b8e0 feat: Node-RED custom nodes + dashboard entity type
Node-RED nodes (nodered/):
- bf-config: shared server URL + admin API key
- bf-event-in: filter kiosk events by topic glob
- bf-layout-switch: POST display layout-switch
- bf-power: kiosk wake/standby
- bf-fan: kiosk fan control
- bf-cameras: query camera list
- Drag-droppable from Node-RED palette

Server:
- Admin Bearer API key auth on /admin/* (NodeRED can call admin API)
- GET /api/admin/cameras for bf-cameras node
- Dashboard entity type:
  - entities.type CHECK adds 'dashboard'
  - entities.dashboard_id column
  - shared/nodered-bridge.ts listDashboards() polls /nrdp/flows
  - Bundle resolves dashboard entity → web cell at /dash/<id>
  - POST /admin/entities/sync-dashboards mirrors Node-RED tabs
  - EntitiesPage shows Dashboards section + Sync button
  - EntityEditPage for dashboard: read-only + "Open in Node-RED"
  - No create/delete from BF UI — managed in Node-RED
- sec-config: noderedUrl on admin-http (was already on api-http)
2026-05-13 01:47:53 +02:00

41 lines
1.3 KiB
HTML

<script type="text/javascript">
RED.nodes.registerType("bf-layout-switch", {
category: "BetterFrame",
color: "#a6d4ff",
defaults: {
name: { value: "" },
config: { value: "", type: "bf-config", required: true },
display_id: { value: "" },
layout_id: { value: "" },
},
inputs: 1,
outputs: 1,
icon: "betterframe.svg",
label: function () {
return this.name || "bf layout switch";
},
paletteLabel: "bf layout switch",
});
</script>
<script type="text/html" data-template-name="bf-layout-switch">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" />
</div>
<div class="form-row">
<label for="node-input-config"><i class="fa fa-cog"></i> BF</label>
<input type="text" id="node-input-config" />
</div>
<div class="form-row">
<label for="node-input-display_id"><i class="fa fa-tv"></i> Display ID</label>
<input type="number" id="node-input-display_id" />
</div>
<div class="form-row">
<label for="node-input-layout_id"><i class="fa fa-th"></i> Layout ID</label>
<input type="number" id="node-input-layout_id" />
</div>
<div class="form-tips">
Either field can be overridden by <code>msg.display_id</code> / <code>msg.layout_id</code>.
</div>
</script>