Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flowfuse/node-red-dashboard

Package Overview
Dependencies
Maintainers
0
Versions
620
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flowfuse/node-red-dashboard - npm Package Compare versions

Comparing version 1.20.1-af1d14f-202412061320.0 to 1.20.1-fd37c72-202412061413.0

43

nodes/widgets/ui_template.js

@@ -0,1 +1,3 @@

const statestore = require('../store/state.js')
module.exports = function (RED) {

@@ -8,6 +10,2 @@ function TemplateNode (config) {

const evts = {
onAction: true // TODO: think we need an onSend event for template nodes that matches up with a `widget-send` message
}
if (config.templateScope === 'local') {

@@ -35,14 +33,33 @@ config.page = ''

// which group are we rendering this widget
// determine which group/page/ui are we rendering this widget
let group, page, ui
if (config.group) {
const group = RED.nodes.getNode(config.group)
// inform the dashboard UI that we are adding this node
group = RED.nodes.getNode(config.group)
} else if (config.page) {
page = RED.nodes.getNode(config.page)
} else if (config.ui) {
ui = RED.nodes.getNode(config.ui)
}
const evts = {
onAction: true, // TODO: think we need an onSend event for template nodes that matches up with a `widget-send` message
beforeSend: function (msg) {
if (msg.ui_update) {
const update = msg.ui_update
if (typeof update.format !== 'undefined') {
// dynamically set "format" property
const parent = group || page || ui
statestore.set(parent.getBase(), node, msg, 'format', update.format)
}
}
return msg
}
}
// inform the dashboard group/page/ui that we are adding this node
if (group) {
group.register(node, config, evts)
} else if (config.page) {
const page = RED.nodes.getNode(config.page)
// inform the dashboard UI that we are adding this node
} else if (page) {
page.register(null, node, config, evts)
} else if (config.ui) {
const ui = RED.nodes.getNode(config.ui)
// inform the dashboard UI that we are adding this node
} else if (ui) {
ui.register(null, null, node, config, evts)

@@ -49,0 +66,0 @@ }

{
"name": "@flowfuse/node-red-dashboard",
"version": "1.20.1-af1d14f-202412061320.0",
"version": "1.20.1-fd37c72-202412061413.0",
"description": "Dashboard 2.0 - A collection of Node-RED nodes that provide functionality to build your own UI applications (inc. forms, buttons, charts).",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc