Hi. Currently working on the node red dashboard that have file manager nodes. Im using node-red-contrib-fs-ops to have access to directory files. But now im having a problem on uploading the files through the dashboard. I have tried to use node-red-contrib-ui-media but the problem is the files need to be upload manually in the node-red flows. My concern here is for the end user to upload the files through the dashboard without go directly to the node-red flows.
[
{
"id": "8e2472f8.4af9a",
"type": "ui_template",
"z": "61c3f9d6.037da8",
"group": "4343e83e.d00228",
"name": "Display File List",
"order": 1,
"width": "5",
"height": "12",
"format": "<script>\n \nthis.scope.action = function(opt) {\n var playFile = opt || \"no data passed to function\";\n// console.warn(playFile)\n return playFile; } \n</script>\n\n\n<div style=\"max-width:300px;\">\n <ul>\n <li ng-repeat=\"file in msg.files track by $index\" style=\"list-style-type: none;\">\n <label>\n <input type=\"radio\" ng-model=\"$parent.file\" name=\"data\" value=\"{{file}}\" required />{{file}}\n </label>\n </li>\n </ul>\n <p>Item Selected: {{file}}</p>\n\n <md-button ng-click=\"send({payload:action(file)})\">\n OPEN \n </md-button>\n\n</div>\n\n",
"storeOutMessages": false,
"fwdInMessages": false,
"templateScope": "local",
"x": 340,
"y": 140,
"wires": [
[
"5037150b.fead5c"
]
]
},
{
"id": "e63e4999.2acad8",
"type": "fs-ops-dir",
"z": "61c3f9d6.037da8",
"name": "/media/pi/",
"path": "/media/pi/",
"pathType": "str",
"filter": "*",
"filterType": "str",
"dir": "files",
"dirType": "msg",
"x": 340,
"y": 80,
"wires": [
[
"8e2472f8.4af9a"
]
]
},
{
"id": "48343b4b.bfb164",
"type": "fs-ops-dir",
"z": "61c3f9d6.037da8",
"name": "/media/pi/drive",
"path": "payload",
"pathType": "msg",
"filter": "*mp4",
"filterType": "str",
"dir": "files",
"dirType": "msg",
"x": 680,
"y": 80,
"wires": [
[
"bfebb620.7572b8"
]
]
},
{
"id": "5037150b.fead5c",
"type": "function",
"z": "61c3f9d6.037da8",
"name": "Concat",
"func": "//This function is to get drive name \n//and combine it with path\n\nvar payload=msg.payload; //get payload\nvar dir=\"/media/pi/\";\nmsg.payload=dir.concat(payload);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 80,
"wires": [
[
"48343b4b.bfb164"
]
]
},
{
"id": "bfebb620.7572b8",
"type": "ui_template",
"z": "61c3f9d6.037da8",
"group": "74ad0ed9.56adc",
"name": "",
"order": 0,
"width": "6",
"height": "12",
"format": "<script>\n \nthis.scope.action = function(opt) {\n var playFile = opt || \"no data passed to function\";\n// console.warn(playFile)\n return playFile; } \n</script>\n\n\n<div style=\"max-width:400px;\">\n <ul>\n <li ng-repeat=\"file in msg.files track by $index\" style=\"list-style-type: none;\">\n <label>\n <input type=\"radio\" ng-model=\"$parent.file\" name=\"data\" value=\"{{file}}\" required />{{file}}\n </label>\n </li>\n </ul>\n <p>Item Selected: {{file}}</p>\n\n <md-button ng-click=\"send({payload:action(file)})\">\n Click to Upload File\n </md-button>\n\n</div>\n\n",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 660,
"y": 140,
"wires": [
[
"b37d2aa7.b8f9f8"
]
]
},
{
"id": "e2d330d.6cce7d",
"type": "ui_button",
"z": "61c3f9d6.037da8",
"name": "",
"group": "4343e83e.d00228",
"order": 0,
"width": "2",
"height": "2",
"passthru": false,
"label": "Refresh",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "date",
"topic": "",
"x": 100,
"y": 80,
"wires": [
[
"e63e4999.2acad8"
]
]
},
{
"id": "b37d2aa7.b8f9f8",
"type": "debug",
"z": "61c3f9d6.037da8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 850,
"y": 160,
"wires": []
},
{
"id": "4343e83e.d00228",
"type": "ui_group",
"z": "",
"name": "Drive List",
"tab": "9ef7fa03.271ac8",
"order": 3,
"disp": true,
"width": "12",
"collapse": true
},
{
"id": "74ad0ed9.56adc",
"type": "ui_group",
"z": "",
"name": "File List",
"tab": "9ef7fa03.271ac8",
"order": 4,
"disp": true,
"width": "6",
"collapse": true
},
{
"id": "9ef7fa03.271ac8",
"type": "ui_tab",
"z": "",
"name": "Files",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]