ui: fix data purge

This commit is contained in:
Romain Bazile 2020-12-09 15:27:12 +01:00
parent 62f7ffa029
commit 0ec6c383c9

View file

@ -5462,7 +5462,7 @@
"id": "eaf74a43.fa27d", "id": "eaf74a43.fa27d",
"type": "switch", "type": "switch",
"z": "1371dec5.76e671", "z": "1371dec5.76e671",
"name": "", "name": "if disk > 90%",
"property": "payload", "property": "payload",
"propertyType": "msg", "propertyType": "msg",
"rules": [ "rules": [
@ -5475,11 +5475,11 @@
"checkall": "true", "checkall": "true",
"repair": false, "repair": false,
"outputs": 1, "outputs": 1,
"x": 490, "x": 590,
"y": 420, "y": 420,
"wires": [ "wires": [
[ [
"24df077a.cb252" "6d09f428.930bcc"
] ]
] ]
}, },
@ -5497,7 +5497,7 @@
"raw": false, "raw": false,
"topic": "", "topic": "",
"name": "", "name": "",
"x": 790, "x": 1070,
"y": 420, "y": 420,
"wires": [ "wires": [
[] []
@ -5522,7 +5522,7 @@
"from": "", "from": "",
"to": "", "to": "",
"reg": false, "reg": false,
"x": 630, "x": 910,
"y": 420, "y": 420,
"wires": [ "wires": [
[ [
@ -7169,8 +7169,8 @@
"raw": false, "raw": false,
"topic": "", "topic": "",
"name": "", "name": "",
"x": 1070, "x": 1090,
"y": 940, "y": 960,
"wires": [ "wires": [
[] []
] ]
@ -7231,9 +7231,9 @@
"ok": "GO BACK", "ok": "GO BACK",
"cancel": "YES I'M SURE, I WANT TO PURGE THE DATA", "cancel": "YES I'M SURE, I WANT TO PURGE THE DATA",
"raw": false, "raw": false,
"topic": "", "topic": "Data purge",
"name": "", "name": "",
"x": 370, "x": 350,
"y": 980, "y": 980,
"wires": [ "wires": [
[ [
@ -7241,24 +7241,6 @@
] ]
] ]
}, },
{
"id": "b57cc390.f055c8",
"type": "ui_toast",
"z": "1371dec5.76e671",
"position": "top right",
"displayTime": "5",
"highlight": "",
"sendall": true,
"outputs": 0,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "",
"x": 870,
"y": 980,
"wires": []
},
{ {
"id": "d80e6307.3aaf8", "id": "d80e6307.3aaf8",
"type": "switch", "type": "switch",
@ -7288,21 +7270,21 @@
"id": "4a8cb5d4.52e4bc", "id": "4a8cb5d4.52e4bc",
"type": "exec", "type": "exec",
"z": "1371dec5.76e671", "z": "1371dec5.76e671",
"command": "rm -R /home/pi/data/*", "command": "rm -r /home/pi/data/img /home/pi/data/objects /home/pi/data/export",
"addpay": false, "addpay": false,
"append": "", "append": "",
"useSpawn": "true", "useSpawn": "false",
"timer": "", "timer": "",
"oldrc": false, "oldrc": false,
"name": "rm data", "name": "rm data",
"x": 680, "x": 680,
"y": 980, "y": 980,
"wires": [ "wires": [
[
"b57cc390.f055c8"
],
[], [],
[] [],
[
"c5b1e763.d1bba8"
]
] ]
}, },
{ {
@ -8447,5 +8429,46 @@
"991d1df9.3ffb3" "991d1df9.3ffb3"
] ]
] ]
},
{
"id": "c5b1e763.d1bba8",
"type": "function",
"z": "1371dec5.76e671",
"name": "error message",
"func": "switch (msg.payload.code){\ncase 0:\n msg.payload = \"/home/pi/data was purged successfully!\";\n break;\ndefault:\n msg.payload = \"There was an error! The error code is \" + msg.payload.code;\n break;\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 900,
"y": 980,
"wires": [
[
"81a48376.27a66"
]
]
},
{
"id": "6d09f428.930bcc",
"type": "delay",
"z": "1371dec5.76e671",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 750,
"y": 420,
"wires": [
[
"24df077a.cb252"
]
]
} }
] ]