@iobroker/adapter-react-v5 4.8.1 → 4.9.0
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/Logo.d.ts +9 -50
- package/Components/Logo.js +106 -173
- package/Components/ObjectBrowser.d.ts +9 -0
- package/Components/ObjectBrowser.js +370 -165
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/SaveCloseButtons.d.ts +17 -61
- package/Components/SaveCloseButtons.js +64 -124
- package/Components/Schedule.d.ts +31 -6
- package/Components/Schedule.js +1144 -1562
- package/Components/TabContainer.d.ts +9 -37
- package/Components/TabContainer.js +49 -74
- package/Components/TabContent.d.ts +6 -27
- package/Components/TabContent.js +24 -67
- package/Components/TabHeader.d.ts +6 -11
- package/Components/TabHeader.js +11 -40
- package/Components/ToggleThemeMenu.d.ts +10 -8
- package/Components/ToggleThemeMenu.js +16 -36
- package/Components/types.d.ts +10 -2
- package/Dialogs/SelectID.d.ts +39 -114
- package/Dialogs/SelectID.js +141 -246
- package/LegacyConnection.d.ts +1 -1
- package/README.md +6 -2
- package/i18n.d.ts +2 -2
- package/index.d.ts +127 -126
- package/index.js +213 -192
- package/package.json +6 -7
- package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
- package/Components/JsonConfigComponent/ChipInput.js +0 -763
- package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
- package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
- package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
- package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigChip.js +0 -120
- package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
- package/Components/JsonConfigComponent/ConfigColor.js +0 -120
- package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
- package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
- package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
- package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigFile.js +0 -228
- package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
- package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
- package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
- package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigIP.js +0 -130
- package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
- package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
- package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
- package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
- package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
- package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
- package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
- package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPort.js +0 -176
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
- package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
- package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
- package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
- package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
- package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
- package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
- package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigText.js +0 -226
- package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
- package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
- package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigUser.js +0 -142
- package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
- package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
- package/Components/JsonConfigComponent/index.d.ts +0 -26
- package/Components/JsonConfigComponent/index.js +0 -520
- package/Components/JsonConfigComponent/index.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
- package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
- package/Components/Logo.js.map +0 -1
- package/Components/SaveCloseButtons.js.map +0 -1
- package/Components/Schedule.js.map +0 -1
- package/Components/TabContainer.js.map +0 -1
- package/Components/TabContent.js.map +0 -1
- package/Components/TabHeader.js.map +0 -1
- package/Components/ToggleThemeMenu.js.map +0 -1
- package/Dialogs/SelectID.js.map +0 -1
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const material_1 = require("@mui/material");
|
|
31
|
-
const Utils_1 = require("./Utils");
|
|
32
|
-
const JsonConfig_1 = __importDefault(require("./JsonConfig"));
|
|
33
|
-
/**
|
|
34
|
-
* Device List Component
|
|
35
|
-
* @param {object} params - Component parameters
|
|
36
|
-
* @param {object} params.socket - socket object
|
|
37
|
-
* @param {string} params.selectedInstance - Selected instance
|
|
38
|
-
* @returns {*[]} - Array of device cards
|
|
39
|
-
*/
|
|
40
|
-
class Communication extends react_1.Component {
|
|
41
|
-
constructor(props) {
|
|
42
|
-
super(props);
|
|
43
|
-
this.sendActionToInstance = (command, messageToSend, refresh) => {
|
|
44
|
-
const send = async () => {
|
|
45
|
-
this.setState({ showSpinner: true });
|
|
46
|
-
/** @type {object} */
|
|
47
|
-
const response = await this.props.socket.sendTo(this.props.selectedInstance, command, messageToSend);
|
|
48
|
-
/** @type {string} */
|
|
49
|
-
const type = response.type;
|
|
50
|
-
console.log(`Response: ${response.type}`);
|
|
51
|
-
switch (type) {
|
|
52
|
-
case 'message':
|
|
53
|
-
console.log(`Message received: ${response.message}`);
|
|
54
|
-
if (response.message) {
|
|
55
|
-
this.setState({
|
|
56
|
-
message: {
|
|
57
|
-
message: response.message,
|
|
58
|
-
handleClose: () => this.setState({ message: null }, () => this.sendActionToInstance('dm:actionProgress', { origin: response.origin })),
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
case 'confirm':
|
|
64
|
-
console.log(`Confirm received: ${response.confirm}`);
|
|
65
|
-
if (response.confirm) {
|
|
66
|
-
this.setState({
|
|
67
|
-
confirm: {
|
|
68
|
-
message: response.confirm,
|
|
69
|
-
handleClose: (confirm) => this.setState({ confirm: null }, () => this.sendActionToInstance('dm:actionProgress', {
|
|
70
|
-
origin: response.origin,
|
|
71
|
-
confirm,
|
|
72
|
-
})),
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case 'form':
|
|
78
|
-
console.log('Form received');
|
|
79
|
-
if (response.form) {
|
|
80
|
-
this.setState({
|
|
81
|
-
form: Object.assign(Object.assign({}, response.form), { handleClose: (data) => this.setState({ form: null }, () => {
|
|
82
|
-
console.log(`Form ${JSON.stringify(data)}`);
|
|
83
|
-
this.sendActionToInstance('dm:actionProgress', {
|
|
84
|
-
origin: response.origin,
|
|
85
|
-
data,
|
|
86
|
-
});
|
|
87
|
-
}) }),
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
case 'progress':
|
|
92
|
-
if (response.progress) {
|
|
93
|
-
if (this.state.progress) {
|
|
94
|
-
const progress = Object.assign(Object.assign({}, this.state.progress), response.progress);
|
|
95
|
-
this.setState({ progress });
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.setState({ progress: response.progress });
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
this.sendActionToInstance('dm:actionProgress', { origin: response.origin });
|
|
102
|
-
break;
|
|
103
|
-
case 'result':
|
|
104
|
-
console.log('Response content', response.result);
|
|
105
|
-
if (response.result.refresh) {
|
|
106
|
-
if (response.result.refresh === true) {
|
|
107
|
-
this.loadData();
|
|
108
|
-
console.log('Refreshing all');
|
|
109
|
-
}
|
|
110
|
-
else if (response.result.refresh === 'instance') {
|
|
111
|
-
console.log(`Refreshing instance infos: ${this.props.selectedInstance}`);
|
|
112
|
-
}
|
|
113
|
-
else if (response.result.refresh === 'device') {
|
|
114
|
-
if (refresh) {
|
|
115
|
-
console.log(`Refreshing device infos: ${this.props.selectedInstance}`);
|
|
116
|
-
refresh();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
console.log('Not refreshing anything');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (response.result.error) {
|
|
124
|
-
console.error(`Error: ${response.result.error}`);
|
|
125
|
-
this.setState({ showToast: response.result.error.message });
|
|
126
|
-
}
|
|
127
|
-
this.setState({ showSpinner: false });
|
|
128
|
-
break;
|
|
129
|
-
default:
|
|
130
|
-
console.log(`Unknown response type: ${type}`);
|
|
131
|
-
this.setState({ showSpinner: false });
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
send().catch(console.error);
|
|
136
|
-
};
|
|
137
|
-
this.sendControlToInstance = async (command, messageToSend) => {
|
|
138
|
-
const response = await this.props.socket.sendTo(this.props.selectedInstance, command, messageToSend);
|
|
139
|
-
const type = response.type;
|
|
140
|
-
console.log(`Response: ${response.type}`);
|
|
141
|
-
if (response.type === 'result') {
|
|
142
|
-
console.log('Response content', response.result);
|
|
143
|
-
if (response.result.error) {
|
|
144
|
-
console.error(`Error: ${response.result.error}`);
|
|
145
|
-
this.setState({ showToast: response.result.error.message });
|
|
146
|
-
}
|
|
147
|
-
else if (response.result.state !== undefined) {
|
|
148
|
-
return response.result.state;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
console.warn('Unexpected response type', type);
|
|
153
|
-
}
|
|
154
|
-
return null;
|
|
155
|
-
};
|
|
156
|
-
// @ts-expect-error
|
|
157
|
-
this.state = {
|
|
158
|
-
showSpinner: false,
|
|
159
|
-
showToast: null,
|
|
160
|
-
message: null,
|
|
161
|
-
confirm: null,
|
|
162
|
-
form: null,
|
|
163
|
-
progress: null,
|
|
164
|
-
};
|
|
165
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
166
|
-
this.instanceHandler = action => () => this.sendActionToInstance('dm:instanceAction', { actionId: action.id });
|
|
167
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
168
|
-
this.deviceHandler = (deviceId, action, refresh) => () => this.sendActionToInstance('dm:deviceAction', { deviceId, actionId: action.id }, refresh);
|
|
169
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
170
|
-
this.controlHandler = (deviceId, control, state) => () => this.sendControlToInstance('dm:deviceControl', { deviceId, controlId: control.id, state });
|
|
171
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
172
|
-
this.controlStateHandler = (deviceId, control) => () => this.sendControlToInstance('dm:deviceControlState', { deviceId, controlId: control.id });
|
|
173
|
-
this.props.registerHandler && this.props.registerHandler(() => this.loadData());
|
|
174
|
-
}
|
|
175
|
-
// eslint-disable-next-line class-methods-use-this
|
|
176
|
-
loadData() {
|
|
177
|
-
console.error('loadData not implemented');
|
|
178
|
-
}
|
|
179
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
180
|
-
loadDevices() {
|
|
181
|
-
return this.props.socket.sendTo(this.props.selectedInstance, 'dm:listDevices');
|
|
182
|
-
}
|
|
183
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
184
|
-
loadInstanceInfos() {
|
|
185
|
-
return this.props.socket.sendTo(this.props.selectedInstance, 'dm:instanceInfo');
|
|
186
|
-
}
|
|
187
|
-
renderMessageDialog() {
|
|
188
|
-
var _a;
|
|
189
|
-
if (!this.state.message) {
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
return react_1.default.createElement(material_1.Dialog, { open: !0, onClose: () => { var _a; return (_a = this.state.message) === null || _a === void 0 ? void 0 : _a.handleClose(); }, hideBackdrop: true, "aria-describedby": "message-dialog-description" },
|
|
193
|
-
react_1.default.createElement(material_1.DialogContent, null,
|
|
194
|
-
react_1.default.createElement(material_1.DialogContentText, { id: "message-dialog-description" }, (_a = this.state.message) === null || _a === void 0 ? void 0 : _a.message)),
|
|
195
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
196
|
-
react_1.default.createElement(material_1.Button, { onClick: () => { var _a; return (_a = this.state.message) === null || _a === void 0 ? void 0 : _a.handleClose(); }, autoFocus: true }, (0, Utils_1.getTranslation)('okButtonText'))));
|
|
197
|
-
}
|
|
198
|
-
renderConfirmDialog() {
|
|
199
|
-
var _a;
|
|
200
|
-
if (!this.state.confirm) {
|
|
201
|
-
return null;
|
|
202
|
-
}
|
|
203
|
-
return react_1.default.createElement(material_1.Dialog, { open: !0, onClose: () => { var _a; return (_a = this.state.confirm) === null || _a === void 0 ? void 0 : _a.handleClose(); }, hideBackdrop: true, "aria-describedby": "confirm-dialog-description" },
|
|
204
|
-
react_1.default.createElement(material_1.DialogContent, null,
|
|
205
|
-
react_1.default.createElement(material_1.DialogContentText, { id: "confirm-dialog-description" }, (0, Utils_1.getTranslation)((_a = this.state.confirm) === null || _a === void 0 ? void 0 : _a.message))),
|
|
206
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
207
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => { var _a; return (_a = this.state.confirm) === null || _a === void 0 ? void 0 : _a.handleClose(true); }, autoFocus: true }, (0, Utils_1.getTranslation)('yesButtonText')),
|
|
208
|
-
react_1.default.createElement(material_1.Button, { variant: "contained",
|
|
209
|
-
// @ts-expect-error
|
|
210
|
-
color: "grey", onClick: () => { var _a; return (_a = this.state.confirm) === null || _a === void 0 ? void 0 : _a.handleClose(false); }, autoFocus: true, hideBackdrop: true }, (0, Utils_1.getTranslation)('noButtonText'))));
|
|
211
|
-
}
|
|
212
|
-
renderSnackbar() {
|
|
213
|
-
return react_1.default.createElement(material_1.Snackbar, { open: !!this.state.showToast, autoHideDuration: 6000, onClose: () => this.setState({ showToast: null }), message: this.state.showToast });
|
|
214
|
-
}
|
|
215
|
-
renderFormDialog() {
|
|
216
|
-
var _a, _b;
|
|
217
|
-
if (!this.state.form || !this.state.form.schema || !this.state.form.data) {
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
return react_1.default.createElement(material_1.Dialog, { open: !0, onClose: () => { var _a; return ((_a = this.state.form) === null || _a === void 0 ? void 0 : _a.handleClose) && this.state.form.handleClose(); }, hideBackdrop: true },
|
|
221
|
-
((_a = this.state.form) === null || _a === void 0 ? void 0 : _a.title) ? react_1.default.createElement(material_1.DialogTitle, null, (0, Utils_1.getTranslation)((_b = this.state.form) === null || _b === void 0 ? void 0 : _b.title)) : null,
|
|
222
|
-
react_1.default.createElement(material_1.DialogContent, null,
|
|
223
|
-
react_1.default.createElement(JsonConfig_1.default, { instanceId: this.props.selectedInstance, schema: this.state.form.schema, data: this.state.form.data, socket: this.props.socket, onChange: (data) => {
|
|
224
|
-
console.log('handleFormChange', { data });
|
|
225
|
-
const form = Object.assign({}, this.state.form);
|
|
226
|
-
if (form) {
|
|
227
|
-
form.data = data;
|
|
228
|
-
this.setState({ form });
|
|
229
|
-
}
|
|
230
|
-
} })),
|
|
231
|
-
react_1.default.createElement(material_1.DialogActions, null,
|
|
232
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => { var _a, _b; return ((_a = this.state.form) === null || _a === void 0 ? void 0 : _a.handleClose) && this.state.form.handleClose((_b = this.state.form) === null || _b === void 0 ? void 0 : _b.data); }, autoFocus: true }, (0, Utils_1.getTranslation)('okButtonText')),
|
|
233
|
-
react_1.default.createElement(material_1.Button, { variant: "contained",
|
|
234
|
-
// @ts-expect-error
|
|
235
|
-
color: "grey", onClick: () => { var _a; return ((_a = this.state.form) === null || _a === void 0 ? void 0 : _a.handleClose) && this.state.form.handleClose(); }, hideBackdrop: true }, (0, Utils_1.getTranslation)('cancelButtonText'))));
|
|
236
|
-
}
|
|
237
|
-
renderProgressDialog() {
|
|
238
|
-
var _a, _b;
|
|
239
|
-
if (!((_a = this.state.progress) === null || _a === void 0 ? void 0 : _a.open)) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
return react_1.default.createElement(material_1.Dialog, { open: !0, onClose: () => { }, hideBackdrop: true },
|
|
243
|
-
react_1.default.createElement(material_1.LinearProgress, { variant: "determinate", value: ((_b = this.state.progress) === null || _b === void 0 ? void 0 : _b.progress) || 0 }));
|
|
244
|
-
}
|
|
245
|
-
// eslint-disable-next-line class-methods-use-this
|
|
246
|
-
renderContent() {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
renderSpinner() {
|
|
250
|
-
var _a;
|
|
251
|
-
if (!this.state.showSpinner && !((_a = this.state.progress) === null || _a === void 0 ? void 0 : _a.open) && !this.state.message && !this.state.confirm && !this.state.form) {
|
|
252
|
-
return null;
|
|
253
|
-
}
|
|
254
|
-
return react_1.default.createElement(material_1.Backdrop, { style: { zIndex: 1000 }, open: !0 },
|
|
255
|
-
react_1.default.createElement(material_1.CircularProgress, null));
|
|
256
|
-
}
|
|
257
|
-
render() {
|
|
258
|
-
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
259
|
-
this.renderSnackbar(),
|
|
260
|
-
this.renderContent(),
|
|
261
|
-
this.renderSpinner(),
|
|
262
|
-
this.renderConfirmDialog(),
|
|
263
|
-
this.renderMessageDialog(),
|
|
264
|
-
this.renderFormDialog(),
|
|
265
|
-
this.renderProgressDialog());
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
exports.default = Communication;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ActionBase } from '@iobroker/dm-utils/build/types/base';
|
|
3
|
-
interface DeviceActionButtonProps {
|
|
4
|
-
deviceId: string;
|
|
5
|
-
action: any;
|
|
6
|
-
refresh: () => void;
|
|
7
|
-
deviceHandler: (deviceId: string, action: ActionBase<'api'>, refresh: () => void) => () => void;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export default function DeviceActionButton(props: DeviceActionButtonProps): React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const TooltipButton_js_1 = __importDefault(require("./TooltipButton.js"));
|
|
8
|
-
const Utils_js_1 = require("./Utils.js");
|
|
9
|
-
function DeviceActionButton(props) {
|
|
10
|
-
const { deviceId, action, refresh, deviceHandler, disabled, } = props;
|
|
11
|
-
const tooltip = (0, Utils_js_1.getTranslation)(action.description);
|
|
12
|
-
const icon = (0, Utils_js_1.renderIcon)(action);
|
|
13
|
-
return react_1.default.createElement(TooltipButton_js_1.default, { label: action.label || (icon ? null : action.id), tooltip: tooltip, disabled: disabled || action.disabled, Icon: icon, onClick: deviceHandler(deviceId, action, refresh) });
|
|
14
|
-
}
|
|
15
|
-
exports.default = DeviceActionButton;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import { Connection } from '@iobroker/socket-client';
|
|
3
|
-
import { DeviceDetails, DeviceInfo } from '@iobroker/dm-utils';
|
|
4
|
-
import { ActionBase, ControlBase, ControlState } from '@iobroker/dm-utils/build/types/base';
|
|
5
|
-
interface DeviceCardProps {
|
|
6
|
-
title?: string;
|
|
7
|
-
id: string;
|
|
8
|
-
device: DeviceInfo;
|
|
9
|
-
instanceId: string;
|
|
10
|
-
socket: Connection;
|
|
11
|
-
uploadImagesToInstance?: string;
|
|
12
|
-
deviceHandler: (deviceId: string, action: ActionBase<'api'>, refresh: () => void) => () => void;
|
|
13
|
-
controlHandler: (deviceId: string, control: ControlBase, state: ControlState) => () => Promise<ioBroker.State | null>;
|
|
14
|
-
controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;
|
|
15
|
-
smallCards?: boolean;
|
|
16
|
-
alive: boolean;
|
|
17
|
-
}
|
|
18
|
-
interface DeviceCardState {
|
|
19
|
-
open: boolean;
|
|
20
|
-
details: DeviceDetails | null;
|
|
21
|
-
data: Record<string, any>;
|
|
22
|
-
icon: string | undefined;
|
|
23
|
-
showControlDialog: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Device Card Component
|
|
27
|
-
*/
|
|
28
|
-
declare class DeviceCard extends Component<DeviceCardProps, DeviceCardState> {
|
|
29
|
-
constructor(props: DeviceCardProps);
|
|
30
|
-
fetchIcon(): Promise<void>;
|
|
31
|
-
componentDidMount(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Load the device details
|
|
34
|
-
*/
|
|
35
|
-
loadDetails(): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Refresh the device details
|
|
38
|
-
*/
|
|
39
|
-
refresh: () => void;
|
|
40
|
-
/**
|
|
41
|
-
* Copy the device ID to the clipboard
|
|
42
|
-
* @returns {void}
|
|
43
|
-
*/
|
|
44
|
-
copyToClipboard: () => Promise<void>;
|
|
45
|
-
renderDialog(): React.JSX.Element;
|
|
46
|
-
renderControlDialog(): React.JSX.Element;
|
|
47
|
-
renderControls(): React.JSX.Element;
|
|
48
|
-
renderActions(): React.JSX.Element[];
|
|
49
|
-
renderSmall(): React.JSX.Element;
|
|
50
|
-
renderBig(): React.JSX.Element;
|
|
51
|
-
render(): React.JSX.Element;
|
|
52
|
-
}
|
|
53
|
-
export default DeviceCard;
|