@iobroker/json-config 9.0.19 → 9.0.21

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/build/types.d.ts CHANGED
@@ -17,6 +17,40 @@ declare module '@mui/material/Button' {
17
17
 
18
18
  type CustomCSSProperties = React.CSSProperties;
19
19
 
20
+ /**
21
+ * Operating system of the ioBroker host, on which the instance runs.
22
+ * These are the values of the node.js `process.platform`, like in `common.os` of `io-package.json`.
23
+ */
24
+ export type ConfigItemOs =
25
+ 'aix' | 'android' | 'cygwin' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'netbsd' | 'openbsd' | 'sunos' | 'win32';
26
+
27
+ /** Information about the ioBroker host, on which the configured instance runs */
28
+ export interface JsonConfigHostInfo {
29
+ /** Name of the host without `system.host.` prefix, e.g. `iobroker-raspi`. Empty if unknown */
30
+ id: string;
31
+ /** Operating system of the host (`process.platform`), e.g. `linux`. Empty if unknown */
32
+ os: ConfigItemOs | '';
33
+ /** Type of the operating system (`os.type()`), e.g. `Linux`, `Windows_NT`, `Darwin` */
34
+ osType: string;
35
+ /** Architecture of the host (`os.arch()`), e.g. `x64`, `arm64` */
36
+ arch: string;
37
+ /** Release of the operating system (`os.release()`) */
38
+ release: string;
39
+ /** Node.js version of the js-controller, e.g. `22.18.0` */
40
+ nodeVersion: string;
41
+ /** Installed js-controller version, e.g. `7.0.7` */
42
+ controllerVersion: string;
43
+ /**
44
+ * True if the ioBroker runs in a docker container.
45
+ *
46
+ * It is `undefined` if the docker state could not be detected: it is only requested if the configuration
47
+ * uses it (`docker` attribute or `_host.docker`) and it requires a running host.
48
+ */
49
+ docker?: boolean;
50
+ /** Version of the official ioBroker docker image. It is `undefined` for a not official image */
51
+ dockerVersion?: string;
52
+ }
53
+
20
54
  export type ConfigItemType =
21
55
  | 'accordion'
22
56
  | 'alive'
@@ -164,6 +198,22 @@ export interface ConfigItem {
164
198
  hidden?: string | boolean;
165
199
  /** If true and the control is hidden, the place of the control will be still reserved for it */
166
200
  hideOnlyControl?: boolean;
201
+ /**
202
+ * Show this element only on the given operating system(s) of the host, on which the instance runs:
203
+ * e.g. `"win32"` or `["linux", "darwin"]`. If the OS cannot be detected, the element will be shown.
204
+ */
205
+ os?: ConfigItemOs | ConfigItemOs[];
206
+ /**
207
+ * Do not show this element on the given operating system(s) of the host, on which the instance runs:
208
+ * e.g. `"win32"` or `["linux", "darwin"]`. If the OS cannot be detected, the element will be shown.
209
+ */
210
+ notOs?: ConfigItemOs | ConfigItemOs[];
211
+ /**
212
+ * Show this element only if the ioBroker runs in a docker container (`true`) or only if it does not
213
+ * run in a docker container (`false`). If the docker state cannot be detected (the host must run for
214
+ * that), the element will be shown.
215
+ */
216
+ docker?: boolean;
167
217
  /** JS function to calculate if the control is disabled. You can write "true" too */
168
218
  disabled?: string | boolean;
169
219
  /** Help text of the control */
@@ -247,6 +297,12 @@ export interface ConfigItemSelectOption {
247
297
  color?: string;
248
298
  /** Formula or boolean value to show or hide the option */
249
299
  hidden?: string | boolean;
300
+ /** Show this option only on the given operating system(s) of the host, on which the instance runs */
301
+ os?: ConfigItemOs | ConfigItemOs[];
302
+ /** Do not show this option on the given operating system(s) of the host, on which the instance runs */
303
+ notOs?: ConfigItemOs | ConfigItemOs[];
304
+ /** Show this option only if the ioBroker runs (`true`) or does not run (`false`) in a docker container */
305
+ docker?: boolean;
250
306
  /** Description for the value */
251
307
  description?: ioBroker.StringOrTranslated;
252
308
  /** Icon URL or base64 to display next to the option */
@@ -614,6 +670,12 @@ export interface ConfigItemSelect extends ConfigItem {
614
670
  value?: number | string;
615
671
  color?: string;
616
672
  hidden?: string | boolean;
673
+ /** Show this group only on the given operating system(s) of the host, on which the instance runs */
674
+ os?: ConfigItemOs | ConfigItemOs[];
675
+ /** Do not show this group on the given operating system(s) of the host, on which the instance runs */
676
+ notOs?: ConfigItemOs | ConfigItemOs[];
677
+ /** Show this group only if the ioBroker runs (`true`) or does not run (`false`) in a docker container */
678
+ docker?: boolean;
617
679
  description?: ioBroker.StringOrTranslated;
618
680
  noTranslation?: boolean;
619
681
  icon?: string;
@@ -1250,6 +1312,8 @@ export type JsonConfigContext = {
1250
1312
  onValueChange?: (attr: string, value: any, saveConfig: boolean) => void;
1251
1313
  registerOnForceUpdate?: (attr: string, cb?: (data: any) => void) => void;
1252
1314
  getCachedObject?: (id: string) => Promise<ioBroker.Object | null>;
1315
+ /** Information about the host, on which the configured instance runs */
1316
+ hostInfo?: JsonConfigHostInfo;
1253
1317
  };
1254
1318
 
1255
1319
  // Notification GUI
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iobroker/json-config",
3
3
  "description": "This package contains the ioBroker JSON config UI components",
4
- "version": "9.0.19",
4
+ "version": "9.0.21",
5
5
  "author": {
6
6
  "name": "bluefox",
7
7
  "email": "dogafox@gmail.com"
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@emotion/react": "^11.14.0",
39
39
  "@emotion/styled": "^11.14.1",
40
- "@iobroker/gui-components": "^10.0.15",
40
+ "@iobroker/gui-components": "^10.1.0",
41
41
  "@module-federation/runtime": "^2.8.2",
42
42
  "@mui/icons-material": "^9.3.1",
43
43
  "@mui/material": "^9.3.1",
@@ -47,7 +47,7 @@
47
47
  "react": "^19.2.8",
48
48
  "react-ace": "^15.0.0",
49
49
  "react-dom": "^19.2.8",
50
- "react-dropzone": "^20.0.0",
50
+ "react-dropzone": "^20.1.0",
51
51
  "react-qr-code": "^2.2.0",
52
52
  "yaml": "^2.9.0"
53
53
  },
@@ -65,7 +65,7 @@
65
65
  "ajv": "^8.20.0",
66
66
  "date-fns": "^4.4.0",
67
67
  "react-color": "^2.19.3",
68
- "tsc-alias": "^1.9.1",
68
+ "tsc-alias": "^1.9.2",
69
69
  "typescript": "~6.0.3"
70
70
  },
71
71
  "overrides": {