@iobroker/adapter-react-v5 4.0.19 → 4.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/Components/ColorPicker.js +9 -3
  2. package/Components/ColorPicker.js.map +1 -1
  3. package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +14 -0
  4. package/Components/JsonConfigComponent/ConfigCertCollection.js +143 -0
  5. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -0
  6. package/Components/JsonConfigComponent/ConfigCertificateSelect.js +1 -1
  7. package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
  8. package/Components/JsonConfigComponent/ConfigCertificates.d.ts +14 -0
  9. package/Components/JsonConfigComponent/ConfigCertificates.js +297 -0
  10. package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -0
  11. package/Components/JsonConfigComponent/ConfigCheckLicense.js +216 -93
  12. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
  13. package/Components/JsonConfigComponent/ConfigPanel.js +4 -0
  14. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
  15. package/Components/JsonConfigComponent/ConfigPort.js +22 -8
  16. package/Components/JsonConfigComponent/ConfigPort.js.map +1 -1
  17. package/Components/JsonConfigComponent/index.js +105 -45
  18. package/Components/JsonConfigComponent/index.js.map +1 -1
  19. package/README.md +6 -0
  20. package/i18n/de.json +8 -1
  21. package/i18n/en.json +8 -1
  22. package/i18n/es.json +8 -1
  23. package/i18n/fr.json +8 -1
  24. package/i18n/it.json +8 -1
  25. package/i18n/nl.json +8 -1
  26. package/i18n/pl.json +8 -1
  27. package/i18n/pt.json +8 -1
  28. package/i18n/ru.json +8 -1
  29. package/i18n/uk.json +8 -1
  30. package/i18n/zh-cn.json +8 -1
  31. package/package.json +1 -1
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -22,6 +23,7 @@ var _Send = _interopRequireDefault(require("@mui/icons-material/Send"));
22
23
  var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
23
24
  var _Error = _interopRequireDefault(require("./wrapper/Dialogs/Error"));
24
25
  var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
26
+ var _Confirm = _interopRequireDefault(require("./wrapper/Dialogs/Confirm"));
25
27
  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); }; }
26
28
  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; } }
27
29
  var styles = function styles(theme) {
@@ -37,6 +39,7 @@ var styles = function styles(theme) {
37
39
  licLabel: {
38
40
  fontWeight: 'bold',
39
41
  minWidth: 100,
42
+ marginRight: 10,
40
43
  textTransform: 'capitalize',
41
44
  display: 'inline-block'
42
45
  },
@@ -112,13 +115,44 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
112
115
  value: function renderMessageDialog() {
113
116
  var _this2 = this;
114
117
  if (this.state.showLicenseData) {
115
- var pre = Object.keys(this.state.showLicenseData).map(function (key) {
116
- return /*#__PURE__*/_react["default"].createElement("div", {
117
- key: key
118
- }, /*#__PURE__*/_react["default"].createElement("div", {
119
- className: _this2.props.classes.licLabel
120
- }, key.replace(/_/g, ' '), ":"), " ", _this2.state.showLicenseData[key]);
118
+ var pre = [];
119
+ var data = this.state.showLicenseData;
120
+ Object.keys(data).forEach(function (key) {
121
+ if (data[key] === null || data[key] === undefined) {
122
+ return;
123
+ }
124
+ if ((0, _typeof2["default"])(data[key]) === 'object') {
125
+ var obj = data[key];
126
+ Object.keys(obj).forEach(function (key1) {
127
+ if (obj[key1] !== null && obj[key1] !== undefined) {
128
+ if ((0, _typeof2["default"])(obj[key1]) === 'object') {
129
+ pre.push( /*#__PURE__*/_react["default"].createElement("div", {
130
+ key: key1
131
+ }, /*#__PURE__*/_react["default"].createElement("div", {
132
+ className: _this2.props.classes.licLabel
133
+ }, key1, ":"), JSON.stringify(obj[key1], null, 2)));
134
+ } else {
135
+ pre.push( /*#__PURE__*/_react["default"].createElement("div", {
136
+ key: key1
137
+ }, /*#__PURE__*/_react["default"].createElement("div", {
138
+ className: _this2.props.classes.licLabel
139
+ }, key, " - ", key1, ":"), data[key1].toString()));
140
+ }
141
+ }
142
+ });
143
+ } else {
144
+ pre.push( /*#__PURE__*/_react["default"].createElement("div", {
145
+ key: key
146
+ }, /*#__PURE__*/_react["default"].createElement("div", {
147
+ className: _this2.props.classes.licLabel
148
+ }, key.replace(/_/g, ' '), ":"), data[key]));
149
+ }
121
150
  });
151
+ pre.push( /*#__PURE__*/_react["default"].createElement("div", {
152
+ key: "checked"
153
+ }, /*#__PURE__*/_react["default"].createElement("div", {
154
+ className: this.props.classes.licLabel
155
+ }, _i18n["default"].t('ra_Checked'), ":"), this.state.licenseOfflineCheck ? _i18n["default"].t('ra_locally') : _i18n["default"].t('ra_via internet')));
122
156
  return /*#__PURE__*/_react["default"].createElement(_material.Dialog, {
123
157
  open: !0,
124
158
  onClose: function onClose() {
@@ -209,7 +243,7 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
209
243
  key: "checkLicense",
210
244
  value: function () {
211
245
  var _checkLicense = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(license, adapterName) {
212
- var uuid, _uuidObj$native2, uuidObj, version, _aObj$common2, aObj, _data, response, data, _data2, showLicenseData, validTill, parts, _error$response, _data3, _parts;
246
+ var uuid, _uuidObj$native2, uuidObj, version, _aObj$common2, aObj, controller, timeout, _data, response, data, _data2, showLicenseData, validTill, parts, _error$response, _data3, _parts;
213
247
  return _regenerator["default"].wrap(function _callee3$(_context3) {
214
248
  while (1) switch (_context3.prev = _context3.next) {
215
249
  case 0:
@@ -233,8 +267,13 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
233
267
  aObj = _context3.sent;
234
268
  version = aObj === null || aObj === void 0 ? void 0 : (_aObj$common2 = aObj.common) === null || _aObj$common2 === void 0 ? void 0 : _aObj$common2.version;
235
269
  case 10:
236
- _context3.prev = 10;
237
- _context3.next = 13;
270
+ controller = new AbortController();
271
+ timeout = setTimeout(function () {
272
+ timeout = null;
273
+ controller.abort();
274
+ }, 5000);
275
+ _context3.prev = 12;
276
+ _context3.next = 15;
238
277
  return window.fetch('https://iobroker.net/api/v1/public/cert/', {
239
278
  method: 'POST',
240
279
  body: JSON.stringify({
@@ -243,13 +282,15 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
243
282
  }),
244
283
  headers: {
245
284
  'Content-Type': 'text/plain'
246
- }
285
+ },
286
+ signal: controller.signal
247
287
  });
248
- case 13:
288
+ case 15:
249
289
  response = _context3.sent;
250
- _context3.next = 16;
290
+ timeout && clearTimeout(timeout);
291
+ _context3.next = 19;
251
292
  return response.text();
252
- case 16:
293
+ case 19:
253
294
  data = _context3.sent;
254
295
  try {
255
296
  data = JSON.parse(data);
@@ -257,107 +298,108 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
257
298
  // ignore
258
299
  }
259
300
  if (!((_data = data) !== null && _data !== void 0 && _data.error)) {
260
- _context3.next = 30;
301
+ _context3.next = 33;
261
302
  break;
262
303
  }
263
- _context3.prev = 19;
304
+ _context3.prev = 22;
264
305
  _data2 = ConfigCheckLicense.parseJwt(license);
265
306
  return _context3.abrupt("return", this.setState({
266
307
  _error: _data2.error,
308
+ licenseOfflineCheck: false,
267
309
  showLicenseData: _data2,
268
310
  result: false,
269
311
  running: false
270
312
  }));
271
- case 24:
272
- _context3.prev = 24;
273
- _context3.t0 = _context3["catch"](19);
313
+ case 27:
314
+ _context3.prev = 27;
315
+ _context3.t0 = _context3["catch"](22);
274
316
  console.log('Cannot parse license');
275
317
  return _context3.abrupt("return", this.setState({
276
318
  _error: data.error,
277
319
  result: false,
278
320
  running: false
279
321
  }));
280
- case 28:
281
- _context3.next = 49;
322
+ case 31:
323
+ _context3.next = 52;
282
324
  break;
283
- case 30:
325
+ case 33:
284
326
  showLicenseData = null;
285
327
  try {
286
328
  showLicenseData = ConfigCheckLicense.parseJwt(license);
287
329
  } catch (e) {}
288
330
  if (!data) {
289
- _context3.next = 48;
331
+ _context3.next = 51;
290
332
  break;
291
333
  }
292
334
  validTill = data.validTill || data.valid_till;
293
335
  if (!(validTill && validTill !== '0000-00-00 00:00:00' && new Date(validTill).getTime() < Date.now())) {
294
- _context3.next = 36;
336
+ _context3.next = 39;
295
337
  break;
296
338
  }
297
339
  return _context3.abrupt("return", this.setState({
298
340
  _error: _i18n["default"].t('ra_License expired on %s', new Date(validTill).toLocaleString()),
299
- licenseOfflineCheck: true,
341
+ licenseOfflineCheck: false,
300
342
  showLicenseData: showLicenseData,
301
343
  result: false,
302
344
  running: false
303
345
  }));
304
- case 36:
346
+ case 39:
305
347
  parts = (data.name || '').split('.');
306
348
  if (!(parts[1] === adapterName)) {
307
- _context3.next = 45;
349
+ _context3.next = 48;
308
350
  break;
309
351
  }
310
352
  if (!(uuid && data.uuid && data.uuid !== uuid)) {
311
- _context3.next = 40;
353
+ _context3.next = 43;
312
354
  break;
313
355
  }
314
356
  return _context3.abrupt("return", this.setState({
315
357
  _error: _i18n["default"].t('ra_Serial number (UUID) "%s" in license is for other device.', data.uuid),
316
- licenseOfflineCheck: true,
358
+ licenseOfflineCheck: false,
317
359
  showLicenseData: showLicenseData,
318
360
  result: false,
319
361
  running: false
320
362
  }));
321
- case 40:
363
+ case 43:
322
364
  if (ConfigCheckLicense.isVersionValid(version, data.version, data.invoice, adapterName)) {
323
- _context3.next = 42;
365
+ _context3.next = 45;
324
366
  break;
325
367
  }
326
368
  return _context3.abrupt("return", this.setState({
327
369
  _error: _i18n["default"].t('ra_License is for version %s, but required version is %s', data.version, this.props.schema.version),
328
- licenseOfflineCheck: true,
370
+ licenseOfflineCheck: false,
329
371
  showLicenseData: showLicenseData,
330
372
  result: false,
331
373
  running: false
332
374
  }));
333
- case 42:
375
+ case 45:
334
376
  return _context3.abrupt("return", this.setState({
335
- licenseOfflineCheck: true,
377
+ licenseOfflineCheck: false,
336
378
  showLicenseData: showLicenseData,
337
379
  result: true,
338
380
  running: false
339
381
  }));
340
- case 45:
382
+ case 48:
341
383
  return _context3.abrupt("return", this.setState({
342
384
  _error: _i18n["default"].t('ra_License for other product "%s"', data.name),
343
- licenseOfflineCheck: true,
385
+ licenseOfflineCheck: false,
344
386
  showLicenseData: showLicenseData,
345
387
  result: false,
346
388
  running: false
347
389
  }));
348
- case 46:
349
- _context3.next = 49;
350
- break;
351
- case 48:
352
- throw new Error('ra_Invalid answer from server');
353
390
  case 49:
354
- _context3.next = 74;
391
+ _context3.next = 52;
355
392
  break;
356
393
  case 51:
357
- _context3.prev = 51;
358
- _context3.t1 = _context3["catch"](10);
394
+ throw new Error('ra_Invalid answer from server');
395
+ case 52:
396
+ _context3.next = 77;
397
+ break;
398
+ case 54:
399
+ _context3.prev = 54;
400
+ _context3.t1 = _context3["catch"](12);
359
401
  if (!((_context3.t1 === null || _context3.t1 === void 0 ? void 0 : (_error$response = _context3.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 404)) {
360
- _context3.next = 55;
402
+ _context3.next = 58;
361
403
  break;
362
404
  }
363
405
  return _context3.abrupt("return", this.setState({
@@ -365,12 +407,12 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
365
407
  result: false,
366
408
  running: false
367
409
  }));
368
- case 55:
369
- _context3.prev = 55;
410
+ case 58:
411
+ _context3.prev = 58;
370
412
  _data3 = ConfigCheckLicense.parseJwt(license);
371
413
  _parts = (_data3.name || '').split('.');
372
414
  if (!(_data3.valid_till && _data3.valid_till !== '0000-00-00 00:00:00' && new Date(_data3.valid_till).getTime() < Date.now())) {
373
- _context3.next = 60;
415
+ _context3.next = 63;
374
416
  break;
375
417
  }
376
418
  return _context3.abrupt("return", this.setState({
@@ -380,13 +422,13 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
380
422
  running: false,
381
423
  result: false
382
424
  }));
383
- case 60:
425
+ case 63:
384
426
  if (!(_parts[1] === adapterName)) {
385
- _context3.next = 68;
427
+ _context3.next = 71;
386
428
  break;
387
429
  }
388
430
  if (!(uuid && _data3.uuid && _data3.uuid !== uuid)) {
389
- _context3.next = 63;
431
+ _context3.next = 66;
390
432
  break;
391
433
  }
392
434
  return _context3.abrupt("return", this.setState({
@@ -396,9 +438,9 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
396
438
  result: false,
397
439
  running: false
398
440
  }));
399
- case 63:
441
+ case 66:
400
442
  if (ConfigCheckLicense.isVersionValid(version, _data3.version, _data3.invoice, adapterName)) {
401
- _context3.next = 65;
443
+ _context3.next = 68;
402
444
  break;
403
445
  }
404
446
  return _context3.abrupt("return", this.setState({
@@ -408,12 +450,14 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
408
450
  result: false,
409
451
  running: false
410
452
  }));
411
- case 65:
453
+ case 68:
412
454
  return _context3.abrupt("return", this.setState({
455
+ running: false,
413
456
  result: true,
414
- licenseOfflineCheck: true
457
+ licenseOfflineCheck: true,
458
+ showLicenseData: _data3
415
459
  }));
416
- case 68:
460
+ case 71:
417
461
  return _context3.abrupt("return", this.setState({
418
462
  _error: _i18n["default"].t('ra_License for other product "%s"', _data3.name),
419
463
  licenseOfflineCheck: true,
@@ -421,75 +465,135 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
421
465
  result: false,
422
466
  running: false
423
467
  }));
424
- case 69:
425
- _context3.next = 74;
468
+ case 72:
469
+ _context3.next = 77;
426
470
  break;
427
- case 71:
428
- _context3.prev = 71;
429
- _context3.t2 = _context3["catch"](55);
471
+ case 74:
472
+ _context3.prev = 74;
473
+ _context3.t2 = _context3["catch"](58);
430
474
  return _context3.abrupt("return", this.setState({
431
475
  _error: _i18n["default"].t('ra_Cannot decode license'),
432
476
  result: false,
433
477
  licenseOfflineCheck: true,
434
478
  running: false
435
479
  }));
436
- case 74:
480
+ case 77:
437
481
  case "end":
438
482
  return _context3.stop();
439
483
  }
440
- }, _callee3, this, [[10, 51], [19, 24], [55, 71]]);
484
+ }, _callee3, this, [[12, 54], [22, 27], [58, 74]]);
441
485
  }));
442
486
  function checkLicense(_x2, _x3) {
443
487
  return _checkLicense.apply(this, arguments);
444
488
  }
445
489
  return checkLicense;
446
490
  }()
491
+ }, {
492
+ key: "renderAskForUpdate",
493
+ value: function renderAskForUpdate() {
494
+ var _this3 = this;
495
+ if (!this.state.askForUpdate) {
496
+ return null;
497
+ }
498
+ return /*#__PURE__*/_react["default"].createElement(_Confirm["default"], {
499
+ text: _i18n["default"].t('ra_License not found in license manager. Do you want to read licenses from iobroker.net?'),
500
+ ok: _i18n["default"].t('ra_Yes'),
501
+ onClose: /*#__PURE__*/function () {
502
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(isYes) {
503
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
504
+ while (1) switch (_context4.prev = _context4.next) {
505
+ case 0:
506
+ _this3.setState({
507
+ askForUpdate: false
508
+ });
509
+ if (!isYes) {
510
+ _context4.next = 6;
511
+ break;
512
+ }
513
+ _context4.next = 4;
514
+ return ConfigCheckLicense.updateLicenses();
515
+ case 4:
516
+ _context4.next = 6;
517
+ return _this3._onClick(true);
518
+ case 6:
519
+ case "end":
520
+ return _context4.stop();
521
+ }
522
+ }, _callee4);
523
+ }));
524
+ return function (_x4) {
525
+ return _ref.apply(this, arguments);
526
+ };
527
+ }()
528
+ });
529
+ }
447
530
  }, {
448
531
  key: "_onClick",
449
532
  value: function () {
450
- var _onClick2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
451
- var license;
452
- return _regenerator["default"].wrap(function _callee4$(_context4) {
453
- while (1) switch (_context4.prev = _context4.next) {
533
+ var _onClick2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(secondRun) {
534
+ var adapterName, license;
535
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
536
+ while (1) switch (_context5.prev = _context5.next) {
454
537
  case 0:
538
+ adapterName = this.props.adapterName === 'vis-2-beta' ? 'vis' : this.props.adapterName;
455
539
  this.setState({
456
540
  running: true
457
541
  });
458
542
  if (!this.props.data.useLicenseManager) {
459
- _context4.next = 7;
543
+ _context5.next = 11;
544
+ break;
545
+ }
546
+ _context5.next = 5;
547
+ return this.findInLicenseManager(adapterName);
548
+ case 5:
549
+ license = _context5.sent;
550
+ if (!(!license && !secondRun)) {
551
+ _context5.next = 9;
460
552
  break;
461
553
  }
462
- _context4.next = 4;
463
- return this.findInLicenseManager(this.props.adapterName);
464
- case 4:
465
- license = _context4.sent;
466
- _context4.next = 8;
554
+ // no suitable license found in license manager
555
+ // should we read all licenses again?
556
+ this.setState({
557
+ askForUpdate: true
558
+ });
559
+ return _context5.abrupt("return");
560
+ case 9:
561
+ _context5.next = 12;
467
562
  break;
468
- case 7:
563
+ case 11:
469
564
  license = this.props.data.license;
470
- case 8:
565
+ case 12:
471
566
  if (!license) {
472
- _context4.next = 13;
567
+ _context5.next = 17;
473
568
  break;
474
569
  }
475
- _context4.next = 11;
476
- return this.checkLicense(license, this.props.adapterName, this.props.schema.uuid);
477
- case 11:
478
- _context4.next = 14;
570
+ _context5.next = 15;
571
+ return this.checkLicense(license, adapterName, this.props.schema.uuid);
572
+ case 15:
573
+ _context5.next = 18;
479
574
  break;
480
- case 13:
481
- this.setState({
482
- _error: _i18n["default"].t('ra_Suitable license not found in license manager'),
483
- result: false,
484
- running: false
485
- });
486
- case 14:
575
+ case 17:
576
+ if (this.props.data.useLicenseManager) {
577
+ this.setState({
578
+ _error: _i18n["default"].t('ra_Suitable license not found in license manager'),
579
+ result: false,
580
+ running: false
581
+ });
582
+ } else {
583
+ // this case could not happen
584
+ this.setState({
585
+ _error: _i18n["default"].t('ra_Please enter the license'),
586
+ result: false,
587
+ running: false
588
+ });
589
+ }
590
+ case 18:
487
591
  case "end":
488
- return _context4.stop();
592
+ return _context5.stop();
489
593
  }
490
- }, _callee4, this);
594
+ }, _callee5, this);
491
595
  }));
492
- function _onClick() {
596
+ function _onClick(_x5) {
493
597
  return _onClick2.apply(this, arguments);
494
598
  }
495
599
  return _onClick;
@@ -497,24 +601,24 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
497
601
  }, {
498
602
  key: "renderItem",
499
603
  value: function renderItem(error, disabled, defaultValue) {
500
- var _this3 = this;
604
+ var _this4 = this;
501
605
  return /*#__PURE__*/_react["default"].createElement("div", {
502
606
  className: this.props.classes.fullWidth
503
607
  }, /*#__PURE__*/_react["default"].createElement(_material.Button, {
504
608
  variant: this.props.schema.variant || 'outlined',
505
609
  color: this.props.schema.color || 'primary',
506
610
  className: this.props.classes.fullWidth,
507
- disabled: !this.props.data.license && !this.props.data.useLicenseManager,
611
+ disabled: !this.props.data.license && !this.props.data.useLicenseManager || this.state.running,
508
612
  startIcon: /*#__PURE__*/_react["default"].createElement(_Send["default"], null),
509
613
  onClick: function onClick() {
510
- return _this3._onClick();
614
+ return _this4._onClick();
511
615
  }
512
616
  }, this.state.running ? /*#__PURE__*/_react["default"].createElement(_material.CircularProgress, {
513
617
  size: 20,
514
618
  style: {
515
619
  marginRight: 8
516
620
  }
517
- }) : null, this.getText(this.props.schema.label || 'ra_Check license', this.props.schema.noTranslation)), this.renderMessageDialog());
621
+ }) : null, this.getText(this.props.schema.label || 'ra_Check license', this.props.schema.noTranslation)), this.renderMessageDialog(), this.renderErrorDialog(), this.renderAskForUpdate());
518
622
  }
519
623
  }], [{
520
624
  key: "parseJwt",
@@ -563,6 +667,25 @@ var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
563
667
  }
564
668
  return true;
565
669
  }
670
+ }, {
671
+ key: "updateLicenses",
672
+ value: function updateLicenses(socket) {
673
+ return new Promise(function (resolve, reject) {
674
+ socket.getRawSocket().emit('updateLicenses', null, null, function (err, licenses) {
675
+ if (err === 'permissionError') {
676
+ reject(_i18n["default"].t('May not trigger "updateLicenses"'));
677
+ } else {
678
+ if (err && err.error) {
679
+ reject(_i18n["default"].t(err.error));
680
+ } else if (err) {
681
+ reject(_i18n["default"].t(err));
682
+ } else {
683
+ resolve(licenses);
684
+ }
685
+ }
686
+ });
687
+ });
688
+ }
566
689
  }]);
567
690
  return ConfigCheckLicense;
568
691
  }(_ConfigGeneric2["default"]);