@iobroker/dm-gui-components 9.0.1 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -6
- package/build/Communication.d.ts +7 -6
- package/build/Communication.js +39 -22
- package/build/Communication.js.map +1 -1
- package/build/DeviceActionButton.d.ts +1 -2
- package/build/DeviceActionButton.js +2 -2
- package/build/DeviceActionButton.js.map +1 -1
- package/build/DeviceCard.d.ts +4 -5
- package/build/DeviceCard.js +34 -41
- package/build/DeviceCard.js.map +1 -1
- package/build/DeviceList.d.ts +6 -2
- package/build/DeviceList.js +26 -8
- package/build/DeviceList.js.map +1 -1
- package/build/DeviceStatus.d.ts +1 -2
- package/build/DeviceStatus.js +2 -2
- package/build/DeviceStatus.js.map +1 -1
- package/build/StateOrObjectHandler.d.ts +6 -2
- package/build/StateOrObjectHandler.js +128 -108
- package/build/StateOrObjectHandler.js.map +1 -1
- package/build/hooks.js +3 -2
- package/build/hooks.js.map +1 -1
- package/build/protocol/DmProtocolV1.js +68 -4
- package/build/protocol/DmProtocolV1.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -23,47 +23,60 @@ render() {
|
|
|
23
23
|
-->
|
|
24
24
|
|
|
25
25
|
## Changelog
|
|
26
|
-
### 9.0.
|
|
26
|
+
### 9.0.3 (2026-03-04)
|
|
27
|
+
|
|
28
|
+
- (@UncleSamSwiss) Fix handling of "result" response from action handler (update, delete device)
|
|
29
|
+
- (@UncleSamSwiss) Fix handling of V1 protocol action responses
|
|
30
|
+
- (@UncleSamSwiss) Fix handling of "refresh" response from instance actions
|
|
31
|
+
|
|
32
|
+
### 9.0.2 (2026-03-03)
|
|
33
|
+
|
|
27
34
|
- (@UncleSamSwiss) Implemented v3 protocol: added support to use states and objects as values
|
|
28
35
|
|
|
29
36
|
### 8.0.9 (2026-01-28)
|
|
37
|
+
|
|
30
38
|
- (@GermanBluefox) Analyze API version and do not show anything if version is higher than supported
|
|
31
39
|
|
|
32
40
|
### 8.0.8 (2026-01-27)
|
|
41
|
+
|
|
33
42
|
- (@GermanBluefox) Added support of instance selection if not provided
|
|
34
43
|
|
|
35
44
|
### 8.0.7 (2026-01-02)
|
|
45
|
+
|
|
36
46
|
- (@GermanBluefox) Added `ignoreApplyDisabled` flag
|
|
37
47
|
|
|
38
48
|
### 8.0.6 (2025-12-30)
|
|
49
|
+
|
|
39
50
|
- (@GermanBluefox) Added update icon for device actions
|
|
40
51
|
- (@GermanBluefox) Added indeterminate progress
|
|
41
52
|
|
|
42
53
|
### 8.0.4 (2025-10-25)
|
|
54
|
+
|
|
43
55
|
- (@GermanBluefox) Updated packages
|
|
44
56
|
|
|
45
57
|
### 8.0.2 (2025-10-23)
|
|
58
|
+
|
|
46
59
|
- (@GermanBluefox) Renamed gui-components to adapter-react-v5
|
|
47
60
|
|
|
48
61
|
### 8.0.1 (2025-10-23)
|
|
49
62
|
|
|
50
|
-
-
|
|
63
|
+
- (@GermanBluefox) Make package independent
|
|
51
64
|
|
|
52
65
|
### 0.0.10 (2023-12-14)
|
|
53
66
|
|
|
54
|
-
-
|
|
67
|
+
- (bluefox) Changed layout of the device list
|
|
55
68
|
|
|
56
69
|
### 0.0.7 (2023-12-14)
|
|
57
70
|
|
|
58
|
-
-
|
|
71
|
+
- (bluefox) Added alive flag
|
|
59
72
|
|
|
60
73
|
### 0.0.4 (2023-12-12)
|
|
61
74
|
|
|
62
|
-
-
|
|
75
|
+
- (bluefox) return the style of big cards
|
|
63
76
|
|
|
64
77
|
### 0.0.3 (2023-12-12)
|
|
65
78
|
|
|
66
|
-
-
|
|
79
|
+
- (bluefox) initial commit
|
|
67
80
|
|
|
68
81
|
## License
|
|
69
82
|
|
package/build/Communication.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Connection, type IobTheme, type ThemeName, type ThemeType } from '@iobroker/adapter-react-v5';
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
|
-
import type { ActionBase, ActionButton, CommunicationForm, ControlBase, ControlState, InstanceDetails, ProgressUpdate } from './protocol/api';
|
|
3
|
+
import type { ActionBase, ActionButton, CommunicationForm, ControlBase, ControlState, DeviceId, InstanceDetails, ProgressUpdate, DeviceInfo } from './protocol/api';
|
|
4
4
|
import type { CommandName, LoadDevicesCallback, Message } from './protocol/DmProtocolBase';
|
|
5
5
|
declare module '@mui/material/Button' {
|
|
6
6
|
interface ButtonPropsColorOverrides {
|
|
@@ -27,8 +27,6 @@ interface CommunicationFormInState extends CommunicationForm {
|
|
|
27
27
|
interface InputAction extends ActionBase {
|
|
28
28
|
/** If it is a device action */
|
|
29
29
|
deviceId?: string;
|
|
30
|
-
/** Optional refresh function to execute */
|
|
31
|
-
refresh?: () => void;
|
|
32
30
|
}
|
|
33
31
|
export type CommunicationState = {
|
|
34
32
|
showSpinner: boolean;
|
|
@@ -55,13 +53,16 @@ export default class Communication<P extends CommunicationProps, S extends Commu
|
|
|
55
53
|
private protocol;
|
|
56
54
|
private responseTimeout;
|
|
57
55
|
instanceHandler: (action: ActionBase) => () => void;
|
|
58
|
-
deviceHandler: (deviceId: string, action: ActionBase
|
|
56
|
+
deviceHandler: (deviceId: string, action: ActionBase) => () => void;
|
|
59
57
|
controlHandler: (deviceId: string, control: ControlBase, state: ControlState) => () => Promise<ioBroker.State | null>;
|
|
60
58
|
controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;
|
|
61
59
|
constructor(props: P);
|
|
62
60
|
componentWillUnmount(): void;
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
loadAllData(): Promise<void>;
|
|
62
|
+
loadDeviceList(): void;
|
|
63
|
+
updateDevice(_update: DeviceInfo): void;
|
|
64
|
+
deleteDevice(_deviceId: DeviceId): void;
|
|
65
|
+
sendActionToInstance: (command: CommandName, messageToSend: Message) => void;
|
|
65
66
|
sendControlToInstance: (command: CommandName, messageToSend: {
|
|
66
67
|
deviceId: string;
|
|
67
68
|
controlId: string;
|
package/build/Communication.js
CHANGED
|
@@ -49,25 +49,25 @@ export default class Communication extends Component {
|
|
|
49
49
|
this.sendActionToInstance('dm:instanceAction', { actionId: action.id, timeout: action.timeout });
|
|
50
50
|
};
|
|
51
51
|
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
52
|
-
this.deviceHandler = (deviceId, action
|
|
52
|
+
this.deviceHandler = (deviceId, action) => () => {
|
|
53
53
|
if (action.confirmation) {
|
|
54
|
-
this.setState({ showConfirmation: { ...action, deviceId
|
|
54
|
+
this.setState({ showConfirmation: { ...action, deviceId } });
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
if (action.inputBefore) {
|
|
58
58
|
this.setState({
|
|
59
|
-
showInput: { ...action, deviceId
|
|
59
|
+
showInput: { ...action, deviceId },
|
|
60
60
|
inputValue: action.inputBefore.defaultValue || '',
|
|
61
61
|
});
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
this.sendActionToInstance('dm:deviceAction', { deviceId, actionId: action.id, timeout: action.timeout }
|
|
64
|
+
this.sendActionToInstance('dm:deviceAction', { deviceId, actionId: action.id, timeout: action.timeout });
|
|
65
65
|
};
|
|
66
66
|
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
67
67
|
this.controlHandler = (deviceId, control, state) => () => this.sendControlToInstance('dm:deviceControl', { deviceId, controlId: control.id, state });
|
|
68
68
|
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
69
69
|
this.controlStateHandler = (deviceId, control) => () => this.sendControlToInstance('dm:deviceControlState', { deviceId, controlId: control.id });
|
|
70
|
-
this.props.registerHandler?.(() => this.
|
|
70
|
+
this.props.registerHandler?.(() => this.loadDeviceList());
|
|
71
71
|
}
|
|
72
72
|
componentWillUnmount() {
|
|
73
73
|
if (this.responseTimeout) {
|
|
@@ -76,10 +76,23 @@ export default class Communication extends Component {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
// eslint-disable-next-line class-methods-use-this
|
|
79
|
-
|
|
80
|
-
console.error('
|
|
79
|
+
loadAllData() {
|
|
80
|
+
console.error('loadAllData not implemented');
|
|
81
|
+
return Promise.resolve();
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
// eslint-disable-next-line class-methods-use-this
|
|
84
|
+
loadDeviceList() {
|
|
85
|
+
console.error('loadDeviceList not implemented');
|
|
86
|
+
}
|
|
87
|
+
// eslint-disable-next-line class-methods-use-this
|
|
88
|
+
updateDevice(_update) {
|
|
89
|
+
console.error('updateDevice not implemented');
|
|
90
|
+
}
|
|
91
|
+
// eslint-disable-next-line class-methods-use-this
|
|
92
|
+
deleteDevice(_deviceId) {
|
|
93
|
+
console.error('deleteDevice not implemented');
|
|
94
|
+
}
|
|
95
|
+
sendActionToInstance = (command, messageToSend) => {
|
|
83
96
|
const send = async () => {
|
|
84
97
|
this.setState({ showSpinner: true });
|
|
85
98
|
this.responseTimeout = setTimeout(() => {
|
|
@@ -101,7 +114,7 @@ export default class Communication extends Component {
|
|
|
101
114
|
this.setState({
|
|
102
115
|
message: {
|
|
103
116
|
message,
|
|
104
|
-
handleClose: () => this.setState({ message: null }, () => this.sendActionToInstance('dm:actionProgress', { origin: response.origin }
|
|
117
|
+
handleClose: () => this.setState({ message: null }, () => this.sendActionToInstance('dm:actionProgress', { origin: response.origin })),
|
|
105
118
|
},
|
|
106
119
|
showSpinner: false,
|
|
107
120
|
});
|
|
@@ -118,7 +131,7 @@ export default class Communication extends Component {
|
|
|
118
131
|
handleClose: (confirm) => this.setState({ confirm: null }, () => this.sendActionToInstance('dm:actionProgress', {
|
|
119
132
|
origin: response.origin,
|
|
120
133
|
confirm,
|
|
121
|
-
}
|
|
134
|
+
})),
|
|
122
135
|
},
|
|
123
136
|
showSpinner: false,
|
|
124
137
|
});
|
|
@@ -148,7 +161,7 @@ export default class Communication extends Component {
|
|
|
148
161
|
this.sendActionToInstance('dm:actionProgress', {
|
|
149
162
|
origin: response.origin,
|
|
150
163
|
data,
|
|
151
|
-
}
|
|
164
|
+
});
|
|
152
165
|
}),
|
|
153
166
|
},
|
|
154
167
|
showSpinner: false,
|
|
@@ -169,31 +182,35 @@ export default class Communication extends Component {
|
|
|
169
182
|
this.setState({ progress: response.progress, showSpinner: false });
|
|
170
183
|
}
|
|
171
184
|
}
|
|
172
|
-
this.sendActionToInstance('dm:actionProgress', { origin: response.origin }
|
|
185
|
+
this.sendActionToInstance('dm:actionProgress', { origin: response.origin });
|
|
173
186
|
break;
|
|
174
187
|
case 'result':
|
|
175
188
|
console.log('Response content', response.result);
|
|
176
189
|
if ('refresh' in response.result && response.result.refresh) {
|
|
177
190
|
if (response.result.refresh === true || response.result.refresh === 'all') {
|
|
178
191
|
console.log('Refreshing all');
|
|
179
|
-
this.
|
|
192
|
+
await this.loadAllData();
|
|
180
193
|
}
|
|
181
194
|
else if (response.result.refresh === 'instance') {
|
|
182
195
|
console.log(`Refreshing instance infos: ${this.state.selectedInstance}`);
|
|
196
|
+
await this.loadInstanceInfos();
|
|
183
197
|
}
|
|
184
198
|
else if (response.result.refresh === 'devices') {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
console.log(`Refreshing device infos: ${this.state.selectedInstance}`);
|
|
190
|
-
refresh();
|
|
191
|
-
}
|
|
199
|
+
console.log('Refreshing devices');
|
|
200
|
+
this.loadDeviceList();
|
|
192
201
|
}
|
|
193
202
|
else {
|
|
194
203
|
console.log('Not refreshing anything');
|
|
195
204
|
}
|
|
196
205
|
}
|
|
206
|
+
else if ('update' in response.result && response.result.update) {
|
|
207
|
+
console.log('Update received', response.result.update);
|
|
208
|
+
this.updateDevice(response.result.update);
|
|
209
|
+
}
|
|
210
|
+
else if ('delete' in response.result && response.result.delete) {
|
|
211
|
+
console.log('Delete received', response.result.delete);
|
|
212
|
+
this.deleteDevice(response.result.delete);
|
|
213
|
+
}
|
|
197
214
|
if ('error' in response.result && response.result.error) {
|
|
198
215
|
console.error(`Error: ${response.result.error.message}`);
|
|
199
216
|
this.setState({ showToast: response.result.error.message, showSpinner: false });
|
|
@@ -416,7 +433,7 @@ export default class Communication extends Component {
|
|
|
416
433
|
actionId: showConfirmation.id,
|
|
417
434
|
deviceId: showConfirmation.deviceId,
|
|
418
435
|
timeout: showConfirmation.timeout,
|
|
419
|
-
}
|
|
436
|
+
});
|
|
420
437
|
}
|
|
421
438
|
else {
|
|
422
439
|
this.sendActionToInstance('dm:instanceAction', {
|
|
@@ -444,7 +461,7 @@ export default class Communication extends Component {
|
|
|
444
461
|
: showInput.inputBefore?.type === 'number'
|
|
445
462
|
? parseFloat(this.state.inputValue) || 0
|
|
446
463
|
: this.state.inputValue,
|
|
447
|
-
}
|
|
464
|
+
});
|
|
448
465
|
}
|
|
449
466
|
else {
|
|
450
467
|
this.sendActionToInstance('dm:instanceAction', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Communication.js","sourceRoot":"./src/","sources":["Communication.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EACJ,IAAI,EACJ,KAAK,GAMR,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACH,QAAQ,EACR,GAAG,EACH,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,KAAK,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,UAAU,MAAM,cAAc,CAAC;AAWtC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAA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K,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG;oCAC9C,IAAI,EAAE,QAAQ;iCACjB,GACH,CACE,CACJ,CACN,CACT,CAAC,CAAC,CAAC,IAAI,CACI;YAChB,oBAAC,aAAa;gBACV,oBAAC,MAAM,IACH,OAAO,EAAC,WAAW,EACnB,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,EACnC,SAAS,EAAE,oBAAC,KAAK,OAAG,IAEnB,cAAc,CAAC,eAAe,CAAC,CAC3B;gBACT,oBAAC,MAAM,IACH,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,MAAM,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EACjD,SAAS,EAAE,oBAAC,KAAK,OAAG,IAEnB,cAAc,CAAC,kBAAkB,CAAC,CAC9B,CACG,CACX,CACZ,CAAC;IACN,CAAC;IAED,MAAM;QACF,OAAO,CACH;YACK,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,mBAAmB,EAAE;YAC1B,IAAI,CAAC,mBAAmB,EAAE;YAC1B,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,wBAAwB,EAAE;YAC/B,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,aAAa,EAAE,CACtB,CACN,CAAC;IACN,CAAC;CACJ","sourcesContent":["import {\n I18n,\n Icon,\n Utils,\n type AdminConnection,\n type Connection,\n type IobTheme,\n type ThemeName,\n type ThemeType,\n} from '@iobroker/adapter-react-v5';\nimport type { ConfigItemPanel, ConfigItemTabs } from '@iobroker/json-config';\nimport { Check, Close, ContentCopy } from '@mui/icons-material';\nimport {\n Backdrop,\n Box,\n Button,\n Checkbox,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControl,\n FormControlLabel,\n Grid2,\n IconButton,\n Input,\n InputAdornment,\n InputLabel,\n LinearProgress,\n MenuItem,\n Select,\n Slider,\n Snackbar,\n TextField,\n Typography,\n} from '@mui/material';\nimport React, { Component } from 'react';\nimport JsonConfig from './JsonConfig';\nimport type {\n ActionBase,\n ActionButton,\n CommunicationForm,\n ControlBase,\n ControlState,\n InstanceDetails,\n ProgressUpdate,\n} from './protocol/api';\nimport type { CommandName, DmProtocolBase, LoadDevicesCallback, Message } from './protocol/DmProtocolBase';\nimport { DmProtocolV1 } from './protocol/DmProtocolV1';\nimport { DmProtocolV2 } from './protocol/DmProtocolV2';\nimport { DmProtocolV3 } from './protocol/DmProtocolV3';\nimport { UnknownDmProtocol } from './protocol/UnknownDmProtocol';\nimport { getTranslation } from './Utils';\n\ndeclare module '@mui/material/Button' {\n interface ButtonPropsColorOverrides {\n grey: true;\n }\n}\n\nexport type CommunicationProps = {\n /** Socket connection */\n socket: Connection;\n /** Instance to communicate with device-manager backend, like `adapterName.X` */\n selectedInstance?: string; // adapterName.X\n registerHandler?: (handler: null | ((command: string) => void)) => void;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n};\n\ninterface CommunicationFormInState extends CommunicationForm {\n handleClose?: (data?: Record<string, any>) => void;\n originalData: string;\n changed: boolean;\n}\n\ninterface InputAction extends ActionBase {\n /** If it is a device action */\n deviceId?: string;\n /** Optional refresh function to execute */\n refresh?: () => void;\n}\n\nexport type CommunicationState = {\n showSpinner: boolean;\n showToast: string | null;\n message: {\n message: string;\n handleClose: () => void;\n } | null;\n confirm: {\n message: string;\n handleClose: (confirmation?: boolean) => void;\n } | null;\n form: CommunicationFormInState | null;\n progress: ProgressUpdate | null;\n showConfirmation: InputAction | null;\n showInput: InputAction | null;\n inputValue: string | boolean | number | null;\n selectedInstance: string; // adapterName.X\n};\n\n/**\n * Communication Component\n */\nexport default class Communication<P extends CommunicationProps, S extends CommunicationState> extends Component<P, S> {\n private protocol: DmProtocolBase = new UnknownDmProtocol();\n private responseTimeout: ReturnType<typeof setTimeout> | null = null;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n instanceHandler: (action: ActionBase) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n\n constructor(props: P) {\n super(props);\n\n this.state = {\n showSpinner: false,\n showToast: null,\n message: null,\n confirm: null,\n form: null,\n progress: null,\n showConfirmation: null,\n showInput: null,\n inputValue: null,\n selectedInstance: this.props.selectedInstance ?? (window.localStorage.getItem('dmSelectedInstance') || ''),\n } as S;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.instanceHandler = action => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: action });\n return;\n }\n if (action.inputBefore) {\n this.setState({ showInput: action });\n return;\n }\n\n this.sendActionToInstance('dm:instanceAction', { actionId: action.id, timeout: action.timeout });\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.deviceHandler = (deviceId, action, refresh) => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: { ...action, deviceId, refresh } });\n return;\n }\n if (action.inputBefore) {\n this.setState({\n showInput: { ...action, deviceId, refresh },\n inputValue: action.inputBefore.defaultValue || '',\n });\n return;\n }\n\n this.sendActionToInstance(\n 'dm:deviceAction',\n { deviceId, actionId: action.id, timeout: action.timeout },\n refresh,\n );\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlHandler = (deviceId, control, state) => () =>\n this.sendControlToInstance('dm:deviceControl', { deviceId, controlId: control.id, state });\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlStateHandler = (deviceId, control) => () =>\n this.sendControlToInstance('dm:deviceControlState', { deviceId, controlId: control.id });\n\n this.props.registerHandler?.(() => this.loadData());\n }\n\n componentWillUnmount(): void {\n if (this.responseTimeout) {\n clearTimeout(this.responseTimeout);\n this.responseTimeout = null;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n loadData(): void {\n console.error('loadData not implemented');\n }\n\n sendActionToInstance = (command: CommandName, messageToSend: Message, refresh?: () => void): void => {\n const send = async (): Promise<void> => {\n this.setState({ showSpinner: true });\n\n this.responseTimeout = setTimeout(() => {\n this.setState({ showSpinner: false });\n window.alert(I18n.t('ra_No response from the backend'));\n }, messageToSend.timeout || 5000);\n\n const response = await this.protocol.sendAction(command, messageToSend);\n\n if (this.responseTimeout) {\n clearTimeout(this.responseTimeout);\n this.responseTimeout = null;\n }\n\n const type = response.type;\n console.log(`Response: ${type}`);\n switch (response.type) {\n case 'message': {\n const message = getTranslation(response.message);\n console.log(`Message received: ${message}`);\n if (message) {\n this.setState({\n message: {\n message,\n handleClose: () =>\n this.setState({ message: null }, () =>\n this.sendActionToInstance(\n 'dm:actionProgress',\n { origin: response.origin },\n refresh,\n ),\n ),\n },\n showSpinner: false,\n });\n }\n break;\n }\n\n case 'confirm': {\n const message = getTranslation(response.confirm);\n console.log(`Confirm received: ${message}`);\n if (message) {\n this.setState({\n confirm: {\n message: message,\n handleClose: (confirm?: boolean) =>\n this.setState({ confirm: null }, () =>\n this.sendActionToInstance(\n 'dm:actionProgress',\n {\n origin: response.origin,\n confirm,\n },\n refresh,\n ),\n ),\n },\n showSpinner: false,\n });\n }\n break;\n }\n\n case 'form':\n console.log('Form received');\n if (response.form) {\n const data: Record<string, any> | undefined = response.form.data;\n const originalData: Record<string, any> = {};\n if (data) {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined) {\n originalData[key] = data[key];\n }\n });\n }\n response.form.data = JSON.parse(JSON.stringify(originalData)) as Record<string, any>;\n\n this.setState({\n form: {\n ...response.form,\n changed: false,\n originalData: JSON.stringify(originalData),\n handleClose: (data: any) =>\n this.setState({ form: null }, () => {\n console.log(`Form ${JSON.stringify(data)}`);\n this.sendActionToInstance(\n 'dm:actionProgress',\n {\n origin: response.origin,\n data,\n },\n refresh,\n );\n }),\n },\n showSpinner: false,\n });\n }\n break;\n\n case 'progress':\n console.log('Progress received', response.progress);\n if (response.progress) {\n if (response.progress.open === false) {\n this.setState({ progress: null, showSpinner: false });\n } else if (this.state.progress) {\n const progress = { ...this.state.progress, ...response.progress };\n this.setState({ progress, showSpinner: false });\n } else {\n this.setState({ progress: response.progress, showSpinner: false });\n }\n }\n this.sendActionToInstance('dm:actionProgress', { origin: response.origin }, refresh);\n break;\n\n case 'result':\n console.log('Response content', response.result);\n if ('refresh' in response.result && response.result.refresh) {\n if (response.result.refresh === true || response.result.refresh === 'all') {\n console.log('Refreshing all');\n this.loadData();\n } else if (response.result.refresh === 'instance') {\n console.log(`Refreshing instance infos: ${this.state.selectedInstance}`);\n } else if (response.result.refresh === 'devices') {\n if (!refresh) {\n console.log('No refresh function provided to refresh \"devices\"');\n } else {\n console.log(`Refreshing device infos: ${this.state.selectedInstance}`);\n refresh();\n }\n } else {\n console.log('Not refreshing anything');\n }\n }\n if ('error' in response.result && response.result.error) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message, showSpinner: false });\n } else {\n this.setState({ showSpinner: false });\n }\n break;\n\n default:\n console.log(`Unknown response type: ${type}`);\n this.setState({ showSpinner: false });\n break;\n }\n };\n\n void send().catch(console.error);\n };\n\n sendControlToInstance = async (\n command: CommandName,\n messageToSend: { deviceId: string; controlId: string; state?: ControlState },\n ): Promise<null | ioBroker.State> => {\n const response = await this.protocol.sendControl(command, messageToSend);\n const type = response.type;\n console.log(`Response: ${response.type}`);\n if (response.type === 'result') {\n console.log('Response content', response.result);\n if ('error' in response.result) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message });\n } else if (response.result.state !== undefined) {\n return response.result.state;\n }\n } else {\n console.warn('Unexpected response type', type);\n }\n\n return null;\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n loadDevices(callback: LoadDevicesCallback): Promise<void> {\n return this.protocol.loadDevices(callback);\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n async loadInstanceInfos(): Promise<InstanceDetails> {\n if (!this.state.selectedInstance) {\n throw new Error('No instance selected');\n }\n const details = await this.props.socket.sendTo(this.state.selectedInstance, 'dm:instanceInfo');\n console.log('Instance details of', this.state.selectedInstance, details);\n if (details.apiVersion === 'v1') {\n this.protocol = new DmProtocolV1(this.state.selectedInstance, this.props.socket);\n } else if (details.apiVersion === 'v2') {\n this.protocol = new DmProtocolV2(this.state.selectedInstance, this.props.socket);\n } else if (details.apiVersion === 'v3') {\n this.protocol = new DmProtocolV3(this.state.selectedInstance, this.props.socket);\n } else {\n this.protocol = new UnknownDmProtocol();\n }\n\n return this.protocol.convertInstanceDetails(details);\n }\n\n renderMessageDialog(): React.JSX.Element | null {\n if (!this.state.message) {\n return null;\n }\n\n const message = this.state.message;\n return (\n <Dialog\n open={!0}\n onClose={() => message.handleClose()}\n hideBackdrop\n aria-describedby=\"message-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">{message.message}</DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n color=\"primary\"\n onClick={() => message.handleClose()}\n variant=\"contained\"\n autoFocus\n >\n {getTranslation('okButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderConfirmDialog(): React.JSX.Element | null {\n if (!this.state.confirm) {\n return null;\n }\n\n const confirm = this.state.confirm;\n return (\n <Dialog\n open={!0}\n onClose={() => confirm.handleClose()}\n hideBackdrop\n aria-describedby=\"confirm-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"confirm-dialog-description\">\n {getTranslation(confirm.message)}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => confirm.handleClose(true)}\n autoFocus\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => confirm.handleClose(false)}\n autoFocus\n >\n {getTranslation('noButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderSnackbar(): React.JSX.Element {\n return (\n <Snackbar\n open={!!this.state.showToast}\n autoHideDuration={6_000}\n onClose={() => this.setState({ showToast: null })}\n message={this.state.showToast}\n />\n );\n }\n\n getOkButton(button?: ActionButton | 'apply' | 'cancel' | 'close'): React.JSX.Element {\n if (typeof button === 'string') {\n button = undefined;\n }\n\n // TODO: detect if any input fields are present and if no one, do not disable the button\n\n return (\n <Button\n key=\"apply\"\n disabled={!this.state.form?.changed && !this.state.form?.ignoreApplyDisabled}\n variant={button?.variant || 'contained'}\n color={\n button?.color === 'primary' ? 'primary' : button?.color === 'secondary' ? 'secondary' : 'primary'\n }\n style={{\n backgroundColor:\n button?.color && button?.color !== 'primary' && button?.color !== 'secondary'\n ? button?.color\n : undefined,\n ...(button?.style || undefined),\n }}\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose(this.state.form?.data)}\n startIcon={button?.icon ? <Icon src={button?.icon} /> : undefined}\n >\n {getTranslation(button?.label || 'okButtonText', button?.noTranslation)}\n </Button>\n );\n }\n\n getCancelButton(button?: ActionButton | 'apply' | 'cancel' | 'close'): React.JSX.Element {\n let isClose = false;\n if (typeof button === 'string') {\n isClose = button === 'close';\n button = undefined;\n }\n return (\n <Button\n key=\"cancel\"\n variant={button?.variant || 'contained'}\n color={button?.color === 'primary' ? 'primary' : button?.color === 'secondary' ? 'secondary' : 'grey'}\n style={{\n backgroundColor:\n button?.color && button?.color !== 'primary' && button?.color !== 'secondary'\n ? button?.color\n : undefined,\n ...(button?.style || undefined),\n }}\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose()}\n startIcon={isClose ? <Close /> : button?.icon ? <Icon src={button?.icon} /> : undefined}\n >\n {getTranslation(button?.label || 'cancelButtonText', button?.noTranslation)}\n </Button>\n );\n }\n\n renderFormDialog(): React.JSX.Element | null {\n if (!this.state.form?.schema) {\n return null;\n }\n if (!this.state.selectedInstance) {\n throw new Error('No instance selected');\n }\n\n const form = this.state.form;\n let buttons: React.JSX.Element[];\n if (form.buttons) {\n buttons = [];\n form.buttons.forEach((button: ActionButton | 'apply' | 'cancel' | 'close'): void => {\n if (typeof button === 'object' && button.type === 'copyToClipboard') {\n buttons.push(\n <Button\n key=\"copyToClipboard\"\n variant={button.variant || 'outlined'}\n color={\n button.color === 'primary'\n ? 'primary'\n : button.color === 'secondary'\n ? 'secondary'\n : undefined\n }\n style={{\n backgroundColor:\n button.color && button.color !== 'primary' && button.color !== 'secondary'\n ? button.color\n : undefined,\n ...(button.style || undefined),\n }}\n onClick={() => {\n if (button.copyToClipboardAttr && form.data) {\n const val = form.data[button.copyToClipboardAttr];\n if (typeof val === 'string') {\n Utils.copyToClipboard(val);\n } else {\n Utils.copyToClipboard(JSON.stringify(val, null, 2));\n }\n window.alert(I18n.t('copied'));\n } else if (form.data) {\n Utils.copyToClipboard(JSON.stringify(form.data, null, 2));\n window.alert(I18n.t('copied'));\n } else {\n window.alert(I18n.t('nothingToCopy'));\n }\n }}\n startIcon={button?.icon ? <Icon src={button?.icon} /> : <ContentCopy />}\n >\n {getTranslation(button?.label || 'ctcButtonText', button?.noTranslation)}\n </Button>,\n );\n } else if (button === 'apply' || (button as ActionButton).type === 'apply') {\n buttons.push(this.getOkButton(button));\n } else {\n buttons.push(this.getCancelButton(button));\n }\n });\n } else {\n buttons = [this.getOkButton(), this.getCancelButton()];\n }\n\n return (\n <Dialog\n onClose={() => form.handleClose?.()}\n hideBackdrop\n fullWidth\n open\n sx={{\n '& .MuiDialog-paper': {\n minWidth: form.minWidth || undefined,\n },\n }}\n maxWidth={form.maxWidth || 'md'}\n >\n {form.title ? (\n <DialogTitle>{getTranslation(form.label || form.title, form.noTranslation)}</DialogTitle>\n ) : null}\n <DialogContent>\n <JsonConfig\n instanceId={this.state.selectedInstance}\n schema={form.schema as ConfigItemPanel | ConfigItemTabs}\n data={form.data || {}}\n socket={this.props.socket as AdminConnection}\n onChange={(data: Record<string, any>) => {\n console.log('handleFormChange', { data });\n if (form) {\n form.data = data;\n form.changed = JSON.stringify(data) !== form.originalData;\n this.setState({ form });\n }\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>{buttons}</DialogActions>\n </Dialog>\n );\n }\n\n renderProgressDialog(): React.JSX.Element | null {\n if (!this.state.progress) {\n return null;\n }\n return (\n <Dialog\n onClose={() => {}}\n hideBackdrop\n open\n >\n {this.state.progress.title && <DialogTitle>{getTranslation(this.state.progress.title)}</DialogTitle>}\n <DialogContent>\n {this.state.progress.label && (\n <DialogContentText>{getTranslation(this.state.progress.label)}</DialogContentText>\n )}\n <LinearProgress\n variant={this.state.progress.indeterminate ? 'indeterminate' : 'determinate'}\n value={this.state.progress.value}\n />\n </DialogContent>\n </Dialog>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n renderContent(): React.JSX.Element | React.JSX.Element[] | null {\n return null;\n }\n\n renderSpinner(): React.JSX.Element | null {\n if (!this.state.showSpinner) {\n return null;\n }\n return (\n <Backdrop\n style={{ zIndex: 1000 }}\n open\n >\n <CircularProgress />\n </Backdrop>\n );\n }\n\n renderConfirmationDialog(): React.JSX.Element | null {\n if (!this.state.showConfirmation) {\n return null;\n }\n return (\n <Dialog\n onClose={() => this.setState({ showConfirmation: null })}\n open\n >\n <DialogTitle>\n {getTranslation(\n this.state.showConfirmation.confirmation === true\n ? getTranslation('areYouSureText')\n : getTranslation(this.state.showConfirmation.confirmation as ioBroker.StringOrTranslated),\n )}\n </DialogTitle>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => {\n if (!this.state.showConfirmation) {\n return;\n }\n\n const showConfirmation = this.state.showConfirmation;\n this.setState({ showConfirmation: null }, () => {\n if (showConfirmation.deviceId) {\n this.sendActionToInstance(\n 'dm:deviceAction',\n {\n actionId: showConfirmation.id,\n deviceId: showConfirmation.deviceId,\n timeout: showConfirmation.timeout,\n },\n showConfirmation.refresh,\n );\n } else {\n this.sendActionToInstance('dm:instanceAction', {\n actionId: showConfirmation.id,\n timeout: showConfirmation.timeout,\n });\n }\n });\n }}\n autoFocus\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showConfirmation: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n onShowInputOk(): void {\n if (!this.state.showInput) {\n return;\n }\n\n const showInput = this.state.showInput;\n this.setState({ showInput: null }, () => {\n if (showInput.deviceId) {\n this.sendActionToInstance(\n 'dm:deviceAction',\n {\n actionId: showInput.id,\n deviceId: showInput.deviceId,\n timeout: showInput.timeout,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n },\n showInput.refresh,\n );\n } else {\n this.sendActionToInstance('dm:instanceAction', {\n actionId: showInput.id,\n timeout: showInput.timeout,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n });\n }\n });\n }\n\n renderInputDialog(): React.JSX.Element | null {\n if (!this.state.showInput || !this.state.showInput.inputBefore) {\n return null;\n }\n let okDisabled = false;\n if (!this.state.showInput.inputBefore.allowEmptyValue && this.state.showInput.inputBefore.type !== 'checkbox') {\n if (\n this.state.showInput.inputBefore.type === 'number' ||\n this.state.showInput.inputBefore.type === 'slider'\n ) {\n okDisabled =\n this.state.inputValue === '' ||\n this.state.inputValue === null ||\n !window.isFinite(this.state.inputValue as number);\n } else {\n okDisabled = !this.state.inputValue;\n }\n }\n\n return (\n <Dialog\n onClose={() => this.setState({ showInput: null })}\n open\n >\n <DialogTitle>{getTranslation('pleaseEnterValueText')}</DialogTitle>\n <DialogContent>\n {this.state.showInput.inputBefore.type === 'text' ||\n this.state.showInput.inputBefore.type === 'number' ||\n !this.state.showInput.inputBefore.type ? (\n <TextField\n autoFocus\n margin=\"dense\"\n label={getTranslation(this.state.showInput.inputBefore.label)}\n slotProps={{\n htmlInput:\n this.state.showInput.inputBefore.type === 'number'\n ? {\n min: this.state.showInput.inputBefore.min,\n max: this.state.showInput.inputBefore.max,\n step: this.state.showInput.inputBefore.step,\n }\n : undefined,\n input: {\n endAdornment: this.state.inputValue ? (\n <InputAdornment position=\"end\">\n <IconButton\n tabIndex={-1}\n size=\"small\"\n onClick={() => this.setState({ inputValue: '' })}\n >\n <Close />\n </IconButton>\n </InputAdornment>\n ) : null,\n },\n }}\n type={this.state.showInput.inputBefore.type === 'number' ? 'number' : 'text'}\n fullWidth\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n onKeyUp={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n this.onShowInputOk();\n }\n }}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'checkbox' ? (\n <FormControlLabel\n control={\n <Checkbox\n checked={!!this.state.inputValue}\n autoFocus\n onChange={e => this.setState({ inputValue: e.target.checked })}\n />\n }\n label={getTranslation(this.state.showInput.inputBefore.label)}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'select' ? (\n <FormControl fullWidth>\n <InputLabel>{getTranslation(this.state.showInput.inputBefore.label)}</InputLabel>\n <Select\n variant=\"standard\"\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n >\n {this.state.showInput.inputBefore.options?.map(item => (\n <MenuItem\n key={item.value}\n value={item.value}\n >\n {getTranslation(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n ) : null}\n {this.state.showInput.inputBefore.type === 'slider' ? (\n <Box sx={{ width: '100%' }}>\n <Typography gutterBottom>\n {getTranslation(this.state.showInput.inputBefore.label)}\n </Typography>\n <Grid2\n container\n spacing={2}\n alignItems=\"center\"\n >\n <Grid2>\n <Slider\n value={typeof this.state.inputValue === 'number' ? this.state.inputValue : 0}\n onChange={(_event: Event, newValue: number) =>\n this.setState({ inputValue: newValue })\n }\n />\n </Grid2>\n <Grid2>\n <Input\n value={this.state.inputValue}\n size=\"small\"\n onChange={e =>\n this.setState({\n inputValue: e.target.value === '' ? 0 : Number(e.target.value),\n })\n }\n onBlur={() => {\n if (!this.state.showInput) {\n return;\n }\n\n const min =\n this.state.showInput.inputBefore?.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min;\n const max =\n this.state.showInput.inputBefore?.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max;\n\n if ((this.state.inputValue as number) < min) {\n this.setState({ inputValue: min });\n } else if ((this.state.inputValue as number) > max) {\n this.setState({ inputValue: max });\n }\n }}\n inputProps={{\n step: this.state.showInput.inputBefore.step,\n min:\n this.state.showInput.inputBefore.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min,\n max:\n this.state.showInput.inputBefore.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max,\n type: 'number',\n }}\n />\n </Grid2>\n </Grid2>\n </Box>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n disabled={okDisabled}\n color=\"primary\"\n onClick={() => this.onShowInputOk()}\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showInput: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n render(): React.JSX.Element {\n return (\n <>\n {this.renderSnackbar()}\n {this.renderContent()}\n {this.renderConfirmDialog()}\n {this.renderMessageDialog()}\n {this.renderFormDialog()}\n {this.renderProgressDialog()}\n {this.renderConfirmationDialog()}\n {this.renderInputDialog()}\n {this.renderSpinner()}\n </>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Communication.js","sourceRoot":"./src/","sources":["Communication.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EACJ,IAAI,EACJ,KAAK,GAMR,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACH,QAAQ,EACR,GAAG,EACH,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,KAAK,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAU,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,UAAU,MAAM,cAAc,CAAC;AAatC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAmDzC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAA0E,SAAQ,SAAe;IAC1G,QAAQ,GAAmB,IAAI,iBAAiB,EAAE,CAAC;IACnD,eAAe,GAAyC,IAAI,CAAC;IAErE,mEAAmE;IACnE,eAAe,CAAqC;IAE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I,CAAC,aAAa,EAAE,CACtB,CACN,CAAC;IACN,CAAC;CACJ","sourcesContent":["import {\n I18n,\n Icon,\n Utils,\n type AdminConnection,\n type Connection,\n type IobTheme,\n type ThemeName,\n type ThemeType,\n} from '@iobroker/adapter-react-v5';\nimport type { ConfigItemPanel, ConfigItemTabs } from '@iobroker/json-config';\nimport { Check, Close, ContentCopy } from '@mui/icons-material';\nimport {\n Backdrop,\n Box,\n Button,\n Checkbox,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControl,\n FormControlLabel,\n Grid2,\n IconButton,\n Input,\n InputAdornment,\n InputLabel,\n LinearProgress,\n MenuItem,\n Select,\n Slider,\n Snackbar,\n TextField,\n Typography,\n} from '@mui/material';\nimport React, { Component } from 'react';\nimport JsonConfig from './JsonConfig';\nimport type {\n ActionBase,\n ActionButton,\n CommunicationForm,\n ControlBase,\n ControlState,\n DeviceId,\n InstanceDetails,\n ProgressUpdate,\n DeviceInfo,\n} from './protocol/api';\nimport type { CommandName, DmProtocolBase, LoadDevicesCallback, Message } from './protocol/DmProtocolBase';\nimport { DmProtocolV1 } from './protocol/DmProtocolV1';\nimport { DmProtocolV2 } from './protocol/DmProtocolV2';\nimport { DmProtocolV3 } from './protocol/DmProtocolV3';\nimport { UnknownDmProtocol } from './protocol/UnknownDmProtocol';\nimport { getTranslation } from './Utils';\n\ndeclare module '@mui/material/Button' {\n interface ButtonPropsColorOverrides {\n grey: true;\n }\n}\n\nexport type CommunicationProps = {\n /** Socket connection */\n socket: Connection;\n /** Instance to communicate with device-manager backend, like `adapterName.X` */\n selectedInstance?: string; // adapterName.X\n registerHandler?: (handler: null | ((command: string) => void)) => void;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n};\n\ninterface CommunicationFormInState extends CommunicationForm {\n handleClose?: (data?: Record<string, any>) => void;\n originalData: string;\n changed: boolean;\n}\n\ninterface InputAction extends ActionBase {\n /** If it is a device action */\n deviceId?: string;\n}\n\nexport type CommunicationState = {\n showSpinner: boolean;\n showToast: string | null;\n message: {\n message: string;\n handleClose: () => void;\n } | null;\n confirm: {\n message: string;\n handleClose: (confirmation?: boolean) => void;\n } | null;\n form: CommunicationFormInState | null;\n progress: ProgressUpdate | null;\n showConfirmation: InputAction | null;\n showInput: InputAction | null;\n inputValue: string | boolean | number | null;\n selectedInstance: string; // adapterName.X\n};\n\n/**\n * Communication Component\n */\nexport default class Communication<P extends CommunicationProps, S extends CommunicationState> extends Component<P, S> {\n private protocol: DmProtocolBase = new UnknownDmProtocol();\n private responseTimeout: ReturnType<typeof setTimeout> | null = null;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n instanceHandler: (action: ActionBase) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n deviceHandler: (deviceId: string, action: ActionBase) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n\n constructor(props: P) {\n super(props);\n\n this.state = {\n showSpinner: false,\n showToast: null,\n message: null,\n confirm: null,\n form: null,\n progress: null,\n showConfirmation: null,\n showInput: null,\n inputValue: null,\n selectedInstance: this.props.selectedInstance ?? (window.localStorage.getItem('dmSelectedInstance') || ''),\n } as S;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.instanceHandler = action => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: action });\n return;\n }\n if (action.inputBefore) {\n this.setState({ showInput: action });\n return;\n }\n\n this.sendActionToInstance('dm:instanceAction', { actionId: action.id, timeout: action.timeout });\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.deviceHandler = (deviceId, action) => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: { ...action, deviceId } });\n return;\n }\n if (action.inputBefore) {\n this.setState({\n showInput: { ...action, deviceId },\n inputValue: action.inputBefore.defaultValue || '',\n });\n return;\n }\n\n this.sendActionToInstance('dm:deviceAction', { deviceId, actionId: action.id, timeout: action.timeout });\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlHandler = (deviceId, control, state) => () =>\n this.sendControlToInstance('dm:deviceControl', { deviceId, controlId: control.id, state });\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlStateHandler = (deviceId, control) => () =>\n this.sendControlToInstance('dm:deviceControlState', { deviceId, controlId: control.id });\n\n this.props.registerHandler?.(() => this.loadDeviceList());\n }\n\n componentWillUnmount(): void {\n if (this.responseTimeout) {\n clearTimeout(this.responseTimeout);\n this.responseTimeout = null;\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n loadAllData(): Promise<void> {\n console.error('loadAllData not implemented');\n return Promise.resolve();\n }\n\n // eslint-disable-next-line class-methods-use-this\n loadDeviceList(): void {\n console.error('loadDeviceList not implemented');\n }\n\n // eslint-disable-next-line class-methods-use-this\n updateDevice(_update: DeviceInfo): void {\n console.error('updateDevice not implemented');\n }\n\n // eslint-disable-next-line class-methods-use-this\n deleteDevice(_deviceId: DeviceId): void {\n console.error('deleteDevice not implemented');\n }\n\n sendActionToInstance = (command: CommandName, messageToSend: Message): void => {\n const send = async (): Promise<void> => {\n this.setState({ showSpinner: true });\n\n this.responseTimeout = setTimeout(() => {\n this.setState({ showSpinner: false });\n window.alert(I18n.t('ra_No response from the backend'));\n }, messageToSend.timeout || 5000);\n\n const response = await this.protocol.sendAction(command, messageToSend);\n\n if (this.responseTimeout) {\n clearTimeout(this.responseTimeout);\n this.responseTimeout = null;\n }\n\n const type = response.type;\n console.log(`Response: ${type}`);\n switch (response.type) {\n case 'message': {\n const message = getTranslation(response.message);\n console.log(`Message received: ${message}`);\n if (message) {\n this.setState({\n message: {\n message,\n handleClose: () =>\n this.setState({ message: null }, () =>\n this.sendActionToInstance('dm:actionProgress', { origin: response.origin }),\n ),\n },\n showSpinner: false,\n });\n }\n break;\n }\n\n case 'confirm': {\n const message = getTranslation(response.confirm);\n console.log(`Confirm received: ${message}`);\n if (message) {\n this.setState({\n confirm: {\n message: message,\n handleClose: (confirm?: boolean) =>\n this.setState({ confirm: null }, () =>\n this.sendActionToInstance('dm:actionProgress', {\n origin: response.origin,\n confirm,\n }),\n ),\n },\n showSpinner: false,\n });\n }\n break;\n }\n\n case 'form':\n console.log('Form received');\n if (response.form) {\n const data: Record<string, any> | undefined = response.form.data;\n const originalData: Record<string, any> = {};\n if (data) {\n Object.keys(data).forEach(key => {\n if (data[key] !== undefined) {\n originalData[key] = data[key];\n }\n });\n }\n response.form.data = JSON.parse(JSON.stringify(originalData)) as Record<string, any>;\n\n this.setState({\n form: {\n ...response.form,\n changed: false,\n originalData: JSON.stringify(originalData),\n handleClose: (data: any) =>\n this.setState({ form: null }, () => {\n console.log(`Form ${JSON.stringify(data)}`);\n this.sendActionToInstance('dm:actionProgress', {\n origin: response.origin,\n data,\n });\n }),\n },\n showSpinner: false,\n });\n }\n break;\n\n case 'progress':\n console.log('Progress received', response.progress);\n if (response.progress) {\n if (response.progress.open === false) {\n this.setState({ progress: null, showSpinner: false });\n } else if (this.state.progress) {\n const progress = { ...this.state.progress, ...response.progress };\n this.setState({ progress, showSpinner: false });\n } else {\n this.setState({ progress: response.progress, showSpinner: false });\n }\n }\n this.sendActionToInstance('dm:actionProgress', { origin: response.origin });\n break;\n\n case 'result':\n console.log('Response content', response.result);\n if ('refresh' in response.result && response.result.refresh) {\n if (response.result.refresh === true || response.result.refresh === 'all') {\n console.log('Refreshing all');\n await this.loadAllData();\n } else if (response.result.refresh === 'instance') {\n console.log(`Refreshing instance infos: ${this.state.selectedInstance}`);\n await this.loadInstanceInfos();\n } else if (response.result.refresh === 'devices') {\n console.log('Refreshing devices');\n this.loadDeviceList();\n } else {\n console.log('Not refreshing anything');\n }\n } else if ('update' in response.result && response.result.update) {\n console.log('Update received', response.result.update);\n this.updateDevice(response.result.update);\n } else if ('delete' in response.result && response.result.delete) {\n console.log('Delete received', response.result.delete);\n this.deleteDevice(response.result.delete);\n }\n\n if ('error' in response.result && response.result.error) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message, showSpinner: false });\n } else {\n this.setState({ showSpinner: false });\n }\n break;\n\n default:\n console.log(`Unknown response type: ${type}`);\n this.setState({ showSpinner: false });\n break;\n }\n };\n\n void send().catch(console.error);\n };\n\n sendControlToInstance = async (\n command: CommandName,\n messageToSend: { deviceId: string; controlId: string; state?: ControlState },\n ): Promise<null | ioBroker.State> => {\n const response = await this.protocol.sendControl(command, messageToSend);\n const type = response.type;\n console.log(`Response: ${response.type}`);\n if (response.type === 'result') {\n console.log('Response content', response.result);\n if ('error' in response.result) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message });\n } else if (response.result.state !== undefined) {\n return response.result.state;\n }\n } else {\n console.warn('Unexpected response type', type);\n }\n\n return null;\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n loadDevices(callback: LoadDevicesCallback): Promise<void> {\n return this.protocol.loadDevices(callback);\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n async loadInstanceInfos(): Promise<InstanceDetails> {\n if (!this.state.selectedInstance) {\n throw new Error('No instance selected');\n }\n const details = await this.props.socket.sendTo(this.state.selectedInstance, 'dm:instanceInfo');\n console.log('Instance details of', this.state.selectedInstance, details);\n if (details.apiVersion === 'v1') {\n this.protocol = new DmProtocolV1(this.state.selectedInstance, this.props.socket);\n } else if (details.apiVersion === 'v2') {\n this.protocol = new DmProtocolV2(this.state.selectedInstance, this.props.socket);\n } else if (details.apiVersion === 'v3') {\n this.protocol = new DmProtocolV3(this.state.selectedInstance, this.props.socket);\n } else {\n this.protocol = new UnknownDmProtocol();\n }\n\n return this.protocol.convertInstanceDetails(details);\n }\n\n renderMessageDialog(): React.JSX.Element | null {\n if (!this.state.message) {\n return null;\n }\n\n const message = this.state.message;\n return (\n <Dialog\n open={!0}\n onClose={() => message.handleClose()}\n hideBackdrop\n aria-describedby=\"message-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">{message.message}</DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n color=\"primary\"\n onClick={() => message.handleClose()}\n variant=\"contained\"\n autoFocus\n >\n {getTranslation('okButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderConfirmDialog(): React.JSX.Element | null {\n if (!this.state.confirm) {\n return null;\n }\n\n const confirm = this.state.confirm;\n return (\n <Dialog\n open={!0}\n onClose={() => confirm.handleClose()}\n hideBackdrop\n aria-describedby=\"confirm-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"confirm-dialog-description\">\n {getTranslation(confirm.message)}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => confirm.handleClose(true)}\n autoFocus\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => confirm.handleClose(false)}\n autoFocus\n >\n {getTranslation('noButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderSnackbar(): React.JSX.Element {\n return (\n <Snackbar\n open={!!this.state.showToast}\n autoHideDuration={6_000}\n onClose={() => this.setState({ showToast: null })}\n message={this.state.showToast}\n />\n );\n }\n\n getOkButton(button?: ActionButton | 'apply' | 'cancel' | 'close'): React.JSX.Element {\n if (typeof button === 'string') {\n button = undefined;\n }\n\n // TODO: detect if any input fields are present and if no one, do not disable the button\n\n return (\n <Button\n key=\"apply\"\n disabled={!this.state.form?.changed && !this.state.form?.ignoreApplyDisabled}\n variant={button?.variant || 'contained'}\n color={\n button?.color === 'primary' ? 'primary' : button?.color === 'secondary' ? 'secondary' : 'primary'\n }\n style={{\n backgroundColor:\n button?.color && button?.color !== 'primary' && button?.color !== 'secondary'\n ? button?.color\n : undefined,\n ...(button?.style || undefined),\n }}\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose(this.state.form?.data)}\n startIcon={button?.icon ? <Icon src={button?.icon} /> : undefined}\n >\n {getTranslation(button?.label || 'okButtonText', button?.noTranslation)}\n </Button>\n );\n }\n\n getCancelButton(button?: ActionButton | 'apply' | 'cancel' | 'close'): React.JSX.Element {\n let isClose = false;\n if (typeof button === 'string') {\n isClose = button === 'close';\n button = undefined;\n }\n return (\n <Button\n key=\"cancel\"\n variant={button?.variant || 'contained'}\n color={button?.color === 'primary' ? 'primary' : button?.color === 'secondary' ? 'secondary' : 'grey'}\n style={{\n backgroundColor:\n button?.color && button?.color !== 'primary' && button?.color !== 'secondary'\n ? button?.color\n : undefined,\n ...(button?.style || undefined),\n }}\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose()}\n startIcon={isClose ? <Close /> : button?.icon ? <Icon src={button?.icon} /> : undefined}\n >\n {getTranslation(button?.label || 'cancelButtonText', button?.noTranslation)}\n </Button>\n );\n }\n\n renderFormDialog(): React.JSX.Element | null {\n if (!this.state.form?.schema) {\n return null;\n }\n if (!this.state.selectedInstance) {\n throw new Error('No instance selected');\n }\n\n const form = this.state.form;\n let buttons: React.JSX.Element[];\n if (form.buttons) {\n buttons = [];\n form.buttons.forEach((button: ActionButton | 'apply' | 'cancel' | 'close'): void => {\n if (typeof button === 'object' && button.type === 'copyToClipboard') {\n buttons.push(\n <Button\n key=\"copyToClipboard\"\n variant={button.variant || 'outlined'}\n color={\n button.color === 'primary'\n ? 'primary'\n : button.color === 'secondary'\n ? 'secondary'\n : undefined\n }\n style={{\n backgroundColor:\n button.color && button.color !== 'primary' && button.color !== 'secondary'\n ? button.color\n : undefined,\n ...(button.style || undefined),\n }}\n onClick={() => {\n if (button.copyToClipboardAttr && form.data) {\n const val = form.data[button.copyToClipboardAttr];\n if (typeof val === 'string') {\n Utils.copyToClipboard(val);\n } else {\n Utils.copyToClipboard(JSON.stringify(val, null, 2));\n }\n window.alert(I18n.t('copied'));\n } else if (form.data) {\n Utils.copyToClipboard(JSON.stringify(form.data, null, 2));\n window.alert(I18n.t('copied'));\n } else {\n window.alert(I18n.t('nothingToCopy'));\n }\n }}\n startIcon={button?.icon ? <Icon src={button?.icon} /> : <ContentCopy />}\n >\n {getTranslation(button?.label || 'ctcButtonText', button?.noTranslation)}\n </Button>,\n );\n } else if (button === 'apply' || (button as ActionButton).type === 'apply') {\n buttons.push(this.getOkButton(button));\n } else {\n buttons.push(this.getCancelButton(button));\n }\n });\n } else {\n buttons = [this.getOkButton(), this.getCancelButton()];\n }\n\n return (\n <Dialog\n onClose={() => form.handleClose?.()}\n hideBackdrop\n fullWidth\n open\n sx={{\n '& .MuiDialog-paper': {\n minWidth: form.minWidth || undefined,\n },\n }}\n maxWidth={form.maxWidth || 'md'}\n >\n {form.title ? (\n <DialogTitle>{getTranslation(form.label || form.title, form.noTranslation)}</DialogTitle>\n ) : null}\n <DialogContent>\n <JsonConfig\n instanceId={this.state.selectedInstance}\n schema={form.schema as ConfigItemPanel | ConfigItemTabs}\n data={form.data || {}}\n socket={this.props.socket as AdminConnection}\n onChange={(data: Record<string, any>) => {\n console.log('handleFormChange', { data });\n if (form) {\n form.data = data;\n form.changed = JSON.stringify(data) !== form.originalData;\n this.setState({ form });\n }\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>{buttons}</DialogActions>\n </Dialog>\n );\n }\n\n renderProgressDialog(): React.JSX.Element | null {\n if (!this.state.progress) {\n return null;\n }\n return (\n <Dialog\n onClose={() => {}}\n hideBackdrop\n open\n >\n {this.state.progress.title && <DialogTitle>{getTranslation(this.state.progress.title)}</DialogTitle>}\n <DialogContent>\n {this.state.progress.label && (\n <DialogContentText>{getTranslation(this.state.progress.label)}</DialogContentText>\n )}\n <LinearProgress\n variant={this.state.progress.indeterminate ? 'indeterminate' : 'determinate'}\n value={this.state.progress.value}\n />\n </DialogContent>\n </Dialog>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n renderContent(): React.JSX.Element | React.JSX.Element[] | null {\n return null;\n }\n\n renderSpinner(): React.JSX.Element | null {\n if (!this.state.showSpinner) {\n return null;\n }\n return (\n <Backdrop\n style={{ zIndex: 1000 }}\n open\n >\n <CircularProgress />\n </Backdrop>\n );\n }\n\n renderConfirmationDialog(): React.JSX.Element | null {\n if (!this.state.showConfirmation) {\n return null;\n }\n return (\n <Dialog\n onClose={() => this.setState({ showConfirmation: null })}\n open\n >\n <DialogTitle>\n {getTranslation(\n this.state.showConfirmation.confirmation === true\n ? getTranslation('areYouSureText')\n : getTranslation(this.state.showConfirmation.confirmation as ioBroker.StringOrTranslated),\n )}\n </DialogTitle>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => {\n if (!this.state.showConfirmation) {\n return;\n }\n\n const showConfirmation = this.state.showConfirmation;\n this.setState({ showConfirmation: null }, () => {\n if (showConfirmation.deviceId) {\n this.sendActionToInstance('dm:deviceAction', {\n actionId: showConfirmation.id,\n deviceId: showConfirmation.deviceId,\n timeout: showConfirmation.timeout,\n });\n } else {\n this.sendActionToInstance('dm:instanceAction', {\n actionId: showConfirmation.id,\n timeout: showConfirmation.timeout,\n });\n }\n });\n }}\n autoFocus\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showConfirmation: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n onShowInputOk(): void {\n if (!this.state.showInput) {\n return;\n }\n\n const showInput = this.state.showInput;\n this.setState({ showInput: null }, () => {\n if (showInput.deviceId) {\n this.sendActionToInstance('dm:deviceAction', {\n actionId: showInput.id,\n deviceId: showInput.deviceId,\n timeout: showInput.timeout,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n });\n } else {\n this.sendActionToInstance('dm:instanceAction', {\n actionId: showInput.id,\n timeout: showInput.timeout,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n });\n }\n });\n }\n\n renderInputDialog(): React.JSX.Element | null {\n if (!this.state.showInput || !this.state.showInput.inputBefore) {\n return null;\n }\n let okDisabled = false;\n if (!this.state.showInput.inputBefore.allowEmptyValue && this.state.showInput.inputBefore.type !== 'checkbox') {\n if (\n this.state.showInput.inputBefore.type === 'number' ||\n this.state.showInput.inputBefore.type === 'slider'\n ) {\n okDisabled =\n this.state.inputValue === '' ||\n this.state.inputValue === null ||\n !window.isFinite(this.state.inputValue as number);\n } else {\n okDisabled = !this.state.inputValue;\n }\n }\n\n return (\n <Dialog\n onClose={() => this.setState({ showInput: null })}\n open\n >\n <DialogTitle>{getTranslation('pleaseEnterValueText')}</DialogTitle>\n <DialogContent>\n {this.state.showInput.inputBefore.type === 'text' ||\n this.state.showInput.inputBefore.type === 'number' ||\n !this.state.showInput.inputBefore.type ? (\n <TextField\n autoFocus\n margin=\"dense\"\n label={getTranslation(this.state.showInput.inputBefore.label)}\n slotProps={{\n htmlInput:\n this.state.showInput.inputBefore.type === 'number'\n ? {\n min: this.state.showInput.inputBefore.min,\n max: this.state.showInput.inputBefore.max,\n step: this.state.showInput.inputBefore.step,\n }\n : undefined,\n input: {\n endAdornment: this.state.inputValue ? (\n <InputAdornment position=\"end\">\n <IconButton\n tabIndex={-1}\n size=\"small\"\n onClick={() => this.setState({ inputValue: '' })}\n >\n <Close />\n </IconButton>\n </InputAdornment>\n ) : null,\n },\n }}\n type={this.state.showInput.inputBefore.type === 'number' ? 'number' : 'text'}\n fullWidth\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n onKeyUp={(e: React.KeyboardEvent) => {\n if (e.key === 'Enter') {\n this.onShowInputOk();\n }\n }}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'checkbox' ? (\n <FormControlLabel\n control={\n <Checkbox\n checked={!!this.state.inputValue}\n autoFocus\n onChange={e => this.setState({ inputValue: e.target.checked })}\n />\n }\n label={getTranslation(this.state.showInput.inputBefore.label)}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'select' ? (\n <FormControl fullWidth>\n <InputLabel>{getTranslation(this.state.showInput.inputBefore.label)}</InputLabel>\n <Select\n variant=\"standard\"\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n >\n {this.state.showInput.inputBefore.options?.map(item => (\n <MenuItem\n key={item.value}\n value={item.value}\n >\n {getTranslation(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n ) : null}\n {this.state.showInput.inputBefore.type === 'slider' ? (\n <Box sx={{ width: '100%' }}>\n <Typography gutterBottom>\n {getTranslation(this.state.showInput.inputBefore.label)}\n </Typography>\n <Grid2\n container\n spacing={2}\n alignItems=\"center\"\n >\n <Grid2>\n <Slider\n value={typeof this.state.inputValue === 'number' ? this.state.inputValue : 0}\n onChange={(_event: Event, newValue: number) =>\n this.setState({ inputValue: newValue })\n }\n />\n </Grid2>\n <Grid2>\n <Input\n value={this.state.inputValue}\n size=\"small\"\n onChange={e =>\n this.setState({\n inputValue: e.target.value === '' ? 0 : Number(e.target.value),\n })\n }\n onBlur={() => {\n if (!this.state.showInput) {\n return;\n }\n\n const min =\n this.state.showInput.inputBefore?.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min;\n const max =\n this.state.showInput.inputBefore?.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max;\n\n if ((this.state.inputValue as number) < min) {\n this.setState({ inputValue: min });\n } else if ((this.state.inputValue as number) > max) {\n this.setState({ inputValue: max });\n }\n }}\n inputProps={{\n step: this.state.showInput.inputBefore.step,\n min:\n this.state.showInput.inputBefore.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min,\n max:\n this.state.showInput.inputBefore.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max,\n type: 'number',\n }}\n />\n </Grid2>\n </Grid2>\n </Box>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n disabled={okDisabled}\n color=\"primary\"\n onClick={() => this.onShowInputOk()}\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showInput: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n render(): React.JSX.Element {\n return (\n <>\n {this.renderSnackbar()}\n {this.renderContent()}\n {this.renderConfirmDialog()}\n {this.renderMessageDialog()}\n {this.renderFormDialog()}\n {this.renderProgressDialog()}\n {this.renderConfirmationDialog()}\n {this.renderInputDialog()}\n {this.renderSpinner()}\n </>\n );\n }\n}\n"]}
|
|
@@ -3,8 +3,7 @@ import type { ActionBase, DeviceAction, DeviceId } from './protocol/api';
|
|
|
3
3
|
interface DeviceActionButtonProps {
|
|
4
4
|
deviceId: DeviceId;
|
|
5
5
|
action: DeviceAction;
|
|
6
|
-
|
|
7
|
-
deviceHandler: (deviceId: DeviceId, action: ActionBase, refresh: () => void) => () => void;
|
|
6
|
+
deviceHandler: (deviceId: DeviceId, action: ActionBase) => () => void;
|
|
8
7
|
disabled?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export default function DeviceActionButton(props: DeviceActionButtonProps): React.JSX.Element;
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import TooltipButton from './TooltipButton';
|
|
3
3
|
import { getTranslation, renderActionIcon } from './Utils';
|
|
4
4
|
export default function DeviceActionButton(props) {
|
|
5
|
-
const { deviceId, action,
|
|
5
|
+
const { deviceId, action, deviceHandler, disabled } = props;
|
|
6
6
|
const icon = renderActionIcon(action);
|
|
7
7
|
const tooltip = getTranslation(action.description ?? '') || (icon ? null : action.id);
|
|
8
|
-
return (React.createElement(TooltipButton, { tooltip: tooltip || undefined, disabled: disabled || action.disabled, Icon: icon, onClick: deviceHandler(deviceId, action
|
|
8
|
+
return (React.createElement(TooltipButton, { tooltip: tooltip || undefined, disabled: disabled || action.disabled, Icon: icon, onClick: deviceHandler(deviceId, action), url: 'url' in action ? getTranslation(action.url) : undefined }));
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=DeviceActionButton.js.map
|