@flowfuse/node-red-dashboard
Advanced tools
Comparing version 1.14.1-3adf3fb-202408081723.0 to 1.14.1-3d419a2-202408211518.0
@@ -26,3 +26,2 @@ { | ||
"time": "Time", | ||
"element": "element", | ||
"buttons": "Buttons", | ||
@@ -39,2 +38,2 @@ "submit": "submit", | ||
} | ||
} | ||
} |
@@ -13,2 +13,3 @@ { | ||
"gaugeBattery": "Battery Level", | ||
"gaugeTank": "Tank Level", | ||
"needle": "Needle", | ||
@@ -15,0 +16,0 @@ "rounded": "Rounded", |
@@ -20,3 +20,4 @@ { | ||
"search": "Search", | ||
"showSearch": "Show" | ||
"showSearch": "Show", | ||
"mobileBreakpoint": "Breakpoint" | ||
}, | ||
@@ -23,0 +24,0 @@ "selection": { |
@@ -0,1 +1,3 @@ | ||
const statestore = require('../store/state.js') | ||
module.exports = function (RED) { | ||
@@ -7,9 +9,63 @@ function NotificationNode (config) { | ||
// which group are we rendering this widget | ||
// Which ui are we rendering this widget. | ||
// In contradiction to other ui nodes (which belong to a group), the notification node belongs to a ui instead. | ||
const ui = RED.nodes.getNode(config.ui) | ||
const evts = { | ||
onAction: true, | ||
beforeSend: function (msg) { | ||
if (msg.ui_update) { | ||
const updates = msg.ui_update | ||
const allowedPositions = ['top right', 'top center', 'top left', 'bottom right', 'bottom center', 'bottom left', 'center center'] | ||
if (updates) { | ||
if (typeof updates.allowConfirm !== 'undefined') { | ||
// dynamically set "allowConfirm" property | ||
statestore.set(ui, node, msg, 'allowConfirm', updates.allowConfirm) | ||
} | ||
if (typeof updates.allowDismiss !== 'undefined') { | ||
// dynamically set "allowDismiss" property | ||
statestore.set(ui, node, msg, 'allowDismiss', updates.allowDismiss) | ||
} | ||
if (typeof updates.color !== 'undefined') { | ||
// dynamically set "color" property | ||
statestore.set(ui, node, msg, 'color', updates.color) | ||
} | ||
if (typeof updates.confirmText !== 'undefined') { | ||
// dynamically set "confirmText" property | ||
statestore.set(ui, node, msg, 'confirmText', updates.confirmText) | ||
} | ||
if (typeof updates.dismissText !== 'undefined') { | ||
// dynamically set "dismissText" property | ||
statestore.set(ui, node, msg, 'dismissText', updates.dismissText) | ||
} | ||
if (typeof updates.displayTime !== 'undefined') { | ||
// dynamically set "displayTime" property | ||
statestore.set(ui, node, msg, 'displayTime', updates.displayTime) | ||
} | ||
if (typeof updates.position !== 'undefined' && allowedPositions.includes(updates.position)) { | ||
// dynamically set "position" property | ||
statestore.set(ui, node, msg, 'position', updates.position) | ||
} | ||
if (typeof updates.raw !== 'undefined') { | ||
// dynamically set "raw" property | ||
statestore.set(ui, node, msg, 'raw', updates.raw) | ||
} | ||
if (typeof updates.showCountdown !== 'undefined') { | ||
// dynamically set "showCountdown" property | ||
statestore.set(ui, node, msg, 'showCountdown', updates.showCountdown) | ||
} | ||
// Note that update.close will NOT be stored in the data store, | ||
// since it does not need to be remembered | ||
} | ||
} | ||
return msg | ||
} | ||
} | ||
// inform the dashboard UI that we are adding this node | ||
ui.register(null, null, node, config) | ||
ui.register(null, null, node, config, evts) | ||
} | ||
RED.nodes.registerType('ui-notification', NotificationNode) | ||
} |
@@ -0,1 +1,3 @@ | ||
const statestore = require('../store/state.js') | ||
module.exports = function (RED) { | ||
@@ -22,6 +24,35 @@ function TextNode (config) { | ||
const beforeSend = function (msg) { | ||
const updates = msg.ui_update | ||
if (updates) { | ||
if (typeof updates.label !== 'undefined') { | ||
// dynamically set "label" property | ||
statestore.set(group.getBase(), node, msg, 'label', updates.label) | ||
} | ||
if (typeof updates.layout !== 'undefined') { | ||
// dynamically set "label" property | ||
statestore.set(group.getBase(), node, msg, 'layout', updates.layout) | ||
} | ||
if (typeof updates.font !== 'undefined') { | ||
// dynamically set "label" property | ||
statestore.set(group.getBase(), node, msg, 'font', updates.font) | ||
} | ||
if (typeof updates.fontSize !== 'undefined') { | ||
// dynamically set "label" property | ||
statestore.set(group.getBase(), node, msg, 'fontSize', updates.fontSize) | ||
} | ||
if (typeof updates.color !== 'undefined') { | ||
// dynamically set "label" property | ||
statestore.set(group.getBase(), node, msg, 'color', updates.color) | ||
} | ||
} | ||
return msg | ||
} | ||
// which group are we rendering this widget | ||
const group = RED.nodes.getNode(config.group) | ||
// inform the dashboard UI that we are adding this node | ||
group.register(node, config) | ||
group.register(node, config, { | ||
beforeSend | ||
}) | ||
} | ||
@@ -31,70 +62,1 @@ | ||
} | ||
// module.exports = function(RED) { | ||
// var ui = require('../ui')(RED); | ||
// function TextNode(config) { | ||
// RED.nodes.createNode(this, config); | ||
// var node = this; | ||
// var group = RED.nodes.getNode(config.group); | ||
// if (!group) { return; } | ||
// var tab = RED.nodes.getNode(group.config.tab); | ||
// if (!tab) { return; } | ||
// var layout = config.layout||"row-spread"; | ||
// var angLayout = "row"; | ||
// var angLayoutAlign = "space-between center"; | ||
// if (layout === "row-spread") { angLayout = 'row'; angLayoutAlign = 'space-between center'} | ||
// else if (layout === "row-left") { angLayout = 'row'; angLayoutAlign = 'start center'} | ||
// else if (layout === "row-center") { angLayout = 'row'; angLayoutAlign = 'center center'} | ||
// else if (layout === "row-right") { angLayout = 'row'; angLayoutAlign = 'end center'} | ||
// else if (layout === "col-center") { angLayout = 'column'; angLayoutAlign = 'center center'} | ||
// let style = ""; | ||
// if (config.style) { | ||
// if (config.color) { | ||
// style += `color: ${config.color};` | ||
// } | ||
// if (config.fontSize) { | ||
// style += `font-size: ${config.fontSize}px;` | ||
// } | ||
// if (config.font) { | ||
// style += `font-family: ${config.font};` | ||
// } | ||
// } | ||
// var done = ui.add({ | ||
// emitOnlyNewValues: false, | ||
// node: node, | ||
// tab: tab, | ||
// group: group, | ||
// control: { | ||
// type: 'text', | ||
// label: config.label, | ||
// order: config.order, | ||
// format: config.format, | ||
// width: config.width || group.config.width || 6, | ||
// height: config.height || 1, | ||
// layout: angLayout, | ||
// layoutAlign: angLayoutAlign, | ||
// className: config.className || '', | ||
// style: style, | ||
// }, | ||
// convert: function(value,oldValue,msg) { | ||
// if (value !== undefined && value !== null) { | ||
// if (Buffer.isBuffer(value)) { | ||
// value = value.toString('binary'); | ||
// } | ||
// else { | ||
// value = value.toString(); | ||
// } | ||
// } | ||
// else { | ||
// msg.payload = oldValue; | ||
// } | ||
// return value; | ||
// } | ||
// }); | ||
// node.on("close", done); | ||
// } | ||
// RED.nodes.registerType("ui_text", TextNode); | ||
// }; |
{ | ||
"name": "@flowfuse/node-red-dashboard", | ||
"version": "1.14.1-3adf3fb-202408081723.0", | ||
"version": "1.14.1-3d419a2-202408211518.0", | ||
"description": "Dashboard 2.0 - A collection of Node-RED nodes that provide functionality to build your own UI applications (inc. forms, buttons, charts).", | ||
@@ -126,2 +126,3 @@ "keywords": [ | ||
"ui-text-input": "nodes/widgets/ui_text_input.js", | ||
"ui-number-input": "nodes/widgets/ui_number_input.js", | ||
"ui-file-input": "nodes/widgets/ui_file_input.js", | ||
@@ -128,0 +129,0 @@ "ui-button": "nodes/widgets/ui_button.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
587940
108
3192