@iobroker/adapter-react-v5 7.7.5 → 8.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +3 -3
- package/build/AdminConnection.js.map +1 -1
- package/build/Components/404.js +13 -13
- package/build/Components/404.js.map +1 -1
- package/build/Components/ColorPicker.js.map +1 -1
- package/build/Components/CopyToClipboard.js.map +1 -1
- package/build/Components/Icon.js.map +1 -1
- package/build/Components/IobUri.d.ts +1 -1
- package/build/Components/IobUri.js.map +1 -1
- package/build/Components/Loader.js +223 -223
- package/build/Components/Loader.js.map +1 -1
- package/build/Components/Loaders/MV.js.map +1 -1
- package/build/Components/Loaders/PT.js +103 -103
- package/build/Components/Loaders/PT.js.map +1 -1
- package/build/Components/Loaders/Vendor.js +7 -7
- package/build/Components/Loaders/Vendor.js.map +1 -1
- package/build/Components/MDUtils.js.map +1 -1
- package/build/Components/ObjectBrowser.d.ts +2 -1
- package/build/Components/ObjectBrowser.js +2 -2
- package/build/Components/ObjectBrowser.js.map +1 -1
- package/build/Components/Router.js.map +1 -1
- package/build/Components/SaveCloseButtons.js.map +1 -1
- package/build/Components/SimpleCron/cronText.js.map +1 -1
- package/build/Components/SimpleCron/index.js.map +1 -1
- package/build/Components/TabContainer.js.map +1 -1
- package/build/Components/TabContent.js.map +1 -1
- package/build/Components/TabHeader.js.map +1 -1
- package/build/Components/TableResize.js.map +1 -1
- package/build/Components/TreeTable.js.map +1 -1
- package/build/Components/UploadImage.js +305 -305
- package/build/Components/UploadImage.js.map +1 -1
- package/build/Connection.js.map +1 -1
- package/build/Dialogs/ComplexCron.js.map +1 -1
- package/build/Dialogs/Confirm.js.map +1 -1
- package/build/Dialogs/Cron.js.map +1 -1
- package/build/Dialogs/Error.js.map +1 -1
- package/build/Dialogs/Message.js.map +1 -1
- package/build/Dialogs/SimpleCron.js.map +1 -1
- package/build/Dialogs/TextInput.js.map +1 -1
- package/build/Prompt.js +7 -7
- package/build/Prompt.js.map +1 -1
- package/build/assets/devices/parseNames.js.map +1 -1
- package/build/assets/devices.json +1 -1
- package/build/assets/lamp_ceiling.svg +8 -8
- package/build/assets/lamp_table.svg +7 -7
- package/build/assets/no_icon.svg +9 -9
- package/build/assets/rooms/parseNames.js.map +1 -1
- package/build/assets/rooms.json +1 -1
- package/build/dictionary.js.map +1 -1
- package/build/globals.d.ts +19 -0
- package/build/i18n.js.map +1 -1
- package/build/index.css +56 -56
- package/index.css +56 -56
- package/package.json +84 -82
- package/tasksExample.js +91 -91
package/tasksExample.js
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 bluefox <dogafox@gmail.com>
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
|
|
9
|
-
const fs = require('node:fs');
|
|
10
|
-
const { deleteFoldersRecursive, npmInstall, buildReact, copyFiles } = require('@iobroker/build-tools');
|
|
11
|
-
|
|
12
|
-
const SRC = 'src';
|
|
13
|
-
|
|
14
|
-
function copyAllFiles() {
|
|
15
|
-
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
16
|
-
|
|
17
|
-
copyFiles(
|
|
18
|
-
[
|
|
19
|
-
`${SRC}/build/*`,
|
|
20
|
-
`!${SRC}/build/index.html`,
|
|
21
|
-
`!${SRC}/build/static/js/main.*.chunk.js`,
|
|
22
|
-
`!${SRC}/build/static/media/*.svg`,
|
|
23
|
-
`!${SRC}/build/static/media/*.txt`,
|
|
24
|
-
`!${SRC}/build/i18n/*`,
|
|
25
|
-
`!${SRC}/build/i18n`,
|
|
26
|
-
],
|
|
27
|
-
'admin',
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
copyFiles(`${SRC}/build/index.html`, 'admin');
|
|
31
|
-
|
|
32
|
-
copyFiles(`${SRC}/build/static/js/main.*.chunk.js`, 'admin/static/js');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function clean() {
|
|
36
|
-
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
37
|
-
deleteFoldersRecursive(`${SRC}/build`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function installNpmLocal() {
|
|
41
|
-
if (fs.existsSync(`${SRC}/node_modules`)) {
|
|
42
|
-
return Promise.resolve();
|
|
43
|
-
}
|
|
44
|
-
return npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function patchFiles() {
|
|
48
|
-
if (fs.existsSync(`${__dirname}/admin/index.html`)) {
|
|
49
|
-
let code = fs.readFileSync(`${__dirname}/admin/index.html`).toString('utf8');
|
|
50
|
-
code = code.replace(
|
|
51
|
-
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
52
|
-
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
fs.writeFileSync(`${__dirname}/admin/index.html`, code);
|
|
56
|
-
}
|
|
57
|
-
if (fs.existsSync(`${__dirname}/${SRC}/build/index.html`)) {
|
|
58
|
-
let code = fs.readFileSync(`${__dirname}/${SRC}/build/index.html`).toString('utf8');
|
|
59
|
-
code = code.replace(
|
|
60
|
-
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
61
|
-
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
fs.writeFileSync(`${SRC}/build/index.html`, code);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (process.argv.find(arg => arg === '--0-clean')) {
|
|
69
|
-
clean();
|
|
70
|
-
} else if (process.argv.find(arg => arg === '--1-npm')) {
|
|
71
|
-
npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`).catch(e => {
|
|
72
|
-
console.error(`Cannot install: ${e}`);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
});
|
|
75
|
-
} else if (process.argv.find(arg => arg === '--2-build')) {
|
|
76
|
-
buildReact(SRC, { rootDir: __dirname }).catch(e => {
|
|
77
|
-
console.error(`Cannot build: ${e}`);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
});
|
|
80
|
-
} else if (process.argv.find(arg => arg === '--3-copy')) {
|
|
81
|
-
copyAllFiles();
|
|
82
|
-
} else if (process.argv.find(arg => arg === '--4-patch')) {
|
|
83
|
-
patchFiles();
|
|
84
|
-
} else {
|
|
85
|
-
clean();
|
|
86
|
-
|
|
87
|
-
installNpmLocal()
|
|
88
|
-
.then(() => buildReact(SRC, { rootDir: __dirname }))
|
|
89
|
-
.then(() => copyAllFiles())
|
|
90
|
-
.then(() => patchFiles());
|
|
91
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024 bluefox <dogafox@gmail.com>
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const fs = require('node:fs');
|
|
10
|
+
const { deleteFoldersRecursive, npmInstall, buildReact, copyFiles } = require('@iobroker/build-tools');
|
|
11
|
+
|
|
12
|
+
const SRC = 'src';
|
|
13
|
+
|
|
14
|
+
function copyAllFiles() {
|
|
15
|
+
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
16
|
+
|
|
17
|
+
copyFiles(
|
|
18
|
+
[
|
|
19
|
+
`${SRC}/build/*`,
|
|
20
|
+
`!${SRC}/build/index.html`,
|
|
21
|
+
`!${SRC}/build/static/js/main.*.chunk.js`,
|
|
22
|
+
`!${SRC}/build/static/media/*.svg`,
|
|
23
|
+
`!${SRC}/build/static/media/*.txt`,
|
|
24
|
+
`!${SRC}/build/i18n/*`,
|
|
25
|
+
`!${SRC}/build/i18n`,
|
|
26
|
+
],
|
|
27
|
+
'admin',
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
copyFiles(`${SRC}/build/index.html`, 'admin');
|
|
31
|
+
|
|
32
|
+
copyFiles(`${SRC}/build/static/js/main.*.chunk.js`, 'admin/static/js');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function clean() {
|
|
36
|
+
deleteFoldersRecursive('admin', ['.png', '.json', 'i18n']);
|
|
37
|
+
deleteFoldersRecursive(`${SRC}/build`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function installNpmLocal() {
|
|
41
|
+
if (fs.existsSync(`${SRC}/node_modules`)) {
|
|
42
|
+
return Promise.resolve();
|
|
43
|
+
}
|
|
44
|
+
return npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function patchFiles() {
|
|
48
|
+
if (fs.existsSync(`${__dirname}/admin/index.html`)) {
|
|
49
|
+
let code = fs.readFileSync(`${__dirname}/admin/index.html`).toString('utf8');
|
|
50
|
+
code = code.replace(
|
|
51
|
+
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
52
|
+
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
fs.writeFileSync(`${__dirname}/admin/index.html`, code);
|
|
56
|
+
}
|
|
57
|
+
if (fs.existsSync(`${__dirname}/${SRC}/build/index.html`)) {
|
|
58
|
+
let code = fs.readFileSync(`${__dirname}/${SRC}/build/index.html`).toString('utf8');
|
|
59
|
+
code = code.replace(
|
|
60
|
+
/<script>var script=document\.createElement\("script"\).+?<\/script>/,
|
|
61
|
+
`<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>`,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
fs.writeFileSync(`${SRC}/build/index.html`, code);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (process.argv.find(arg => arg === '--0-clean')) {
|
|
69
|
+
clean();
|
|
70
|
+
} else if (process.argv.find(arg => arg === '--1-npm')) {
|
|
71
|
+
npmInstall(`${__dirname.replace(/\\/g, '/')}/${SRC}/`).catch(e => {
|
|
72
|
+
console.error(`Cannot install: ${e}`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
});
|
|
75
|
+
} else if (process.argv.find(arg => arg === '--2-build')) {
|
|
76
|
+
buildReact(SRC, { rootDir: __dirname }).catch(e => {
|
|
77
|
+
console.error(`Cannot build: ${e}`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
});
|
|
80
|
+
} else if (process.argv.find(arg => arg === '--3-copy')) {
|
|
81
|
+
copyAllFiles();
|
|
82
|
+
} else if (process.argv.find(arg => arg === '--4-patch')) {
|
|
83
|
+
patchFiles();
|
|
84
|
+
} else {
|
|
85
|
+
clean();
|
|
86
|
+
|
|
87
|
+
installNpmLocal()
|
|
88
|
+
.then(() => buildReact(SRC, { rootDir: __dirname }))
|
|
89
|
+
.then(() => copyAllFiles())
|
|
90
|
+
.then(() => patchFiles());
|
|
91
|
+
}
|