@iobroker/json-config 8.0.2 → 8.0.3

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/README.md CHANGED
@@ -1593,6 +1593,9 @@ To update the location of JsonConfig schema, create pull request to this file: h
1593
1593
  ### **WORK IN PROGRESS**
1594
1594
  -->
1595
1595
  ## Changelog
1596
+ ### 8.0.3 (2025-10-23)
1597
+ - (@GermanBluefox) Do not translate certificates names
1598
+
1596
1599
  ### 8.0.2 (2025-10-23)
1597
1600
  - (@GermanBluefox) Renamed gui-components to adapter-react-v5
1598
1601
 
@@ -10,8 +10,8 @@ interface ConfigCertificateSelectState extends ConfigGenericState {
10
10
  value: string;
11
11
  }[];
12
12
  }
13
- declare class ConfigCertificateSelect extends ConfigGeneric<ConfigCertificateSelectProps, ConfigCertificateSelectState> {
13
+ export default class ConfigCertificateSelect extends ConfigGeneric<ConfigCertificateSelectProps, ConfigCertificateSelectState> {
14
14
  componentDidMount(): Promise<void>;
15
15
  renderItem(error: unknown, disabled: boolean): JSX.Element | null;
16
16
  }
17
- export default ConfigCertificateSelect;
17
+ export {};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { InputLabel, MenuItem, FormControl, Select, FormHelperText } from '@mui/material';
3
3
  import { I18n } from '@iobroker/adapter-react-v5';
4
4
  import ConfigGeneric from './ConfigGeneric';
5
- class ConfigCertificateSelect extends ConfigGeneric {
5
+ export default class ConfigCertificateSelect extends ConfigGeneric {
6
6
  async componentDidMount() {
7
7
  super.componentDidMount();
8
8
  const value = ConfigGeneric.getValue(this.props.data, this.props.attr);
@@ -37,5 +37,4 @@ class ConfigCertificateSelect extends ConfigGeneric {
37
37
  this.props.schema.help ? (React.createElement(FormHelperText, null, this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation))) : null));
38
38
  }
39
39
  }
40
- export default ConfigCertificateSelect;
41
40
  //# sourceMappingURL=ConfigCertificateSelect.js.map
@@ -1 +1 @@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CAAC,aAAa,CAClC,CACY,CACpB,CAAC,CAAC,CAAC,IAAI,CACE,CACjB,CAAC;IACN,CAAC;CACJ;AAED,eAAe,uBAAuB,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { InputLabel, MenuItem, FormControl, Select, FormHelperText } from '@mui/material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemCertificateSelect } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\ninterface ConfigCertificateSelectProps extends ConfigGenericProps {\n schema: ConfigItemCertificateSelect;\n}\n\ninterface ConfigCertificateSelectState extends ConfigGenericState {\n selectOptions?: { label: string; value: string }[];\n}\n\nclass ConfigCertificateSelect extends ConfigGeneric<ConfigCertificateSelectProps, ConfigCertificateSelectState> {\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n // Important: getCertificates is only available in AdminConnection\n const certificates = await this.props.oContext.socket.getCertificates();\n\n const selectOptions: { label: string; value: string }[] = certificates\n .filter(el => {\n const name = this.props.attr.toLowerCase();\n\n if (name.includes(el.type)) {\n return true;\n }\n if (el.type === 'public' && name.includes('cert')) {\n return true;\n }\n if (el.type === 'private' && (name.includes('priv') || name.includes('key'))) {\n return true;\n }\n return !!(el.type === 'chained' && (name.includes('chain') || name.includes('ca')));\n })\n .map(el => ({ label: el.name, value: el.name }));\n\n selectOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n\n this.setState({ value, selectOptions });\n }\n\n renderItem(error: unknown, disabled: boolean /* , defaultValue */): JSX.Element | null {\n if (!this.state.selectOptions) {\n return null;\n }\n\n const item = this.state.selectOptions?.find(_item => _item.value === this.state.value);\n\n return (\n <FormControl\n style={{ width: '100%' }}\n variant=\"standard\"\n >\n {this.props.schema.label ? (\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n ) : null}\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={this.state.value}\n renderValue={() => this.getText(item?.label, this.props.schema.noTranslation !== false)}\n onChange={e =>\n this.setState({ value: e.target.value }, () => this.onChange(this.props.attr, this.state.value))\n }\n >\n {this.state.selectOptions?.map(item_ => (\n <MenuItem\n key={item_.value}\n value={item_.value}\n style={item_.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item_.label, this.props.schema.noTranslation !== false)}\n </MenuItem>\n ))}\n </Select>\n {this.props.schema.help ? (\n <FormHelperText>\n {this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n </FormHelperText>\n ) : null}\n </FormControl>\n );\n }\n}\n\nexport default ConfigCertificateSelect;\n"]}
1
+ {"version":3,"file":"ConfigCertificateSelect.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigCertificateSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAUlG,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,aAGpD;IACG,KAAK,CAAC,iBAAiB;QACnB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvE,kEAAkE;QAClE,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QAExE,MAAM,aAAa,GAAuC,YAAY;aACjE,MAAM,CAAC,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K,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAEtE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,KAAK,KAAK,CAAC,CAC9D,CACd,CAAC,CACG;YACR,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACtB,oBAAC,cAAc,QACV,IAAI,CAAC,UAAU,CACZ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAClC,CACY,CACpB,CAAC,CAAC,CAAC,IAAI,CACE,CACjB,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { InputLabel, MenuItem, FormControl, Select, FormHelperText } from '@mui/material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemCertificateSelect } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\ninterface ConfigCertificateSelectProps extends ConfigGenericProps {\n schema: ConfigItemCertificateSelect;\n}\n\ninterface ConfigCertificateSelectState extends ConfigGenericState {\n selectOptions?: { label: string; value: string }[];\n}\n\nexport default class ConfigCertificateSelect extends ConfigGeneric<\n ConfigCertificateSelectProps,\n ConfigCertificateSelectState\n> {\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n // Important: getCertificates is only available in AdminConnection\n const certificates = await this.props.oContext.socket.getCertificates();\n\n const selectOptions: { label: string; value: string }[] = certificates\n .filter(el => {\n const name = this.props.attr.toLowerCase();\n\n if (name.includes(el.type)) {\n return true;\n }\n if (el.type === 'public' && name.includes('cert')) {\n return true;\n }\n if (el.type === 'private' && (name.includes('priv') || name.includes('key'))) {\n return true;\n }\n return !!(el.type === 'chained' && (name.includes('chain') || name.includes('ca')));\n })\n .map(el => ({ label: el.name, value: el.name }));\n\n selectOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n\n this.setState({ value, selectOptions });\n }\n\n renderItem(error: unknown, disabled: boolean /* , defaultValue */): JSX.Element | null {\n if (!this.state.selectOptions) {\n return null;\n }\n\n const item = this.state.selectOptions?.find(_item => _item.value === this.state.value);\n\n return (\n <FormControl\n style={{ width: '100%' }}\n variant=\"standard\"\n >\n {this.props.schema.label ? (\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n ) : null}\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={this.state.value}\n renderValue={() => this.getText(item?.label, this.props.schema.noTranslation !== false)}\n onChange={e =>\n this.setState({ value: e.target.value }, () => this.onChange(this.props.attr, this.state.value))\n }\n >\n {this.state.selectOptions?.map(item_ => (\n <MenuItem\n key={item_.value}\n value={item_.value}\n style={item_.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item_.label, this.props.schema.noTranslation !== false)}\n </MenuItem>\n ))}\n </Select>\n {this.props.schema.help ? (\n <FormHelperText>\n {this.renderHelp(\n this.props.schema.help,\n this.props.schema.helpLink,\n this.props.schema.noTranslation,\n )}\n </FormHelperText>\n ) : null}\n </FormControl>\n );\n }\n}"]}
@@ -19,8 +19,8 @@ interface ConfigCertificatesState extends ConfigGenericState {
19
19
  }[];
20
20
  collectionsOptions?: string[];
21
21
  }
22
- declare class ConfigCertificates extends ConfigGeneric<ConfigCertificatesProps, ConfigCertificatesState> {
22
+ export default class ConfigCertificates extends ConfigGeneric<ConfigCertificatesProps, ConfigCertificatesState> {
23
23
  componentDidMount(): Promise<void>;
24
24
  renderItem(error: unknown, disabled: boolean): JSX.Element | null;
25
25
  }
26
- export default ConfigCertificates;
26
+ export {};
@@ -15,7 +15,7 @@ const styles = {
15
15
  marginRight: 10,
16
16
  },
17
17
  };
18
- class ConfigCertificates extends ConfigGeneric {
18
+ export default class ConfigCertificates extends ConfigGeneric {
19
19
  async componentDidMount() {
20
20
  super.componentDidMount();
21
21
  // Important: getCertificates is only available in AdminConnection
@@ -83,14 +83,13 @@ class ConfigCertificates extends ConfigGeneric {
83
83
  this.state.collectionsOptions && leCollection !== 'false' ? (React.createElement("div", null, I18n.t('ra_Fallback custom certificates'))) : null,
84
84
  React.createElement(FormControl, { style: styles.certWidth, variant: "standard" },
85
85
  React.createElement(InputLabel, { shrink: true }, I18n.t('ra_Public certificate')),
86
- React.createElement(Select, { variant: "standard", error: !!error, displayEmpty: true, disabled: !!disabled, value: certPublic || '', renderValue: () => this.getText(itemCertPublic?.label), onChange: e => this.onChange(this.props.schema.certPublicName || 'certPublic', e.target.value) }, this.state.certsPublicOptions?.map((item, i) => (React.createElement(MenuItem, { key: `${item.value}_${i}`, value: item.value, style: item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {} }, this.getText(item.label)))))),
86
+ React.createElement(Select, { variant: "standard", error: !!error, displayEmpty: true, disabled: !!disabled, value: certPublic || '', renderValue: () => this.getText(itemCertPublic?.label, true), onChange: e => this.onChange(this.props.schema.certPublicName || 'certPublic', e.target.value) }, this.state.certsPublicOptions?.map((item, i) => (React.createElement(MenuItem, { key: `${item.value}_${i}`, value: item.value, style: item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {} }, this.getText(item.label, true)))))),
87
87
  React.createElement(FormControl, { style: styles.certWidth, variant: "standard" },
88
88
  React.createElement(InputLabel, { shrink: true }, I18n.t('ra_Private certificate')),
89
- React.createElement(Select, { variant: "standard", error: !!error, displayEmpty: true, disabled: !!disabled, value: certPrivate || '', renderValue: () => this.getText(itemCertPrivate?.label), onChange: e => this.onChange(this.props.schema.certPrivateName || 'certPrivate', e.target.value) }, this.state.certsPrivateOptions?.map((item, i) => (React.createElement(MenuItem, { key: `${item.value}_${i}`, value: item.value, style: item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {} }, this.getText(item.label)))))),
89
+ React.createElement(Select, { variant: "standard", error: !!error, displayEmpty: true, disabled: !!disabled, value: certPrivate || '', renderValue: () => this.getText(itemCertPrivate?.label, true), onChange: e => this.onChange(this.props.schema.certPrivateName || 'certPrivate', e.target.value) }, this.state.certsPrivateOptions?.map((item, i) => (React.createElement(MenuItem, { key: `${item.value}_${i}`, value: item.value, style: item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {} }, this.getText(item.label, true)))))),
90
90
  React.createElement(FormControl, { style: styles.certWidth, variant: "standard" },
91
91
  React.createElement(InputLabel, { shrink: true }, I18n.t('ra_Chained certificate')),
92
- React.createElement(Select, { variant: "standard", error: !!error, displayEmpty: true, disabled: !!disabled, value: certChained || '', renderValue: () => this.getText(itemCertChained?.label), onChange: e => this.onChange(this.props.schema.certChainedName || 'certChained', e.target.value) }, this.state.certsChainOptions?.map((item, i) => (React.createElement(MenuItem, { key: `${item.value}_${i}`, value: item.value, style: item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {} }, this.getText(item.label))))))));
92
+ React.createElement(Select, { variant: "standard", error: !!error, displayEmpty: true, disabled: !!disabled, value: certChained || '', renderValue: () => this.getText(itemCertChained?.label, true), onChange: e => this.onChange(this.props.schema.certChainedName || 'certChained', e.target.value) }, this.state.certsChainOptions?.map((item, i) => (React.createElement(MenuItem, { key: `${item.value}_${i}`, value: item.value, style: item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {} }, this.getText(item.label, true))))))));
93
93
  }
94
94
  }
95
- export default ConfigCertificates;
96
95
  //# sourceMappingURL=ConfigCertificates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigCertificates.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigCertificates.tsx"],"names":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ACC,CACZ,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,kBAAkB,CAAC","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { InputLabel, MenuItem, FormControl, Select } from '@mui/material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemCertificates } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nconst styles: Record<string, React.CSSProperties> = {\n fullWidth: {\n width: '100%',\n },\n leWidth: {\n width: 620,\n marginBottom: 10,\n },\n certWidth: {\n width: 200,\n marginRight: 10,\n },\n};\n\ninterface ConfigCertificatesProps extends ConfigGenericProps {\n schema: ConfigItemCertificates;\n}\n\ninterface ConfigCertificatesState extends ConfigGenericState {\n certsPublicOptions?: { label: string; value: string }[];\n certsChainOptions?: { label: string; value: string }[];\n certsPrivateOptions?: { label: string; value: string }[];\n collectionsOptions?: string[];\n}\n\nclass ConfigCertificates extends ConfigGeneric<ConfigCertificatesProps, ConfigCertificatesState> {\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n // Important: getCertificates is only available in AdminConnection\n const certificates = await this.props.oContext.socket.getCertificates();\n const certsPublicOptions: { label: string; value: string }[] = [];\n const certsPrivateOptions: { label: string; value: string }[] = [];\n const certsChainOptions: { label: string; value: string }[] = [];\n\n let collectionsOptions: string[] | null = [];\n const collectionsOptionsObj = await this.props.oContext.socket.getObject('system.certificates');\n if (collectionsOptionsObj?.native?.collections) {\n collectionsOptions = Object.keys(collectionsOptionsObj.native.collections);\n } else {\n collectionsOptions = null;\n }\n\n certificates.forEach(el => {\n if (el.type === 'public') {\n certsPublicOptions.push({ label: el.name, value: el.name });\n } else if (el.type === 'private') {\n certsPrivateOptions.push({ label: el.name, value: el.name });\n } else if (el.type === 'chained') {\n certsChainOptions.push({ label: el.name, value: el.name });\n } else {\n certsPublicOptions.push({ label: el.name, value: el.name });\n certsPrivateOptions.push({ label: el.name, value: el.name });\n certsChainOptions.push({ label: el.name, value: el.name });\n }\n });\n\n certsPublicOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n certsPrivateOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n certsChainOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n\n this.setState({\n certsPublicOptions,\n certsChainOptions,\n certsPrivateOptions,\n collectionsOptions,\n });\n }\n\n renderItem(error: unknown, disabled: boolean /* , defaultValue */): JSX.Element | null {\n if (!this.state.certsPublicOptions || !this.state.certsPrivateOptions || !this.state.certsChainOptions) {\n return null;\n }\n const leCollection = (\n ConfigGeneric.getValue(this.props.data, this.props.schema.leCollectionName || 'leCollection') || 'false'\n ).toString();\n const certPublic = ConfigGeneric.getValue(this.props.data, this.props.schema.certPublicName || 'certPublic');\n const certPrivate = ConfigGeneric.getValue(this.props.data, this.props.schema.certPrivateName || 'certPrivate');\n const certChained = ConfigGeneric.getValue(this.props.data, this.props.schema.certChainedName || 'certChained');\n\n const itemCertPublic = this.state.certsPublicOptions?.find(item => item.value === certPublic);\n const itemCertPrivate = this.state.certsPrivateOptions?.find(item => item.value === certPrivate);\n const itemCertChained = this.state.certsChainOptions?.find(item => item.value === certChained);\n\n return (\n <div style={styles.fullWidth}>\n {this.state.collectionsOptions ? (\n <FormControl\n style={styles.leWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>Let&apos;s encrypt</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={leCollection}\n onChange={e =>\n this.onChange(\n this.props.schema.leCollectionName || 'leCollection',\n e.target.value === 'false'\n ? false\n : e.target.value === 'true'\n ? true\n : e.target.value,\n )\n }\n >\n <MenuItem\n key=\"_false\"\n value=\"false\"\n style={{ fontWeight: 'bold' }}\n >\n {I18n.t(\"ra_Do not use let's encrypt\")}\n </MenuItem>\n <MenuItem\n key=\"_true\"\n value=\"true\"\n style={{ fontWeight: 'bold' }}\n >\n {I18n.t(\"ra_Use all available let's encrypt certificates\")}\n </MenuItem>\n {this.state.collectionsOptions?.map(item => (\n <MenuItem\n key={item}\n value={item}\n >\n {item}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n ) : null}\n {this.state.collectionsOptions ? <br /> : null}\n {this.state.collectionsOptions && leCollection !== 'false' ? (\n <div>{I18n.t('ra_Fallback custom certificates')}</div>\n ) : null}\n <FormControl\n style={styles.certWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>{I18n.t('ra_Public certificate')}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={certPublic || ''}\n renderValue={() => this.getText(itemCertPublic?.label)}\n onChange={e => this.onChange(this.props.schema.certPublicName || 'certPublic', e.target.value)}\n >\n {this.state.certsPublicOptions?.map((item, i) => (\n <MenuItem\n key={`${item.value}_${i}`}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl\n style={styles.certWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>{I18n.t('ra_Private certificate')}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={certPrivate || ''}\n renderValue={() => this.getText(itemCertPrivate?.label)}\n onChange={e =>\n this.onChange(this.props.schema.certPrivateName || 'certPrivate', e.target.value)\n }\n >\n {this.state.certsPrivateOptions?.map((item, i) => (\n <MenuItem\n key={`${item.value}_${i}`}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl\n style={styles.certWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>{I18n.t('ra_Chained certificate')}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={certChained || ''}\n renderValue={() => this.getText(itemCertChained?.label)}\n onChange={e =>\n this.onChange(this.props.schema.certChainedName || 'certChained', e.target.value)\n }\n >\n {this.state.certsChainOptions?.map((item, i) => (\n <MenuItem\n key={`${item.value}_${i}`}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </div>\n );\n }\n}\n\nexport default ConfigCertificates;\n"]}
1
+ {"version":3,"file":"ConfigCertificates.js","sourceRoot":"./src/","sources":["JsonConfigComponent/ConfigCertificates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,aAAmE,MAAM,iBAAiB,CAAC;AAElG,MAAM,MAAM,GAAwC;IAChD,SAAS,EAAE;QACP,KAAK,EAAE,MAAM;KAChB;IACD,OAAO,EAAE;QACL,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,EAAE;KACnB;IACD,SAAS,EAAE;QACP,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,EAAE;KAClB;CACJ,CAAC;AAaF,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,aAA+D;IAC3G,KAAK,CAAC,iBAAiB;QACnB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,kEAAkE;QAClE,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACxE,MAAM,kBAAkB,GAAuC,EAAE,CAAC;QAClE,MAAM,mBAAmB,GAAuC,EAAE,CAAC;QACnE,MAAM,iBAAiB,GAAuC,EAAE,CAAC;QAEjE,IAAI,kBAAk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MAAM,CAAC,eAAe,IAAI,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAGpF,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5C,oBAAC,QAAQ,IACL,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAErE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CACxB,CACd,CAAC,CACG,CACC,CACZ,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import React, { type JSX } from 'react';\n\nimport { InputLabel, MenuItem, FormControl, Select } from '@mui/material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { ConfigItemCertificates } from '../types';\nimport ConfigGeneric, { type ConfigGenericProps, type ConfigGenericState } from './ConfigGeneric';\n\nconst styles: Record<string, React.CSSProperties> = {\n fullWidth: {\n width: '100%',\n },\n leWidth: {\n width: 620,\n marginBottom: 10,\n },\n certWidth: {\n width: 200,\n marginRight: 10,\n },\n};\n\ninterface ConfigCertificatesProps extends ConfigGenericProps {\n schema: ConfigItemCertificates;\n}\n\ninterface ConfigCertificatesState extends ConfigGenericState {\n certsPublicOptions?: { label: string; value: string }[];\n certsChainOptions?: { label: string; value: string }[];\n certsPrivateOptions?: { label: string; value: string }[];\n collectionsOptions?: string[];\n}\n\nexport default class ConfigCertificates extends ConfigGeneric<ConfigCertificatesProps, ConfigCertificatesState> {\n async componentDidMount(): Promise<void> {\n super.componentDidMount();\n // Important: getCertificates is only available in AdminConnection\n const certificates = await this.props.oContext.socket.getCertificates();\n const certsPublicOptions: { label: string; value: string }[] = [];\n const certsPrivateOptions: { label: string; value: string }[] = [];\n const certsChainOptions: { label: string; value: string }[] = [];\n\n let collectionsOptions: string[] | null = [];\n const collectionsOptionsObj = await this.props.oContext.socket.getObject('system.certificates');\n if (collectionsOptionsObj?.native?.collections) {\n collectionsOptions = Object.keys(collectionsOptionsObj.native.collections);\n } else {\n collectionsOptions = null;\n }\n\n certificates.forEach(el => {\n if (el.type === 'public') {\n certsPublicOptions.push({ label: el.name, value: el.name });\n } else if (el.type === 'private') {\n certsPrivateOptions.push({ label: el.name, value: el.name });\n } else if (el.type === 'chained') {\n certsChainOptions.push({ label: el.name, value: el.name });\n } else {\n certsPublicOptions.push({ label: el.name, value: el.name });\n certsPrivateOptions.push({ label: el.name, value: el.name });\n certsChainOptions.push({ label: el.name, value: el.name });\n }\n });\n\n certsPublicOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n certsPrivateOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n certsChainOptions.unshift({ label: I18n.t(ConfigGeneric.NONE_LABEL), value: ConfigGeneric.NONE_VALUE });\n\n this.setState({\n certsPublicOptions,\n certsChainOptions,\n certsPrivateOptions,\n collectionsOptions,\n });\n }\n\n renderItem(error: unknown, disabled: boolean /* , defaultValue */): JSX.Element | null {\n if (!this.state.certsPublicOptions || !this.state.certsPrivateOptions || !this.state.certsChainOptions) {\n return null;\n }\n const leCollection = (\n ConfigGeneric.getValue(this.props.data, this.props.schema.leCollectionName || 'leCollection') || 'false'\n ).toString();\n const certPublic = ConfigGeneric.getValue(this.props.data, this.props.schema.certPublicName || 'certPublic');\n const certPrivate = ConfigGeneric.getValue(this.props.data, this.props.schema.certPrivateName || 'certPrivate');\n const certChained = ConfigGeneric.getValue(this.props.data, this.props.schema.certChainedName || 'certChained');\n\n const itemCertPublic = this.state.certsPublicOptions?.find(item => item.value === certPublic);\n const itemCertPrivate = this.state.certsPrivateOptions?.find(item => item.value === certPrivate);\n const itemCertChained = this.state.certsChainOptions?.find(item => item.value === certChained);\n\n return (\n <div style={styles.fullWidth}>\n {this.state.collectionsOptions ? (\n <FormControl\n style={styles.leWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>Let&apos;s encrypt</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={leCollection}\n onChange={e =>\n this.onChange(\n this.props.schema.leCollectionName || 'leCollection',\n e.target.value === 'false'\n ? false\n : e.target.value === 'true'\n ? true\n : e.target.value,\n )\n }\n >\n <MenuItem\n key=\"_false\"\n value=\"false\"\n style={{ fontWeight: 'bold' }}\n >\n {I18n.t(\"ra_Do not use let's encrypt\")}\n </MenuItem>\n <MenuItem\n key=\"_true\"\n value=\"true\"\n style={{ fontWeight: 'bold' }}\n >\n {I18n.t(\"ra_Use all available let's encrypt certificates\")}\n </MenuItem>\n {this.state.collectionsOptions?.map(item => (\n <MenuItem\n key={item}\n value={item}\n >\n {item}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n ) : null}\n {this.state.collectionsOptions ? <br /> : null}\n {this.state.collectionsOptions && leCollection !== 'false' ? (\n <div>{I18n.t('ra_Fallback custom certificates')}</div>\n ) : null}\n <FormControl\n style={styles.certWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>{I18n.t('ra_Public certificate')}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={certPublic || ''}\n renderValue={() => this.getText(itemCertPublic?.label, true)}\n onChange={e => this.onChange(this.props.schema.certPublicName || 'certPublic', e.target.value)}\n >\n {this.state.certsPublicOptions?.map((item, i) => (\n <MenuItem\n key={`${item.value}_${i}`}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item.label, true)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl\n style={styles.certWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>{I18n.t('ra_Private certificate')}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={certPrivate || ''}\n renderValue={() => this.getText(itemCertPrivate?.label, true)}\n onChange={e =>\n this.onChange(this.props.schema.certPrivateName || 'certPrivate', e.target.value)\n }\n >\n {this.state.certsPrivateOptions?.map((item, i) => (\n <MenuItem\n key={`${item.value}_${i}`}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item.label, true)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl\n style={styles.certWidth}\n variant=\"standard\"\n >\n <InputLabel shrink>{I18n.t('ra_Chained certificate')}</InputLabel>\n <Select\n variant=\"standard\"\n error={!!error}\n displayEmpty\n disabled={!!disabled}\n value={certChained || ''}\n renderValue={() => this.getText(itemCertChained?.label, true)}\n onChange={e =>\n this.onChange(this.props.schema.certChainedName || 'certChained', e.target.value)\n }\n >\n {this.state.certsChainOptions?.map((item, i) => (\n <MenuItem\n key={`${item.value}_${i}`}\n value={item.value}\n style={item.value === ConfigGeneric.NONE_VALUE ? { opacity: 0.5 } : {}}\n >\n {this.getText(item.label, true)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </div>\n );\n }\n}\n"]}
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": "8.0.2",
4
+ "version": "8.0.3",
5
5
  "author": {
6
6
  "name": "bluefox",
7
7
  "email": "dogafox@gmail.com"