iobroker.webui 1.20.1 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +27 -12
- package/io-package.json +27 -27
- package/package.json +14 -14
- package/www/dist/frontend/common/IobrokerHandler.d.ts +3 -2
- package/www/dist/frontend/common/IobrokerHandler.js +3 -0
- package/www/dist/frontend/config/ConfigureWebcomponentDesigner.js +5 -2
- package/www/dist/frontend/config/IobrokerWebuiSolutionExplorer.js +54 -1
- package/www/dist/frontend/generated/ScriptCommands.json +144 -108
- package/www/dist/frontend/runtime/ScreenViewer.js +8 -2
- package/www/dist/frontend/scripting/IobrokerWebuiScriptCommands.js +1 -0
- package/www/dist/frontend/scripting/IobrokerWebuiScriptSystem.js +10 -0
- package/www/dist/frontend/services/IobrokerWebuiBindableLocalObjectsService.js +46 -0
- package/www/dist/frontend/services/IobrokerWebuiBindableObjectDragDropService.js +29 -0
- package/www/dist/frontend/services/IobrokerWebuiCopyPasteService.js +1 -1
- package/www/index.html +1 -1
- package/www/node_modules/@iobroker/socket-client/dist/esm/AdminConnection.js +7 -9
- package/www/node_modules/@iobroker/socket-client/dist/esm/Connection.d.ts +3 -3
- package/www/node_modules/@iobroker/socket-client/dist/esm/Connection.js +2 -3
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/wunderbaum/dist/wunderbaum.css +545 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/wunderbaum/dist/wunderbaum.esm.js +8271 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/wunderbaum/dist/wunderbaum.esm.min.js +86 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/wunderbaum/dist/wunderbaum.umd.js +8279 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/wunderbaum/dist/wunderbaum.umd.min.js +86 -0
- package/www/node_modules/@node-projects/propertygrid.webcomponent/node_modules/wunderbaum/src/wunderbaum.scss +895 -0
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/CssCurrentPropertiesService.js +14 -10
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/propertiesService/services/CssProperties.json +0 -2
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/helpers/BindingsHelper.js +14 -13
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/scripting/ScriptSystem.js +3 -1
- package/www/node_modules/blockly/blockly_compressed.js +590 -564
- package/www/node_modules/blockly/blocks_compressed.js +34 -33
- package/www/node_modules/es-module-shims/dist/es-module-shims.js +512 -442
- package/www/node_modules/wunderbaum/dist/wunderbaum.css +10 -10
- package/www/node_modules/wunderbaum/dist/wunderbaum.esm.min.js +24 -24
- package/www/runtime.html +12 -4
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/blockly/components/fields/FieldObjectId.js +0 -6
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -21,14 +21,14 @@ This is a complete visualization system for ioBroker.
|
|
|
21
21
|
|
|
22
22
|
It includes features like:
|
|
23
23
|
|
|
24
|
-
-
|
|
24
|
+
- simple scripting language
|
|
25
25
|
- binding to ioBroker objects including converters & javascript expressions
|
|
26
|
-
-
|
|
27
|
-
- drag
|
|
28
|
-
- drag
|
|
29
|
-
- drag
|
|
30
|
-
- relative signal paths to ioBroker objects in screens (the full path can be
|
|
31
|
-
- split view
|
|
26
|
+
- pasting of images from clipboard
|
|
27
|
+
- drag&drop of external images
|
|
28
|
+
- drag&drop of ioBroker objects to automaticy create bindings
|
|
29
|
+
- drag&drop of ioBroker objects to Properties to create Bindings to them
|
|
30
|
+
- relative signal paths to ioBroker objects in screens (the full path can be handed over from outside into the screen)
|
|
31
|
+
- split view editing of layout and html code
|
|
32
32
|
- global stylesheet support
|
|
33
33
|
- usage of npm packages containing webcomponents
|
|
34
34
|
- screens inside of screens
|
|
@@ -36,6 +36,8 @@ It includes features like:
|
|
|
36
36
|
- use charts from ioBroker
|
|
37
37
|
- use combined signals object id's e.g. "webui.0.test3.{webui.0.test3.select}" -> this will use the value from webui.0.test3.select for the signal name
|
|
38
38
|
|
|
39
|
+
There is more information about specific topics in the [wiki](https://github.com/iobroker-community-adapters/ioBroker.webui/wiki) (the German section has a few more articles than the English one).
|
|
40
|
+
|
|
39
41
|
## Installation
|
|
40
42
|
|
|
41
43
|
### Dependecies
|
|
@@ -46,18 +48,20 @@ It includes features like:
|
|
|
46
48
|
|
|
47
49
|
### Description
|
|
48
50
|
|
|
49
|
-
The Designer uses
|
|
51
|
+
The Designer uses Web Components, so the HTML you design is inside of a Shadowroot of a Webcomponent. This means, you cannot style <body> or <html> inside of the Stylesheet. To style the outer Layout, use the ":host" selector.
|
|
50
52
|
This also means, you cannot use "on..." eventhandlers. Use the "@..." event assignment.
|
|
51
53
|
|
|
52
54
|
### Custom Controls in WebUI
|
|
53
55
|
|
|
54
|
-
You can create own reusable CustomControls in WebUI
|
|
56
|
+
You can create your own reusable CustomControls in WebUI, each of which can have its own Javascript, Properties and a template.
|
|
55
57
|
|
|
56
|
-
You can use Double-Bracket Syntax and Double-Curly-
|
|
58
|
+
You can use Double-Bracket Syntax and Double-Curly-Bracket Syntax of the "BaseCustomWebcomponent" to create bindings from the Template to the properties defined in the Designer. Curylbrackets create two way Bindings.
|
|
57
59
|
If you use the Bindings Dialog, you can Bind to a Property with ??Propertyname and to IoBroker Object in the Property via ?Propertyname.
|
|
58
60
|
In Scripts you can also write to Signals defined in Custom Properties.
|
|
59
61
|
|
|
60
|
-
You
|
|
62
|
+
You can include Javascript in your CustomControl or Screen.
|
|
63
|
+
In addition, you can export a function `init(instance)` wich will be called when your CustomControl will be instantiated.
|
|
64
|
+
Finally, `connected()` and `disconnected()` functions can be defined to be called when ...
|
|
61
65
|
|
|
62
66
|
## Sponsoring
|
|
63
67
|
|
|
@@ -129,6 +133,17 @@ runtime.html?screenName=screen2
|
|
|
129
133
|
Placeholder for next versions:
|
|
130
134
|
### __WORK IN PROGRESS__
|
|
131
135
|
-->
|
|
136
|
+
### 1.22.0 (2025-01-15)
|
|
137
|
+
- local signals browser
|
|
138
|
+
- style completition fixes
|
|
139
|
+
- special bindings for "ring" cameras
|
|
140
|
+
|
|
141
|
+
### 1.21.0 (2024-12-28)
|
|
142
|
+
- fix scripts with empty names on css
|
|
143
|
+
- css props with only bindings are not shown
|
|
144
|
+
- remove of css prop should remove binding?
|
|
145
|
+
- Open Screen in sub screen command
|
|
146
|
+
|
|
132
147
|
### 1.20.1 (2024-12-03)
|
|
133
148
|
- fix in designer with svgs
|
|
134
149
|
|
|
@@ -990,4 +1005,4 @@ runtime.html?screenName=screen2
|
|
|
990
1005
|
## License
|
|
991
1006
|
The MIT License (MIT)
|
|
992
1007
|
|
|
993
|
-
Copyright (c)
|
|
1008
|
+
Copyright (c) 2025 jogibear9988 <jochen.kuehner@gmx.de>
|
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "webui",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.22.0",
|
|
5
5
|
"titleLang": {
|
|
6
6
|
"en": "webui",
|
|
7
7
|
"de": "webui",
|
|
@@ -29,6 +29,32 @@
|
|
|
29
29
|
"zh-cn": "使用万维网传送器的高锰用户接口"
|
|
30
30
|
},
|
|
31
31
|
"news": {
|
|
32
|
+
"1.22.0": {
|
|
33
|
+
"en": "local signals browser\nstyle completition fixes\nspecial bindings for \"ring\" cameras",
|
|
34
|
+
"de": "lokale signale browser\nstil completition fixes\nspezielle bindungen für \"ring\"-kameras",
|
|
35
|
+
"ru": "браузер местных сигналов\nстиль комплектации\nспециальные привязки для «кольцовых» камер",
|
|
36
|
+
"pt": "navegador de sinais locais\ncorreções de conclusão de estilo\nligações especiais para câmeras \"ring\"",
|
|
37
|
+
"nl": "lokale signalenbrowser\nstijl completitie fixes\nspeciale bindingen voor \"ring\"-camera's",
|
|
38
|
+
"fr": "navigateur de signaux locaux\ncorrectifs de complétion de style\nfixations spéciales pour caméras \"ring\"",
|
|
39
|
+
"it": "browser segnali locali\nstile correzioni di completamento\nattacchi speciali per telecamere \"ring\"",
|
|
40
|
+
"es": "navegador de señales locales\nestilo completition fixes\nencuadernaciones especiales para cámaras \"ring\"",
|
|
41
|
+
"pl": "przeglądarka lokalnych sygnałów\npoprawki zakończenia stylu\nspecjalne wiązania do kamer \"ring\"",
|
|
42
|
+
"uk": "веб камера\nфіксація стилів\nспеціальні прив'язки для камер \"обручка\"",
|
|
43
|
+
"zh-cn": "本地信号浏览器\n样式补丁修正\n“环”相机的特殊装订"
|
|
44
|
+
},
|
|
45
|
+
"1.21.0": {
|
|
46
|
+
"en": "fix scripts with empty names on css\ncss props with only bindings are not shown\nremove of css prop should remove binding?\nOpen Screen in sub screen command",
|
|
47
|
+
"de": "skripte mit leeren namen auf css fixieren\ncss props mit nur bindungen sind nicht dargestellt\nentfernen css prop sollte bindung entfernen?\nBildschirm im Sub-Bildschirm-Befehl öffnen",
|
|
48
|
+
"ru": "исправить сценарии с пустыми именами на css\ncss реквизиты только связывания не показаны\nудаление css prop должно удалить связывания?\nОткрытый экран в командном пункте",
|
|
49
|
+
"pt": "corrigir scripts com nomes vazios no css\ncss adereços com apenas ligações não são mostrados\nremover de css prop deve remover a ligação?\nAbra a tela no comando sub screen",
|
|
50
|
+
"nl": "scripts herstellen met lege namen op css\ncss rekwisieten met alleen bindingen worden niet getoond\nverwijderen van css prop moet binden verwijderen?\nScherm openen in subschermcommando",
|
|
51
|
+
"fr": "corriger des scripts avec des noms vides sur css\nles accessoires css avec uniquement des fixations ne sont pas montrés\nenlever de css prop devrait supprimer la liaison?\nOuvre l'écran dans la commande sous-écran",
|
|
52
|
+
"it": "correggere gli script con nomi vuoti su css\ncss props con solo binding non sono mostrati\nrimuovere di css prop dovrebbe rimuovere il legame?\nSchermo aperto nel comando sotto schermata",
|
|
53
|
+
"es": "fijar scripts con nombres vacíos en css\ncss props with only bindings are not shown\nremover el css prop debe eliminar la unión?\nPantalla abierta en el comando sub pantalla",
|
|
54
|
+
"pl": "naprawić skrypty z pustymi nazwami na css\npropy css z tylko wiązaniami nie są wyświetlane\nusunięcie rekwizytu css powinno usunąć wiązanie?\nOtwórz ekran w komendzie podekranu",
|
|
55
|
+
"uk": "виправлено сценарії з порожніми іменами на css\ncss пропси з тільки зв'язками не показані\nприбрати css проп слід видалити зв'язок?\nВідкритий екран в командному режимі",
|
|
56
|
+
"zh-cn": "css 上的空名脚本\n未显示只装订的 cs 道具\n删除 css 道具应删除绑定吗 ?\n在子屏幕命令中打开屏幕"
|
|
57
|
+
},
|
|
32
58
|
"1.20.1": {
|
|
33
59
|
"en": "fix in designer with svgs",
|
|
34
60
|
"de": "fix in designer mit svgs",
|
|
@@ -93,32 +119,6 @@
|
|
|
93
119
|
"pl": "użyj nazwy na liście klas",
|
|
94
120
|
"uk": "ім'я користувача в класі",
|
|
95
121
|
"zh-cn": "使用分类列表中的名称"
|
|
96
|
-
},
|
|
97
|
-
"1.19.1": {
|
|
98
|
-
"en": "copy path for screens/controls",
|
|
99
|
-
"de": "kopierpfad für bildschirme/steuerungen",
|
|
100
|
-
"ru": "путь копирования для экранов/контролей",
|
|
101
|
-
"pt": "caminho de cópia para telas / controles",
|
|
102
|
-
"nl": "pad voor schermen/besturing kopiëren",
|
|
103
|
-
"fr": "chemin de copie pour les écrans/contrôles",
|
|
104
|
-
"it": "copiare il percorso per schermi/controlli",
|
|
105
|
-
"es": "copy path para pantallas/controles",
|
|
106
|
-
"pl": "ścieżka kopiowania ekranów / urządzeń sterujących",
|
|
107
|
-
"uk": "копіювання шляху до екранів/контролів",
|
|
108
|
-
"zh-cn": "屏幕/控件复制路径"
|
|
109
|
-
},
|
|
110
|
-
"1.19.0": {
|
|
111
|
-
"en": "fix error in script system",
|
|
112
|
-
"de": "fehler im skriptsystem beheben",
|
|
113
|
-
"ru": "исправление ошибки в системе сценариев",
|
|
114
|
-
"pt": "corrigir erro no sistema de script",
|
|
115
|
-
"nl": "fix error in script systeem",
|
|
116
|
-
"fr": "correction d'erreur dans le système de script",
|
|
117
|
-
"it": "errore di correzione nel sistema di script",
|
|
118
|
-
"es": "corregir error en el sistema script",
|
|
119
|
-
"pl": "naprawić błąd w systemie skryptu",
|
|
120
|
-
"uk": "виправлено помилку в системі скриптів",
|
|
121
|
-
"zh-cn": "修补脚本系统错误"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"icon": "logo.png",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.webui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "ioBroker webui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/backend/main.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"coverage": "nyc npm run test:ts",
|
|
21
21
|
"lint": "eslint --ext .ts src/",
|
|
22
22
|
"reflection": "npm run reflection-scripts && npm run reflection-props",
|
|
23
|
-
"reflection-scripts": "cross-env typescript-json-schema './
|
|
23
|
+
"reflection-scripts": "cross-env typescript-json-schema './dist/frontend/scripting/IobrokerWebuiScriptCommands.d.ts' '*' --ignoreErrors --strictNullChecks --propOrder > ./src/frontend/generated/ScriptCommands.json",
|
|
24
24
|
"reflection-props": "cp ./node_modules/@node-projects/web-component-designer-visualization-addons/dist/interfaces/IScriptMultiplexValue.d.ts ./src/frontend/interfaces/ && cross-env typescript-json-schema './src/frontend/interfaces/*.ts' '*' --ignoreErrors --strictNullChecks --propOrder > ./src/frontend/generated/Properties.json",
|
|
25
25
|
"release": "release-script"
|
|
26
26
|
},
|
|
@@ -43,31 +43,31 @@
|
|
|
43
43
|
"node": ">=18"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@iobroker/adapter-core": "^3.2.
|
|
47
|
-
"@types/node": "^22.10.
|
|
46
|
+
"@iobroker/adapter-core": "^3.2.3",
|
|
47
|
+
"@types/node": "^22.10.6"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@adobe/css-tools": "4.4.1",
|
|
51
51
|
"@alcalzone/release-script": "^3.8.0",
|
|
52
52
|
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
|
|
53
53
|
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
54
|
-
"@blockly/zoom-to-fit": "^6.0.
|
|
55
|
-
"@iobroker/socket-client": "^
|
|
54
|
+
"@blockly/zoom-to-fit": "^6.0.12",
|
|
55
|
+
"@iobroker/socket-client": "^4.0.0",
|
|
56
56
|
"@iobroker/testing": "^5.0.0",
|
|
57
57
|
"@node-projects/base-custom-webcomponent": "0.27.8",
|
|
58
58
|
"@node-projects/lean-he-esm": "^3.3.0",
|
|
59
59
|
"@node-projects/node-html-parser-esm": "^6.2.0",
|
|
60
60
|
"@node-projects/propertygrid.webcomponent": "^1.2.3",
|
|
61
61
|
"@node-projects/splitview.webcomponent": "^1.0.1",
|
|
62
|
-
"@node-projects/web-component-designer": "^0.1.
|
|
62
|
+
"@node-projects/web-component-designer": "^0.1.237",
|
|
63
63
|
"@node-projects/web-component-designer-codeview-monaco": "^0.1.32",
|
|
64
64
|
"@node-projects/web-component-designer-htmlparserservice-nodehtmlparser": "^0.1.11",
|
|
65
65
|
"@node-projects/web-component-designer-stylesheetservice-css-tools": "^0.1.10",
|
|
66
|
-
"@node-projects/web-component-designer-visualization-addons": "^0.1.
|
|
66
|
+
"@node-projects/web-component-designer-visualization-addons": "^0.1.103",
|
|
67
67
|
"@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.31",
|
|
68
68
|
"@types/json-schema": "^7.0.15",
|
|
69
69
|
"@web/dev-server": "^0.4.6",
|
|
70
|
-
"blockly": "^11.
|
|
70
|
+
"blockly": "^11.2.0",
|
|
71
71
|
"chai": "^5.1.2",
|
|
72
72
|
"chai-as-promised": "^8.0.1",
|
|
73
73
|
"construct-style-sheets-polyfill": "^3.1.0",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"dayjs": "^1.11.13",
|
|
76
76
|
"del": "^8.0.0",
|
|
77
77
|
"dock-spawn-ts": "^3.2.1",
|
|
78
|
-
"es-module-shims": "^
|
|
79
|
-
"eslint": "^9.
|
|
78
|
+
"es-module-shims": "^2.0.3",
|
|
79
|
+
"eslint": "^9.18.0",
|
|
80
80
|
"esprima-next": "^6.0.3",
|
|
81
81
|
"gulp": "^5.0.0",
|
|
82
82
|
"gulp-git": "^2.11.0",
|
|
83
83
|
"gulp-replace": "^1.1.4",
|
|
84
|
-
"long": "^5.2.
|
|
84
|
+
"long": "^5.2.4",
|
|
85
85
|
"mobile-drag-drop": "^3.0.0-rc.0",
|
|
86
86
|
"mocha": "^11.0.1",
|
|
87
87
|
"monaco-editor": "^0.50.0",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"toastify-js": "^1.12.0",
|
|
91
91
|
"ts-node": "^10.9.2",
|
|
92
92
|
"tslib": "^2.8.1",
|
|
93
|
-
"typescript": "^5.7.
|
|
93
|
+
"typescript": "^5.7.3",
|
|
94
94
|
"typescript-json-schema": "^0.65.1",
|
|
95
|
-
"wunderbaum": "0.
|
|
95
|
+
"wunderbaum": "0.12.0"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -75,6 +75,7 @@ export declare class IobrokerHandler implements VisualizationHandler {
|
|
|
75
75
|
file: ArrayBuffer;
|
|
76
76
|
}>;
|
|
77
77
|
removeAdditionalFile(name: string): Promise<void>;
|
|
78
|
+
getLocalStateNames(): string[];
|
|
78
79
|
subscribeState(id: string, cb: ioBroker.StateChangeHandler): Promise<void>;
|
|
79
80
|
unsubscribeState(id: string, cb: ioBroker.StateChangeHandler): void;
|
|
80
81
|
getObjectList(type: ioBroker.ObjectType, id: string): Promise<Record<string, ioBroker.AnyObject & {
|
|
@@ -95,8 +96,8 @@ export declare class IobrokerHandler implements VisualizationHandler {
|
|
|
95
96
|
getSignalInformation(signal: any): SignalInformation;
|
|
96
97
|
getHistoricData(id: string, config: any): Promise<{
|
|
97
98
|
values: ioBroker.GetHistoryResult;
|
|
98
|
-
sessionId:
|
|
99
|
-
|
|
99
|
+
sessionId: number;
|
|
100
|
+
step: number;
|
|
100
101
|
}>;
|
|
101
102
|
}
|
|
102
103
|
export declare const iobrokerHandler: IobrokerHandler;
|
|
@@ -336,6 +336,9 @@ export class IobrokerHandler {
|
|
|
336
336
|
}
|
|
337
337
|
#localSubscriptions = new Map;
|
|
338
338
|
#localValues = new Map;
|
|
339
|
+
getLocalStateNames() {
|
|
340
|
+
return Array.from(this.#localSubscriptions.keys());
|
|
341
|
+
}
|
|
339
342
|
async subscribeState(id, cb) {
|
|
340
343
|
if (id.startsWith('local_')) {
|
|
341
344
|
let arr = this.#localSubscriptions.get(id);
|
|
@@ -2,7 +2,7 @@ import { BaseCustomWebcomponentBindingsService, EventsService, JsonFileElementsS
|
|
|
2
2
|
import { NodeHtmlParserService } from '@node-projects/web-component-designer-htmlparserservice-nodehtmlparser';
|
|
3
3
|
import { CodeViewMonaco } from '@node-projects/web-component-designer-codeview-monaco';
|
|
4
4
|
import { CssToolsStylesheetService } from '@node-projects/web-component-designer-stylesheetservice-css-tools';
|
|
5
|
-
import {
|
|
5
|
+
import { BindingsEditor, VisualizationBindingsService, PropertyGridDragDropService, ScriptRefactorService, VisualizationBindingsRefactorService } from "@node-projects/web-component-designer-visualization-addons";
|
|
6
6
|
import { IobrokerWebuiBindableObjectsService } from "../services/IobrokerWebuiBindableObjectsService.js";
|
|
7
7
|
import { IobrokerWebuiDemoProviderService } from "../services/IobrokerWebuiDemoProviderService.js";
|
|
8
8
|
import { IobrokerWebuiConfirmationWrapper } from "./IobrokerWebuiConfirmationWrapper.js";
|
|
@@ -20,13 +20,16 @@ import { IobrokerWebuiScreenContextMenu } from "../services/IobrokerWebuiScreenC
|
|
|
20
20
|
import { IobrokerWebuiEventsService } from "../services/IobrokerWebuiEventsService.js";
|
|
21
21
|
import { IobrokerWebuiCustomControlEventsService } from "../services/IobrokerWebuiCustomControlEventsService.js";
|
|
22
22
|
import { IobrokerWebuiBindableObjectsForPropertiesService } from "../services/IobrokerWebuiBindableObjectsForPropertiesService.js";
|
|
23
|
+
import { IobrokerWebuiBindableLocalObjectsService } from "../services/IobrokerWebuiBindableLocalObjectsService.js";
|
|
24
|
+
import { IobrokerWebuiBindableObjectDragDropService } from "../services/IobrokerWebuiBindableObjectDragDropService.js";
|
|
23
25
|
export function configureDesigner(bindingsHelper) {
|
|
24
26
|
const serviceContainer = createDefaultServiceContainer();
|
|
25
27
|
serviceContainer.register("bindingService", new BaseCustomWebcomponentBindingsService());
|
|
26
28
|
serviceContainer.register("htmlParserService", new NodeHtmlParserService());
|
|
27
29
|
serviceContainer.register("bindableObjectsService", new IobrokerWebuiBindableObjectsService());
|
|
30
|
+
serviceContainer.register("bindableObjectsService", new IobrokerWebuiBindableLocalObjectsService());
|
|
28
31
|
serviceContainer.register("bindableObjectsService", new IobrokerWebuiBindableObjectsForPropertiesService());
|
|
29
|
-
serviceContainer.register("bindableObjectDragDropService", new
|
|
32
|
+
serviceContainer.register("bindableObjectDragDropService", new IobrokerWebuiBindableObjectDragDropService(bindingsHelper, iobrokerHandler));
|
|
30
33
|
serviceContainer.register("bindingService", new VisualizationBindingsService(bindingsHelper));
|
|
31
34
|
serviceContainer.register("demoProviderService", new IobrokerWebuiDemoProviderService());
|
|
32
35
|
serviceContainer.register("externalDragDropService", new IobrokerWebuiExternalDragDropService());
|
|
@@ -74,7 +74,7 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
74
74
|
this._createAdditionalFilesNode(),
|
|
75
75
|
this._createChartsNode(),
|
|
76
76
|
this._createIconsFolderNode(),
|
|
77
|
-
this.
|
|
77
|
+
this._createBindablesNode()
|
|
78
78
|
]);
|
|
79
79
|
return result.map(x => x.status == 'fulfilled' ? x.value : null);
|
|
80
80
|
}
|
|
@@ -726,6 +726,18 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
726
726
|
}
|
|
727
727
|
return controlsNode;
|
|
728
728
|
}
|
|
729
|
+
async _createBindablesNode() {
|
|
730
|
+
const node = {
|
|
731
|
+
title: 'Bindables',
|
|
732
|
+
folder: true,
|
|
733
|
+
lazy: true,
|
|
734
|
+
children: [
|
|
735
|
+
await this._createObjectsNode(),
|
|
736
|
+
await this._createLocalsNode()
|
|
737
|
+
]
|
|
738
|
+
};
|
|
739
|
+
return node;
|
|
740
|
+
}
|
|
729
741
|
async _createObjectsNode() {
|
|
730
742
|
const s = this.serviceContainer.bindableObjectsServices[0];
|
|
731
743
|
const objectsNode = {
|
|
@@ -778,6 +790,47 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
778
790
|
lazyload: (event, data) => this._lazyLoadObjectNodes(event, data)
|
|
779
791
|
}));
|
|
780
792
|
}
|
|
793
|
+
async _createLocalsNode() {
|
|
794
|
+
//Todo: reset lazy load on colapse in local nodes view
|
|
795
|
+
const s = this.serviceContainer.bindableObjectsServices[1];
|
|
796
|
+
const objectsNode = {
|
|
797
|
+
title: 'Locals',
|
|
798
|
+
data: { service: s },
|
|
799
|
+
folder: true,
|
|
800
|
+
lazy: true,
|
|
801
|
+
key: 'locals',
|
|
802
|
+
lazyload: (event, data) => this._lazyLoadObjectNodes(event, data),
|
|
803
|
+
contextMenu: (event) => {
|
|
804
|
+
ContextMenu.show([{
|
|
805
|
+
title: 'Refresh', action: async () => {
|
|
806
|
+
s.clearCache();
|
|
807
|
+
const objectsNode = this._tree.findKey('locals');
|
|
808
|
+
if (objectsNode) {
|
|
809
|
+
objectsNode.resetLazy();
|
|
810
|
+
await sleep(50);
|
|
811
|
+
objectsNode.setExpanded(true);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}, {
|
|
815
|
+
title: 'Add local', action: async () => {
|
|
816
|
+
let nm = prompt('new local variable name (without local_ prefix) :');
|
|
817
|
+
if (nm) {
|
|
818
|
+
if (!nm.startsWith('local_'))
|
|
819
|
+
nm = "local_" + nm;
|
|
820
|
+
const cb = () => { };
|
|
821
|
+
iobrokerHandler.subscribeState(nm, cb);
|
|
822
|
+
iobrokerHandler.unsubscribeState(nm, cb);
|
|
823
|
+
const objectsNode = this._tree.findKey('locals');
|
|
824
|
+
objectsNode.resetLazy();
|
|
825
|
+
await sleep(50);
|
|
826
|
+
objectsNode.setExpanded(true);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
}], event);
|
|
830
|
+
},
|
|
831
|
+
};
|
|
832
|
+
return objectsNode;
|
|
833
|
+
}
|
|
781
834
|
#activeLazyLoads = new Set();
|
|
782
835
|
async _loadTree() {
|
|
783
836
|
let dndSourceNode = null;
|