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,
"wires": [
[
"cc966678.da8d08"
"cc966678.da8d08",
"328cec46.09e40c"
]
]
},
@ -7030,7 +7031,7 @@
"icon": "archive",
"payload": "",
"payloadType": "str",
"topic": "",
"topic": "USB Backup",
"x": 160,
"y": 900,
"wires": [
@ -7084,7 +7085,7 @@
"timer": "",
"oldrc": false,
"name": "usb_backup.sh",
"x": 700,
"x": 720,
"y": 920,
"wires": [
[
@ -7100,7 +7101,7 @@
"id": "df4d4d6a.24787",
"type": "switch",
"z": "1371dec5.76e671",
"name": "",
"name": "No Drive",
"property": "payload",
"propertyType": "msg",
"rules": [
@ -7116,14 +7117,15 @@
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 530,
"x": 520,
"y": 900,
"wires": [
[
"9a577caa.1535a"
],
[
"c74fe76.bcba718"
"c74fe76.bcba718",
"4997446.5176d3c"
]
]
},
@ -7141,7 +7143,7 @@
"raw": false,
"topic": "",
"name": "",
"x": 690,
"x": 710,
"y": 880,
"wires": [
[]
@ -7161,7 +7163,7 @@
"raw": false,
"topic": "",
"name": "",
"x": 910,
"x": 930,
"y": 900,
"wires": []
},
@ -7179,8 +7181,8 @@
"raw": false,
"topic": "",
"name": "",
"x": 1090,
"y": 960,
"x": 1110,
"y": 980,
"wires": [
[]
]
@ -7189,13 +7191,13 @@
"id": "a2c36500.6d376",
"type": "function",
"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;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 900,
"x": 910,
"y": 940,
"wires": [
[
@ -7222,7 +7224,7 @@
"payloadType": "str",
"topic": "BE EXTRA CAREFUL",
"x": 150,
"y": 980,
"y": 1020,
"wires": [
[
"ba72704a.8a38a"
@ -7244,7 +7246,7 @@
"topic": "Data purge",
"name": "",
"x": 350,
"y": 980,
"y": 1020,
"wires": [
[
"d80e6307.3aaf8"
@ -7269,7 +7271,7 @@
"repair": false,
"outputs": 1,
"x": 530,
"y": 980,
"y": 1020,
"wires": [
[
"4a8cb5d4.52e4bc"
@ -7288,7 +7290,7 @@
"oldrc": false,
"name": "rm data",
"x": 680,
"y": 980,
"y": 1020,
"wires": [
[
"c5b1e763.d1bba8"
@ -8455,7 +8457,7 @@
"initialize": "",
"finalize": "",
"x": 900,
"y": 980,
"y": 1020,
"wires": [
[
"81a48376.27a66"
@ -8484,5 +8486,32 @@
"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"
]
]
}
]