@iobroker/adapter-react-v5 4.8.1 → 4.9.1
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 -139
- package/Dialogs/SelectID.js +141 -271
- package/LegacyConnection.d.ts +1 -1
- package/README.md +9 -2
- package/i18n.d.ts +2 -2
- package/index.d.ts +127 -126
- package/index.js +213 -192
- package/package.json +7 -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
|
@@ -37,6 +37,7 @@ var _IconState = _interopRequireDefault(require("../icons/IconState"));
|
|
|
37
37
|
var _IconClosed = _interopRequireDefault(require("../icons/IconClosed"));
|
|
38
38
|
var _IconOpen = _interopRequireDefault(require("../icons/IconOpen"));
|
|
39
39
|
var _IconClearFilter = _interopRequireDefault(require("../icons/IconClearFilter"));
|
|
40
|
+
var _Connection = _interopRequireDefault(require("../Connection"));
|
|
40
41
|
var _Icon = _interopRequireDefault(require("./Icon"));
|
|
41
42
|
var _withWidth = _interopRequireDefault(require("./withWidth"));
|
|
42
43
|
var _Utils = _interopRequireDefault(require("./Utils"));
|
|
@@ -489,7 +490,7 @@ var styles = function styles(theme) {
|
|
|
489
490
|
marginTop: -2
|
|
490
491
|
},
|
|
491
492
|
cellButtonsButtonWithCustoms: {
|
|
492
|
-
color: theme.palette.secondary.main
|
|
493
|
+
color: theme.palette.mode === 'dark' ? theme.palette.primary.main : theme.palette.secondary.main
|
|
493
494
|
},
|
|
494
495
|
cellButtonsButtonWithoutCustoms: {
|
|
495
496
|
opacity: 0.2
|
|
@@ -746,6 +747,9 @@ var styles = function styles(theme) {
|
|
|
746
747
|
marginLeft: theme.spacing(1),
|
|
747
748
|
opacity: 0.7,
|
|
748
749
|
fontSize: 'smaller'
|
|
750
|
+
},
|
|
751
|
+
contextMenuWithSubMenu: {
|
|
752
|
+
display: 'flex'
|
|
749
753
|
}
|
|
750
754
|
};
|
|
751
755
|
};
|
|
@@ -1296,7 +1300,7 @@ function buildTree(objects, options) {
|
|
|
1296
1300
|
do {
|
|
1297
1301
|
repeat = false;
|
|
1298
1302
|
|
|
1299
|
-
// If current level is still OK, and we can add ID to children
|
|
1303
|
+
// If the current level is still OK, and we can add ID to children
|
|
1300
1304
|
if (!currentPath || id.startsWith("".concat(currentPath, "."))) {
|
|
1301
1305
|
var _obj$common, _obj$common2, _obj$common3, _obj$common4;
|
|
1302
1306
|
// if more than one level added
|
|
@@ -1913,7 +1917,14 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
1913
1917
|
if (_this.contextMenu && Date.now() - _this.contextMenu.ts < 2000) {
|
|
1914
1918
|
e.preventDefault();
|
|
1915
1919
|
_this.setState({
|
|
1916
|
-
showContextMenu:
|
|
1920
|
+
showContextMenu: {
|
|
1921
|
+
item: _this.contextMenu.item
|
|
1922
|
+
}
|
|
1923
|
+
});
|
|
1924
|
+
} else if (_this.state.showContextMenu) {
|
|
1925
|
+
e.preventDefault();
|
|
1926
|
+
_this.setState({
|
|
1927
|
+
showContextMenu: null
|
|
1917
1928
|
});
|
|
1918
1929
|
}
|
|
1919
1930
|
_this.contextMenu = null;
|
|
@@ -2780,7 +2791,15 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2780
2791
|
aclEveryone_read_object: props.t('ra_aclEveryone_read_object'),
|
|
2781
2792
|
aclEveryone_read_state: props.t('ra_aclEveryone_read_state'),
|
|
2782
2793
|
aclEveryone_write_object: props.t('ra_aclEveryone_write_object'),
|
|
2783
|
-
aclEveryone_write_state: props.t('ra_aclEveryone_write_state')
|
|
2794
|
+
aclEveryone_write_state: props.t('ra_aclEveryone_write_state'),
|
|
2795
|
+
create: props.t('ra_Create'),
|
|
2796
|
+
createBooleanState: props.t('ra_create_boolean_state'),
|
|
2797
|
+
createNumberState: props.t('ra_create_number_state'),
|
|
2798
|
+
createStringState: props.t('ra_create_string_state'),
|
|
2799
|
+
createState: props.t('ra_create_state'),
|
|
2800
|
+
createChannel: props.t('ra_create_channel'),
|
|
2801
|
+
createDevice: props.t('ra_create_device'),
|
|
2802
|
+
createFolder: props.t('ra_Create folder')
|
|
2784
2803
|
};
|
|
2785
2804
|
_this.levelPadding = props.levelPadding || ITEM_LEVEL;
|
|
2786
2805
|
var resizerCurrentWidths = (window._localStorage || window.localStorage).getItem("".concat(_this.props.dialogName || 'App', ".table"));
|
|
@@ -2807,131 +2826,182 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2807
2826
|
}
|
|
2808
2827
|
(0, _createClass2["default"])(ObjectBrowser, [{
|
|
2809
2828
|
key: "loadAllObjects",
|
|
2810
|
-
value: function
|
|
2811
|
-
var
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2829
|
+
value: function () {
|
|
2830
|
+
var _loadAllObjects = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(update) {
|
|
2831
|
+
var _this2 = this;
|
|
2832
|
+
var props, objects, i, moreObjects, columnsForAdmin, _buildTree2, info, root, node;
|
|
2833
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
2834
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
2835
|
+
case 0:
|
|
2836
|
+
props = this.props;
|
|
2837
|
+
_context4.prev = 1;
|
|
2838
|
+
_context4.next = 4;
|
|
2839
|
+
return new Promise(function (resolve) {
|
|
2840
|
+
_this2.setState({
|
|
2841
|
+
updating: true
|
|
2842
|
+
}, function () {
|
|
2843
|
+
return resolve();
|
|
2844
|
+
});
|
|
2845
|
+
});
|
|
2846
|
+
case 4:
|
|
2847
|
+
if (!this.props.objectsWorker) {
|
|
2848
|
+
_context4.next = 10;
|
|
2849
|
+
break;
|
|
2850
|
+
}
|
|
2851
|
+
_context4.next = 7;
|
|
2852
|
+
return this.props.objectsWorker.getObjects(update);
|
|
2853
|
+
case 7:
|
|
2854
|
+
_context4.t0 = _context4.sent;
|
|
2855
|
+
_context4.next = 13;
|
|
2856
|
+
break;
|
|
2857
|
+
case 10:
|
|
2858
|
+
_context4.next = 12;
|
|
2859
|
+
return props.socket.getObjects(update, true);
|
|
2860
|
+
case 12:
|
|
2861
|
+
_context4.t0 = _context4.sent;
|
|
2862
|
+
case 13:
|
|
2863
|
+
objects = _context4.t0;
|
|
2864
|
+
if (!(props.types && _Connection["default"].isWeb())) {
|
|
2865
|
+
_context4.next = 26;
|
|
2866
|
+
break;
|
|
2867
|
+
}
|
|
2868
|
+
i = 0;
|
|
2869
|
+
case 16:
|
|
2870
|
+
if (!(i < props.types.length)) {
|
|
2871
|
+
_context4.next = 26;
|
|
2872
|
+
break;
|
|
2873
|
+
}
|
|
2874
|
+
if (!(props.types[i] === 'state' || props.types[i] === 'channel' || props.types[i] === 'device' || props.types[i] === 'enum')) {
|
|
2875
|
+
_context4.next = 19;
|
|
2876
|
+
break;
|
|
2877
|
+
}
|
|
2878
|
+
return _context4.abrupt("continue", 23);
|
|
2879
|
+
case 19:
|
|
2880
|
+
_context4.next = 21;
|
|
2881
|
+
return props.socket.getObjectViewSystem(props.types[i], null, null);
|
|
2882
|
+
case 21:
|
|
2883
|
+
moreObjects = _context4.sent;
|
|
2884
|
+
Object.assign(objects, moreObjects);
|
|
2885
|
+
case 23:
|
|
2886
|
+
i++;
|
|
2887
|
+
_context4.next = 16;
|
|
2888
|
+
break;
|
|
2889
|
+
case 26:
|
|
2890
|
+
_context4.t1 = this.systemConfig || objects['system.config'];
|
|
2891
|
+
if (_context4.t1) {
|
|
2892
|
+
_context4.next = 31;
|
|
2893
|
+
break;
|
|
2894
|
+
}
|
|
2895
|
+
_context4.next = 30;
|
|
2896
|
+
return props.socket.getObject('system.config');
|
|
2897
|
+
case 30:
|
|
2898
|
+
_context4.t1 = _context4.sent;
|
|
2899
|
+
case 31:
|
|
2900
|
+
this.systemConfig = _context4.t1;
|
|
2901
|
+
this.systemConfig.common = this.systemConfig.common || {};
|
|
2902
|
+
this.systemConfig.common.defaultNewAcl = this.systemConfig.common.defaultNewAcl || {};
|
|
2903
|
+
this.systemConfig.common.defaultNewAcl.owner = this.systemConfig.common.defaultNewAcl.owner || 'system.user.admin';
|
|
2904
|
+
this.systemConfig.common.defaultNewAcl.ownerGroup = this.systemConfig.common.defaultNewAcl.ownerGroup || 'system.group.administrator';
|
|
2905
|
+
if (typeof this.systemConfig.common.defaultNewAcl.state !== 'number') {
|
|
2906
|
+
// TODO: may be convert here from string
|
|
2907
|
+
this.systemConfig.common.defaultNewAcl.state = 0x664;
|
|
2908
|
+
}
|
|
2909
|
+
if (typeof this.systemConfig.common.defaultNewAcl.object !== 'number') {
|
|
2910
|
+
// TODO: may be convert here from string
|
|
2911
|
+
this.systemConfig.common.defaultNewAcl.state = 0x664;
|
|
2912
|
+
}
|
|
2913
|
+
if (typeof props.filterFunc === 'function') {
|
|
2914
|
+
this.objects = {};
|
|
2915
|
+
Object.keys(objects).forEach(function (id) {
|
|
2916
|
+
try {
|
|
2917
|
+
if (props.filterFunc(objects[id])) {
|
|
2918
|
+
_this2.objects[id] = objects[id];
|
|
2919
|
+
}
|
|
2920
|
+
} catch (e) {
|
|
2921
|
+
console.log("Error by filtering of \"".concat(id, "\": ").concat(e));
|
|
2922
|
+
}
|
|
2923
|
+
});
|
|
2924
|
+
} else if (props.types) {
|
|
2925
|
+
this.objects = {};
|
|
2926
|
+
Object.keys(objects).forEach(function (id) {
|
|
2927
|
+
var type = objects[id] && objects[id].type;
|
|
2928
|
+
// include "folder" types too
|
|
2929
|
+
if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || props.types.includes(type))) {
|
|
2930
|
+
_this2.objects[id] = objects[id];
|
|
2931
|
+
}
|
|
2932
|
+
});
|
|
2933
|
+
} else {
|
|
2934
|
+
this.objects = objects;
|
|
2861
2935
|
}
|
|
2862
|
-
} catch (e) {
|
|
2863
|
-
console.log("Error by filtering of \"".concat(id, "\": ").concat(e));
|
|
2864
|
-
}
|
|
2865
|
-
});
|
|
2866
|
-
} else if (props.types) {
|
|
2867
|
-
_this2.objects = {};
|
|
2868
|
-
Object.keys(objects).forEach(function (id) {
|
|
2869
|
-
var type = objects[id] && objects[id].type;
|
|
2870
|
-
// include "folder" types too
|
|
2871
|
-
if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || props.types.includes(type))) {
|
|
2872
|
-
_this2.objects[id] = objects[id];
|
|
2873
|
-
}
|
|
2874
|
-
});
|
|
2875
|
-
} else {
|
|
2876
|
-
_this2.objects = objects;
|
|
2877
|
-
}
|
|
2878
|
-
|
|
2879
|
-
// read default history
|
|
2880
|
-
_this2.defaultHistory = _this2.systemConfig.common.defaultHistory;
|
|
2881
|
-
if (_this2.defaultHistory) {
|
|
2882
|
-
props.socket.getState("system.adapter.".concat(_this2.defaultHistory, ".alive")).then(function (state) {
|
|
2883
|
-
if (!state || !state.val) {
|
|
2884
|
-
_this2.defaultHistory = '';
|
|
2885
|
-
}
|
|
2886
|
-
})["catch"](function (e) {
|
|
2887
|
-
return window.alert("Cannot get state: ".concat(e));
|
|
2888
|
-
});
|
|
2889
|
-
}
|
|
2890
|
-
return _this2.getAdditionalColumns();
|
|
2891
|
-
}).then(function (columnsForAdmin) {
|
|
2892
|
-
_this2.calculateColumnsVisibility(null, null, columnsForAdmin);
|
|
2893
|
-
var _buildTree2 = buildTree(_this2.objects, _this2.props),
|
|
2894
|
-
info = _buildTree2.info,
|
|
2895
|
-
root = _buildTree2.root;
|
|
2896
|
-
_this2.root = root;
|
|
2897
|
-
_this2.info = info;
|
|
2898
2936
|
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2937
|
+
// read default history
|
|
2938
|
+
this.defaultHistory = this.systemConfig.common.defaultHistory;
|
|
2939
|
+
if (this.defaultHistory) {
|
|
2940
|
+
props.socket.getState("system.adapter.".concat(this.defaultHistory, ".alive")).then(function (state) {
|
|
2941
|
+
if (!state || !state.val) {
|
|
2942
|
+
_this2.defaultHistory = '';
|
|
2943
|
+
}
|
|
2944
|
+
})["catch"](function (e) {
|
|
2945
|
+
return window.alert("Cannot get state: ".concat(e));
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
_context4.next = 43;
|
|
2949
|
+
return this.getAdditionalColumns();
|
|
2950
|
+
case 43:
|
|
2951
|
+
columnsForAdmin = _context4.sent;
|
|
2952
|
+
this.calculateColumnsVisibility(null, null, columnsForAdmin);
|
|
2953
|
+
_buildTree2 = buildTree(this.objects, this.props), info = _buildTree2.info, root = _buildTree2.root;
|
|
2954
|
+
this.root = root;
|
|
2955
|
+
this.info = info;
|
|
2902
2956
|
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
_this2.setState({
|
|
2907
|
-
filter: _objectSpread({}, DEFAULT_FILTER),
|
|
2908
|
-
columnsForAdmin: columnsForAdmin
|
|
2909
|
-
}, function () {
|
|
2910
|
-
_this2.setState({
|
|
2911
|
-
loaded: true,
|
|
2912
|
-
updating: false
|
|
2913
|
-
}, function () {
|
|
2914
|
-
return _this2.expandAllSelected(function () {
|
|
2915
|
-
return _this2.onAfterSelect();
|
|
2916
|
-
});
|
|
2917
|
-
});
|
|
2918
|
-
});
|
|
2919
|
-
} else {
|
|
2920
|
-
_this2.setState({
|
|
2921
|
-
loaded: true,
|
|
2922
|
-
updating: false,
|
|
2923
|
-
columnsForAdmin: columnsForAdmin
|
|
2924
|
-
}, function () {
|
|
2925
|
-
return _this2.expandAllSelected(function () {
|
|
2926
|
-
return _this2.onAfterSelect();
|
|
2927
|
-
});
|
|
2928
|
-
});
|
|
2929
|
-
}
|
|
2930
|
-
})["catch"](function (e) {
|
|
2931
|
-
return _this2.showError(e);
|
|
2932
|
-
});
|
|
2933
|
-
}
|
|
2957
|
+
// Show first selected item
|
|
2958
|
+
node = this.state.selected && this.state.selected.length && findNode(this.root, this.state.selected[0]);
|
|
2959
|
+
this.lastAppliedFilter = null;
|
|
2934
2960
|
|
|
2961
|
+
// If the selected ID is not visible, reset filter
|
|
2962
|
+
if (node && !applyFilter(node, this.state.filter, this.props.lang, this.objects, null, null, props.customFilter, props.types)) {
|
|
2963
|
+
// reset filter
|
|
2964
|
+
this.setState({
|
|
2965
|
+
filter: _objectSpread({}, DEFAULT_FILTER),
|
|
2966
|
+
columnsForAdmin: columnsForAdmin
|
|
2967
|
+
}, function () {
|
|
2968
|
+
_this2.setState({
|
|
2969
|
+
loaded: true,
|
|
2970
|
+
updating: false
|
|
2971
|
+
}, function () {
|
|
2972
|
+
return _this2.expandAllSelected(function () {
|
|
2973
|
+
return _this2.onAfterSelect();
|
|
2974
|
+
});
|
|
2975
|
+
});
|
|
2976
|
+
});
|
|
2977
|
+
} else {
|
|
2978
|
+
this.setState({
|
|
2979
|
+
loaded: true,
|
|
2980
|
+
updating: false,
|
|
2981
|
+
columnsForAdmin: columnsForAdmin
|
|
2982
|
+
}, function () {
|
|
2983
|
+
return _this2.expandAllSelected(function () {
|
|
2984
|
+
return _this2.onAfterSelect();
|
|
2985
|
+
});
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
_context4.next = 56;
|
|
2989
|
+
break;
|
|
2990
|
+
case 53:
|
|
2991
|
+
_context4.prev = 53;
|
|
2992
|
+
_context4.t2 = _context4["catch"](1);
|
|
2993
|
+
this.showError(_context4.t2);
|
|
2994
|
+
case 56:
|
|
2995
|
+
case "end":
|
|
2996
|
+
return _context4.stop();
|
|
2997
|
+
}
|
|
2998
|
+
}, _callee4, this, [[1, 53]]);
|
|
2999
|
+
}));
|
|
3000
|
+
function loadAllObjects(_x5) {
|
|
3001
|
+
return _loadAllObjects.apply(this, arguments);
|
|
3002
|
+
}
|
|
3003
|
+
return loadAllObjects;
|
|
3004
|
+
}()
|
|
2935
3005
|
/**
|
|
2936
3006
|
* Check if it is a non-expert id
|
|
2937
3007
|
*
|
|
@@ -3018,11 +3088,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3018
3088
|
* Called when component is mounted.
|
|
3019
3089
|
*/
|
|
3020
3090
|
function () {
|
|
3021
|
-
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
3022
|
-
return _regenerator["default"].wrap(function
|
|
3023
|
-
while (1) switch (
|
|
3091
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
3092
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
3093
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
3024
3094
|
case 0:
|
|
3025
|
-
|
|
3095
|
+
_context5.next = 2;
|
|
3026
3096
|
return this.loadAllObjects(!objectsAlreadyLoaded);
|
|
3027
3097
|
case 2:
|
|
3028
3098
|
if (this.props.objectsWorker) {
|
|
@@ -3034,9 +3104,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3034
3104
|
window.addEventListener('contextmenu', this.onContextMenu, true);
|
|
3035
3105
|
case 5:
|
|
3036
3106
|
case "end":
|
|
3037
|
-
return
|
|
3107
|
+
return _context5.stop();
|
|
3038
3108
|
}
|
|
3039
|
-
},
|
|
3109
|
+
}, _callee5, this);
|
|
3040
3110
|
}));
|
|
3041
3111
|
function componentDidMount() {
|
|
3042
3112
|
return _componentDidMount.apply(this, arguments);
|
|
@@ -4068,47 +4138,47 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4068
4138
|
}, {
|
|
4069
4139
|
key: "_exportObjects",
|
|
4070
4140
|
value: (function () {
|
|
4071
|
-
var _exportObjects2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
4141
|
+
var _exportObjects2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(options) {
|
|
4072
4142
|
var result, id, ids, _iterator2, _step2, _result$key, key, state, enums;
|
|
4073
|
-
return _regenerator["default"].wrap(function
|
|
4074
|
-
while (1) switch (
|
|
4143
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
4144
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4075
4145
|
case 0:
|
|
4076
4146
|
if (!options.isAll) {
|
|
4077
|
-
|
|
4147
|
+
_context6.next = 3;
|
|
4078
4148
|
break;
|
|
4079
4149
|
}
|
|
4080
4150
|
generateFile('allObjects.json', this.objects, options);
|
|
4081
|
-
return
|
|
4151
|
+
return _context6.abrupt("return");
|
|
4082
4152
|
case 3:
|
|
4083
4153
|
if (this.state.selected.length || this.state.selectedNonObject) {
|
|
4084
|
-
|
|
4154
|
+
_context6.next = 6;
|
|
4085
4155
|
break;
|
|
4086
4156
|
}
|
|
4087
4157
|
window.alert(this.props.t('ra_Save of objects-tree is not possible'));
|
|
4088
|
-
return
|
|
4158
|
+
return _context6.abrupt("return");
|
|
4089
4159
|
case 6:
|
|
4090
4160
|
result = {};
|
|
4091
4161
|
id = this.state.selected[0] || this.state.selectedNonObject;
|
|
4092
4162
|
ids = this._getSelectedIdsForExport();
|
|
4093
4163
|
_iterator2 = _createForOfIteratorHelper(ids);
|
|
4094
|
-
|
|
4164
|
+
_context6.prev = 10;
|
|
4095
4165
|
_iterator2.s();
|
|
4096
4166
|
case 12:
|
|
4097
4167
|
if ((_step2 = _iterator2.n()).done) {
|
|
4098
|
-
|
|
4168
|
+
_context6.next = 23;
|
|
4099
4169
|
break;
|
|
4100
4170
|
}
|
|
4101
4171
|
key = _step2.value;
|
|
4102
4172
|
result[key] = JSON.parse(JSON.stringify(this.objects[key]));
|
|
4103
4173
|
// read states values
|
|
4104
4174
|
if (!(((_result$key = result[key]) === null || _result$key === void 0 ? void 0 : _result$key.type) === 'state' && !options.noStatesByExportImport)) {
|
|
4105
|
-
|
|
4175
|
+
_context6.next = 20;
|
|
4106
4176
|
break;
|
|
4107
4177
|
}
|
|
4108
|
-
|
|
4178
|
+
_context6.next = 18;
|
|
4109
4179
|
return this.props.socket.getState(key);
|
|
4110
4180
|
case 18:
|
|
4111
|
-
state =
|
|
4181
|
+
state = _context6.sent;
|
|
4112
4182
|
if (state) {
|
|
4113
4183
|
result[key].val = state.val;
|
|
4114
4184
|
result[key].ack = state.ack;
|
|
@@ -4122,28 +4192,28 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4122
4192
|
}
|
|
4123
4193
|
}
|
|
4124
4194
|
case 21:
|
|
4125
|
-
|
|
4195
|
+
_context6.next = 12;
|
|
4126
4196
|
break;
|
|
4127
4197
|
case 23:
|
|
4128
|
-
|
|
4198
|
+
_context6.next = 28;
|
|
4129
4199
|
break;
|
|
4130
4200
|
case 25:
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
_iterator2.e(
|
|
4201
|
+
_context6.prev = 25;
|
|
4202
|
+
_context6.t0 = _context6["catch"](10);
|
|
4203
|
+
_iterator2.e(_context6.t0);
|
|
4134
4204
|
case 28:
|
|
4135
|
-
|
|
4205
|
+
_context6.prev = 28;
|
|
4136
4206
|
_iterator2.f();
|
|
4137
|
-
return
|
|
4207
|
+
return _context6.finish(28);
|
|
4138
4208
|
case 31:
|
|
4139
4209
|
generateFile("".concat(id, ".json"), result, options);
|
|
4140
4210
|
case 32:
|
|
4141
4211
|
case "end":
|
|
4142
|
-
return
|
|
4212
|
+
return _context6.stop();
|
|
4143
4213
|
}
|
|
4144
|
-
},
|
|
4214
|
+
}, _callee6, this, [[10, 25, 28, 31]]);
|
|
4145
4215
|
}));
|
|
4146
|
-
function _exportObjects(
|
|
4216
|
+
function _exportObjects(_x6) {
|
|
4147
4217
|
return _exportObjects2.apply(this, arguments);
|
|
4148
4218
|
}
|
|
4149
4219
|
return _exportObjects;
|
|
@@ -4398,7 +4468,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4398
4468
|
disabled: !allowObjectCreation,
|
|
4399
4469
|
onClick: function onClick() {
|
|
4400
4470
|
return _this25.setState({
|
|
4401
|
-
modalNewObj:
|
|
4471
|
+
modalNewObj: {
|
|
4472
|
+
id: _this25.state.selected[0] || _this25.state.selectedNonObject
|
|
4473
|
+
}
|
|
4402
4474
|
});
|
|
4403
4475
|
},
|
|
4404
4476
|
size: "large"
|
|
@@ -6401,6 +6473,18 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6401
6473
|
}
|
|
6402
6474
|
});
|
|
6403
6475
|
}
|
|
6476
|
+
}, {
|
|
6477
|
+
key: "showAddDataPointDialog",
|
|
6478
|
+
value: function showAddDataPointDialog(id, initialType, initialStateType) {
|
|
6479
|
+
this.setState({
|
|
6480
|
+
showContextMenu: null,
|
|
6481
|
+
modalNewObj: {
|
|
6482
|
+
id: id,
|
|
6483
|
+
initialType: initialType,
|
|
6484
|
+
initialStateType: initialStateType
|
|
6485
|
+
}
|
|
6486
|
+
});
|
|
6487
|
+
}
|
|
6404
6488
|
|
|
6405
6489
|
/**
|
|
6406
6490
|
* Renders the right mouse button context menu
|
|
@@ -6422,7 +6506,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6422
6506
|
if (!this.state.showContextMenu) {
|
|
6423
6507
|
return null;
|
|
6424
6508
|
}
|
|
6425
|
-
var item = this.state.showContextMenu;
|
|
6509
|
+
var item = this.state.showContextMenu.item;
|
|
6426
6510
|
var id = item.data.id;
|
|
6427
6511
|
var items = [];
|
|
6428
6512
|
// const ctrl = isIOS() ? '⌘' : (this.props.lang === 'de' ? 'Strg+' : 'Ctrl+');
|
|
@@ -6439,6 +6523,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6439
6523
|
}
|
|
6440
6524
|
}
|
|
6441
6525
|
var enumEditable = !this.props.notEditable && obj && (this.state.filter.expertMode || obj.type === 'state' || obj.type === 'channel' || obj.type === 'device');
|
|
6526
|
+
var createStateVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.obj.type === 'channel' || item.data.obj.type === 'device' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
|
|
6527
|
+
var createChannelVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.obj.type === 'device' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
|
|
6528
|
+
var createDeviceVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
|
|
6529
|
+
var createFolderVisible = !item.data.obj || item.data.obj.type === 'folder' || item.data.id === '0_userdata.0' || item.data.obj.type === 'meta';
|
|
6442
6530
|
var ITEMS = {
|
|
6443
6531
|
EDIT: {
|
|
6444
6532
|
key: '0',
|
|
@@ -6612,6 +6700,80 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6612
6700
|
}
|
|
6613
6701
|
}
|
|
6614
6702
|
},
|
|
6703
|
+
CREATE: {
|
|
6704
|
+
key: '+',
|
|
6705
|
+
visibility: (item.data.id.startsWith('0_userdata.0') || item.data.id.startsWith('javascript.')) && (createStateVisible || createChannelVisible || createDeviceVisible || createFolderVisible),
|
|
6706
|
+
icon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Add, {
|
|
6707
|
+
fontSize: "small",
|
|
6708
|
+
className: this.props.classes.cellButtonsButtonWithCustoms
|
|
6709
|
+
}),
|
|
6710
|
+
className: this.props.classes.contextMenuWithSubMenu,
|
|
6711
|
+
label: this.texts.create,
|
|
6712
|
+
subMenu: [{
|
|
6713
|
+
label: this.texts.createBooleanState,
|
|
6714
|
+
visibility: createStateVisible,
|
|
6715
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
|
|
6716
|
+
fontSize: "small"
|
|
6717
|
+
}),
|
|
6718
|
+
onClick: function onClick() {
|
|
6719
|
+
return _this46.showAddDataPointDialog(item.data.id, 'state', 'boolean');
|
|
6720
|
+
}
|
|
6721
|
+
}, {
|
|
6722
|
+
label: this.texts.createNumberState,
|
|
6723
|
+
visibility: createStateVisible,
|
|
6724
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
|
|
6725
|
+
fontSize: "small"
|
|
6726
|
+
}),
|
|
6727
|
+
onClick: function onClick() {
|
|
6728
|
+
return _this46.showAddDataPointDialog(item.data.id, 'state', 'number');
|
|
6729
|
+
}
|
|
6730
|
+
}, {
|
|
6731
|
+
label: this.texts.createStringState,
|
|
6732
|
+
visibility: createStateVisible,
|
|
6733
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
|
|
6734
|
+
fontSize: "small"
|
|
6735
|
+
}),
|
|
6736
|
+
onClick: function onClick() {
|
|
6737
|
+
return _this46.showAddDataPointDialog(item.data.id, 'state', 'string');
|
|
6738
|
+
}
|
|
6739
|
+
}, {
|
|
6740
|
+
label: this.texts.createState,
|
|
6741
|
+
visibility: createStateVisible,
|
|
6742
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IconState["default"], {
|
|
6743
|
+
fontSize: "small"
|
|
6744
|
+
}),
|
|
6745
|
+
onClick: function onClick() {
|
|
6746
|
+
return _this46.showAddDataPointDialog(item.data.id, 'state');
|
|
6747
|
+
}
|
|
6748
|
+
}, {
|
|
6749
|
+
label: this.texts.createChannel,
|
|
6750
|
+
visibility: createChannelVisible,
|
|
6751
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IconChannel["default"], {
|
|
6752
|
+
fontSize: "small"
|
|
6753
|
+
}),
|
|
6754
|
+
onClick: function onClick() {
|
|
6755
|
+
return _this46.showAddDataPointDialog(item.data.id, 'channel');
|
|
6756
|
+
}
|
|
6757
|
+
}, {
|
|
6758
|
+
label: this.texts.createDevice,
|
|
6759
|
+
visibility: createDeviceVisible,
|
|
6760
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IconDevice["default"], {
|
|
6761
|
+
fontSize: "small"
|
|
6762
|
+
}),
|
|
6763
|
+
onClick: function onClick() {
|
|
6764
|
+
return _this46.showAddDataPointDialog(item.data.id, 'device');
|
|
6765
|
+
}
|
|
6766
|
+
}, {
|
|
6767
|
+
label: this.texts.createFolder,
|
|
6768
|
+
icon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.CreateNewFolder, {
|
|
6769
|
+
fontSize: "small"
|
|
6770
|
+
}),
|
|
6771
|
+
visibility: createFolderVisible,
|
|
6772
|
+
onClick: function onClick() {
|
|
6773
|
+
return _this46.showAddDataPointDialog(item.data.id, 'folder');
|
|
6774
|
+
}
|
|
6775
|
+
}]
|
|
6776
|
+
},
|
|
6615
6777
|
DELETE: {
|
|
6616
6778
|
key: 'Delete',
|
|
6617
6779
|
visibility: this.props.onObjectDelete && (((_item$children6 = item.children) === null || _item$children6 === void 0 ? void 0 : _item$children6.length) || obj && !((_obj$common15 = obj.common) !== null && _obj$common15 !== void 0 && _obj$common15.dontDelete)),
|
|
@@ -6636,16 +6798,59 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6636
6798
|
};
|
|
6637
6799
|
Object.keys(ITEMS).forEach(function (key) {
|
|
6638
6800
|
if (ITEMS[key].visibility) {
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6801
|
+
if (ITEMS[key].subMenu) {
|
|
6802
|
+
items.push( /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
|
|
6803
|
+
key: key,
|
|
6804
|
+
onClick: function onClick(e) {
|
|
6805
|
+
return _this46.setState({
|
|
6806
|
+
showContextMenu: {
|
|
6807
|
+
item: _this46.state.showContextMenu.item,
|
|
6808
|
+
subItem: key,
|
|
6809
|
+
subAnchor: e.target
|
|
6810
|
+
}
|
|
6811
|
+
});
|
|
6812
|
+
},
|
|
6813
|
+
className: ITEMS[key].className
|
|
6814
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
|
|
6815
|
+
style: ITEMS[key].iconStyle,
|
|
6816
|
+
className: ITEMS[key].listItemIconClass
|
|
6817
|
+
}, ITEMS[key].icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, ITEMS[key].label, "..."), /*#__PURE__*/_react["default"].createElement(_material.ListItemSecondaryAction, null, /*#__PURE__*/_react["default"].createElement(_iconsMaterial.ArrowRight, null))));
|
|
6818
|
+
if (_this46.state.showContextMenu.subItem === key) {
|
|
6819
|
+
items.push( /*#__PURE__*/_react["default"].createElement(_material.Menu, {
|
|
6820
|
+
key: "subContextMenu",
|
|
6821
|
+
open: !0,
|
|
6822
|
+
anchorEl: _this46.state.showContextMenu.subAnchor,
|
|
6823
|
+
onClose: function onClose() {
|
|
6824
|
+
_this46.setState({
|
|
6825
|
+
showContextMenu: {
|
|
6826
|
+
item: _this46.state.showContextMenu.item
|
|
6827
|
+
}
|
|
6828
|
+
});
|
|
6829
|
+
_this46.contextMenu = null;
|
|
6830
|
+
}
|
|
6831
|
+
}, ITEMS[key].subMenu.map(function (subItem) {
|
|
6832
|
+
return subItem.visibility ? /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
|
|
6833
|
+
key: subItem.label,
|
|
6834
|
+
onClick: subItem.onClick,
|
|
6835
|
+
className: subItem.className
|
|
6836
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
|
|
6837
|
+
style: subItem.iconStyle,
|
|
6838
|
+
className: subItem.listItemIconClass
|
|
6839
|
+
}, subItem.icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, subItem.label)) : null;
|
|
6840
|
+
})));
|
|
6841
|
+
}
|
|
6842
|
+
} else {
|
|
6843
|
+
items.push( /*#__PURE__*/_react["default"].createElement(_material.MenuItem, {
|
|
6844
|
+
key: key,
|
|
6845
|
+
onClick: ITEMS[key].onClick,
|
|
6846
|
+
className: ITEMS[key].className
|
|
6847
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, {
|
|
6848
|
+
style: ITEMS[key].iconStyle,
|
|
6849
|
+
className: ITEMS[key].listItemIconClass
|
|
6850
|
+
}, ITEMS[key].icon), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, null, ITEMS[key].label), ITEMS[key].key ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
6851
|
+
className: _this46.props.classes.contextMenuKeys
|
|
6852
|
+
}, "Alt+".concat(ITEMS[key].key === 'Delete' ? _this46.props.t('ra_Del') : ITEMS[key].key)) : null));
|
|
6853
|
+
}
|
|
6649
6854
|
}
|
|
6650
6855
|
});
|
|
6651
6856
|
if (!items.length) {
|