@iobroker/adapter-react-v5 4.13.3 → 4.13.4
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/AdminConnection.js.map +1 -1
- package/Components/404.js +13 -13
- package/Components/ColorPicker.js +54 -54
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js.map +1 -1
- package/Components/FileBrowser.js +3 -3
- package/Components/FileViewer.js +9 -16
- package/Components/Loader.js +223 -223
- package/Components/Loaders/PT.css +108 -108
- package/Components/Loaders/PT.js +103 -103
- package/Components/Loaders/Vendor.css +13 -13
- package/Components/Loaders/Vendor.js +7 -7
- package/Components/ObjectBrowser.d.ts +2 -2
- package/Components/ObjectBrowser.js +359 -351
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/TabContent.d.ts +3 -7
- package/Components/TabContent.js +1 -3
- package/Components/TableResize.d.ts +20 -13
- package/Components/TableResize.js +244 -262
- package/Components/TreeTable.js +70 -70
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +305 -305
- package/Components/loader.css +221 -221
- package/Components/types.d.ts +82 -82
- package/Components/withWidth.js +2 -2
- package/Components/withWidth.js.map +1 -1
- package/Connection.js.map +1 -1
- package/GenericApp.js +49 -49
- package/LICENSE +22 -22
- package/LegacyConnection.d.ts +4 -0
- package/LegacyConnection.js +14 -0
- package/Prompt.js +7 -7
- package/README.md +845 -841
- package/assets/devices/Alarm Systems.svg +18 -18
- package/assets/devices/Amplifier.svg +21 -21
- package/assets/devices/Awnings.svg +4 -4
- package/assets/devices/Battery Status.svg +4 -4
- package/assets/devices/Ceiling Spotlights.svg +15 -15
- package/assets/devices/Chandelier.svg +6 -6
- package/assets/devices/Climate.svg +11 -11
- package/assets/devices/Coffee Makers.svg +5 -5
- package/assets/devices/Cold Water.svg +31 -31
- package/assets/devices/Computer.svg +21 -21
- package/assets/devices/Consumption.svg +7 -7
- package/assets/devices/Curtains.svg +43 -43
- package/assets/devices/Dishwashers.svg +11 -11
- package/assets/devices/Doors.svg +5 -5
- package/assets/devices/Doorstep.svg +35 -35
- package/assets/devices/Dryer.svg +13 -13
- package/assets/devices/Fan.svg +20 -20
- package/assets/devices/Floor Lamps.svg +4 -4
- package/assets/devices/Garage Doors.svg +9 -9
- package/assets/devices/Gates.svg +32 -32
- package/assets/devices/Hairdryer.svg +23 -23
- package/assets/devices/Handle.svg +6 -6
- package/assets/devices/Hanging Lamps.svg +8 -8
- package/assets/devices/Heater.svg +44 -44
- package/assets/devices/Hoods.svg +11 -11
- package/assets/devices/Hot Water.svg +9 -9
- package/assets/devices/Humidity.svg +41 -41
- package/assets/devices/Iron.svg +4 -4
- package/assets/devices/Irrigation.svg +22 -22
- package/assets/devices/Led Strip.svg +30 -30
- package/assets/devices/Light.svg +29 -29
- package/assets/devices/Lightings.svg +46 -46
- package/assets/devices/Lock.svg +19 -19
- package/assets/devices/Louvre.svg +6 -6
- package/assets/devices/Mowing Machine.svg +8 -8
- package/assets/devices/Music.svg +12 -12
- package/assets/devices/Outdoor Blinds.svg +6 -6
- package/assets/devices/People.svg +19 -19
- package/assets/devices/Pool.svg +7 -7
- package/assets/devices/Power Consumption.svg +12 -12
- package/assets/devices/Printer.svg +9 -9
- package/assets/devices/Pump.svg +9 -9
- package/assets/devices/Receiver.svg +18 -18
- package/assets/devices/Sconces.svg +9 -9
- package/assets/devices/Security.svg +34 -34
- package/assets/devices/Shading.svg +4 -4
- package/assets/devices/Shutters.svg +10 -10
- package/assets/devices/SmokeDetector.svg +12 -12
- package/assets/devices/Sockets.svg +13 -13
- package/assets/devices/Speaker.svg +35 -35
- package/assets/devices/Stove.svg +11 -11
- package/assets/devices/Table Lamps.svg +11 -11
- package/assets/devices/Temperature Sensors.svg +28 -28
- package/assets/devices/Tv.svg +7 -7
- package/assets/devices/Vacuum Cleaner.svg +15 -15
- package/assets/devices/Ventilation.svg +12 -12
- package/assets/devices/Washing Machines.svg +15 -15
- package/assets/devices/Water Consumption.svg +5 -5
- package/assets/devices/Water Heater.svg +8 -8
- package/assets/devices/Water.svg +40 -40
- package/assets/devices/Weather.svg +28 -28
- package/assets/devices/Window.svg +7 -7
- package/assets/devices/list.json +993 -993
- package/assets/devices/names.txt +62 -62
- package/assets/devices/parseNames.js +34 -34
- package/assets/lamp_ceiling.svg +8 -8
- package/assets/lamp_table.svg +7 -7
- package/assets/no_icon.svg +9 -9
- package/assets/rooms/Anteroom.svg +52 -52
- package/assets/rooms/Attic.svg +21 -21
- package/assets/rooms/Balcony.svg +12 -12
- package/assets/rooms/Barn.svg +5 -5
- package/assets/rooms/Basement.svg +4 -4
- package/assets/rooms/Bathroom.svg +38 -38
- package/assets/rooms/Bedroom.svg +5 -5
- package/assets/rooms/Boiler Room.svg +12 -12
- package/assets/rooms/Carport.svg +17 -17
- package/assets/rooms/Cellar.svg +89 -89
- package/assets/rooms/Chamber.svg +9 -9
- package/assets/rooms/Corridor.svg +52 -52
- package/assets/rooms/Dining Area.svg +37 -37
- package/assets/rooms/Dining Room.svg +37 -37
- package/assets/rooms/Dining.svg +37 -37
- package/assets/rooms/Dressing Room.svg +4 -4
- package/assets/rooms/Driveway.svg +14 -14
- package/assets/rooms/Entrance.svg +44 -44
- package/assets/rooms/Equipment Room.svg +14 -14
- package/assets/rooms/Front Yard.svg +64 -64
- package/assets/rooms/Gallery.svg +13 -13
- package/assets/rooms/Garage.svg +20 -20
- package/assets/rooms/Garden.svg +12 -12
- package/assets/rooms/Ground Floor.svg +95 -95
- package/assets/rooms/Guest Bathroom.svg +32 -32
- package/assets/rooms/Guest Room.svg +5 -5
- package/assets/rooms/Gym.svg +4 -4
- package/assets/rooms/Hall.svg +19 -19
- package/assets/rooms/Home Theater.svg +7 -7
- package/assets/rooms/Kitchen.svg +17 -17
- package/assets/rooms/Laundry Room.svg +11 -11
- package/assets/rooms/Living Area.svg +10 -10
- package/assets/rooms/Living Room.svg +10 -10
- package/assets/rooms/Locker Room.svg +16 -16
- package/assets/rooms/Nursery.svg +4 -4
- package/assets/rooms/Office.svg +8 -8
- package/assets/rooms/Outdoors.svg +7 -7
- package/assets/rooms/Playroom.svg +5 -5
- package/assets/rooms/Pool.svg +7 -7
- package/assets/rooms/Rear Wall.svg +30 -30
- package/assets/rooms/Second Floor.svg +95 -95
- package/assets/rooms/Shed.svg +16 -16
- package/assets/rooms/Sleeping Area.svg +22 -22
- package/assets/rooms/Stairway.svg +4 -4
- package/assets/rooms/Stairwell.svg +15 -15
- package/assets/rooms/Storeroom.svg +4 -4
- package/assets/rooms/Summer House.svg +27 -27
- package/assets/rooms/Swimming Pool.svg +21 -21
- package/assets/rooms/Terrace.svg +6 -6
- package/assets/rooms/Toilet.svg +10 -10
- package/assets/rooms/Upstairs.svg +5 -5
- package/assets/rooms/Wardrobe.svg +60 -60
- package/assets/rooms/Washroom.svg +19 -19
- package/assets/rooms/Wc.svg +10 -10
- package/assets/rooms/Windscreen.svg +60 -60
- package/assets/rooms/Workshop.svg +22 -22
- package/assets/rooms/Workspace.svg +8 -8
- package/assets/rooms/list.json +945 -945
- package/assets/rooms/names.txt +59 -59
- package/assets/rooms/parseNames.js +34 -34
- package/craco-module-federation.js +69 -69
- package/icons/IconAdapter.js.map +1 -1
- package/icons/IconAlias.js.map +1 -1
- package/icons/IconChannel.js.map +1 -1
- package/icons/IconClearFilter.js.map +1 -1
- package/icons/IconClosed.js.map +1 -1
- package/icons/IconCopy.js +8 -8
- package/icons/IconCopy.js.map +1 -1
- package/icons/IconDevice.js.map +1 -1
- package/icons/IconDocument.js.map +1 -1
- package/icons/IconDocumentReadOnly.js.map +1 -1
- package/icons/IconFx.js +1 -1
- package/icons/IconFx.js.map +1 -1
- package/icons/IconInstance.js.map +1 -1
- package/icons/IconLogout.js +9 -9
- package/icons/IconLogout.js.map +1 -1
- package/icons/IconNoIcon.js +8 -8
- package/icons/IconNoIcon.js.map +1 -1
- package/icons/IconOpen.js.map +1 -1
- package/icons/IconState.js.map +1 -1
- package/index.css +54 -54
- package/package.json +1 -1
- package/types.d.ts +94 -94
- package/Components/404.js.map +0 -1
- package/Components/CustomModal.js.map +0 -1
- package/Components/FileBrowser.js.map +0 -1
- package/Components/FileViewer.js.map +0 -1
- package/Components/Icon.js.map +0 -1
- package/Components/IconPicker.js.map +0 -1
- package/Components/IconSelector.js.map +0 -1
- package/Components/Image.js.map +0 -1
- package/Components/JsonConfigComponent/ChipInput.d.ts +0 -12
- package/Components/JsonConfigComponent/ChipInput.js +0 -763
- package/Components/JsonConfigComponent/ChipInput.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigAccordion.js +0 -348
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigAlive.js +0 -105
- package/Components/JsonConfigComponent/ConfigAlive.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +0 -37
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +0 -73
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +0 -131
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCRON.js +0 -157
- package/Components/JsonConfigComponent/ConfigCRON.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertCollection.js +0 -128
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +0 -149
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCertificates.js +0 -284
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +0 -821
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigCheckbox.js +0 -40
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigChip.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigChip.js +0 -120
- package/Components/JsonConfigComponent/ConfigChip.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigColor.d.ts +0 -22
- package/Components/JsonConfigComponent/ConfigColor.js +0 -120
- package/Components/JsonConfigComponent/ConfigColor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigCoordinates.js +0 -265
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +0 -26
- package/Components/JsonConfigComponent/ConfigCustom.js +0 -316
- package/Components/JsonConfigComponent/ConfigCustom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigDatePicker.js +0 -91
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +0 -6
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +0 -18
- package/Components/JsonConfigComponent/ConfigFile.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigFile.js +0 -228
- package/Components/JsonConfigComponent/ConfigFile.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigFileSelector.js +0 -625
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigFunc.js +0 -124
- package/Components/JsonConfigComponent/ConfigFunc.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +0 -95
- package/Components/JsonConfigComponent/ConfigGeneric.js +0 -646
- package/Components/JsonConfigComponent/ConfigIP.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigIP.js +0 -130
- package/Components/JsonConfigComponent/ConfigIP.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigImageSendTo.js +0 -114
- package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigImageUpload.js +0 -166
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +0 -264
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigInterface.js +0 -146
- package/Components/JsonConfigComponent/ConfigInterface.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +0 -13
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +0 -145
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +0 -7
- package/Components/JsonConfigComponent/ConfigLanguage.js +0 -110
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigLicense.js +0 -183
- package/Components/JsonConfigComponent/ConfigLicense.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigNumber.js +0 -117
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigObjectId.js +0 -167
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPanel.js +0 -396
- package/Components/JsonConfigComponent/ConfigPanel.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigPassword.js +0 -193
- package/Components/JsonConfigComponent/ConfigPassword.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +0 -21
- package/Components/JsonConfigComponent/ConfigPattern.js +0 -65
- package/Components/JsonConfigComponent/ConfigPattern.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigPort.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigPort.js +0 -176
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigRoom.js +0 -124
- package/Components/JsonConfigComponent/ConfigRoom.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSelect.js +0 -159
- package/Components/JsonConfigComponent/ConfigSelect.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +0 -272
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +0 -24
- package/Components/JsonConfigComponent/ConfigSendto.js +0 -294
- package/Components/JsonConfigComponent/ConfigSendto.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +0 -18
- package/Components/JsonConfigComponent/ConfigSetState.js +0 -185
- package/Components/JsonConfigComponent/ConfigSetState.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigSlider.js +0 -119
- package/Components/JsonConfigComponent/ConfigSlider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +0 -68
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +0 -81
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticImage.js +0 -71
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigStaticText.js +0 -88
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTable.d.ts +0 -3
- package/Components/JsonConfigComponent/ConfigTable.js +0 -1064
- package/Components/JsonConfigComponent/ConfigTable.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +0 -34
- package/Components/JsonConfigComponent/ConfigTabs.js +0 -162
- package/Components/JsonConfigComponent/ConfigTabs.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigText.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigText.js +0 -226
- package/Components/JsonConfigComponent/ConfigText.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +0 -10
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +0 -129
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigTimePicker.js +0 -85
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +0 -17
- package/Components/JsonConfigComponent/ConfigTopic.js +0 -110
- package/Components/JsonConfigComponent/ConfigTopic.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +0 -15
- package/Components/JsonConfigComponent/ConfigUUID.js +0 -95
- package/Components/JsonConfigComponent/ConfigUUID.js.map +0 -1
- package/Components/JsonConfigComponent/ConfigUser.d.ts +0 -14
- package/Components/JsonConfigComponent/ConfigUser.js +0 -142
- package/Components/JsonConfigComponent/ConfigUser.js.map +0 -1
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +0 -63
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +0 -268
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +0 -15
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +0 -53
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +0 -340
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +0 -45
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +0 -146
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +0 -69
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +0 -51
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +0 -226
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +0 -13
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +0 -111
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +0 -7
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +0 -16
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +0 -11
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +0 -94
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +0 -10
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +0 -22
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +0 -12
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +0 -158
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +0 -26
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +0 -21
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +0 -2
- package/Components/JsonConfigComponent/DeviceManager/index.js +0 -10
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +0 -1
- package/Components/JsonConfigComponent/Utils.d.ts +0 -9
- package/Components/JsonConfigComponent/Utils.js +0 -13
- package/Components/JsonConfigComponent/index.d.ts +0 -26
- package/Components/JsonConfigComponent/index.js +0 -520
- package/Components/JsonConfigComponent/index.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +0 -7
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +0 -10
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/i18n.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/i18n.js +0 -10
- package/Components/JsonConfigComponent/wrapper/i18n.js.map +0 -1
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +0 -2
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +0 -10
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +0 -1
- package/Components/Loader.js.map +0 -1
- package/Components/Loaders/PT.js.map +0 -1
- package/Components/Loaders/Vendor.js.map +0 -1
- package/Components/Logo.js.map +0 -1
- package/Components/MDUtils.js.map +0 -1
- package/Components/Router.js.map +0 -1
- package/Components/SaveCloseButtons.js.map +0 -1
- package/Components/Schedule.js.map +0 -1
- package/Components/SelectWithIcon.js.map +0 -1
- package/Components/SimpleCron/cron2text.js.map +0 -1
- package/Components/SimpleCron/cronText.js.map +0 -1
- package/Components/SimpleCron/index.js.map +0 -1
- package/Components/SimpleCron/jquery.cron.locale.js.map +0 -1
- package/Components/TabContainer.js.map +0 -1
- package/Components/TabContent.js.map +0 -1
- package/Components/TabHeader.js.map +0 -1
- package/Components/TableResize.js.map +0 -1
- package/Components/TextWithIcon.js.map +0 -1
- package/Components/ToggleThemeMenu.js.map +0 -1
- package/Components/UploadImage.js.map +0 -1
- package/Components/Utils.js.map +0 -1
- package/Components/copy-to-clipboard.d.ts +0 -13
- package/Components/copy-to-clipboard.js +0 -156
- package/Components/copy-to-clipboard.js.map +0 -1
- package/Dialogs/ComplexCron.js.map +0 -1
- package/Dialogs/Confirm.js.map +0 -1
- package/Dialogs/Cron.js.map +0 -1
- package/Dialogs/Error.js.map +0 -1
- package/Dialogs/Message.js.map +0 -1
- package/Dialogs/SelectFile.js.map +0 -1
- package/Dialogs/SelectID.js.map +0 -1
- package/Dialogs/SimpleCron.js.map +0 -1
- package/Dialogs/TextInput.js.map +0 -1
- package/GenericApp.js.map +0 -1
- package/LegacyConnection.js.map +0 -1
- package/Prompt.js.map +0 -1
- package/Theme.js.map +0 -1
- package/i18n.js.map +0 -1
- package/icons/IconExpert.js.map +0 -1
|
@@ -1,821 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
18
|
-
var _react = _interopRequireDefault(require("react"));
|
|
19
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
20
|
-
var _styles = require("@mui/styles");
|
|
21
|
-
var _material = require("@mui/material");
|
|
22
|
-
var _iconsMaterial = require("@mui/icons-material");
|
|
23
|
-
var _i18n = _interopRequireDefault(require("./wrapper/i18n"));
|
|
24
|
-
var _ConfigGeneric2 = _interopRequireDefault(require("./ConfigGeneric"));
|
|
25
|
-
var _Confirm = _interopRequireDefault(require("./wrapper/Dialogs/Confirm"));
|
|
26
|
-
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); }; }
|
|
27
|
-
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; } }
|
|
28
|
-
var styles = function styles(theme) {
|
|
29
|
-
return {
|
|
30
|
-
fullWidth: {
|
|
31
|
-
width: '100%'
|
|
32
|
-
},
|
|
33
|
-
icon: {
|
|
34
|
-
width: 24,
|
|
35
|
-
height: 24,
|
|
36
|
-
marginRight: 4
|
|
37
|
-
},
|
|
38
|
-
licLabel: {
|
|
39
|
-
fontWeight: 'bold',
|
|
40
|
-
minWidth: 100,
|
|
41
|
-
marginRight: 10,
|
|
42
|
-
textTransform: 'capitalize',
|
|
43
|
-
display: 'inline-block'
|
|
44
|
-
},
|
|
45
|
-
licValue: {
|
|
46
|
-
fontWeight: 'normal'
|
|
47
|
-
},
|
|
48
|
-
errorTitle: {
|
|
49
|
-
color: theme.palette.mode === 'dark' ? '#e39191' : '#b62020'
|
|
50
|
-
},
|
|
51
|
-
okTitle: {
|
|
52
|
-
color: theme.palette.mode === 'dark' ? '#6fd56f' : '#007c00'
|
|
53
|
-
},
|
|
54
|
-
errorText: {
|
|
55
|
-
color: theme.palette.mode === 'dark' ? '#e39191' : '#b62020',
|
|
56
|
-
marginBottom: 30
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
var ConfigCheckLicense = /*#__PURE__*/function (_ConfigGeneric) {
|
|
61
|
-
(0, _inherits2["default"])(ConfigCheckLicense, _ConfigGeneric);
|
|
62
|
-
var _super = _createSuper(ConfigCheckLicense);
|
|
63
|
-
function ConfigCheckLicense() {
|
|
64
|
-
(0, _classCallCheck2["default"])(this, ConfigCheckLicense);
|
|
65
|
-
return _super.apply(this, arguments);
|
|
66
|
-
}
|
|
67
|
-
(0, _createClass2["default"])(ConfigCheckLicense, [{
|
|
68
|
-
key: "componentDidMount",
|
|
69
|
-
value: function () {
|
|
70
|
-
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
71
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
72
|
-
while (1) switch (_context.prev = _context.next) {
|
|
73
|
-
case 0:
|
|
74
|
-
(0, _get2["default"])((0, _getPrototypeOf2["default"])(ConfigCheckLicense.prototype), "componentDidMount", this).call(this);
|
|
75
|
-
this.setState({
|
|
76
|
-
_error: '',
|
|
77
|
-
running: false,
|
|
78
|
-
showLicenseData: null,
|
|
79
|
-
foundSuitableLicense: false,
|
|
80
|
-
licenseOfflineCheck: false,
|
|
81
|
-
result: null
|
|
82
|
-
});
|
|
83
|
-
case 2:
|
|
84
|
-
case "end":
|
|
85
|
-
return _context.stop();
|
|
86
|
-
}
|
|
87
|
-
}, _callee, this);
|
|
88
|
-
}));
|
|
89
|
-
function componentDidMount() {
|
|
90
|
-
return _componentDidMount.apply(this, arguments);
|
|
91
|
-
}
|
|
92
|
-
return componentDidMount;
|
|
93
|
-
}()
|
|
94
|
-
}, {
|
|
95
|
-
key: "renderErrorDialog",
|
|
96
|
-
value: function renderErrorDialog() {
|
|
97
|
-
var _this = this;
|
|
98
|
-
if (this.state._error && !this.state.showLicenseData) {
|
|
99
|
-
var content = this.state._error;
|
|
100
|
-
if (this.state.allLicenses) {
|
|
101
|
-
content = [/*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
-
key: "error"
|
|
103
|
-
}, content)];
|
|
104
|
-
content.push( /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
105
|
-
key: "button",
|
|
106
|
-
variant: "contained",
|
|
107
|
-
onClick: function onClick() {
|
|
108
|
-
return window.open('https://iobroker.net/www/account/licenses', '_blank');
|
|
109
|
-
}
|
|
110
|
-
}, _i18n["default"].t('iobroker.net')));
|
|
111
|
-
if (!this.state.allLicenses.length) {
|
|
112
|
-
content.push( /*#__PURE__*/_react["default"].createElement("div", {
|
|
113
|
-
key: "text1"
|
|
114
|
-
}, _i18n["default"].t('ra_No one license found in license manager')));
|
|
115
|
-
content.push( /*#__PURE__*/_react["default"].createElement("div", {
|
|
116
|
-
key: "text2"
|
|
117
|
-
}, _i18n["default"].t('ra_Please create license')));
|
|
118
|
-
} else {
|
|
119
|
-
// license.id,
|
|
120
|
-
// validName,
|
|
121
|
-
// validUuid,
|
|
122
|
-
// validTill,
|
|
123
|
-
// validVersion,
|
|
124
|
-
// license,
|
|
125
|
-
content.push( /*#__PURE__*/_react["default"].createElement(_material.TableContainer, {
|
|
126
|
-
key: "table"
|
|
127
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.Table, {
|
|
128
|
-
size: "small"
|
|
129
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.TableHead, null, /*#__PURE__*/_react["default"].createElement(_material.TableRow, null, /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, _i18n["default"].t('ra_Product')), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, _i18n["default"].t('ra_Version')), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, "UUID"), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, _i18n["default"].t('ra_ValidTill')), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, _i18n["default"].t('ra_Commercial')), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, "ID"))), /*#__PURE__*/_react["default"].createElement(_material.TableBody, null, this.state.allLicenses.map(function (license) {
|
|
130
|
-
return /*#__PURE__*/_react["default"].createElement(_material.TableRow, {
|
|
131
|
-
key: license.id
|
|
132
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
133
|
-
className: license.validName ? '' : _this.props.classes.errorText
|
|
134
|
-
}, license.license.product), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
135
|
-
className: license.validVersion ? '' : _this.props.classes.errorText
|
|
136
|
-
}, license.license.version), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
137
|
-
className: license.validUuid ? '' : _this.props.classes.errorText
|
|
138
|
-
}, license.license.uuid || '--'), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
139
|
-
className: license.validTill ? '' : _this.props.classes.errorText
|
|
140
|
-
}, license.license.validTill && license.license.validTill !== '0000-00-00 00:00:00' ? new Date(license.license.validTill).toLocaleDateString() : '--'), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, license.license.invoice !== 'free' ? license.license.invoice === 'MANUALLY_CREATED' ? '✓' : license.license.invoice : '-'), /*#__PURE__*/_react["default"].createElement(_material.TableCell, null, license.id));
|
|
141
|
-
})))));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return /*#__PURE__*/_react["default"].createElement(_material.Dialog, {
|
|
145
|
-
open: !0,
|
|
146
|
-
maxWidth: "xl",
|
|
147
|
-
fullWidth: this.props.fullWidth !== undefined ? this.props.fullWidth : true,
|
|
148
|
-
onClose: function onClose() {
|
|
149
|
-
return _this.handleOk();
|
|
150
|
-
}
|
|
151
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.DialogTitle, null, _i18n["default"].t('ra_Error')), /*#__PURE__*/_react["default"].createElement(_material.DialogContent, null, /*#__PURE__*/_react["default"].createElement(_material.DialogContentText, null, content)), /*#__PURE__*/_react["default"].createElement(_material.DialogActions, null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
152
|
-
variant: "contained",
|
|
153
|
-
onClick: function onClick() {
|
|
154
|
-
return _this.setState({
|
|
155
|
-
_error: '',
|
|
156
|
-
allLicenses: null
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
color: "primary",
|
|
160
|
-
autoFocus: true,
|
|
161
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Check, null)
|
|
162
|
-
}, _i18n["default"].t('ra_Ok'))));
|
|
163
|
-
}
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "renderMessageDialog",
|
|
168
|
-
value: function renderMessageDialog() {
|
|
169
|
-
var _this2 = this;
|
|
170
|
-
if (this.state.showLicenseData) {
|
|
171
|
-
var pre = [];
|
|
172
|
-
var data = this.state.showLicenseData;
|
|
173
|
-
Object.keys(data).forEach(function (key) {
|
|
174
|
-
if (data[key] === null || data[key] === undefined) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if ((0, _typeof2["default"])(data[key]) === 'object') {
|
|
178
|
-
var obj = data[key];
|
|
179
|
-
Object.keys(obj).forEach(function (key1) {
|
|
180
|
-
if (obj[key1] !== null && obj[key1] !== undefined) {
|
|
181
|
-
if ((0, _typeof2["default"])(obj[key1]) === 'object') {
|
|
182
|
-
pre.push( /*#__PURE__*/_react["default"].createElement("div", {
|
|
183
|
-
key: key1
|
|
184
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
|
-
className: _this2.props.classes.licLabel
|
|
186
|
-
}, key1, ":"), JSON.stringify(obj[key1], null, 2)));
|
|
187
|
-
} else {
|
|
188
|
-
pre.push( /*#__PURE__*/_react["default"].createElement("div", {
|
|
189
|
-
key: key1
|
|
190
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
191
|
-
className: _this2.props.classes.licLabel
|
|
192
|
-
}, key, ' ', "-", key1, ":"), obj[key1].toString()));
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
pre.push( /*#__PURE__*/_react["default"].createElement("div", {
|
|
198
|
-
key: key
|
|
199
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
200
|
-
className: _this2.props.classes.licLabel
|
|
201
|
-
}, key.replace(/_/g, ' '), ":"), data[key].toString()));
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
pre.push( /*#__PURE__*/_react["default"].createElement("div", {
|
|
205
|
-
key: "checked"
|
|
206
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
207
|
-
className: this.props.classes.licLabel
|
|
208
|
-
}, _i18n["default"].t('ra_Checked'), ":"), this.state.licenseOfflineCheck ? _i18n["default"].t('ra_locally') : _i18n["default"].t('ra_via internet')));
|
|
209
|
-
return /*#__PURE__*/_react["default"].createElement(_material.Dialog, {
|
|
210
|
-
open: !0,
|
|
211
|
-
onClose: function onClose() {
|
|
212
|
-
return _this2.setState({
|
|
213
|
-
showLicenseData: null
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.DialogTitle, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
217
|
-
className: this.state.result ? this.props.classes.okTitle : this.props.classes.errorTitle
|
|
218
|
-
}, _i18n["default"].t('ra_License %s', this.state.result ? 'OK' : 'INVALID'))), /*#__PURE__*/_react["default"].createElement(_material.DialogContent, null, this.state.showLinkToProfile ? /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
219
|
-
variant: "contained",
|
|
220
|
-
onClick: function onClick() {
|
|
221
|
-
return window.open('https://iobroker.net/www/account/licenses', '_blank');
|
|
222
|
-
}
|
|
223
|
-
}, "https://iobroker.net") : null, this.state._error ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
224
|
-
className: this.props.classes.errorText
|
|
225
|
-
}, this.state._error) : null, pre), /*#__PURE__*/_react["default"].createElement(_material.DialogActions, null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
226
|
-
onClick: function onClick() {
|
|
227
|
-
return _this2.setState({
|
|
228
|
-
showLicenseData: null,
|
|
229
|
-
_error: ''
|
|
230
|
-
});
|
|
231
|
-
},
|
|
232
|
-
color: "primary",
|
|
233
|
-
variant: "contained"
|
|
234
|
-
}, _i18n["default"].t('ra_Close'))));
|
|
235
|
-
}
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
key: "findInLicenseManager",
|
|
240
|
-
value: function () {
|
|
241
|
-
var _findInLicenseManager = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(adapterName) {
|
|
242
|
-
var _licenses$native;
|
|
243
|
-
var licenses, errors, useLicense, now, uuid, _uuidObj$native, uuidObj, version, _aObj$common, aObj;
|
|
244
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
245
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
246
|
-
case 0:
|
|
247
|
-
_context2.next = 2;
|
|
248
|
-
return this.props.socket.getObject('system.licenses');
|
|
249
|
-
case 2:
|
|
250
|
-
licenses = _context2.sent;
|
|
251
|
-
errors = [];
|
|
252
|
-
if (!(licenses !== null && licenses !== void 0 && (_licenses$native = licenses["native"]) !== null && _licenses$native !== void 0 && (_licenses$native = _licenses$native.licenses) !== null && _licenses$native !== void 0 && _licenses$native.length)) {
|
|
253
|
-
_context2.next = 18;
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
// enable license manager
|
|
257
|
-
now = Date.now();
|
|
258
|
-
if (!this.props.schema.uuid) {
|
|
259
|
-
_context2.next = 11;
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
_context2.next = 9;
|
|
263
|
-
return this.props.socket.getObject('system.meta.uuid');
|
|
264
|
-
case 9:
|
|
265
|
-
uuidObj = _context2.sent;
|
|
266
|
-
uuid = uuidObj === null || uuidObj === void 0 || (_uuidObj$native = uuidObj["native"]) === null || _uuidObj$native === void 0 ? void 0 : _uuidObj$native.uuid;
|
|
267
|
-
case 11:
|
|
268
|
-
if (!this.props.schema.version) {
|
|
269
|
-
_context2.next = 16;
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
_context2.next = 14;
|
|
273
|
-
return this.props.socket.getObject("system.adapter.".concat(adapterName));
|
|
274
|
-
case 14:
|
|
275
|
-
aObj = _context2.sent;
|
|
276
|
-
version = aObj === null || aObj === void 0 || (_aObj$common = aObj.common) === null || _aObj$common === void 0 ? void 0 : _aObj$common.version;
|
|
277
|
-
case 16:
|
|
278
|
-
// find license for vis
|
|
279
|
-
licenses["native"].licenses.forEach(function (license) {
|
|
280
|
-
var validTill = !license.validTill || license.validTill === '0000-00-00 00:00:00' || new Date(license.validTill).getTime() > now;
|
|
281
|
-
var parts = (license.product || '').split('.');
|
|
282
|
-
var validName = parts[1] === adapterName || adapterName === 'vis-2' && parts[1] === 'vis';
|
|
283
|
-
var validUuid = !uuid || !license.uuid || license.uuid === uuid;
|
|
284
|
-
var validVersion = ConfigCheckLicense.isVersionValid(version, license.version, license.invoice, adapterName);
|
|
285
|
-
// commercial license has priority over free license
|
|
286
|
-
if ((!useLicense || license.invoice !== 'free') && validTill && validName && validUuid && validVersion) {
|
|
287
|
-
useLicense = license;
|
|
288
|
-
}
|
|
289
|
-
errors.push({
|
|
290
|
-
id: license.id,
|
|
291
|
-
validName: validName,
|
|
292
|
-
validUuid: validUuid,
|
|
293
|
-
validVersion: validVersion,
|
|
294
|
-
validTill: validTill,
|
|
295
|
-
license: license
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
if (useLicense) {
|
|
299
|
-
errors.find(function (e) {
|
|
300
|
-
return e.id === useLicense.id;
|
|
301
|
-
}).used = true;
|
|
302
|
-
}
|
|
303
|
-
case 18:
|
|
304
|
-
return _context2.abrupt("return", errors);
|
|
305
|
-
case 19:
|
|
306
|
-
case "end":
|
|
307
|
-
return _context2.stop();
|
|
308
|
-
}
|
|
309
|
-
}, _callee2, this);
|
|
310
|
-
}));
|
|
311
|
-
function findInLicenseManager(_x) {
|
|
312
|
-
return _findInLicenseManager.apply(this, arguments);
|
|
313
|
-
}
|
|
314
|
-
return findInLicenseManager;
|
|
315
|
-
}()
|
|
316
|
-
}, {
|
|
317
|
-
key: "checkLicense",
|
|
318
|
-
value: function () {
|
|
319
|
-
var _checkLicense = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(license, adapterName) {
|
|
320
|
-
var uuid, _uuidObj$native2, uuidObj, version, _aObj$common2, aObj, controller, timeout, _data, response, data, data_, _error, showLicenseData, validTill, parts, _error$response, _data2, _parts;
|
|
321
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
322
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
323
|
-
case 0:
|
|
324
|
-
if (!this.props.schema.uuid) {
|
|
325
|
-
_context3.next = 5;
|
|
326
|
-
break;
|
|
327
|
-
}
|
|
328
|
-
_context3.next = 3;
|
|
329
|
-
return this.props.socket.getObject('system.meta.uuid');
|
|
330
|
-
case 3:
|
|
331
|
-
uuidObj = _context3.sent;
|
|
332
|
-
uuid = uuidObj === null || uuidObj === void 0 || (_uuidObj$native2 = uuidObj["native"]) === null || _uuidObj$native2 === void 0 ? void 0 : _uuidObj$native2.uuid;
|
|
333
|
-
case 5:
|
|
334
|
-
if (!this.props.schema.version) {
|
|
335
|
-
_context3.next = 10;
|
|
336
|
-
break;
|
|
337
|
-
}
|
|
338
|
-
_context3.next = 8;
|
|
339
|
-
return this.props.socket.getObject("system.adapter.".concat(adapterName));
|
|
340
|
-
case 8:
|
|
341
|
-
aObj = _context3.sent;
|
|
342
|
-
version = aObj === null || aObj === void 0 || (_aObj$common2 = aObj.common) === null || _aObj$common2 === void 0 ? void 0 : _aObj$common2.version;
|
|
343
|
-
case 10:
|
|
344
|
-
controller = new AbortController();
|
|
345
|
-
timeout = setTimeout(function () {
|
|
346
|
-
timeout = null;
|
|
347
|
-
controller.abort();
|
|
348
|
-
}, 5000);
|
|
349
|
-
_context3.prev = 12;
|
|
350
|
-
_context3.next = 15;
|
|
351
|
-
return window.fetch('https://iobroker.net/api/v1/public/cert/', {
|
|
352
|
-
method: 'POST',
|
|
353
|
-
body: JSON.stringify({
|
|
354
|
-
json: license,
|
|
355
|
-
uuid: uuid
|
|
356
|
-
}),
|
|
357
|
-
headers: {
|
|
358
|
-
'Content-Type': 'text/plain'
|
|
359
|
-
},
|
|
360
|
-
signal: controller.signal
|
|
361
|
-
});
|
|
362
|
-
case 15:
|
|
363
|
-
response = _context3.sent;
|
|
364
|
-
timeout && clearTimeout(timeout);
|
|
365
|
-
_context3.next = 19;
|
|
366
|
-
return response.text();
|
|
367
|
-
case 19:
|
|
368
|
-
data = _context3.sent;
|
|
369
|
-
try {
|
|
370
|
-
data = JSON.parse(data);
|
|
371
|
-
} catch (e) {
|
|
372
|
-
// ignore
|
|
373
|
-
}
|
|
374
|
-
if (!((_data = data) !== null && _data !== void 0 && _data.error)) {
|
|
375
|
-
_context3.next = 34;
|
|
376
|
-
break;
|
|
377
|
-
}
|
|
378
|
-
_context3.prev = 22;
|
|
379
|
-
data_ = ConfigCheckLicense.parseJwt(license);
|
|
380
|
-
_error = _i18n["default"].t("ra_".concat(data_.error || data.error || 'Unknown error')).replace(/^ra_/, '');
|
|
381
|
-
return _context3.abrupt("return", this.setState({
|
|
382
|
-
_error: _error,
|
|
383
|
-
licenseOfflineCheck: false,
|
|
384
|
-
showLicenseData: data_,
|
|
385
|
-
result: false,
|
|
386
|
-
running: false
|
|
387
|
-
}));
|
|
388
|
-
case 28:
|
|
389
|
-
_context3.prev = 28;
|
|
390
|
-
_context3.t0 = _context3["catch"](22);
|
|
391
|
-
console.log('Cannot parse license');
|
|
392
|
-
return _context3.abrupt("return", this.setState({
|
|
393
|
-
_error: data.error,
|
|
394
|
-
result: false,
|
|
395
|
-
running: false
|
|
396
|
-
}));
|
|
397
|
-
case 32:
|
|
398
|
-
_context3.next = 51;
|
|
399
|
-
break;
|
|
400
|
-
case 34:
|
|
401
|
-
showLicenseData = null;
|
|
402
|
-
try {
|
|
403
|
-
showLicenseData = ConfigCheckLicense.parseJwt(license);
|
|
404
|
-
} catch (e) {
|
|
405
|
-
// ignore
|
|
406
|
-
}
|
|
407
|
-
if (!data) {
|
|
408
|
-
_context3.next = 50;
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
411
|
-
validTill = data.validTill || data.valid_till;
|
|
412
|
-
if (!(validTill && validTill !== '0000-00-00 00:00:00' && new Date(validTill).getTime() < Date.now())) {
|
|
413
|
-
_context3.next = 40;
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
return _context3.abrupt("return", this.setState({
|
|
417
|
-
_error: _i18n["default"].t('ra_License expired on %s', new Date(validTill).toLocaleString()),
|
|
418
|
-
licenseOfflineCheck: false,
|
|
419
|
-
showLicenseData: showLicenseData,
|
|
420
|
-
result: false,
|
|
421
|
-
running: false
|
|
422
|
-
}));
|
|
423
|
-
case 40:
|
|
424
|
-
parts = (data.name || '').split('.');
|
|
425
|
-
if (!(parts[1] === adapterName || parts[1] === 'vis' && adapterName === 'vis-2')) {
|
|
426
|
-
_context3.next = 49;
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
if (!(uuid && !data.uuid && adapterName === 'vis-2')) {
|
|
430
|
-
_context3.next = 44;
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
return _context3.abrupt("return", this.setState({
|
|
434
|
-
_error: _i18n["default"].t('ra_License must be converted', data.uuid),
|
|
435
|
-
showLinkToProfile: true,
|
|
436
|
-
licenseOfflineCheck: false,
|
|
437
|
-
showLicenseData: showLicenseData,
|
|
438
|
-
result: false,
|
|
439
|
-
running: false
|
|
440
|
-
}));
|
|
441
|
-
case 44:
|
|
442
|
-
if (!(uuid && data.uuid && data.uuid !== uuid)) {
|
|
443
|
-
_context3.next = 46;
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
return _context3.abrupt("return", this.setState({
|
|
447
|
-
_error: _i18n["default"].t('ra_Serial number (UUID) "%s" in license is for other device.', data.uuid),
|
|
448
|
-
licenseOfflineCheck: false,
|
|
449
|
-
showLicenseData: showLicenseData,
|
|
450
|
-
result: false,
|
|
451
|
-
running: false
|
|
452
|
-
}));
|
|
453
|
-
case 46:
|
|
454
|
-
if (ConfigCheckLicense.isVersionValid(version, data.version, data.invoice, adapterName)) {
|
|
455
|
-
_context3.next = 48;
|
|
456
|
-
break;
|
|
457
|
-
}
|
|
458
|
-
return _context3.abrupt("return", this.setState({
|
|
459
|
-
_error: _i18n["default"].t('ra_License is for version %s, but required version is %s', data.version, this.props.schema.version),
|
|
460
|
-
licenseOfflineCheck: false,
|
|
461
|
-
showLicenseData: showLicenseData,
|
|
462
|
-
result: false,
|
|
463
|
-
running: false
|
|
464
|
-
}));
|
|
465
|
-
case 48:
|
|
466
|
-
return _context3.abrupt("return", this.setState({
|
|
467
|
-
licenseOfflineCheck: false,
|
|
468
|
-
showLicenseData: showLicenseData,
|
|
469
|
-
result: true,
|
|
470
|
-
running: false
|
|
471
|
-
}));
|
|
472
|
-
case 49:
|
|
473
|
-
return _context3.abrupt("return", this.setState({
|
|
474
|
-
_error: _i18n["default"].t('ra_License for other product "%s"', data.name),
|
|
475
|
-
licenseOfflineCheck: false,
|
|
476
|
-
showLicenseData: showLicenseData,
|
|
477
|
-
result: false,
|
|
478
|
-
running: false
|
|
479
|
-
}));
|
|
480
|
-
case 50:
|
|
481
|
-
throw new Error('ra_Invalid answer from server');
|
|
482
|
-
case 51:
|
|
483
|
-
_context3.next = 74;
|
|
484
|
-
break;
|
|
485
|
-
case 53:
|
|
486
|
-
_context3.prev = 53;
|
|
487
|
-
_context3.t1 = _context3["catch"](12);
|
|
488
|
-
if (!((_context3.t1 === null || _context3.t1 === void 0 || (_error$response = _context3.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 404)) {
|
|
489
|
-
_context3.next = 57;
|
|
490
|
-
break;
|
|
491
|
-
}
|
|
492
|
-
return _context3.abrupt("return", this.setState({
|
|
493
|
-
_error: _i18n["default"].t('ra_License does not exist'),
|
|
494
|
-
result: false,
|
|
495
|
-
running: false
|
|
496
|
-
}));
|
|
497
|
-
case 57:
|
|
498
|
-
_context3.prev = 57;
|
|
499
|
-
_data2 = ConfigCheckLicense.parseJwt(license);
|
|
500
|
-
_parts = (_data2.name || '').split('.');
|
|
501
|
-
if (!(_data2.valid_till && _data2.valid_till !== '0000-00-00 00:00:00' && new Date(_data2.valid_till).getTime() < Date.now())) {
|
|
502
|
-
_context3.next = 62;
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
return _context3.abrupt("return", this.setState({
|
|
506
|
-
_error: _i18n["default"].t('ra_License expired on %s', new Date(_data2.valid_till).toLocaleString()),
|
|
507
|
-
showLicenseData: _data2,
|
|
508
|
-
licenseOfflineCheck: true,
|
|
509
|
-
running: false,
|
|
510
|
-
result: false
|
|
511
|
-
}));
|
|
512
|
-
case 62:
|
|
513
|
-
if (!(_parts[1] === adapterName)) {
|
|
514
|
-
_context3.next = 68;
|
|
515
|
-
break;
|
|
516
|
-
}
|
|
517
|
-
if (!(uuid && _data2.uuid && _data2.uuid !== uuid)) {
|
|
518
|
-
_context3.next = 65;
|
|
519
|
-
break;
|
|
520
|
-
}
|
|
521
|
-
return _context3.abrupt("return", this.setState({
|
|
522
|
-
_error: _i18n["default"].t('ra_Serial number (UUID) "%s" in license is for other device.', _data2.uuid),
|
|
523
|
-
showLicenseData: _data2,
|
|
524
|
-
licenseOfflineCheck: true,
|
|
525
|
-
result: false,
|
|
526
|
-
running: false
|
|
527
|
-
}));
|
|
528
|
-
case 65:
|
|
529
|
-
if (ConfigCheckLicense.isVersionValid(version, _data2.version, _data2.invoice, adapterName)) {
|
|
530
|
-
_context3.next = 67;
|
|
531
|
-
break;
|
|
532
|
-
}
|
|
533
|
-
return _context3.abrupt("return", this.setState({
|
|
534
|
-
_error: _i18n["default"].t('ra_License is for version %s, but required version is %s', _data2.version, this.props.schema.version),
|
|
535
|
-
licenseOfflineCheck: true,
|
|
536
|
-
showLicenseData: _data2,
|
|
537
|
-
result: false,
|
|
538
|
-
running: false
|
|
539
|
-
}));
|
|
540
|
-
case 67:
|
|
541
|
-
return _context3.abrupt("return", this.setState({
|
|
542
|
-
running: false,
|
|
543
|
-
result: true,
|
|
544
|
-
licenseOfflineCheck: true,
|
|
545
|
-
showLicenseData: _data2
|
|
546
|
-
}));
|
|
547
|
-
case 68:
|
|
548
|
-
return _context3.abrupt("return", this.setState({
|
|
549
|
-
_error: _i18n["default"].t('ra_License for other product "%s"', _data2.name),
|
|
550
|
-
licenseOfflineCheck: true,
|
|
551
|
-
showLicenseData: _data2,
|
|
552
|
-
result: false,
|
|
553
|
-
running: false
|
|
554
|
-
}));
|
|
555
|
-
case 71:
|
|
556
|
-
_context3.prev = 71;
|
|
557
|
-
_context3.t2 = _context3["catch"](57);
|
|
558
|
-
return _context3.abrupt("return", this.setState({
|
|
559
|
-
_error: _i18n["default"].t('ra_Cannot decode license'),
|
|
560
|
-
result: false,
|
|
561
|
-
licenseOfflineCheck: true,
|
|
562
|
-
running: false
|
|
563
|
-
}));
|
|
564
|
-
case 74:
|
|
565
|
-
case "end":
|
|
566
|
-
return _context3.stop();
|
|
567
|
-
}
|
|
568
|
-
}, _callee3, this, [[12, 53], [22, 28], [57, 71]]);
|
|
569
|
-
}));
|
|
570
|
-
function checkLicense(_x2, _x3) {
|
|
571
|
-
return _checkLicense.apply(this, arguments);
|
|
572
|
-
}
|
|
573
|
-
return checkLicense;
|
|
574
|
-
}()
|
|
575
|
-
}, {
|
|
576
|
-
key: "renderAskForUpdate",
|
|
577
|
-
value: function renderAskForUpdate() {
|
|
578
|
-
var _this3 = this;
|
|
579
|
-
if (!this.state.askForUpdate) {
|
|
580
|
-
return null;
|
|
581
|
-
}
|
|
582
|
-
return /*#__PURE__*/_react["default"].createElement(_Confirm["default"], {
|
|
583
|
-
text: _i18n["default"].t('ra_License not found in license manager. Do you want to read licenses from iobroker.net?'),
|
|
584
|
-
ok: _i18n["default"].t('ra_Yes'),
|
|
585
|
-
onClose: ( /*#__PURE__*/function () {
|
|
586
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(isYes) {
|
|
587
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
588
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
589
|
-
case 0:
|
|
590
|
-
if (!isYes) {
|
|
591
|
-
_context4.next = 15;
|
|
592
|
-
break;
|
|
593
|
-
}
|
|
594
|
-
_this3.setState({
|
|
595
|
-
askForUpdate: false
|
|
596
|
-
});
|
|
597
|
-
_context4.prev = 2;
|
|
598
|
-
_context4.next = 5;
|
|
599
|
-
return ConfigCheckLicense.updateLicenses(_this3.props.socket);
|
|
600
|
-
case 5:
|
|
601
|
-
_context4.next = 11;
|
|
602
|
-
break;
|
|
603
|
-
case 7:
|
|
604
|
-
_context4.prev = 7;
|
|
605
|
-
_context4.t0 = _context4["catch"](2);
|
|
606
|
-
window.alert(_i18n["default"].t('ra_Cannot read licenses: %s', _context4.t0));
|
|
607
|
-
return _context4.abrupt("return");
|
|
608
|
-
case 11:
|
|
609
|
-
_context4.next = 13;
|
|
610
|
-
return _this3._onClick(true);
|
|
611
|
-
case 13:
|
|
612
|
-
_context4.next = 16;
|
|
613
|
-
break;
|
|
614
|
-
case 15:
|
|
615
|
-
_this3.setState({
|
|
616
|
-
askForUpdate: false,
|
|
617
|
-
running: false
|
|
618
|
-
});
|
|
619
|
-
case 16:
|
|
620
|
-
case "end":
|
|
621
|
-
return _context4.stop();
|
|
622
|
-
}
|
|
623
|
-
}, _callee4, null, [[2, 7]]);
|
|
624
|
-
}));
|
|
625
|
-
return function (_x4) {
|
|
626
|
-
return _ref.apply(this, arguments);
|
|
627
|
-
};
|
|
628
|
-
}())
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
}, {
|
|
632
|
-
key: "_onClick",
|
|
633
|
-
value: function () {
|
|
634
|
-
var _onClick2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(secondRun) {
|
|
635
|
-
var adapterName, license, licenses;
|
|
636
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
637
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
638
|
-
case 0:
|
|
639
|
-
adapterName = this.props.adapterName === 'vis-2' ? 'vis' : this.props.adapterName;
|
|
640
|
-
this.setState({
|
|
641
|
-
running: true
|
|
642
|
-
});
|
|
643
|
-
if (!this.props.data.useLicenseManager) {
|
|
644
|
-
_context5.next = 13;
|
|
645
|
-
break;
|
|
646
|
-
}
|
|
647
|
-
_context5.next = 5;
|
|
648
|
-
return this.findInLicenseManager(adapterName);
|
|
649
|
-
case 5:
|
|
650
|
-
licenses = _context5.sent;
|
|
651
|
-
license = licenses.find(function (li) {
|
|
652
|
-
return li.used;
|
|
653
|
-
});
|
|
654
|
-
if (license) {
|
|
655
|
-
license = license.license.json;
|
|
656
|
-
}
|
|
657
|
-
if (!(!license && !secondRun)) {
|
|
658
|
-
_context5.next = 11;
|
|
659
|
-
break;
|
|
660
|
-
}
|
|
661
|
-
// no suitable license found in the license manager
|
|
662
|
-
// should we read all licenses again?
|
|
663
|
-
this.setState({
|
|
664
|
-
askForUpdate: true
|
|
665
|
-
});
|
|
666
|
-
return _context5.abrupt("return");
|
|
667
|
-
case 11:
|
|
668
|
-
_context5.next = 14;
|
|
669
|
-
break;
|
|
670
|
-
case 13:
|
|
671
|
-
license = this.props.data.license;
|
|
672
|
-
case 14:
|
|
673
|
-
if (!license) {
|
|
674
|
-
_context5.next = 19;
|
|
675
|
-
break;
|
|
676
|
-
}
|
|
677
|
-
_context5.next = 17;
|
|
678
|
-
return this.checkLicense(license, adapterName, this.props.schema.uuid);
|
|
679
|
-
case 17:
|
|
680
|
-
_context5.next = 20;
|
|
681
|
-
break;
|
|
682
|
-
case 19:
|
|
683
|
-
if (this.props.data.useLicenseManager) {
|
|
684
|
-
this.setState({
|
|
685
|
-
_error: _i18n["default"].t('ra_Suitable license not found in license manager'),
|
|
686
|
-
result: false,
|
|
687
|
-
running: false,
|
|
688
|
-
allLicenses: licenses
|
|
689
|
-
});
|
|
690
|
-
} else {
|
|
691
|
-
// this case could not happen
|
|
692
|
-
this.setState({
|
|
693
|
-
_error: _i18n["default"].t('ra_Please enter the license'),
|
|
694
|
-
result: false,
|
|
695
|
-
running: false
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
case 20:
|
|
699
|
-
case "end":
|
|
700
|
-
return _context5.stop();
|
|
701
|
-
}
|
|
702
|
-
}, _callee5, this);
|
|
703
|
-
}));
|
|
704
|
-
function _onClick(_x5) {
|
|
705
|
-
return _onClick2.apply(this, arguments);
|
|
706
|
-
}
|
|
707
|
-
return _onClick;
|
|
708
|
-
}()
|
|
709
|
-
}, {
|
|
710
|
-
key: "renderItem",
|
|
711
|
-
value: function renderItem( /* error, disabled, defaultValue */
|
|
712
|
-
) {
|
|
713
|
-
var _this4 = this;
|
|
714
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
715
|
-
className: this.props.classes.fullWidth
|
|
716
|
-
}, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
717
|
-
variant: this.props.schema.variant || 'outlined',
|
|
718
|
-
color: this.props.schema.color || 'primary',
|
|
719
|
-
className: this.props.classes.fullWidth,
|
|
720
|
-
disabled: !this.props.data.license && !this.props.data.useLicenseManager || this.state.running,
|
|
721
|
-
startIcon: /*#__PURE__*/_react["default"].createElement(_iconsMaterial.Send, null),
|
|
722
|
-
onClick: function onClick() {
|
|
723
|
-
return _this4._onClick();
|
|
724
|
-
}
|
|
725
|
-
}, this.state.running ? /*#__PURE__*/_react["default"].createElement(_material.CircularProgress, {
|
|
726
|
-
size: 20,
|
|
727
|
-
style: {
|
|
728
|
-
marginRight: 8
|
|
729
|
-
}
|
|
730
|
-
}) : null, this.getText(this.props.schema.label || 'ra_Check license', this.props.schema.noTranslation)), this.renderMessageDialog(), this.renderErrorDialog(), this.renderAskForUpdate());
|
|
731
|
-
}
|
|
732
|
-
}], [{
|
|
733
|
-
key: "parseJwt",
|
|
734
|
-
value: function parseJwt(token) {
|
|
735
|
-
var base64Url = token.split('.')[1];
|
|
736
|
-
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
737
|
-
var jsonPayload = decodeURIComponent(atob(base64).split('').map(function (c) {
|
|
738
|
-
return "%".concat("00".concat(c.charCodeAt(0).toString(16)).slice(-2));
|
|
739
|
-
}).join(''));
|
|
740
|
-
try {
|
|
741
|
-
return JSON.parse(jsonPayload);
|
|
742
|
-
} catch (e) {
|
|
743
|
-
return null;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
}, {
|
|
747
|
-
key: "isVersionValid",
|
|
748
|
-
value: function isVersionValid(version, rule, invoice, adapterName) {
|
|
749
|
-
if (!rule || !version) {
|
|
750
|
-
return true;
|
|
751
|
-
}
|
|
752
|
-
var result = true;
|
|
753
|
-
var _version$split = version.split('.'),
|
|
754
|
-
_version$split2 = (0, _slicedToArray2["default"])(_version$split, 1),
|
|
755
|
-
major = _version$split2[0];
|
|
756
|
-
if (rule.startsWith('>=')) {
|
|
757
|
-
result = parseInt(major, 10) >= parseInt(rule.substring(2, 10));
|
|
758
|
-
} else if (rule.startsWith('<=')) {
|
|
759
|
-
result = parseInt(major, 10) <= parseInt(rule.substring(2, 10));
|
|
760
|
-
} else if (rule.startsWith('>')) {
|
|
761
|
-
result = parseInt(major, 10) > parseInt(rule.substring(1, 10));
|
|
762
|
-
} else if (rule.startsWith('<')) {
|
|
763
|
-
result = parseInt(major, 10) < parseInt(rule.substring(1, 10));
|
|
764
|
-
} else if (rule.startsWith('=')) {
|
|
765
|
-
result = parseInt(major, 10) === parseInt(rule.substring(1, 10));
|
|
766
|
-
} else if (rule.startsWith('==')) {
|
|
767
|
-
result = parseInt(major, 10) === parseInt(rule.substring(2, 10));
|
|
768
|
-
} else if (rule.startsWith('===')) {
|
|
769
|
-
result = parseInt(major, 10) === parseInt(rule.substring(3, 10));
|
|
770
|
-
}
|
|
771
|
-
if (!result && invoice && adapterName) {
|
|
772
|
-
// all commercial licenses are valid for all versions
|
|
773
|
-
if (invoice !== 'free') {
|
|
774
|
-
return true;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
return true;
|
|
778
|
-
}
|
|
779
|
-
}, {
|
|
780
|
-
key: "updateLicenses",
|
|
781
|
-
value: function updateLicenses(socket) {
|
|
782
|
-
return new Promise(function (resolve, reject) {
|
|
783
|
-
socket.getRawSocket().emit('updateLicenses', null, null, function (err, licenses) {
|
|
784
|
-
if (err === 'permissionError') {
|
|
785
|
-
reject(_i18n["default"].t('ra_May not trigger "updateLicenses"'));
|
|
786
|
-
} else if (err && err.error) {
|
|
787
|
-
if (typeof err.error === 'string') {
|
|
788
|
-
reject(_i18n["default"].t(err.error));
|
|
789
|
-
} else {
|
|
790
|
-
reject(JSON.stringify(err.error));
|
|
791
|
-
}
|
|
792
|
-
} else if (err) {
|
|
793
|
-
if (typeof err === 'string') {
|
|
794
|
-
reject(_i18n["default"].t(err));
|
|
795
|
-
} else {
|
|
796
|
-
reject(JSON.stringify(err));
|
|
797
|
-
}
|
|
798
|
-
} else {
|
|
799
|
-
resolve(licenses);
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
}]);
|
|
805
|
-
return ConfigCheckLicense;
|
|
806
|
-
}(_ConfigGeneric2["default"]);
|
|
807
|
-
ConfigCheckLicense.propTypes = {
|
|
808
|
-
socket: _propTypes["default"].object.isRequired,
|
|
809
|
-
themeType: _propTypes["default"].string,
|
|
810
|
-
themeName: _propTypes["default"].string,
|
|
811
|
-
style: _propTypes["default"].object,
|
|
812
|
-
className: _propTypes["default"].string,
|
|
813
|
-
data: _propTypes["default"].object.isRequired,
|
|
814
|
-
schema: _propTypes["default"].object,
|
|
815
|
-
onError: _propTypes["default"].func,
|
|
816
|
-
onChange: _propTypes["default"].func,
|
|
817
|
-
adapterName: _propTypes["default"].string,
|
|
818
|
-
instance: _propTypes["default"].number
|
|
819
|
-
};
|
|
820
|
-
var _default = exports["default"] = (0, _styles.withStyles)(styles)(ConfigCheckLicense);
|
|
821
|
-
//# sourceMappingURL=ConfigCheckLicense.js.map
|