mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into idf4
This commit is contained in:
179
interface/package-lock.json
generated
179
interface/package-lock.json
generated
@@ -12,15 +12,15 @@
|
||||
"@emotion/styled": "^11.8.1",
|
||||
"@msgpack/msgpack": "^2.7.2",
|
||||
"@mui/icons-material": "^5.6.2",
|
||||
"@mui/material": "^5.6.2",
|
||||
"@mui/material": "^5.6.3",
|
||||
"@table-library/react-table-library": "^3.1.0",
|
||||
"@types/lodash": "^4.14.182",
|
||||
"@types/node": "^17.0.26",
|
||||
"@types/node": "^17.0.30",
|
||||
"@types/react": "^17.0.43",
|
||||
"@types/react-dom": "^17.0.14",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"async-validator": "^4.0.8",
|
||||
"axios": "^0.26.1",
|
||||
"async-validator": "^4.1.1",
|
||||
"axios": "^0.27.2",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
@@ -29,15 +29,15 @@
|
||||
"react": "^17.0.2",
|
||||
"react-app-rewired": "^2.2.1",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dropzone": "^12.0.5",
|
||||
"react-dropzone": "^14.0.1",
|
||||
"react-icons": "^4.3.1",
|
||||
"react-router-dom": "^6.3.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"sockette": "^2.0.6",
|
||||
"typescript": "^4.6.3"
|
||||
"typescript": "^4.6.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.15",
|
||||
"nodemon": "^2.0.16",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
},
|
||||
@@ -2856,9 +2856,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@mui/base": {
|
||||
"version": "5.0.0-alpha.77",
|
||||
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.77.tgz",
|
||||
"integrity": "sha512-Zqm3qlczGViD3lJSYo8ZnQLHJ3PwGYftbDfVuh2Rq5OD88F7H6oDILlqknzty59NDkeSVO2qlymYmHOY1nLodg==",
|
||||
"version": "5.0.0-alpha.78",
|
||||
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.78.tgz",
|
||||
"integrity": "sha512-5L+GNe2M9/tFjQpjK2r837+kzRg/l6D5R9SQbG1wmSWejw5Ei8P+KXIgS/NLNi9g7dUT8bnCyzz9AZKQX1Jsfg==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@emotion/is-prop-valid": "^1.1.2",
|
||||
@@ -2913,13 +2913,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@mui/material": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.6.2.tgz",
|
||||
"integrity": "sha512-bwMvroBrMgUTwUh/BcjhtcJwEw9uH4chV3+ZSj6RckOJtMj8U4yEeD7S4NgHE8Ioj5eObKFzHpih/cTD1sDRpg==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.6.3.tgz",
|
||||
"integrity": "sha512-2VovFsbCEhic29NYoBF7zFrpH2sEOlKXXDhGjzxmWiI9OnC3SX63hapWunjaVsiRINVnjuMHuW1MOs4UtV8Gfg==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@mui/base": "5.0.0-alpha.77",
|
||||
"@mui/system": "^5.6.2",
|
||||
"@mui/base": "5.0.0-alpha.78",
|
||||
"@mui/system": "^5.6.3",
|
||||
"@mui/types": "^7.1.3",
|
||||
"@mui/utils": "^5.6.1",
|
||||
"@types/react-transition-group": "^4.4.4",
|
||||
@@ -3013,9 +3013,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@mui/system": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.6.2.tgz",
|
||||
"integrity": "sha512-Wg9TRbvavSwEYk6UdpnoDx+CqJfaAN7AzlmwEx7DtGmx0snFVBST8FVb1Ev1vXosxEnq6/fe7ZDRobFVewvEPQ==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.6.3.tgz",
|
||||
"integrity": "sha512-4SRi52a4ttZ2S4EHEDE8arVNuKqyQLTYUTF80WAZ0tQwnG20qwlBtzcrywCGItmVAMl7RUaYopyWOx3yVPvrmQ==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@mui/private-theming": "^5.6.2",
|
||||
@@ -3763,9 +3763,9 @@
|
||||
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "17.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz",
|
||||
"integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A=="
|
||||
"version": "17.0.30",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.30.tgz",
|
||||
"integrity": "sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw=="
|
||||
},
|
||||
"node_modules/@types/parse-json": {
|
||||
"version": "4.0.0",
|
||||
@@ -4670,9 +4670,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/async-validator": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.0.8.tgz",
|
||||
"integrity": "sha512-vx1kyOCuSJqB5IVatlybUkV/e22sdx+V0XohCWbBfbbzbiLFt6fHxfWg6UEBhFw0gVgZtaSLTJtugmP4rdGQAQ=="
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.1.1.tgz",
|
||||
"integrity": "sha512-p4DO/JXwjs8klJyJL8Q2oM4ks5fUTze/h5k10oPPKMiLe1fj3G1QMzPHNmN1Py4ycOk7WlO2DcGXv1qiESJCZA=="
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
@@ -4736,11 +4736,25 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "0.26.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
|
||||
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
|
||||
"integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.14.8"
|
||||
"follow-redirects": "^1.14.9",
|
||||
"form-data": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/axios/node_modules/form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/axobject-query": {
|
||||
@@ -7962,9 +7976,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/file-selector": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.4.0.tgz",
|
||||
"integrity": "sha512-iACCiXeMYOvZqlF1kTiYINzgepRBymz1wwjiuup9u9nayhb6g4fSwiyJ/6adli+EPwrWtpgQAh2PoS7HukEGEg==",
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.5.0.tgz",
|
||||
"integrity": "sha512-s8KNnmIDTBoD0p9uJ9uD0XY38SCeBOtj0UMXyQSLg1Ypfrfj8+dAvwsLjYQkQ2GjhVtp2HrnF5cJzMhBjfD8HA==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.3"
|
||||
},
|
||||
@@ -12045,9 +12059,9 @@
|
||||
"integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw=="
|
||||
},
|
||||
"node_modules/nodemon": {
|
||||
"version": "2.0.15",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz",
|
||||
"integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==",
|
||||
"version": "2.0.16",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.16.tgz",
|
||||
"integrity": "sha512-zsrcaOfTWRuUzBn3P44RDliLlp263Z/76FPoHFr3cFFkOz0lTPAcIw8dCzfdVIx/t3AtDYCZRCDkoCojJqaG3w==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
@@ -14442,19 +14456,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-dropzone": {
|
||||
"version": "12.0.5",
|
||||
"resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-12.0.5.tgz",
|
||||
"integrity": "sha512-zUjZigD0VJ91CSm9T1h7ErxFReBLaa9sjS2dUL0+inb0RROZpSJTNDHPY1rrBES5V2NXhF8v0kghmaHc81BMFg==",
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-14.0.1.tgz",
|
||||
"integrity": "sha512-FyRWrlMmM2+8TkM0aPdRwdZJ5HX3+4O1vWtHecJMFB36N89Bub1sIrk8HyOrjb9hwm1HXGRZ4Q+PW4G/MDFg1Q==",
|
||||
"dependencies": {
|
||||
"attr-accept": "^2.2.2",
|
||||
"file-selector": "^0.4.0",
|
||||
"file-selector": "^0.5.0",
|
||||
"prop-types": "^15.8.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.13"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">= 16.8"
|
||||
"react": ">= 16.8 || 18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-error-overlay": {
|
||||
@@ -16373,9 +16387,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz",
|
||||
"integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==",
|
||||
"version": "4.6.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
||||
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -19574,9 +19588,9 @@
|
||||
"integrity": "sha512-rYEi46+gIzufyYUAoHDnRzkWGxajpD9vVXFQ3g1vbjrBm6P7MBmm+s/fqPa46sxa+8FOUdEuRQKaugo5a4JWpw=="
|
||||
},
|
||||
"@mui/base": {
|
||||
"version": "5.0.0-alpha.77",
|
||||
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.77.tgz",
|
||||
"integrity": "sha512-Zqm3qlczGViD3lJSYo8ZnQLHJ3PwGYftbDfVuh2Rq5OD88F7H6oDILlqknzty59NDkeSVO2qlymYmHOY1nLodg==",
|
||||
"version": "5.0.0-alpha.78",
|
||||
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.78.tgz",
|
||||
"integrity": "sha512-5L+GNe2M9/tFjQpjK2r837+kzRg/l6D5R9SQbG1wmSWejw5Ei8P+KXIgS/NLNi9g7dUT8bnCyzz9AZKQX1Jsfg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@emotion/is-prop-valid": "^1.1.2",
|
||||
@@ -19597,13 +19611,13 @@
|
||||
}
|
||||
},
|
||||
"@mui/material": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.6.2.tgz",
|
||||
"integrity": "sha512-bwMvroBrMgUTwUh/BcjhtcJwEw9uH4chV3+ZSj6RckOJtMj8U4yEeD7S4NgHE8Ioj5eObKFzHpih/cTD1sDRpg==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.6.3.tgz",
|
||||
"integrity": "sha512-2VovFsbCEhic29NYoBF7zFrpH2sEOlKXXDhGjzxmWiI9OnC3SX63hapWunjaVsiRINVnjuMHuW1MOs4UtV8Gfg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@mui/base": "5.0.0-alpha.77",
|
||||
"@mui/system": "^5.6.2",
|
||||
"@mui/base": "5.0.0-alpha.78",
|
||||
"@mui/system": "^5.6.3",
|
||||
"@mui/types": "^7.1.3",
|
||||
"@mui/utils": "^5.6.1",
|
||||
"@types/react-transition-group": "^4.4.4",
|
||||
@@ -19636,9 +19650,9 @@
|
||||
}
|
||||
},
|
||||
"@mui/system": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.6.2.tgz",
|
||||
"integrity": "sha512-Wg9TRbvavSwEYk6UdpnoDx+CqJfaAN7AzlmwEx7DtGmx0snFVBST8FVb1Ev1vXosxEnq6/fe7ZDRobFVewvEPQ==",
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.6.3.tgz",
|
||||
"integrity": "sha512-4SRi52a4ttZ2S4EHEDE8arVNuKqyQLTYUTF80WAZ0tQwnG20qwlBtzcrywCGItmVAMl7RUaYopyWOx3yVPvrmQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@mui/private-theming": "^5.6.2",
|
||||
@@ -20155,9 +20169,9 @@
|
||||
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "17.0.26",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz",
|
||||
"integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A=="
|
||||
"version": "17.0.30",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.30.tgz",
|
||||
"integrity": "sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw=="
|
||||
},
|
||||
"@types/parse-json": {
|
||||
"version": "4.0.0",
|
||||
@@ -20857,9 +20871,9 @@
|
||||
}
|
||||
},
|
||||
"async-validator": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.0.8.tgz",
|
||||
"integrity": "sha512-vx1kyOCuSJqB5IVatlybUkV/e22sdx+V0XohCWbBfbbzbiLFt6fHxfWg6UEBhFw0gVgZtaSLTJtugmP4rdGQAQ=="
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.1.1.tgz",
|
||||
"integrity": "sha512-p4DO/JXwjs8klJyJL8Q2oM4ks5fUTze/h5k10oPPKMiLe1fj3G1QMzPHNmN1Py4ycOk7WlO2DcGXv1qiESJCZA=="
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
@@ -20895,11 +20909,24 @@
|
||||
"integrity": "sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw=="
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.26.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
|
||||
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
|
||||
"integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.14.8"
|
||||
"follow-redirects": "^1.14.9",
|
||||
"form-data": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"axobject-query": {
|
||||
@@ -23272,9 +23299,9 @@
|
||||
}
|
||||
},
|
||||
"file-selector": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.4.0.tgz",
|
||||
"integrity": "sha512-iACCiXeMYOvZqlF1kTiYINzgepRBymz1wwjiuup9u9nayhb6g4fSwiyJ/6adli+EPwrWtpgQAh2PoS7HukEGEg==",
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.5.0.tgz",
|
||||
"integrity": "sha512-s8KNnmIDTBoD0p9uJ9uD0XY38SCeBOtj0UMXyQSLg1Ypfrfj8+dAvwsLjYQkQ2GjhVtp2HrnF5cJzMhBjfD8HA==",
|
||||
"requires": {
|
||||
"tslib": "^2.0.3"
|
||||
}
|
||||
@@ -26223,9 +26250,9 @@
|
||||
"integrity": "sha512-maHFz6OLqYxz+VQyCAtA3PTX4UP/53pa05fyDNc9CwjvJ0yEh6+xBwKsgCxMNhS8taUKBFYxfuiaD9U/55iFaw=="
|
||||
},
|
||||
"nodemon": {
|
||||
"version": "2.0.15",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.15.tgz",
|
||||
"integrity": "sha512-gdHMNx47Gw7b3kWxJV64NI+Q5nfl0y5DgDbiVtShiwa7Z0IZ07Ll4RLFo6AjrhzMtoEZn5PDE3/c2AbVsiCkpA==",
|
||||
"version": "2.0.16",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.16.tgz",
|
||||
"integrity": "sha512-zsrcaOfTWRuUzBn3P44RDliLlp263Z/76FPoHFr3cFFkOz0lTPAcIw8dCzfdVIx/t3AtDYCZRCDkoCojJqaG3w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chokidar": "^3.5.2",
|
||||
@@ -27803,12 +27830,12 @@
|
||||
}
|
||||
},
|
||||
"react-dropzone": {
|
||||
"version": "12.0.5",
|
||||
"resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-12.0.5.tgz",
|
||||
"integrity": "sha512-zUjZigD0VJ91CSm9T1h7ErxFReBLaa9sjS2dUL0+inb0RROZpSJTNDHPY1rrBES5V2NXhF8v0kghmaHc81BMFg==",
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-14.0.1.tgz",
|
||||
"integrity": "sha512-FyRWrlMmM2+8TkM0aPdRwdZJ5HX3+4O1vWtHecJMFB36N89Bub1sIrk8HyOrjb9hwm1HXGRZ4Q+PW4G/MDFg1Q==",
|
||||
"requires": {
|
||||
"attr-accept": "^2.2.2",
|
||||
"file-selector": "^0.4.0",
|
||||
"file-selector": "^0.5.0",
|
||||
"prop-types": "^15.8.1"
|
||||
}
|
||||
},
|
||||
@@ -29250,9 +29277,9 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz",
|
||||
"integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw=="
|
||||
"version": "4.6.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
||||
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg=="
|
||||
},
|
||||
"unbox-primitive": {
|
||||
"version": "1.0.2",
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
"@emotion/styled": "^11.8.1",
|
||||
"@msgpack/msgpack": "^2.7.2",
|
||||
"@mui/icons-material": "^5.6.2",
|
||||
"@mui/material": "^5.6.2",
|
||||
"@mui/material": "^5.6.3",
|
||||
"@table-library/react-table-library": "^3.1.0",
|
||||
"@types/lodash": "^4.14.182",
|
||||
"@types/node": "^17.0.26",
|
||||
"@types/node": "^17.0.30",
|
||||
"@types/react": "^17.0.43",
|
||||
"@types/react-dom": "^17.0.14",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"async-validator": "^4.0.8",
|
||||
"axios": "^0.26.1",
|
||||
"async-validator": "^4.1.1",
|
||||
"axios": "^0.27.2",
|
||||
"http-proxy-middleware": "^2.0.6",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
@@ -25,12 +25,12 @@
|
||||
"react": "^17.0.2",
|
||||
"react-app-rewired": "^2.2.1",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dropzone": "^12.0.5",
|
||||
"react-dropzone": "^14.0.1",
|
||||
"react-icons": "^4.3.1",
|
||||
"react-router-dom": "^6.3.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"sockette": "^2.0.6",
|
||||
"typescript": "^4.6.3"
|
||||
"typescript": "^4.6.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-app-rewired start",
|
||||
@@ -97,7 +97,7 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.15",
|
||||
"nodemon": "^2.0.16",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import * as AuthenticationApi from './api/authentication';
|
||||
import { PROJECT_NAME } from './api/env';
|
||||
import { AuthenticationContext } from './contexts/authentication';
|
||||
|
||||
import { AxiosError } from 'axios';
|
||||
|
||||
import { extractErrorMessage, onEnterCallback, updateValue } from './utils';
|
||||
import { SignInRequest } from './types';
|
||||
import { ValidatedTextField } from './components';
|
||||
@@ -42,9 +44,11 @@ const SignIn: FC = () => {
|
||||
try {
|
||||
const { data: loginResponse } = await AuthenticationApi.signIn(signInRequest);
|
||||
authenticationContext.signIn(loginResponse.access_token);
|
||||
} catch (error: any) {
|
||||
if (error.response?.status === 401) {
|
||||
enqueueSnackbar('Invalid login details', { variant: 'warning' });
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof AxiosError) {
|
||||
if (error.response?.status === 401) {
|
||||
enqueueSnackbar('Invalid login details', { variant: 'warning' });
|
||||
}
|
||||
} else {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Unexpected error, please try again'), { variant: 'error' });
|
||||
}
|
||||
|
||||
@@ -24,13 +24,19 @@ const getBorderColor = (theme: Theme, props: DropzoneState) => {
|
||||
export interface SingleUploadProps {
|
||||
onDrop: (acceptedFiles: File[]) => void;
|
||||
onCancel: () => void;
|
||||
accept?: string | string[];
|
||||
uploading: boolean;
|
||||
progress?: ProgressEvent;
|
||||
}
|
||||
|
||||
const SingleUpload: FC<SingleUploadProps> = ({ onDrop, onCancel, accept, uploading, progress }) => {
|
||||
const dropzoneState = useDropzone({ onDrop, accept, disabled: uploading, multiple: false });
|
||||
const SingleUpload: FC<SingleUploadProps> = ({ onDrop, onCancel, uploading, progress }) => {
|
||||
const dropzoneState = useDropzone({
|
||||
onDrop,
|
||||
accept: {
|
||||
'application/octet-stream': ['.bin']
|
||||
},
|
||||
disabled: uploading,
|
||||
multiple: false
|
||||
});
|
||||
const { getRootProps, getInputProps } = dropzoneState;
|
||||
const theme = useTheme();
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ const useFileUpload = ({ upload }: MediaUploadOptions) => {
|
||||
});
|
||||
resetUploadingStates();
|
||||
enqueueSnackbar('Upload successful', { variant: 'success' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
if (axios.isCancel(error)) {
|
||||
enqueueSnackbar('Upload aborted', { variant: 'warning' });
|
||||
} else {
|
||||
|
||||
@@ -23,9 +23,9 @@ const Authentication: FC = ({ children }) => {
|
||||
const decodedMe = AuthenticationApi.decodeMeJWT(accessToken);
|
||||
setMe(decodedMe);
|
||||
enqueueSnackbar(`Logged in as ${decodedMe.username}`, { variant: 'success' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
setMe(undefined);
|
||||
throw new Error('Failed to parse JWT ' + error.message);
|
||||
throw new Error('Failed to parse JWT');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ const Authentication: FC = ({ children }) => {
|
||||
await AuthenticationApi.verifyAuthorization();
|
||||
setMe(AuthenticationApi.decodeMeJWT(accessToken));
|
||||
setInitialized(true);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
setMe(undefined);
|
||||
setInitialized(true);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ const FeaturesLoader: FC = (props) => {
|
||||
try {
|
||||
const response = await FeaturesApi.readFeatures();
|
||||
setFeatures(response.data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
setErrorMessage(extractErrorMessage(error, 'Failed to fetch application details.'));
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { useEffect, FC, useState, useCallback, useRef } from 'react';
|
||||
import { useSnackbar } from 'notistack';
|
||||
|
||||
import { AxiosError } from 'axios';
|
||||
|
||||
import { Button } from '@mui/material';
|
||||
import PermScanWifiIcon from '@mui/icons-material/PermScanWifi';
|
||||
|
||||
import * as NetworkApi from '../../api/network';
|
||||
import { WiFiNetwork, WiFiNetworkList } from '../../types';
|
||||
import { ButtonRow, FormLoader, SectionContent } from '../../components';
|
||||
import { extractErrorMessage } from '../../utils';
|
||||
|
||||
import WiFiNetworkSelector from './WiFiNetworkSelector';
|
||||
|
||||
@@ -52,8 +53,12 @@ const WiFiNetworkScanner: FC = () => {
|
||||
newNetworkList.networks.sort(compareNetworks);
|
||||
setNetworkList(newNetworkList);
|
||||
}
|
||||
} catch (error: any) {
|
||||
finishedWithError(extractErrorMessage(error, 'Problem listing WiFi networks'));
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof AxiosError) {
|
||||
finishedWithError('Problem listing WiFi networks ' + error.response?.data.message);
|
||||
} else {
|
||||
finishedWithError('Problem listing WiFi networks');
|
||||
}
|
||||
}
|
||||
}, [finishedWithError]);
|
||||
|
||||
@@ -64,8 +69,12 @@ const WiFiNetworkScanner: FC = () => {
|
||||
try {
|
||||
await NetworkApi.scanNetworks();
|
||||
setTimeout(pollNetworkList, POLLING_FREQUENCY);
|
||||
} catch (error: any) {
|
||||
finishedWithError(extractErrorMessage(error, 'Problem scanning for WiFi networks'));
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof AxiosError) {
|
||||
finishedWithError('Problem scanning for WiFi networks ' + error.response?.data.message);
|
||||
} else {
|
||||
finishedWithError('Problem scanning for WiFi networks');
|
||||
}
|
||||
}
|
||||
}, [finishedWithError, pollNetworkList]);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ const NTPStatusForm: FC = () => {
|
||||
enqueueSnackbar('Time set', { variant: 'success' });
|
||||
setSettingTime(false);
|
||||
loadData();
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem updating time'), { variant: 'error' });
|
||||
} finally {
|
||||
setProcessing(false);
|
||||
|
||||
@@ -33,7 +33,7 @@ const GenerateToken: FC<GenerateTokenProps> = ({ username, onClose }) => {
|
||||
const getToken = useCallback(async () => {
|
||||
try {
|
||||
setToken((await SecurityApi.generateToken(username)).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem generating token'), { variant: 'error' });
|
||||
}
|
||||
}, [username, enqueueSnackbar]);
|
||||
|
||||
@@ -21,7 +21,6 @@ const FirmwareFileUpload: FC<UploadFirmwareProps> = ({ uploadFirmware }) => {
|
||||
/>
|
||||
)}
|
||||
<SingleUpload
|
||||
accept=".bin"
|
||||
onDrop={uploadFile}
|
||||
onCancel={cancelUpload}
|
||||
uploading={uploading}
|
||||
|
||||
@@ -17,7 +17,7 @@ const FirmwareRestartMonitor: FC = () => {
|
||||
try {
|
||||
await SystemApi.readSystemStatus(POLL_TIMEOUT);
|
||||
document.location.href = '/firmwareUpdated';
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
if (new Date().getTime() < timeoutAt.current) {
|
||||
setTimeoutId(setTimeout(poll.current, POLL_INTERVAL));
|
||||
} else {
|
||||
|
||||
@@ -106,7 +106,7 @@ const SystemLog: FC = () => {
|
||||
if (response.status !== 200) {
|
||||
enqueueSnackbar('Problem applying log settings', { variant: 'error' });
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem applying log settings'), { variant: 'error' });
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ const SystemLog: FC = () => {
|
||||
const fetchLog = useCallback(async () => {
|
||||
try {
|
||||
setLogEntries((await SystemApi.readLogEntries()).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
setErrorMessage(extractErrorMessage(error, 'Failed to fetch log'));
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -81,7 +81,7 @@ const SystemStatusForm: FC = () => {
|
||||
try {
|
||||
await SystemApi.restart();
|
||||
enqueueSnackbar('EMS-ESP is restarting...', { variant: 'info' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem restarting device'), { variant: 'error' });
|
||||
} finally {
|
||||
setConfirmRestart(false);
|
||||
@@ -179,7 +179,7 @@ const SystemStatusForm: FC = () => {
|
||||
try {
|
||||
await SystemApi.factoryReset();
|
||||
enqueueSnackbar('Device has been factory reset and will now restart', { variant: 'info' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem factory resetting the device'), { variant: 'error' });
|
||||
} finally {
|
||||
setConfirmFactoryReset(false);
|
||||
|
||||
@@ -138,6 +138,7 @@ const DashboardData: FC = () => {
|
||||
border-right: 1px solid transparent;
|
||||
border-bottom: 1px solid transparent;
|
||||
&:nth-of-type(1) {
|
||||
padding-left: 8px;
|
||||
min-width: 42px;
|
||||
width: 42px;
|
||||
div {
|
||||
@@ -197,21 +198,36 @@ const DashboardData: FC = () => {
|
||||
border-top: 1px solid #177ac9;
|
||||
border-bottom: 1px solid #177ac9;
|
||||
color: white;
|
||||
cursor: 'pointer',
|
||||
}
|
||||
`,
|
||||
BaseCell: `
|
||||
padding-left: 8px;
|
||||
padding-left: 16px;
|
||||
cursor: pointer;
|
||||
border-top: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
border-bottom: 1px solid transparent;
|
||||
&:nth-of-type(1) {
|
||||
padding-left: 16px;
|
||||
}
|
||||
&:nth-of-type(4) {
|
||||
padding-left: 16px;
|
||||
}
|
||||
width: 124px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
&:last-of-type {
|
||||
text-align: right;
|
||||
min-width: 64px;
|
||||
}
|
||||
`,
|
||||
HeaderCell: `
|
||||
padding-left: 0px;
|
||||
padding-left: 8px;
|
||||
&:nth-of-type(1) {
|
||||
padding-left: 8px;
|
||||
}
|
||||
&:nth-of-type(4) {
|
||||
padding-left: 16px;
|
||||
}
|
||||
&:not(:last-of-type) {
|
||||
border-right: 1px solid #565656;
|
||||
}
|
||||
@@ -237,6 +253,7 @@ const DashboardData: FC = () => {
|
||||
iconUp: <KeyboardArrowUpOutlinedIcon />,
|
||||
iconDown: <KeyboardArrowDownOutlinedIcon />
|
||||
},
|
||||
sortToggleType: SortToggleType.AlternateWithReset,
|
||||
sortFns: {
|
||||
GPIO: (array) => array.sort((a, b) => a.g - b.g),
|
||||
NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)),
|
||||
@@ -254,6 +271,7 @@ const DashboardData: FC = () => {
|
||||
iconUp: <KeyboardArrowUpOutlinedIcon />,
|
||||
iconDown: <KeyboardArrowDownOutlinedIcon />
|
||||
},
|
||||
sortToggleType: SortToggleType.AlternateWithReset,
|
||||
sortFns: {
|
||||
NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)),
|
||||
TEMPERATURE: (array) => array.sort((a, b) => a.t - b.t)
|
||||
@@ -272,7 +290,8 @@ const DashboardData: FC = () => {
|
||||
},
|
||||
sortToggleType: SortToggleType.AlternateWithReset,
|
||||
sortFns: {
|
||||
NAME: (array) => array.sort((a, b) => a.id.slice(2).localeCompare(b.id.slice(2)))
|
||||
NAME: (array) => array.sort((a, b) => a.id.slice(2).localeCompare(b.id.slice(2))),
|
||||
VALUE: (array) => array.sort((a, b) => a.v.toString().localeCompare(b.v.toString()))
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -360,7 +379,7 @@ const DashboardData: FC = () => {
|
||||
const fetchCoreData = useCallback(async () => {
|
||||
try {
|
||||
setCoreData((await EMSESP.readCoreData()).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Failed to fetch core data'), { variant: 'error' });
|
||||
}
|
||||
}, [enqueueSnackbar]);
|
||||
@@ -381,7 +400,7 @@ const DashboardData: FC = () => {
|
||||
const unique_id = parseInt(id);
|
||||
try {
|
||||
setDeviceData((await EMSESP.readDeviceData({ id: unique_id })).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem fetching device data'), { variant: 'error' });
|
||||
}
|
||||
};
|
||||
@@ -389,7 +408,7 @@ const DashboardData: FC = () => {
|
||||
const fetchSensorData = async () => {
|
||||
try {
|
||||
setSensorData((await EMSESP.readSensorData()).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem fetching sensor data'), { variant: 'error' });
|
||||
}
|
||||
};
|
||||
@@ -442,7 +461,7 @@ const DashboardData: FC = () => {
|
||||
enqueueSnackbar('Write command sent', { variant: 'success' });
|
||||
}
|
||||
setDeviceValue(undefined);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem writing value'), { variant: 'error' });
|
||||
} finally {
|
||||
refreshData();
|
||||
@@ -533,7 +552,7 @@ const DashboardData: FC = () => {
|
||||
enqueueSnackbar('Sensor updated', { variant: 'success' });
|
||||
}
|
||||
setSensor(undefined);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem updating sensor'), { variant: 'error' });
|
||||
} finally {
|
||||
setSensor(undefined);
|
||||
@@ -741,6 +760,7 @@ const DashboardData: FC = () => {
|
||||
}}
|
||||
theme={data_theme}
|
||||
sort={dv_sort}
|
||||
// layout={{ custom: true }}
|
||||
>
|
||||
{(tableList: any) => (
|
||||
<>
|
||||
@@ -756,7 +776,16 @@ const DashboardData: FC = () => {
|
||||
ENTITY NAME
|
||||
</Button>
|
||||
</HeaderCell>
|
||||
<HeaderCell resize>VALUE</HeaderCell>
|
||||
<HeaderCell resize>
|
||||
<Button
|
||||
fullWidth
|
||||
style={{ fontSize: '14px', justifyContent: 'flex-start' }}
|
||||
endIcon={getSortIcon(dv_sort.state, 'VALUE')}
|
||||
onClick={() => dv_sort.fns.onToggleSort({ sortKey: 'VALUE' })}
|
||||
>
|
||||
VALUE
|
||||
</Button>
|
||||
</HeaderCell>
|
||||
<HeaderCell />
|
||||
</HeaderRow>
|
||||
</Header>
|
||||
@@ -940,7 +969,7 @@ const DashboardData: FC = () => {
|
||||
} else {
|
||||
enqueueSnackbar('Analog sensor removed', { variant: 'success' });
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem updating analog sensor'), { variant: 'error' });
|
||||
} finally {
|
||||
setAnalog(undefined);
|
||||
@@ -968,7 +997,7 @@ const DashboardData: FC = () => {
|
||||
} else {
|
||||
enqueueSnackbar('Analog sensor updated', { variant: 'success' });
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem updating analog'), { variant: 'error' });
|
||||
} finally {
|
||||
setAnalog(undefined);
|
||||
|
||||
@@ -91,6 +91,7 @@ const DashboardStatus: FC = () => {
|
||||
BaseRow: `
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
height: 32px;
|
||||
`,
|
||||
HeaderRow: `
|
||||
text-transform: uppercase;
|
||||
@@ -123,9 +124,29 @@ const DashboardStatus: FC = () => {
|
||||
border-top: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
border-bottom: 1px solid transparent;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
&:nth-of-type(1) {
|
||||
padding-left: 8px;
|
||||
flex: 1;
|
||||
}
|
||||
&:nth-of-type(2) {
|
||||
min-width: 15%;
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
}
|
||||
&:nth-of-type(3) {
|
||||
min-width: 15%;
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
}
|
||||
&:last-of-type {
|
||||
min-width: 15%;
|
||||
width: 15%;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
}
|
||||
`
|
||||
});
|
||||
|
||||
@@ -141,7 +162,7 @@ const DashboardStatus: FC = () => {
|
||||
try {
|
||||
await EMSESP.scanDevices();
|
||||
enqueueSnackbar('Scanning for devices...', { variant: 'info' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem initiating scan'), { variant: 'error' });
|
||||
} finally {
|
||||
setConfirmScan(false);
|
||||
|
||||
@@ -48,7 +48,7 @@ const HelpInformation: FC = () => {
|
||||
document.body.removeChild(a);
|
||||
enqueueSnackbar('File downloaded', { variant: 'info' });
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem with downloading'), { variant: 'error' });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@ const SettingsApplication: FC = () => {
|
||||
eth_clock_mode: response.data.eth_clock_mode
|
||||
});
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem fetching board profile'), { variant: 'error' });
|
||||
} finally {
|
||||
setProcessingBoard(false);
|
||||
@@ -103,7 +103,7 @@ const SettingsApplication: FC = () => {
|
||||
try {
|
||||
await EMSESP.restart();
|
||||
enqueueSnackbar('EMS-ESP is restarting...', { variant: 'info' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem restarting device'), { variant: 'error' });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,6 +62,7 @@ const SettingsCustomization: FC = () => {
|
||||
BaseRow: `
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
`,
|
||||
HeaderRow: `
|
||||
@@ -103,12 +104,14 @@ const SettingsCustomization: FC = () => {
|
||||
border-top: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
border-bottom: 1px solid transparent;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
&:nth-of-type(1) {
|
||||
left: 0px;
|
||||
min-width: 124px;
|
||||
width: 124px;
|
||||
padding-left: 0px;
|
||||
|
||||
}
|
||||
&:nth-of-type(2) {
|
||||
min-width: 70%;
|
||||
@@ -116,12 +119,14 @@ const SettingsCustomization: FC = () => {
|
||||
}
|
||||
`,
|
||||
HeaderCell: `
|
||||
padding-left: 0px;
|
||||
&:nth-of-type(1) {
|
||||
padding-left: 24px;
|
||||
}
|
||||
&:nth-of-type(3) {
|
||||
border-left: 1px solid #565656;
|
||||
&:nth-of-type(2) {
|
||||
padding-left: 0px;
|
||||
}
|
||||
&:not(:last-of-type) {
|
||||
border-right: 1px solid #565656;
|
||||
}
|
||||
`
|
||||
});
|
||||
@@ -155,7 +160,7 @@ const SettingsCustomization: FC = () => {
|
||||
const fetchDevices = useCallback(async () => {
|
||||
try {
|
||||
setDevices((await EMSESP.readDevices()).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
setErrorMessage(extractErrorMessage(error, 'Failed to fetch device list'));
|
||||
}
|
||||
}, []);
|
||||
@@ -168,7 +173,7 @@ const SettingsCustomization: FC = () => {
|
||||
try {
|
||||
const data = (await EMSESP.readDeviceEntities({ id: unique_id })).data;
|
||||
setInitialMask(data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
setErrorMessage(extractErrorMessage(error, 'Problem fetching device entities'));
|
||||
}
|
||||
};
|
||||
@@ -250,7 +255,7 @@ const SettingsCustomization: FC = () => {
|
||||
try {
|
||||
await EMSESP.resetCustomizations();
|
||||
enqueueSnackbar('All customizations have been removed. Restarting...', { variant: 'info' });
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem resetting customizations'), { variant: 'error' });
|
||||
} finally {
|
||||
setConfirmReset(false);
|
||||
@@ -278,7 +283,7 @@ const SettingsCustomization: FC = () => {
|
||||
} else {
|
||||
enqueueSnackbar('Customization save failed', { variant: 'error' });
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
enqueueSnackbar(extractErrorMessage(error, 'Problem sending entity list'), { variant: 'error' });
|
||||
}
|
||||
setInitialMask(deviceEntities);
|
||||
@@ -414,17 +419,12 @@ const SettingsCustomization: FC = () => {
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Table
|
||||
data={{ nodes: shown_data }}
|
||||
theme={entities_theme}
|
||||
sort={entity_sort}
|
||||
layout={{ custom: true, horizontalScroll: true }}
|
||||
>
|
||||
<Table data={{ nodes: shown_data }} theme={entities_theme} sort={entity_sort} layout={{ custom: true }}>
|
||||
{(tableList: any) => (
|
||||
<>
|
||||
<Header>
|
||||
<HeaderRow>
|
||||
<HeaderCell pinLeft>OPTIONS</HeaderCell>
|
||||
<HeaderCell>OPTIONS</HeaderCell>
|
||||
<HeaderCell resize>
|
||||
<Button
|
||||
fullWidth
|
||||
@@ -436,7 +436,6 @@ const SettingsCustomization: FC = () => {
|
||||
</Button>
|
||||
</HeaderCell>
|
||||
<HeaderCell resize>VALUE</HeaderCell>
|
||||
<HeaderCell />
|
||||
</HeaderRow>
|
||||
</Header>
|
||||
<Body>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { AxiosError } from 'axios';
|
||||
|
||||
export const extractErrorMessage = (error: AxiosError, defaultMessage: string) =>
|
||||
(error.response && error.response.data ? error.response.data.message : error.message) || defaultMessage;
|
||||
export const extractErrorMessage = (error: unknown, defaultMessage: string) => {
|
||||
if (error instanceof AxiosError) {
|
||||
return error.response && error.response.data && error?.response?.data?.message;
|
||||
} else if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
return defaultMessage;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ export const useRest = <D>({ read, update }: RestRequestOptions<D>) => {
|
||||
setErrorMessage(undefined);
|
||||
try {
|
||||
setData((await read()).data);
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
const message = extractErrorMessage(error, 'Problem loading data');
|
||||
enqueueSnackbar(message, { variant: 'error' });
|
||||
setErrorMessage(message);
|
||||
@@ -45,7 +45,7 @@ export const useRest = <D>({ read, update }: RestRequestOptions<D>) => {
|
||||
} else {
|
||||
enqueueSnackbar('Settings saved', { variant: 'success' });
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
const message = extractErrorMessage(error, 'Problem saving data');
|
||||
enqueueSnackbar(message, { variant: 'error' });
|
||||
setErrorMessage(message);
|
||||
|
||||
Reference in New Issue
Block a user