@iobroker/adapter-react-v5 4.13.0 → 4.13.2
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/404.js.map +1 -0
- package/Components/ColorPicker.js +54 -54
- package/Components/ColorPicker.js.map +1 -1
- package/Components/ComplexCron.js.map +1 -1
- package/Components/CustomModal.js.map +1 -0
- package/Components/FileBrowser.js +5 -1
- package/Components/FileBrowser.js.map +1 -0
- package/Components/FileViewer.js.map +1 -0
- package/Components/Icon.js.map +1 -0
- package/Components/IconPicker.js.map +1 -0
- package/Components/IconSelector.js.map +1 -0
- package/Components/Image.js.map +1 -0
- package/Components/JsonConfigComponent/ChipInput.d.ts +12 -0
- package/Components/JsonConfigComponent/ChipInput.js +763 -0
- package/Components/JsonConfigComponent/ChipInput.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigAccordion.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigAccordion.js +348 -0
- package/Components/JsonConfigComponent/ConfigAccordion.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigAlive.d.ts +10 -0
- package/Components/JsonConfigComponent/ConfigAlive.js +105 -0
- package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigAutocomplete.d.ts +37 -0
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +73 -0
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +131 -0
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCRON.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigCRON.js +157 -0
- package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCertCollection.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCertCollection.js +128 -0
- package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCertificateSelect.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +149 -0
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCertificates.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCertificates.js +284 -0
- package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCheckLicense.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigCheckLicense.js +821 -0
- package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCheckbox.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigCheckbox.js +40 -0
- package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigChip.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigChip.js +120 -0
- package/Components/JsonConfigComponent/ConfigChip.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigColor.d.ts +22 -0
- package/Components/JsonConfigComponent/ConfigColor.js +120 -0
- package/Components/JsonConfigComponent/ConfigColor.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCoordinates.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigCoordinates.js +265 -0
- package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigCustom.d.ts +26 -0
- package/Components/JsonConfigComponent/ConfigCustom.js +316 -0
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigDatePicker.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigDatePicker.js +91 -0
- package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigDeviceManager.d.ts +6 -0
- package/Components/JsonConfigComponent/ConfigDeviceManager.js +18 -0
- package/Components/JsonConfigComponent/ConfigFile.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigFile.js +228 -0
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js +625 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigFunc.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigFunc.js +124 -0
- package/Components/JsonConfigComponent/ConfigFunc.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigGeneric.d.ts +95 -0
- package/Components/JsonConfigComponent/ConfigGeneric.js +646 -0
- package/Components/JsonConfigComponent/ConfigIP.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigIP.js +130 -0
- package/Components/JsonConfigComponent/ConfigIP.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigImageSendTo.d.ts +10 -0
- package/Components/JsonConfigComponent/ConfigImageSendTo.js +114 -0
- package/Components/JsonConfigComponent/ConfigImageSendTo.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigImageUpload.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigImageUpload.js +166 -0
- package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigInstanceSelect.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +264 -0
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigInterface.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigInterface.js +146 -0
- package/Components/JsonConfigComponent/ConfigInterface.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigJsonEditor.d.ts +13 -0
- package/Components/JsonConfigComponent/ConfigJsonEditor.js +145 -0
- package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigLanguage.d.ts +7 -0
- package/Components/JsonConfigComponent/ConfigLanguage.js +110 -0
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigLicense.d.ts +24 -0
- package/Components/JsonConfigComponent/ConfigLicense.js +183 -0
- package/Components/JsonConfigComponent/ConfigLicense.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigNumber.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigNumber.js +117 -0
- package/Components/JsonConfigComponent/ConfigObjectId.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigObjectId.js +167 -0
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigPanel.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigPanel.js +396 -0
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigPassword.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigPassword.js +193 -0
- package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigPattern.d.ts +21 -0
- package/Components/JsonConfigComponent/ConfigPattern.js +65 -0
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigPort.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigPort.js +176 -0
- package/Components/JsonConfigComponent/ConfigRoom.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigRoom.js +124 -0
- package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigSelect.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigSelect.js +159 -0
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigSelectSendTo.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js +272 -0
- package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigSendto.d.ts +24 -0
- package/Components/JsonConfigComponent/ConfigSendto.js +294 -0
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigSetState.d.ts +18 -0
- package/Components/JsonConfigComponent/ConfigSetState.js +185 -0
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigSlider.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigSlider.js +119 -0
- package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigStaticDivider.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticDivider.js +68 -0
- package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigStaticHeader.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +81 -0
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigStaticImage.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticImage.js +71 -0
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigStaticText.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigStaticText.js +88 -0
- package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigTable.d.ts +3 -0
- package/Components/JsonConfigComponent/ConfigTable.js +1064 -0
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigTabs.d.ts +34 -0
- package/Components/JsonConfigComponent/ConfigTabs.js +162 -0
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigText.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigText.js +226 -0
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigTextSendTo.d.ts +10 -0
- package/Components/JsonConfigComponent/ConfigTextSendTo.js +129 -0
- package/Components/JsonConfigComponent/ConfigTextSendTo.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigTimePicker.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigTimePicker.js +85 -0
- package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigTopic.d.ts +17 -0
- package/Components/JsonConfigComponent/ConfigTopic.js +110 -0
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigUUID.d.ts +15 -0
- package/Components/JsonConfigComponent/ConfigUUID.js +95 -0
- package/Components/JsonConfigComponent/ConfigUUID.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigUser.d.ts +14 -0
- package/Components/JsonConfigComponent/ConfigUser.js +142 -0
- package/Components/JsonConfigComponent/ConfigUser.js.map +1 -0
- package/Components/JsonConfigComponent/DeviceManager/Communication.d.ts +63 -0
- package/Components/JsonConfigComponent/DeviceManager/Communication.js +268 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.d.ts +11 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceActionButton.js +15 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.d.ts +53 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceCard.js +340 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.d.ts +45 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceControl.js +146 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.d.ts +12 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceImageUpload.js +69 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.d.ts +51 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceList.js +226 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.d.ts +13 -0
- package/Components/JsonConfigComponent/DeviceManager/DeviceStatus.js +111 -0
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.d.ts +7 -0
- package/Components/JsonConfigComponent/DeviceManager/InstanceActionButton.js +16 -0
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.d.ts +11 -0
- package/Components/JsonConfigComponent/DeviceManager/JsonConfig.js +94 -0
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.d.ts +10 -0
- package/Components/JsonConfigComponent/DeviceManager/TooltipButton.js +22 -0
- package/Components/JsonConfigComponent/DeviceManager/Utils.d.ts +12 -0
- package/Components/JsonConfigComponent/DeviceManager/Utils.js +158 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/de.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/en.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/es.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/fr.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/i18n.d.ts +26 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/it.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/nl.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/pl.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/pt.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/ru.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/uk.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/i18n/zh-cn.json +21 -0
- package/Components/JsonConfigComponent/DeviceManager/index.d.ts +2 -0
- package/Components/JsonConfigComponent/DeviceManager/index.js +10 -0
- package/Components/JsonConfigComponent/DeviceManager/index.js.map +1 -0
- package/Components/JsonConfigComponent/Utils.d.ts +9 -0
- package/Components/JsonConfigComponent/Utils.js +13 -0
- package/Components/JsonConfigComponent/index.d.ts +26 -0
- package/Components/JsonConfigComponent/index.js +520 -0
- package/Components/JsonConfigComponent/index.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/AdminConnection.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/AdminConnection.js +7 -0
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Components/ColorPicker.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Components/Icon.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Components/Icon.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Components/TextWithIcon.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Components/UploadImage.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Components/Utils.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Components/Utils.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Confirm.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Cron.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Error.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/Message.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectFile.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js +10 -0
- package/Components/JsonConfigComponent/wrapper/Dialogs/SelectID.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/i18n.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/i18n.js +10 -0
- package/Components/JsonConfigComponent/wrapper/i18n.js.map +1 -0
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.d.ts +2 -0
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js +10 -0
- package/Components/JsonConfigComponent/wrapper/icons/IconCopy.js.map +1 -0
- package/Components/Loader.js +223 -223
- package/Components/Loader.js.map +1 -0
- package/Components/Loaders/PT.css +108 -108
- package/Components/Loaders/PT.js +103 -103
- package/Components/Loaders/PT.js.map +1 -0
- package/Components/Loaders/Vendor.css +13 -13
- package/Components/Loaders/Vendor.js +7 -7
- package/Components/Loaders/Vendor.js.map +1 -0
- package/Components/Logo.js.map +1 -0
- package/Components/MDUtils.js.map +1 -0
- package/Components/ObjectBrowser.js +344 -344
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/Router.js.map +1 -0
- package/Components/SaveCloseButtons.js.map +1 -0
- package/Components/Schedule.js.map +1 -0
- package/Components/SelectWithIcon.js.map +1 -0
- package/Components/SimpleCron/cron2text.js.map +1 -0
- package/Components/SimpleCron/cronText.js.map +1 -0
- package/Components/SimpleCron/index.js.map +1 -0
- package/Components/SimpleCron/jquery.cron.locale.js.map +1 -0
- package/Components/TabContainer.js.map +1 -0
- package/Components/TabContent.js.map +1 -0
- package/Components/TabHeader.js.map +1 -0
- package/Components/TableResize.js +5 -5
- package/Components/TableResize.js.map +1 -1
- package/Components/TextWithIcon.js.map +1 -0
- package/Components/ToggleThemeMenu.js.map +1 -0
- package/Components/TreeTable.js +70 -70
- package/Components/TreeTable.js.map +1 -1
- package/Components/UploadImage.js +305 -305
- package/Components/UploadImage.js.map +1 -0
- package/Components/Utils.js.map +1 -0
- package/Components/copy-to-clipboard.d.ts +13 -0
- package/Components/copy-to-clipboard.js +156 -0
- package/Components/copy-to-clipboard.js.map +1 -0
- package/Components/loader.css +221 -221
- package/Components/types.d.ts +82 -82
- package/Components/withWidth.js.map +1 -1
- package/Connection.js.map +1 -1
- package/Dialogs/ComplexCron.js.map +1 -0
- package/Dialogs/Confirm.js.map +1 -0
- package/Dialogs/Cron.js.map +1 -0
- package/Dialogs/Error.js.map +1 -0
- package/Dialogs/Message.js.map +1 -0
- package/Dialogs/SelectFile.js.map +1 -0
- package/Dialogs/SelectID.js.map +1 -0
- package/Dialogs/SimpleCron.js.map +1 -0
- package/Dialogs/TextInput.js.map +1 -0
- package/GenericApp.d.ts +2 -2
- package/GenericApp.js +49 -49
- package/GenericApp.js.map +1 -0
- package/LICENSE +22 -22
- package/LegacyConnection.d.ts +1 -1
- package/LegacyConnection.js +1 -0
- package/LegacyConnection.js.map +1 -0
- package/Prompt.js +7 -7
- package/Prompt.js.map +1 -0
- package/README.md +1101 -1101
- package/Theme.js.map +1 -0
- 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/i18n.js.map +1 -0
- 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/IconExpert.js.map +1 -0
- 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 +2 -2
- package/types.d.ts +94 -94
package/README.md
CHANGED
|
@@ -1,1101 +1,1101 @@
|
|
|
1
|
-
# Help ReactJS classes for adapter config
|
|
2
|
-
You can find demo on https://github.com/ioBroker/adapter-react-demo
|
|
3
|
-
|
|
4
|
-
## Getting started
|
|
5
|
-
If you want to create the configuration page with ReactJS:
|
|
6
|
-
1. Create github repo for adapter.
|
|
7
|
-
2. execute `npx create-react-app src` . It will take a while.
|
|
8
|
-
3. `cd src`
|
|
9
|
-
4. Modify package.json file in src directory:
|
|
10
|
-
- Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
|
|
11
|
-
- Add to devDependencies:
|
|
12
|
-
```
|
|
13
|
-
"@iobroker/adapter-react": "^4.0.10",
|
|
14
|
-
```
|
|
15
|
-
Versions can be higher.
|
|
16
|
-
So your src/package.json should look like:
|
|
17
|
-
```
|
|
18
|
-
{
|
|
19
|
-
"name": "ADAPTERNAME-admin",
|
|
20
|
-
"version": "0.1.0",
|
|
21
|
-
"private": true,
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"react": "^18.2.0",
|
|
24
|
-
"react-dom": "^18.2.0",
|
|
25
|
-
"react-icons": "^4.6.0",
|
|
26
|
-
"react-scripts": "^5.0.1",
|
|
27
|
-
"@iobroker/adapter-react-v5": "^3.2.7",
|
|
28
|
-
"del": "^6.1.1",
|
|
29
|
-
"gulp": "^4.0.2"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"start": "react-scripts start",
|
|
33
|
-
"build": "react-scripts build",
|
|
34
|
-
"test": "react-scripts test",
|
|
35
|
-
"eject": "react-scripts eject"
|
|
36
|
-
},
|
|
37
|
-
"eslintConfig": {
|
|
38
|
-
"extends": "react-app"
|
|
39
|
-
},
|
|
40
|
-
"homepage": ".",
|
|
41
|
-
"browserslist": [
|
|
42
|
-
">0.2%",
|
|
43
|
-
"not dead",
|
|
44
|
-
"not ie <= 11",
|
|
45
|
-
"not op_mini all"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
5. Call in `src`: `npm install`
|
|
50
|
-
6. Copy gulpfile.js into `src`: `cp node_modules/@iobroker/adapter-react/gulpfile.js gulpfile.js`
|
|
51
|
-
7. Start your dummy application `npm run start` for developing or build with `npm run build` and
|
|
52
|
-
copy files in `build` directory to `www` or to `admin`. In the admin you must rename `index.html` to `index_m.html`.
|
|
53
|
-
8. You can do that with `gulp` tasks: `gulp build`, `gulp copy`, `gulp renameIndex` or `gulp renameTab`
|
|
54
|
-
|
|
55
|
-
## Development
|
|
56
|
-
1. Add `socket.io` to `public/index.html`.
|
|
57
|
-
After
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
insert
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
<script>
|
|
67
|
-
var script = document.createElement('script');
|
|
68
|
-
window.registerSocketOnLoad = function (cb) {
|
|
69
|
-
window.socketLoadedHandler = cb;
|
|
70
|
-
};
|
|
71
|
-
const parts = (window.location.search || '').replace(/^\?/, '').split('&');
|
|
72
|
-
const query = {};
|
|
73
|
-
parts.forEach(item => {
|
|
74
|
-
const [name, val] = item.split('=');
|
|
75
|
-
query[decodeURIComponent(name)] = val !== undefined ? decodeURIComponent(val) : true;
|
|
76
|
-
});
|
|
77
|
-
script.onload = function () { typeof window.socketLoadedHandler === 'function' && window.socketLoadedHandler(); };
|
|
78
|
-
script.src = window.location.port === '3000' ? window.location.protocol + '//' + (query.host || window.location.hostname) + ':' + (query.port || 8081) + '/lib/js/socket.io.js' : '%PUBLIC_URL%/../../lib/js/socket.io.js';
|
|
79
|
-
|
|
80
|
-
document.head.appendChild(script);
|
|
81
|
-
</script>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
3. Add to App.js constructor initialization for I18n:
|
|
85
|
-
```
|
|
86
|
-
class App extends GenericApp {
|
|
87
|
-
constructor(props) {
|
|
88
|
-
const extendedProps = {...props};
|
|
89
|
-
extendedProps.encryptedFields = ['pass']; // this parameter will be encrypted and decrypted automatically
|
|
90
|
-
extendedProps.translations = {
|
|
91
|
-
'en': require('./i18n/en'),
|
|
92
|
-
'de': require('./i18n/de'),
|
|
93
|
-
'ru': require('./i18n/ru'),
|
|
94
|
-
'pt': require('./i18n/pt'),
|
|
95
|
-
'nl': require('./i18n/nl'),
|
|
96
|
-
'fr': require('./i18n/fr'),
|
|
97
|
-
'it': require('./i18n/it'),
|
|
98
|
-
'es': require('./i18n/es'),
|
|
99
|
-
'pl': require('./i18n/pl'),
|
|
100
|
-
'uk': require('./i18n/uk'),
|
|
101
|
-
'zh-cn': require('./i18n/zh-cn'),
|
|
102
|
-
};
|
|
103
|
-
// get actual admin port
|
|
104
|
-
extendedProps.socket = {port: parseInt(window.location.port, 10)};
|
|
105
|
-
|
|
106
|
-
// Only if close, save buttons are not required at the bottom (e.g. if admin tab)
|
|
107
|
-
// extendedProps.bottomButtons = false;
|
|
108
|
-
|
|
109
|
-
// only for debug purposes
|
|
110
|
-
if (extendedProps.socket.port === 3000) {
|
|
111
|
-
extendedProps.socket.port = 8081;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// allow to manage GenericApp the sentry initialisation or do not set the sentryDSN if no sentry available
|
|
115
|
-
extendedProps.sentryDSN = 'https://yyy@sentry.iobroker.net/xx';
|
|
116
|
-
|
|
117
|
-
super(extendedProps);
|
|
118
|
-
}
|
|
119
|
-
...
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
4. Replace `index.js` with the following code to support themes:
|
|
124
|
-
```
|
|
125
|
-
import React from 'react';
|
|
126
|
-
import ReactDOM from 'react-dom';
|
|
127
|
-
import { MuiThemeProvider} from '@material-ui/core/styles';
|
|
128
|
-
import * as serviceWorker from './serviceWorker';
|
|
129
|
-
|
|
130
|
-
import './index.css';
|
|
131
|
-
import App from './App';
|
|
132
|
-
import { version } from '../package.json';
|
|
133
|
-
|
|
134
|
-
import theme from '@iobroker/adapter-react/Theme';
|
|
135
|
-
|
|
136
|
-
console.log('iobroker.scenes@' + version);
|
|
137
|
-
let themeName = window.localStorage ? window.localStorage.getItem('App.theme') || 'light' : 'light';
|
|
138
|
-
|
|
139
|
-
function build() {
|
|
140
|
-
return ReactDOM.render(<MuiThemeProvider theme={ theme(themeName) }>
|
|
141
|
-
<App onThemeChange={_theme => {
|
|
142
|
-
themeName = _theme;
|
|
143
|
-
build();
|
|
144
|
-
}}/>
|
|
145
|
-
</MuiThemeProvider>, document.getElementById('root'));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
build();
|
|
149
|
-
|
|
150
|
-
// If you want your app to work offline and load faster, you can change
|
|
151
|
-
// unregister() to register() below. Note this comes with some pitfalls.
|
|
152
|
-
// Learn more about service workers: http://bit.ly/CRA-PWA
|
|
153
|
-
serviceWorker.unregister();
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
5. Add to App.js encoding and decoding of values:
|
|
157
|
-
```
|
|
158
|
-
class App extend GenericApp {
|
|
159
|
-
...
|
|
160
|
-
onPrepareLoad(settings) {
|
|
161
|
-
settings.pass = this.decode(settings.pass);
|
|
162
|
-
}
|
|
163
|
-
onPrepareSave(settings) {
|
|
164
|
-
settings.pass = this.encode(settings.pass);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
6. The optional step is to validate the data to be saved:
|
|
170
|
-
```
|
|
171
|
-
onPrepareSave(settings) {
|
|
172
|
-
super.onPrepareSave(settings);
|
|
173
|
-
if (DATA_INVALID) {
|
|
174
|
-
return false; // configuration will not be saved
|
|
175
|
-
} else {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Components
|
|
182
|
-
|
|
183
|
-
### Connection.js
|
|
184
|
-
This is a non-react class to provide the communication for socket connection with the server.
|
|
185
|
-
|
|
186
|
-
### GenericApp.tsx
|
|
187
|
-
|
|
188
|
-
### i18n.ts
|
|
189
|
-
|
|
190
|
-
### Theme.tsx
|
|
191
|
-
|
|
192
|
-
### Dialogs
|
|
193
|
-
Some dialogs are predefined and could be used out of the box.
|
|
194
|
-
|
|
195
|
-
#### Confirm.tsx
|
|
196
|
-
<!-- TODO: Provide screenshot here -->
|
|
197
|
-
|
|
198
|
-
Usage:
|
|
199
|
-
```
|
|
200
|
-
import React from 'react';
|
|
201
|
-
import ConfirmDialog from '@iobroker/adapter-react/Dialogs/Confirm'
|
|
202
|
-
import I18n from '@iobroker/adapter-react/i18n';
|
|
203
|
-
|
|
204
|
-
class ExportImportDialog extends React.Component {
|
|
205
|
-
constructor(props) {
|
|
206
|
-
super(props);
|
|
207
|
-
|
|
208
|
-
this.state = {
|
|
209
|
-
confirmDialog: false,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
renderConfirmDialog() {
|
|
214
|
-
if (!this.state.confirmDialog) {
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
return <ConfirmDialog
|
|
218
|
-
title={ I18n.t('Scene will be overwritten.') }
|
|
219
|
-
text={ I18n.t('All data will be lost. Confirm?') }
|
|
220
|
-
ok={ I18n.t('Yes') }
|
|
221
|
-
cancel={ I18n.t('Cancel') }
|
|
222
|
-
suppressQuestionMinutes={5}
|
|
223
|
-
dialogName="myConfirmDialogThatCouldBeSuppressed"
|
|
224
|
-
suppressText={I18n.t('Suppress question for next %s minutes', 5)}
|
|
225
|
-
onClose={isYes => {
|
|
226
|
-
this.setState({ confirmDialog: false} );
|
|
227
|
-
}}
|
|
228
|
-
/>;
|
|
229
|
-
}
|
|
230
|
-
render() {
|
|
231
|
-
return <div>
|
|
232
|
-
<Button onClick={ () => this.setState({confirmDialog: true}) }>Click</Button>
|
|
233
|
-
{ this.renderConfirmDialog() }
|
|
234
|
-
</div>
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export default ExportImportDialog;
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
#### Error.tsx
|
|
242
|
-
<!-- TODO: Provide screenshot here -->
|
|
243
|
-
|
|
244
|
-
#### Message.tsx
|
|
245
|
-
<!-- TODO: Provide screenshot here -->
|
|
246
|
-
```
|
|
247
|
-
renderMessage() {
|
|
248
|
-
if (this.state.showMessage) {
|
|
249
|
-
return <Message
|
|
250
|
-
text={this.state.showMessage}
|
|
251
|
-
onClose={() => this.setState({showMessage: false})}
|
|
252
|
-
/>;
|
|
253
|
-
} else {
|
|
254
|
-
return null;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
#### SelectID.tsx
|
|
260
|
-

|
|
261
|
-
```
|
|
262
|
-
import DialogSelectID from '@iobroker/adapter-react/Dialogs/SelectID';
|
|
263
|
-
|
|
264
|
-
class MyComponent extends Component {
|
|
265
|
-
constructor(props) {
|
|
266
|
-
super(props);
|
|
267
|
-
this.state = {
|
|
268
|
-
showSelectId: false,
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
renderSelectIdDialog() {
|
|
273
|
-
if (this.state.showSelectId) {
|
|
274
|
-
return <DialogSelectID
|
|
275
|
-
key="tableSelect"
|
|
276
|
-
imagePrefix="../.."
|
|
277
|
-
dialogName={this.props.adapterName}
|
|
278
|
-
themeType={this.props.themeType}
|
|
279
|
-
socket={this.props.socket}
|
|
280
|
-
statesOnly={true}
|
|
281
|
-
selected={this.state.selectIdValue}
|
|
282
|
-
onClose={() => this.setState({showSelectId: false})}
|
|
283
|
-
onOk={(selected, name) => {
|
|
284
|
-
this.setState({showSelectId: false, selectIdValue: selected});
|
|
285
|
-
}}
|
|
286
|
-
/>;
|
|
287
|
-
} else {
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
render() {
|
|
292
|
-
return renderSelectIdDialog();
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
#### Cron
|
|
298
|
-
Include `"react-text-mask": "^5.4.3",` in package.json.
|
|
299
|
-
|
|
300
|
-
<!-- TODO: Provide screenshot here -->
|
|
301
|
-
|
|
302
|
-
```
|
|
303
|
-
function renderCron() {
|
|
304
|
-
if (!showCron) {
|
|
305
|
-
return null;
|
|
306
|
-
} else {
|
|
307
|
-
return <DialogCron
|
|
308
|
-
key="dialogCron1"
|
|
309
|
-
cron={this.state.cronValue || '* * * * *'}
|
|
310
|
-
onClose={() => this.setState({ showCron: false })}
|
|
311
|
-
onOk={cronValue => {
|
|
312
|
-
this.setState({ cronValue })
|
|
313
|
-
}}
|
|
314
|
-
/>;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
### Components
|
|
320
|
-
|
|
321
|
-
#### Utils.tsx
|
|
322
|
-
##### getObjectNameFromObj
|
|
323
|
-
`getObjectNameFromObj(obj, settings, options, isDesc)`
|
|
324
|
-
|
|
325
|
-
Get object name from a single object.
|
|
326
|
-
|
|
327
|
-
Usage: `Utils.getObjectNameFromObj(this.objects[id], null, {language: I18n.getLanguage()})`
|
|
328
|
-
|
|
329
|
-
##### getObjectIcon
|
|
330
|
-
`getObjectIcon(id, obj)`
|
|
331
|
-
|
|
332
|
-
Get icon from the object.
|
|
333
|
-
|
|
334
|
-
Usage:
|
|
335
|
-
```
|
|
336
|
-
const icon = Utils.getObjectIcon(id, this.objects[id]);
|
|
337
|
-
return (<img src={icon}/>);
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
##### isUseBright
|
|
341
|
-
`isUseBright(color, defaultValue)`
|
|
342
|
-
|
|
343
|
-
Usage: `
|
|
344
|
-
|
|
345
|
-
#### Loader.tsx
|
|
346
|
-

|
|
347
|
-
|
|
348
|
-
```
|
|
349
|
-
render() {
|
|
350
|
-
if (!this.state.loaded) {
|
|
351
|
-
return <MuiThemeProvider theme={this.state.theme}>
|
|
352
|
-
<Loader theme={this.state.themeType}/>
|
|
353
|
-
</MuiThemeProvider>;
|
|
354
|
-
}
|
|
355
|
-
// render loaded data
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
#### Logo.tsx
|
|
361
|
-

|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
render() {
|
|
365
|
-
return <form className={this.props.classes.tab}>
|
|
366
|
-
<Logo
|
|
367
|
-
instance={this.props.instance}
|
|
368
|
-
common={this.props.common}
|
|
369
|
-
native={this.props.native}
|
|
370
|
-
onError={text => this.setState({errorText: text})}
|
|
371
|
-
onLoad={this.props.onLoad}
|
|
372
|
-
/>
|
|
373
|
-
...
|
|
374
|
-
</form>;
|
|
375
|
-
}
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
#### Router.tsx
|
|
379
|
-
|
|
380
|
-
#### ObjectBrowser.js
|
|
381
|
-
It is better to use `Dialog/SelectID`, but if you want:
|
|
382
|
-
|
|
383
|
-

|
|
384
|
-
|
|
385
|
-
```
|
|
386
|
-
<ObjectBrowser
|
|
387
|
-
foldersFirst={this.props.foldersFirst}
|
|
388
|
-
imagePrefix={this.props.imagePrefix || this.props.prefix} // prefix is for back compatibility
|
|
389
|
-
defaultFilters={this.filters}
|
|
390
|
-
dialogName={this.dialogName}
|
|
391
|
-
showExpertButton={this.props.showExpertButton !== undefined ? this.props.showExpertButton : true}
|
|
392
|
-
style={{ width: '100%', height: '100%' }}
|
|
393
|
-
columns={this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val']}
|
|
394
|
-
types={this.props.types || ['state']}
|
|
395
|
-
t={I18n.t}
|
|
396
|
-
lang={this.props.lang || I18n.getLanguage()}
|
|
397
|
-
socket={this.props.socket}
|
|
398
|
-
selected={this.state.selected}
|
|
399
|
-
multiSelect={this.props.multiSelect}
|
|
400
|
-
notEditable={this.props.notEditable === undefined ? true : this.props.notEditable}
|
|
401
|
-
name={this.state.name}
|
|
402
|
-
themeName={this.props.themeName}
|
|
403
|
-
themeType={this.props.themeType}
|
|
404
|
-
customFilter={this.props.customFilter}
|
|
405
|
-
onFilterChanged={filterConfig => {
|
|
406
|
-
this.filters = filterConfig;
|
|
407
|
-
window.localStorage.setItem(this.dialogName, JSON.stringify(filterConfig));
|
|
408
|
-
}}
|
|
409
|
-
onSelect={(selected, name, isDouble) => {
|
|
410
|
-
if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
|
|
411
|
-
this.setState({selected, name}, () =>
|
|
412
|
-
isDouble && this.handleOk());
|
|
413
|
-
} else if (isDouble) {
|
|
414
|
-
this.handleOk();
|
|
415
|
-
}
|
|
416
|
-
}}
|
|
417
|
-
/>
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
#### TreeTable.js
|
|
421
|
-

|
|
422
|
-
|
|
423
|
-
```
|
|
424
|
-
// STYLES
|
|
425
|
-
const styles = theme => ({
|
|
426
|
-
tableDiv: {
|
|
427
|
-
width: '100%',
|
|
428
|
-
overflow: 'hidden',
|
|
429
|
-
height: 'calc(100% - 48px)',
|
|
430
|
-
},
|
|
431
|
-
});
|
|
432
|
-
class MyComponent extends Component {
|
|
433
|
-
constructor(props) {
|
|
434
|
-
super(props);
|
|
435
|
-
|
|
436
|
-
this.state = {
|
|
437
|
-
data: [
|
|
438
|
-
{
|
|
439
|
-
id: 'UniqueID1' // required
|
|
440
|
-
fieldIdInData: 'Name1',
|
|
441
|
-
myType: 'number',
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
id: 'UniqueID2' // required
|
|
445
|
-
fieldIdInData: 'Name12',
|
|
446
|
-
myType: 'string',
|
|
447
|
-
},
|
|
448
|
-
],
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
this.columns = [
|
|
452
|
-
{
|
|
453
|
-
title: 'Name of field', // required, else it will be "field"
|
|
454
|
-
field: 'fieldIdInData', // required
|
|
455
|
-
editable: false, // or true [default - true]
|
|
456
|
-
cellStyle: { // CSS style - // optional
|
|
457
|
-
maxWidth: '12rem',
|
|
458
|
-
overflow: 'hidden',
|
|
459
|
-
wordBreak: 'break-word',
|
|
460
|
-
},
|
|
461
|
-
lookup: { // optional => edit will be automatically "SELECT"
|
|
462
|
-
'value1': 'text1',
|
|
463
|
-
'value2': 'text2',
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
title: 'Type', // required, else it will be "field"
|
|
468
|
-
field: 'myType', // required
|
|
469
|
-
editable: true, // or true [default - true]
|
|
470
|
-
lookup: { // optional => edit will be automatically "SELECT"
|
|
471
|
-
'number': 'Number',
|
|
472
|
-
'string': 'String',
|
|
473
|
-
'boolean': 'Boolean',
|
|
474
|
-
},
|
|
475
|
-
type: 'number/string/color/oid/icon/boolean', // oid=ObjectID,icon=base64-icon
|
|
476
|
-
editComponent: props =>
|
|
477
|
-
<div>Prefix{ <br/>
|
|
478
|
-
<textarea
|
|
479
|
-
rows={4}
|
|
480
|
-
style={{width: '100%', resize: 'vertical'}}
|
|
481
|
-
value={props.value}
|
|
482
|
-
onChange={e => props.onChange(e.target.value)}
|
|
483
|
-
/>
|
|
484
|
-
Suffix
|
|
485
|
-
</div>,
|
|
486
|
-
},
|
|
487
|
-
];
|
|
488
|
-
}
|
|
489
|
-
// renderTable
|
|
490
|
-
render() {
|
|
491
|
-
return <div className={this.props.classes.tableDiv}>
|
|
492
|
-
<TreeTable
|
|
493
|
-
columns={this.columns}
|
|
494
|
-
data={this.state.data}
|
|
495
|
-
onUpdate={(newData, oldData) => {
|
|
496
|
-
const data = JSON.parse(JSON.stringify(this.state.data));
|
|
497
|
-
|
|
498
|
-
// Added new line
|
|
499
|
-
if (newData === true) {
|
|
500
|
-
// find unique ID
|
|
501
|
-
let i = 1;
|
|
502
|
-
let id = 'line_' + i;
|
|
503
|
-
|
|
504
|
-
// eslint-disable-next-line
|
|
505
|
-
while(this.state.data.find(item => item.id === id)) {
|
|
506
|
-
i++;
|
|
507
|
-
id = 'line_' + i;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
data.push({
|
|
511
|
-
id,
|
|
512
|
-
name: I18n.t('New resource') + '_' + i,
|
|
513
|
-
color: '',
|
|
514
|
-
icon: '',
|
|
515
|
-
unit: '',
|
|
516
|
-
price: 0,
|
|
517
|
-
});
|
|
518
|
-
} else {
|
|
519
|
-
// existing line was modifed
|
|
520
|
-
const pos = this.state.data.indexOf(oldData);
|
|
521
|
-
if (pos !== -1) {
|
|
522
|
-
Object.keys(newData).forEach(attr => data[pos][attr] = newData[attr]);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
this.setState({data});
|
|
527
|
-
}}
|
|
528
|
-
onDelete={oldData => {
|
|
529
|
-
console.log('Delete: ' + JSON.stringify(oldData));
|
|
530
|
-
const pos = this.state.data.indexOf(oldData);
|
|
531
|
-
if (pos !== -1) {
|
|
532
|
-
const data = JSON.parse(JSON.stringify(this.state.data));
|
|
533
|
-
data.splice(pos, 1);
|
|
534
|
-
this.setState({data});
|
|
535
|
-
}
|
|
536
|
-
}}
|
|
537
|
-
/>
|
|
538
|
-
</div>;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
#### Toast
|
|
544
|
-
<!-- TODO: Provide screenshot here -->
|
|
545
|
-
|
|
546
|
-
Toast is not a part of `adapter-react` but it is an example how to use toast in application:
|
|
547
|
-
|
|
548
|
-
```
|
|
549
|
-
import Snackbar from '@material-ui/core/Snackbar';
|
|
550
|
-
|
|
551
|
-
class MyComponent {
|
|
552
|
-
constructor(props) {
|
|
553
|
-
super(props);
|
|
554
|
-
this.state = {
|
|
555
|
-
// ....
|
|
556
|
-
toast: '',
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
// ...
|
|
560
|
-
renderToast() {
|
|
561
|
-
if (!this.state.toast) {
|
|
562
|
-
return null;
|
|
563
|
-
}
|
|
564
|
-
return <Snackbar
|
|
565
|
-
anchorOrigin={{
|
|
566
|
-
vertical: 'bottom',
|
|
567
|
-
horizontal: 'left',
|
|
568
|
-
}}
|
|
569
|
-
open={true}
|
|
570
|
-
autoHideDuration={6000}
|
|
571
|
-
onClose={() => this.setState({toast: ''})}
|
|
572
|
-
ContentProps={{'aria-describedby': 'message-id'}}
|
|
573
|
-
message={<span id="message-id">{this.state.toast}</span>}
|
|
574
|
-
action={[
|
|
575
|
-
<IconButton
|
|
576
|
-
key="close"
|
|
577
|
-
aria-label="Close"
|
|
578
|
-
color="inherit"
|
|
579
|
-
className={this.props.classes.close}
|
|
580
|
-
onClick={() => this.setState({toast: ''})}
|
|
581
|
-
>
|
|
582
|
-
<IconClose />
|
|
583
|
-
</IconButton>,
|
|
584
|
-
]}
|
|
585
|
-
/>;
|
|
586
|
-
}
|
|
587
|
-
render() {
|
|
588
|
-
return <div>
|
|
589
|
-
{this.renderToast()}
|
|
590
|
-
</div>;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
## List of adapters that use adapter-react
|
|
596
|
-
- Admin
|
|
597
|
-
- iot
|
|
598
|
-
- echarts
|
|
599
|
-
- text2command
|
|
600
|
-
- scenes
|
|
601
|
-
- javascript
|
|
602
|
-
- devices
|
|
603
|
-
- eventlist
|
|
604
|
-
- cameras
|
|
605
|
-
- web
|
|
606
|
-
- vis-2
|
|
607
|
-
- vis-2-widgets-xxx
|
|
608
|
-
- fullcalendar
|
|
609
|
-
- openweathermap
|
|
610
|
-
|
|
611
|
-
## Usability
|
|
612
|
-
In dialogs, the OK button is first (on the left) and the cancel button is last (on the right)
|
|
613
|
-
|
|
614
|
-
## Used icons
|
|
615
|
-
This project uses icons from [Flaticon](https://www.flaticon.com/).
|
|
616
|
-
|
|
617
|
-
ioBroker GmbH has a valid license for all the used icons.
|
|
618
|
-
The icons may not be reused in other projects without the proper flaticon license or flaticon subscription.
|
|
619
|
-
|
|
620
|
-
## Migration from adapter-react to adapter-react-v5
|
|
621
|
-
### In src/package.json => dependencies
|
|
622
|
-
- `"@iobroker/adapter-react": "^2.0.22",` => `"@iobroker/adapter-react-v5": "^3.1.34",`
|
|
623
|
-
- `"@material-ui/core": "^4.12.3",` => `"@mui/material": "^5.10.9",`
|
|
624
|
-
- `"@material-ui/icons": "^4.11.2",` => `"@mui/icons-material": "^5.10.9",`
|
|
625
|
-
- Add `"@mui/styles": "^5.10.9",`
|
|
626
|
-
- Add `"babel-eslint": "^10.1.0",`
|
|
627
|
-
|
|
628
|
-
### In Source files
|
|
629
|
-
- All `@iobroker/adapter-react/...` => `@iobroker/adapter-react-v5/...`
|
|
630
|
-
- All `@material-ui/icons/...` => `@mui/icons-material/...`
|
|
631
|
-
- Change `import { withStyles } from '@material-ui/core/styles';` => `import { withStyles } from '@mui/styles';`
|
|
632
|
-
- Change `import { makeStyles } from '@mui/material/styles';` => `import { makeStyles } from '@mui/styles';`
|
|
633
|
-
- Change `import withWidth from '@material-ui/core/withWidth';` => `import { withWidth } from '@iobroker/adapter-react-v5';`
|
|
634
|
-
- All `@material-ui/core...` => `@mui/material...`
|
|
635
|
-
- Change `import { MuiThemeProvider } from '@material-ui/core/styles';` => `import { ThemeProvider, StyledEngineProvider } from '@mui/material/styles';`
|
|
636
|
-
- Change all `<MuiThemeProvider theme={this.state.theme}>` to `<StyledEngineProvider injectFirst><ThemeProvider theme={this.state.theme}>`
|
|
637
|
-
- Rename in styles `theme.palette.type` => `theme.palette.mode`
|
|
638
|
-
- Add to all `TextField`, `Select`, `FormControl` the property `variant="standard"`
|
|
639
|
-
- Add to all `Button` that do not have `color` property: `color="grey"`
|
|
640
|
-
- Replace by `TextField` the `readOnly` attribute (if exists) with `InputProps={{readOnly: true}}`
|
|
641
|
-
- Remove px by all `theme.spacing`: `calc(100% - ${theme.spacing(4)}px)` => `calc(100% - ${theme.spacing(4)})`
|
|
642
|
-
- Replace `this.selectTab(e.target.parentNode.dataset.name, index)` => `this.selectTab(e.target.dataset.name, index)`
|
|
643
|
-
|
|
644
|
-
If you still have questions, try to find an answer [here](https://mui.com/guides/migration-v4/).
|
|
645
|
-
|
|
646
|
-
## Migration from adapter-react-v5@3.x to adapter-react-v5@4.x
|
|
647
|
-
- Look for getObjectView socket requests and replace `socket.getObjectView('startKey', 'endKey', 'instance')` to `socket.getObjectViewSystem('instance', 'startKey', 'endKey')`
|
|
648
|
-
- Look for calls of custom like
|
|
649
|
-
```
|
|
650
|
-
this.props.socket._socket.emit('getObjectView', 'system', 'custom', {startKey: '', endKey:'\u9999'}, (err, objs) => {
|
|
651
|
-
(objs?.rows || [])
|
|
652
|
-
.forEach(item => console.log(item.id, item.value));
|
|
653
|
-
});
|
|
654
|
-
```
|
|
655
|
-
to
|
|
656
|
-
```
|
|
657
|
-
socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
|
|
658
|
-
.then(objects => {
|
|
659
|
-
Object.keys(objects).forEach(obj => console.log(obj._id));
|
|
660
|
-
});
|
|
661
|
-
```
|
|
662
|
-
- Replace all `socket.log.error('text')` to `socket.log('text', 'error')`
|
|
663
|
-
- Add to App.js `import { AdminConnection } from '@iobroker/adapter-react-v5';` and `super(props, { Connection: AdminConnection });` if run in admin
|
|
664
|
-
|
|
665
|
-
## Warning
|
|
666
|
-
`react-inlinesvg@4.0.5` cannot be used. Use `react-inlinesvg@4.0.3` instead.
|
|
667
|
-
<!--
|
|
668
|
-
Placeholder for the next version (at the beginning of the line):
|
|
669
|
-
### **WORK IN PROGRESS**
|
|
670
|
-
-->
|
|
671
|
-
|
|
672
|
-
## Changelog
|
|
673
|
-
### 4.13.
|
|
674
|
-
* (bluefox) used new connection classes
|
|
675
|
-
|
|
676
|
-
### 4.12.3 (2024-03-30)
|
|
677
|
-
* (bluefox) Migrated legacy connection to typescript
|
|
678
|
-
|
|
679
|
-
### 4.12.2 (2024-03-25)
|
|
680
|
-
* (bluefox) Added support for remote cloud
|
|
681
|
-
|
|
682
|
-
### 4.11.6 (2024-03-19)
|
|
683
|
-
* (bluefox) Corrected rendering of LoaderMV
|
|
684
|
-
|
|
685
|
-
### 4.11.4 (2024-03-18)
|
|
686
|
-
* (bluefox) Corrected types of IconPicker
|
|
687
|
-
|
|
688
|
-
### 4.11.3 (2024-03-17)
|
|
689
|
-
* (bluefox) Made filters for the file selector dialog optional
|
|
690
|
-
|
|
691
|
-
### 4.11.2 (2024-03-16)
|
|
692
|
-
* (bluefox) Migrated GenericApp to typescript
|
|
693
|
-
|
|
694
|
-
### 4.10.4 (2024-03-16)
|
|
695
|
-
* (bluefox) Migrated some components to typescript
|
|
696
|
-
|
|
697
|
-
### 4.10.1 (2024-03-11)
|
|
698
|
-
* (bluefox) Migrated some components to typescript
|
|
699
|
-
|
|
700
|
-
### 4.9.11 (2024-03-08)
|
|
701
|
-
* (foxriver76) type GenericApp socket correctly
|
|
702
|
-
|
|
703
|
-
### 4.9.10 (2024-02-21)
|
|
704
|
-
* (bluefox) translations
|
|
705
|
-
* (bluefox) updated json config
|
|
706
|
-
|
|
707
|
-
### 4.9.9 (2024-02-16)
|
|
708
|
-
* (foxriver76) also check plugin state of instance to see if Sentry is explicitly disabled
|
|
709
|
-
|
|
710
|
-
### 4.9.8 (2024-02-13)
|
|
711
|
-
* (bluefox) allowed hiding wizard in cron dialog
|
|
712
|
-
|
|
713
|
-
### 4.9.7 (2024-02-03)
|
|
714
|
-
* (foxriver76) allow passing down the instance number do avoid determining from url
|
|
715
|
-
|
|
716
|
-
### 4.9.5 (2024-01-01)
|
|
717
|
-
* (foxriver76) make `copyToClipboard` event parameter optional
|
|
718
|
-
|
|
719
|
-
### 4.9.4 (2024-01-01)
|
|
720
|
-
* (foxriver76) try to fix `SelectID` scrolling
|
|
721
|
-
|
|
722
|
-
### 4.9.2 (2023-12-30)
|
|
723
|
-
* (foxriver76) bump version of `@iobroker/json-config`
|
|
724
|
-
|
|
725
|
-
### 4.9.1 (2023-12-22)
|
|
726
|
-
* (foxriver76) `@iobroker/json-config` moved to real dependencies
|
|
727
|
-
|
|
728
|
-
### 4.9.0 (2023-12-22)
|
|
729
|
-
* (foxriver76) migrate to `@iobroker/json-config` module to have a single point of truth
|
|
730
|
-
* (bluefox) Allowed using of `filterFunc` as string
|
|
731
|
-
|
|
732
|
-
### 4.8.1 (2023-12-14)
|
|
733
|
-
* (bluefox) Added Device manager to JSON Config
|
|
734
|
-
|
|
735
|
-
### 4.7.15 (2023-12-12)
|
|
736
|
-
* (bluefox) Corrected parsing of a text
|
|
737
|
-
|
|
738
|
-
### 4.7.13 (2023-12-10)
|
|
739
|
-
* (bluefox) Added possibility to define the root style and embedded property
|
|
740
|
-
|
|
741
|
-
### 4.7.11 (2023-12-06)
|
|
742
|
-
* (bluefox) Extended color picker with "noInputField" option
|
|
743
|
-
|
|
744
|
-
### 4.7.9 (2023-12-04)
|
|
745
|
-
* (bluefox) Corrected the icon picker
|
|
746
|
-
|
|
747
|
-
### 4.7.8 (2023-12-04)
|
|
748
|
-
* (foxriver76) port to `@iobroker/types`
|
|
749
|
-
|
|
750
|
-
### 4.7.6 (2023-11-29)
|
|
751
|
-
* (bluefox) Added translations
|
|
752
|
-
|
|
753
|
-
### 4.7.5 (2023-11-28)
|
|
754
|
-
* (bluefox) Corrected subscribe on objects in the legacy connection
|
|
755
|
-
|
|
756
|
-
### 4.7.4 (2023-11-23)
|
|
757
|
-
* (bluefox) Updated packages
|
|
758
|
-
* (bluefox) Made getStates method in legacy connection compatible with new one
|
|
759
|
-
|
|
760
|
-
### 4.7.3 (2023-11-08)
|
|
761
|
-
* (bluefox) Updated packages
|
|
762
|
-
|
|
763
|
-
### 4.7.2 (2023-11-03)
|
|
764
|
-
* (foxriver76) fixed problem with color picker, where editing TextField was buggy
|
|
765
|
-
* (foxriver76) fixed light mode color of a path in FileBrowser
|
|
766
|
-
|
|
767
|
-
### 4.7.0 (2023-10-31)
|
|
768
|
-
* (bluefox) Synced with admin
|
|
769
|
-
* (bluefox) Added GIF to image files
|
|
770
|
-
|
|
771
|
-
### 4.6.7 (2023-10-19)
|
|
772
|
-
* (bluefox) Added return value for `subscribeOnInstance` for Connection class
|
|
773
|
-
|
|
774
|
-
### 4.6.6 (2023-10-13)
|
|
775
|
-
* (bluefox) Fixed the legacy connection
|
|
776
|
-
|
|
777
|
-
### 4.6.5 (2023-10-12)
|
|
778
|
-
* (foxriver76) fixed object browser with date
|
|
779
|
-
|
|
780
|
-
### 4.6.4 (2023-10-11)
|
|
781
|
-
* (bluefox) Updated the packages
|
|
782
|
-
|
|
783
|
-
### 4.6.3 (2023-10-09)
|
|
784
|
-
* (bluefox) Just updated the packages
|
|
785
|
-
* (bluefox) Synced with admin
|
|
786
|
-
|
|
787
|
-
### 4.6.2 (2023-09-29)
|
|
788
|
-
* (bluefox) Experimental feature added: update states on re-subscribe
|
|
789
|
-
|
|
790
|
-
### 4.5.5 (2023-09-27)
|
|
791
|
-
* (bluefox) Added export for IconNoIcon
|
|
792
|
-
|
|
793
|
-
### 4.5.4 (2023-09-17)
|
|
794
|
-
* (bluefox) Added the restricting to folder property for select file dialog
|
|
795
|
-
|
|
796
|
-
### 4.5.3 (2023-08-20)
|
|
797
|
-
* (foxriver76) fixed css classes of TableResize, see https://github.com/ioBroker/ioBroker.admin/issues/1860
|
|
798
|
-
|
|
799
|
-
### 4.5.2 (2023-08-20)
|
|
800
|
-
* (foxriver76) added missing export of TableResize
|
|
801
|
-
|
|
802
|
-
### 4.5.1 (2023-08-19)
|
|
803
|
-
* (foxriver76) fix dialog TextInput
|
|
804
|
-
|
|
805
|
-
### 4.5.0 (2023-08-18)
|
|
806
|
-
* (bluefox) Synchronize components with admin
|
|
807
|
-
|
|
808
|
-
### 4.4.8 (2023-08-17)
|
|
809
|
-
* (bluefox) Added translations
|
|
810
|
-
|
|
811
|
-
### 4.4.7 (2023-08-10)
|
|
812
|
-
* (bluefox) Added `subscribeStateAsync` method to wait for answer
|
|
813
|
-
* (bluefox) Added support for arrays for un/subscriptions
|
|
814
|
-
|
|
815
|
-
### 4.4.5 (2023-08-01)
|
|
816
|
-
* (bluefox) Updated packages
|
|
817
|
-
|
|
818
|
-
### 4.3.3 (2023-07-28)
|
|
819
|
-
* (bluefox) Added translations
|
|
820
|
-
|
|
821
|
-
### 4.3.0 (2023-07-19)
|
|
822
|
-
* (bluefox) Updated packages
|
|
823
|
-
* (bluefox) Added translations
|
|
824
|
-
* (bluefox) Synced object browser
|
|
825
|
-
* (bluefox) formatting
|
|
826
|
-
|
|
827
|
-
### 4.2.1 (2023-07-17)
|
|
828
|
-
* (bluefox) Updated packages
|
|
829
|
-
* (bluefox) Added translations
|
|
830
|
-
|
|
831
|
-
### 4.2.0 (2023-07-07)
|
|
832
|
-
* (bluefox) Updated packages
|
|
833
|
-
* (bluefox) Added new method `getObjectsById` to the socket communication
|
|
834
|
-
|
|
835
|
-
### 4.1.2 (2023-06-20)
|
|
836
|
-
* (bluefox) Allowed setting theme name directly by theme toggle
|
|
837
|
-
|
|
838
|
-
### 4.1.0 (2023-05-10)
|
|
839
|
-
* (bluefox) `craco-module-federation.js` was added. For node 16
|
|
840
|
-
|
|
841
|
-
### 4.0.27 (2023-05-09)
|
|
842
|
-
* (bluefox) Allowed showing only specific root in SelectIDDialog
|
|
843
|
-
|
|
844
|
-
### 4.0.26 (2023-05-08)
|
|
845
|
-
* (bluefox) Added IDs to the buttons in the dialog for GUI tests
|
|
846
|
-
|
|
847
|
-
### 4.0.25 (2023-04-23)
|
|
848
|
-
* (bluefox) Extended `TextWithIcon` with defined color and icon
|
|
849
|
-
|
|
850
|
-
### 4.0.24 (2023-04-03)
|
|
851
|
-
* (bluefox) Updated the file selector in tile mode
|
|
852
|
-
|
|
853
|
-
### 4.0.23 (2023-03-27)
|
|
854
|
-
* (bluefox) Added translations
|
|
855
|
-
|
|
856
|
-
### 4.0.22 (2023-03-22)
|
|
857
|
-
* (bluefox) Re-Activate legacy connection
|
|
858
|
-
|
|
859
|
-
### 4.0.21 (2023-03-22)
|
|
860
|
-
* (bluefox) Added translations
|
|
861
|
-
|
|
862
|
-
### 4.0.20 (2023-03-21)
|
|
863
|
-
* (bluefox) Color picker was improved
|
|
864
|
-
|
|
865
|
-
### 4.0.19 (2023-03-20)
|
|
866
|
-
* (bluefox) Packages were updated
|
|
867
|
-
* (bluefox) Added new translations
|
|
868
|
-
|
|
869
|
-
### 4.0.18 (2023-03-16)
|
|
870
|
-
* (bluefox) Packages were updated
|
|
871
|
-
|
|
872
|
-
### 4.0.17 (2023-03-15)
|
|
873
|
-
* (bluefox) Added translations
|
|
874
|
-
* (bluefox) Added port controller to JSON config
|
|
875
|
-
|
|
876
|
-
### 4.0.15 (2023-03-12)
|
|
877
|
-
* (bluefox) Updated the object browser and file browser
|
|
878
|
-
|
|
879
|
-
### 4.0.14 (2023-03-03)
|
|
880
|
-
* (bluefox) added handler of alert messages
|
|
881
|
-
|
|
882
|
-
### 4.0.13 (2023-02-15)
|
|
883
|
-
* (bluefox) Corrected the theme button
|
|
884
|
-
|
|
885
|
-
### 4.0.12 (2023-02-15)
|
|
886
|
-
* (bluefox) made the fix for `echarts`
|
|
887
|
-
|
|
888
|
-
### 4.0.11 (2023-02-14)
|
|
889
|
-
* (bluefox) Updated packages
|
|
890
|
-
* (bluefox) The `chartReady` event was omitted
|
|
891
|
-
|
|
892
|
-
### 4.0.10 (2023-02-10)
|
|
893
|
-
* (bluefox) Updated packages
|
|
894
|
-
* (bluefox) made the fix for `material`
|
|
895
|
-
|
|
896
|
-
### 4.0.9 (2023-02-02)
|
|
897
|
-
* (bluefox) Updated packages
|
|
898
|
-
|
|
899
|
-
### 4.0.8 (2022-12-19)
|
|
900
|
-
* (bluefox) Extended socket with `log` command
|
|
901
|
-
|
|
902
|
-
### 4.0.6 (2022-12-19)
|
|
903
|
-
* (bluefox) Corrected URL for the connection
|
|
904
|
-
|
|
905
|
-
### 4.0.5 (2022-12-14)
|
|
906
|
-
* (bluefox) Added support of custom palette for color picker
|
|
907
|
-
|
|
908
|
-
### 4.0.2 (2022-12-01)
|
|
909
|
-
* (bluefox) use `@iobroker/socket-client` instead of `Connection.js`
|
|
910
|
-
|
|
911
|
-
### 3.5.3 (2022-11-30)
|
|
912
|
-
* (bluefox) Improved `renderTextWithA` function to support `<b>` and `<i>` tags
|
|
913
|
-
|
|
914
|
-
### 3.5.2 (2022-11-30)
|
|
915
|
-
* (bluefox) updated json config component
|
|
916
|
-
|
|
917
|
-
### 3.4.1 (2022-11-29)
|
|
918
|
-
* (bluefox) Added button text for message dialog
|
|
919
|
-
|
|
920
|
-
### 3.4.0 (2022-11-29)
|
|
921
|
-
* (bluefox) Added file selector
|
|
922
|
-
|
|
923
|
-
### 3.3.0 (2022-11-26)
|
|
924
|
-
* (bluefox) Added subscribe on files
|
|
925
|
-
|
|
926
|
-
### 3.2.7 (2022-11-13)
|
|
927
|
-
* (bluefox) Added `fullWidth` property to `Dialog`
|
|
928
|
-
|
|
929
|
-
### 3.2.6 (2022-11-08)
|
|
930
|
-
* (xXBJXx) Improved TreeTable component
|
|
931
|
-
|
|
932
|
-
### 3.2.5 (2022-11-08)
|
|
933
|
-
* (bluefox) Added the role filter for the object browser
|
|
934
|
-
|
|
935
|
-
### 3.2.4 (2022-11-03)
|
|
936
|
-
* (bluefox) Added support for alfa channel for `invertColor`
|
|
937
|
-
|
|
938
|
-
### 3.2.3 (2022-10-26)
|
|
939
|
-
* (bluefox) Corrected expert mode for object browser
|
|
940
|
-
|
|
941
|
-
### 3.2.2 (2022-10-25)
|
|
942
|
-
* (bluefox) Added support for prefixes for translations
|
|
943
|
-
|
|
944
|
-
### 3.2.1 (2022-10-24)
|
|
945
|
-
* (bluefox) Corrected color inversion
|
|
946
|
-
|
|
947
|
-
### 3.2.0 (2022-10-19)
|
|
948
|
-
* (bluefox) Added ukrainian translation
|
|
949
|
-
|
|
950
|
-
### 3.1.35 (2022-10-17)
|
|
951
|
-
* (bluefox) small changes for material
|
|
952
|
-
|
|
953
|
-
### 3.1.34 (2022-08-24)
|
|
954
|
-
* (bluefox) Implemented fallback to english by translations
|
|
955
|
-
|
|
956
|
-
### 3.1.33 (2022-08-24)
|
|
957
|
-
* (bluefox) Added support for onchange flag
|
|
958
|
-
|
|
959
|
-
### 3.1.30 (2022-08-23)
|
|
960
|
-
* (bluefox) Added method `getCompactSystemRepositories`
|
|
961
|
-
* (bluefox) corrected error in `ObjectBrowser`
|
|
962
|
-
|
|
963
|
-
### 3.1.27 (2022-08-01)
|
|
964
|
-
* (bluefox) Disable file editing in FileViewer
|
|
965
|
-
|
|
966
|
-
### 3.1.26 (2022-08-01)
|
|
967
|
-
* (bluefox) Added translations
|
|
968
|
-
* (bluefox) JSON schema was extended with missing definitions
|
|
969
|
-
|
|
970
|
-
### 3.1.24 (2022-07-28)
|
|
971
|
-
* (bluefox) Updated file browser and object browser
|
|
972
|
-
|
|
973
|
-
### 3.1.23 (2022-07-25)
|
|
974
|
-
* (bluefox) Extend custom filter for object selector
|
|
975
|
-
|
|
976
|
-
### 3.1.22 (2022-07-22)
|
|
977
|
-
* (bluefox) Added i18n tools for development
|
|
978
|
-
|
|
979
|
-
### 3.1.20 (2022-07-14)
|
|
980
|
-
* (bluefox) Allowed to show select dialog with the expert mode enabled
|
|
981
|
-
|
|
982
|
-
### 3.1.19 (2022-07-08)
|
|
983
|
-
* (bluefox) Allowed extending translations for all languages together
|
|
984
|
-
|
|
985
|
-
### 3.1.18 (2022-07-06)
|
|
986
|
-
* (bluefox) Added translation
|
|
987
|
-
|
|
988
|
-
### 3.1.17 (2022-07-05)
|
|
989
|
-
* (bluefox) Deactivate JSON editor for JSONConfig because of space
|
|
990
|
-
|
|
991
|
-
### 3.1.16 (2022-06-27)
|
|
992
|
-
* (bluefox) Update object browser
|
|
993
|
-
|
|
994
|
-
### 3.1.15 (2022-06-27)
|
|
995
|
-
* (bluefox) Allowed using of spaces in name
|
|
996
|
-
|
|
997
|
-
### 3.1.14 (2022-06-23)
|
|
998
|
-
* (bluefox) Added translations
|
|
999
|
-
|
|
1000
|
-
### 3.1.11 (2022-06-22)
|
|
1001
|
-
* (bluefox) Added preparations for iobroker cloud
|
|
1002
|
-
|
|
1003
|
-
### 3.1.10 (2022-06-22)
|
|
1004
|
-
* (bluefox) Added translations
|
|
1005
|
-
|
|
1006
|
-
### 3.1.9 (2022-06-20)
|
|
1007
|
-
* (bluefox) Allowed working behind reverse proxy
|
|
1008
|
-
|
|
1009
|
-
### 3.1.7 (2022-06-19)
|
|
1010
|
-
* (bluefox) Added file select dialog
|
|
1011
|
-
|
|
1012
|
-
### 3.1.3 (2022-06-13)
|
|
1013
|
-
* (bluefox) Added table with resized headers
|
|
1014
|
-
|
|
1015
|
-
### 3.1.2 (2022-06-09)
|
|
1016
|
-
* (bluefox) Added new document icon (read only)
|
|
1017
|
-
|
|
1018
|
-
### 3.1.1 (2022-06-09)
|
|
1019
|
-
* (bluefox) Allowed working behind reverse proxy
|
|
1020
|
-
|
|
1021
|
-
### 3.1.0 (2022-06-07)
|
|
1022
|
-
* (bluefox) Some german texts were corrected
|
|
1023
|
-
|
|
1024
|
-
### 3.0.17 (2022-06-03)
|
|
1025
|
-
* (bluefox) Allowed calling getAdapterInstances not for admin too
|
|
1026
|
-
|
|
1027
|
-
### 3.0.15 (2022-06-01)
|
|
1028
|
-
* (bluefox) Updated JsonConfigComponent: password, table
|
|
1029
|
-
|
|
1030
|
-
### 3.0.14 (2022-05-25)
|
|
1031
|
-
* (bluefox) Added ConfigGeneric to import
|
|
1032
|
-
|
|
1033
|
-
### 3.0.7 (2022-05-25)
|
|
1034
|
-
* (bluefox) Made the module definitions
|
|
1035
|
-
|
|
1036
|
-
### 3.0.6 (2022-05-25)
|
|
1037
|
-
* (bluefox) Added JsonConfigComponent
|
|
1038
|
-
|
|
1039
|
-
### 2.1.11 (2022-05-24)
|
|
1040
|
-
* (bluefox) Update file browser. It supports now the file changed events.
|
|
1041
|
-
|
|
1042
|
-
### 2.1.10 (2022-05-24)
|
|
1043
|
-
* (bluefox) Corrected object browser
|
|
1044
|
-
|
|
1045
|
-
### 2.1.9 (2022-05-16)
|
|
1046
|
-
* (bluefox) Corrected expert mode in object browser
|
|
1047
|
-
|
|
1048
|
-
### 2.1.7 (2022-05-09)
|
|
1049
|
-
* (bluefox) Changes were synchronized with adapter-react-v5
|
|
1050
|
-
* (bluefox) Added `I18n.disableWarning` method
|
|
1051
|
-
|
|
1052
|
-
### 2.1.6 (2022-03-28)
|
|
1053
|
-
* (bluefox) Added `log` method to connection
|
|
1054
|
-
* (bluefox) Corrected translations
|
|
1055
|
-
|
|
1056
|
-
### 2.1.1 (2022-03-27)
|
|
1057
|
-
* (bluefox) Corrected error in TreeTable
|
|
1058
|
-
|
|
1059
|
-
### 2.1.0 (2022-03-26)
|
|
1060
|
-
* (bluefox) BREAKING_CHANGE: Corrected error with readFile(base64=false)
|
|
1061
|
-
|
|
1062
|
-
### 2.0.0 (2022-03-26)
|
|
1063
|
-
* (bluefox) Initial version
|
|
1064
|
-
|
|
1065
|
-
### 0.1.0 (2022-03-23)
|
|
1066
|
-
* (bluefox) Fixed theme errors
|
|
1067
|
-
|
|
1068
|
-
### 0.0.4 (2022-03-22)
|
|
1069
|
-
* (bluefox) Fixed eslint warnings
|
|
1070
|
-
|
|
1071
|
-
### 0.0.3 (2022-03-19)
|
|
1072
|
-
* (bluefox) beta version
|
|
1073
|
-
|
|
1074
|
-
### 0.0.2 (2022-02-24)
|
|
1075
|
-
* (bluefox) try to publish a first version
|
|
1076
|
-
|
|
1077
|
-
### 0.0.1 (2022-02-24)
|
|
1078
|
-
* initial commit
|
|
1079
|
-
|
|
1080
|
-
## License
|
|
1081
|
-
The MIT License (MIT)
|
|
1082
|
-
|
|
1083
|
-
Copyright (c) 2019-2024 bluefox <dogafox@gmail.com>
|
|
1084
|
-
|
|
1085
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1086
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
1087
|
-
in the Software without restriction, including without limitation the rights
|
|
1088
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1089
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
1090
|
-
furnished to do so, subject to the following conditions:
|
|
1091
|
-
|
|
1092
|
-
The above copyright notice and this permission notice shall be included in all
|
|
1093
|
-
copies or substantial portions of the Software.
|
|
1094
|
-
|
|
1095
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1096
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1097
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1098
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1099
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1100
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1101
|
-
SOFTWARE.
|
|
1
|
+
# Help ReactJS classes for adapter config
|
|
2
|
+
You can find demo on https://github.com/ioBroker/adapter-react-demo
|
|
3
|
+
|
|
4
|
+
## Getting started
|
|
5
|
+
If you want to create the configuration page with ReactJS:
|
|
6
|
+
1. Create github repo for adapter.
|
|
7
|
+
2. execute `npx create-react-app src` . It will take a while.
|
|
8
|
+
3. `cd src`
|
|
9
|
+
4. Modify package.json file in src directory:
|
|
10
|
+
- Change `name` from `src` to `ADAPTERNAME-admin` (Of course replace `ADAPTERNAME` with yours)
|
|
11
|
+
- Add to devDependencies:
|
|
12
|
+
```
|
|
13
|
+
"@iobroker/adapter-react": "^4.0.10",
|
|
14
|
+
```
|
|
15
|
+
Versions can be higher.
|
|
16
|
+
So your src/package.json should look like:
|
|
17
|
+
```
|
|
18
|
+
{
|
|
19
|
+
"name": "ADAPTERNAME-admin",
|
|
20
|
+
"version": "0.1.0",
|
|
21
|
+
"private": true,
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"react": "^18.2.0",
|
|
24
|
+
"react-dom": "^18.2.0",
|
|
25
|
+
"react-icons": "^4.6.0",
|
|
26
|
+
"react-scripts": "^5.0.1",
|
|
27
|
+
"@iobroker/adapter-react-v5": "^3.2.7",
|
|
28
|
+
"del": "^6.1.1",
|
|
29
|
+
"gulp": "^4.0.2"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"start": "react-scripts start",
|
|
33
|
+
"build": "react-scripts build",
|
|
34
|
+
"test": "react-scripts test",
|
|
35
|
+
"eject": "react-scripts eject"
|
|
36
|
+
},
|
|
37
|
+
"eslintConfig": {
|
|
38
|
+
"extends": "react-app"
|
|
39
|
+
},
|
|
40
|
+
"homepage": ".",
|
|
41
|
+
"browserslist": [
|
|
42
|
+
">0.2%",
|
|
43
|
+
"not dead",
|
|
44
|
+
"not ie <= 11",
|
|
45
|
+
"not op_mini all"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
5. Call in `src`: `npm install`
|
|
50
|
+
6. Copy gulpfile.js into `src`: `cp node_modules/@iobroker/adapter-react/gulpfile.js gulpfile.js`
|
|
51
|
+
7. Start your dummy application `npm run start` for developing or build with `npm run build` and
|
|
52
|
+
copy files in `build` directory to `www` or to `admin`. In the admin you must rename `index.html` to `index_m.html`.
|
|
53
|
+
8. You can do that with `gulp` tasks: `gulp build`, `gulp copy`, `gulp renameIndex` or `gulp renameTab`
|
|
54
|
+
|
|
55
|
+
## Development
|
|
56
|
+
1. Add `socket.io` to `public/index.html`.
|
|
57
|
+
After
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
insert
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
<script>
|
|
67
|
+
var script = document.createElement('script');
|
|
68
|
+
window.registerSocketOnLoad = function (cb) {
|
|
69
|
+
window.socketLoadedHandler = cb;
|
|
70
|
+
};
|
|
71
|
+
const parts = (window.location.search || '').replace(/^\?/, '').split('&');
|
|
72
|
+
const query = {};
|
|
73
|
+
parts.forEach(item => {
|
|
74
|
+
const [name, val] = item.split('=');
|
|
75
|
+
query[decodeURIComponent(name)] = val !== undefined ? decodeURIComponent(val) : true;
|
|
76
|
+
});
|
|
77
|
+
script.onload = function () { typeof window.socketLoadedHandler === 'function' && window.socketLoadedHandler(); };
|
|
78
|
+
script.src = window.location.port === '3000' ? window.location.protocol + '//' + (query.host || window.location.hostname) + ':' + (query.port || 8081) + '/lib/js/socket.io.js' : '%PUBLIC_URL%/../../lib/js/socket.io.js';
|
|
79
|
+
|
|
80
|
+
document.head.appendChild(script);
|
|
81
|
+
</script>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
3. Add to App.js constructor initialization for I18n:
|
|
85
|
+
```
|
|
86
|
+
class App extends GenericApp {
|
|
87
|
+
constructor(props) {
|
|
88
|
+
const extendedProps = {...props};
|
|
89
|
+
extendedProps.encryptedFields = ['pass']; // this parameter will be encrypted and decrypted automatically
|
|
90
|
+
extendedProps.translations = {
|
|
91
|
+
'en': require('./i18n/en'),
|
|
92
|
+
'de': require('./i18n/de'),
|
|
93
|
+
'ru': require('./i18n/ru'),
|
|
94
|
+
'pt': require('./i18n/pt'),
|
|
95
|
+
'nl': require('./i18n/nl'),
|
|
96
|
+
'fr': require('./i18n/fr'),
|
|
97
|
+
'it': require('./i18n/it'),
|
|
98
|
+
'es': require('./i18n/es'),
|
|
99
|
+
'pl': require('./i18n/pl'),
|
|
100
|
+
'uk': require('./i18n/uk'),
|
|
101
|
+
'zh-cn': require('./i18n/zh-cn'),
|
|
102
|
+
};
|
|
103
|
+
// get actual admin port
|
|
104
|
+
extendedProps.socket = {port: parseInt(window.location.port, 10)};
|
|
105
|
+
|
|
106
|
+
// Only if close, save buttons are not required at the bottom (e.g. if admin tab)
|
|
107
|
+
// extendedProps.bottomButtons = false;
|
|
108
|
+
|
|
109
|
+
// only for debug purposes
|
|
110
|
+
if (extendedProps.socket.port === 3000) {
|
|
111
|
+
extendedProps.socket.port = 8081;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// allow to manage GenericApp the sentry initialisation or do not set the sentryDSN if no sentry available
|
|
115
|
+
extendedProps.sentryDSN = 'https://yyy@sentry.iobroker.net/xx';
|
|
116
|
+
|
|
117
|
+
super(extendedProps);
|
|
118
|
+
}
|
|
119
|
+
...
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
4. Replace `index.js` with the following code to support themes:
|
|
124
|
+
```
|
|
125
|
+
import React from 'react';
|
|
126
|
+
import ReactDOM from 'react-dom';
|
|
127
|
+
import { MuiThemeProvider} from '@material-ui/core/styles';
|
|
128
|
+
import * as serviceWorker from './serviceWorker';
|
|
129
|
+
|
|
130
|
+
import './index.css';
|
|
131
|
+
import App from './App';
|
|
132
|
+
import { version } from '../package.json';
|
|
133
|
+
|
|
134
|
+
import theme from '@iobroker/adapter-react/Theme';
|
|
135
|
+
|
|
136
|
+
console.log('iobroker.scenes@' + version);
|
|
137
|
+
let themeName = window.localStorage ? window.localStorage.getItem('App.theme') || 'light' : 'light';
|
|
138
|
+
|
|
139
|
+
function build() {
|
|
140
|
+
return ReactDOM.render(<MuiThemeProvider theme={ theme(themeName) }>
|
|
141
|
+
<App onThemeChange={_theme => {
|
|
142
|
+
themeName = _theme;
|
|
143
|
+
build();
|
|
144
|
+
}}/>
|
|
145
|
+
</MuiThemeProvider>, document.getElementById('root'));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
build();
|
|
149
|
+
|
|
150
|
+
// If you want your app to work offline and load faster, you can change
|
|
151
|
+
// unregister() to register() below. Note this comes with some pitfalls.
|
|
152
|
+
// Learn more about service workers: http://bit.ly/CRA-PWA
|
|
153
|
+
serviceWorker.unregister();
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
5. Add to App.js encoding and decoding of values:
|
|
157
|
+
```
|
|
158
|
+
class App extend GenericApp {
|
|
159
|
+
...
|
|
160
|
+
onPrepareLoad(settings) {
|
|
161
|
+
settings.pass = this.decode(settings.pass);
|
|
162
|
+
}
|
|
163
|
+
onPrepareSave(settings) {
|
|
164
|
+
settings.pass = this.encode(settings.pass);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
6. The optional step is to validate the data to be saved:
|
|
170
|
+
```
|
|
171
|
+
onPrepareSave(settings) {
|
|
172
|
+
super.onPrepareSave(settings);
|
|
173
|
+
if (DATA_INVALID) {
|
|
174
|
+
return false; // configuration will not be saved
|
|
175
|
+
} else {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Components
|
|
182
|
+
|
|
183
|
+
### Connection.js
|
|
184
|
+
This is a non-react class to provide the communication for socket connection with the server.
|
|
185
|
+
|
|
186
|
+
### GenericApp.tsx
|
|
187
|
+
|
|
188
|
+
### i18n.ts
|
|
189
|
+
|
|
190
|
+
### Theme.tsx
|
|
191
|
+
|
|
192
|
+
### Dialogs
|
|
193
|
+
Some dialogs are predefined and could be used out of the box.
|
|
194
|
+
|
|
195
|
+
#### Confirm.tsx
|
|
196
|
+
<!-- TODO: Provide screenshot here -->
|
|
197
|
+
|
|
198
|
+
Usage:
|
|
199
|
+
```
|
|
200
|
+
import React from 'react';
|
|
201
|
+
import ConfirmDialog from '@iobroker/adapter-react/Dialogs/Confirm'
|
|
202
|
+
import I18n from '@iobroker/adapter-react/i18n';
|
|
203
|
+
|
|
204
|
+
class ExportImportDialog extends React.Component {
|
|
205
|
+
constructor(props) {
|
|
206
|
+
super(props);
|
|
207
|
+
|
|
208
|
+
this.state = {
|
|
209
|
+
confirmDialog: false,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
renderConfirmDialog() {
|
|
214
|
+
if (!this.state.confirmDialog) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
return <ConfirmDialog
|
|
218
|
+
title={ I18n.t('Scene will be overwritten.') }
|
|
219
|
+
text={ I18n.t('All data will be lost. Confirm?') }
|
|
220
|
+
ok={ I18n.t('Yes') }
|
|
221
|
+
cancel={ I18n.t('Cancel') }
|
|
222
|
+
suppressQuestionMinutes={5}
|
|
223
|
+
dialogName="myConfirmDialogThatCouldBeSuppressed"
|
|
224
|
+
suppressText={I18n.t('Suppress question for next %s minutes', 5)}
|
|
225
|
+
onClose={isYes => {
|
|
226
|
+
this.setState({ confirmDialog: false} );
|
|
227
|
+
}}
|
|
228
|
+
/>;
|
|
229
|
+
}
|
|
230
|
+
render() {
|
|
231
|
+
return <div>
|
|
232
|
+
<Button onClick={ () => this.setState({confirmDialog: true}) }>Click</Button>
|
|
233
|
+
{ this.renderConfirmDialog() }
|
|
234
|
+
</div>
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export default ExportImportDialog;
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Error.tsx
|
|
242
|
+
<!-- TODO: Provide screenshot here -->
|
|
243
|
+
|
|
244
|
+
#### Message.tsx
|
|
245
|
+
<!-- TODO: Provide screenshot here -->
|
|
246
|
+
```
|
|
247
|
+
renderMessage() {
|
|
248
|
+
if (this.state.showMessage) {
|
|
249
|
+
return <Message
|
|
250
|
+
text={this.state.showMessage}
|
|
251
|
+
onClose={() => this.setState({showMessage: false})}
|
|
252
|
+
/>;
|
|
253
|
+
} else {
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
#### SelectID.tsx
|
|
260
|
+

|
|
261
|
+
```
|
|
262
|
+
import DialogSelectID from '@iobroker/adapter-react/Dialogs/SelectID';
|
|
263
|
+
|
|
264
|
+
class MyComponent extends Component {
|
|
265
|
+
constructor(props) {
|
|
266
|
+
super(props);
|
|
267
|
+
this.state = {
|
|
268
|
+
showSelectId: false,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
renderSelectIdDialog() {
|
|
273
|
+
if (this.state.showSelectId) {
|
|
274
|
+
return <DialogSelectID
|
|
275
|
+
key="tableSelect"
|
|
276
|
+
imagePrefix="../.."
|
|
277
|
+
dialogName={this.props.adapterName}
|
|
278
|
+
themeType={this.props.themeType}
|
|
279
|
+
socket={this.props.socket}
|
|
280
|
+
statesOnly={true}
|
|
281
|
+
selected={this.state.selectIdValue}
|
|
282
|
+
onClose={() => this.setState({showSelectId: false})}
|
|
283
|
+
onOk={(selected, name) => {
|
|
284
|
+
this.setState({showSelectId: false, selectIdValue: selected});
|
|
285
|
+
}}
|
|
286
|
+
/>;
|
|
287
|
+
} else {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
render() {
|
|
292
|
+
return renderSelectIdDialog();
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### Cron
|
|
298
|
+
Include `"react-text-mask": "^5.4.3",` in package.json.
|
|
299
|
+
|
|
300
|
+
<!-- TODO: Provide screenshot here -->
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
function renderCron() {
|
|
304
|
+
if (!showCron) {
|
|
305
|
+
return null;
|
|
306
|
+
} else {
|
|
307
|
+
return <DialogCron
|
|
308
|
+
key="dialogCron1"
|
|
309
|
+
cron={this.state.cronValue || '* * * * *'}
|
|
310
|
+
onClose={() => this.setState({ showCron: false })}
|
|
311
|
+
onOk={cronValue => {
|
|
312
|
+
this.setState({ cronValue })
|
|
313
|
+
}}
|
|
314
|
+
/>;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Components
|
|
320
|
+
|
|
321
|
+
#### Utils.tsx
|
|
322
|
+
##### getObjectNameFromObj
|
|
323
|
+
`getObjectNameFromObj(obj, settings, options, isDesc)`
|
|
324
|
+
|
|
325
|
+
Get object name from a single object.
|
|
326
|
+
|
|
327
|
+
Usage: `Utils.getObjectNameFromObj(this.objects[id], null, {language: I18n.getLanguage()})`
|
|
328
|
+
|
|
329
|
+
##### getObjectIcon
|
|
330
|
+
`getObjectIcon(id, obj)`
|
|
331
|
+
|
|
332
|
+
Get icon from the object.
|
|
333
|
+
|
|
334
|
+
Usage:
|
|
335
|
+
```
|
|
336
|
+
const icon = Utils.getObjectIcon(id, this.objects[id]);
|
|
337
|
+
return (<img src={icon}/>);
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
##### isUseBright
|
|
341
|
+
`isUseBright(color, defaultValue)`
|
|
342
|
+
|
|
343
|
+
Usage: `
|
|
344
|
+
|
|
345
|
+
#### Loader.tsx
|
|
346
|
+

|
|
347
|
+
|
|
348
|
+
```
|
|
349
|
+
render() {
|
|
350
|
+
if (!this.state.loaded) {
|
|
351
|
+
return <MuiThemeProvider theme={this.state.theme}>
|
|
352
|
+
<Loader theme={this.state.themeType}/>
|
|
353
|
+
</MuiThemeProvider>;
|
|
354
|
+
}
|
|
355
|
+
// render loaded data
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### Logo.tsx
|
|
361
|
+

|
|
362
|
+
|
|
363
|
+
```
|
|
364
|
+
render() {
|
|
365
|
+
return <form className={this.props.classes.tab}>
|
|
366
|
+
<Logo
|
|
367
|
+
instance={this.props.instance}
|
|
368
|
+
common={this.props.common}
|
|
369
|
+
native={this.props.native}
|
|
370
|
+
onError={text => this.setState({errorText: text})}
|
|
371
|
+
onLoad={this.props.onLoad}
|
|
372
|
+
/>
|
|
373
|
+
...
|
|
374
|
+
</form>;
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
#### Router.tsx
|
|
379
|
+
|
|
380
|
+
#### ObjectBrowser.js
|
|
381
|
+
It is better to use `Dialog/SelectID`, but if you want:
|
|
382
|
+
|
|
383
|
+

|
|
384
|
+
|
|
385
|
+
```
|
|
386
|
+
<ObjectBrowser
|
|
387
|
+
foldersFirst={this.props.foldersFirst}
|
|
388
|
+
imagePrefix={this.props.imagePrefix || this.props.prefix} // prefix is for back compatibility
|
|
389
|
+
defaultFilters={this.filters}
|
|
390
|
+
dialogName={this.dialogName}
|
|
391
|
+
showExpertButton={this.props.showExpertButton !== undefined ? this.props.showExpertButton : true}
|
|
392
|
+
style={{ width: '100%', height: '100%' }}
|
|
393
|
+
columns={this.props.columns || ['name', 'type', 'role', 'room', 'func', 'val']}
|
|
394
|
+
types={this.props.types || ['state']}
|
|
395
|
+
t={I18n.t}
|
|
396
|
+
lang={this.props.lang || I18n.getLanguage()}
|
|
397
|
+
socket={this.props.socket}
|
|
398
|
+
selected={this.state.selected}
|
|
399
|
+
multiSelect={this.props.multiSelect}
|
|
400
|
+
notEditable={this.props.notEditable === undefined ? true : this.props.notEditable}
|
|
401
|
+
name={this.state.name}
|
|
402
|
+
themeName={this.props.themeName}
|
|
403
|
+
themeType={this.props.themeType}
|
|
404
|
+
customFilter={this.props.customFilter}
|
|
405
|
+
onFilterChanged={filterConfig => {
|
|
406
|
+
this.filters = filterConfig;
|
|
407
|
+
window.localStorage.setItem(this.dialogName, JSON.stringify(filterConfig));
|
|
408
|
+
}}
|
|
409
|
+
onSelect={(selected, name, isDouble) => {
|
|
410
|
+
if (JSON.stringify(selected) !== JSON.stringify(this.state.selected)) {
|
|
411
|
+
this.setState({selected, name}, () =>
|
|
412
|
+
isDouble && this.handleOk());
|
|
413
|
+
} else if (isDouble) {
|
|
414
|
+
this.handleOk();
|
|
415
|
+
}
|
|
416
|
+
}}
|
|
417
|
+
/>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
#### TreeTable.js
|
|
421
|
+

|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
// STYLES
|
|
425
|
+
const styles = theme => ({
|
|
426
|
+
tableDiv: {
|
|
427
|
+
width: '100%',
|
|
428
|
+
overflow: 'hidden',
|
|
429
|
+
height: 'calc(100% - 48px)',
|
|
430
|
+
},
|
|
431
|
+
});
|
|
432
|
+
class MyComponent extends Component {
|
|
433
|
+
constructor(props) {
|
|
434
|
+
super(props);
|
|
435
|
+
|
|
436
|
+
this.state = {
|
|
437
|
+
data: [
|
|
438
|
+
{
|
|
439
|
+
id: 'UniqueID1' // required
|
|
440
|
+
fieldIdInData: 'Name1',
|
|
441
|
+
myType: 'number',
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: 'UniqueID2' // required
|
|
445
|
+
fieldIdInData: 'Name12',
|
|
446
|
+
myType: 'string',
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
this.columns = [
|
|
452
|
+
{
|
|
453
|
+
title: 'Name of field', // required, else it will be "field"
|
|
454
|
+
field: 'fieldIdInData', // required
|
|
455
|
+
editable: false, // or true [default - true]
|
|
456
|
+
cellStyle: { // CSS style - // optional
|
|
457
|
+
maxWidth: '12rem',
|
|
458
|
+
overflow: 'hidden',
|
|
459
|
+
wordBreak: 'break-word',
|
|
460
|
+
},
|
|
461
|
+
lookup: { // optional => edit will be automatically "SELECT"
|
|
462
|
+
'value1': 'text1',
|
|
463
|
+
'value2': 'text2',
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
title: 'Type', // required, else it will be "field"
|
|
468
|
+
field: 'myType', // required
|
|
469
|
+
editable: true, // or true [default - true]
|
|
470
|
+
lookup: { // optional => edit will be automatically "SELECT"
|
|
471
|
+
'number': 'Number',
|
|
472
|
+
'string': 'String',
|
|
473
|
+
'boolean': 'Boolean',
|
|
474
|
+
},
|
|
475
|
+
type: 'number/string/color/oid/icon/boolean', // oid=ObjectID,icon=base64-icon
|
|
476
|
+
editComponent: props =>
|
|
477
|
+
<div>Prefix{ <br/>
|
|
478
|
+
<textarea
|
|
479
|
+
rows={4}
|
|
480
|
+
style={{width: '100%', resize: 'vertical'}}
|
|
481
|
+
value={props.value}
|
|
482
|
+
onChange={e => props.onChange(e.target.value)}
|
|
483
|
+
/>
|
|
484
|
+
Suffix
|
|
485
|
+
</div>,
|
|
486
|
+
},
|
|
487
|
+
];
|
|
488
|
+
}
|
|
489
|
+
// renderTable
|
|
490
|
+
render() {
|
|
491
|
+
return <div className={this.props.classes.tableDiv}>
|
|
492
|
+
<TreeTable
|
|
493
|
+
columns={this.columns}
|
|
494
|
+
data={this.state.data}
|
|
495
|
+
onUpdate={(newData, oldData) => {
|
|
496
|
+
const data = JSON.parse(JSON.stringify(this.state.data));
|
|
497
|
+
|
|
498
|
+
// Added new line
|
|
499
|
+
if (newData === true) {
|
|
500
|
+
// find unique ID
|
|
501
|
+
let i = 1;
|
|
502
|
+
let id = 'line_' + i;
|
|
503
|
+
|
|
504
|
+
// eslint-disable-next-line
|
|
505
|
+
while(this.state.data.find(item => item.id === id)) {
|
|
506
|
+
i++;
|
|
507
|
+
id = 'line_' + i;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
data.push({
|
|
511
|
+
id,
|
|
512
|
+
name: I18n.t('New resource') + '_' + i,
|
|
513
|
+
color: '',
|
|
514
|
+
icon: '',
|
|
515
|
+
unit: '',
|
|
516
|
+
price: 0,
|
|
517
|
+
});
|
|
518
|
+
} else {
|
|
519
|
+
// existing line was modifed
|
|
520
|
+
const pos = this.state.data.indexOf(oldData);
|
|
521
|
+
if (pos !== -1) {
|
|
522
|
+
Object.keys(newData).forEach(attr => data[pos][attr] = newData[attr]);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
this.setState({data});
|
|
527
|
+
}}
|
|
528
|
+
onDelete={oldData => {
|
|
529
|
+
console.log('Delete: ' + JSON.stringify(oldData));
|
|
530
|
+
const pos = this.state.data.indexOf(oldData);
|
|
531
|
+
if (pos !== -1) {
|
|
532
|
+
const data = JSON.parse(JSON.stringify(this.state.data));
|
|
533
|
+
data.splice(pos, 1);
|
|
534
|
+
this.setState({data});
|
|
535
|
+
}
|
|
536
|
+
}}
|
|
537
|
+
/>
|
|
538
|
+
</div>;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
#### Toast
|
|
544
|
+
<!-- TODO: Provide screenshot here -->
|
|
545
|
+
|
|
546
|
+
Toast is not a part of `adapter-react` but it is an example how to use toast in application:
|
|
547
|
+
|
|
548
|
+
```
|
|
549
|
+
import Snackbar from '@material-ui/core/Snackbar';
|
|
550
|
+
|
|
551
|
+
class MyComponent {
|
|
552
|
+
constructor(props) {
|
|
553
|
+
super(props);
|
|
554
|
+
this.state = {
|
|
555
|
+
// ....
|
|
556
|
+
toast: '',
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
// ...
|
|
560
|
+
renderToast() {
|
|
561
|
+
if (!this.state.toast) {
|
|
562
|
+
return null;
|
|
563
|
+
}
|
|
564
|
+
return <Snackbar
|
|
565
|
+
anchorOrigin={{
|
|
566
|
+
vertical: 'bottom',
|
|
567
|
+
horizontal: 'left',
|
|
568
|
+
}}
|
|
569
|
+
open={true}
|
|
570
|
+
autoHideDuration={6000}
|
|
571
|
+
onClose={() => this.setState({toast: ''})}
|
|
572
|
+
ContentProps={{'aria-describedby': 'message-id'}}
|
|
573
|
+
message={<span id="message-id">{this.state.toast}</span>}
|
|
574
|
+
action={[
|
|
575
|
+
<IconButton
|
|
576
|
+
key="close"
|
|
577
|
+
aria-label="Close"
|
|
578
|
+
color="inherit"
|
|
579
|
+
className={this.props.classes.close}
|
|
580
|
+
onClick={() => this.setState({toast: ''})}
|
|
581
|
+
>
|
|
582
|
+
<IconClose />
|
|
583
|
+
</IconButton>,
|
|
584
|
+
]}
|
|
585
|
+
/>;
|
|
586
|
+
}
|
|
587
|
+
render() {
|
|
588
|
+
return <div>
|
|
589
|
+
{this.renderToast()}
|
|
590
|
+
</div>;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
## List of adapters that use adapter-react
|
|
596
|
+
- Admin
|
|
597
|
+
- iot
|
|
598
|
+
- echarts
|
|
599
|
+
- text2command
|
|
600
|
+
- scenes
|
|
601
|
+
- javascript
|
|
602
|
+
- devices
|
|
603
|
+
- eventlist
|
|
604
|
+
- cameras
|
|
605
|
+
- web
|
|
606
|
+
- vis-2
|
|
607
|
+
- vis-2-widgets-xxx
|
|
608
|
+
- fullcalendar
|
|
609
|
+
- openweathermap
|
|
610
|
+
|
|
611
|
+
## Usability
|
|
612
|
+
In dialogs, the OK button is first (on the left) and the cancel button is last (on the right)
|
|
613
|
+
|
|
614
|
+
## Used icons
|
|
615
|
+
This project uses icons from [Flaticon](https://www.flaticon.com/).
|
|
616
|
+
|
|
617
|
+
ioBroker GmbH has a valid license for all the used icons.
|
|
618
|
+
The icons may not be reused in other projects without the proper flaticon license or flaticon subscription.
|
|
619
|
+
|
|
620
|
+
## Migration from adapter-react to adapter-react-v5
|
|
621
|
+
### In src/package.json => dependencies
|
|
622
|
+
- `"@iobroker/adapter-react": "^2.0.22",` => `"@iobroker/adapter-react-v5": "^3.1.34",`
|
|
623
|
+
- `"@material-ui/core": "^4.12.3",` => `"@mui/material": "^5.10.9",`
|
|
624
|
+
- `"@material-ui/icons": "^4.11.2",` => `"@mui/icons-material": "^5.10.9",`
|
|
625
|
+
- Add `"@mui/styles": "^5.10.9",`
|
|
626
|
+
- Add `"babel-eslint": "^10.1.0",`
|
|
627
|
+
|
|
628
|
+
### In Source files
|
|
629
|
+
- All `@iobroker/adapter-react/...` => `@iobroker/adapter-react-v5/...`
|
|
630
|
+
- All `@material-ui/icons/...` => `@mui/icons-material/...`
|
|
631
|
+
- Change `import { withStyles } from '@material-ui/core/styles';` => `import { withStyles } from '@mui/styles';`
|
|
632
|
+
- Change `import { makeStyles } from '@mui/material/styles';` => `import { makeStyles } from '@mui/styles';`
|
|
633
|
+
- Change `import withWidth from '@material-ui/core/withWidth';` => `import { withWidth } from '@iobroker/adapter-react-v5';`
|
|
634
|
+
- All `@material-ui/core...` => `@mui/material...`
|
|
635
|
+
- Change `import { MuiThemeProvider } from '@material-ui/core/styles';` => `import { ThemeProvider, StyledEngineProvider } from '@mui/material/styles';`
|
|
636
|
+
- Change all `<MuiThemeProvider theme={this.state.theme}>` to `<StyledEngineProvider injectFirst><ThemeProvider theme={this.state.theme}>`
|
|
637
|
+
- Rename in styles `theme.palette.type` => `theme.palette.mode`
|
|
638
|
+
- Add to all `TextField`, `Select`, `FormControl` the property `variant="standard"`
|
|
639
|
+
- Add to all `Button` that do not have `color` property: `color="grey"`
|
|
640
|
+
- Replace by `TextField` the `readOnly` attribute (if exists) with `InputProps={{readOnly: true}}`
|
|
641
|
+
- Remove px by all `theme.spacing`: `calc(100% - ${theme.spacing(4)}px)` => `calc(100% - ${theme.spacing(4)})`
|
|
642
|
+
- Replace `this.selectTab(e.target.parentNode.dataset.name, index)` => `this.selectTab(e.target.dataset.name, index)`
|
|
643
|
+
|
|
644
|
+
If you still have questions, try to find an answer [here](https://mui.com/guides/migration-v4/).
|
|
645
|
+
|
|
646
|
+
## Migration from adapter-react-v5@3.x to adapter-react-v5@4.x
|
|
647
|
+
- Look for getObjectView socket requests and replace `socket.getObjectView('startKey', 'endKey', 'instance')` to `socket.getObjectViewSystem('instance', 'startKey', 'endKey')`
|
|
648
|
+
- Look for calls of custom like
|
|
649
|
+
```
|
|
650
|
+
this.props.socket._socket.emit('getObjectView', 'system', 'custom', {startKey: '', endKey:'\u9999'}, (err, objs) => {
|
|
651
|
+
(objs?.rows || [])
|
|
652
|
+
.forEach(item => console.log(item.id, item.value));
|
|
653
|
+
});
|
|
654
|
+
```
|
|
655
|
+
to
|
|
656
|
+
```
|
|
657
|
+
socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
|
|
658
|
+
.then(objects => {
|
|
659
|
+
Object.keys(objects).forEach(obj => console.log(obj._id));
|
|
660
|
+
});
|
|
661
|
+
```
|
|
662
|
+
- Replace all `socket.log.error('text')` to `socket.log('text', 'error')`
|
|
663
|
+
- Add to App.js `import { AdminConnection } from '@iobroker/adapter-react-v5';` and `super(props, { Connection: AdminConnection });` if run in admin
|
|
664
|
+
|
|
665
|
+
## Warning
|
|
666
|
+
`react-inlinesvg@4.0.5` cannot be used. Use `react-inlinesvg@4.0.3` instead.
|
|
667
|
+
<!--
|
|
668
|
+
Placeholder for the next version (at the beginning of the line):
|
|
669
|
+
### **WORK IN PROGRESS**
|
|
670
|
+
-->
|
|
671
|
+
|
|
672
|
+
## Changelog
|
|
673
|
+
### 4.13.2 (2024-04-01)
|
|
674
|
+
* (bluefox) used new connection classes
|
|
675
|
+
|
|
676
|
+
### 4.12.3 (2024-03-30)
|
|
677
|
+
* (bluefox) Migrated legacy connection to typescript
|
|
678
|
+
|
|
679
|
+
### 4.12.2 (2024-03-25)
|
|
680
|
+
* (bluefox) Added support for remote cloud
|
|
681
|
+
|
|
682
|
+
### 4.11.6 (2024-03-19)
|
|
683
|
+
* (bluefox) Corrected rendering of LoaderMV
|
|
684
|
+
|
|
685
|
+
### 4.11.4 (2024-03-18)
|
|
686
|
+
* (bluefox) Corrected types of IconPicker
|
|
687
|
+
|
|
688
|
+
### 4.11.3 (2024-03-17)
|
|
689
|
+
* (bluefox) Made filters for the file selector dialog optional
|
|
690
|
+
|
|
691
|
+
### 4.11.2 (2024-03-16)
|
|
692
|
+
* (bluefox) Migrated GenericApp to typescript
|
|
693
|
+
|
|
694
|
+
### 4.10.4 (2024-03-16)
|
|
695
|
+
* (bluefox) Migrated some components to typescript
|
|
696
|
+
|
|
697
|
+
### 4.10.1 (2024-03-11)
|
|
698
|
+
* (bluefox) Migrated some components to typescript
|
|
699
|
+
|
|
700
|
+
### 4.9.11 (2024-03-08)
|
|
701
|
+
* (foxriver76) type GenericApp socket correctly
|
|
702
|
+
|
|
703
|
+
### 4.9.10 (2024-02-21)
|
|
704
|
+
* (bluefox) translations
|
|
705
|
+
* (bluefox) updated json config
|
|
706
|
+
|
|
707
|
+
### 4.9.9 (2024-02-16)
|
|
708
|
+
* (foxriver76) also check plugin state of instance to see if Sentry is explicitly disabled
|
|
709
|
+
|
|
710
|
+
### 4.9.8 (2024-02-13)
|
|
711
|
+
* (bluefox) allowed hiding wizard in cron dialog
|
|
712
|
+
|
|
713
|
+
### 4.9.7 (2024-02-03)
|
|
714
|
+
* (foxriver76) allow passing down the instance number do avoid determining from url
|
|
715
|
+
|
|
716
|
+
### 4.9.5 (2024-01-01)
|
|
717
|
+
* (foxriver76) make `copyToClipboard` event parameter optional
|
|
718
|
+
|
|
719
|
+
### 4.9.4 (2024-01-01)
|
|
720
|
+
* (foxriver76) try to fix `SelectID` scrolling
|
|
721
|
+
|
|
722
|
+
### 4.9.2 (2023-12-30)
|
|
723
|
+
* (foxriver76) bump version of `@iobroker/json-config`
|
|
724
|
+
|
|
725
|
+
### 4.9.1 (2023-12-22)
|
|
726
|
+
* (foxriver76) `@iobroker/json-config` moved to real dependencies
|
|
727
|
+
|
|
728
|
+
### 4.9.0 (2023-12-22)
|
|
729
|
+
* (foxriver76) migrate to `@iobroker/json-config` module to have a single point of truth
|
|
730
|
+
* (bluefox) Allowed using of `filterFunc` as string
|
|
731
|
+
|
|
732
|
+
### 4.8.1 (2023-12-14)
|
|
733
|
+
* (bluefox) Added Device manager to JSON Config
|
|
734
|
+
|
|
735
|
+
### 4.7.15 (2023-12-12)
|
|
736
|
+
* (bluefox) Corrected parsing of a text
|
|
737
|
+
|
|
738
|
+
### 4.7.13 (2023-12-10)
|
|
739
|
+
* (bluefox) Added possibility to define the root style and embedded property
|
|
740
|
+
|
|
741
|
+
### 4.7.11 (2023-12-06)
|
|
742
|
+
* (bluefox) Extended color picker with "noInputField" option
|
|
743
|
+
|
|
744
|
+
### 4.7.9 (2023-12-04)
|
|
745
|
+
* (bluefox) Corrected the icon picker
|
|
746
|
+
|
|
747
|
+
### 4.7.8 (2023-12-04)
|
|
748
|
+
* (foxriver76) port to `@iobroker/types`
|
|
749
|
+
|
|
750
|
+
### 4.7.6 (2023-11-29)
|
|
751
|
+
* (bluefox) Added translations
|
|
752
|
+
|
|
753
|
+
### 4.7.5 (2023-11-28)
|
|
754
|
+
* (bluefox) Corrected subscribe on objects in the legacy connection
|
|
755
|
+
|
|
756
|
+
### 4.7.4 (2023-11-23)
|
|
757
|
+
* (bluefox) Updated packages
|
|
758
|
+
* (bluefox) Made getStates method in legacy connection compatible with new one
|
|
759
|
+
|
|
760
|
+
### 4.7.3 (2023-11-08)
|
|
761
|
+
* (bluefox) Updated packages
|
|
762
|
+
|
|
763
|
+
### 4.7.2 (2023-11-03)
|
|
764
|
+
* (foxriver76) fixed problem with color picker, where editing TextField was buggy
|
|
765
|
+
* (foxriver76) fixed light mode color of a path in FileBrowser
|
|
766
|
+
|
|
767
|
+
### 4.7.0 (2023-10-31)
|
|
768
|
+
* (bluefox) Synced with admin
|
|
769
|
+
* (bluefox) Added GIF to image files
|
|
770
|
+
|
|
771
|
+
### 4.6.7 (2023-10-19)
|
|
772
|
+
* (bluefox) Added return value for `subscribeOnInstance` for Connection class
|
|
773
|
+
|
|
774
|
+
### 4.6.6 (2023-10-13)
|
|
775
|
+
* (bluefox) Fixed the legacy connection
|
|
776
|
+
|
|
777
|
+
### 4.6.5 (2023-10-12)
|
|
778
|
+
* (foxriver76) fixed object browser with date
|
|
779
|
+
|
|
780
|
+
### 4.6.4 (2023-10-11)
|
|
781
|
+
* (bluefox) Updated the packages
|
|
782
|
+
|
|
783
|
+
### 4.6.3 (2023-10-09)
|
|
784
|
+
* (bluefox) Just updated the packages
|
|
785
|
+
* (bluefox) Synced with admin
|
|
786
|
+
|
|
787
|
+
### 4.6.2 (2023-09-29)
|
|
788
|
+
* (bluefox) Experimental feature added: update states on re-subscribe
|
|
789
|
+
|
|
790
|
+
### 4.5.5 (2023-09-27)
|
|
791
|
+
* (bluefox) Added export for IconNoIcon
|
|
792
|
+
|
|
793
|
+
### 4.5.4 (2023-09-17)
|
|
794
|
+
* (bluefox) Added the restricting to folder property for select file dialog
|
|
795
|
+
|
|
796
|
+
### 4.5.3 (2023-08-20)
|
|
797
|
+
* (foxriver76) fixed css classes of TableResize, see https://github.com/ioBroker/ioBroker.admin/issues/1860
|
|
798
|
+
|
|
799
|
+
### 4.5.2 (2023-08-20)
|
|
800
|
+
* (foxriver76) added missing export of TableResize
|
|
801
|
+
|
|
802
|
+
### 4.5.1 (2023-08-19)
|
|
803
|
+
* (foxriver76) fix dialog TextInput
|
|
804
|
+
|
|
805
|
+
### 4.5.0 (2023-08-18)
|
|
806
|
+
* (bluefox) Synchronize components with admin
|
|
807
|
+
|
|
808
|
+
### 4.4.8 (2023-08-17)
|
|
809
|
+
* (bluefox) Added translations
|
|
810
|
+
|
|
811
|
+
### 4.4.7 (2023-08-10)
|
|
812
|
+
* (bluefox) Added `subscribeStateAsync` method to wait for answer
|
|
813
|
+
* (bluefox) Added support for arrays for un/subscriptions
|
|
814
|
+
|
|
815
|
+
### 4.4.5 (2023-08-01)
|
|
816
|
+
* (bluefox) Updated packages
|
|
817
|
+
|
|
818
|
+
### 4.3.3 (2023-07-28)
|
|
819
|
+
* (bluefox) Added translations
|
|
820
|
+
|
|
821
|
+
### 4.3.0 (2023-07-19)
|
|
822
|
+
* (bluefox) Updated packages
|
|
823
|
+
* (bluefox) Added translations
|
|
824
|
+
* (bluefox) Synced object browser
|
|
825
|
+
* (bluefox) formatting
|
|
826
|
+
|
|
827
|
+
### 4.2.1 (2023-07-17)
|
|
828
|
+
* (bluefox) Updated packages
|
|
829
|
+
* (bluefox) Added translations
|
|
830
|
+
|
|
831
|
+
### 4.2.0 (2023-07-07)
|
|
832
|
+
* (bluefox) Updated packages
|
|
833
|
+
* (bluefox) Added new method `getObjectsById` to the socket communication
|
|
834
|
+
|
|
835
|
+
### 4.1.2 (2023-06-20)
|
|
836
|
+
* (bluefox) Allowed setting theme name directly by theme toggle
|
|
837
|
+
|
|
838
|
+
### 4.1.0 (2023-05-10)
|
|
839
|
+
* (bluefox) `craco-module-federation.js` was added. For node 16
|
|
840
|
+
|
|
841
|
+
### 4.0.27 (2023-05-09)
|
|
842
|
+
* (bluefox) Allowed showing only specific root in SelectIDDialog
|
|
843
|
+
|
|
844
|
+
### 4.0.26 (2023-05-08)
|
|
845
|
+
* (bluefox) Added IDs to the buttons in the dialog for GUI tests
|
|
846
|
+
|
|
847
|
+
### 4.0.25 (2023-04-23)
|
|
848
|
+
* (bluefox) Extended `TextWithIcon` with defined color and icon
|
|
849
|
+
|
|
850
|
+
### 4.0.24 (2023-04-03)
|
|
851
|
+
* (bluefox) Updated the file selector in tile mode
|
|
852
|
+
|
|
853
|
+
### 4.0.23 (2023-03-27)
|
|
854
|
+
* (bluefox) Added translations
|
|
855
|
+
|
|
856
|
+
### 4.0.22 (2023-03-22)
|
|
857
|
+
* (bluefox) Re-Activate legacy connection
|
|
858
|
+
|
|
859
|
+
### 4.0.21 (2023-03-22)
|
|
860
|
+
* (bluefox) Added translations
|
|
861
|
+
|
|
862
|
+
### 4.0.20 (2023-03-21)
|
|
863
|
+
* (bluefox) Color picker was improved
|
|
864
|
+
|
|
865
|
+
### 4.0.19 (2023-03-20)
|
|
866
|
+
* (bluefox) Packages were updated
|
|
867
|
+
* (bluefox) Added new translations
|
|
868
|
+
|
|
869
|
+
### 4.0.18 (2023-03-16)
|
|
870
|
+
* (bluefox) Packages were updated
|
|
871
|
+
|
|
872
|
+
### 4.0.17 (2023-03-15)
|
|
873
|
+
* (bluefox) Added translations
|
|
874
|
+
* (bluefox) Added port controller to JSON config
|
|
875
|
+
|
|
876
|
+
### 4.0.15 (2023-03-12)
|
|
877
|
+
* (bluefox) Updated the object browser and file browser
|
|
878
|
+
|
|
879
|
+
### 4.0.14 (2023-03-03)
|
|
880
|
+
* (bluefox) added handler of alert messages
|
|
881
|
+
|
|
882
|
+
### 4.0.13 (2023-02-15)
|
|
883
|
+
* (bluefox) Corrected the theme button
|
|
884
|
+
|
|
885
|
+
### 4.0.12 (2023-02-15)
|
|
886
|
+
* (bluefox) made the fix for `echarts`
|
|
887
|
+
|
|
888
|
+
### 4.0.11 (2023-02-14)
|
|
889
|
+
* (bluefox) Updated packages
|
|
890
|
+
* (bluefox) The `chartReady` event was omitted
|
|
891
|
+
|
|
892
|
+
### 4.0.10 (2023-02-10)
|
|
893
|
+
* (bluefox) Updated packages
|
|
894
|
+
* (bluefox) made the fix for `material`
|
|
895
|
+
|
|
896
|
+
### 4.0.9 (2023-02-02)
|
|
897
|
+
* (bluefox) Updated packages
|
|
898
|
+
|
|
899
|
+
### 4.0.8 (2022-12-19)
|
|
900
|
+
* (bluefox) Extended socket with `log` command
|
|
901
|
+
|
|
902
|
+
### 4.0.6 (2022-12-19)
|
|
903
|
+
* (bluefox) Corrected URL for the connection
|
|
904
|
+
|
|
905
|
+
### 4.0.5 (2022-12-14)
|
|
906
|
+
* (bluefox) Added support of custom palette for color picker
|
|
907
|
+
|
|
908
|
+
### 4.0.2 (2022-12-01)
|
|
909
|
+
* (bluefox) use `@iobroker/socket-client` instead of `Connection.js`
|
|
910
|
+
|
|
911
|
+
### 3.5.3 (2022-11-30)
|
|
912
|
+
* (bluefox) Improved `renderTextWithA` function to support `<b>` and `<i>` tags
|
|
913
|
+
|
|
914
|
+
### 3.5.2 (2022-11-30)
|
|
915
|
+
* (bluefox) updated json config component
|
|
916
|
+
|
|
917
|
+
### 3.4.1 (2022-11-29)
|
|
918
|
+
* (bluefox) Added button text for message dialog
|
|
919
|
+
|
|
920
|
+
### 3.4.0 (2022-11-29)
|
|
921
|
+
* (bluefox) Added file selector
|
|
922
|
+
|
|
923
|
+
### 3.3.0 (2022-11-26)
|
|
924
|
+
* (bluefox) Added subscribe on files
|
|
925
|
+
|
|
926
|
+
### 3.2.7 (2022-11-13)
|
|
927
|
+
* (bluefox) Added `fullWidth` property to `Dialog`
|
|
928
|
+
|
|
929
|
+
### 3.2.6 (2022-11-08)
|
|
930
|
+
* (xXBJXx) Improved TreeTable component
|
|
931
|
+
|
|
932
|
+
### 3.2.5 (2022-11-08)
|
|
933
|
+
* (bluefox) Added the role filter for the object browser
|
|
934
|
+
|
|
935
|
+
### 3.2.4 (2022-11-03)
|
|
936
|
+
* (bluefox) Added support for alfa channel for `invertColor`
|
|
937
|
+
|
|
938
|
+
### 3.2.3 (2022-10-26)
|
|
939
|
+
* (bluefox) Corrected expert mode for object browser
|
|
940
|
+
|
|
941
|
+
### 3.2.2 (2022-10-25)
|
|
942
|
+
* (bluefox) Added support for prefixes for translations
|
|
943
|
+
|
|
944
|
+
### 3.2.1 (2022-10-24)
|
|
945
|
+
* (bluefox) Corrected color inversion
|
|
946
|
+
|
|
947
|
+
### 3.2.0 (2022-10-19)
|
|
948
|
+
* (bluefox) Added ukrainian translation
|
|
949
|
+
|
|
950
|
+
### 3.1.35 (2022-10-17)
|
|
951
|
+
* (bluefox) small changes for material
|
|
952
|
+
|
|
953
|
+
### 3.1.34 (2022-08-24)
|
|
954
|
+
* (bluefox) Implemented fallback to english by translations
|
|
955
|
+
|
|
956
|
+
### 3.1.33 (2022-08-24)
|
|
957
|
+
* (bluefox) Added support for onchange flag
|
|
958
|
+
|
|
959
|
+
### 3.1.30 (2022-08-23)
|
|
960
|
+
* (bluefox) Added method `getCompactSystemRepositories`
|
|
961
|
+
* (bluefox) corrected error in `ObjectBrowser`
|
|
962
|
+
|
|
963
|
+
### 3.1.27 (2022-08-01)
|
|
964
|
+
* (bluefox) Disable file editing in FileViewer
|
|
965
|
+
|
|
966
|
+
### 3.1.26 (2022-08-01)
|
|
967
|
+
* (bluefox) Added translations
|
|
968
|
+
* (bluefox) JSON schema was extended with missing definitions
|
|
969
|
+
|
|
970
|
+
### 3.1.24 (2022-07-28)
|
|
971
|
+
* (bluefox) Updated file browser and object browser
|
|
972
|
+
|
|
973
|
+
### 3.1.23 (2022-07-25)
|
|
974
|
+
* (bluefox) Extend custom filter for object selector
|
|
975
|
+
|
|
976
|
+
### 3.1.22 (2022-07-22)
|
|
977
|
+
* (bluefox) Added i18n tools for development
|
|
978
|
+
|
|
979
|
+
### 3.1.20 (2022-07-14)
|
|
980
|
+
* (bluefox) Allowed to show select dialog with the expert mode enabled
|
|
981
|
+
|
|
982
|
+
### 3.1.19 (2022-07-08)
|
|
983
|
+
* (bluefox) Allowed extending translations for all languages together
|
|
984
|
+
|
|
985
|
+
### 3.1.18 (2022-07-06)
|
|
986
|
+
* (bluefox) Added translation
|
|
987
|
+
|
|
988
|
+
### 3.1.17 (2022-07-05)
|
|
989
|
+
* (bluefox) Deactivate JSON editor for JSONConfig because of space
|
|
990
|
+
|
|
991
|
+
### 3.1.16 (2022-06-27)
|
|
992
|
+
* (bluefox) Update object browser
|
|
993
|
+
|
|
994
|
+
### 3.1.15 (2022-06-27)
|
|
995
|
+
* (bluefox) Allowed using of spaces in name
|
|
996
|
+
|
|
997
|
+
### 3.1.14 (2022-06-23)
|
|
998
|
+
* (bluefox) Added translations
|
|
999
|
+
|
|
1000
|
+
### 3.1.11 (2022-06-22)
|
|
1001
|
+
* (bluefox) Added preparations for iobroker cloud
|
|
1002
|
+
|
|
1003
|
+
### 3.1.10 (2022-06-22)
|
|
1004
|
+
* (bluefox) Added translations
|
|
1005
|
+
|
|
1006
|
+
### 3.1.9 (2022-06-20)
|
|
1007
|
+
* (bluefox) Allowed working behind reverse proxy
|
|
1008
|
+
|
|
1009
|
+
### 3.1.7 (2022-06-19)
|
|
1010
|
+
* (bluefox) Added file select dialog
|
|
1011
|
+
|
|
1012
|
+
### 3.1.3 (2022-06-13)
|
|
1013
|
+
* (bluefox) Added table with resized headers
|
|
1014
|
+
|
|
1015
|
+
### 3.1.2 (2022-06-09)
|
|
1016
|
+
* (bluefox) Added new document icon (read only)
|
|
1017
|
+
|
|
1018
|
+
### 3.1.1 (2022-06-09)
|
|
1019
|
+
* (bluefox) Allowed working behind reverse proxy
|
|
1020
|
+
|
|
1021
|
+
### 3.1.0 (2022-06-07)
|
|
1022
|
+
* (bluefox) Some german texts were corrected
|
|
1023
|
+
|
|
1024
|
+
### 3.0.17 (2022-06-03)
|
|
1025
|
+
* (bluefox) Allowed calling getAdapterInstances not for admin too
|
|
1026
|
+
|
|
1027
|
+
### 3.0.15 (2022-06-01)
|
|
1028
|
+
* (bluefox) Updated JsonConfigComponent: password, table
|
|
1029
|
+
|
|
1030
|
+
### 3.0.14 (2022-05-25)
|
|
1031
|
+
* (bluefox) Added ConfigGeneric to import
|
|
1032
|
+
|
|
1033
|
+
### 3.0.7 (2022-05-25)
|
|
1034
|
+
* (bluefox) Made the module definitions
|
|
1035
|
+
|
|
1036
|
+
### 3.0.6 (2022-05-25)
|
|
1037
|
+
* (bluefox) Added JsonConfigComponent
|
|
1038
|
+
|
|
1039
|
+
### 2.1.11 (2022-05-24)
|
|
1040
|
+
* (bluefox) Update file browser. It supports now the file changed events.
|
|
1041
|
+
|
|
1042
|
+
### 2.1.10 (2022-05-24)
|
|
1043
|
+
* (bluefox) Corrected object browser
|
|
1044
|
+
|
|
1045
|
+
### 2.1.9 (2022-05-16)
|
|
1046
|
+
* (bluefox) Corrected expert mode in object browser
|
|
1047
|
+
|
|
1048
|
+
### 2.1.7 (2022-05-09)
|
|
1049
|
+
* (bluefox) Changes were synchronized with adapter-react-v5
|
|
1050
|
+
* (bluefox) Added `I18n.disableWarning` method
|
|
1051
|
+
|
|
1052
|
+
### 2.1.6 (2022-03-28)
|
|
1053
|
+
* (bluefox) Added `log` method to connection
|
|
1054
|
+
* (bluefox) Corrected translations
|
|
1055
|
+
|
|
1056
|
+
### 2.1.1 (2022-03-27)
|
|
1057
|
+
* (bluefox) Corrected error in TreeTable
|
|
1058
|
+
|
|
1059
|
+
### 2.1.0 (2022-03-26)
|
|
1060
|
+
* (bluefox) BREAKING_CHANGE: Corrected error with readFile(base64=false)
|
|
1061
|
+
|
|
1062
|
+
### 2.0.0 (2022-03-26)
|
|
1063
|
+
* (bluefox) Initial version
|
|
1064
|
+
|
|
1065
|
+
### 0.1.0 (2022-03-23)
|
|
1066
|
+
* (bluefox) Fixed theme errors
|
|
1067
|
+
|
|
1068
|
+
### 0.0.4 (2022-03-22)
|
|
1069
|
+
* (bluefox) Fixed eslint warnings
|
|
1070
|
+
|
|
1071
|
+
### 0.0.3 (2022-03-19)
|
|
1072
|
+
* (bluefox) beta version
|
|
1073
|
+
|
|
1074
|
+
### 0.0.2 (2022-02-24)
|
|
1075
|
+
* (bluefox) try to publish a first version
|
|
1076
|
+
|
|
1077
|
+
### 0.0.1 (2022-02-24)
|
|
1078
|
+
* initial commit
|
|
1079
|
+
|
|
1080
|
+
## License
|
|
1081
|
+
The MIT License (MIT)
|
|
1082
|
+
|
|
1083
|
+
Copyright (c) 2019-2024 bluefox <dogafox@gmail.com>
|
|
1084
|
+
|
|
1085
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1086
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
1087
|
+
in the Software without restriction, including without limitation the rights
|
|
1088
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1089
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
1090
|
+
furnished to do so, subject to the following conditions:
|
|
1091
|
+
|
|
1092
|
+
The above copyright notice and this permission notice shall be included in all
|
|
1093
|
+
copies or substantial portions of the Software.
|
|
1094
|
+
|
|
1095
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1096
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1097
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1098
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1099
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1100
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1101
|
+
SOFTWARE.
|