@iobroker/adapter-react-v5 3.1.23 → 3.1.26
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/404.d.ts +3 -0
- package/Components/ColorPicker.d.ts +138 -0
- package/Components/ComplexCron.d.ts +8 -0
- package/Components/CustomModal.d.ts +3 -0
- package/Components/FileBrowser.d.ts +125 -0
- package/Components/FileBrowser.js +26 -9
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.d.ts +80 -0
- package/Components/FileViewer.js +27 -22
- package/Components/FileViewer.js.map +1 -1
- package/Components/Icon.d.ts +21 -0
- package/Components/IconPicker.d.ts +64 -0
- package/Components/IconSelector.d.ts +25 -0
- package/Components/Image.d.ts +64 -0
- package/Components/JsonConfigComponent/ChipInput.d.ts +13 -0
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +10 -0
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigChip.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigColor.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +26 -0
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigFile.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +71 -0
- package/Components/JsonConfigComponent/ConfigIP.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +18 -0
- package/Components/JsonConfigComponent/ConfigSendto.js +171 -9
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +18 -0
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigTable.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +33 -0
- package/Components/JsonConfigComponent/ConfigText.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigText.js +24 -3
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +10 -0
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigUser.d.ts +14 -0
- package/Components/JsonConfigComponent/index.d.ts +27 -0
- package/Components/JsonConfigComponent/index.js +21 -17
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/Loader.d.ts +37 -0
- package/Components/Loaders/PT.d.ts +41 -0
- package/Components/Loaders/Vendor.d.ts +41 -0
- package/Components/Logo.d.ts +59 -0
- package/Components/MDUtils.d.ts +12 -0
- package/Components/ObjectBrowser.d.ts +632 -0
- package/Components/ObjectBrowser.js +315 -449
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.d.ts +35 -0
- package/Components/SaveCloseButtons.d.ts +64 -0
- package/Components/Schedule.d.ts +7 -0
- package/Components/SelectWithIcon.d.ts +21 -0
- package/Components/SimpleCron/cron2text.d.ts +8 -0
- package/Components/SimpleCron/cronText.d.ts +2 -0
- package/Components/SimpleCron/index.d.ts +8 -0
- package/Components/SimpleCron/jquery.cron.locale.d.ts +2 -0
- package/Components/TabContainer.d.ts +42 -0
- package/Components/TabContent.d.ts +32 -0
- package/Components/TabHeader.d.ts +13 -0
- package/Components/TableResize.d.ts +14 -0
- package/Components/TextWithIcon.d.ts +3 -0
- package/Components/ToggleThemeMenu.d.ts +8 -0
- package/Components/TreeTable.d.ts +3 -0
- package/Components/UploadImage.d.ts +2 -0
- package/Components/Utils.d.ts +334 -0
- package/Components/copy-to-clipboard.d.ts +2 -0
- package/Components/withWidth.d.ts +2 -0
- package/Connection.d.ts +761 -0
- package/Connection.js +9 -1
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.d.ts +15 -0
- package/Dialogs/Confirm.d.ts +48 -0
- package/Dialogs/Cron.d.ts +15 -0
- package/Dialogs/Error.d.ts +49 -0
- package/Dialogs/FileSelect.d.ts +148 -0
- package/Dialogs/Message.d.ts +39 -0
- package/Dialogs/SelectID.d.ts +161 -0
- package/Dialogs/SimpleCron.d.ts +14 -0
- package/Dialogs/TextInput.d.ts +87 -0
- package/GenericApp.d.ts +213 -0
- package/Prompt.d.ts +5 -0
- package/README.md +7 -0
- package/Theme.d.ts +7 -0
- package/assets/devices/parseNames.d.ts +1 -0
- package/assets/rooms/parseNames.d.ts +1 -0
- package/i18n/de.json +4 -1
- package/i18n/en.json +4 -1
- package/i18n/es.json +4 -1
- package/i18n/fr.json +4 -1
- package/i18n/it.json +4 -1
- package/i18n/nl.json +4 -1
- package/i18n/pl.json +4 -1
- package/i18n/pt.json +4 -1
- package/i18n/ru.json +4 -1
- package/i18n/zh-cn.json +4 -1
- package/i18n.d.ts +92 -0
- package/icons/IconAdapter.d.ts +11 -0
- package/icons/IconAlias.d.ts +11 -0
- package/icons/IconChannel.d.ts +11 -0
- package/icons/IconClearFilter.d.ts +11 -0
- package/icons/IconClosed.d.ts +11 -0
- package/icons/IconCopy.d.ts +38 -0
- package/icons/IconDevice.d.ts +11 -0
- package/icons/IconDocument.d.ts +11 -0
- package/icons/IconDocumentReadOnly.d.ts +11 -0
- package/icons/IconExpert.d.ts +38 -0
- package/icons/IconFx.d.ts +11 -0
- package/icons/IconInstance.d.ts +11 -0
- package/icons/IconLogout.d.ts +38 -0
- package/icons/IconNoIcon.d.ts +38 -0
- package/icons/IconOpen.d.ts +11 -0
- package/icons/IconState.d.ts +11 -0
- package/index.d.ts +113 -0
- package/index.js +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
imagePrefix: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "fullWidthOneButton" | "selectedImage" | "fullWidthIcon"> & object>;
|
|
13
|
+
export default _default;
|
|
14
|
+
import PropTypes from "prop-types";
|
|
15
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export default ConfigGeneric;
|
|
2
|
+
declare class ConfigGeneric extends React.Component<any, any, any> {
|
|
3
|
+
static DIFFERENT_VALUE: string;
|
|
4
|
+
static DIFFERENT_LABEL: string;
|
|
5
|
+
static NONE_VALUE: string;
|
|
6
|
+
static NONE_LABEL: string;
|
|
7
|
+
static AsyncFunction: any;
|
|
8
|
+
static getValue(data: any, attr: any): any;
|
|
9
|
+
static setValue(data: any, attr: any, value: any): any;
|
|
10
|
+
constructor(props: any);
|
|
11
|
+
state: {
|
|
12
|
+
confirmDialog: boolean;
|
|
13
|
+
confirmNewValue: any;
|
|
14
|
+
confirmAttr: any;
|
|
15
|
+
confirmData: any;
|
|
16
|
+
};
|
|
17
|
+
isError: {};
|
|
18
|
+
defaultValue: any;
|
|
19
|
+
lang: ioBroker.Languages;
|
|
20
|
+
componentDidMount(): void;
|
|
21
|
+
sendTo(): void;
|
|
22
|
+
defaultSendToDone: boolean;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
sendToTimeout: any;
|
|
25
|
+
onUpdate: (data: any) => void;
|
|
26
|
+
getText(text: any, noTranslation: any): any;
|
|
27
|
+
renderConfirmDialog(): JSX.Element;
|
|
28
|
+
onChange(attr: any, newValue: any): void;
|
|
29
|
+
execute(func: any, defaultValue: any, data: any, arrayIndex: any, globalData: any): any;
|
|
30
|
+
executeCustom(func: any, data: any, customObj: any, instanceObj: any, arrayIndex: any, globalData: any): any;
|
|
31
|
+
calculate(schema: any): {
|
|
32
|
+
error: boolean;
|
|
33
|
+
disabled: any;
|
|
34
|
+
hidden: any;
|
|
35
|
+
defaultValue: any;
|
|
36
|
+
};
|
|
37
|
+
onError(attr: any, error: any): void;
|
|
38
|
+
renderItem(error: any, disabled: any, defaultValue: any): any;
|
|
39
|
+
renderHelp(text: any, link: any, noTranslation: any): any;
|
|
40
|
+
getPattern(pattern: any): any;
|
|
41
|
+
render(): JSX.Element;
|
|
42
|
+
}
|
|
43
|
+
declare namespace ConfigGeneric {
|
|
44
|
+
namespace propTypes {
|
|
45
|
+
const socket: PropTypes.Validator<object>;
|
|
46
|
+
const data: PropTypes.Requireable<object>;
|
|
47
|
+
const originalData: PropTypes.Requireable<object>;
|
|
48
|
+
const schema: PropTypes.Requireable<object>;
|
|
49
|
+
const attr: PropTypes.Requireable<string>;
|
|
50
|
+
const value: PropTypes.Requireable<any>;
|
|
51
|
+
const themeName: PropTypes.Requireable<string>;
|
|
52
|
+
const style: PropTypes.Requireable<object>;
|
|
53
|
+
const onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
54
|
+
const onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
55
|
+
const customs: PropTypes.Requireable<object>;
|
|
56
|
+
const forceUpdate: PropTypes.Validator<(...args: any[]) => any>;
|
|
57
|
+
const disabled: PropTypes.Requireable<boolean>;
|
|
58
|
+
const systemConfig: PropTypes.Requireable<object>;
|
|
59
|
+
const alive: PropTypes.Requireable<boolean>;
|
|
60
|
+
const common: PropTypes.Requireable<object>;
|
|
61
|
+
const adapterName: PropTypes.Requireable<string>;
|
|
62
|
+
const instance: PropTypes.Requireable<number>;
|
|
63
|
+
const dateFormat: PropTypes.Requireable<string>;
|
|
64
|
+
const isFloatComma: PropTypes.Requireable<boolean>;
|
|
65
|
+
const customObj: PropTypes.Requireable<object>;
|
|
66
|
+
const instanceObj: PropTypes.Requireable<object>;
|
|
67
|
+
const custom: PropTypes.Requireable<boolean>;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
import React from "react";
|
|
71
|
+
import PropTypes from "prop-types";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"image" | "fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"button" | "flex" | "fullWidth" | "wrapper"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
dateFormat: PropTypes.Requireable<string>;
|
|
12
|
+
isFloatComma: PropTypes.Requireable<boolean>;
|
|
13
|
+
imagePrefix: PropTypes.Requireable<string>;
|
|
14
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"button" | "flex" | "fullWidth"> & object>;
|
|
15
|
+
export default _default;
|
|
16
|
+
import PropTypes from "prop-types";
|
|
17
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "halfWidth1" | "halfWidth2"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<never> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth"> & object>;
|
|
12
|
+
export default _default;
|
|
13
|
+
import PropTypes from "prop-types";
|
|
14
|
+
import React from "react";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
adapterName: PropTypes.Requireable<string>;
|
|
7
|
+
alive: PropTypes.Requireable<boolean>;
|
|
8
|
+
instance: PropTypes.Requireable<number>;
|
|
9
|
+
className: PropTypes.Requireable<string>;
|
|
10
|
+
data: PropTypes.Validator<object>;
|
|
11
|
+
schema: PropTypes.Requireable<object>;
|
|
12
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"fullWidth" | "menuPaper"> & object>;
|
|
15
|
+
export default _default;
|
|
16
|
+
import PropTypes from "prop-types";
|
|
17
|
+
import React from "react";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: React.JSXElementConstructor<Omit<PropTypes.InferProps<{
|
|
2
|
+
socket: PropTypes.Validator<object>;
|
|
3
|
+
themeType: PropTypes.Requireable<string>;
|
|
4
|
+
themeName: PropTypes.Requireable<string>;
|
|
5
|
+
style: PropTypes.Requireable<object>;
|
|
6
|
+
className: PropTypes.Requireable<string>;
|
|
7
|
+
data: PropTypes.Validator<object>;
|
|
8
|
+
schema: PropTypes.Requireable<object>;
|
|
9
|
+
onError: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
|
+
adapterName: PropTypes.Requireable<string>;
|
|
12
|
+
instance: PropTypes.Requireable<number>;
|
|
13
|
+
commandRunning: PropTypes.Requireable<boolean>;
|
|
14
|
+
onCommandRunning: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
}>, "classes"> & import("@mui/styles").StyledComponentProps<"icon" | "fullWidth"> & object>;
|
|
16
|
+
export default _default;
|
|
17
|
+
import PropTypes from "prop-types";
|
|
18
|
+
import React from "react";
|
|
@@ -7,8 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
10
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
13
|
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
+
|
|
12
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
19
|
|
|
14
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -47,6 +53,10 @@ var _Error2 = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
|
47
53
|
|
|
48
54
|
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
49
55
|
|
|
56
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
|
+
|
|
58
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
|
+
|
|
50
60
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
51
61
|
|
|
52
62
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -64,6 +74,82 @@ var styles = function styles(theme) {
|
|
|
64
74
|
};
|
|
65
75
|
};
|
|
66
76
|
|
|
77
|
+
function ip2int(ip) {
|
|
78
|
+
return ip.split('.').reduce(function (ipInt, octet) {
|
|
79
|
+
return (ipInt << 8) + parseInt(octet, 10);
|
|
80
|
+
}, 0) >>> 0;
|
|
81
|
+
} // copied from iobroker.admin/src-rx/src/Utils.js
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
function findNetworkAddressOfHost(obj, localIp) {
|
|
85
|
+
var _obj$native, _obj$native$hardware;
|
|
86
|
+
|
|
87
|
+
var networkInterfaces = obj === null || obj === void 0 ? void 0 : (_obj$native = obj["native"]) === null || _obj$native === void 0 ? void 0 : (_obj$native$hardware = _obj$native.hardware) === null || _obj$native$hardware === void 0 ? void 0 : _obj$native$hardware.networkInterfaces;
|
|
88
|
+
|
|
89
|
+
if (!networkInterfaces) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var hostIp;
|
|
94
|
+
Object.keys(networkInterfaces).forEach(function (inter) {
|
|
95
|
+
return networkInterfaces[inter].forEach(function (ip) {
|
|
96
|
+
if (ip.internal) {
|
|
97
|
+
return;
|
|
98
|
+
} else if (localIp.includes(':') && ip.family !== 'IPv6') {
|
|
99
|
+
return;
|
|
100
|
+
} else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
|
|
105
|
+
// if DNS name
|
|
106
|
+
hostIp = ip.address;
|
|
107
|
+
} else {
|
|
108
|
+
if (ip.family === 'IPv4' && localIp.includes('.') && (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))) {
|
|
109
|
+
hostIp = ip.address;
|
|
110
|
+
} else {
|
|
111
|
+
hostIp = ip.address;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (!hostIp) {
|
|
118
|
+
Object.keys(networkInterfaces).forEach(function (inter) {
|
|
119
|
+
networkInterfaces[inter].forEach(function (ip) {
|
|
120
|
+
if (ip.internal) {
|
|
121
|
+
return;
|
|
122
|
+
} else if (localIp.includes(':') && ip.family !== 'IPv6') {
|
|
123
|
+
return;
|
|
124
|
+
} else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
|
|
129
|
+
// if DNS name
|
|
130
|
+
hostIp = ip.address;
|
|
131
|
+
} else {
|
|
132
|
+
hostIp = ip.address;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (!hostIp) {
|
|
139
|
+
Object.keys(networkInterfaces).forEach(function (inter) {
|
|
140
|
+
networkInterfaces[inter].forEach(function (ip) {
|
|
141
|
+
if (ip.internal) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
hostIp = ip.address;
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return hostIp;
|
|
151
|
+
}
|
|
152
|
+
|
|
67
153
|
var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
68
154
|
(0, _inherits2["default"])(ConfigSendto, _ConfigGeneric);
|
|
69
155
|
|
|
@@ -76,13 +162,72 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
76
162
|
|
|
77
163
|
(0, _createClass2["default"])(ConfigSendto, [{
|
|
78
164
|
key: "componentDidMount",
|
|
79
|
-
value: function
|
|
80
|
-
(0,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
165
|
+
value: function () {
|
|
166
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
167
|
+
var hostname, adminInstance, instanceObj, hostObj, ip;
|
|
168
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
169
|
+
while (1) {
|
|
170
|
+
switch (_context.prev = _context.next) {
|
|
171
|
+
case 0:
|
|
172
|
+
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigSendto.prototype), "componentDidMount", this).call(this);
|
|
173
|
+
hostname = window.location.hostname;
|
|
174
|
+
|
|
175
|
+
if (!this.props.schema.openUrl) {
|
|
176
|
+
_context.next = 19;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
_context.next = 5;
|
|
181
|
+
return this.props.socket.getCurrentInstance();
|
|
182
|
+
|
|
183
|
+
case 5:
|
|
184
|
+
adminInstance = _context.sent;
|
|
185
|
+
_context.next = 8;
|
|
186
|
+
return this.props.socket.getObject("system.adapter.".concat(adminInstance));
|
|
187
|
+
|
|
188
|
+
case 8:
|
|
189
|
+
instanceObj = _context.sent;
|
|
190
|
+
_context.next = 11;
|
|
191
|
+
return this.props.socket.getObject("system.host.".concat(instanceObj.common.host));
|
|
192
|
+
|
|
193
|
+
case 11:
|
|
194
|
+
hostObj = _context.sent;
|
|
195
|
+
ip = findNetworkAddressOfHost(hostObj, window.location.hostname);
|
|
196
|
+
|
|
197
|
+
if (!ip) {
|
|
198
|
+
_context.next = 17;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
hostname = ip + ':' + window.location.port;
|
|
203
|
+
_context.next = 19;
|
|
204
|
+
break;
|
|
205
|
+
|
|
206
|
+
case 17:
|
|
207
|
+
console.warn("Cannot find suitable IP in host ".concat(instanceObj.common.host, " for ").concat(instanceObj._id));
|
|
208
|
+
return _context.abrupt("return", null);
|
|
209
|
+
|
|
210
|
+
case 19:
|
|
211
|
+
this.setState({
|
|
212
|
+
_error: '',
|
|
213
|
+
_message: '',
|
|
214
|
+
hostname: hostname
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
case 20:
|
|
218
|
+
case "end":
|
|
219
|
+
return _context.stop();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}, _callee, this);
|
|
223
|
+
}));
|
|
224
|
+
|
|
225
|
+
function componentDidMount() {
|
|
226
|
+
return _componentDidMount.apply(this, arguments);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return componentDidMount;
|
|
230
|
+
}()
|
|
86
231
|
}, {
|
|
87
232
|
key: "renderErrorDialog",
|
|
88
233
|
value: function renderErrorDialog() {
|
|
@@ -127,10 +272,15 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
127
272
|
var _this3 = this;
|
|
128
273
|
|
|
129
274
|
this.props.onCommandRunning(true);
|
|
275
|
+
|
|
276
|
+
var _origin = "".concat(window.location.protocol, "//").concat(this.state.hostname).concat(window.location.pathname.replace(/\/index\.html$/, ''));
|
|
277
|
+
|
|
130
278
|
var data = this.props.schema.data;
|
|
131
279
|
|
|
132
280
|
if (data === undefined && this.props.schema.jsonData) {
|
|
133
|
-
data = this.getPattern(this.props.schema.jsonData, {},
|
|
281
|
+
data = this.getPattern(this.props.schema.jsonData, {}, _objectSpread({
|
|
282
|
+
_origin: _origin
|
|
283
|
+
}, this.props.data));
|
|
134
284
|
|
|
135
285
|
try {
|
|
136
286
|
data = JSON.parse(data);
|
|
@@ -143,6 +293,12 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
143
293
|
data = null;
|
|
144
294
|
}
|
|
145
295
|
|
|
296
|
+
if (this.props.schema.openUrl && !data) {
|
|
297
|
+
data = {
|
|
298
|
+
_origin: "".concat(window.location.protocol, "//").concat(this.state.hostname).concat(window.location.pathname.replace(/\/index\.html$/, ''))
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
146
302
|
this.props.socket.sendTo("".concat(this.props.adapterName, ".").concat(this.props.instance), this.props.schema.command || 'send', data).then(function (response) {
|
|
147
303
|
if (response !== null && response !== void 0 && response.error) {
|
|
148
304
|
if (_this3.props.schema.error && _this3.props.schema.error[response.error]) {
|
|
@@ -163,7 +319,9 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
163
319
|
});
|
|
164
320
|
}
|
|
165
321
|
} else {
|
|
166
|
-
if (response !== null && response !== void 0 && response.
|
|
322
|
+
if (response !== null && response !== void 0 && response.openUrl && _this3.props.schema.openUrl) {
|
|
323
|
+
window.open(response.openUrl, response.window || _this3.props.schema.window || '_blank');
|
|
324
|
+
} else if (response !== null && response !== void 0 && response.result && _this3.props.schema.result && _this3.props.schema.result[response.result]) {
|
|
167
325
|
var text = _this3.getText(_this3.props.schema.result[response.result]);
|
|
168
326
|
|
|
169
327
|
if (response.args) {
|
|
@@ -180,6 +338,10 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
180
338
|
window.alert(_i18n["default"].t('ra_Ok'));
|
|
181
339
|
}
|
|
182
340
|
}
|
|
341
|
+
|
|
342
|
+
if (response !== null && response !== void 0 && response.saveConfig) {
|
|
343
|
+
_this3.props.onChange(null, null, null, true);
|
|
344
|
+
}
|
|
183
345
|
}
|
|
184
346
|
})["catch"](function (e) {
|
|
185
347
|
if (_this3.props.schema.error && _this3.props.schema.error[e.toString()]) {
|