UI: improve USB Backup message

This commit is contained in:
Romain Bazile 2020-12-17 19:44:06 +01:00
parent 0bdb95b607
commit 4d1ce263f4

View file

@ -3858,7 +3858,8 @@
"y": 80, "y": 80,
"wires": [ "wires": [
[ [
"cc966678.da8d08" "cc966678.da8d08",
"328cec46.09e40c"
] ]
] ]
}, },
@ -7030,7 +7031,7 @@
"icon": "archive", "icon": "archive",
"payload": "", "payload": "",
"payloadType": "str", "payloadType": "str",
"topic": "", "topic": "USB Backup",
"x": 160, "x": 160,
"y": 900, "y": 900,
"wires": [ "wires": [
@ -7084,7 +7085,7 @@
"timer": "", "timer": "",
"oldrc": false, "oldrc": false,
"name": "usb_backup.sh", "name": "usb_backup.sh",
"x": 700, "x": 720,
"y": 920, "y": 920,
"wires": [ "wires": [
[ [
@ -7100,7 +7101,7 @@
"id": "df4d4d6a.24787", "id": "df4d4d6a.24787",
"type": "switch", "type": "switch",
"z": "1371dec5.76e671", "z": "1371dec5.76e671",
"name": "", "name": "No Drive",
"property": "payload", "property": "payload",
"propertyType": "msg", "propertyType": "msg",
"rules": [ "rules": [
@ -7116,14 +7117,15 @@
"checkall": "false", "checkall": "false",
"repair": false, "repair": false,
"outputs": 2, "outputs": 2,
"x": 530, "x": 520,
"y": 900, "y": 900,
"wires": [ "wires": [
[ [
"9a577caa.1535a" "9a577caa.1535a"
], ],
[ [
"c74fe76.bcba718" "c74fe76.bcba718",
"4997446.5176d3c"
] ]
] ]
}, },
@ -7141,7 +7143,7 @@
"raw": false, "raw": false,
"topic": "", "topic": "",
"name": "", "name": "",
"x": 690, "x": 710,
"y": 880, "y": 880,
"wires": [ "wires": [
[] []
@ -7161,7 +7163,7 @@
"raw": false, "raw": false,
"topic": "", "topic": "",
"name": "", "name": "",
"x": 910, "x": 930,
"y": 900, "y": 900,
"wires": [] "wires": []
}, },
@ -7179,8 +7181,8 @@
"raw": false, "raw": false,
"topic": "", "topic": "",
"name": "", "name": "",
"x": 1090, "x": 1110,
"y": 960, "y": 980,
"wires": [ "wires": [
[] []
] ]
@ -7189,13 +7191,13 @@
"id": "a2c36500.6d376", "id": "a2c36500.6d376",
"type": "function", "type": "function",
"z": "1371dec5.76e671", "z": "1371dec5.76e671",
"name": "error message", "name": "return code",
"func": "switch (msg.payload.code){\ncase 0:\n msg.payload = \"All files successfully copied, you can remove your usb drive!\";\n break;\ncase 1:\n msg.payload = \"There was an error!\";\n break;\ncase 2:\n msg.payload = \"Error: your device is already mounted\"\n break;\ncase 3:\n msg.payload = \"Error while mounting the device\"\n break;\ncase 4:\n msg.payload = \"Error: some files were corrupted during the copy!\"\n break;\n}\nreturn msg;", "func": "switch (msg.payload.code){\ncase 0:\n msg.payload = \"All files successfully copied, you can remove your usb drive!\";\n break;\ncase 1:\n msg.payload = \"There was an error!\";\n break;\ncase 2:\n msg.payload = \"Error: your device is already mounted\"\n break;\ncase 3:\n msg.payload = \"Error while mounting the device\"\n break;\ncase 4:\n msg.payload = \"Error: some files were corrupted during the copy!\"\n break;\n}\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"x": 900, "x": 910,
"y": 940, "y": 940,
"wires": [ "wires": [
[ [
@ -7222,7 +7224,7 @@
"payloadType": "str", "payloadType": "str",
"topic": "BE EXTRA CAREFUL", "topic": "BE EXTRA CAREFUL",
"x": 150, "x": 150,
"y": 980, "y": 1020,
"wires": [ "wires": [
[ [
"ba72704a.8a38a" "ba72704a.8a38a"
@ -7244,7 +7246,7 @@
"topic": "Data purge", "topic": "Data purge",
"name": "", "name": "",
"x": 350, "x": 350,
"y": 980, "y": 1020,
"wires": [ "wires": [
[ [
"d80e6307.3aaf8" "d80e6307.3aaf8"
@ -7269,7 +7271,7 @@
"repair": false, "repair": false,
"outputs": 1, "outputs": 1,
"x": 530, "x": 530,
"y": 980, "y": 1020,
"wires": [ "wires": [
[ [
"4a8cb5d4.52e4bc" "4a8cb5d4.52e4bc"
@ -7288,7 +7290,7 @@
"oldrc": false, "oldrc": false,
"name": "rm data", "name": "rm data",
"x": 680, "x": 680,
"y": 980, "y": 1020,
"wires": [ "wires": [
[ [
"c5b1e763.d1bba8" "c5b1e763.d1bba8"
@ -8455,7 +8457,7 @@
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"x": 900, "x": 900,
"y": 980, "y": 1020,
"wires": [ "wires": [
[ [
"81a48376.27a66" "81a48376.27a66"
@ -8484,5 +8486,32 @@
"24df077a.cb252" "24df077a.cb252"
] ]
] ]
},
{
"id": "4997446.5176d3c",
"type": "change",
"z": "1371dec5.76e671",
"name": "Backup starting message",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "\"The backup is starting now, please wait for the complete message before removing the drive\"",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 750,
"y": 980,
"wires": [
[
"81a48376.27a66"
]
]
} }
] ]