@flowfuse/node-red-dashboard
Advanced tools
Comparing version 1.20.2-a0c4941-202412131634.0 to 1.20.2-abf3130-202412181911.0
@@ -1055,8 +1055,9 @@ const { Agent } = require('https') | ||
if (msg) { | ||
if (widgetConfig.topic || widgetConfig.topicType) { | ||
msg = await appendTopic(RED, widgetConfig, wNode, msg) | ||
} | ||
// store the latest msg passed to node | ||
datastore.save(n, widgetNode, msg) | ||
if (widgetConfig.topic || widgetConfig.topicType) { | ||
msg = await appendTopic(RED, widgetConfig, wNode, msg) | ||
} | ||
if (hasProperty(widgetConfig, 'passthru')) { | ||
@@ -1063,0 +1064,0 @@ if (widgetConfig.passthru) { |
@@ -41,2 +41,12 @@ const data = {} | ||
// Strip msg of properties that are not needed for storage | ||
function stripMsg (msg) { | ||
const newMsg = config.RED.util.cloneMessage(msg) | ||
// don't need to store ui_updates in the datastore, as this is handled in statestore | ||
delete newMsg.ui_update | ||
return newMsg | ||
} | ||
const getters = { | ||
@@ -79,3 +89,7 @@ RED () { | ||
if (canSaveInStore(base, node, msg)) { | ||
data[node.id] = config.RED.util.cloneMessage(msg) | ||
const newMsg = stripMsg(msg) | ||
data[node.id] = { | ||
...data[node.id], | ||
...newMsg | ||
} | ||
} | ||
@@ -82,0 +96,0 @@ } |
@@ -41,17 +41,33 @@ const fs = require('fs') | ||
if (config.includeClientData) { | ||
if (!msg._client) { | ||
msg._client = {} | ||
} | ||
RED.plugins.getByType('node-red-dashboard-2').forEach(plugin => { | ||
if (plugin.hooks?.onAddConnectionCredentials && msg) { | ||
msg = plugin.hooks.onAddConnectionCredentials(conn, msg) | ||
// Add _client to each element | ||
const addClientData = (item) => { | ||
if (!item._client) { | ||
item._client = {} | ||
} | ||
}) | ||
msg._client = { | ||
...msg._client, | ||
...{ | ||
socketId: conn.id, | ||
socketIp: conn.handshake?.address | ||
RED.plugins.getByType('node-red-dashboard-2').forEach(plugin => { | ||
if (plugin.hooks?.onAddConnectionCredentials && item) { | ||
item = plugin.hooks.onAddConnectionCredentials(conn, item) | ||
} | ||
}) | ||
item._client = { | ||
...item._client, | ||
...{ | ||
socketId: conn.id, | ||
socketIp: conn.handshake?.address | ||
} | ||
} | ||
return item | ||
} | ||
// Handle arrays and nested arrays | ||
const processMsg = (data) => { | ||
if (Array.isArray(data)) { | ||
return data.map(item => processMsg(item)) | ||
} else if (typeof data === 'object' && data !== null) { | ||
return addClientData(data) | ||
} | ||
return data | ||
} | ||
msg = processMsg(msg) | ||
} | ||
@@ -58,0 +74,0 @@ return msg |
@@ -22,3 +22,3 @@ // const datastore = require('../store/data.js') | ||
const MAX_FILESIZE_DEFAULT = 1e6 | ||
const maxFileSize = RED.settings.dashboard?.maxHttpBufferSize || MAX_FILESIZE_DEFAULT | ||
const maxFileSize = RED.settings.dashboard?.maxHttpBufferSize || RED.settings.ui?.maxHttpBufferSize || MAX_FILESIZE_DEFAULT | ||
@@ -25,0 +25,0 @@ config.maxFileSize = maxFileSize |
{ | ||
"name": "@flowfuse/node-red-dashboard", | ||
"version": "1.20.2-a0c4941-202412131634.0", | ||
"version": "1.20.2-abf3130-202412181911.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": [ |
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
715341
4044
30
54