@iobroker/adapter-react-v5 3.1.24 → 3.1.25
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/JsonConfigComponent/ConfigSendto.js +171 -9
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +21 -17
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/README.md +3 -0
- package/i18n/de.json +4 -1
- package/i18n/en.json +4 -1
- package/i18n/es.json +4 -1
- package/i18n/fr.json +4 -1
- package/i18n/it.json +4 -1
- package/i18n/nl.json +4 -1
- package/i18n/pl.json +4 -1
- package/i18n/pt.json +4 -1
- package/i18n/ru.json +4 -1
- package/i18n/zh-cn.json +4 -1
- package/package.json +1 -1
|
@@ -7,8 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
10
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
13
|
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
+
|
|
12
18
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
19
|
|
|
14
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -47,6 +53,10 @@ var _Error2 = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
|
47
53
|
|
|
48
54
|
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
49
55
|
|
|
56
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
|
+
|
|
58
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
|
+
|
|
50
60
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
51
61
|
|
|
52
62
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -64,6 +74,82 @@ var styles = function styles(theme) {
|
|
|
64
74
|
};
|
|
65
75
|
};
|
|
66
76
|
|
|
77
|
+
function ip2int(ip) {
|
|
78
|
+
return ip.split('.').reduce(function (ipInt, octet) {
|
|
79
|
+
return (ipInt << 8) + parseInt(octet, 10);
|
|
80
|
+
}, 0) >>> 0;
|
|
81
|
+
} // copied from iobroker.admin/src-rx/src/Utils.js
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
function findNetworkAddressOfHost(obj, localIp) {
|
|
85
|
+
var _obj$native, _obj$native$hardware;
|
|
86
|
+
|
|
87
|
+
var networkInterfaces = obj === null || obj === void 0 ? void 0 : (_obj$native = obj["native"]) === null || _obj$native === void 0 ? void 0 : (_obj$native$hardware = _obj$native.hardware) === null || _obj$native$hardware === void 0 ? void 0 : _obj$native$hardware.networkInterfaces;
|
|
88
|
+
|
|
89
|
+
if (!networkInterfaces) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var hostIp;
|
|
94
|
+
Object.keys(networkInterfaces).forEach(function (inter) {
|
|
95
|
+
return networkInterfaces[inter].forEach(function (ip) {
|
|
96
|
+
if (ip.internal) {
|
|
97
|
+
return;
|
|
98
|
+
} else if (localIp.includes(':') && ip.family !== 'IPv6') {
|
|
99
|
+
return;
|
|
100
|
+
} else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
|
|
105
|
+
// if DNS name
|
|
106
|
+
hostIp = ip.address;
|
|
107
|
+
} else {
|
|
108
|
+
if (ip.family === 'IPv4' && localIp.includes('.') && (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))) {
|
|
109
|
+
hostIp = ip.address;
|
|
110
|
+
} else {
|
|
111
|
+
hostIp = ip.address;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (!hostIp) {
|
|
118
|
+
Object.keys(networkInterfaces).forEach(function (inter) {
|
|
119
|
+
networkInterfaces[inter].forEach(function (ip) {
|
|
120
|
+
if (ip.internal) {
|
|
121
|
+
return;
|
|
122
|
+
} else if (localIp.includes(':') && ip.family !== 'IPv6') {
|
|
123
|
+
return;
|
|
124
|
+
} else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
|
|
129
|
+
// if DNS name
|
|
130
|
+
hostIp = ip.address;
|
|
131
|
+
} else {
|
|
132
|
+
hostIp = ip.address;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (!hostIp) {
|
|
139
|
+
Object.keys(networkInterfaces).forEach(function (inter) {
|
|
140
|
+
networkInterfaces[inter].forEach(function (ip) {
|
|
141
|
+
if (ip.internal) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
hostIp = ip.address;
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return hostIp;
|
|
151
|
+
}
|
|
152
|
+
|
|
67
153
|
var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
68
154
|
(0, _inherits2["default"])(ConfigSendto, _ConfigGeneric);
|
|
69
155
|
|
|
@@ -76,13 +162,72 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
76
162
|
|
|
77
163
|
(0, _createClass2["default"])(ConfigSendto, [{
|
|
78
164
|
key: "componentDidMount",
|
|
79
|
-
value: function
|
|
80
|
-
(0,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
165
|
+
value: function () {
|
|
166
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
167
|
+
var hostname, adminInstance, instanceObj, hostObj, ip;
|
|
168
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
169
|
+
while (1) {
|
|
170
|
+
switch (_context.prev = _context.next) {
|
|
171
|
+
case 0:
|
|
172
|
+
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigSendto.prototype), "componentDidMount", this).call(this);
|
|
173
|
+
hostname = window.location.hostname;
|
|
174
|
+
|
|
175
|
+
if (!this.props.schema.openUrl) {
|
|
176
|
+
_context.next = 19;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
_context.next = 5;
|
|
181
|
+
return this.props.socket.getCurrentInstance();
|
|
182
|
+
|
|
183
|
+
case 5:
|
|
184
|
+
adminInstance = _context.sent;
|
|
185
|
+
_context.next = 8;
|
|
186
|
+
return this.props.socket.getObject("system.adapter.".concat(adminInstance));
|
|
187
|
+
|
|
188
|
+
case 8:
|
|
189
|
+
instanceObj = _context.sent;
|
|
190
|
+
_context.next = 11;
|
|
191
|
+
return this.props.socket.getObject("system.host.".concat(instanceObj.common.host));
|
|
192
|
+
|
|
193
|
+
case 11:
|
|
194
|
+
hostObj = _context.sent;
|
|
195
|
+
ip = findNetworkAddressOfHost(hostObj, window.location.hostname);
|
|
196
|
+
|
|
197
|
+
if (!ip) {
|
|
198
|
+
_context.next = 17;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
hostname = ip + ':' + window.location.port;
|
|
203
|
+
_context.next = 19;
|
|
204
|
+
break;
|
|
205
|
+
|
|
206
|
+
case 17:
|
|
207
|
+
console.warn("Cannot find suitable IP in host ".concat(instanceObj.common.host, " for ").concat(instanceObj._id));
|
|
208
|
+
return _context.abrupt("return", null);
|
|
209
|
+
|
|
210
|
+
case 19:
|
|
211
|
+
this.setState({
|
|
212
|
+
_error: '',
|
|
213
|
+
_message: '',
|
|
214
|
+
hostname: hostname
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
case 20:
|
|
218
|
+
case "end":
|
|
219
|
+
return _context.stop();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}, _callee, this);
|
|
223
|
+
}));
|
|
224
|
+
|
|
225
|
+
function componentDidMount() {
|
|
226
|
+
return _componentDidMount.apply(this, arguments);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return componentDidMount;
|
|
230
|
+
}()
|
|
86
231
|
}, {
|
|
87
232
|
key: "renderErrorDialog",
|
|
88
233
|
value: function renderErrorDialog() {
|
|
@@ -127,10 +272,15 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
127
272
|
var _this3 = this;
|
|
128
273
|
|
|
129
274
|
this.props.onCommandRunning(true);
|
|
275
|
+
|
|
276
|
+
var _origin = "".concat(window.location.protocol, "//").concat(this.state.hostname).concat(window.location.pathname.replace(/\/index\.html$/, ''));
|
|
277
|
+
|
|
130
278
|
var data = this.props.schema.data;
|
|
131
279
|
|
|
132
280
|
if (data === undefined && this.props.schema.jsonData) {
|
|
133
|
-
data = this.getPattern(this.props.schema.jsonData, {},
|
|
281
|
+
data = this.getPattern(this.props.schema.jsonData, {}, _objectSpread({
|
|
282
|
+
_origin: _origin
|
|
283
|
+
}, this.props.data));
|
|
134
284
|
|
|
135
285
|
try {
|
|
136
286
|
data = JSON.parse(data);
|
|
@@ -143,6 +293,12 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
143
293
|
data = null;
|
|
144
294
|
}
|
|
145
295
|
|
|
296
|
+
if (this.props.schema.openUrl && !data) {
|
|
297
|
+
data = {
|
|
298
|
+
_origin: "".concat(window.location.protocol, "//").concat(this.state.hostname).concat(window.location.pathname.replace(/\/index\.html$/, ''))
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
146
302
|
this.props.socket.sendTo("".concat(this.props.adapterName, ".").concat(this.props.instance), this.props.schema.command || 'send', data).then(function (response) {
|
|
147
303
|
if (response !== null && response !== void 0 && response.error) {
|
|
148
304
|
if (_this3.props.schema.error && _this3.props.schema.error[response.error]) {
|
|
@@ -163,7 +319,9 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
163
319
|
});
|
|
164
320
|
}
|
|
165
321
|
} else {
|
|
166
|
-
if (response !== null && response !== void 0 && response.
|
|
322
|
+
if (response !== null && response !== void 0 && response.openUrl && _this3.props.schema.openUrl) {
|
|
323
|
+
window.open(response.openUrl, response.window || _this3.props.schema.window || '_blank');
|
|
324
|
+
} else if (response !== null && response !== void 0 && response.result && _this3.props.schema.result && _this3.props.schema.result[response.result]) {
|
|
167
325
|
var text = _this3.getText(_this3.props.schema.result[response.result]);
|
|
168
326
|
|
|
169
327
|
if (response.args) {
|
|
@@ -180,6 +338,10 @@ var ConfigSendto = /*#__PURE__*/function (_ConfigGeneric) {
|
|
|
180
338
|
window.alert(_i18n["default"].t('ra_Ok'));
|
|
181
339
|
}
|
|
182
340
|
}
|
|
341
|
+
|
|
342
|
+
if (response !== null && response !== void 0 && response.saveConfig) {
|
|
343
|
+
_this3.props.onChange(null, null, null, true);
|
|
344
|
+
}
|
|
183
345
|
}
|
|
184
346
|
})["catch"](function (e) {
|
|
185
347
|
if (_this3.props.schema.error && _this3.props.schema.error[e.toString()]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigSendto.js","names":["styles","theme","fullWidth","width","icon","height","marginRight","ConfigSendto","setState","_error","_message","state","undefined","props","onCommandRunning","data","schema","jsonData","getPattern","JSON","parse","e","console","error","socket","sendTo","adapterName","instance","command","then","response","getText","args","forEach","arg","replace","I18n","t","result","text","window","alert","stringify","toString","confirmDialog","confirm","confirmData","type","title","ok","cancel","isOk","_onClick","disabled","defaultValue","classes","variant","color","label","noTranslation","renderErrorDialog","renderMessageDialog","ConfigGeneric","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","onChange","number","commandRunning","bool","withStyles"],"sources":["JsonConfigComponent/ConfigSendto.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport Button from '@mui/material/Button';\n\nimport I18n from '../../i18n';\nimport Icon from '../Icon';\nimport DialogError from '../../Dialogs/Error';\nimport DialogMessage from '../../Dialogs/Message';\nimport ConfirmDialog from '../../Dialogs/Confirm';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport IconWarning from '@mui/icons-material/Warning';\nimport IconError from '@mui/icons-material/Error';\nimport IconInfo from '@mui/icons-material/Info';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n icon: {\n width: 24,\n height: 24,\n marginRight: 4\n }\n});\n\nclass ConfigSendto extends ConfigGeneric {\n componentDidMount() {\n super.componentDidMount();\n\n this.setState( {_error: '', _message: ''});\n }\n\n renderErrorDialog() {\n if (this.state._error) {\n return <DialogError text={this.state._error} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n renderMessageDialog() {\n if (this.state._message) {\n return <DialogMessage text={this.state._message} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n _onClick() {\n this.props.onCommandRunning(true);\n\n let data = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n data = this.getPattern(this.props.schema.jsonData, {}, this.props.data);\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.error('Cannot parse json data: ' + data);\n }\n }\n if (data === undefined) {\n data = null;\n }\n\n this.props.socket.sendTo(\n `${this.props.adapterName}.${this.props.instance}`,\n this.props.schema.command || 'send',\n data\n )\n .then(response => {\n if (response?.error) {\n if (this.props.schema.error && this.props.schema.error[response.error]) {\n let error = this.getText(this.props.schema.error[response.error]);\n if (response.args) {\n response.args.forEach(arg => error = error.replace('%s', arg));\n }\n this.setState({_error: error});\n } else {\n this.setState({_error: response.error ? I18n.t(response.error) : I18n.t('ra_Error')});\n }\n } else {\n if (response?.result && this.props.schema.result && this.props.schema.result[response.result]) {\n let text = this.getText(this.props.schema.result[response.result]);\n if (response.args) {\n response.args.forEach(arg => text = text.replace('%s', arg));\n }\n window.alert(text);\n } else {\n if (response?.result) {\n window.alert(typeof response.result === 'object' ? JSON.stringify(response.result) : response.result);\n } else {\n window.alert(I18n.t('ra_Ok'));\n }\n }\n }\n })\n .catch(e => {\n if (this.props.schema.error && this.props.schema.error[e.toString()]) {\n this.setState({_error: this.getText(this.props.schema.error[e.toString()])});\n } else {\n this.setState({_error: I18n.t(e.toString()) || I18n.t('ra_Error')});\n }\n })\n .then(() => this.props.onCommandRunning(false))\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 isOk && this._onClick())\n }\n />;\n }\n\n renderItem(error, disabled, defaultValue) {\n return <div className={this.props.classes.fullWidth}>\n <Button\n variant={this.props.schema.variant || undefined}\n color={this.props.schema.color || 'grey'}\n className={this.props.classes.fullWidth}\n disabled={disabled}\n onClick={() => {\n if (this.props.schema.confirm) {\n this.setState({confirmDialog: true});\n } else {\n this._onClick();\n }\n }}\n >\n {this.props.schema.icon ? <Icon src={this.props.schema.icon} className={this.props.classes.icon}/> : null}\n {this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n {this.renderErrorDialog()}\n {this.renderMessageDialog()}\n </div>;\n }\n}\n\nConfigSendto.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 adapterName: PropTypes.string,\n instance: PropTypes.number,\n commandRunning: PropTypes.bool,\n onCommandRunning: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSendto);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;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ullWidth","width","icon","height","marginRight","ip2int","ip","split","reduce","ipInt","octet","parseInt","findNetworkAddressOfHost","obj","localIp","networkInterfaces","hardware","hostIp","Object","keys","forEach","inter","internal","includes","family","match","address","netmask","ConfigSendto","hostname","window","location","props","schema","openUrl","socket","getCurrentInstance","adminInstance","getObject","instanceObj","common","host","hostObj","port","console","warn","_id","setState","_error","_message","state","undefined","onCommandRunning","_origin","protocol","pathname","replace","data","jsonData","getPattern","JSON","parse","e","error","sendTo","adapterName","instance","command","then","response","getText","args","arg","I18n","t","open","result","text","alert","stringify","saveConfig","onChange","toString","confirmDialog","confirm","confirmData","type","title","ok","cancel","isOk","_onClick","disabled","defaultValue","classes","variant","color","label","noTranslation","renderErrorDialog","renderMessageDialog","ConfigGeneric","propTypes","PropTypes","object","isRequired","themeType","string","themeName","style","className","onError","func","number","commandRunning","bool","withStyles"],"sources":["JsonConfigComponent/ConfigSendto.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport Button from '@mui/material/Button';\n\nimport I18n from '../../i18n';\nimport Icon from '../Icon';\nimport DialogError from '../../Dialogs/Error';\nimport DialogMessage from '../../Dialogs/Message';\nimport ConfirmDialog from '../../Dialogs/Confirm';\n\nimport ConfigGeneric from './ConfigGeneric';\nimport IconWarning from '@mui/icons-material/Warning';\nimport IconError from '@mui/icons-material/Error';\nimport IconInfo from '@mui/icons-material/Info';\n\nconst styles = theme => ({\n fullWidth: {\n width: '100%'\n },\n icon: {\n width: 24,\n height: 24,\n marginRight: 4\n }\n});\n\nfunction ip2int(ip) {\n return ip.split('.').reduce((ipInt, octet) => (ipInt << 8) + parseInt(octet, 10), 0) >>> 0;\n}\n\n// copied from iobroker.admin/src-rx/src/Utils.js\nfunction findNetworkAddressOfHost(obj, localIp) {\n const networkInterfaces = obj?.native?.hardware?.networkInterfaces;\n if (!networkInterfaces) {\n return null;\n }\n\n let hostIp;\n Object.keys(networkInterfaces).forEach(inter =>\n networkInterfaces[inter].forEach(ip => {\n if (ip.internal) {\n return;\n } else if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n } else if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/)) { // if DNS name\n hostIp = ip.address;\n } else {\n if (ip.family === 'IPv4' && localIp.includes('.') &&\n (ip2int(localIp) & ip2int(ip.netmask)) === (ip2int(ip.address) & ip2int(ip.netmask))) {\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n }\n }));\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach(ip => {\n if (ip.internal) {\n return;\n } else if (localIp.includes(':') && ip.family !== 'IPv6') {\n return;\n } else if (localIp.includes('.') && !localIp.match(/[^.\\d]/) && ip.family !== 'IPv4') {\n return;\n }\n if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\\d]/)) { // if DNS name\n hostIp = ip.address;\n } else {\n hostIp = ip.address;\n }\n });\n });\n }\n\n if (!hostIp) {\n Object.keys(networkInterfaces).forEach(inter => {\n networkInterfaces[inter].forEach(ip => {\n if (ip.internal) {\n return;\n }\n hostIp = ip.address;\n });\n });\n }\n\n return hostIp;\n}\n\n\nclass ConfigSendto extends ConfigGeneric {\n async componentDidMount() {\n super.componentDidMount();\n\n let hostname = window.location.hostname;\n if (this.props.schema.openUrl) {\n // read admin host\n const adminInstance = await this.props.socket.getCurrentInstance();\n const instanceObj = await this.props.socket.getObject(`system.adapter.${adminInstance}`);\n const hostObj = await this.props.socket.getObject(`system.host.${instanceObj.common.host}`);\n\n const ip = findNetworkAddressOfHost(hostObj, window.location.hostname);\n if (ip) {\n hostname = ip + ':' + window.location.port;\n } else {\n console.warn(`Cannot find suitable IP in host ${instanceObj.common.host} for ${instanceObj._id}`);\n return null;\n }\n }\n this.setState( { _error: '', _message: '', hostname });\n }\n\n renderErrorDialog() {\n if (this.state._error) {\n return <DialogError text={this.state._error} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n renderMessageDialog() {\n if (this.state._message) {\n return <DialogMessage text={this.state._message} classes={undefined} onClose={() => this.setState({_error: ''})} />;\n } else {\n return null;\n }\n }\n\n _onClick() {\n this.props.onCommandRunning(true);\n\n const _origin = `${window.location.protocol}//${this.state.hostname}${window.location.pathname.replace(/\\/index\\.html$/, '')}`\n\n let data = this.props.schema.data;\n if (data === undefined && this.props.schema.jsonData) {\n data = this.getPattern(this.props.schema.jsonData, {}, {\n _origin,\n ...this.props.data\n });\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.error('Cannot parse json data: ' + data);\n }\n }\n if (data === undefined) {\n data = null;\n }\n if (this.props.schema.openUrl && !data) {\n data = { _origin: `${window.location.protocol}//${this.state.hostname}${window.location.pathname.replace(/\\/index\\.html$/, '')}` };\n }\n\n this.props.socket.sendTo(\n `${this.props.adapterName}.${this.props.instance}`,\n this.props.schema.command || 'send',\n data\n )\n .then(response => {\n if (response?.error) {\n if (this.props.schema.error && this.props.schema.error[response.error]) {\n let error = this.getText(this.props.schema.error[response.error]);\n if (response.args) {\n response.args.forEach(arg => error = error.replace('%s', arg));\n }\n this.setState({_error: error});\n } else {\n this.setState({_error: response.error ? I18n.t(response.error) : I18n.t('ra_Error')});\n }\n } else {\n if (response?.openUrl && this.props.schema.openUrl) {\n window.open(response.openUrl, response.window || this.props.schema.window || '_blank');\n } else\n if (response?.result && this.props.schema.result && this.props.schema.result[response.result]) {\n let text = this.getText(this.props.schema.result[response.result]);\n if (response.args) {\n response.args.forEach(arg => text = text.replace('%s', arg));\n }\n window.alert(text);\n } else {\n if (response?.result) {\n window.alert(typeof response.result === 'object' ? JSON.stringify(response.result) : response.result);\n } else {\n window.alert(I18n.t('ra_Ok'));\n }\n }\n\n if (response?.saveConfig) {\n this.props.onChange(null, null, null, true);\n }\n }\n })\n .catch(e => {\n if (this.props.schema.error && this.props.schema.error[e.toString()]) {\n this.setState({_error: this.getText(this.props.schema.error[e.toString()])});\n } else {\n this.setState({_error: I18n.t(e.toString()) || I18n.t('ra_Error')});\n }\n })\n .then(() => this.props.onCommandRunning(false))\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 isOk && this._onClick())\n }\n />;\n }\n\n renderItem(error, disabled, defaultValue) {\n return <div className={this.props.classes.fullWidth}>\n <Button\n variant={this.props.schema.variant || undefined}\n color={this.props.schema.color || 'grey'}\n className={this.props.classes.fullWidth}\n disabled={disabled}\n onClick={() => {\n if (this.props.schema.confirm) {\n this.setState({confirmDialog: true});\n } else {\n this._onClick();\n }\n }}\n >\n {this.props.schema.icon ? <Icon src={this.props.schema.icon} className={this.props.classes.icon}/> : null}\n {this.getText(this.props.schema.label, this.props.schema.noTranslation)}\n </Button>\n {this.renderErrorDialog()}\n {this.renderMessageDialog()}\n </div>;\n }\n}\n\nConfigSendto.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 adapterName: PropTypes.string,\n instance: PropTypes.number,\n commandRunning: PropTypes.bool,\n onCommandRunning: PropTypes.func,\n};\n\nexport default withStyles(styles)(ConfigSendto);"],"m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default"])(_this), "onChange", function (data, value, cb) {
|
|
85
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (data, value, cb, saveConfig) {
|
|
86
86
|
if (_this.props.onValueChange) {
|
|
87
|
-
_this.props.onValueChange(data, value);
|
|
87
|
+
_this.props.onValueChange(data, value, saveConfig);
|
|
88
88
|
|
|
89
89
|
cb && cb();
|
|
90
90
|
} else {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
if (data) {
|
|
92
|
+
var state = {
|
|
93
|
+
data: data
|
|
94
|
+
};
|
|
95
|
+
var _data = {}; // remove all attributes starting with "_"
|
|
96
|
+
|
|
97
|
+
Object.keys(data).forEach(function (attr) {
|
|
98
|
+
return !attr.startsWith('_') && (_data[attr] = data[attr]);
|
|
99
|
+
});
|
|
100
|
+
state.changed = JSON.stringify(_data) !== _this.state.originalData;
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
_this.setState({
|
|
103
|
+
state: state
|
|
104
|
+
}, function () {
|
|
105
|
+
_this.props.onChange(_data, state.changed, saveConfig);
|
|
100
106
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
_this.props.onChange(
|
|
105
|
-
|
|
106
|
-
cb && cb();
|
|
107
|
-
});
|
|
107
|
+
cb && cb();
|
|
108
|
+
});
|
|
109
|
+
} else if (saveConfig) {
|
|
110
|
+
_this.props.onChange(null, null, saveConfig);
|
|
111
|
+
}
|
|
108
112
|
}
|
|
109
113
|
});
|
|
110
114
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onError", function (attr, error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["styles","theme","root","width","height","JsonConfigComponent","props","commandRunning","setState","id","state","val","alive","data","value","cb","onValueChange","_data","Object","keys","forEach","attr","startsWith","changed","JSON","stringify","originalData","onChange","error","errors","parse","onError","length","forceUpdate","Array","isArray","a","forceUpdateHandlers","updateData","systemConfig","schema","buildDependencies","readData","custom","common","Promise","resolve","socket","getObject","adapterName","instance","then","obj","readSettings","getCompactSystemConfig","getState","subscribeState","onAlive","_list","items","flatten","attrs","confirm","alsoDependsOn","dep","console","warn","replace","confirmDependsOn","depObj","cancel","push","onChangeDependsOn","hidden","hiddenDependsOn","label","labelDependsOn","help","helpDependsOn","item","type","onCommandRunning","themeType","themeName","customs","dateFormat","isFloatComma","multiEdit","imagePrefix","customObj","instanceObj","changeLanguage","forceAttrUpdate","registerOnForceUpdate","classes","renderItem","i18n","lang","I18n","getLanguage","path","fileExists","exists","fileName","readFile","json","file","undefined","extendTranslations","e","Component","propTypes","PropTypes","object","isRequired","string","number","bool","style","className","func","withStyles"],"sources":["JsonConfigComponent/index.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport LinearProgress from '@mui/material/LinearProgress';\n\nimport I18n from '../../i18n';\n\nimport ConfigTabs from './ConfigTabs';\nimport ConfigPanel from './ConfigPanel';\n\nconst styles = theme => ({\n root: {\n width: '100%',\n height: '100%'\n }\n});\n\nclass JsonConfigComponent extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n originalData: JSON.stringify(this.props.data),\n changed: false,\n errors: {\n\n },\n updateData: this.props.updateData,\n systemConfig: null,\n alive: false,\n commandRunning: false,\n schema: JSON.parse(JSON.stringify(this.props.schema))\n };\n\n this.forceUpdateHandlers = {};\n\n this.buildDependencies(this.state.schema);\n\n this.readData();\n }\n\n static getDerivedStateFromProps(props, state) {\n if (props.updateData !== state.updateData) {\n return {\n updateData: props.updateData,\n originalData: JSON.stringify(props.data),\n schema: JSON.parse(JSON.stringify(props.schema)),\n };\n } else {\n return null;\n }\n }\n\n static loadI18n(socket, i18n, adapterName) {\n if (i18n === true || (i18n && typeof i18n === 'string')) {\n const lang = I18n.getLanguage();\n const path = typeof i18n === 'string' ? i18n : 'i18n';\n return socket.fileExists(adapterName + '.admin', `${path}/${lang}.json`)\n .then(exists => {\n if (exists) {\n return `${path}/${lang}.json`;\n } else {\n return socket.fileExists(adapterName + '.admin', `${path}/${lang}/translations.json`)\n .then(exists =>\n exists ? `${path}/${lang}/translations.json` : '')\n }\n })\n .then(fileName => {\n if (fileName) {\n return socket.readFile(adapterName + '.admin', fileName)\n .then(json => {\n if (json.file !== undefined) {\n json = json.file;\n }\n try {\n json = JSON.parse(json);\n // apply file to I18n\n I18n.extendTranslations(json, lang);\n } catch (e) {\n console.error(`Cannot parse language file \"${adapterName}.admin/${fileName}: ${e}`);\n }\n })\n } else {\n console.warn(`Cannot find i18n for ${adapterName} / ${fileName}`);\n return Promise.resolve();\n }\n });\n } else if (i18n && typeof i18n === 'object') {\n I18n.extendTranslations(i18n);\n return Promise.resolve();\n } else {\n return Promise.resolve();\n }\n }\n\n onCommandRunning = commandRunning => this.setState( {commandRunning});\n\n readSettings() {\n if ((this.props.custom || this.props.common) && this.props.data) {\n return Promise.resolve();\n } else {\n return this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`)\n .then(obj => this.setState({common: obj.common, data: this.props.data || obj.native}));\n }\n }\n\n readData() {\n this.readSettings()\n .then(() => this.props.socket.getCompactSystemConfig())\n .then(systemConfig =>\n this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`)\n .then(state => {\n if (this.props.custom) {\n this.setState({systemConfig: systemConfig.common, alive: !!(state && state.val)});\n } else {\n this.setState({systemConfig: systemConfig.common, alive: !!(state && state.val)}, () =>\n this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`, this.onAlive));\n }\n }));\n }\n\n onAlive = (id, state) => {\n if ((state?.val || false) !== this.state.alive) {\n this.setState({alive: state?.val || false});\n }\n }\n\n onChange = (data, value, cb) => {\n if (this.props.onValueChange) {\n this.props.onValueChange(data, value);\n cb && cb();\n } else {\n const state = {data};\n\n const _data = {};\n // remove all attributes starting with \"_\"\n Object.keys(data).forEach(attr => !attr.startsWith('_') && (_data[attr] = data[attr]));\n\n state.changed = JSON.stringify(_data) !== this.state.originalData;\n\n this.setState({state}, () => {\n this.props.onChange(_data, state.changed);\n cb && cb();\n });\n }\n }\n\n onError = (attr, error) => {\n const errors = JSON.parse(JSON.stringify(this.state.errors));\n if (error) {\n errors[attr] = error;\n } else {\n delete errors[attr];\n }\n\n if (JSON.stringify(errors) !== JSON.parse(JSON.stringify(this.state.errors))) {\n this.setState({errors}, () =>\n this.props.onError(!!Object.keys(this.state.errors).length));\n }\n }\n\n flatten(schema, _list) {\n _list = _list || {};\n if (schema.items) {\n Object.keys(schema.items).forEach(attr => {\n _list[attr] = schema.items[attr];\n this.flatten(schema.items[attr], _list);\n });\n }\n\n return _list;\n }\n\n buildDependencies(schema) {\n const attrs = this.flatten(schema);\n Object.keys(attrs).forEach(attr => {\n if (attrs[attr].confirm?.alsoDependsOn) {\n attrs[attr].confirm?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].confirmDependsOn = attrs[dep].confirmDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n if (depObj.confirm) {\n depObj.confirm.cancel = 'Undo';\n }\n\n attrs[dep].confirmDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].onChange?.alsoDependsOn) {\n attrs[attr].onChange?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].onChangeDependsOn = attrs[dep].onChangeDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].onChangeDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].hidden?.alsoDependsOn) {\n attrs[attr].hidden?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].hiddenDependsOn = attrs[dep].hiddenDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].hiddenDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].label?.alsoDependsOn) {\n attrs[attr].label?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].labelDependsOn = attrs[dep].labelDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].labelDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].help?.alsoDependsOn) {\n attrs[attr].help?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].helpDependsOn = attrs[dep].helpDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].helpDependsOn.push(depObj);\n }\n });\n }\n });\n }\n\n renderItem(item) {\n if (item.type === 'tabs') {\n return <ConfigTabs\n onCommandRunning={this.onCommandRunning}\n commandRunning={this.state.commandRunning}\n socket={this.props.socket}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n common={this.props.common}\n alive={this.state.alive}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={JSON.parse(this.state.originalData)}\n schema={item}\n systemConfig={this.state.systemConfig}\n customs={this.props.customs}\n dateFormat={this.props.dateFormat}\n isFloatComma={this.props.isFloatComma}\n multiEdit={this.props.multiEdit}\n imagePrefix={this.props.imagePrefix}\n\n custom={this.props.custom}\n customObj={this.props.customObj}\n instanceObj={this.props.instanceObj}\n\n changeLanguage={this.changeLanguage}\n forceUpdate={this.forceAttrUpdate}\n registerOnForceUpdate={this.registerOnForceUpdate}\n\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n />;\n } else if (item.type === 'panel' || !item.type) {\n return <ConfigPanel\n index={1000}\n isParentTab={true}\n onCommandRunning={this.onCommandRunning}\n commandRunning={this.state.commandRunning}\n socket={this.props.socket}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n common={this.props.common}\n alive={this.state.alive}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={JSON.parse(this.state.originalData)}\n schema={item}\n systemConfig={this.state.systemConfig}\n customs={this.props.customs}\n dateFormat={this.props.dateFormat}\n isFloatComma={this.props.isFloatComma}\n multiEdit={this.props.multiEdit}\n imagePrefix={this.props.imagePrefix}\n\n custom={this.props.custom}\n customObj={this.props.customObj}\n instanceObj={this.props.instanceObj}\n\n changeLanguage={this.changeLanguage}\n forceUpdate={this.forceAttrUpdate}\n registerOnForceUpdate={this.registerOnForceUpdate}\n\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n />;\n }\n }\n\n changeLanguage = () => {\n this.forceUpdate();\n }\n\n forceAttrUpdate = (attr, data) => {\n if (Array.isArray(attr)) {\n attr.forEach(a =>\n this.forceUpdateHandlers[a] && this.forceUpdateHandlers[a](data));\n } else {\n if (this.forceUpdateHandlers[attr]) {\n this.forceUpdateHandlers[attr](data);\n }\n }\n }\n\n registerOnForceUpdate = (attr, cb) => {\n if (cb) {\n this.forceUpdateHandlers[attr] = cb;\n } else if (this.forceUpdateHandlers[attr]) {\n delete this.forceUpdateHandlers[attr];\n }\n }\n\n render() {\n if (!this.state.systemConfig) {\n return <LinearProgress />;\n }\n\n return <div className={this.props.classes.root}>\n {this.renderItem(this.state.schema)}\n </div>;\n }\n}\n\nJsonConfigComponent.propTypes = {\n socket: PropTypes.object.isRequired,\n\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n common: PropTypes.object,\n customs: PropTypes.object, // custom components\n\n custom: PropTypes.bool, // is the customs settings must be shown\n customObj: PropTypes.object,\n multiEdit: PropTypes.bool, // set if user edits more than one object simultaneously\n instanceObj: PropTypes.object,\n dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n imagePrefix: PropTypes.string,\n\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n updateData: PropTypes.number,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n onValueChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(JsonConfigComponent);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,IAAI,EAAE;MACFC,KAAK,EAAE,MADL;MAEFC,MAAM,EAAE;IAFN;EADe,CAAL;AAAA,CAApB;;IAOMC,mB;;;;;EACF,6BAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IADe,qGA6EA,UAAAC,cAAc;MAAA,OAAI,MAAKC,QAAL,CAAe;QAACD,cAAc,EAAdA;MAAD,CAAf,CAAJ;IAAA,CA7Ed;IAAA,4FAuGT,UAACE,EAAD,EAAKC,KAAL,EAAe;MACrB,IAAI,CAAC,CAAAA,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,GAAP,KAAc,KAAf,MAA0B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AA,CAAUC,MATO;EAU5B1B,SAAS,EAAEyB,qBAAA,CAAUK,IAVO;EAUD;EAC3B3B,WAAW,EAAEsB,qBAAA,CAAUC,MAXK;EAY5B5B,UAAU,EAAE2B,qBAAA,CAAUG,MAZM;EAa5B7B,YAAY,EAAE0B,qBAAA,CAAUK,IAbI;EAc5B7B,WAAW,EAAEwB,qBAAA,CAAUG,MAdK;EAgB5BjC,SAAS,EAAE8B,qBAAA,CAAUG,MAhBO;EAiB5BhC,SAAS,EAAE6B,qBAAA,CAAUG,MAjBO;EAkB5BG,KAAK,EAAEN,qBAAA,CAAUC,MAlBW;EAmB5BM,SAAS,EAAEP,qBAAA,CAAUG,MAnBO;EAoB5BtG,IAAI,EAAEmG,qBAAA,CAAUC,MAAV,CAAiBC,UApBK;EAqB5B5E,UAAU,EAAE0E,qBAAA,CAAUI,MArBM;EAsB5B5E,MAAM,EAAEwE,qBAAA,CAAUC,MAtBU;EAuB5BlF,OAAO,EAAEiF,qBAAA,CAAUQ,IAvBS;EAwB5B7F,QAAQ,EAAEqF,qBAAA,CAAUQ,IAxBQ;EAyB5BxG,aAAa,EAAEgG,qBAAA,CAAUQ;AAzBG,CAAhC;;eA4Be,IAAAC,kBAAA,EAAWzH,MAAX,EAAmBK,mBAAnB,C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["styles","theme","root","width","height","JsonConfigComponent","props","commandRunning","setState","id","state","val","alive","data","value","cb","saveConfig","onValueChange","_data","Object","keys","forEach","attr","startsWith","changed","JSON","stringify","originalData","onChange","error","errors","parse","onError","length","forceUpdate","Array","isArray","a","forceUpdateHandlers","updateData","systemConfig","schema","buildDependencies","readData","custom","common","Promise","resolve","socket","getObject","adapterName","instance","then","obj","readSettings","getCompactSystemConfig","getState","subscribeState","onAlive","_list","items","flatten","attrs","confirm","alsoDependsOn","dep","console","warn","replace","confirmDependsOn","depObj","cancel","push","onChangeDependsOn","hidden","hiddenDependsOn","label","labelDependsOn","help","helpDependsOn","item","type","onCommandRunning","themeType","themeName","customs","dateFormat","isFloatComma","multiEdit","imagePrefix","customObj","instanceObj","changeLanguage","forceAttrUpdate","registerOnForceUpdate","classes","renderItem","i18n","lang","I18n","getLanguage","path","fileExists","exists","fileName","readFile","json","file","undefined","extendTranslations","e","Component","propTypes","PropTypes","object","isRequired","string","number","bool","style","className","func","withStyles"],"sources":["JsonConfigComponent/index.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@mui/styles';\n\nimport LinearProgress from '@mui/material/LinearProgress';\n\nimport I18n from '../../i18n';\n\nimport ConfigTabs from './ConfigTabs';\nimport ConfigPanel from './ConfigPanel';\n\nconst styles = theme => ({\n root: {\n width: '100%',\n height: '100%'\n }\n});\n\nclass JsonConfigComponent extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n originalData: JSON.stringify(this.props.data),\n changed: false,\n errors: {\n\n },\n updateData: this.props.updateData,\n systemConfig: null,\n alive: false,\n commandRunning: false,\n schema: JSON.parse(JSON.stringify(this.props.schema))\n };\n\n this.forceUpdateHandlers = {};\n\n this.buildDependencies(this.state.schema);\n\n this.readData();\n }\n\n static getDerivedStateFromProps(props, state) {\n if (props.updateData !== state.updateData) {\n return {\n updateData: props.updateData,\n originalData: JSON.stringify(props.data),\n schema: JSON.parse(JSON.stringify(props.schema)),\n };\n } else {\n return null;\n }\n }\n\n static loadI18n(socket, i18n, adapterName) {\n if (i18n === true || (i18n && typeof i18n === 'string')) {\n const lang = I18n.getLanguage();\n const path = typeof i18n === 'string' ? i18n : 'i18n';\n return socket.fileExists(adapterName + '.admin', `${path}/${lang}.json`)\n .then(exists => {\n if (exists) {\n return `${path}/${lang}.json`;\n } else {\n return socket.fileExists(adapterName + '.admin', `${path}/${lang}/translations.json`)\n .then(exists =>\n exists ? `${path}/${lang}/translations.json` : '')\n }\n })\n .then(fileName => {\n if (fileName) {\n return socket.readFile(adapterName + '.admin', fileName)\n .then(json => {\n if (json.file !== undefined) {\n json = json.file;\n }\n try {\n json = JSON.parse(json);\n // apply file to I18n\n I18n.extendTranslations(json, lang);\n } catch (e) {\n console.error(`Cannot parse language file \"${adapterName}.admin/${fileName}: ${e}`);\n }\n })\n } else {\n console.warn(`Cannot find i18n for ${adapterName} / ${fileName}`);\n return Promise.resolve();\n }\n });\n } else if (i18n && typeof i18n === 'object') {\n I18n.extendTranslations(i18n);\n return Promise.resolve();\n } else {\n return Promise.resolve();\n }\n }\n\n onCommandRunning = commandRunning => this.setState( {commandRunning});\n\n readSettings() {\n if ((this.props.custom || this.props.common) && this.props.data) {\n return Promise.resolve();\n } else {\n return this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`)\n .then(obj => this.setState({common: obj.common, data: this.props.data || obj.native}));\n }\n }\n\n readData() {\n this.readSettings()\n .then(() => this.props.socket.getCompactSystemConfig())\n .then(systemConfig =>\n this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`)\n .then(state => {\n if (this.props.custom) {\n this.setState({systemConfig: systemConfig.common, alive: !!(state && state.val)});\n } else {\n this.setState({systemConfig: systemConfig.common, alive: !!(state && state.val)}, () =>\n this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`, this.onAlive));\n }\n }));\n }\n\n onAlive = (id, state) => {\n if ((state?.val || false) !== this.state.alive) {\n this.setState({alive: state?.val || false});\n }\n }\n\n onChange = (data, value, cb, saveConfig) => {\n if (this.props.onValueChange) {\n this.props.onValueChange(data, value, saveConfig);\n cb && cb();\n } else {\n if (data) {\n const state = { data };\n\n const _data = {};\n // remove all attributes starting with \"_\"\n Object.keys(data).forEach(attr => !attr.startsWith('_') && (_data[attr] = data[attr]));\n\n state.changed = JSON.stringify(_data) !== this.state.originalData;\n\n this.setState({ state }, () => {\n this.props.onChange(_data, state.changed, saveConfig);\n cb && cb();\n });\n } else if (saveConfig) {\n this.props.onChange(null, null, saveConfig);\n }\n }\n }\n\n onError = (attr, error) => {\n const errors = JSON.parse(JSON.stringify(this.state.errors));\n if (error) {\n errors[attr] = error;\n } else {\n delete errors[attr];\n }\n\n if (JSON.stringify(errors) !== JSON.parse(JSON.stringify(this.state.errors))) {\n this.setState({errors}, () =>\n this.props.onError(!!Object.keys(this.state.errors).length));\n }\n }\n\n flatten(schema, _list) {\n _list = _list || {};\n if (schema.items) {\n Object.keys(schema.items).forEach(attr => {\n _list[attr] = schema.items[attr];\n this.flatten(schema.items[attr], _list);\n });\n }\n\n return _list;\n }\n\n buildDependencies(schema) {\n const attrs = this.flatten(schema);\n Object.keys(attrs).forEach(attr => {\n if (attrs[attr].confirm?.alsoDependsOn) {\n attrs[attr].confirm?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].confirmDependsOn = attrs[dep].confirmDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n if (depObj.confirm) {\n depObj.confirm.cancel = 'Undo';\n }\n\n attrs[dep].confirmDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].onChange?.alsoDependsOn) {\n attrs[attr].onChange?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].onChangeDependsOn = attrs[dep].onChangeDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].onChangeDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].hidden?.alsoDependsOn) {\n attrs[attr].hidden?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].hiddenDependsOn = attrs[dep].hiddenDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].hiddenDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].label?.alsoDependsOn) {\n attrs[attr].label?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].labelDependsOn = attrs[dep].labelDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].labelDependsOn.push(depObj);\n }\n });\n }\n\n if (attrs[attr].help?.alsoDependsOn) {\n attrs[attr].help?.alsoDependsOn.forEach(dep => {\n if (!attrs[dep]) {\n console.error(`[JsonConfigComponent] Attribute ${dep} does not exist!`);\n if (dep.startsWith('data.')) {\n console.warn(`[JsonConfigComponent] please use \"${dep.replace(/^data\\./, '')}\" instead of \"${dep}\"`);\n }\n } else {\n attrs[dep].helpDependsOn = attrs[dep].helpDependsOn || [];\n\n const depObj = {...attrs[attr], attr};\n\n attrs[dep].helpDependsOn.push(depObj);\n }\n });\n }\n });\n }\n\n renderItem(item) {\n if (item.type === 'tabs') {\n return <ConfigTabs\n onCommandRunning={this.onCommandRunning}\n commandRunning={this.state.commandRunning}\n socket={this.props.socket}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n common={this.props.common}\n alive={this.state.alive}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={JSON.parse(this.state.originalData)}\n schema={item}\n systemConfig={this.state.systemConfig}\n customs={this.props.customs}\n dateFormat={this.props.dateFormat}\n isFloatComma={this.props.isFloatComma}\n multiEdit={this.props.multiEdit}\n imagePrefix={this.props.imagePrefix}\n\n custom={this.props.custom}\n customObj={this.props.customObj}\n instanceObj={this.props.instanceObj}\n\n changeLanguage={this.changeLanguage}\n forceUpdate={this.forceAttrUpdate}\n registerOnForceUpdate={this.registerOnForceUpdate}\n\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n />;\n } else if (item.type === 'panel' || !item.type) {\n return <ConfigPanel\n index={1000}\n isParentTab={true}\n onCommandRunning={this.onCommandRunning}\n commandRunning={this.state.commandRunning}\n socket={this.props.socket}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n common={this.props.common}\n alive={this.state.alive}\n themeType={this.props.themeType}\n themeName={this.props.themeName}\n data={this.props.data}\n originalData={JSON.parse(this.state.originalData)}\n schema={item}\n systemConfig={this.state.systemConfig}\n customs={this.props.customs}\n dateFormat={this.props.dateFormat}\n isFloatComma={this.props.isFloatComma}\n multiEdit={this.props.multiEdit}\n imagePrefix={this.props.imagePrefix}\n\n custom={this.props.custom}\n customObj={this.props.customObj}\n instanceObj={this.props.instanceObj}\n\n changeLanguage={this.changeLanguage}\n forceUpdate={this.forceAttrUpdate}\n registerOnForceUpdate={this.registerOnForceUpdate}\n\n onChange={this.onChange}\n onError={(attr, error) => this.onError(attr, error)}\n />;\n }\n }\n\n changeLanguage = () => {\n this.forceUpdate();\n }\n\n forceAttrUpdate = (attr, data) => {\n if (Array.isArray(attr)) {\n attr.forEach(a =>\n this.forceUpdateHandlers[a] && this.forceUpdateHandlers[a](data));\n } else {\n if (this.forceUpdateHandlers[attr]) {\n this.forceUpdateHandlers[attr](data);\n }\n }\n }\n\n registerOnForceUpdate = (attr, cb) => {\n if (cb) {\n this.forceUpdateHandlers[attr] = cb;\n } else if (this.forceUpdateHandlers[attr]) {\n delete this.forceUpdateHandlers[attr];\n }\n }\n\n render() {\n if (!this.state.systemConfig) {\n return <LinearProgress />;\n }\n\n return <div className={this.props.classes.root}>\n {this.renderItem(this.state.schema)}\n </div>;\n }\n}\n\nJsonConfigComponent.propTypes = {\n socket: PropTypes.object.isRequired,\n\n adapterName: PropTypes.string,\n instance: PropTypes.number,\n common: PropTypes.object,\n customs: PropTypes.object, // custom components\n\n custom: PropTypes.bool, // is the customs settings must be shown\n customObj: PropTypes.object,\n multiEdit: PropTypes.bool, // set if user edits more than one object simultaneously\n instanceObj: PropTypes.object,\n dateFormat: PropTypes.string,\n isFloatComma: PropTypes.bool,\n imagePrefix: PropTypes.string,\n\n themeType: PropTypes.string,\n themeName: PropTypes.string,\n style: PropTypes.object,\n className: PropTypes.string,\n data: PropTypes.object.isRequired,\n updateData: PropTypes.number,\n schema: PropTypes.object,\n onError: PropTypes.func,\n onChange: PropTypes.func,\n onValueChange: PropTypes.func,\n};\n\nexport default withStyles(styles)(JsonConfigComponent);"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;EAAA,OAAK;IACrBC,IAAI,EAAE;MACFC,KAAK,EAAE,MADL;MAEFC,MAAM,EAAE;IAFN;EADe,CAAL;AAAA,CAApB;;IAOMC,mB;;;;;EACF,6BAAYC,KAAZ,EAAmB;IAAA;;IAAA;IACf,0BAAMA,KAAN;IADe,qGA6EA,UAAAC,cAAc;MAAA,OAAI,MAAKC,QAAL,CAAe;QAACD,cAAc,EAAdA;MAAD,CAAf,CAAJ;IAAA,CA7Ed;IAAA,4FAuGT,UAACE,EAAD,EAAKC,KAAL,EAAe;MACrB,IAAI,CAAC,CAAAA,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,GAAP,KAAc,KAAf,MAA0B,MAAKD,KAAL,CAAWE,KAAzC,EAAgD;QAC5C,MAAKJ,QAAL,CAAc;UAACI,KAAK,EAAE,CAAAF,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEC,GAAP,KAAc;QAAtB,CAAd;MACH;IACJ,CA3GkB;IAAA,6FA6GR,U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qBAAA,CAAUC,MATO;EAU5B1B,SAAS,EAAEyB,qBAAA,CAAUK,IAVO;EAUD;EAC3B3B,WAAW,EAAEsB,qBAAA,CAAUC,MAXK;EAY5B5B,UAAU,EAAE2B,qBAAA,CAAUG,MAZM;EAa5B7B,YAAY,EAAE0B,qBAAA,CAAUK,IAbI;EAc5B7B,WAAW,EAAEwB,qBAAA,CAAUG,MAdK;EAgB5BjC,SAAS,EAAE8B,qBAAA,CAAUG,MAhBO;EAiB5BhC,SAAS,EAAE6B,qBAAA,CAAUG,MAjBO;EAkB5BG,KAAK,EAAEN,qBAAA,CAAUC,MAlBW;EAmB5BM,SAAS,EAAEP,qBAAA,CAAUG,MAnBO;EAoB5BvG,IAAI,EAAEoG,qBAAA,CAAUC,MAAV,CAAiBC,UApBK;EAqB5B5E,UAAU,EAAE0E,qBAAA,CAAUI,MArBM;EAsB5B5E,MAAM,EAAEwE,qBAAA,CAAUC,MAtBU;EAuB5BlF,OAAO,EAAEiF,qBAAA,CAAUQ,IAvBS;EAwB5B7F,QAAQ,EAAEqF,qBAAA,CAAUQ,IAxBQ;EAyB5BxG,aAAa,EAAEgG,qBAAA,CAAUQ;AAzBG,CAAhC;;eA4Be,IAAAC,kBAAA,EAAW1H,MAAX,EAAmBK,mBAAnB,C"}
|
package/README.md
CHANGED
|
@@ -642,6 +642,9 @@ If you still have questions, try to find an answer [here](https://mui.com/guides
|
|
|
642
642
|
-->
|
|
643
643
|
|
|
644
644
|
## Changelog
|
|
645
|
+
### 3.1.25 (2022-08-01)
|
|
646
|
+
* (bluefox) Added translations
|
|
647
|
+
|
|
645
648
|
### 3.1.24 (2022-07-28)
|
|
646
649
|
* (bluefox) Updated file browser and object browser
|
|
647
650
|
|
package/i18n/de.json
CHANGED
|
@@ -316,5 +316,8 @@
|
|
|
316
316
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "Datei ist zu groß. Max %sk erlaubt. Versuchen Sie, SVG zu verwenden.",
|
|
317
317
|
"ra_Cannot upload": "Kann nicht hochladen",
|
|
318
318
|
"ra_Crop": "Ernte",
|
|
319
|
-
"ra_tooltip_comment": "Kommentar"
|
|
319
|
+
"ra_tooltip_comment": "Kommentar",
|
|
320
|
+
"ra_Disconnected": "Getrennt",
|
|
321
|
+
"ra_Connected": "Verbunden",
|
|
322
|
+
"ra_Configure": "Konfigurieren"
|
|
320
323
|
}
|
package/i18n/en.json
CHANGED
|
@@ -316,5 +316,8 @@
|
|
|
316
316
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "File is too big. Max %sk allowed. Try use SVG.",
|
|
317
317
|
"ra_Cannot upload": "Cannot upload",
|
|
318
318
|
"ra_Crop": "Crop",
|
|
319
|
-
"ra_tooltip_comment": "Comment"
|
|
319
|
+
"ra_tooltip_comment": "Comment",
|
|
320
|
+
"ra_Disconnected": "Disconnected",
|
|
321
|
+
"ra_Connected": "Connected",
|
|
322
|
+
"ra_Configure": "Configure"
|
|
320
323
|
}
|
package/i18n/es.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "El archivo es demasiado grande. Máximo de %sk permitido. Intenta usar SVG.",
|
|
304
304
|
"ra_Cannot upload": "no se puede cargar",
|
|
305
305
|
"ra_Crop": "Cultivo",
|
|
306
|
-
"ra_tooltip_comment": "Comentario"
|
|
306
|
+
"ra_tooltip_comment": "Comentario",
|
|
307
|
+
"ra_Disconnected": "Desconectado",
|
|
308
|
+
"ra_Connected": "Conectado",
|
|
309
|
+
"ra_Configure": "Configurar"
|
|
307
310
|
}
|
package/i18n/fr.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "Le fichier est trop volumineux. Max %sk autorisé. Essayez d'utiliser SVG.",
|
|
304
304
|
"ra_Cannot upload": "Impossible de télécharger",
|
|
305
305
|
"ra_Crop": "Recadrer",
|
|
306
|
-
"ra_tooltip_comment": "Commentaire"
|
|
306
|
+
"ra_tooltip_comment": "Commentaire",
|
|
307
|
+
"ra_Disconnected": "Débranché",
|
|
308
|
+
"ra_Connected": "Lié",
|
|
309
|
+
"ra_Configure": "Configurer"
|
|
307
310
|
}
|
package/i18n/it.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "Il file è troppo grande. Max %sk consentito. Prova a usare SVG.",
|
|
304
304
|
"ra_Cannot upload": "Impossibile caricare",
|
|
305
305
|
"ra_Crop": "Raccolto",
|
|
306
|
-
"ra_tooltip_comment": "Commento"
|
|
306
|
+
"ra_tooltip_comment": "Commento",
|
|
307
|
+
"ra_Disconnected": "Disconnesso",
|
|
308
|
+
"ra_Connected": "Collegato",
|
|
309
|
+
"ra_Configure": "Configura"
|
|
307
310
|
}
|
package/i18n/nl.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "Bestand is te groot. Max. %sk toegestaan. Probeer SVG te gebruiken.",
|
|
304
304
|
"ra_Cannot upload": "Kan niet uploaden",
|
|
305
305
|
"ra_Crop": "Bijsnijden",
|
|
306
|
-
"ra_tooltip_comment": "Opmerking"
|
|
306
|
+
"ra_tooltip_comment": "Opmerking",
|
|
307
|
+
"ra_Disconnected": "Verbinding verbroken",
|
|
308
|
+
"ra_Connected": "Verbonden",
|
|
309
|
+
"ra_Configure": "Configureren"
|
|
307
310
|
}
|
package/i18n/pl.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "Plik jest za duży. Maksymalna dozwolona liczba %sk. Spróbuj użyć SVG.",
|
|
304
304
|
"ra_Cannot upload": "Nie można przesłać",
|
|
305
305
|
"ra_Crop": "Przyciąć",
|
|
306
|
-
"ra_tooltip_comment": "Komentarz"
|
|
306
|
+
"ra_tooltip_comment": "Komentarz",
|
|
307
|
+
"ra_Disconnected": "Niepowiązany",
|
|
308
|
+
"ra_Connected": "Połączony",
|
|
309
|
+
"ra_Configure": "Konfiguruj"
|
|
307
310
|
}
|
package/i18n/pt.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "O arquivo é muito grande. Max %sk permitido. Tente usar SVG.",
|
|
304
304
|
"ra_Cannot upload": "Não é possível fazer upload",
|
|
305
305
|
"ra_Crop": "Colheita",
|
|
306
|
-
"ra_tooltip_comment": "Comente"
|
|
306
|
+
"ra_tooltip_comment": "Comente",
|
|
307
|
+
"ra_Disconnected": "Desconectado",
|
|
308
|
+
"ra_Connected": "Conectado",
|
|
309
|
+
"ra_Configure": "Configurar"
|
|
307
310
|
}
|
package/i18n/ru.json
CHANGED
|
@@ -316,5 +316,8 @@
|
|
|
316
316
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "Файл слишком большой. Разрешено максимальное количество %sk. Попробуйте использовать SVG.",
|
|
317
317
|
"ra_Cannot upload": "Невозможно загрузить",
|
|
318
318
|
"ra_Crop": "Обрезать",
|
|
319
|
-
"ra_tooltip_comment": "Комментарий"
|
|
319
|
+
"ra_tooltip_comment": "Комментарий",
|
|
320
|
+
"ra_Disconnected": "Отключено",
|
|
321
|
+
"ra_Connected": "Соединение установлено",
|
|
322
|
+
"ra_Configure": "Настроить"
|
|
320
323
|
}
|
package/i18n/zh-cn.json
CHANGED
|
@@ -303,5 +303,8 @@
|
|
|
303
303
|
"ra_File is too big. Max %sk allowed. Try use SVG.": "文件太大。允许的最大字节%s数。尝试使用 SVG。",
|
|
304
304
|
"ra_Cannot upload": "无法上传",
|
|
305
305
|
"ra_Crop": "庄稼",
|
|
306
|
-
"ra_tooltip_comment": "评论"
|
|
306
|
+
"ra_tooltip_comment": "评论",
|
|
307
|
+
"ra_Disconnected": "断开连接",
|
|
308
|
+
"ra_Connected": "连接的",
|
|
309
|
+
"ra_Configure": "配置"
|
|
307
310
|
}
|