mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 17:56:34 +00:00
feat(nodered): install Dashboard 2.0 + auto-sync on entities page
- Bake @flowfuse/node-red-dashboard into Node-RED Docker image - Fire-and-forget syncDashboardsFromNodered() on GET /admin/entities so dashboard tabs appear without manual sync button click
This commit is contained in:
parent
0ae161173a
commit
8e75ed379d
2 changed files with 5 additions and 2 deletions
|
|
@ -22,10 +22,12 @@ COPY deploy/docker/nodered-settings.js /usr/src/bf-settings.js
|
|||
COPY deploy/docker/nodered-entrypoint.sh /usr/local/bin/bf-nodered-entrypoint
|
||||
RUN chmod +x /usr/local/bin/bf-nodered-entrypoint
|
||||
|
||||
# Install deps for the nodes
|
||||
# Install deps for the nodes + FlowFuse Dashboard 2.0 into user dir
|
||||
RUN cd /usr/src/betterframe-nodes && \
|
||||
npm install --omit=dev && \
|
||||
chown -R node-red:root /usr/src/betterframe-nodes /usr/src/bf-settings.js
|
||||
cd /usr/src/node-red && \
|
||||
npm install @flowfuse/node-red-dashboard && \
|
||||
chown -R node-red:root /usr/src/betterframe-nodes /usr/src/bf-settings.js /usr/src/node-red
|
||||
|
||||
# Run entrypoint as root so it can fix stale /data state (e.g. /data/settings.js
|
||||
# left as a directory by a previous broken bind mount). Entrypoint drops to
|
||||
|
|
|
|||
|
|
@ -590,6 +590,7 @@ export function registerAdminRoutes(app: H3, deps: AdminDeps): void {
|
|||
|
||||
app.get("/admin/entities", (event) => {
|
||||
const user = event.context.user!;
|
||||
syncDashboardsFromNodered(deps).catch(() => {});
|
||||
return htmlPage(EntitiesPage({
|
||||
user: user.username,
|
||||
entities: deps.repo.listEntities(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue