Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/proddy/EMS-ESP32 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Dec 12, 2023
2 parents 9f34531 + a33f179 commit d78d4ae
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 50 deletions.
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"**/.pnp.*": true
},
"editor.codeActionsOnSave": {
"source.fixAll": true
// "source.organizeImports": true
"source.fixAll": "explicit"
},
"eslint.nodePath": "interface/.yarn/sdks",
"eslint.workingDirectories": ["interface"],
Expand Down
2 changes: 1 addition & 1 deletion interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@alova/adapter-xhr": "^1.0.1",
"@babel/core": "^7.23.5",
"@babel/core": "^7.23.6",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.19",
Expand Down
13 changes: 6 additions & 7 deletions interface/src/framework/system/UploadFileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,26 @@ const UploadFileForm: FC = () => {
type: 'text/plain'
})
);
anchor.download = 'emsesp_' + endpoint + '.json';
anchor.download = 'emsesp_' + endpoint;
anchor.click();
URL.revokeObjectURL(anchor.href);
toast.info(LL.DOWNLOAD_SUCCESSFUL());
};

onSuccessGetSettings((event) => {
saveFile(event.data, 'settings');
saveFile(event.data, 'settings.json');
});
onSuccessgetCustomizations((event) => {
saveFile(event.data, 'customizations');
saveFile(event.data, 'customizations.json');
});
onSuccessGetEntities((event) => {
saveFile(event.data, 'entities');
saveFile(event.data, 'entities.json');
});
onSuccessGetSchedule((event) => {
saveFile(event.data, 'schedule');
saveFile(event.data, 'schedule.json');
});
onGetAPI((event) => {
const filename = event.sendArgs[0].device + '_' + event.sendArgs[0].entity;
saveFile(event.data, filename);
saveFile(event.data, event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.txt');
});

const downloadSettings = async () => {
Expand Down
4 changes: 3 additions & 1 deletion interface/src/project/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ const Help: FC = () => {
const { send: getAPI, onSuccess: onGetAPI } = useRequest((data) => EMSESP.API(data), {
immediate: false
});

onGetAPI((event) => {
const anchor = document.createElement('a');
anchor.href = URL.createObjectURL(
new Blob([JSON.stringify(event.data, null, 2)], {
type: 'text/plain'
})
);
anchor.download = 'emsesp_' + event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.json';
anchor.download = 'emsesp_' + event.sendArgs[0].device + '_' + event.sendArgs[0].entity + '.txt';
anchor.click();
URL.revokeObjectURL(anchor.href);
toast.info(LL.DOWNLOAD_SUCCESSFUL());
});

const callAPI = async (device: string, entity: string) => {
await getAPI({ device, entity, id: 0 }).catch((error) => {
toast.error(error.message);
Expand Down
140 changes: 101 additions & 39 deletions interface/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ __metadata:
languageName: node
linkType: hard

"@babel/compat-data@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/compat-data@npm:7.23.5"
checksum: 088f14f646ecbddd5ef89f120a60a1b3389a50a9705d44603dca77662707d0175a5e0e0da3943c3298f1907a4ab871468656fbbf74bb7842cd8b0686b2c19736
languageName: node
linkType: hard

"@babel/core@npm:^7.22.1":
version: 7.23.2
resolution: "@babel/core@npm:7.23.2"
Expand All @@ -79,26 +86,26 @@ __metadata:
languageName: node
linkType: hard

"@babel/core@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/core@npm:7.23.5"
"@babel/core@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/core@npm:7.23.6"
dependencies:
"@ampproject/remapping": "npm:^2.2.0"
"@babel/code-frame": "npm:^7.23.5"
"@babel/generator": "npm:^7.23.5"
"@babel/helper-compilation-targets": "npm:^7.22.15"
"@babel/generator": "npm:^7.23.6"
"@babel/helper-compilation-targets": "npm:^7.23.6"
"@babel/helper-module-transforms": "npm:^7.23.3"
"@babel/helpers": "npm:^7.23.5"
"@babel/parser": "npm:^7.23.5"
"@babel/helpers": "npm:^7.23.6"
"@babel/parser": "npm:^7.23.6"
"@babel/template": "npm:^7.22.15"
"@babel/traverse": "npm:^7.23.5"
"@babel/types": "npm:^7.23.5"
"@babel/traverse": "npm:^7.23.6"
"@babel/types": "npm:^7.23.6"
convert-source-map: "npm:^2.0.0"
debug: "npm:^4.1.0"
gensync: "npm:^1.0.0-beta.2"
json5: "npm:^2.2.3"
semver: "npm:^6.3.1"
checksum: f24265172610dbffe0e315b6a8e8f87cf87d2643c8915196adcddd81c66a8eaeb1b36fea851e2308961636a180089a5f10becaa340d5b707d5f64e2e5ffb2bc8
checksum: a72ba71d2f557d09ff58a5f0846344b9cea9dfcbd7418729a3a74d5b0f37a5ca024942fef4d19f248de751928a1be3d5cb0488746dd8896009dd55b974bb552e
languageName: node
linkType: hard

Expand All @@ -114,15 +121,15 @@ __metadata:
languageName: node
linkType: hard

"@babel/generator@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/generator@npm:7.23.5"
"@babel/generator@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/generator@npm:7.23.6"
dependencies:
"@babel/types": "npm:^7.23.5"
"@babel/types": "npm:^7.23.6"
"@jridgewell/gen-mapping": "npm:^0.3.2"
"@jridgewell/trace-mapping": "npm:^0.3.17"
jsesc: "npm:^2.5.1"
checksum: 094af79c2e8fdb0cfd06b42ff6a39a8a95639bc987cace44f52ed5c46127f5469eb20ab5f4c8991fc00fa9c1445a1977cde8e44289d6be29ddbb315fb0fc1b45
checksum: 864090d5122c0aa3074471fd7b79d8a880c1468480cbd28925020a3dcc7eb6e98bedcdb38983df299c12b44b166e30915b8085a7bc126e68fa7e2aadc7bd1ac5
languageName: node
linkType: hard

Expand All @@ -148,6 +155,19 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-compilation-targets@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/helper-compilation-targets@npm:7.23.6"
dependencies:
"@babel/compat-data": "npm:^7.23.5"
"@babel/helper-validator-option": "npm:^7.23.5"
browserslist: "npm:^4.22.2"
lru-cache: "npm:^5.1.1"
semver: "npm:^6.3.1"
checksum: 05595cd73087ddcd81b82d2f3297aac0c0422858dfdded43d304786cf680ec33e846e2317e6992d2c964ee61d93945cbf1fa8ec80b55aee5bfb159227fb02cb9
languageName: node
linkType: hard

"@babel/helper-environment-visitor@npm:^7.22.20":
version: 7.22.20
resolution: "@babel/helper-environment-visitor@npm:7.22.20"
Expand Down Expand Up @@ -266,6 +286,13 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-validator-option@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/helper-validator-option@npm:7.23.5"
checksum: 537cde2330a8aede223552510e8a13e9c1c8798afee3757995a7d4acae564124fe2bf7e7c3d90d62d3657434a74340a274b3b3b1c6f17e9a2be1f48af29cb09e
languageName: node
linkType: hard

"@babel/helpers@npm:^7.23.2":
version: 7.23.2
resolution: "@babel/helpers@npm:7.23.2"
Expand All @@ -277,14 +304,14 @@ __metadata:
languageName: node
linkType: hard

"@babel/helpers@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/helpers@npm:7.23.5"
"@babel/helpers@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/helpers@npm:7.23.6"
dependencies:
"@babel/template": "npm:^7.22.15"
"@babel/traverse": "npm:^7.23.5"
"@babel/types": "npm:^7.23.5"
checksum: 84a813db55e03b5f47cef1210eb22751dae5dc3605bf62ff9acd4c248d857f94cb43dc7299e0edcec9312b31088f0d77f881282df2957e65a322b5412801cc24
"@babel/traverse": "npm:^7.23.6"
"@babel/types": "npm:^7.23.6"
checksum: 2a85fd2bcbc15a6c94dbe7b9e94d8920f9de76d164179d6895fee89c4339079d9e3e56f572bf19b5e7d1e6f1997d7fbaeaa686b47d35136852631dfd09e85c2f
languageName: node
linkType: hard

Expand Down Expand Up @@ -319,12 +346,12 @@ __metadata:
languageName: node
linkType: hard

"@babel/parser@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/parser@npm:7.23.5"
"@babel/parser@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/parser@npm:7.23.6"
bin:
parser: ./bin/babel-parser.js
checksum: 828c250ace0c58f9dc311fd13ad3da34e86ed27a5c6b4183ce9d85be250e78eeb71a13f6d51a368c46f8cbe51106c726bfbb158bf46a89db3a168a0002d3050a
checksum: 6be3a63d3c9d07b035b5a79c022327cb7e16cbd530140ecb731f19a650c794c315a72c699a22413ebeafaff14aa8f53435111898d59e01a393d741b85629fa7d
languageName: node
linkType: hard

Expand Down Expand Up @@ -412,21 +439,21 @@ __metadata:
languageName: node
linkType: hard

"@babel/traverse@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/traverse@npm:7.23.5"
"@babel/traverse@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/traverse@npm:7.23.6"
dependencies:
"@babel/code-frame": "npm:^7.23.5"
"@babel/generator": "npm:^7.23.5"
"@babel/generator": "npm:^7.23.6"
"@babel/helper-environment-visitor": "npm:^7.22.20"
"@babel/helper-function-name": "npm:^7.23.0"
"@babel/helper-hoist-variables": "npm:^7.22.5"
"@babel/helper-split-export-declaration": "npm:^7.22.6"
"@babel/parser": "npm:^7.23.5"
"@babel/types": "npm:^7.23.5"
debug: "npm:^4.1.0"
"@babel/parser": "npm:^7.23.6"
"@babel/types": "npm:^7.23.6"
debug: "npm:^4.3.1"
globals: "npm:^11.1.0"
checksum: 281cae2765caad88c7af6214eab3647db0e9cadc7ffcd3fd924f09fbb9bd09d97d6fb210794b7545c317ce417a30016636530043a455ba6922349e39c1ba622a
checksum: ee4434a3ce792ee8956b64d76843caa1dda4779bb621ed9f951dd3551965bf1f292f097011c9730ecbc0b57f02434b1fa5a771610a2ef570726b0df0fc3332d9
languageName: node
linkType: hard

Expand All @@ -441,14 +468,14 @@ __metadata:
languageName: node
linkType: hard

"@babel/types@npm:^7.23.5":
version: 7.23.5
resolution: "@babel/types@npm:7.23.5"
"@babel/types@npm:^7.23.6":
version: 7.23.6
resolution: "@babel/types@npm:7.23.6"
dependencies:
"@babel/helper-string-parser": "npm:^7.23.4"
"@babel/helper-validator-identifier": "npm:^7.22.20"
to-fast-properties: "npm:^2.0.0"
checksum: a623a4e7f396f1903659099da25bfa059694a49f42820f6b5288347f1646f0b37fb7cc550ba45644e9067149368ef34ccb1bd4a4251ec59b83b3f7765088f363
checksum: 07e70bb94d30b0231396b5e9a7726e6d9227a0a62e0a6830c0bd3232f33b024092e3d5a7d1b096a65bbf2bb43a9ab4c721bf618e115bfbb87b454fa060f88cbf
languageName: node
linkType: hard

Expand Down Expand Up @@ -1783,7 +1810,7 @@ __metadata:
resolution: "EMS-ESP@workspace:."
dependencies:
"@alova/adapter-xhr": "npm:^1.0.1"
"@babel/core": "npm:^7.23.5"
"@babel/core": "npm:^7.23.6"
"@emotion/react": "npm:^11.11.1"
"@emotion/styled": "npm:^11.11.0"
"@mui/icons-material": "npm:^5.14.19"
Expand Down Expand Up @@ -2332,6 +2359,20 @@ __metadata:
languageName: node
linkType: hard

"browserslist@npm:^4.22.2":
version: 4.22.2
resolution: "browserslist@npm:4.22.2"
dependencies:
caniuse-lite: "npm:^1.0.30001565"
electron-to-chromium: "npm:^1.4.601"
node-releases: "npm:^2.0.14"
update-browserslist-db: "npm:^1.0.13"
bin:
browserslist: cli.js
checksum: e3590793db7f66ad3a50817e7b7f195ce61e029bd7187200244db664bfbe0ac832f784e4f6b9c958aef8ea4abe001ae7880b7522682df521f4bc0a5b67660b5e
languageName: node
linkType: hard

"buffer-alloc-unsafe@npm:^1.1.0":
version: 1.1.0
resolution: "buffer-alloc-unsafe@npm:1.1.0"
Expand Down Expand Up @@ -2466,6 +2507,13 @@ __metadata:
languageName: node
linkType: hard

"caniuse-lite@npm:^1.0.30001565":
version: 1.0.30001568
resolution: "caniuse-lite@npm:1.0.30001568"
checksum: 27aa9697e8fccf61702962a3cc48ec2355940e94872e4f0dab108d8a88adb0250e5b96572bef08b90a67a8183d1c704448b2fc69d600d7b6405b3f74dc5dbcb6
languageName: node
linkType: hard

"caw@npm:^2.0.0, caw@npm:^2.0.1":
version: 2.0.1
resolution: "caw@npm:2.0.1"
Expand Down Expand Up @@ -2841,7 +2889,7 @@ __metadata:
languageName: node
linkType: hard

"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4":
"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4":
version: 4.3.4
resolution: "debug@npm:4.3.4"
dependencies:
Expand Down Expand Up @@ -3162,6 +3210,13 @@ __metadata:
languageName: node
linkType: hard

"electron-to-chromium@npm:^1.4.601":
version: 1.4.609
resolution: "electron-to-chromium@npm:1.4.609"
checksum: 0ec022c34a254eaa3b595b05f2c0f027f713e8c3c986e42920f8a958385ef5b8a3ea97735109edf4394600db7a9d2dd8ab096b0d1839d4452708f0ad88488943
languageName: node
linkType: hard

"emoji-regex@npm:^8.0.0":
version: 8.0.0
resolution: "emoji-regex@npm:8.0.0"
Expand Down Expand Up @@ -6311,6 +6366,13 @@ __metadata:
languageName: node
linkType: hard

"node-releases@npm:^2.0.14":
version: 2.0.14
resolution: "node-releases@npm:2.0.14"
checksum: 0f7607ec7db5ef1dc616899a5f24ae90c869b6a54c2d4f36ff6d84a282ab9343c7ff3ca3670fe4669171bb1e8a9b3e286e1ef1c131f09a83d70554f855d54f24
languageName: node
linkType: hard

"nopt@npm:^6.0.0":
version: 6.0.0
resolution: "nopt@npm:6.0.0"
Expand Down

0 comments on commit d78d4ae

Please sign in to comment.