iobroker.admin 7.7.22 → 7.7.26
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 +43 -37
- package/admin/jsonConfig.json5 +1 -0
- package/adminWww/assets/{AdapterUpdateDialog-o9AXiJmD.js → AdapterUpdateDialog-yNgFjE1o.js} +1 -1
- package/adminWww/assets/{Adapters-RtNAutnt.js → Adapters-BtNFnxCJ.js} +2 -2
- package/adminWww/assets/Config-sMcJlq21.js +1 -0
- package/adminWww/assets/{CustomModal-DNnnlFgr.js → CustomModal-0o4IxcLS.js} +1 -1
- package/adminWww/assets/CustomTab-AUuHabFy.js +1 -0
- package/adminWww/assets/{DefaultPropsProvider-B5c2OG2z.js → DefaultPropsProvider-fAJulk6t.js} +1 -1
- package/adminWww/assets/EasyMode-CqUYygqL.js +1 -0
- package/adminWww/assets/{Enums-Cwo4Pepw.js → Enums-Wn6A_3T2.js} +2 -2
- package/adminWww/assets/{Fields-CaO6CcAz.js → Fields-EQW3YVW9.js} +1 -1
- package/adminWww/assets/Files-Bsm_NQWp.js +1 -0
- package/adminWww/assets/{Google-BIQTgBYl.js → Google-pvA-zt6c.js} +1 -1
- package/adminWww/assets/{Hosts-DuOGpp9N.js → Hosts-BNO62G-2.js} +4 -4
- package/adminWww/assets/Instances-CdJF4wl7.js +2 -0
- package/adminWww/assets/Intro-2owNMmCe.js +2 -0
- package/adminWww/assets/Logs-BC-J1zA-.js +1 -0
- package/adminWww/assets/{Objects-BQRHLall.js → Objects-Cz5z8r2u.js} +109 -109
- package/adminWww/assets/{State-DGRrEcKl.js → State-GyY9wyOT.js} +1 -1
- package/adminWww/assets/TextField-DSIv0GLu.js +139 -0
- package/adminWww/assets/{ThemeProvider-DNQViEu4.js → ThemeProvider-CI3x2Phd.js} +3 -3
- package/adminWww/assets/Users-DhCmxunx.js +1 -0
- package/adminWww/assets/{ace-CYt3t_cI.js → ace-B1WbEy8J.js} +2 -2
- package/adminWww/assets/assertThisInitialized-ChXZRqZI.js +1 -0
- package/adminWww/assets/blue-CagzI6CQ.js +1 -0
- package/adminWww/assets/{bootstrap-D0MQDxWO.js → bootstrap-B0ym92tp.js} +43 -43
- package/adminWww/assets/createSvgIcon-DxrIPjze.js +1 -0
- package/adminWww/assets/createTheme-CUQsQ-Ay.js +8 -0
- package/adminWww/assets/defaultTheme-DElBoCBJ.js +1 -0
- package/adminWww/assets/{emotion-react.browser.esm-D7Jkuj04.js → emotion-react.browser.esm-DrKG52pD.js} +1 -1
- package/adminWww/assets/{emotion-styled.browser.esm-DiyVJA3e.js → emotion-styled.browser.esm-DOdpWCne.js} +1 -1
- package/adminWww/assets/{emotion-use-insertion-effect-with-fallbacks.browser.esm-CT5_vd4A.js → emotion-use-insertion-effect-with-fallbacks.browser.esm-D9zECpgL.js} +1 -1
- package/adminWww/assets/{ext-language_tools-DvQi7Kc6.js → ext-language_tools-BqKBvfbG.js} +12 -12
- package/adminWww/assets/hostInit-OBG53iVO.js +1 -1
- package/adminWww/assets/{iconBase-BMCY-5uR.js → iconBase-2IlPecPg.js} +1 -1
- package/adminWww/assets/{index-Cbs1Z9rf.js → index-BNf_ih1Z.js} +5 -5
- package/adminWww/assets/index-BiffItm1.js +5 -0
- package/adminWww/assets/index-BmtEARo0.js +2 -0
- package/adminWww/assets/index-CCNrf5yA.js +1 -0
- package/adminWww/assets/{index-JBsfqF-I.js → index-CGMVO6mE.js} +6 -6
- package/adminWww/assets/{index-Br2ooWaK.js → index-Cy4zkLZ7.js} +1 -1
- package/adminWww/assets/{index-Bxw-ODqg.js → index-Czs89esz.js} +1 -1
- package/adminWww/assets/index-CztlSU9L.js +1 -0
- package/adminWww/assets/{index-B9Xws5c8.js → index-D4duMcFr.js} +14 -14
- package/adminWww/assets/{index-B3nnrPBm.js → index-DO54fzHx.js} +7 -7
- package/adminWww/assets/{index-xTVnYbA-.js → index-DrKV183R.js} +1 -1
- package/adminWww/assets/{index-Dv2K4Q6g.js → index-VyvVCiN5.js} +1 -1
- package/adminWww/assets/{index-Dzf1aL_r.js → index-Zog04pZd.js} +4 -4
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-Bmlw3SWO.js → iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BywLg1Xe.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-l9PIpaYN.js → iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js} +1 -1
- package/adminWww/assets/iobroker_admin__loadShare___mf_0_iobroker_mf_1_dm_mf_2_gui_mf_2_components__loadShare__-BrYTa8Jk.js +1 -0
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-CwWFvDsz.js → iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-CpA7pnS5.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-DzaajawM.js → iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__prop_mf_2_types__loadShare__-D6ndp5Ca.js → iobroker_admin__loadShare__prop_mf_2_types__loadShare__-C8VwgmPM.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-CHPuozrV.js → iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js} +1 -1
- package/adminWww/assets/iobroker_admin__loadShare__react_mf_2_dom__loadShare__-CVeAXnkk.js +1 -0
- package/adminWww/assets/{iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-R1iI-8qU.js → iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-CwjnV48g.js} +1 -1
- package/adminWww/assets/{iobroker_admin__mf_v__runtimeInit__mf_v__-Bo09dU7H.js → iobroker_admin__mf_v__runtimeInit__mf_v__-g2X2zhAf.js} +2 -2
- package/adminWww/assets/pl-D9B-runF.js +1 -0
- package/adminWww/assets/sdk-CcTtwqWG.js +15 -0
- package/adminWww/assets/{sentry-frxKf5Le.js → sentry-B0qhbc78.js} +1 -1
- package/adminWww/assets/useTheme-BmJ1xpF_.js +1 -0
- package/adminWww/assets/{useTheme-Dh221hBT.js → useTheme-jgYB_iM6.js} +1 -1
- package/adminWww/assets/{zh-cn-DVF2k9yq.js → zh-cn-nUtvS7Wc.js} +2 -2
- package/adminWww/index.html +2 -2
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry.js +2 -2
- package/io-package.json +28 -28
- package/package.json +9 -9
- package/adminWww/assets/Config-Cz5Tb3cJ.js +0 -1
- package/adminWww/assets/CustomTab-DiclrWUo.js +0 -1
- package/adminWww/assets/DefaultPropsProvider-Be8JLp04.js +0 -1
- package/adminWww/assets/EasyMode-BRCn4Bbc.js +0 -1
- package/adminWww/assets/Files-n4TFe3SC.js +0 -1
- package/adminWww/assets/FilledInput-DJRgejyV.js +0 -2
- package/adminWww/assets/Instances-qkFbHG3P.js +0 -2
- package/adminWww/assets/Intro-Cb9spCqV.js +0 -2
- package/adminWww/assets/Logs-746_DK7u.js +0 -1
- package/adminWww/assets/TextField-x1mERwLV.js +0 -138
- package/adminWww/assets/Users-CATatmLk.js +0 -1
- package/adminWww/assets/assertThisInitialized-DlYvfVN2.js +0 -1
- package/adminWww/assets/createSvgIcon-LuwKX81Z.js +0 -1
- package/adminWww/assets/createTheme-DNmjkp0E.js +0 -8
- package/adminWww/assets/defaultTheme-BZCCD40Q.js +0 -1
- package/adminWww/assets/en-US-B8gg5zk_.js +0 -1
- package/adminWww/assets/geosearch.module-BFmd1ZqL.js +0 -1
- package/adminWww/assets/index-C0PKj09v.js +0 -1
- package/adminWww/assets/index-CIIyyQHu.js +0 -5
- package/adminWww/assets/index-DYnXRmiP.js +0 -1
- package/adminWww/assets/index-DjFNRINs.js +0 -2
- package/adminWww/assets/iobroker_admin__loadShare__leaflet__loadShare__-CNY9K2NI.js +0 -1
- package/adminWww/assets/iobroker_admin__loadShare__react_mf_2_dom__loadShare__-ADPrxhQ_.js +0 -1
- package/adminWww/assets/leaflet-src-B651YTWC.js +0 -1
- package/adminWww/assets/locale-ZVMVA5rz.js +0 -1
- package/adminWww/assets/pl-Dnnja0cD.js +0 -1
- package/adminWww/assets/sdk-CbFERf4v.js +0 -15
- package/adminWww/assets/useTheme-Dbv7x_lT.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2014-
|
|
3
|
+
Copyright (c) 2014-2026 bluefox <dogafox@gmail.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
User interface for configuration and administration of ioBroker.
|
|
14
14
|
|
|
15
|
-
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
|
|
15
|
+
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information on how to disable the error reporting, see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
|
|
16
16
|
|
|
17
17
|
## JSON config schema
|
|
18
18
|
|
|
@@ -30,18 +30,18 @@ The JSON config schema description can be found at [JSON config schema](/package
|
|
|
30
30
|
|
|
31
31
|
## Scheduled restart
|
|
32
32
|
|
|
33
|
-
Some adapters are not stable or connection disappears after one or two days.
|
|
33
|
+
Some adapters are not stable, or the connection disappears after one or two days.
|
|
34
34
|
To fix this, there is a scheduled restart setting.
|
|
35
35
|
To activate scheduled restart, just define CRON condition when to restart adapter.
|
|
36
36
|
|
|
37
|
-
It is suggested to restart in the night, when no one
|
|
37
|
+
It is suggested to restart in the night, when no one uses the adapter, e.g. `0 3 * * *` - at 3:00 every day.
|
|
38
38
|
|
|
39
39
|
## Let's Encrypt Certificates
|
|
40
40
|
|
|
41
41
|
To manage and update, let's encrypt certificates you need to use [`iobroker.acme`](https://github.com/iobroker-community-adapters/ioBroker.acme) adapter.
|
|
42
42
|
|
|
43
43
|
You will have so-called "collections" of certificates. Each collection has its own domains.
|
|
44
|
-
You can select in configuration of admin adapter if and which collection to use.
|
|
44
|
+
You can select in the configuration of the admin adapter if and which a collection to use.
|
|
45
45
|
|
|
46
46
|
## Simple instance's settings page
|
|
47
47
|
|
|
@@ -56,7 +56,7 @@ If this option is disabled, the simple configuration page could be accessed unde
|
|
|
56
56
|
|
|
57
57
|
Please be sure that you forward not only the http/https requests, but the web-socket traffic too. It is essential for communication.
|
|
58
58
|
|
|
59
|
-
From version 6.1.0 you have the possibility to tune intro page for usage with reverse proxy.
|
|
59
|
+
From version 6.1.0 you have the possibility to tune the intro page for usage with reverse proxy.
|
|
60
60
|
|
|
61
61
|
### Example
|
|
62
62
|
|
|
@@ -66,7 +66,7 @@ And you set up e.g., nginx to forward the requests to the `http://local-iobroker
|
|
|
66
66
|
The same is with your web instance: `https://iobroker.mydomain.com/ioBrokerWeb/ => http://local-iobroker.IP:8082`.
|
|
67
67
|
And with rest-api instance: `https://iobroker.mydomain.com/ioBrokerAPI/ => http://local-iobroker.IP:8093`.
|
|
68
68
|
|
|
69
|
-
You can add the following lines into Reverse Proxy tab to let Intro tab run behind reverse proxy properly:
|
|
69
|
+
You can add the following lines into the Reverse Proxy tab to let the Intro tab run behind the reverse proxy properly:
|
|
70
70
|
|
|
71
71
|
| Global path | Instance | Instance path behind proxy |
|
|
72
72
|
|-------------------|---------------|----------------------------|
|
|
@@ -91,26 +91,36 @@ Map the public root (or a dedicated host like `https://iobroker.example.com/`) d
|
|
|
91
91
|
|
|
92
92
|
#### 2. Custom locations for other services
|
|
93
93
|
|
|
94
|
-
Add additional custom locations for web / REST / other adapter frontends. Each location forwards to the respective local port (e.g. web.0 on 8082, rest-api.0 on 8093):
|
|
94
|
+
Add additional custom locations for web / REST / other adapter frontends. Each location forwards to the respective local port (e.g. `web.0` on 8082, rest-api.0 on 8093):
|
|
95
95
|
|
|
96
96
|
<img src="assets/revproxy_nginxpm_customlocations.png" alt="Nginx Proxy Manager: custom locations" width="640" />
|
|
97
97
|
|
|
98
98
|
Example custom locations (Nginx style):
|
|
99
99
|
```
|
|
100
|
-
/
|
|
101
|
-
/
|
|
102
|
-
/
|
|
100
|
+
/web/ => http://LOCAL_IOBROKER_IP:8082/
|
|
101
|
+
/welcome/ => http://LOCAL_IOBROKER_IP:PORT_CONFIGURED_IN_WELCOME_INSTANCE_SETTINGS/
|
|
102
|
+
/esphome/ => http://LOCAL_IOBROKER_IP:6052/
|
|
103
|
+
```
|
|
104
|
+
If you have views imported from vis into vis-2, it is possible images / ... are still used from the old vis path.
|
|
105
|
+
In this case (or to be on the safe side - just also configuring them should not break other things) you probably also want to add these locations (NOTE: no trailing / here!):
|
|
106
|
+
```
|
|
107
|
+
/vis.0 => http://LOCAL_IOBROKER_IP:8082
|
|
108
|
+
/vis/widgets => http://LOCAL_IOBROKER_IP:8082
|
|
109
|
+
/vis-2/widgets => http://LOCAL_IOBROKER_IP:8082
|
|
110
|
+
/icons-mfd-svg => http://LOCAL_IOBROKER_IP:8082
|
|
111
|
+
/icons-material-png => http://LOCAL_IOBROKER_IP:8082
|
|
103
112
|
```
|
|
104
113
|
(Adjust paths/ports for your environment.)
|
|
105
114
|
|
|
106
|
-
#### 3. Configure mappings in Admin Reverse Proxy tab
|
|
115
|
+
#### 3. Configure mappings in the Admin Reverse Proxy tab
|
|
107
116
|
|
|
108
|
-
Enter the same paths so that Intro / Instances pages rewrite adapter links correctly:
|
|
117
|
+
Enter the same paths so that Intro / Instances pages rewrite adapter links correctly. Also add paths for all adapters running as web extension (like rest-api, ...). Obviously, you only need to configure what you are actually using. Here are some examples:
|
|
109
118
|
|
|
110
119
|
| Global path | Instance | Instance path behind proxy |
|
|
111
120
|
|-------------|--------------|----------------------------|
|
|
112
121
|
| `/` | `web.0` | `/web/` |
|
|
113
|
-
| | `
|
|
122
|
+
| | `welcome.0` | `/welcome/` |
|
|
123
|
+
| | `rest-api.0` | `/web/rest-api/` |
|
|
114
124
|
| | `esphome.0` | `/esphome/` |
|
|
115
125
|
|
|
116
126
|
> If you keep Admin on `/` you usually do not need to list `admin.0`, but adding it does not hurt and can make intent explicit.
|
|
@@ -125,26 +135,26 @@ After saving, the Intro screen rewrites links so that all web‑served adapters
|
|
|
125
135
|
* Adapter path awareness: Not every adapter UI is currently path‑aware. While generic `localLink` rewriting covers many cases, some UIs still assume they are hosted at the domain root. Known examples:
|
|
126
136
|
* `vis` (classic) – NOT fully working behind a sub‑path today.
|
|
127
137
|
* `vis-2` – generally more path tolerant, but custom widgets or legacy resources may still use absolute paths.
|
|
128
|
-
* Any adapter serving hard‑coded absolute URLs (starting with `/`) may need manual fixes until updated upstream.
|
|
138
|
+
* Any adapter serving hard‑coded absolute URLs (starting with `/`) may need manual fixes until updated upstream. Please open issues in the respective adapter repositories to notify maintainers.
|
|
129
139
|
* Mixed content: If you terminate TLS at the proxy (HTTPS) but contact adapters over HTTP internally, make sure all external links are rewritten to HTTPS to avoid browser mixed-content blocks.
|
|
130
140
|
* WebSocket forwarding: Ensure `Upgrade` and `Connection` headers are passed through. In Nginx, this typically means adding:
|
|
131
141
|
```
|
|
132
142
|
proxy_set_header Upgrade $http_upgrade;
|
|
133
143
|
proxy_set_header Connection "upgrade";
|
|
134
144
|
```
|
|
135
|
-
(
|
|
136
|
-
* Trailing slashes:
|
|
137
|
-
|
|
145
|
+
(or checking the websocket support box, if using proxy manager)
|
|
146
|
+
* Trailing slashes: Often a trailing slash in the mapped path (e.g. `/web/`) and location are required for path unaware adapters.
|
|
147
|
+
Then nginx does path rewriting, which makes most cases like the welcome adapter above work, because it only sees a / path -> correctly serves its index.html.
|
|
138
148
|
|
|
139
149
|
#### 5. Quick troubleshooting checklist
|
|
140
150
|
|
|
141
|
-
| Symptom | Likely cause | Action
|
|
142
|
-
|
|
143
|
-
| Blank or partial Admin UI | Admin mounted under sub‑path only | Keep Admin at `/` (see limitation)
|
|
144
|
-
| Adapter link opens wrong host/port | Missing entry in Reverse Proxy tab | Add mapping row and save
|
|
145
|
-
| 404 for adapter JS/CSS | Missing trailing slash in location | Add trailing slash to location and mapping
|
|
146
|
-
| WebSocket errors in console | Proxy not forwarding upgrade headers | Add `proxy_set_header Upgrade` / `Connection` headers
|
|
147
|
-
|
|
|
151
|
+
| Symptom | Likely cause | Action |
|
|
152
|
+
|------------------------------------|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
153
|
+
| Blank or partial Admin UI | Admin mounted under sub‑path only | Keep Admin at `/` (see limitation) |
|
|
154
|
+
| Adapter link opens wrong host/port | Missing entry in Reverse Proxy tab | Add mapping row and save |
|
|
155
|
+
| 404 for adapter JS/CSS | Missing trailing slash in location | Add trailing slash to location and mapping |
|
|
156
|
+
| WebSocket errors in console | Proxy not forwarding upgrade headers | Add `proxy_set_header Upgrade` / `Connection` headers |
|
|
157
|
+
| other (loading) issue | Adapter not path‑aware | Keep on root or wait for adapter update. Please open an issue in the adapters repository so the maintainers are aware about it and the issue can be tracked. |
|
|
148
158
|
|
|
149
159
|
## Used icons
|
|
150
160
|
|
|
@@ -157,8 +167,15 @@ The icons may not be reused in other projects without the proper flaticon licens
|
|
|
157
167
|
<!--
|
|
158
168
|
### **WORK IN PROGRESS**
|
|
159
169
|
-->
|
|
170
|
+
### 7.7.26 (2026-02-08)
|
|
171
|
+
- (@GermanBluefox) Added iframe support for JSON Config
|
|
172
|
+
|
|
173
|
+
### 7.7.23 (2026-01-27)
|
|
174
|
+
- (@GermanBluefox) Added support of device manager in the admin tabs
|
|
175
|
+
- (@GermanBluefox) Corrected JSON Config issues
|
|
176
|
+
|
|
160
177
|
### 7.7.22 (2025-12-15)
|
|
161
|
-
- (@GermanBluefox) Layout fix in edit object dialog
|
|
178
|
+
- (@GermanBluefox) Layout fix in the edit object dialog
|
|
162
179
|
|
|
163
180
|
### 7.7.20 (2025-11-15)
|
|
164
181
|
- (@GermanBluefox) Small optimizations
|
|
@@ -167,19 +184,8 @@ The icons may not be reused in other projects without the proper flaticon licens
|
|
|
167
184
|
### 7.7.19 (2025-10-26)
|
|
168
185
|
- (@GermanBluefox) Updated schema location for JsonConfig
|
|
169
186
|
|
|
170
|
-
### 7.7.18 (2025-10-25)
|
|
171
|
-
- (@GermanBluefox) Improvement of categories: drag&drop, visibility
|
|
172
|
-
- (@copilot) Added missing filterFunc property to jsonConfig objectId schema to match documentation and implementation
|
|
173
|
-
- (@copilot, @SimonFischer04) Added extended reverse proxy example section with screenshots, limitations (admin root requirement), and adapter compatibility notes
|
|
174
|
-
- (@copilot, @SimonFischer04) Fixed instances page reverse proxy link mapping so adapter localLinks are rewritten to the configured proxy paths (prefix matching + web port replacement, with duplicate link collapse)
|
|
175
|
-
- (@copilot, @SimonFischer04) Fixed intro page reverse proxy link remapping so links are correctly rewritten immediately and after navigating away and back (load reverseProxy config before instance scan and use prefix startsWith matching)
|
|
176
|
-
- (@GermanBluefox) Fixed multi-selection in the select ID dialog
|
|
177
|
-
|
|
178
|
-
### 7.7.3 (2025-09-25)
|
|
179
|
-
- Many GUI changes: See previous changelog below for details
|
|
180
|
-
|
|
181
187
|
## License
|
|
182
188
|
|
|
183
189
|
The MIT License (MIT)
|
|
184
190
|
|
|
185
|
-
Copyright (c) 2014-
|
|
191
|
+
Copyright (c) 2014-2026 bluefox <dogafox@gmail.com>
|
package/admin/jsonConfig.json5
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as t}from"./DefaultPropsProvider-
|
|
1
|
+
import{j as t}from"./DefaultPropsProvider-fAJulk6t.js";import{i as y}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{s as f,m as C}from"./bootstrap-B0ym92tp.js";import{h as T}from"./zh-cn-nUtvS7Wc.js";import{i as s,a as u}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as k}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{S as D}from"./State-GyY9wyOT.js";const a={closeButton:l=>({position:"absolute",right:8,top:8,color:l.palette.grey[500]}),languageButton:{position:"absolute",right:60,top:8},languageButtonActive:l=>({color:l.palette.primary.main}),typography:{paddingRight:30},version:l=>({background:"#4dabf5",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:l.palette.mode==="dark"?"black":"white"}),wrapperButton:{"@media screen and (max-width: 465px)":{"& *":{fontSize:10}},"@media screen and (max-width: 380px)":{"& *":{fontSize:9}}},messageText:{},messageIcon:{width:32,height:32,marginRight:8},messageColor_warn:{color:"#cb7642"},messageColor_error:{color:"#f5614d"},messageColor_info:{color:"#5abd29"},messageTitle_warn:l=>({background:"#cb7642",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:l.palette.mode==="dark"?"black":"white"}),messageTitle_error:l=>({background:"#f5614d",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:l.palette.mode==="dark"?"black":"white"}),messageTitle_info:l=>({background:"#5abd29",borderRadius:"3px",pl:"10px",fontWeight:"bold",color:l.palette.mode==="dark"?"black":"white"}),messageDialogText:{fontSize:18},messageDialogTitle:{},versionTime:{fontSize:"smaller",opacity:.5,marginLeft:4},dialogPaper:{maxWidth:880},repoStableVersionText:l=>({color:l.palette.mode==="dark"?"#8dff7a":"#2b9800",fontWeight:"bold",marginLeft:"4px"}),repoLatestVersionText:l=>({color:l.palette.mode==="dark"?"#a3fcff":"#005498",fontWeight:"bold",marginLeft:"4px"})};function I(l,e,p,r){let c=null;return l&&l.forEach(i=>{var m,_;let d=!((m=i.condition)!=null&&m.rules);if((_=i.condition)!=null&&_.rules){const j=(Array.isArray(i.condition.rules)?i.condition.rules:[i.condition.rules]).map(o=>{let n,h,g;if(o.includes("oldVersion"))n=e,o=o.substring(10);else if(o.includes("newVersion"))n=p,o=o.substring(10);else{if(o==="installed")return!!e;if(o==="!"||o==="not-installed")return!e;if(r){const w=o.match(/([a-z][-a-z_0-9]+)([!=<>]+)([.\d]+)/);if(w){const x=Object.keys(r).find(b=>{var v;return((v=r[b])==null?void 0:v.name)===w[1]});if(x){n=r[x].version,h=w[2],g=w[3];try{return h==="=="?f.eq(n,g):h===">"?f.gt(n,g):h==="<"?f.lt(n,g):h===">="?f.gte(n,g):h==="<="?f.lte(n,g):h==="!="?f.neq(n,g):(console.warn(`Unknown rule ${n}${o}`),!1)}catch{return console.warn(`Cannot compare ${n}${o}`),!1}}}else if(o.match(/^[!=<>]+/)){if(o.startsWith("!")){const x=o.substring(1);if(!Object.keys(r).find(b=>{var v;return((v=r[b])==null?void 0:v.name)===x}))return!0}}else if(Object.keys(r).find(x=>{var b;return((b=r[x])==null?void 0:b.name)===o}))return!0;return!1}}o[1]>="0"&&o[1]<="9"?(h=o[0],g=o.substring(1)):(h=o.substring(0,2),g=o.substring(2));try{if(h==="==")return f.eq(n,g);if(h===">")return f.gt(n,g);if(h==="<")return f.lt(n,g);if(h===">=")return f.gte(n,g);if(h==="<=")return f.lte(n,g);if(h==="!=")return f.neq(n,g);console.warn(`Unknown rule ${n}${o}`)}catch{console.warn(`Cannot compare ${n}${o}`)}return!1});i.condition.operand==="or"?d=j.find(o=>o):d=j.findIndex(o=>!o)===-1}d&&(c||=[],c.push({title:i.title,text:i.text,link:i.link,linkText:i.linkText,buttons:i.buttons,level:i.level}))}),c}class W extends y.Component{t;mobile;messages;lang;constructor(e){var r,c;super(e),this.t=e.t,this.mobile=window.innerWidth<C,this.state={showMessageDialog:!1};const p=!1;this.messages=I(((r=this.props.adapterObject)==null?void 0:r.messages)||p,this.props.installedVersion,(c=this.props.adapterObject)==null?void 0:c.version,this.props.instances),this.lang=k.I18n.getLanguage(),T.locale(this.lang)}getDependencies(){return(this.props.dependencies||[]).map(e=>t.jsx(D,{state:e.rightVersion,children:`${e.name}${e.version?` (${e.version})`:""}: ${e.installed?e.installedVersion:"-"}`},e.name))}getNews(){var c;const e=[];let p,r;return this.props.isStable!==void 0&&(this.props.isStable?(p=this.props.adapterObject.version,r=this.props.adapterObject.latestVersion):(p=this.props.adapterObject.stable,r=this.props.adapterObject.version)),(c=this.props.news)==null||c.forEach(i=>{var m,_,j;const d=(i.news?i.news.split(`
|
|
2
2
|
`):[]).map(o=>o.trim().replace(/^\*\s*/,"").replace(/<!--[^>]*->/,"").replace(/<! -[^>]*->/,"").replace(/<!--|--!?>/g,"").trim()).filter(o=>!!o);(m=this.props.adapterObject)!=null&&m.version&&i.version&&f.gt(i.version,(_=this.props.adapterObject)==null?void 0:_.version)||e.push(t.jsxs(s.Grid2,{children:[t.jsxs(s.Typography,{sx:a.version,children:[i.version,r&&r===i.version?t.jsx(s.Box,{component:"span",sx:a.repoLatestVersionText,children:"(latest)"}):null,p&&p===i.version?t.jsx(s.Box,{component:"span",sx:a.repoStableVersionText,children:`(${k.I18n.t("stable")})`}):null,((j=this.props.adapterObject)==null?void 0:j.version)===i.version?t.jsxs("span",{style:a.versionTime,children:["(",T(this.props.adapterObject.versionDate).fromNow(),")"]}):null]}),d.map((o,n)=>t.jsx(s.Typography,{component:"div",variant:"body2",children:`• ${o}`},`${i.version}-${n}`))]},i.version))}),e}getText(e,p){return e&&typeof e=="object"?p?e.en:e[this.lang]||e.en:typeof e=="object"?"":e}renderOneMessage(e,p){return t.jsxs(s.Grid2,{children:[t.jsx(s.Typography,{sx:a[`messageTitle_${e.level||"warn"}`],children:this.getText(e.title,this.props.noTranslation)||""}),t.jsx(s.Typography,{component:"div",variant:"body2",style:a.messageText,children:this.getText(e.text,this.props.noTranslation)||""}),e.link?t.jsx(s.Button,{onClick:()=>{window.open(e.link,"_blank").focus()},startIcon:t.jsx(u.Public,{}),variant:"contained",color:"grey",children:this.getText(e.linkText,this.props.noTranslation)||this.props.t("More info")}):null]},p)}renderMessages(){return this.messages?t.jsx(s.Grid2,{container:!0,spacing:2,direction:"column",wrap:"nowrap",sx:{marginBottom:1},children:this.messages.map((e,p)=>this.renderOneMessage(e,p))}):null}renderMessageDialog(){var r;if(!this.state.showMessageDialog)return null;const e=this.messages.find(c=>c.buttons),p=(r=this.props.adapterObject)==null?void 0:r.version;return t.jsxs(s.Dialog,{onClose:()=>this.setState({showMessageDialog:!1}),open:!0,children:[t.jsx(s.DialogTitle,{style:a.messageDialogTitle,children:this.getText(e.title,this.props.noTranslation)||this.props.t("Please confirm")}),t.jsxs(s.DialogContent,{style:a.messageDialogText,children:[e.level==="warn"?t.jsx(u.Warning,{style:{...a.messageIcon,...a.messageColor_warn}}):null,e.level==="error"?t.jsx(u.Error,{style:{...a.messageIcon,...a.messageColor_error}}):null,e.level==="info"?t.jsx(u.Info,{style:{...a.messageIcon,...a.messageColor_info}}):null,this.getText(e.text,this.props.noTranslation)]}),t.jsxs(s.DialogActions,{children:[e.link?t.jsx(s.Button,{onClick:()=>{window.open(e.link,"_blank").focus()},startIcon:t.jsx(u.Public,{}),variant:"contained",color:"secondary",children:this.getText(e.linkText,this.props.noTranslation)||this.props.t("More info")}):null,e.link?t.jsx("div",{style:{flexGrow:1}}):null,e.buttons.map((c,i)=>c==="ok"?t.jsx(s.Button,{variant:"contained",onClick:()=>this.setState({showMessageDialog:!1},()=>this.props.onUpdate(p)),color:"primary",startIcon:t.jsx(u.Check,{}),children:this.t("Update")},i):c==="agree"?t.jsx(s.Button,{sx:a[`messageTitle_${e.level||"warn"}`],variant:"contained",onClick:()=>this.setState({showMessageDialog:!1},()=>this.props.onUpdate(p)),color:"primary",startIcon:t.jsx(u.Check,{}),children:this.t("Agree")},i):c==="cancel"?t.jsx(s.Button,{variant:"contained",onClick:()=>this.setState({showMessageDialog:!1}),startIcon:t.jsx(u.Close,{}),color:"grey",children:this.t("Cancel")},i):null)]})]})}render(){var c,i;const e=(c=this.props.adapterObject)==null?void 0:c.version,p=(i=this.props.news)==null?void 0:i.every(d=>d.downloaded),r=this.getNews();return t.jsxs(s.Dialog,{onClose:this.props.onClose,open:!0,sx:{"& .MuiDialog-paper":a.dialogPaper},children:[this.renderMessageDialog(),t.jsx(s.DialogTitle,{children:t.jsxs(s.Typography,{component:"h2",variant:"h6",sx:{"&.MuiTypography-root":a.typography},children:[t.jsx("div",{style:{width:"calc(100% - 60px)"},children:this.t('Update "%s" to v%s',this.props.adapter,e)}),t.jsx(s.IconButton,{size:"large",sx:a.closeButton,onClick:this.props.onClose,children:t.jsx(u.Close,{})}),this.lang!=="en"&&this.props.toggleTranslation&&!p?t.jsx(s.IconButton,{size:"large",style:k.Utils.getStyle(this.props.theme,a.languageButton,this.props.noTranslation&&a.languageButtonActive),onClick:this.props.toggleTranslation,title:k.I18n.t("Disable/Enable translation"),children:t.jsx(u.Language,{})}):null]})}),t.jsxs(s.DialogContent,{dividers:!0,children:[this.renderMessages(),t.jsxs(s.Grid2,{container:!0,direction:"column",spacing:2,wrap:"nowrap",children:[this.props.dependencies&&this.props.dependencies.length>0&&this.props.dependencies.find(d=>!d.rightVersion)&&t.jsxs(s.Grid2,{children:[t.jsx(s.Typography,{variant:"h6",gutterBottom:!0,children:this.t("Dependencies")}),this.getDependencies()]}),r.length?t.jsxs(s.Grid2,{children:[t.jsx(s.Typography,{variant:"h6",gutterBottom:!0,children:this.t("Change log")}),t.jsx(s.Grid2,{container:!0,spacing:2,direction:"column",wrap:"nowrap",children:r})]}):this.t("No change log available")]})]}),t.jsxs(s.DialogActions,{sx:a.wrapperButton,children:[!!this.props.rightDependencies&&this.props.onIgnore&&e&&t.jsx(s.Button,{id:"adapter-update-dialog-ignore",variant:"outlined",onClick:()=>this.props.onIgnore(e),color:"primary",children:this.t("Ignore version %s",e)}),t.jsx(s.Button,{variant:"contained",id:"adapter-update-dialog-ok",autoFocus:!0,disabled:!this.props.rightDependencies||!e||!this.props.adapterObject,onClick:()=>{var d;(d=this.messages)!=null&&d.find(m=>m.buttons)?this.setState({showMessageDialog:!0}):this.props.onUpdate(e)},color:"primary",startIcon:t.jsx(u.Check,{}),children:this.mobile?null:this.props.textUpdate?this.props.textUpdate:this.t("Update")}),this.props.textInstruction?t.jsx(s.Button,{id:"adapter-update-dialog-instructions",variant:"contained",autoFocus:!0,disabled:!this.props.rightDependencies||!e||!this.props.adapterObject,onClick:()=>{var d;(d=this.messages)!=null&&d.find(m=>m.buttons)?this.setState({showMessageDialog:!0}):this.props.onInstruction()},color:"primary",startIcon:t.jsx(u.Book,{}),children:this.mobile?null:this.props.textInstruction}):null,t.jsx(s.Button,{id:"adapter-update-dialog-cancel",variant:"contained",onClick:()=>this.props.onClose(),color:"grey",startIcon:t.jsx(u.Close,{}),children:this.mobile?null:this.t("Close")})]})]})}}export{W as A,I as c};
|