@iobroker/adapter-react-v5 4.0.8 → 4.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/404.js.map +1 -1
- package/Components/FileBrowser.js.map +1 -1
- package/Components/IconSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCRON.js +13 -15
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +39 -41
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +314 -322
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +138 -144
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.js +95 -99
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFunc.js +13 -7
- package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigGeneric.js +4 -6
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js +1 -1
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.js +21 -23
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +69 -71
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +17 -19
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +2 -2
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +14 -16
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigRoom.js +12 -6
- package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +54 -41
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +70 -76
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +21 -23
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +2 -2
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUUID.js +13 -15
- package/Components/JsonConfigComponent/ConfigUUID.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigUser.js +2 -2
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -1
- package/Components/ObjectBrowser.js +198 -204
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Schedule.js.map +1 -1
- package/Components/Utils.js +1 -1
- package/Components/Utils.js.map +1 -1
- package/Dialogs/SelectFile.js.map +1 -1
- package/Dialogs/SelectID.js.map +1 -1
- package/LICENSE +1 -1
- package/README.md +10 -2
- package/_Connection.js +23 -25
- package/_Connection.js.map +1 -1
- package/i18n/de.json +3 -1
- package/i18n/en.json +3 -1
- package/i18n/es.json +3 -1
- package/i18n/fr.json +3 -1
- package/i18n/it.json +3 -1
- package/i18n/nl.json +3 -1
- package/i18n/pl.json +3 -1
- package/i18n/pt.json +3 -1
- package/i18n/ru.json +3 -1
- package/i18n/uk.json +3 -1
- package/i18n/zh-cn.json +3 -1
- package/package.json +7 -7
|
@@ -623,12 +623,10 @@ var ConfigGeneric = /*#__PURE__*/function (_Component) {
|
|
|
623
623
|
(0, _defineProperty2["default"])(ConfigGeneric, "NONE_LABEL", 'ra_none');
|
|
624
624
|
(0, _defineProperty2["default"])(ConfigGeneric, "AsyncFunction", Object.getPrototypeOf( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
625
625
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
626
|
-
while (1) {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
return _context.stop();
|
|
631
|
-
}
|
|
626
|
+
while (1) switch (_context.prev = _context.next) {
|
|
627
|
+
case 0:
|
|
628
|
+
case "end":
|
|
629
|
+
return _context.stop();
|
|
632
630
|
}
|
|
633
631
|
}, _callee);
|
|
634
632
|
}))).constructor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigGeneric.js","names":["ConfigGeneric","props","data","value","getValue","attr","state","setState","forceUpdate","confirmDialog","confirmNewValue","confirmAttr","confirmData","isError","schema","custom","defaultValue","defaultFunc","executeCustom","instanceObj","arrayIndex","globalData","execute","lang","I18n","getLanguage","registerOnForceUpdate","onUpdate","LIKE_SELECT","undefined","includes","type","setTimeout","onChange","setValue","defaultSendTo","sendTo","alive","defaultSendToDone","jsonData","getPattern","JSON","parse","e","console","error","socket","adapterName","instance","then","onError","t","sendToTimeout","clearTimeout","text","noTranslation","func","en","confirm","icon","getText","title","ok","cancel","isOk","stringify","confirmDepAttr","confirmDepNewValue","confirmOldValue","newValue","cb","condition","confirmDependsOn","z","length","dep","val","changed","onChangeDependsOn","_newValue","calculateFunc","customObj","push","hiddenDependsOn","hidden","labelDependsOn","helpDependsOn","ignoreOwnChanges","forEach","_attr","i","f","Function","result","originalData","systemConfig","common","log","disabled","validator","label","link","Utils","renderTextWithA","color","themeType","textDecoration","pattern","replace","calculate","Object","keys","hideOnlyControl","item","xs","lg","md","sm","assign","marginBottom","textAlign","style","darkStyle","newLine","flexBasis","height","validatorNoSaveOnError","validatorErrorText","renderedItem","renderItem","commandRunning","tooltip","width","button","buttonTooltip","buttonTooltipNoTranslation","renderConfirmDialog","split","part","shift","Component","getPrototypeOf","constructor","propTypes","PropTypes","object","isRequired","string","any","themeName","customs","bool","number","dateFormat","isFloatComma"],"sources":["JsonConfigComponent/ConfigGeneric.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport Grid from '@mui/material/Grid';\nimport Button from '@mui/material/Button';\n\nimport IconInfo from '@mui/icons-material/Info';\nimport IconWarning from '@mui/icons-material/Warning';\nimport IconError from '@mui/icons-material/Error';\n\nimport I18n from './wrapper/i18n';\nimport Utils from './wrapper/Components/Utils';\nimport ConfirmDialog from './wrapper/Dialogs/Confirm';\n\nclass ConfigGeneric extends Component {\n static DIFFERENT_VALUE = '__different__';\n static DIFFERENT_LABEL = 'ra___different__';\n static NONE_VALUE = '';\n static NONE_LABEL = 'ra_none';\n static AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;\n\n constructor(props) {\n super(props);\n\n this.state = {\n confirmDialog: false,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n };\n\n this.isError = {};\n\n if (props.schema) {\n if (props.custom) {\n this.defaultValue = props.schema.defaultFunc ? this.executeCustom(props.schema.defaultFunc, props.schema.default, props.data, props.instanceObj, props.arrayIndex, props.globalData) : props.schema.default;\n } else {\n this.defaultValue = props.schema.defaultFunc ? this.execute(props.schema.defaultFunc, props.schema.default, props.data, props.arrayIndex, props.globalData) : props.schema.default;\n }\n }\n\n this.lang = I18n.getLanguage();\n }\n\n componentDidMount() {\n this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr, this.onUpdate);\n const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];\n // init default value\n if (this.defaultValue !== undefined) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (value === undefined || (LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))) {\n setTimeout(() => {\n if (this.props.custom) {\n this.props.onChange(this.props.attr, this.defaultValue, () =>\n setTimeout(() => this.props.forceUpdate([this.props.attr], this.props.data), 100));\n //this.onChange(this.props.attr, this.defaultValue);\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);\n this.props.onChange(this.props.data, undefined, () =>\n this.props.forceUpdate([this.props.attr], this.props.data));\n }\n }, 100);\n }\n } else if (this.props.schema.defaultSendTo) {\n this.sendTo();\n }\n }\n\n sendTo() {\n if (this.props.alive) {\n this.defaultSendToDone = true;\n let data = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n data = this.getPattern(this.props.schema.jsonData);\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.error('Cannot parse json data: ' + data);\n }\n } else {\n data = {\n attr: this.props.attr,\n value: ConfigGeneric.getValue(this.props.data, this.props.attr),\n };\n }\n\n if (data === undefined) {\n data = null;\n }\n\n this.props.socket.sendTo(`${this.props.adapterName}.${this.props.instance}`, this.props.schema.defaultSendTo, data)\n .then(value => {\n if (value !== null && value !== undefined) {\n if (this.props.custom) {\n this.props.onChange(this.props.attr, value, () =>\n this.props.forceUpdate([this.props.attr], this.props.data));\n //this.onChange(this.props.attr, this.defaultValue);\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, value);\n this.props.onChange(this.props.data, undefined, () =>\n this.props.forceUpdate([this.props.attr], this.props.data));\n }\n }\n });\n } else {\n this.defaultSendToDone = false;\n // show error, that instance does not started\n this.onError(this.props.attr, I18n.t('ra_Instance %s is not alive', this.props.instance));\n }\n }\n\n componentWillUnmount() {\n this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr)\n if (this.sendToTimeout) {\n clearTimeout(this.sendToTimeout);\n this.sendToTimeout = null;\n }\n }\n\n onUpdate = data => {\n const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';\n if (this.state.value !== value) {\n this.setState({ value });\n } else {\n this.forceUpdate();\n }\n }\n\n static getValue(data, attr) {\n if (typeof attr === 'string') {\n return ConfigGeneric.getValue(data, attr.split('.'));\n } else {\n if (attr.length === 1) {\n return data[attr[0]];\n } else {\n const part = attr.shift();\n if (typeof data[part] === 'object') {\n return ConfigGeneric.getValue(data[part], attr);\n } else {\n return null;\n }\n }\n }\n }\n\n static setValue(data, attr, value) {\n if (typeof attr === 'string') {\n return ConfigGeneric.setValue(data, attr.split('.'), value);\n } else {\n if (attr.length === 1) {\n if (value === null) {\n delete data[attr[0]];\n } else {\n data[attr[0]] = value;\n }\n } else {\n const part = attr.shift();\n if (!data[part] || typeof data[part] === 'object') {\n data[part] = data[part] || {};\n }\n return ConfigGeneric.setValue(data[part], attr, value);\n }\n }\n }\n\n getText(text, noTranslation) {\n if (!text) {\n return '';\n }\n\n if (typeof text === 'string') {\n text = noTranslation ? text : I18n.t(text);\n if (text.includes('${')) {\n return this.getPattern(text);\n } else {\n return text;\n }\n } else if (text && typeof text === 'object') {\n if (text.func) {\n // calculate pattern\n if (typeof text.func === 'object') {\n return this.getPattern(text.func[this.lang] || text.func.en || '');\n } else {\n this.getPattern(text.func);\n }\n } else {\n return text[this.lang] || text.en || '';\n }\n }\n }\n\n renderConfirmDialog() {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n let icon = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return <ConfirmDialog\n title={ this.getText(confirm.title) || I18n.t('ra_Please confirm') }\n text={ this.getText(confirm.text) }\n ok={ this.getText(confirm.ok) || I18n.t('ra_Ok') }\n cancel={ this.getText(confirm.cancel) || I18n.t('ra_Cancel') }\n icon={icon}\n onClose={isOk =>\n this.setState({ confirmDialog: false}, () => {\n if (isOk) {\n const data = JSON.parse(JSON.stringify(this.props.data));\n if (this.state.confirmDepAttr) {\n ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);\n }\n\n ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);\n this.setState({\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmOldValue: null,\n confirmData: null,\n }, () =>\n this.props.onChange(data));\n } else {\n this.setState({\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmOldValue: null,\n confirmData: null,\n });\n }\n })\n }\n />;\n }\n\n onChange(attr, newValue, cb) {\n const data = JSON.parse(JSON.stringify(this.props.data));\n ConfigGeneric.setValue(data, attr, newValue);\n\n if (this.props.schema.confirm && this.execute(this.props.schema.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {\n return this.setState({\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmData: null,\n });\n } else {\n // find any inputs with confirmation\n if (this.props.schema.confirmDependsOn) {\n for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {\n const dep = this.props.schema.confirmDependsOn[z];\n if (dep.confirm) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n if (this.execute(dep.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {\n return this.setState({\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmDepNewValue: val,\n confirmDepAttr: dep.attr,\n confirmData: dep.confirm,\n });\n }\n }\n }\n }\n\n const changed = [];\n if (this.props.schema.onChangeDependsOn) {\n for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {\n const dep = this.props.schema.onChangeDependsOn[z];\n if (dep.onChange) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n let _newValue;\n if (this.props.custom) {\n _newValue = this.executeCustom(dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);\n } else {\n _newValue = this.execute(dep.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);\n }\n\n if (_newValue !== val) {\n ConfigGeneric.setValue(data, dep.attr, _newValue);\n changed.push(dep.attr);\n }\n }\n }\n }\n\n if (this.props.schema.hiddenDependsOn) {\n for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {\n const dep = this.props.schema.hiddenDependsOn[z];\n dep.hidden && changed.push(dep.attr);\n }\n }\n\n if (this.props.schema.labelDependsOn) {\n for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {\n const dep = this.props.schema.labelDependsOn[z];\n dep.hidden && changed.push(dep.attr);\n }\n }\n\n if (this.props.schema.helpDependsOn) {\n for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {\n const dep = this.props.schema.helpDependsOn[z];\n dep.hidden && changed.push(dep.attr);\n }\n }\n\n if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {\n const val = ConfigGeneric.getValue(data, this.props.attr);\n\n const newValue = this.props.custom ?\n this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)\n :\n this.execute(this.props.schema.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);\n if (newValue !== val) {\n ConfigGeneric.setValue(data, this.props.attr, newValue);\n }\n }\n\n if (this.props.custom) {\n this.props.onChange(attr, newValue, () => cb && cb());\n\n changed && changed.length && changed.forEach((_attr, i) =>\n setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50));\n } else {\n this.props.onChange(data, undefined, () => {\n changed.length && this.props.forceUpdate(changed, data);\n cb && cb();\n });\n }\n }\n }\n\n execute(func, defaultValue, data, arrayIndex, globalData) {\n if (func && typeof func === 'object') {\n func = func.func;\n }\n\n if (!func) {\n return defaultValue;\n } else {\n try {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', 'arrayIndex', 'globalData', func.includes('return') ? func : 'return ' + func);\n const result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance, arrayIndex, globalData);\n // console.log(result);\n return result;\n } catch (e) {\n console.error(`Cannot execute ${func}: ${e}`);\n return defaultValue;\n }\n }\n }\n\n executeCustom(func, data, customObj, instanceObj, arrayIndex, globalData) {\n if (func && typeof func === 'object') {\n func = func.func;\n }\n\n if (!func) {\n return null;\n } else {\n try {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'arrayIndex', 'globalData', func.includes('return') ? func : 'return ' + func);\n const result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket, arrayIndex, globalData);\n console.log(result);\n return result;\n } catch (e) {\n console.error(`Cannot execute ${func}: ${e}`);\n return null;\n }\n }\n }\n\n calculate(schema) {\n let error;\n let disabled;\n let hidden;\n let defaultValue;\n\n if (this.props.custom) {\n error = schema.validator ? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;\n disabled = schema.disabled ? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;\n hidden = schema.hidden ? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;\n defaultValue = schema.defaultFunc ? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : schema.default;\n } else {\n error = schema.validator ? !this.execute(schema.validator, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;\n disabled = schema.disabled ? this.execute(schema.disabled, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;\n hidden = schema.hidden ? this.execute(schema.hidden, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;\n defaultValue = schema.defaultFunc ? this.execute(schema.defaultFunc, schema.default, this.props.data, this.props.arrayIndex, this.props.globalData) : schema.default;\n }\n\n return { error, disabled, hidden, defaultValue };\n }\n\n onError(attr, error) {\n if (!error) {\n delete this.isError[attr];\n } else {\n this.isError[attr] = error;\n }\n\n this.props.onError && this.props.onError(attr, error);\n }\n\n renderItem(error, disabled, defaultValue) {\n return this.getText(this.props.schema.label) || this.getText(this.props.schema.text)\n }\n\n renderHelp(text, link, noTranslation) {\n if (!link) {\n text = this.getText(text, noTranslation) || '';\n if (text && (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {\n return Utils.renderTextWithA(text);\n } else {\n return text;\n }\n } else {\n return <a\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ color: this.props.themeType === 'dark' ? '#a147ff' : '#5b238f', textDecoration: 'underline' }}\n >{this.getText(text, noTranslation)}</a>;\n }\n }\n\n getPattern(pattern, data) {\n data = data || this.props.data;\n if (!pattern) {\n return '';\n } else {\n if (typeof pattern === 'object') {\n pattern = pattern.func;\n }\n\n try {\n if (this.props.custom) {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', 'instanceObj', 'customObj', '_socket', 'return `' + pattern.replace(/`/g, '\\\\`') + '`');\n return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.instanceObj, this.props.customObj, this.props.socket, this.props.arrayIndex, this.props.globalData);\n } else {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', '_alive', '_common', '_socket', 'return `' + pattern.replace(/`/g, '\\\\`') + '`');\n return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket);\n }\n } catch (e) {\n console.error(`Cannot execute ${pattern}: ${e}`);\n return pattern;\n }\n }\n }\n\n render() {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n if (this.props.alive && this.defaultSendToDone === false) {\n this.sendToTimeout = setTimeout(() => {this.sendToTimeout = null; this.sendTo();}, 200);\n }\n\n const { error, disabled, hidden, defaultValue } = this.calculate(schema);\n\n if (hidden) {\n // Remove all errors if element is hidden\n if (Object.keys(this.isError).length) {\n setTimeout(isError =>\n Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100, JSON.parse(JSON.stringify(this.isError)));\n this.isError = {};\n }\n\n if (schema.hideOnlyControl) {\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign(\n {},\n {marginBottom: 0, /*marginRight: 8, */textAlign: 'left'},\n schema.style,\n this.props.themeType === 'dark' ? schema.darkStyle : {}\n )}\n />;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {item}\n </>;\n } else {\n return item;\n }\n } else {\n return null;\n }\n } else {\n // Add error\n if (schema.validatorNoSaveOnError) {\n if (error && !Object.keys(this.isError).length) {\n this.isError = {[this.props.attr]: schema.validatorErrorText ? I18n.t(schema.validatorErrorText) : true};\n setTimeout(isError =>\n Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])),\n 100, JSON.parse(JSON.stringify(this.isError)));\n } else if (!error && Object.keys(this.isError).length) {\n setTimeout(isError =>\n Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100, JSON.parse(JSON.stringify(this.isError)));\n this.isError = {};\n }\n }\n\n const renderedItem = this.renderItem(error, disabled || this.props.commandRunning || this.props.disabled, defaultValue);\n\n const item = <Grid\n item\n title={this.getText(schema.tooltip)}\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {\n marginBottom: 0,\n // marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n { this.props.schema.defaultSendTo && this.props.schema.button ? <Grid container style={{ width: '100%' }}>\n <Grid item flex={1}>{renderedItem}</Grid>\n <Grid item><Button\n variant=\"outlined\"\n onClick={() => this.sendTo()}\n title={this.props.schema.buttonTooltip ? this.getText(this.props.schema.buttonTooltip, this.props.schema.buttonTooltipNoTranslation) : I18n.t('ra_Request data by instance')}\n >{this.getText(this.props.schema.button)}</Button></Grid>\n </Grid>\n :\n renderedItem\n }\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {this.renderConfirmDialog()}\n {item}\n </>;\n } else {\n if (this.state.confirmDialog) {\n return <>\n {this.renderConfirmDialog()}\n {item}\n </>;\n } else {\n return item;\n }\n }\n }\n }\n}\n\nConfigGeneric.propTypes = {\n socket: PropTypes.object.isRequired,\n data: PropTypes.object,\n originalData: PropTypes.object,\n schema: PropTypes.object,\n attr: PropTypes.string,\n value: PropTypes.any,\n themeName: PropTypes.string,\n style: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n customs: PropTypes.object,\n forceUpdate: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n\n systemConfig: PropTypes.object,\n alive: PropTypes.bool,\n common: PropTypes.object,\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n\n customObj: PropTypes.object,\n instanceObj: PropTypes.object,\n custom: PropTypes.bool,\n};\n\nexport default ConfigGeneric;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAsD;AAAA;AAAA;AAAA;AAAA,IAEhDA,aAAa;EAAA;EAAA;EAOf,uBAAYC,KAAK,EAAE;IAAA;IAAA;IACf,0BAAMA,KAAK;IAAE,6FAiGN,UAAAC,IAAI,EAAI;MACf,IAAMC,KAAK,GAAGH,aAAa,CAACI,QAAQ,CAACF,IAAI,IAAI,MAAKD,KAAK,CAACC,IAAI,EAAE,MAAK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,WAAW;AAkjBhF9I,aAAa,CAAC+I,SAAS,GAAG;EACtBjG,MAAM,EAAEkG,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnChJ,IAAI,EAAE8I,qBAAS,CAACC,MAAM;EACtBnD,YAAY,EAAEkD,qBAAS,CAACC,MAAM;EAC9BnI,MAAM,EAAEkI,qBAAS,CAACC,MAAM;EACxB5I,IAAI,EAAE2I,qBAAS,CAACG,MAAM;EACtBhJ,KAAK,EAAE6I,qBAAS,CAACI,GAAG;EACpBC,SAAS,EAAEL,qBAAS,CAACG,MAAM;EAC3B1B,KAAK,EAAEuB,qBAAS,CAACC,MAAM;EACvB/F,OAAO,EAAE8F,qBAAS,CAACxF,IAAI;EACvBvB,QAAQ,EAAE+G,qBAAS,CAACxF,IAAI;EACxB8F,OAAO,EAAEN,qBAAS,CAACC,MAAM;EACzBzI,WAAW,EAAEwI,qBAAS,CAACxF,IAAI,CAAC0F,UAAU;EACtChD,QAAQ,EAAE8C,qBAAS,CAACO,IAAI;EAExBxD,YAAY,EAAEiD,qBAAS,CAACC,MAAM;EAC9B5G,KAAK,EAAE2G,qBAAS,CAACO,IAAI;EACrBvD,MAAM,EAAEgD,qBAAS,CAACC,MAAM;EACxBlG,WAAW,EAAEiG,qBAAS,CAACG,MAAM;EAC7BnG,QAAQ,EAAEgG,qBAAS,CAACQ,MAAM;EAC1BC,UAAU,EAAET,qBAAS,CAACG,MAAM;EAC5BO,YAAY,EAAEV,qBAAS,CAACO,IAAI;EAE5BtE,SAAS,EAAE+D,qBAAS,CAACC,MAAM;EAC3B9H,WAAW,EAAE6H,qBAAS,CAACC,MAAM;EAC7BlI,MAAM,EAAEiI,qBAAS,CAACO;AACtB,CAAC;AAAC,eAEavJ,aAAa;AAAA"}
|
|
1
|
+
{"version":3,"file":"ConfigGeneric.js","names":["ConfigGeneric","props","data","value","getValue","attr","state","setState","forceUpdate","confirmDialog","confirmNewValue","confirmAttr","confirmData","isError","schema","custom","defaultValue","defaultFunc","executeCustom","instanceObj","arrayIndex","globalData","execute","lang","I18n","getLanguage","registerOnForceUpdate","onUpdate","LIKE_SELECT","undefined","includes","type","setTimeout","onChange","setValue","defaultSendTo","sendTo","alive","defaultSendToDone","jsonData","getPattern","JSON","parse","e","console","error","socket","adapterName","instance","then","onError","t","sendToTimeout","clearTimeout","text","noTranslation","func","en","confirm","icon","getText","title","ok","cancel","isOk","stringify","confirmDepAttr","confirmDepNewValue","confirmOldValue","newValue","cb","condition","confirmDependsOn","z","length","dep","val","changed","onChangeDependsOn","_newValue","calculateFunc","customObj","push","hiddenDependsOn","hidden","labelDependsOn","helpDependsOn","ignoreOwnChanges","forEach","_attr","i","f","Function","result","originalData","systemConfig","common","log","disabled","validator","label","link","Utils","renderTextWithA","color","themeType","textDecoration","pattern","replace","calculate","Object","keys","hideOnlyControl","item","xs","lg","md","sm","assign","marginBottom","textAlign","style","darkStyle","newLine","flexBasis","height","validatorNoSaveOnError","validatorErrorText","renderedItem","renderItem","commandRunning","tooltip","width","button","buttonTooltip","buttonTooltipNoTranslation","renderConfirmDialog","split","part","shift","Component","getPrototypeOf","constructor","propTypes","PropTypes","object","isRequired","string","any","themeName","customs","bool","number","dateFormat","isFloatComma"],"sources":["JsonConfigComponent/ConfigGeneric.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport Grid from '@mui/material/Grid';\nimport Button from '@mui/material/Button';\n\nimport IconInfo from '@mui/icons-material/Info';\nimport IconWarning from '@mui/icons-material/Warning';\nimport IconError from '@mui/icons-material/Error';\n\nimport I18n from './wrapper/i18n';\nimport Utils from './wrapper/Components/Utils';\nimport ConfirmDialog from './wrapper/Dialogs/Confirm';\n\nclass ConfigGeneric extends Component {\n static DIFFERENT_VALUE = '__different__';\n static DIFFERENT_LABEL = 'ra___different__';\n static NONE_VALUE = '';\n static NONE_LABEL = 'ra_none';\n static AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;\n\n constructor(props) {\n super(props);\n\n this.state = {\n confirmDialog: false,\n confirmNewValue: null,\n confirmAttr: null,\n confirmData: null,\n };\n\n this.isError = {};\n\n if (props.schema) {\n if (props.custom) {\n this.defaultValue = props.schema.defaultFunc ? this.executeCustom(props.schema.defaultFunc, props.schema.default, props.data, props.instanceObj, props.arrayIndex, props.globalData) : props.schema.default;\n } else {\n this.defaultValue = props.schema.defaultFunc ? this.execute(props.schema.defaultFunc, props.schema.default, props.data, props.arrayIndex, props.globalData) : props.schema.default;\n }\n }\n\n this.lang = I18n.getLanguage();\n }\n\n componentDidMount() {\n this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr, this.onUpdate);\n const LIKE_SELECT = ['select', 'autocomplete', 'autocompleteSendTo'];\n // init default value\n if (this.defaultValue !== undefined) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n if (value === undefined || (LIKE_SELECT.includes(this.props.schema.type) && (value === '' || value === null))) {\n setTimeout(() => {\n if (this.props.custom) {\n this.props.onChange(this.props.attr, this.defaultValue, () =>\n setTimeout(() => this.props.forceUpdate([this.props.attr], this.props.data), 100));\n //this.onChange(this.props.attr, this.defaultValue);\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, this.defaultValue);\n this.props.onChange(this.props.data, undefined, () =>\n this.props.forceUpdate([this.props.attr], this.props.data));\n }\n }, 100);\n }\n } else if (this.props.schema.defaultSendTo) {\n this.sendTo();\n }\n }\n\n sendTo() {\n if (this.props.alive) {\n this.defaultSendToDone = true;\n let data = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n data = this.getPattern(this.props.schema.jsonData);\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.error('Cannot parse json data: ' + data);\n }\n } else {\n data = {\n attr: this.props.attr,\n value: ConfigGeneric.getValue(this.props.data, this.props.attr),\n };\n }\n\n if (data === undefined) {\n data = null;\n }\n\n this.props.socket.sendTo(`${this.props.adapterName}.${this.props.instance}`, this.props.schema.defaultSendTo, data)\n .then(value => {\n if (value !== null && value !== undefined) {\n if (this.props.custom) {\n this.props.onChange(this.props.attr, value, () =>\n this.props.forceUpdate([this.props.attr], this.props.data));\n //this.onChange(this.props.attr, this.defaultValue);\n } else {\n ConfigGeneric.setValue(this.props.data, this.props.attr, value);\n this.props.onChange(this.props.data, undefined, () =>\n this.props.forceUpdate([this.props.attr], this.props.data));\n }\n }\n });\n } else {\n this.defaultSendToDone = false;\n // show error, that instance does not started\n this.onError(this.props.attr, I18n.t('ra_Instance %s is not alive', this.props.instance));\n }\n }\n\n componentWillUnmount() {\n this.props.registerOnForceUpdate && this.props.registerOnForceUpdate(this.props.attr)\n if (this.sendToTimeout) {\n clearTimeout(this.sendToTimeout);\n this.sendToTimeout = null;\n }\n }\n\n onUpdate = data => {\n const value = ConfigGeneric.getValue(data || this.props.data, this.props.attr) || '';\n if (this.state.value !== value) {\n this.setState({ value });\n } else {\n this.forceUpdate();\n }\n }\n\n static getValue(data, attr) {\n if (typeof attr === 'string') {\n return ConfigGeneric.getValue(data, attr.split('.'));\n } else {\n if (attr.length === 1) {\n return data[attr[0]];\n } else {\n const part = attr.shift();\n if (typeof data[part] === 'object') {\n return ConfigGeneric.getValue(data[part], attr);\n } else {\n return null;\n }\n }\n }\n }\n\n static setValue(data, attr, value) {\n if (typeof attr === 'string') {\n return ConfigGeneric.setValue(data, attr.split('.'), value);\n } else {\n if (attr.length === 1) {\n if (value === null) {\n delete data[attr[0]];\n } else {\n data[attr[0]] = value;\n }\n } else {\n const part = attr.shift();\n if (!data[part] || typeof data[part] === 'object') {\n data[part] = data[part] || {};\n }\n return ConfigGeneric.setValue(data[part], attr, value);\n }\n }\n }\n\n getText(text, noTranslation) {\n if (!text) {\n return '';\n }\n\n if (typeof text === 'string') {\n text = noTranslation ? text : I18n.t(text);\n if (text.includes('${')) {\n return this.getPattern(text);\n } else {\n return text;\n }\n } else if (text && typeof text === 'object') {\n if (text.func) {\n // calculate pattern\n if (typeof text.func === 'object') {\n return this.getPattern(text.func[this.lang] || text.func.en || '');\n } else {\n this.getPattern(text.func);\n }\n } else {\n return text[this.lang] || text.en || '';\n }\n }\n }\n\n renderConfirmDialog() {\n if (!this.state.confirmDialog) {\n return null;\n }\n const confirm = this.state.confirmData || this.props.schema.confirm;\n let icon = null;\n if (confirm.type === 'warning') {\n icon = <IconWarning />;\n } else if (confirm.type === 'error') {\n icon = <IconError />;\n } else if (confirm.type === 'info') {\n icon = <IconInfo />;\n }\n\n return <ConfirmDialog\n title={ this.getText(confirm.title) || I18n.t('ra_Please confirm') }\n text={ this.getText(confirm.text) }\n ok={ this.getText(confirm.ok) || I18n.t('ra_Ok') }\n cancel={ this.getText(confirm.cancel) || I18n.t('ra_Cancel') }\n icon={icon}\n onClose={isOk =>\n this.setState({ confirmDialog: false}, () => {\n if (isOk) {\n const data = JSON.parse(JSON.stringify(this.props.data));\n if (this.state.confirmDepAttr) {\n ConfigGeneric.setValue(data, this.state.confirmDepAttr, this.state.confirmDepNewValue);\n }\n\n ConfigGeneric.setValue(data, this.state.confirmAttr, this.state.confirmNewValue);\n this.setState({\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmOldValue: null,\n confirmData: null,\n }, () =>\n this.props.onChange(data));\n } else {\n this.setState({\n confirmDialog: false,\n confirmDepAttr: null,\n confirmDepNewValue: null,\n confirmNewValue: null,\n confirmAttr: null,\n confirmOldValue: null,\n confirmData: null,\n });\n }\n })\n }\n />;\n }\n\n onChange(attr, newValue, cb) {\n const data = JSON.parse(JSON.stringify(this.props.data));\n ConfigGeneric.setValue(data, attr, newValue);\n\n if (this.props.schema.confirm && this.execute(this.props.schema.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {\n return this.setState({\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmData: null,\n });\n } else {\n // find any inputs with confirmation\n if (this.props.schema.confirmDependsOn) {\n for (let z = 0; z < this.props.schema.confirmDependsOn.length; z++) {\n const dep = this.props.schema.confirmDependsOn[z];\n if (dep.confirm) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n if (this.execute(dep.confirm.condition, false, data, this.props.arrayIndex, this.props.globalData)) {\n return this.setState({\n confirmDialog: true,\n confirmNewValue: newValue,\n confirmAttr: attr,\n confirmDepNewValue: val,\n confirmDepAttr: dep.attr,\n confirmData: dep.confirm,\n });\n }\n }\n }\n }\n\n const changed = [];\n if (this.props.schema.onChangeDependsOn) {\n for (let z = 0; z < this.props.schema.onChangeDependsOn.length; z++) {\n const dep = this.props.schema.onChangeDependsOn[z];\n if (dep.onChange) {\n const val = ConfigGeneric.getValue(data, dep.attr);\n\n let _newValue;\n if (this.props.custom) {\n _newValue = this.executeCustom(dep.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData);\n } else {\n _newValue = this.execute(dep.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);\n }\n\n if (_newValue !== val) {\n ConfigGeneric.setValue(data, dep.attr, _newValue);\n changed.push(dep.attr);\n }\n }\n }\n }\n\n if (this.props.schema.hiddenDependsOn) {\n for (let z = 0; z < this.props.schema.hiddenDependsOn.length; z++) {\n const dep = this.props.schema.hiddenDependsOn[z];\n dep.hidden && changed.push(dep.attr);\n }\n }\n\n if (this.props.schema.labelDependsOn) {\n for (let z = 0; z < this.props.schema.labelDependsOn.length; z++) {\n const dep = this.props.schema.labelDependsOn[z];\n dep.hidden && changed.push(dep.attr);\n }\n }\n\n if (this.props.schema.helpDependsOn) {\n for (let z = 0; z < this.props.schema.helpDependsOn.length; z++) {\n const dep = this.props.schema.helpDependsOn[z];\n dep.hidden && changed.push(dep.attr);\n }\n }\n\n if (this.props.schema.onChange && !this.props.schema.onChange.ignoreOwnChanges) {\n const val = ConfigGeneric.getValue(data, this.props.attr);\n\n const newValue = this.props.custom ?\n this.executeCustom(this.props.schema.onChange.calculateFunc, data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData)\n :\n this.execute(this.props.schema.onChange.calculateFunc, val, data, this.props.arrayIndex, this.props.globalData);\n if (newValue !== val) {\n ConfigGeneric.setValue(data, this.props.attr, newValue);\n }\n }\n\n if (this.props.custom) {\n this.props.onChange(attr, newValue, () => cb && cb());\n\n changed && changed.length && changed.forEach((_attr, i) =>\n setTimeout(() => this.props.onChange(_attr, ConfigGeneric.getValue(data, _attr)), i * 50));\n } else {\n this.props.onChange(data, undefined, () => {\n changed.length && this.props.forceUpdate(changed, data);\n cb && cb();\n });\n }\n }\n }\n\n execute(func, defaultValue, data, arrayIndex, globalData) {\n if (func && typeof func === 'object') {\n func = func.func;\n }\n\n if (!func) {\n return defaultValue;\n } else {\n try {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', '_system', '_alive', '_common', '_socket', '_instance', 'arrayIndex', 'globalData', func.includes('return') ? func : 'return ' + func);\n const result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket, this.props.instance, arrayIndex, globalData);\n // console.log(result);\n return result;\n } catch (e) {\n console.error(`Cannot execute ${func}: ${e}`);\n return defaultValue;\n }\n }\n }\n\n executeCustom(func, data, customObj, instanceObj, arrayIndex, globalData) {\n if (func && typeof func === 'object') {\n func = func.func;\n }\n\n if (!func) {\n return null;\n } else {\n try {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', '_system', 'instanceObj', 'customObj', '_socket', 'arrayIndex', 'globalData', func.includes('return') ? func : 'return ' + func);\n const result = f(data || this.props.data, this.props.originalData, this.props.systemConfig, instanceObj, customObj, this.props.socket, arrayIndex, globalData);\n console.log(result);\n return result;\n } catch (e) {\n console.error(`Cannot execute ${func}: ${e}`);\n return null;\n }\n }\n }\n\n calculate(schema) {\n let error;\n let disabled;\n let hidden;\n let defaultValue;\n\n if (this.props.custom) {\n error = schema.validator ? !this.executeCustom(schema.validator, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;\n disabled = schema.disabled ? this.executeCustom(schema.disabled, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;\n hidden = schema.hidden ? this.executeCustom(schema.hidden, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : false;\n defaultValue = schema.defaultFunc ? this.executeCustom(schema.defaultFunc, this.props.data, this.props.customObj, this.props.instanceObj, this.props.arrayIndex, this.props.globalData) : schema.default;\n } else {\n error = schema.validator ? !this.execute(schema.validator, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;\n disabled = schema.disabled ? this.execute(schema.disabled, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;\n hidden = schema.hidden ? this.execute(schema.hidden, false, this.props.data, this.props.arrayIndex, this.props.globalData) : false;\n defaultValue = schema.defaultFunc ? this.execute(schema.defaultFunc, schema.default, this.props.data, this.props.arrayIndex, this.props.globalData) : schema.default;\n }\n\n return { error, disabled, hidden, defaultValue };\n }\n\n onError(attr, error) {\n if (!error) {\n delete this.isError[attr];\n } else {\n this.isError[attr] = error;\n }\n\n this.props.onError && this.props.onError(attr, error);\n }\n\n renderItem(error, disabled, defaultValue) {\n return this.getText(this.props.schema.label) || this.getText(this.props.schema.text)\n }\n\n renderHelp(text, link, noTranslation) {\n if (!link) {\n text = this.getText(text, noTranslation) || '';\n if (text && (text.includes('<a ') || text.includes('<br') || text.includes('<b>') || text.includes('<i>'))) {\n return Utils.renderTextWithA(text);\n } else {\n return text;\n }\n } else {\n return <a\n href={link}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ color: this.props.themeType === 'dark' ? '#a147ff' : '#5b238f', textDecoration: 'underline' }}\n >{this.getText(text, noTranslation)}</a>;\n }\n }\n\n getPattern(pattern, data) {\n data = data || this.props.data;\n if (!pattern) {\n return '';\n } else {\n if (typeof pattern === 'object') {\n pattern = pattern.func;\n }\n\n try {\n if (this.props.custom) {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', 'instanceObj', 'customObj', '_socket', 'return `' + pattern.replace(/`/g, '\\\\`') + '`');\n return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.instanceObj, this.props.customObj, this.props.socket, this.props.arrayIndex, this.props.globalData);\n } else {\n // eslint-disable-next-line no-new-func\n const f = new Function('data', 'originalData', 'arrayIndex', 'globalData', '_system', '_alive', '_common', '_socket', 'return `' + pattern.replace(/`/g, '\\\\`') + '`');\n return f(data, this.props.originalData, this.props.arrayIndex, this.props.globalData, this.props.systemConfig, this.props.alive, this.props.common, this.props.socket);\n }\n } catch (e) {\n console.error(`Cannot execute ${pattern}: ${e}`);\n return pattern;\n }\n }\n }\n\n render() {\n const schema = this.props.schema;\n\n if (!schema) {\n return null;\n }\n\n if (this.props.alive && this.defaultSendToDone === false) {\n this.sendToTimeout = setTimeout(() => {this.sendToTimeout = null; this.sendTo();}, 200);\n }\n\n const { error, disabled, hidden, defaultValue } = this.calculate(schema);\n\n if (hidden) {\n // Remove all errors if element is hidden\n if (Object.keys(this.isError).length) {\n setTimeout(isError =>\n Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100, JSON.parse(JSON.stringify(this.isError)));\n this.isError = {};\n }\n\n if (schema.hideOnlyControl) {\n const item = <Grid\n item\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign(\n {},\n {marginBottom: 0, /*marginRight: 8, */textAlign: 'left'},\n schema.style,\n this.props.themeType === 'dark' ? schema.darkStyle : {}\n )}\n />;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {item}\n </>;\n } else {\n return item;\n }\n } else {\n return null;\n }\n } else {\n // Add error\n if (schema.validatorNoSaveOnError) {\n if (error && !Object.keys(this.isError).length) {\n this.isError = {[this.props.attr]: schema.validatorErrorText ? I18n.t(schema.validatorErrorText) : true};\n setTimeout(isError =>\n Object.keys(isError).forEach(attr => this.props.onError(attr, isError[attr])),\n 100, JSON.parse(JSON.stringify(this.isError)));\n } else if (!error && Object.keys(this.isError).length) {\n setTimeout(isError =>\n Object.keys(isError).forEach(attr => this.props.onError(attr)),\n 100, JSON.parse(JSON.stringify(this.isError)));\n this.isError = {};\n }\n }\n\n const renderedItem = this.renderItem(error, disabled || this.props.commandRunning || this.props.disabled, defaultValue);\n\n const item = <Grid\n item\n title={this.getText(schema.tooltip)}\n xs={schema.xs || undefined}\n lg={schema.lg || undefined}\n md={schema.md || undefined}\n sm={schema.sm || undefined}\n style={Object.assign({}, {\n marginBottom: 0,\n // marginRight: 8,\n textAlign: 'left',\n width: schema.type === 'divider' || schema.type === 'header' ? schema.width || '100%' : undefined\n }, schema.style, this.props.themeType === 'dark' ? schema.darkStyle : {})}>\n { this.props.schema.defaultSendTo && this.props.schema.button ? <Grid container style={{ width: '100%' }}>\n <Grid item flex={1}>{renderedItem}</Grid>\n <Grid item><Button\n variant=\"outlined\"\n onClick={() => this.sendTo()}\n title={this.props.schema.buttonTooltip ? this.getText(this.props.schema.buttonTooltip, this.props.schema.buttonTooltipNoTranslation) : I18n.t('ra_Request data by instance')}\n >{this.getText(this.props.schema.button)}</Button></Grid>\n </Grid>\n :\n renderedItem\n }\n </Grid>;\n\n if (schema.newLine) {\n return <>\n <div style={{flexBasis: '100%', height: 0}} />\n {this.renderConfirmDialog()}\n {item}\n </>;\n } else {\n if (this.state.confirmDialog) {\n return <>\n {this.renderConfirmDialog()}\n {item}\n </>;\n } else {\n return item;\n }\n }\n }\n }\n}\n\nConfigGeneric.propTypes = {\n socket: PropTypes.object.isRequired,\n data: PropTypes.object,\n originalData: PropTypes.object,\n schema: PropTypes.object,\n attr: PropTypes.string,\n value: PropTypes.any,\n themeName: PropTypes.string,\n style: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n customs: PropTypes.object,\n forceUpdate: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n\n systemConfig: PropTypes.object,\n alive: PropTypes.bool,\n common: PropTypes.object,\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n\n customObj: PropTypes.object,\n instanceObj: PropTypes.object,\n custom: PropTypes.bool,\n};\n\nexport default ConfigGeneric;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAsD;AAAA;AAAA;AAAA;AAAA,IAEhDA,aAAa;EAAA;EAAA;EAOf,uBAAYC,KAAK,EAAE;IAAA;IAAA;IACf,0BAAMA,KAAK;IAAE,6FAiGN,UAAAC,IAAI,EAAI;MACf,IAAMC,KAAK,GAAGH,aAAa,CAACI,QAAQ,CAACF,IAAI,IAAI,MAAKD,KAAK,CAACC,IAAI,EAAE,MAAKD,KAAK,CAACI,IAAI,CAAC,IAAI,EAAE;MACpF,IAAI,MAAKC,KAAK,CAACH,KAAK,KAAKA,KAAK,EAAE;QAC5B,MAAKI,QAAQ,CAAC;UAAEJ,KAAK,EAALA;QAAM,CAAC,CAAC;MAC5B,CAAC,MAAM;QACH,MAAKK,WAAW,EAAE;MACtB;IACJ,CAAC;IAtGG,MAAKF,KAAK,GAAG;MACTG,aAAa,EAAE,KAAK;MACpBC,eAAe,EAAE,IAAI;MACrBC,WAAW,EAAE,IAAI;MACjBC,WAAW,EAAE;IACjB,CAAC;IAED,MAAKC,OAAO,GAAG,CAAC,CAAC;IAEjB,IAAIZ,KAAK,CAACa,MAAM,EAAE;MACd,IAAIb,KAAK,CAACc,MAAM,EAAE;QACd,MAAKC,YAAY,GAAGf,KAAK,CAACa,MAAM,CAACG,WAAW,GAAG,MAAKC,aAAa,CAACjB,KAAK,CAACa,MAAM,CAACG,WAAW,EAAEhB,KAAK,CAACa,MAAM,WAAQ,EAAEb,KAAK,CAACC,IAAI,EAAED,KAAK,CAACkB,WAAW,EAAElB,KAAK,CAACmB,UAAU,EAAEnB,KAAK,CAACoB,UAAU,CAAC,GAAGpB,KAAK,CAACa,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BlG,WAAW,EAAEiG,qBAAS,CAACG,MAAM;EAC7BnG,QAAQ,EAAEgG,qBAAS,CAACQ,MAAM;EAC1BC,UAAU,EAAET,qBAAS,CAACG,MAAM;EAC5BO,YAAY,EAAEV,qBAAS,CAACO,IAAI;EAE5BtE,SAAS,EAAE+D,qBAAS,CAACC,MAAM;EAC3B9H,WAAW,EAAE6H,qBAAS,CAACC,MAAM;EAC7BlI,MAAM,EAAEiI,qBAAS,CAACO;AACtB,CAAC;AAAC,eAEavJ,aAAa;AAAA"}
|
|
@@ -83,7 +83,7 @@ var ConfigIP = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
83
83
|
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
84
84
|
className: this.props.classes.fullWidth,
|
|
85
85
|
variant: "standard"
|
|
86
|
-
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], null, this.getText(this.props.schema.label)), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
86
|
+
}, this.props.schema.label ? /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], null, this.getText(this.props.schema.label)) : null, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
87
87
|
variant: "standard",
|
|
88
88
|
error: !!error,
|
|
89
89
|
disabled: !!disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigIP.js","names":["styles","fullWidth","width","ConfigIP","props","socket","getHostByIp","common","host","then","ips","schema","listenOnAllPorts","filter","item","address","onlyIp4","family","onlyIp6","forEach","name","I18n","t","setState","error","disabled","defaultValue","value","ConfigGeneric","getValue","data","attr","state","find","classes","
|
|
1
|
+
{"version":3,"file":"ConfigIP.js","names":["styles","fullWidth","width","ConfigIP","props","socket","getHostByIp","common","host","then","ips","schema","listenOnAllPorts","filter","item","address","onlyIp4","family","onlyIp6","forEach","name","I18n","t","setState","error","disabled","defaultValue","value","ConfigGeneric","getValue","data","attr","state","find","classes","label","getText","val","e","onChange","target","map","i","help","renderHelp","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigIP.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\nimport Select from '@mui/material/Select';\n\nimport I18n from './wrapper/i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = () => ({\n fullWidth: {\n width: '100%'\n }\n});\n\nclass ConfigIP extends ConfigGeneric {\n\n componentDidMount() {\n super.componentDidMount();\n this.props.socket.getHostByIp(this.props.common.host)\n .then(ips => {\n // [{name, address, family}]\n if (!this.props.schema.listenOnAllPorts) {\n ips = ips.filter(item => item.address !== '0.0.0.0' && item.address !== '::');\n }\n if (this.props.schema.onlyIp4) {\n ips = ips.filter(item => item.family === 'ipv4');\n } else\n if (this.props.schema.onlyIp6) {\n ips = ips.filter(item => item.family === 'ipv6');\n }\n ips.forEach(item => {\n if (item.address === '0.0.0.0') {\n item.name = '[IPv4] 0.0.0.0 - ' + I18n.t('ra_Listen on all IPs');\n } else\n if (item.address === '::') {\n item.name = '[IPv6] :: - ' + I18n.t('ra_Listen on all IPs');\n }\n });\n this.setState({ips});\n });\n }\n\n renderItem(error, disabled, defaultValue) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n const item = this.state.ips?.find(item => item.address === value);\n\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n {this.props.schema.label ? <InputLabel>{this.getText(this.props.schema.label)}</InputLabel> : null}\n <Select\n variant=\"standard\"\n error={!!error}\n disabled={!!disabled}\n value={value}\n renderValue={val => item?.name || val}\n onChange={e => this.onChange(this.props.attr, e.target.value)}\n >\n {this.state.ips?.map((item, i) =>\n <MenuItem key={i} value={item.address}>{item.name}</MenuItem>)}\n </Select>\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n </FormControl>;\n }\n}\n\nConfigIP.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigIP);"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAA4C;AAAA;AAE5C,IAAMA,MAAM,GAAG,SAATA,MAAM;EAAA,OAAU;IAClBC,SAAS,EAAE;MACPC,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGC,QAAQ;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAEV,6BAAoB;MAAA;MAChB;MACA,IAAI,CAACC,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,IAAI,CAAC,CAChDC,IAAI,CAAC,UAAAC,GAAG,EAAI;QACT;QACA,IAAI,CAAC,KAAI,CAACN,KAAK,CAACO,MAAM,CAACC,gBAAgB,EAAE;UACrCF,GAAG,GAAGA,GAAG,CAACG,MAAM,CAAC,UAAAC,IAAI;YAAA,OAAIA,IAAI,CAACC,OAAO,KAAK,SAAS,IAAID,IAAI,CAACC,OAAO,KAAK,IAAI;UAAA,EAAC;QACjF;QACA,IAAI,KAAI,CAACX,KAAK,CAACO,MAAM,CAACK,OAAO,EAAE;UAC3BN,GAAG,GAAGA,GAAG,CAACG,MAAM,CAAC,UAAAC,IAAI;YAAA,OAAIA,IAAI,CAACG,MAAM,KAAK,MAAM;UAAA,EAAC;QACpD,CAAC,MACD,IAAI,KAAI,CAACb,KAAK,CAACO,MAAM,CAACO,OAAO,EAA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P,qBAAS,CAACI,MAAM;EAC3BtB,IAAI,EAAEkB,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCvC,MAAM,EAAEqC,qBAAS,CAACC,MAAM;EACxBO,OAAO,EAAER,qBAAS,CAACS,IAAI;EACvBlB,QAAQ,EAAES,qBAAS,CAACS;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAAC1D,MAAM,CAAC,CAACG,QAAQ,CAAC;AAAA"}
|
|
@@ -52,27 +52,25 @@ var ConfigImageUpload = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
52
52
|
var _this2 = this;
|
|
53
53
|
var value;
|
|
54
54
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
55
|
-
while (1) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return _context.stop();
|
|
75
|
-
}
|
|
55
|
+
while (1) switch (_context.prev = _context.next) {
|
|
56
|
+
case 0:
|
|
57
|
+
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigImageUpload.prototype), "componentDidMount", this).call(this);
|
|
58
|
+
if (this.props.schema.base64) {
|
|
59
|
+
value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
60
|
+
this.setState({
|
|
61
|
+
value: value
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
this.props.socket.fileExists(this.props.adapterName + '.' + this.props.instance, this.props.attr).then(function (exist) {
|
|
65
|
+
if (exist && _this2.imageRef.current) {
|
|
66
|
+
_this2.imageRef.current.src = _this2._getUrl();
|
|
67
|
+
_this2.imageRef.current.style.display = 'block';
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
case 2:
|
|
72
|
+
case "end":
|
|
73
|
+
return _context.stop();
|
|
76
74
|
}
|
|
77
75
|
}, _callee, this);
|
|
78
76
|
}));
|
|
@@ -101,9 +99,9 @@ var ConfigImageUpload = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
101
99
|
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
102
100
|
className: this.props.classes.fullWidth,
|
|
103
101
|
variant: "standard"
|
|
104
|
-
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
102
|
+
}, this.props.schema.label ? /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
105
103
|
shrink: true
|
|
106
|
-
}, this.getText(this.props.schema.label)), /*#__PURE__*/_react["default"].createElement(_UploadImage["default"], {
|
|
104
|
+
}, this.getText(this.props.schema.label)) : null, /*#__PURE__*/_react["default"].createElement(_UploadImage["default"], {
|
|
107
105
|
error: !!error,
|
|
108
106
|
disabled: disabled,
|
|
109
107
|
accept: this.props.schema.accept,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigImageUpload.js","names":["styles","theme","fullWidth","width","image","ConfigImageUpload","props","imageRef","React","createRef","index","Date","now","schema","base64","value","ConfigGeneric","getValue","data","attr","setState","socket","fileExists","adapterName","instance","then","exist","current","src","_getUrl","style","display","update","url","window","location","port","protocol","hostname","error","disabled","defaultValue","classes","getText","label","accept","crop","maxSize","state","undefined","onChange","deleteFile","startsWith","split","writeFile64","I18n","t","help","renderHelp","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigImageUpload.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport UploadImage from './wrapper/Components/UploadImage';\nimport I18n from './wrapper/i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n image: {\n width: 100\n }\n});\n\nclass ConfigImageUpload extends ConfigGeneric {\n constructor(props) {\n super(props);\n this.imageRef = React.createRef();\n this.index = Date.now();\n }\n async componentDidMount() {\n super.componentDidMount();\n\n if (this.props.schema.base64) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n this.setState({ value });\n } else {\n this.props.socket.fileExists(this.props.adapterName + '.' + this.props.instance, this.props.attr)\n .then(exist => {\n if (exist && this.imageRef.current) {\n this.imageRef.current.src = this._getUrl();\n this.imageRef.current.style.display = 'block';\n }\n });\n }\n }\n\n _getUrl(update) {\n if (update) {\n this.index = Date.now();\n }\n let url = `files/${this.props.adapterName}.${this.props.instance}/${this.props.attr}?t=${this.index}`;\n if (window.location.port === '3000') {\n url = `${window.location.protocol}//${window.location.hostname}:8081/${url}`;\n }\n\n return url;\n }\n\n renderItem(error, disabled, defaultValue) {\n // eslint-disable-next-line\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel>\n <UploadImage\n error={!!error}\n disabled={disabled}\n accept={this.props.schema.accept}\n crop={this.props.schema.crop}\n maxSize={this.props.schema.maxSize || 256 * 1024}\n icon={this.state.value || undefined}\n removeIconFunc={() => {\n if (this.props.schema.base64) {\n this.setState({ value: null }, () =>\n this.onChange(this.props.attr, this.state.value));\n } else {\n // delete file to /instance/attr\n this.props.socket.deleteFile(this.props.adapterName + '.' + this.props.instance, this.props.attr);\n // update image\n if (this.imageRef.current) {\n this.imageRef.current.style.display = 'none';\n this.imageRef.current.src = '';\n }\n }\n }}\n onChange={base64 => {\n if (this.props.schema.base64) {\n this.setState({ value: base64 }, () =>\n this.onChange(this.props.attr, this.state.value));\n } else {\n if (base64.startsWith('data')) {\n base64 = base64.split(',')[1];\n }\n // upload file to /instance/attr\n this.props.socket.writeFile64(this.props.adapterName + '.' + this.props.instance, this.props.attr, base64)\n .then(() => {\n if (this.imageRef.current) {\n this.imageRef.current.style.display = 'block';\n this.imageRef.current.src = this._getUrl(true);\n }\n });\n }\n }}\n t={I18n.t}\n />\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n {this.props.schema.base64 ? null : <img\n src={this._getUrl()}\n ref={this.imageRef}\n className={this.props.classes.image}\n style={{display: 'none'}}\n alt=\"Background\"\n />}\n </FormControl>;\n }\n}\n\nConfigImageUpload.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigImageUpload);"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAA4C;AAAA;AAE5C,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IACX,CAAC;IACDC,KAAK,EAAE;MACHD,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGE,iBAAiB;EAAA;EAAA;EACnB,2BAAYC,KAAK,EAAE;IAAA;IAAA;IACf,0BAAMA,KAAK;IACX,MAAKC,QAAQ,gBAAGC,iBAAK,CAACC,SAAS,EAAE;IACjC,MAAKC,KAAK,GAAGC,IAAI,CAACC,GAAG,EAAE;IAAC;EAC5B;EAAC;IAAA;IAAA;MAAA,uGACD;QAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBACI;gBAEA,IAAI,IAAI,CAACN,KAAK,CAACO,MAAM,CAACC,MAAM,EAAE;kBACpBC,KAAK,GAAGC,0BAAa,CAACC,QAAQ,CAAC,IAAI,CAACX,KAAK,CAACY,IAAI,EAAE,IAA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D,KAAK,CAACO,MAAM,CAAC4C,IAAI,EAAE,IAAI,CAACnD,KAAK,CAACO,MAAM,CAAC8C,QAAQ,EAAE,IAAI,CAACrD,KAAK,CAACO,MAAM,CAAC+C,aAAa,CAAC,CAAkB,GAAG,IAAI,EACvK,IAAI,CAACtD,KAAK,CAACO,MAAM,CAACC,MAAM,GAAI,IAAI,gBAAG;QAChC,GAAG,EAAE,IAAI,CAACe,OAAO,EAAG;QACpB,GAAG,EAAE,IAAI,CAACtB,QAAS;QACnB,SAAS,EAAE,IAAI,CAACD,KAAK,CAACoC,OAAO,CAACtC,KAAM;QACpC,KAAK,EAAE;UAAC2B,OAAO,EAAE;QAAM,CAAE;QACzB,GAAG,EAAC;MAAY,EAClB,CACQ;IAClB;EAAC;EAAA;AAAA,EAzF2Bf,0BAAa;AA4F7CX,iBAAiB,CAACwD,SAAS,GAAG;EAC1BxC,MAAM,EAAEyC,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCC,SAAS,EAAEH,qBAAS,CAACI,MAAM;EAC3BC,SAAS,EAAEL,qBAAS,CAACI,MAAM;EAC3BpC,KAAK,EAAEgC,qBAAS,CAACC,MAAM;EACvBK,SAAS,EAAEN,qBAAS,CAACI,MAAM;EAC3BhD,IAAI,EAAE4C,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCnD,MAAM,EAAEiD,qBAAS,CAACC,MAAM;EACxBM,OAAO,EAAEP,qBAAS,CAACQ,IAAI;EACvBpB,QAAQ,EAAEY,qBAAS,CAACQ;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAACvE,MAAM,CAAC,CAACK,iBAAiB,CAAC;AAAA"}
|
|
1
|
+
{"version":3,"file":"ConfigImageUpload.js","names":["styles","theme","fullWidth","width","image","ConfigImageUpload","props","imageRef","React","createRef","index","Date","now","schema","base64","value","ConfigGeneric","getValue","data","attr","setState","socket","fileExists","adapterName","instance","then","exist","current","src","_getUrl","style","display","update","url","window","location","port","protocol","hostname","error","disabled","defaultValue","classes","label","getText","accept","crop","maxSize","state","undefined","onChange","deleteFile","startsWith","split","writeFile64","I18n","t","help","renderHelp","helpLink","noTranslation","propTypes","PropTypes","object","isRequired","themeType","string","themeName","className","onError","func","withStyles"],"sources":["JsonConfigComponent/ConfigImageUpload.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport InputLabel from '@mui/material/InputLabel';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormControl from '@mui/material/FormControl';\n\nimport UploadImage from './wrapper/Components/UploadImage';\nimport I18n from './wrapper/i18n';\n\nimport ConfigGeneric from './ConfigGeneric';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n image: {\n width: 100\n }\n});\n\nclass ConfigImageUpload extends ConfigGeneric {\n constructor(props) {\n super(props);\n this.imageRef = React.createRef();\n this.index = Date.now();\n }\n async componentDidMount() {\n super.componentDidMount();\n\n if (this.props.schema.base64) {\n const value = ConfigGeneric.getValue(this.props.data, this.props.attr);\n this.setState({ value });\n } else {\n this.props.socket.fileExists(this.props.adapterName + '.' + this.props.instance, this.props.attr)\n .then(exist => {\n if (exist && this.imageRef.current) {\n this.imageRef.current.src = this._getUrl();\n this.imageRef.current.style.display = 'block';\n }\n });\n }\n }\n\n _getUrl(update) {\n if (update) {\n this.index = Date.now();\n }\n let url = `files/${this.props.adapterName}.${this.props.instance}/${this.props.attr}?t=${this.index}`;\n if (window.location.port === '3000') {\n url = `${window.location.protocol}//${window.location.hostname}:8081/${url}`;\n }\n\n return url;\n }\n\n renderItem(error, disabled, defaultValue) {\n // eslint-disable-next-line\n return <FormControl className={this.props.classes.fullWidth} variant=\"standard\">\n {this.props.schema.label ? <InputLabel shrink>{this.getText(this.props.schema.label)}</InputLabel> : null}\n <UploadImage\n error={!!error}\n disabled={disabled}\n accept={this.props.schema.accept}\n crop={this.props.schema.crop}\n maxSize={this.props.schema.maxSize || 256 * 1024}\n icon={this.state.value || undefined}\n removeIconFunc={() => {\n if (this.props.schema.base64) {\n this.setState({ value: null }, () =>\n this.onChange(this.props.attr, this.state.value));\n } else {\n // delete file to /instance/attr\n this.props.socket.deleteFile(this.props.adapterName + '.' + this.props.instance, this.props.attr);\n // update image\n if (this.imageRef.current) {\n this.imageRef.current.style.display = 'none';\n this.imageRef.current.src = '';\n }\n }\n }}\n onChange={base64 => {\n if (this.props.schema.base64) {\n this.setState({ value: base64 }, () =>\n this.onChange(this.props.attr, this.state.value));\n } else {\n if (base64.startsWith('data')) {\n base64 = base64.split(',')[1];\n }\n // upload file to /instance/attr\n this.props.socket.writeFile64(this.props.adapterName + '.' + this.props.instance, this.props.attr, base64)\n .then(() => {\n if (this.imageRef.current) {\n this.imageRef.current.style.display = 'block';\n this.imageRef.current.src = this._getUrl(true);\n }\n });\n }\n }}\n t={I18n.t}\n />\n {this.props.schema.help ? <FormHelperText>{this.renderHelp(this.props.schema.help, this.props.schema.helpLink, this.props.schema.noTranslation)}</FormHelperText> : null}\n {this.props.schema.base64 ? null : <img\n src={this._getUrl()}\n ref={this.imageRef}\n className={this.props.classes.image}\n style={{display: 'none'}}\n alt=\"Background\"\n />}\n </FormControl>;\n }\n}\n\nConfigImageUpload.propTypes = {\n socket: PropTypes.object.isRequired,\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigImageUpload);"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAA4C;AAAA;AAE5C,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK;EAAA,OAAK;IACrBC,SAAS,EAAE;MACPC,KAAK,EAAE;IACX,CAAC;IACDC,KAAK,EAAE;MACHD,KAAK,EAAE;IACX;EACJ,CAAC;AAAA,CAAC;AAAC,IAEGE,iBAAiB;EAA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,qBAAS,CAACC,MAAM,CAACC,UAAU;EACjCnD,MAAM,EAAEiD,qBAAS,CAACC,MAAM;EACxBM,OAAO,EAAEP,qBAAS,CAACQ,IAAI;EACvBpB,QAAQ,EAAEY,qBAAS,CAACQ;AACxB,CAAC;AAAC,eAEa,IAAAC,kBAAU,EAACvE,MAAM,CAAC,CAACK,iBAAiB,CAAC;AAAA"}
|
|
@@ -92,78 +92,76 @@ var ConfigInstanceSelect = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
92
92
|
var _this2 = this;
|
|
93
93
|
var value, adapter;
|
|
94
94
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
95
|
-
while (1) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return instance && instance._id.startsWith('system.adapter.' + _this2.props.schema.adapter + '.');
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
selectOptions = instances.map(function (instance) {
|
|
122
|
-
return {
|
|
123
|
-
value: _this2.props.schema["long"] ? instance._id : _this2.props.schema["short"] ? instance._id.split('.').pop() : instance._id.replace(/^system\.adapter\./, ''),
|
|
124
|
-
label: "".concat(instance.common.name, " [").concat(instance._id.replace(/^system\.adapter\./, ''), "]")
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
selectOptions.sort(function (a, b) {
|
|
128
|
-
if (a.value > b.value) {
|
|
129
|
-
return 1;
|
|
130
|
-
} else if (a.value < b.value) {
|
|
131
|
-
return -1;
|
|
132
|
-
} else {
|
|
133
|
-
return 0;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
selectOptions.unshift({
|
|
137
|
-
label: _i18n["default"].t(_ConfigGeneric2["default"].NONE_LABEL),
|
|
138
|
-
value: _ConfigGeneric2["default"].NONE_VALUE
|
|
139
|
-
});
|
|
140
|
-
if (_this2.props.schema.all) {
|
|
141
|
-
selectOptions.unshift({
|
|
142
|
-
label: _i18n["default"].t('sch_all'),
|
|
143
|
-
value: '*'
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
_this2.setState({
|
|
147
|
-
value: value || '',
|
|
148
|
-
selectOptions: selectOptions
|
|
149
|
-
});
|
|
150
|
-
_context.next = 8;
|
|
151
|
-
return _this2.props.socket.subscribeObject("system.adapter.".concat(adapter ? adapter + '.' : '', "*"), _this2.onInstancesUpdate);
|
|
152
|
-
case 8:
|
|
153
|
-
case "end":
|
|
154
|
-
return _context.stop();
|
|
95
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
96
|
+
case 0:
|
|
97
|
+
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigInstanceSelect.prototype), "componentDidMount", this).call(this);
|
|
98
|
+
value = _ConfigGeneric2["default"].getValue(this.props.data, this.props.attr);
|
|
99
|
+
adapter = this.props.schema.adapter;
|
|
100
|
+
if (adapter === '_dataSources') {
|
|
101
|
+
adapter = undefined;
|
|
102
|
+
}
|
|
103
|
+
this.props.socket.getAdapterInstances(adapter, true).then( /*#__PURE__*/function () {
|
|
104
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(instances) {
|
|
105
|
+
var selectOptions;
|
|
106
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
107
|
+
while (1) switch (_context.prev = _context.next) {
|
|
108
|
+
case 0:
|
|
109
|
+
if (_this2.props.schema.adapter === '_dataSources') {
|
|
110
|
+
// get only "data-sources", like history, sql, influx
|
|
111
|
+
instances = instances.filter(function (instance) {
|
|
112
|
+
return instance && instance.common && instance.common.getHistory;
|
|
113
|
+
});
|
|
114
|
+
} else if (_this2.props.schema.adapter) {
|
|
115
|
+
instances = instances.filter(function (instance) {
|
|
116
|
+
return instance && instance._id.startsWith('system.adapter.' + _this2.props.schema.adapter + '.');
|
|
117
|
+
});
|
|
155
118
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
119
|
+
selectOptions = instances.map(function (instance) {
|
|
120
|
+
return {
|
|
121
|
+
value: _this2.props.schema["long"] ? instance._id : _this2.props.schema["short"] ? instance._id.split('.').pop() : instance._id.replace(/^system\.adapter\./, ''),
|
|
122
|
+
label: "".concat(instance.common.name, " [").concat(instance._id.replace(/^system\.adapter\./, ''), "]")
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
selectOptions.sort(function (a, b) {
|
|
126
|
+
if (a.value > b.value) {
|
|
127
|
+
return 1;
|
|
128
|
+
} else if (a.value < b.value) {
|
|
129
|
+
return -1;
|
|
130
|
+
} else {
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
if (_this2.props.schema.allowDeactivate !== false) {
|
|
135
|
+
selectOptions.unshift({
|
|
136
|
+
label: _i18n["default"].t(_ConfigGeneric2["default"].NONE_LABEL),
|
|
137
|
+
value: _ConfigGeneric2["default"].NONE_VALUE
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (_this2.props.schema.all) {
|
|
141
|
+
selectOptions.unshift({
|
|
142
|
+
label: _i18n["default"].t('sch_all'),
|
|
143
|
+
value: '*'
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
_this2.setState({
|
|
147
|
+
value: value || '',
|
|
148
|
+
selectOptions: selectOptions
|
|
149
|
+
});
|
|
150
|
+
_context.next = 8;
|
|
151
|
+
return _this2.props.socket.subscribeObject("system.adapter.".concat(adapter ? "".concat(adapter, ".") : '', "*"), _this2.onInstancesUpdate);
|
|
152
|
+
case 8:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context.stop();
|
|
155
|
+
}
|
|
156
|
+
}, _callee);
|
|
157
|
+
}));
|
|
158
|
+
return function (_x) {
|
|
159
|
+
return _ref.apply(this, arguments);
|
|
160
|
+
};
|
|
161
|
+
}());
|
|
162
|
+
case 5:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context2.stop();
|
|
167
165
|
}
|
|
168
166
|
}, _callee2, this);
|
|
169
167
|
}));
|