FlowFuse / node-red-dashboard

https://dashboard.flowfuse.com
Apache License 2.0
204 stars 48 forks source link

Button Does Not Send Flow Data #469

Closed gdziuba closed 10 months ago

gdziuba commented 10 months ago

Description

Added a new "Button" to the dashboard. I wanted the button to send the contents of flow.CSV to the payload.

I was able to go around it with a change node and set the payload, but this is not currently working as it should.

[{"id":"71c594d011fa2492","type":"ui-template","z":"6e09408d4dd88daf","group":"ea5c3d2dcfb3462e","dashboard":"2daa43f2ba1b1c32","page":"76f6b77509a74a17","name":"UPLOAD","order":0,"width":0,"height":0,"head":"","format":"<v-file-input show-size multiple chips :rules=\"rules\" accept=\".csv\"\n    variant=\"underlined\" label=\"File input\" v-on:change=\"uploadFile\" v-model=\"value\"\n    active-color=\"primary\" @update:modelValue=\"send({payload: value})\" />\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":180,"y":340,"wires":[["d074416fe75457f1"]]},{"id":"92c511500ee9e777","type":"debug","z":"6e09408d4dd88daf","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":280,"wires":[]},{"id":"d074416fe75457f1","type":"change","z":"6e09408d4dd88daf","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":340,"wires":[["dd507559409e63cc"]]},{"id":"dd507559409e63cc","type":"function","z":"6e09408d4dd88daf","name":"Convert Hex to String","func":"const hexBuffer = msg.payload;\n\n// Convert the hex buffer to a Buffer object\nconst buffer = Buffer.from(hexBuffer, 'hex');\n\n// Convert the Buffer to a string\nconst string = buffer.toString();\n\n// Assign the string to msg.payload for further processing\nmsg.payload = string;\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":340,"wires":[["031e695eccd7a368"]]},{"id":"031e695eccd7a368","type":"csv","z":"6e09408d4dd88daf","name":"","sep":",","hdrin":"","hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"1","strings":true,"include_empty_strings":"","include_null_values":"","x":730,"y":340,"wires":[["92c511500ee9e777","fec52337eeb29584"]]},{"id":"d0acd38d8f1c4606","type":"ui-table","z":"6e09408d4dd88daf","group":"b73dc5151c8cd587","name":"","label":"text","order":2,"width":0,"height":0,"maxrows":0,"autocols":true,"columns":[],"x":1050,"y":340,"wires":[]},{"id":"7f0133a7dabb79a2","type":"ui-button","z":"6e09408d4dd88daf","group":"b73dc5151c8cd587","name":"","label":"Send to ....","order":1,"width":0,"height":0,"passthru":false,"tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"CSV","payloadType":"flow","topic":"topic","topicType":"msg","x":190,"y":460,"wires":[["1f95ef1259a2713e"]]},{"id":"fec52337eeb29584","type":"change","z":"6e09408d4dd88daf","name":"","rules":[{"t":"set","p":"CSV","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":340,"wires":[["d0acd38d8f1c4606"]]},{"id":"1f95ef1259a2713e","type":"debug","z":"6e09408d4dd88daf","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":360,"y":460,"wires":[]},{"id":"ea5c3d2dcfb3462e","type":"ui-group","name":"Group Name","page":"76f6b77509a74a17","width":"6","height":"1","order":-1,"showTitle":true,"className":""},{"id":"2daa43f2ba1b1c32","type":"ui-base","name":"UI Name","path":"/dashboard"},{"id":"76f6b77509a74a17","type":"ui-page","name":"Page Name","ui":"2daa43f2ba1b1c32","path":"/","icon":"","layout":"grid","theme":"c5ed292f3032aa43","order":-1,"className":""},{"id":"b73dc5151c8cd587","type":"ui-group","name":"CSV Table","page":"76f6b77509a74a17","width":"12","height":"1","order":-1,"showTitle":true,"className":""},{"id":"c5ed292f3032aa43","type":"ui-theme","name":"Theme Name","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"}}]

Have you provided an initial effort estimate for this issue?

I can not provide an initial effort estimate

joepavitt commented 10 months ago

Closing as a duplicate of https://github.com/FlowFuse/node-red-dashboard/issues/353