@iobroker/adapter-react-v5 5.0.4 → 5.0.6
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/Components/ColorPicker.d.ts +0 -1
- package/Components/ColorPicker.js +1 -1
- package/Components/ComplexCron.js +20 -28
- package/Components/CopyToClipboard.js +0 -4
- package/Components/CustomModal.js +1 -5
- package/Components/FileBrowser.js +13 -18
- package/Components/FileViewer.js +4 -11
- package/Components/Icon.d.ts +2 -2
- package/Components/Icon.js +2 -2
- package/Components/IconSelector.js +2 -10
- package/Components/Image.js +3 -1
- package/Components/Loader.d.ts +2 -2
- package/Components/Loader.js +1 -1
- package/Components/Loaders/PT.d.ts +1 -1
- package/Components/Loaders/PT.js +1 -1
- package/Components/Loaders/Vendor.d.ts +1 -1
- package/Components/Loaders/Vendor.js +2 -2
- package/Components/Logo.js +1 -1
- package/Components/MDUtils.js +2 -0
- package/Components/ObjectBrowser.d.ts +526 -2
- package/Components/ObjectBrowser.js +100 -84
- package/Components/SaveCloseButtons.js +9 -18
- package/Components/Schedule.js +2 -2
- package/Components/SimpleCron/cron2text.js +5 -3
- package/Components/SimpleCron/cronText.js +1 -1
- package/Components/SimpleCron/index.js +29 -35
- package/Components/TableResize.d.ts +1 -1
- package/Components/TableResize.js +1 -1
- package/Components/TextWithIcon.js +1 -1
- package/Components/TreeTable.js +5 -4
- package/Components/Utils.d.ts +58 -60
- package/Components/Utils.js +239 -197
- package/Dialogs/ComplexCron.js +2 -10
- package/Dialogs/Confirm.d.ts +1 -1
- package/Dialogs/Confirm.js +2 -4
- package/Dialogs/Cron.js +1 -3
- package/Dialogs/Error.d.ts +1 -11
- package/Dialogs/Error.js +1 -7
- package/Dialogs/Message.d.ts +1 -12
- package/Dialogs/Message.js +1 -8
- package/Dialogs/SelectFile.js +1 -5
- package/Dialogs/SelectID.d.ts +1 -1
- package/Dialogs/SelectID.js +13 -7
- package/Dialogs/SimpleCron.js +1 -3
- package/Dialogs/TextInput.js +1 -5
- package/GenericApp.d.ts +2 -3
- package/GenericApp.js +11 -9
- package/LegacyConnection.d.ts +11 -12
- package/LegacyConnection.js +350 -222
- package/README.md +25 -0
- package/craco-module-federation.js +2 -2
- package/i18n.d.ts +1 -1
- package/i18n.js +6 -8
- package/package.json +7 -7
- package/types.d.ts +27 -27
package/Dialogs/ComplexCron.js
CHANGED
|
@@ -56,17 +56,9 @@ class DialogComplexCron extends react_1.default.Component {
|
|
|
56
56
|
react_1.default.createElement(material_1.DialogContent, { style: { height: '100%', overflow: 'hidden' } },
|
|
57
57
|
react_1.default.createElement(ComplexCron_1.default, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: i18n_1.default.getLanguage() })),
|
|
58
58
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
59
|
-
!!this.props.clearButton && react_1.default.createElement(material_1.Button
|
|
60
|
-
// @ts-expect-error grey is valid color
|
|
61
|
-
, {
|
|
62
|
-
// @ts-expect-error grey is valid color
|
|
63
|
-
color: "grey", variant: "contained", onClick: () => this.handleClear(), startIcon: react_1.default.createElement(icons_material_1.Delete, null) }, this.props.clear || i18n_1.default.t('ra_Clear')),
|
|
59
|
+
!!this.props.clearButton && react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleClear(), startIcon: react_1.default.createElement(icons_material_1.Delete, null) }, this.props.clear || i18n_1.default.t('ra_Clear')),
|
|
64
60
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
65
|
-
react_1.default.createElement(material_1.Button
|
|
66
|
-
// @ts-expect-error grey is valid color
|
|
67
|
-
, {
|
|
68
|
-
// @ts-expect-error grey is valid color
|
|
69
|
-
color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
61
|
+
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
70
62
|
}
|
|
71
63
|
}
|
|
72
64
|
exports.default = (0, styles_1.withStyles)(styles)(DialogComplexCron);
|
package/Dialogs/Confirm.d.ts
CHANGED
package/Dialogs/Confirm.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* MIT License
|
|
6
6
|
*
|
|
7
|
-
|
|
7
|
+
* */
|
|
8
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
10
10
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -105,9 +105,7 @@ class DialogConfirm extends react_1.Component {
|
|
|
105
105
|
this.props.suppressQuestionMinutes ? react_1.default.createElement(material_1.FormControlLabel, { classes: { label: this.props.classes.suppress, root: this.props.classes.suppressRoot }, control: react_1.default.createElement(material_1.Checkbox, { id: `ar_dialog_confirm_suppress_${this.props.dialogName || ''}`, checked: !!this.state.suppress, onChange: () => this.setState({ suppress: !this.state.suppress }) }), label: this.props.suppressText || i18n_1.default.t('ra_Suppress question for next %s minutes', (this.props.suppressQuestionMinutes || 2).toString()) }) : null)),
|
|
106
106
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
107
107
|
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_ok_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleOk(), color: "primary", autoFocus: true, startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
108
|
-
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_cancel_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleCancel(),
|
|
109
|
-
// @ts-expect-error grey is valid color
|
|
110
|
-
color: "grey", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
108
|
+
react_1.default.createElement(material_1.Button, { id: `ar_dialog_confirm_cancel_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleCancel(), color: "grey", startIcon: react_1.default.createElement(icons_material_1.Close, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
const _export = (0, styles_1.withStyles)(styles)(DialogConfirm);
|
package/Dialogs/Cron.js
CHANGED
|
@@ -98,9 +98,7 @@ class DialogCron extends react_1.default.Component {
|
|
|
98
98
|
this.state.mode === 'complex' && react_1.default.createElement(ComplexCron_1.default, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: i18n_1.default.getLanguage() })),
|
|
99
99
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
100
100
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
101
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleCancel(),
|
|
102
|
-
// @ts-expect-error grey is valid color
|
|
103
|
-
color: "grey", startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
101
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleCancel(), color: "grey", startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
104
|
exports.default = (0, styles_1.withStyles)(styles)(DialogCron);
|
package/Dialogs/Error.d.ts
CHANGED
|
@@ -3,24 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
|
-
|
|
6
|
+
* */
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
interface DialogErrorProps {
|
|
9
9
|
title?: string;
|
|
10
10
|
text: string | React.JSX.Element;
|
|
11
11
|
onClose?: () => void;
|
|
12
|
-
classes?: {
|
|
13
|
-
titleBackground?: string;
|
|
14
|
-
titleColor?: string;
|
|
15
|
-
};
|
|
16
12
|
fullWidth?: boolean;
|
|
17
13
|
}
|
|
18
|
-
/**
|
|
19
|
-
* @property title The dialog title; default: Error (translated)
|
|
20
|
-
* @property text The dialog text.
|
|
21
|
-
* @property onClose Close handler.
|
|
22
|
-
* @property classes The styling class names.
|
|
23
|
-
*/
|
|
24
14
|
declare class DialogError extends Component<DialogErrorProps> {
|
|
25
15
|
handleOk(): void;
|
|
26
16
|
render(): React.JSX.Element;
|
package/Dialogs/Error.js
CHANGED
|
@@ -31,18 +31,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
*
|
|
32
32
|
* MIT License
|
|
33
33
|
*
|
|
34
|
-
|
|
34
|
+
* */
|
|
35
35
|
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const material_1 = require("@mui/material");
|
|
38
38
|
const icons_material_1 = require("@mui/icons-material");
|
|
39
39
|
const i18n_1 = __importDefault(require("../i18n"));
|
|
40
|
-
/**
|
|
41
|
-
* @property title The dialog title; default: Error (translated)
|
|
42
|
-
* @property text The dialog text.
|
|
43
|
-
* @property onClose Close handler.
|
|
44
|
-
* @property classes The styling class names.
|
|
45
|
-
*/
|
|
46
40
|
class DialogError extends react_1.Component {
|
|
47
41
|
handleOk() {
|
|
48
42
|
this.props.onClose && this.props.onClose();
|
package/Dialogs/Message.d.ts
CHANGED
|
@@ -3,27 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
|
-
|
|
6
|
+
* */
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
interface DialogMessageProps {
|
|
9
9
|
title?: string;
|
|
10
10
|
text: string | React.JSX.Element;
|
|
11
11
|
onClose?: () => void;
|
|
12
|
-
classes?: {
|
|
13
|
-
titleBackground: string;
|
|
14
|
-
titleColor: string;
|
|
15
|
-
};
|
|
16
12
|
fullWidth?: boolean;
|
|
17
13
|
icon?: React.JSX.Element;
|
|
18
14
|
ok?: string;
|
|
19
15
|
}
|
|
20
|
-
/**
|
|
21
|
-
* @property title The dialog title; default: Message (translated)
|
|
22
|
-
* @property text The dialog text.
|
|
23
|
-
* @property onClose Close handler.
|
|
24
|
-
*
|
|
25
|
-
* @extends {React.Component<DialogMessageProps>}
|
|
26
|
-
*/
|
|
27
16
|
declare class DialogMessage extends Component<DialogMessageProps> {
|
|
28
17
|
handleOk(): void;
|
|
29
18
|
render(): React.JSX.Element;
|
package/Dialogs/Message.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* MIT License
|
|
6
6
|
*
|
|
7
|
-
|
|
7
|
+
* */
|
|
8
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
10
10
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,13 +37,6 @@ const react_1 = __importStar(require("react"));
|
|
|
37
37
|
const material_1 = require("@mui/material");
|
|
38
38
|
const icons_material_1 = require("@mui/icons-material");
|
|
39
39
|
const i18n_1 = __importDefault(require("../i18n"));
|
|
40
|
-
/**
|
|
41
|
-
* @property title The dialog title; default: Message (translated)
|
|
42
|
-
* @property text The dialog text.
|
|
43
|
-
* @property onClose Close handler.
|
|
44
|
-
*
|
|
45
|
-
* @extends {React.Component<DialogMessageProps>}
|
|
46
|
-
*/
|
|
47
40
|
class DialogMessage extends react_1.Component {
|
|
48
41
|
handleOk() {
|
|
49
42
|
this.props.onClose && this.props.onClose();
|
package/Dialogs/SelectFile.js
CHANGED
|
@@ -112,11 +112,7 @@ class DialogSelectFile extends react_1.default.Component {
|
|
|
112
112
|
}, t: this.props.t || i18n_1.default.t, lang: this.props.lang || i18n_1.default.getLanguage(), socket: this.props.socket, themeType: this.props.themeType, themeName: this.props.themeName, showExpertButton: this.props.showExpertButton, expertMode: this.props.expertMode, showTypeSelector: this.props.showTypeSelector })),
|
|
113
113
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
114
114
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), startIcon: react_1.default.createElement(icons_material_1.Check, null), disabled: !this.state.selected.length, color: "primary" }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
115
|
-
react_1.default.createElement(material_1.Button
|
|
116
|
-
// @ts-expect-error grey is valid color
|
|
117
|
-
, {
|
|
118
|
-
// @ts-expect-error grey is valid color
|
|
119
|
-
color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
115
|
+
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
120
116
|
}
|
|
121
117
|
}
|
|
122
118
|
exports.default = (0, styles_1.withStyles)(styles)(DialogSelectFile);
|
package/Dialogs/SelectID.d.ts
CHANGED
package/Dialogs/SelectID.js
CHANGED
|
@@ -31,7 +31,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
*
|
|
32
32
|
* MIT License
|
|
33
33
|
*
|
|
34
|
-
|
|
34
|
+
* */
|
|
35
35
|
// please do not delete React, as without it other projects could not be compiled: ReferenceError: React is not defined
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const material_1 = require("@mui/material");
|
|
@@ -61,6 +61,7 @@ class DialogSelectID extends react_1.Component {
|
|
|
61
61
|
if (props.filterFunc) {
|
|
62
62
|
if (typeof props.filterFunc === 'string') {
|
|
63
63
|
try {
|
|
64
|
+
// eslint-disable-next-line no-new-func
|
|
64
65
|
this.filterFunc = new Function('obj', props.filterFunc);
|
|
65
66
|
}
|
|
66
67
|
catch (e) {
|
|
@@ -114,7 +115,7 @@ class DialogSelectID extends react_1.Component {
|
|
|
114
115
|
width: '100%',
|
|
115
116
|
maxWidth: '100%',
|
|
116
117
|
maxHeight: 'calc(100% - 16px)',
|
|
117
|
-
}
|
|
118
|
+
},
|
|
118
119
|
}, fullWidth: true, open: !0, "aria-labelledby": "ar_dialog_selectid_title" },
|
|
119
120
|
react_1.default.createElement(material_1.DialogTitle, { id: "ar_dialog_selectid_title", style: {
|
|
120
121
|
whiteSpace: 'nowrap',
|
|
@@ -132,10 +133,17 @@ class DialogSelectID extends react_1.Component {
|
|
|
132
133
|
// style={{ width: '100%', height: '100%' }}
|
|
133
134
|
columns: this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val'], types: this.props.types ? (Array.isArray(this.props.types) ? this.props.types : [this.props.types]) : ['state'], root: this.props.root, t: i18n_1.default.t, lang: this.props.lang || i18n_1.default.getLanguage(), socket: this.props.socket, selected: this.state.selected, multiSelect: this.props.multiSelect, notEditable: this.props.notEditable === undefined ? true : this.props.notEditable,
|
|
134
135
|
// name={this.state.name}
|
|
135
|
-
themeName: this.props.themeName, themeType: this.props.themeType, customFilter: this.props.customFilter, onFilterChanged: filterConfig => {
|
|
136
|
+
themeName: this.props.themeName, themeType: this.props.themeType, customFilter: this.props.customFilter, onFilterChanged: (filterConfig) => {
|
|
136
137
|
this.filters = filterConfig;
|
|
137
138
|
(window._localStorage || window.localStorage).setItem(this.dialogName, JSON.stringify(filterConfig));
|
|
138
|
-
}, onSelect: (
|
|
139
|
+
}, onSelect: (_selected, name, isDouble) => {
|
|
140
|
+
let selected;
|
|
141
|
+
if (!Array.isArray(_selected)) {
|
|
142
|
+
selected = [_selected];
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
selected = _selected;
|
|
146
|
+
}
|
|
139
147
|
if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
|
|
140
148
|
this.setState({ selected, name }, () => isDouble && this.handleOk());
|
|
141
149
|
}
|
|
@@ -145,9 +153,7 @@ class DialogSelectID extends react_1.Component {
|
|
|
145
153
|
}, filterFunc: this.filterFunc, title: "", classes: {} })),
|
|
146
154
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
147
155
|
react_1.default.createElement(material_1.Button, { id: `ar_dialog_selectid_ok_${this.props.dialogName || ''}`, variant: "contained", onClick: () => this.handleOk(), startIcon: react_1.default.createElement(icons_material_1.Check, null), disabled: !this.state.selected.length, color: "primary" }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
148
|
-
react_1.default.createElement(material_1.Button, { id: `ar_dialog_selectid_cancel_${this.props.dialogName || ''}`,
|
|
149
|
-
// @ts-expect-error grey is valid color
|
|
150
|
-
color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
156
|
+
react_1.default.createElement(material_1.Button, { id: `ar_dialog_selectid_cancel_${this.props.dialogName || ''}`, color: "grey", variant: "contained", onClick: () => this.handleCancel(), startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
151
157
|
}
|
|
152
158
|
}
|
|
153
159
|
exports.default = DialogSelectID;
|
package/Dialogs/SimpleCron.js
CHANGED
|
@@ -53,9 +53,7 @@ class DialogSimpleCron extends react_1.default.Component {
|
|
|
53
53
|
react_1.default.createElement(SimpleCron_1.default, { cronExpression: this.state.cron, onChange: cron => this.setState({ cron }), language: i18n_1.default.getLanguage() })),
|
|
54
54
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
55
55
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleOk(), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, this.props.ok || i18n_1.default.t('ra_Ok')),
|
|
56
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleCancel(),
|
|
57
|
-
// @ts-expect-error grey is valid color
|
|
58
|
-
color: "grey", startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
56
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => this.handleCancel(), color: "grey", startIcon: react_1.default.createElement(icons_material_1.Cancel, null) }, this.props.cancel || i18n_1.default.t('ra_Cancel'))));
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
exports.default = (0, styles_1.withStyles)(styles)(DialogSimpleCron);
|
package/Dialogs/TextInput.js
CHANGED
|
@@ -30,10 +30,6 @@ function TextInput(props) {
|
|
|
30
30
|
}, fullWidth: true })),
|
|
31
31
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
32
32
|
react_1.default.createElement(material_1.Button, { variant: "contained", disabled: !text || !!error, onClick: () => props.onClose(text), color: "primary", startIcon: react_1.default.createElement(icons_material_1.Check, null) }, props.applyText || i18n_1.default.t('ra_Ok')),
|
|
33
|
-
react_1.default.createElement(material_1.Button
|
|
34
|
-
// @ts-expect-error grey is valid color
|
|
35
|
-
, {
|
|
36
|
-
// @ts-expect-error grey is valid color
|
|
37
|
-
color: "grey", variant: "contained", onClick: () => props.onClose(null), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, props.cancelText || i18n_1.default.t('ra_Cancel'))));
|
|
33
|
+
react_1.default.createElement(material_1.Button, { color: "grey", variant: "contained", onClick: () => props.onClose(null), startIcon: react_1.default.createElement(icons_material_1.Close, null) }, props.cancelText || i18n_1.default.t('ra_Cancel'))));
|
|
38
34
|
}
|
|
39
35
|
exports.default = (0, withWidth_1.default)()(TextInput);
|
package/GenericApp.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
6
|
-
|
|
6
|
+
* */
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { AdminConnection } from '@iobroker/socket-client';
|
|
9
9
|
import Router from './Components/Router';
|
|
@@ -82,8 +82,7 @@ declare class GenericApp<TProps extends GenericAppProps = GenericAppProps, TStat
|
|
|
82
82
|
onToggleExpertMode(expertMode: boolean): void;
|
|
83
83
|
/**
|
|
84
84
|
* Changes the current theme
|
|
85
|
-
*
|
|
86
|
-
**/
|
|
85
|
+
* */
|
|
87
86
|
toggleTheme(newThemeName?: ThemeName): void;
|
|
88
87
|
/**
|
|
89
88
|
* Gets the system configuration.
|
package/GenericApp.js
CHANGED
|
@@ -31,7 +31,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
*
|
|
32
32
|
* MIT License
|
|
33
33
|
*
|
|
34
|
-
|
|
34
|
+
* */
|
|
35
35
|
const react_1 = __importDefault(require("react"));
|
|
36
36
|
const socket_client_1 = require("@iobroker/socket-client");
|
|
37
37
|
const Sentry = __importStar(require("@sentry/browser"));
|
|
@@ -159,6 +159,7 @@ class GenericApp extends Router_1.default {
|
|
|
159
159
|
this.onToggleExpertMode && this.onToggleExpertMode(this.getExpertMode());
|
|
160
160
|
}
|
|
161
161
|
else if (message.data !== 'chartReady') { // if not "echart ready" message
|
|
162
|
+
// eslint-disable-next-line no-console
|
|
162
163
|
console.debug(`Received unknown message: "${JSON.stringify(message.data)}". May be it will be processed later`);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
@@ -420,8 +421,7 @@ class GenericApp extends Router_1.default {
|
|
|
420
421
|
}
|
|
421
422
|
/**
|
|
422
423
|
* Changes the current theme
|
|
423
|
-
*
|
|
424
|
-
**/
|
|
424
|
+
* */
|
|
425
425
|
toggleTheme(newThemeName) {
|
|
426
426
|
const themeName = this.state.themeName;
|
|
427
427
|
// dark => blue => colored => light => dark
|
|
@@ -468,6 +468,7 @@ class GenericApp extends Router_1.default {
|
|
|
468
468
|
let result = '';
|
|
469
469
|
if (this._secret) {
|
|
470
470
|
for (let i = 0; i < value.length; i++) {
|
|
471
|
+
// eslint-disable-next-line no-bitwise
|
|
471
472
|
result += String.fromCharCode(this._secret[i % this._secret.length].charCodeAt(0) ^ value.charCodeAt(i));
|
|
472
473
|
}
|
|
473
474
|
}
|
|
@@ -480,6 +481,7 @@ class GenericApp extends Router_1.default {
|
|
|
480
481
|
let result = '';
|
|
481
482
|
if (this._secret) {
|
|
482
483
|
for (let i = 0; i < value.length; i++) {
|
|
484
|
+
// eslint-disable-next-line no-bitwise
|
|
483
485
|
result += String.fromCharCode(this._secret[i % this._secret.length].charCodeAt(0) ^ value.charCodeAt(i));
|
|
484
486
|
}
|
|
485
487
|
}
|
|
@@ -555,13 +557,13 @@ class GenericApp extends Router_1.default {
|
|
|
555
557
|
var _a;
|
|
556
558
|
const ips = await this.socket.getHostByIp(host || ((_a = this.common) === null || _a === void 0 ? void 0 : _a.host) || '');
|
|
557
559
|
// translate names
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
560
|
-
|
|
560
|
+
const ip4 = ips.find(ip => ip.address === '0.0.0.0');
|
|
561
|
+
if (ip4) {
|
|
562
|
+
ip4.name = `[IPv4] 0.0.0.0 - ${i18n_1.default.t('ra_Listen on all IPs')}`;
|
|
561
563
|
}
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
|
|
564
|
+
const ip6 = ips.find(ip => ip.address === '::');
|
|
565
|
+
if (ip6) {
|
|
566
|
+
ip6.name = `[IPv4] :: - ${i18n_1.default.t('ra_Listen on all IPs')}`;
|
|
565
567
|
}
|
|
566
568
|
return ips;
|
|
567
569
|
}
|
package/LegacyConnection.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { type HostInfo } from '@iobroker/js-controller-common-db/build/esm/lib/common/tools';
|
|
3
|
-
import { type FilteredNotificationInformation } from '@iobroker/js-controller-common/build/esm/lib/common/notificationHandler';
|
|
4
1
|
/**
|
|
5
2
|
* Copyright 2020-2024, Denis Haev (bluefox) <dogafox@gmail.com>
|
|
6
3
|
*
|
|
7
4
|
* MIT License
|
|
8
5
|
*
|
|
9
|
-
|
|
6
|
+
* */
|
|
7
|
+
/// <reference types="node" />
|
|
8
|
+
import { type HostInfo } from '@iobroker/js-controller-common-db/build/esm/lib/common/tools';
|
|
9
|
+
import { type FilteredNotificationInformation } from '@iobroker/js-controller-common/build/esm/lib/common/notificationHandler';
|
|
10
10
|
declare global {
|
|
11
11
|
interface Window {
|
|
12
12
|
adapterName: undefined | string;
|
|
@@ -24,6 +24,8 @@ export declare const PROGRESS: {
|
|
|
24
24
|
CONNECTED: number;
|
|
25
25
|
/** All objects are loaded. */
|
|
26
26
|
OBJECTS_LOADED: number;
|
|
27
|
+
/** All states are loaded. */
|
|
28
|
+
STATES_LOADED: number;
|
|
27
29
|
/** The socket is ready for use. */
|
|
28
30
|
READY: number;
|
|
29
31
|
};
|
|
@@ -158,19 +160,17 @@ declare class Connection {
|
|
|
158
160
|
waitForFirstConnection(): Promise<void>;
|
|
159
161
|
/**
|
|
160
162
|
* Called internally.
|
|
161
|
-
* @private
|
|
162
163
|
*/
|
|
163
|
-
_getUserPermissions
|
|
164
|
+
private _getUserPermissions;
|
|
164
165
|
/**
|
|
165
166
|
* Called internally.
|
|
166
|
-
* @private
|
|
167
167
|
*/
|
|
168
|
-
onConnect
|
|
168
|
+
private onConnect;
|
|
169
169
|
/**
|
|
170
170
|
* Called internally.
|
|
171
171
|
* @private
|
|
172
172
|
*/
|
|
173
|
-
authenticate(): void;
|
|
173
|
+
static authenticate(): void;
|
|
174
174
|
/**
|
|
175
175
|
* Subscribe to changes of the given state.
|
|
176
176
|
*/
|
|
@@ -492,7 +492,6 @@ declare class Connection {
|
|
|
492
492
|
getLogs(host: string, linesNumber?: number): Promise<string[]>;
|
|
493
493
|
/**
|
|
494
494
|
* Get the log files (only for admin connection).
|
|
495
|
-
* @returns {Promise<string[]>}
|
|
496
495
|
*/
|
|
497
496
|
getLogsFiles(host: string): Promise<string[]>;
|
|
498
497
|
/**
|
|
@@ -872,7 +871,7 @@ declare class Connection {
|
|
|
872
871
|
/** message type like 'startCamera/cam3' */
|
|
873
872
|
messageType: string, data: any,
|
|
874
873
|
/** message handler. Could be null if all callbacks for this messageType should be unsubscribed */
|
|
875
|
-
callback: (
|
|
874
|
+
callback: (_data: Record<string, any>, sourceInstance: string, _messageType: string) => void): Promise<unknown>;
|
|
876
875
|
/**
|
|
877
876
|
* Unsubscribe from instance message
|
|
878
877
|
*/
|
|
@@ -882,7 +881,7 @@ declare class Connection {
|
|
|
882
881
|
/** message type like 'startCamera/cam3' */
|
|
883
882
|
messageType?: string,
|
|
884
883
|
/** message handler. Could be null if all callbacks for this messageType should be unsubscribed */
|
|
885
|
-
callback?: (data: Record<string, any>, sourceInstance: string,
|
|
884
|
+
callback?: (data: Record<string, any>, sourceInstance: string, _messageType: string) => void): Promise<boolean>;
|
|
886
885
|
/**
|
|
887
886
|
* Send log to ioBroker log
|
|
888
887
|
*/
|