@iobroker/adapter-react-v5 3.1.27 → 3.1.30
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/IconPicker.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +4 -3
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +9 -7
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +33 -11
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +1 -0
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +3 -3
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +85 -24
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +1 -1
- package/Components/JsonConfigComponent/ConfigStaticText.js +45 -4
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +36 -25
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +15 -12
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +4 -6
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/ObjectBrowser.js +86 -15
- package/Components/ObjectBrowser.js.map +1 -1
- package/Connection.d.ts +5 -0
- package/Connection.js +78 -16
- package/Connection.js.map +1 -1
- package/Dialogs/FileSelect.js +2 -1
- package/Dialogs/FileSelect.js.map +1 -1
- package/Dialogs/SelectID.js.map +1 -1
- package/README.md +4 -0
- package/i18n/de.json +2 -1
- package/i18n/en.json +2 -1
- package/i18n/es.json +2 -1
- package/i18n/fr.json +2 -1
- package/i18n/it.json +2 -1
- package/i18n/nl.json +2 -1
- package/i18n/pl.json +2 -1
- package/i18n/pt.json +2 -1
- package/i18n/ru.json +2 -1
- package/i18n/zh-cn.json +2 -1
- package/package.json +1 -1
|
@@ -902,25 +902,27 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
|
|
|
902
902
|
var data = item.data;
|
|
903
903
|
|
|
904
904
|
if (data && data.id) {
|
|
905
|
-
var
|
|
905
|
+
var _data$obj;
|
|
906
|
+
|
|
907
|
+
var common = (_data$obj = data.obj) === null || _data$obj === void 0 ? void 0 : _data$obj.common;
|
|
906
908
|
|
|
907
909
|
if (customFilter) {
|
|
908
910
|
var _customFilter$common, _customFilter$common2, _customFilter$common3;
|
|
909
911
|
|
|
910
912
|
if (customFilter.type) {
|
|
911
913
|
if (typeof customFilter.type === 'string') {
|
|
912
|
-
if (customFilter.type !== data.obj.type) {
|
|
914
|
+
if (!data.obj || customFilter.type !== data.obj.type) {
|
|
913
915
|
filteredOut = true;
|
|
914
916
|
}
|
|
915
917
|
} else if (Array.isArray(customFilter.type)) {
|
|
916
|
-
if (!customFilter.type.includes(data.obj.type)) {
|
|
918
|
+
if (!data.obj || !customFilter.type.includes(data.obj.type)) {
|
|
917
919
|
filteredOut = true;
|
|
918
920
|
}
|
|
919
921
|
}
|
|
920
922
|
}
|
|
921
923
|
|
|
922
924
|
if (!filteredOut && (_customFilter$common = customFilter.common) !== null && _customFilter$common !== void 0 && _customFilter$common.type) {
|
|
923
|
-
if (!common
|
|
925
|
+
if (!(common !== null && common !== void 0 && common.type)) {
|
|
924
926
|
filteredOut = true;
|
|
925
927
|
} else if (typeof customFilter.common.type === 'string') {
|
|
926
928
|
if (customFilter.common.type !== common.type) {
|
|
@@ -934,7 +936,7 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
|
|
|
934
936
|
}
|
|
935
937
|
|
|
936
938
|
if (!filteredOut && (_customFilter$common2 = customFilter.common) !== null && _customFilter$common2 !== void 0 && _customFilter$common2.role) {
|
|
937
|
-
if (!common
|
|
939
|
+
if (!(common !== null && common !== void 0 && common.role)) {
|
|
938
940
|
filteredOut = true;
|
|
939
941
|
} else if (typeof customFilter.common.role === 'string') {
|
|
940
942
|
if (common.role.startsWith(customFilter.common.role)) {
|
|
@@ -950,7 +952,7 @@ function applyFilter(item, filters, lang, objects, context, counter, customFilte
|
|
|
950
952
|
}
|
|
951
953
|
|
|
952
954
|
if (!filteredOut && (_customFilter$common3 = customFilter.common) !== null && _customFilter$common3 !== void 0 && _customFilter$common3.custom) {
|
|
953
|
-
if (!common
|
|
955
|
+
if (!(common !== null && common !== void 0 && common.custom)) {
|
|
954
956
|
filteredOut = true;
|
|
955
957
|
} else if (customFilter.common.custom === '_dataSources') {
|
|
956
958
|
// TODO: make it configurable
|
|
@@ -2401,7 +2403,8 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2401
2403
|
|
|
2402
2404
|
var id = _this.state.selected[0] || _this.state.selectedNonObject;
|
|
2403
2405
|
|
|
2404
|
-
if (id.split('.').length < 2 || _this.objects[id] && ((_this$objects$id = _this.objects[id]) === null || _this$objects$id === void 0 ? void 0 : _this$objects$id.type) === 'state') {
|
|
2406
|
+
if (id.split('.').length < 2 || _this.objects[id] && ((_this$objects$id = _this.objects[id]) === null || _this$objects$id === void 0 ? void 0 : _this$objects$id.type) === 'state') {// show default tooltip
|
|
2407
|
+
} else {
|
|
2405
2408
|
if (_this.state.filter.expertMode) {
|
|
2406
2409
|
switch ((_this$objects$id2 = _this.objects[id]) === null || _this$objects$id2 === void 0 ? void 0 : _this$objects$id2.type) {
|
|
2407
2410
|
case 'device':
|
|
@@ -2409,7 +2412,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2409
2412
|
key: 1
|
|
2410
2413
|
}, t('ra_Only following structures of objects are available:')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2411
2414
|
key: 5
|
|
2412
|
-
}, t('ra_Device → Channel → State'))]
|
|
2415
|
+
}, t('ra_Device → Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2416
|
+
key: 7,
|
|
2417
|
+
style: {
|
|
2418
|
+
height: 10
|
|
2419
|
+
}
|
|
2420
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2421
|
+
key: 8
|
|
2422
|
+
}, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2423
|
+
key: 9
|
|
2424
|
+
}, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").'))];
|
|
2413
2425
|
break;
|
|
2414
2426
|
|
|
2415
2427
|
case 'folder':
|
|
@@ -2421,7 +2433,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2421
2433
|
key: 3
|
|
2422
2434
|
}, t('ra_Folder → Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2423
2435
|
key: 4
|
|
2424
|
-
}, t('ra_Folder → Device → Channel → State'))]
|
|
2436
|
+
}, t('ra_Folder → Device → Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2437
|
+
key: 7,
|
|
2438
|
+
style: {
|
|
2439
|
+
height: 10
|
|
2440
|
+
}
|
|
2441
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2442
|
+
key: 8
|
|
2443
|
+
}, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2444
|
+
key: 9
|
|
2445
|
+
}, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").'))];
|
|
2425
2446
|
break;
|
|
2426
2447
|
|
|
2427
2448
|
case 'channel':
|
|
@@ -2429,7 +2450,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2429
2450
|
key: 1
|
|
2430
2451
|
}, t('ra_Only following structures of objects are available:')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2431
2452
|
key: 1
|
|
2432
|
-
}, t('ra_Channel → State'))]
|
|
2453
|
+
}, t('ra_Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2454
|
+
key: 7,
|
|
2455
|
+
style: {
|
|
2456
|
+
height: 10
|
|
2457
|
+
}
|
|
2458
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2459
|
+
key: 8
|
|
2460
|
+
}, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2461
|
+
key: 9
|
|
2462
|
+
}, t('ra_The experts may create objects everywhere but from second level (e.g. "vis.0" or "javascript.0").'))];
|
|
2433
2463
|
break;
|
|
2434
2464
|
|
|
2435
2465
|
default:
|
|
@@ -2439,6 +2469,21 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2439
2469
|
value = [/*#__PURE__*/_react["default"].createElement("div", {
|
|
2440
2470
|
key: 1
|
|
2441
2471
|
}, t('ra_Only following structures of objects are available:')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2472
|
+
key: 2
|
|
2473
|
+
}, t('ra_Folder → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2474
|
+
key: 3
|
|
2475
|
+
}, t('ra_Folder → Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2476
|
+
key: 4
|
|
2477
|
+
}, t('ra_Folder → Device → Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2478
|
+
key: 5
|
|
2479
|
+
}, t('ra_Device → Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2480
|
+
key: 6
|
|
2481
|
+
}, t('ra_Channel → State')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2482
|
+
key: 7,
|
|
2483
|
+
style: {
|
|
2484
|
+
height: 10
|
|
2485
|
+
}
|
|
2486
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2442
2487
|
key: 7
|
|
2443
2488
|
}, t('ra_Non-experts may create new objects only in "0_userdata.0" or "alias.0".')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
2444
2489
|
key: 8
|
|
@@ -2713,7 +2758,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2713
2758
|
}).filter(function (id) {
|
|
2714
2759
|
return id;
|
|
2715
2760
|
});
|
|
2716
|
-
var columns = (window._localStorage || window.localStorage).getItem(
|
|
2761
|
+
var columns = null; // (window._localStorage || window.localStorage).getItem(`${props.dialogName || 'App'}.columns`);
|
|
2717
2762
|
|
|
2718
2763
|
try {
|
|
2719
2764
|
columns = columns ? JSON.parse(columns) : null;
|
|
@@ -2721,7 +2766,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2721
2766
|
columns = null;
|
|
2722
2767
|
}
|
|
2723
2768
|
|
|
2724
|
-
var columnsWidths = (window._localStorage || window.localStorage).getItem(
|
|
2769
|
+
var columnsWidths = null; // (window._localStorage || window.localStorage).getItem(`${props.dialogName || 'App'}.columnsWidths`);
|
|
2725
2770
|
|
|
2726
2771
|
try {
|
|
2727
2772
|
columnsWidths = columnsWidths ? JSON.parse(columnsWidths) : {};
|
|
@@ -2863,6 +2908,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2863
2908
|
var _this2 = this;
|
|
2864
2909
|
|
|
2865
2910
|
var props = this.props;
|
|
2911
|
+
var objects;
|
|
2866
2912
|
return new Promise(function (resolve) {
|
|
2867
2913
|
return _this2.setState({
|
|
2868
2914
|
updating: true
|
|
@@ -2871,8 +2917,33 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2871
2917
|
});
|
|
2872
2918
|
}).then(function () {
|
|
2873
2919
|
return _this2.props.objectsWorker ? _this2.props.objectsWorker.getObjects(update) : props.socket.getObjects(update, true);
|
|
2874
|
-
}).then(function (
|
|
2875
|
-
|
|
2920
|
+
}).then(function (_objects) {
|
|
2921
|
+
objects = _objects;
|
|
2922
|
+
|
|
2923
|
+
if (props.types && props.types[0] !== 'state') {
|
|
2924
|
+
if (props.length >= 1) {
|
|
2925
|
+
console.error('more than one type does not supported!');
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
return props.socket.getObjectView(null, null, props.types[0]);
|
|
2929
|
+
} else {
|
|
2930
|
+
return props.socket.getObject('system.config').then(function (obj) {
|
|
2931
|
+
return {
|
|
2932
|
+
'system.config': obj
|
|
2933
|
+
};
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
}).then(function (moreObjects) {
|
|
2937
|
+
_this2.systemConfig = objects['system.config'] || moreObjects['system.config'] || {};
|
|
2938
|
+
|
|
2939
|
+
if (moreObjects) {
|
|
2940
|
+
if (moreObjects['system.config']) {
|
|
2941
|
+
delete moreObjects['system.config'];
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
Object.assign(objects, moreObjects);
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2876
2947
|
_this2.systemConfig.common = _this2.systemConfig.common || {};
|
|
2877
2948
|
_this2.systemConfig.common.defaultNewAcl = _this2.systemConfig.common.defaultNewAcl || {};
|
|
2878
2949
|
_this2.systemConfig.common.defaultNewAcl.owner = _this2.systemConfig.common.defaultNewAcl.owner || 'system.user.admin';
|
|
@@ -2902,7 +2973,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2902
2973
|
} else if (props.types) {
|
|
2903
2974
|
_this2.objects = {};
|
|
2904
2975
|
Object.keys(objects).forEach(function (id) {
|
|
2905
|
-
var type = objects[id] && objects[id].type;
|
|
2976
|
+
var type = objects[id] && objects[id].type; // include "folder" types too
|
|
2906
2977
|
|
|
2907
2978
|
if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || props.types.includes(type))) {
|
|
2908
2979
|
_this2.objects[id] = objects[id];
|