@iobroker/adapter-react-v5 6.1.10 → 7.0.2
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/FileBrowser.js +42 -16
- package/Components/ObjectBrowser.d.ts +10 -0
- package/Components/ObjectBrowser.js +228 -80
- package/README.md +1009 -1001
- package/Theme.js +8 -7
- package/i18n/de.json +4 -1
- package/i18n/en.json +4 -1
- package/i18n/es.json +4 -1
- package/i18n/fr.json +4 -1
- package/i18n/it.json +4 -1
- package/i18n/nl.json +4 -1
- package/i18n/pl.json +4 -1
- package/i18n/pt.json +4 -1
- package/i18n/ru.json +4 -1
- package/i18n/uk.json +4 -1
- package/i18n/zh-cn.json +4 -1
- package/package.json +5 -5
- package/src/Components/FileBrowser.tsx +45 -16
- package/src/Components/ObjectBrowser.tsx +281 -98
- package/src/Theme.tsx +2 -2
- package/types.d.ts +0 -134
package/Theme.js
CHANGED
|
@@ -68,7 +68,7 @@ overlay) {
|
|
|
68
68
|
* The theme creation factory function.
|
|
69
69
|
*/
|
|
70
70
|
function customTheme(type, overrides) {
|
|
71
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
71
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
72
72
|
let options;
|
|
73
73
|
let localOverrides;
|
|
74
74
|
if (type === 'dark') {
|
|
@@ -306,33 +306,34 @@ function customTheme(type, overrides) {
|
|
|
306
306
|
{
|
|
307
307
|
props: { variant: 'contained', color: 'grey' },
|
|
308
308
|
style: {
|
|
309
|
-
|
|
309
|
+
backgroundColor: (_c = palette.grey) === null || _c === void 0 ? void 0 : _c[300],
|
|
310
|
+
color: palette.getContrastText && ((_d = palette.grey) === null || _d === void 0 ? void 0 : _d[300]) ? palette.getContrastText(palette.grey[300]) : undefined,
|
|
310
311
|
},
|
|
311
312
|
},
|
|
312
313
|
{
|
|
313
314
|
props: { variant: 'outlined', color: 'grey' },
|
|
314
315
|
style: {
|
|
315
|
-
color: (
|
|
316
|
+
color: (_e = palette.text) === null || _e === void 0 ? void 0 : _e.primary,
|
|
316
317
|
borderColor: palette.mode === 'light'
|
|
317
318
|
? 'rgba(0, 0, 0, 0.23)'
|
|
318
319
|
: 'rgba(255, 255, 255, 0.23)',
|
|
319
320
|
'&.Mui-disabled': {
|
|
320
|
-
border: `1px solid ${(
|
|
321
|
+
border: `1px solid ${(_f = palette.action) === null || _f === void 0 ? void 0 : _f.disabledBackground}`,
|
|
321
322
|
},
|
|
322
323
|
'&:hover': {
|
|
323
324
|
borderColor: palette.mode === 'light'
|
|
324
325
|
? 'rgba(0, 0, 0, 0.23)'
|
|
325
326
|
: 'rgba(255, 255, 255, 0.23)',
|
|
326
|
-
backgroundColor: (0, styles_1.alpha)(((
|
|
327
|
+
backgroundColor: (0, styles_1.alpha)(((_g = palette.text) === null || _g === void 0 ? void 0 : _g.primary) || '', ((_h = palette.action) === null || _h === void 0 ? void 0 : _h.hoverOpacity) || 0.04),
|
|
327
328
|
},
|
|
328
329
|
},
|
|
329
330
|
},
|
|
330
331
|
{
|
|
331
332
|
props: { variant: 'text', color: 'grey' },
|
|
332
333
|
style: {
|
|
333
|
-
color: (
|
|
334
|
+
color: (_j = palette.text) === null || _j === void 0 ? void 0 : _j.primary,
|
|
334
335
|
'&:hover': {
|
|
335
|
-
backgroundColor: (0, styles_1.alpha)(((
|
|
336
|
+
backgroundColor: (0, styles_1.alpha)(((_k = palette.text) === null || _k === void 0 ? void 0 : _k.primary) || '', ((_l = palette.action) === null || _l === void 0 ? void 0 : _l.hoverOpacity) || 0.04),
|
|
336
337
|
},
|
|
337
338
|
},
|
|
338
339
|
},
|
package/i18n/de.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "bestimmte(r) Tag(e) der Woche",
|
|
429
429
|
"ra_Name": "Name",
|
|
430
430
|
"ra_import data from %s file": "Daten aus %s-Datei importieren",
|
|
431
|
-
"ra_Invalid JSON": "Ungültiges JSON"
|
|
431
|
+
"ra_Invalid JSON": "Ungültiges JSON",
|
|
432
|
+
"ra_Create alias": "Alias erstellen",
|
|
433
|
+
"ra_Categories": "Kategorien",
|
|
434
|
+
"ra_%s links from aliases": "%s Links von Aliasen"
|
|
432
435
|
}
|
package/i18n/en.json
CHANGED
|
@@ -409,6 +409,8 @@
|
|
|
409
409
|
"ra_Edit function": "Edit function",
|
|
410
410
|
"ra_Edit room": "Edit room",
|
|
411
411
|
"ra_Edit alias": "Edit alias",
|
|
412
|
+
"ra_Create alias": "Create alias",
|
|
413
|
+
"ra_Categories": "Categories",
|
|
412
414
|
"ra_View file": "View file",
|
|
413
415
|
"ra_Del": "Delete",
|
|
414
416
|
"ra_Show all folders": "Show all folders",
|
|
@@ -428,5 +430,6 @@
|
|
|
428
430
|
"ra_Cannot read licenses: %s": "Cannot read licenses: %s",
|
|
429
431
|
"ra_Advanced options": "Advanced options",
|
|
430
432
|
"ra_Name": "Name",
|
|
431
|
-
"ra_Invalid JSON": "Invalid JSON"
|
|
433
|
+
"ra_Invalid JSON": "Invalid JSON",
|
|
434
|
+
"ra_%s links from aliases": "%s links from aliases"
|
|
432
435
|
}
|
package/i18n/es.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "día(s) específico(s) de la semana",
|
|
429
429
|
"ra_Name": "Nombre",
|
|
430
430
|
"ra_import data from %s file": "Importar datos del archivo %s",
|
|
431
|
-
"ra_Invalid JSON": "JSON no válido"
|
|
431
|
+
"ra_Invalid JSON": "JSON no válido",
|
|
432
|
+
"ra_Create alias": "Crear alias",
|
|
433
|
+
"ra_Categories": "Categorías",
|
|
434
|
+
"ra_%s links from aliases": "%s enlaces de alias"
|
|
432
435
|
}
|
package/i18n/fr.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "jour(s) spécifique(s) de la semaine",
|
|
429
429
|
"ra_Name": "Nom",
|
|
430
430
|
"ra_import data from %s file": "Importer des données à partir du fichier %s",
|
|
431
|
-
"ra_Invalid JSON": "JSON invalide"
|
|
431
|
+
"ra_Invalid JSON": "JSON invalide",
|
|
432
|
+
"ra_Create alias": "Créer un alias",
|
|
433
|
+
"ra_Categories": "Catégories",
|
|
434
|
+
"ra_%s links from aliases": "%s liens provenant d'alias"
|
|
432
435
|
}
|
package/i18n/it.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "giorno/i specifico/i della settimana",
|
|
429
429
|
"ra_Name": "Nome",
|
|
430
430
|
"ra_import data from %s file": "Importa dati dal file %s",
|
|
431
|
-
"ra_Invalid JSON": "JSON non valido"
|
|
431
|
+
"ra_Invalid JSON": "JSON non valido",
|
|
432
|
+
"ra_Create alias": "Crea alias",
|
|
433
|
+
"ra_Categories": "Categorie",
|
|
434
|
+
"ra_%s links from aliases": "%s link da alias"
|
|
432
435
|
}
|
package/i18n/nl.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "specifieke dag(en) van de week",
|
|
429
429
|
"ra_Name": "Naam",
|
|
430
430
|
"ra_import data from %s file": "Importeer gegevens uit %s bestand",
|
|
431
|
-
"ra_Invalid JSON": "Ongeldige JSON"
|
|
431
|
+
"ra_Invalid JSON": "Ongeldige JSON",
|
|
432
|
+
"ra_Create alias": "Alias maken",
|
|
433
|
+
"ra_Categories": "Categorieën",
|
|
434
|
+
"ra_%s links from aliases": "%s links van aliassen"
|
|
432
435
|
}
|
package/i18n/pl.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "określone dni tygodnia",
|
|
429
429
|
"ra_Name": "Nazwa",
|
|
430
430
|
"ra_import data from %s file": "Importuj dane z pliku %s",
|
|
431
|
-
"ra_Invalid JSON": "Nieprawidłowy JSON"
|
|
431
|
+
"ra_Invalid JSON": "Nieprawidłowy JSON",
|
|
432
|
+
"ra_Create alias": "Utwórz alias",
|
|
433
|
+
"ra_Categories": "Kategorie",
|
|
434
|
+
"ra_%s links from aliases": "%s linków z aliasów"
|
|
432
435
|
}
|
package/i18n/pt.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "dia(s) específico(s) da semana",
|
|
429
429
|
"ra_Name": "Nome",
|
|
430
430
|
"ra_import data from %s file": "Importar dados do arquivo %s",
|
|
431
|
-
"ra_Invalid JSON": "JSON inválido"
|
|
431
|
+
"ra_Invalid JSON": "JSON inválido",
|
|
432
|
+
"ra_Create alias": "Criar alias",
|
|
433
|
+
"ra_Categories": "Categorias",
|
|
434
|
+
"ra_%s links from aliases": "%s links de aliases"
|
|
432
435
|
}
|
package/i18n/ru.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "конкретный день(а) недели",
|
|
429
429
|
"ra_Name": "Имя",
|
|
430
430
|
"ra_import data from %s file": "Импортировать данные из файла %s",
|
|
431
|
-
"ra_Invalid JSON": "Неверный JSON"
|
|
431
|
+
"ra_Invalid JSON": "Неверный JSON",
|
|
432
|
+
"ra_Create alias": "Создать псевдоним",
|
|
433
|
+
"ra_Categories": "Категории",
|
|
434
|
+
"ra_%s links from aliases": "%s ссылок из псевдонимов"
|
|
432
435
|
}
|
package/i18n/uk.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "конкретний день (дні) тижня",
|
|
429
429
|
"ra_Name": "Ім'я",
|
|
430
430
|
"ra_import data from %s file": "Імпортувати дані з файлу %s",
|
|
431
|
-
"ra_Invalid JSON": "Недійсний JSON"
|
|
431
|
+
"ra_Invalid JSON": "Недійсний JSON",
|
|
432
|
+
"ra_Create alias": "Створити псевдонім",
|
|
433
|
+
"ra_Categories": "Категорії",
|
|
434
|
+
"ra_%s links from aliases": "%s посилань із псевдонімів"
|
|
432
435
|
}
|
package/i18n/zh-cn.json
CHANGED
|
@@ -428,5 +428,8 @@
|
|
|
428
428
|
"sc_specific_dow": "一周中的特定日子",
|
|
429
429
|
"ra_Name": "姓名",
|
|
430
430
|
"ra_import data from %s file": "从 %s 文件导入数据",
|
|
431
|
-
"ra_Invalid JSON": "JSON 无效"
|
|
431
|
+
"ra_Invalid JSON": "JSON 无效",
|
|
432
|
+
"ra_Create alias": "创建别名",
|
|
433
|
+
"ra_Categories": "类别",
|
|
434
|
+
"ra_%s links from aliases": "来自别名的 %s 个链接"
|
|
432
435
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/adapter-react-v5",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "React classes to develop admin interfaces for ioBroker with react.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Denis Haev (bluefox)",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"@iobroker/types": "^6.0.11",
|
|
34
34
|
"@iobroker/js-controller-common": "^6.0.11",
|
|
35
35
|
"@iobroker/js-controller-common-db": "^6.0.11",
|
|
36
|
-
"@mui/icons-material": "^
|
|
37
|
-
"@mui/material": "^
|
|
38
|
-
"@mui/x-date-pickers": "^7.
|
|
39
|
-
"@sentry/browser": "^8.
|
|
36
|
+
"@mui/icons-material": "^6.0.2",
|
|
37
|
+
"@mui/material": "^6.0.2",
|
|
38
|
+
"@mui/x-date-pickers": "^7.16.0",
|
|
39
|
+
"@sentry/browser": "^8.29.0",
|
|
40
40
|
"cronstrue": "^2.50.0",
|
|
41
41
|
"react-color": "^2.19.3",
|
|
42
42
|
"react-colorful": "^5.6.1",
|
|
@@ -787,7 +787,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
787
787
|
}
|
|
788
788
|
|
|
789
789
|
componentWillUnmount() {
|
|
790
|
-
|
|
790
|
+
if (this.supportSubscribes) {
|
|
791
|
+
this.props.socket.unsubscribeFiles('*', '*', this.onFileChange);
|
|
792
|
+
}
|
|
791
793
|
this.mounted = false;
|
|
792
794
|
this.browseList = null;
|
|
793
795
|
this.browseListRunning = false;
|
|
@@ -879,7 +881,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
879
881
|
item.reject = null;
|
|
880
882
|
item.adapter = null;
|
|
881
883
|
item.relPath = null;
|
|
882
|
-
|
|
884
|
+
if (resolve) {
|
|
885
|
+
resolve(files);
|
|
886
|
+
}
|
|
883
887
|
this.browseListRunning = false;
|
|
884
888
|
if (this.browseList.length) {
|
|
885
889
|
if (level < 5) {
|
|
@@ -905,7 +909,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
905
909
|
item.reject = null;
|
|
906
910
|
item.adapter = null;
|
|
907
911
|
item.relPath = null;
|
|
908
|
-
|
|
912
|
+
if (reject) {
|
|
913
|
+
reject(e);
|
|
914
|
+
}
|
|
909
915
|
this.browseListRunning = false;
|
|
910
916
|
if (this.browseList.length) {
|
|
911
917
|
if (level < 5) {
|
|
@@ -1003,7 +1009,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1003
1009
|
|
|
1004
1010
|
_folders.sort((a, b) => (a.id > b.id ? 1 : (a.id < b.id ? -1 : 0)));
|
|
1005
1011
|
if (!this.limitToObjectID || this.limitToObjectID === USER_DATA) {
|
|
1006
|
-
|
|
1012
|
+
if (userData) {
|
|
1013
|
+
_folders.unshift(userData);
|
|
1014
|
+
}
|
|
1007
1015
|
}
|
|
1008
1016
|
|
|
1009
1017
|
newFoldersNotNull[folderId || '/'] = _folders;
|
|
@@ -1016,7 +1024,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1016
1024
|
.then(() => newFoldersNotNull);
|
|
1017
1025
|
}
|
|
1018
1026
|
} catch (e) {
|
|
1019
|
-
this.initialReadFinished
|
|
1027
|
+
if (this.initialReadFinished) {
|
|
1028
|
+
window.alert(`Cannot read meta items: ${e}`);
|
|
1029
|
+
}
|
|
1020
1030
|
newFoldersNotNull[folderId || '/'] = [];
|
|
1021
1031
|
}
|
|
1022
1032
|
return newFoldersNotNull;
|
|
@@ -1081,7 +1091,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1081
1091
|
.then(() => newFoldersNotNull);
|
|
1082
1092
|
}
|
|
1083
1093
|
} catch (e) {
|
|
1084
|
-
this.initialReadFinished
|
|
1094
|
+
if (this.initialReadFinished) {
|
|
1095
|
+
window.alert(`Cannot read ${adapter}${relPath ? `/${relPath}` : ''}: ${e}`);
|
|
1096
|
+
}
|
|
1085
1097
|
newFoldersNotNull[folderId] = [];
|
|
1086
1098
|
}
|
|
1087
1099
|
|
|
@@ -1123,7 +1135,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1123
1135
|
console.log(`File changed ${key}[${size}]`);
|
|
1124
1136
|
|
|
1125
1137
|
if (this.state.folders[folder]) {
|
|
1126
|
-
|
|
1138
|
+
if (this._tempTimeout[folder]) {
|
|
1139
|
+
clearTimeout(this._tempTimeout[folder]);
|
|
1140
|
+
}
|
|
1127
1141
|
|
|
1128
1142
|
this._tempTimeout[folder] = setTimeout(() => {
|
|
1129
1143
|
delete this._tempTimeout[folder];
|
|
@@ -1135,7 +1149,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1135
1149
|
};
|
|
1136
1150
|
|
|
1137
1151
|
changeFolder(e: React.MouseEvent<HTMLDivElement>, folder?: string) {
|
|
1138
|
-
|
|
1152
|
+
if (e) {
|
|
1153
|
+
e.stopPropagation();
|
|
1154
|
+
}
|
|
1139
1155
|
|
|
1140
1156
|
this.lastSelect = Date.now();
|
|
1141
1157
|
|
|
@@ -1177,7 +1193,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1177
1193
|
}
|
|
1178
1194
|
|
|
1179
1195
|
select(id: string, e?: React.MouseEvent<HTMLDivElement> | null, cb?: () => void) {
|
|
1180
|
-
|
|
1196
|
+
if (e) {
|
|
1197
|
+
e.stopPropagation();
|
|
1198
|
+
}
|
|
1181
1199
|
this.lastSelect = Date.now();
|
|
1182
1200
|
|
|
1183
1201
|
this.localStorage.setItem('files.selected', id);
|
|
@@ -1195,7 +1213,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1195
1213
|
this.props.onSelect('');
|
|
1196
1214
|
}
|
|
1197
1215
|
}
|
|
1198
|
-
|
|
1216
|
+
if (cb) {
|
|
1217
|
+
cb();
|
|
1218
|
+
}
|
|
1199
1219
|
});
|
|
1200
1220
|
}
|
|
1201
1221
|
|
|
@@ -1773,7 +1793,7 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1773
1793
|
>
|
|
1774
1794
|
<UploadIcon fontSize="small" />
|
|
1775
1795
|
</IconButton> : null}
|
|
1776
|
-
{this.props.showTypeSelector && IconType ? <Tooltip title={this.props.t('ra_Filter files')}
|
|
1796
|
+
{this.props.showTypeSelector && IconType ? <Tooltip title={this.props.t('ra_Filter files')} slotProps={{ popper: { sx: styles.tooltip } }}>
|
|
1777
1797
|
<IconButton size="small" onClick={e => this.setState({ showTypesMenu: e.target as HTMLButtonElement })}>
|
|
1778
1798
|
<IconType fontSize="small" />
|
|
1779
1799
|
</IconButton>
|
|
@@ -1810,7 +1830,10 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1810
1830
|
</MenuItem>;
|
|
1811
1831
|
})}
|
|
1812
1832
|
</Menu> : null}
|
|
1813
|
-
<Tooltip
|
|
1833
|
+
<Tooltip
|
|
1834
|
+
title={this.props.t('ra_Background image')}
|
|
1835
|
+
slotProps={{ popper: { sx: styles.tooltip } }}
|
|
1836
|
+
>
|
|
1814
1837
|
<IconButton
|
|
1815
1838
|
color="inherit"
|
|
1816
1839
|
edge="start"
|
|
@@ -1823,7 +1846,7 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1823
1846
|
</Tooltip>
|
|
1824
1847
|
{this.state.viewType !== TABLE && this.props.allowDelete ? <Tooltip
|
|
1825
1848
|
title={this.props.t('ra_Delete')}
|
|
1826
|
-
|
|
1849
|
+
slotProps={{ popper: { sx: styles.tooltip } }}
|
|
1827
1850
|
>
|
|
1828
1851
|
<span>
|
|
1829
1852
|
<IconButton
|
|
@@ -1933,7 +1956,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
1933
1956
|
}
|
|
1934
1957
|
|
|
1935
1958
|
componentDidUpdate(/* prevProps , prevState, snapshot */) {
|
|
1936
|
-
|
|
1959
|
+
if (this.setOpacityTimer) {
|
|
1960
|
+
clearTimeout(this.setOpacityTimer);
|
|
1961
|
+
}
|
|
1937
1962
|
this.setOpacityTimer = setTimeout(() => {
|
|
1938
1963
|
this.setOpacityTimer = null;
|
|
1939
1964
|
const items = window.document.getElementsByClassName('browserItem');
|
|
@@ -2259,7 +2284,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
2259
2284
|
}
|
|
2260
2285
|
});
|
|
2261
2286
|
if (changed) {
|
|
2262
|
-
|
|
2287
|
+
if (this.cacheFoldersTimeout) {
|
|
2288
|
+
clearTimeout(this.cacheFoldersTimeout);
|
|
2289
|
+
}
|
|
2263
2290
|
this.cacheFoldersTimeout = setTimeout(() => {
|
|
2264
2291
|
this.cacheFoldersTimeout = null;
|
|
2265
2292
|
const folders = this.cacheFolders || {};
|
|
@@ -2306,7 +2333,9 @@ export class FileBrowserClass extends Component<FileBrowserProps, FileBrowserSta
|
|
|
2306
2333
|
const p: string[] = [];
|
|
2307
2334
|
return <Breadcrumbs style={{ paddingLeft: 8 }}>
|
|
2308
2335
|
{parts.map((part, i) => {
|
|
2309
|
-
|
|
2336
|
+
if (part) {
|
|
2337
|
+
p.push(part);
|
|
2338
|
+
}
|
|
2310
2339
|
const path = p.join('/');
|
|
2311
2340
|
if (i < parts.length - 1) {
|
|
2312
2341
|
return <Box
|