iobroker.admin 7.4.0 → 7.4.1
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/README.md +107 -108
- package/adminWww/asset-manifest.json +21 -21
- package/adminWww/index.html +1 -1
- package/adminWww/static/js/{1193.99579f17.chunk.js → 1193.f78c91c7.chunk.js} +2 -2
- package/adminWww/static/js/1193.f78c91c7.chunk.js.map +1 -0
- package/adminWww/static/js/288.8fd137b7.chunk.js.map +1 -1
- package/adminWww/static/js/4720.f547d551.chunk.js +2 -0
- package/adminWww/static/js/4720.f547d551.chunk.js.map +1 -0
- package/adminWww/static/js/5139.bc9ec1cd.chunk.js.LICENSE.txt +1 -1
- package/adminWww/static/js/591.675e66af.chunk.js +2 -0
- package/adminWww/static/js/{591.1a92eff9.chunk.js.map → 591.675e66af.chunk.js.map} +1 -1
- package/adminWww/static/js/{6853.398f32f8.chunk.js → 6853.be661c6e.chunk.js} +2 -2
- package/adminWww/static/js/6853.be661c6e.chunk.js.map +1 -0
- package/adminWww/static/js/{422.897485de.chunk.js → 706.20143240.chunk.js} +2 -2
- package/adminWww/static/js/706.20143240.chunk.js.map +1 -0
- package/adminWww/static/js/{7931.38a8acbc.chunk.js → 7931.5fd9faf0.chunk.js} +3 -3
- package/adminWww/static/js/7931.5fd9faf0.chunk.js.map +1 -0
- package/adminWww/static/js/921.f7fc8142.chunk.js +3 -0
- package/adminWww/static/js/921.f7fc8142.chunk.js.map +1 -0
- package/adminWww/static/js/{9228.4d6ceaef.chunk.js → 9228.e34a369b.chunk.js} +4 -4
- package/adminWww/static/js/9228.e34a369b.chunk.js.map +1 -0
- package/adminWww/static/js/{9731.81eb2531.chunk.js → 9731.49fa7804.chunk.js} +3 -3
- package/adminWww/static/js/{9731.81eb2531.chunk.js.map → 9731.49fa7804.chunk.js.map} +1 -1
- package/adminWww/static/js/{main.580afe3b.js → main.d185596b.js} +2 -2
- package/adminWww/static/js/{main.580afe3b.js.map → main.d185596b.js.map} +1 -1
- package/io-package.json +14 -14
- package/package.json +4 -4
- package/adminWww/static/js/1193.99579f17.chunk.js.map +0 -1
- package/adminWww/static/js/422.897485de.chunk.js.map +0 -1
- package/adminWww/static/js/4720.a3767f97.chunk.js +0 -2
- package/adminWww/static/js/4720.a3767f97.chunk.js.map +0 -1
- package/adminWww/static/js/591.1a92eff9.chunk.js +0 -2
- package/adminWww/static/js/6853.398f32f8.chunk.js.map +0 -1
- package/adminWww/static/js/7931.38a8acbc.chunk.js.map +0 -1
- package/adminWww/static/js/921.aa5491a4.chunk.js +0 -3
- package/adminWww/static/js/921.aa5491a4.chunk.js.map +0 -1
- package/adminWww/static/js/9228.4d6ceaef.chunk.js.map +0 -1
- /package/adminWww/static/js/{7931.38a8acbc.chunk.js.LICENSE.txt → 7931.5fd9faf0.chunk.js.LICENSE.txt} +0 -0
- /package/adminWww/static/js/{921.aa5491a4.chunk.js.LICENSE.txt → 921.f7fc8142.chunk.js.LICENSE.txt} +0 -0
- /package/adminWww/static/js/{9228.4d6ceaef.chunk.js.LICENSE.txt → 9228.e34a369b.chunk.js.LICENSE.txt} +0 -0
- /package/adminWww/static/js/{9731.81eb2531.chunk.js.LICENSE.txt → 9731.49fa7804.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunksrc_rx=self.webpackChunksrc_rx||[]).push([[4720],{84720:(e,t,s)=>{s.r(t),s.d(t,{default:()=>E});var o=s(29183),i=s(89303),n=s(32075),r=s(16904),l=s(79159);function a(e){const{tooltip:t,label:s,disabled:o,Icon:n,onClick:r}=e,a=!!s&&(0,l.jsx)(i.Typography,{variant:"button",style:{marginLeft:4},children:s});return t?(0,l.jsx)(i.Tooltip,{title:t,slotProps:{popper:{sx:{pointerEvents:"none"}}},children:(0,l.jsx)("span",{children:(0,l.jsxs)(i.IconButton,{onClick:r,disabled:o,size:"small",children:[n,a]})})}):(0,l.jsxs)(i.IconButton,{onClick:r,disabled:o,size:"small",children:[n,a]})}function c(e,t){const s=e.split(" ").map((e=>e.trim())).filter((e=>"fa-solid"!==e));return s.includes("fa-trash-can")||s.includes("fa-trash")?(0,l.jsx)(n.Delete,{style:{color:t}}):s.includes("fa-pen")?(0,l.jsx)(n.Edit,{style:{color:t}}):s.includes("fa-redo-alt")?(0,l.jsx)(n.Refresh,{style:{color:t}}):s.includes("fa-plus")?(0,l.jsx)(n.Add,{style:{color:t}}):s.includes("fa-qrcode")||s.includes("qrcode")?(0,l.jsx)(n.QrCode,{style:{color:t}}):s.includes("fa-wifi")?(0,l.jsx)(n.Wifi,{style:{color:t}}):s.includes("fa-wifi-slash")?(0,l.jsx)(n.WifiOff,{style:{color:t}}):s.includes("fa-bluetooth")?(0,l.jsx)(n.Bluetooth,{style:{color:t}}):s.includes("fa-bluetooth-slash")?(0,l.jsx)(n.BluetoothDisabled,{style:{color:t}}):s.includes("fa-eye")?(0,l.jsx)(n.Visibility,{style:{color:t}}):s.includes("fa-search")?(0,l.jsx)(n.Search,{style:{color:t}}):s.includes("fa-unlink")?(0,l.jsx)(n.LinkOff,{style:{color:t}}):s.includes("fa-link")?(0,l.jsx)(n.Link,{style:{color:t}}):s.includes("fa-search-location")?(0,l.jsx)(n.NotListedLocation,{style:{color:t}}):s.includes("fa-play")?(0,l.jsx)(n.PlayArrow,{style:{color:t}}):s.includes("fa-stop")?(0,l.jsx)(n.Stop,{style:{color:t}}):s.includes("fa-pause")?(0,l.jsx)(n.Pause,{style:{color:t}}):s.includes("forward")?(0,l.jsx)(n.FastForward,{style:{color:t}}):s.includes("rewind")?(0,l.jsx)(n.FastRewind,{style:{color:t}}):s.includes("users")||s.includes("group")?(0,l.jsx)(n.Group,{style:{color:t}}):s.includes("user")?(0,l.jsx)(n.Person,{style:{color:t}}):(0,l.jsx)(n.QuestionMark,{style:{color:t}})}function d(e,t,s){return"edit"===e||"rename"===e||"edit"===t||"rename"===t?(0,l.jsx)(n.Edit,{style:{color:s}}):"delete"===e||"delete"===t?(0,l.jsx)(n.Delete,{style:{color:s}}):"refresh"===e||"refresh"===t?(0,l.jsx)(n.Refresh,{style:{color:s}}):"newDevice"===e||"new"===e||"add"===e||"newDevice"===t||"new"===t||"add"===t?(0,l.jsx)(n.Add,{style:{color:s}}):"discover"===e||"search"===e||"discover"===t||"search"===t?(0,l.jsx)(n.Search,{style:{color:s}}):"unpairDevice"===e||"unpair"===e||"unpairDevice"===t||"unpair"===t?(0,l.jsx)(n.LinkOff,{style:{color:s}}):"pairDevice"===e||"pair"===e||"pairDevice"===t||"pair"===t?(0,l.jsx)(n.Link,{style:{color:s}}):"identify"===e||"identify"===t?(0,l.jsx)(n.NotListedLocation,{style:{color:s}}):"play"===e||"play"===t?(0,l.jsx)(n.PlayArrow,{style:{color:s}}):"stop"===e||"stop"===t?(0,l.jsx)(n.Stop,{style:{color:s}}):"pause"===e||"pause"===t?(0,l.jsx)(n.Pause,{style:{color:s}}):"forward"===e||"next"===e||"forward"===t||"next"===t?(0,l.jsx)(n.FastForward,{style:{color:s}}):"rewind"===e||"previous"===e||"rewind"===t||"previous"===t?(0,l.jsx)(n.FastRewind,{style:{color:s}}):"lamp"===e||"light"===e||"lamp"===t||"light"===t?(0,l.jsx)(n.Lightbulb,{style:{color:s}}):"backlight"===e||"backlight"===t?(0,l.jsx)(n.Fluorescent,{style:{color:s}}):"dimmer"===e||"dimmer"===t?(0,l.jsx)(n.WbIncandescent,{style:{color:s}}):"socket"===e||"socket"===t?(0,l.jsx)(n.Power,{style:{color:s}}):"settings"===e||"settings"===t?(0,l.jsx)(n.Settings,{style:{color:s}}):"users"===e||"group"===e||"users"===t||"group"===t?(0,l.jsx)(n.Group,{style:{color:s}}):"user"===e||"user"===t?(0,l.jsx)(n.Person,{style:{color:s}}):"qrcode"===e||"qrcode"===t?(0,l.jsx)(n.QrCode,{style:{color:s}}):"identify"===e||"identify"===t?(0,l.jsx)(n.WifiFind,{style:{color:s}}):"info"===e||"info"===t?(0,l.jsx)(n.Info,{style:{color:s}}):(0,l.jsx)(n.QuestionMark,{style:{color:s}})}function p(e,t,s){var o,i,n,a;if(!e)return null;let p=s&&e.colorOn||e.color||(e.state?"primary":"inherit");return t&&("primary"===p?p=t.primary:"secondary"===p&&(p=t.secondary)),null!==(o=e.icon)&&void 0!==o&&o.startsWith("fa-")||null!==(i=e.icon)&&void 0!==i&&i.startsWith("fas")?c(e.icon,p):s&&null!==(n=e.iconOn)&&void 0!==n&&n.startsWith("data:image")?(0,l.jsx)(r.Icon,{src:e.iconOn,style:{color:p}}):null!==(a=e.icon)&&void 0!==a&&a.startsWith("data:image")?(0,l.jsx)(r.Icon,{src:e.icon,style:{color:p}}):d(e.id,e.icon,p)}function h(e){var t,s,o;return e?null!==(t=e.icon)&&void 0!==t&&t.startsWith("fa-")||null!==(s=e.icon)&&void 0!==s&&s.startsWith("fas")?c(e.icon,e.color):null!==(o=e.icon)&&void 0!==o&&o.startsWith("data:image")?(0,l.jsx)(r.Icon,{src:e.icon,style:{color:e.color}}):d(e.id,e.icon,e.color):null}let u;function x(e){return u=u||r.I18n.getLanguage(),"object"===typeof e?e[u]||e.en:r.I18n.t(e)}function m(e){var t;const{deviceId:s,action:o,refresh:i,deviceHandler:n,disabled:r}=e,c=h(o),d=x(null!==(t=o.description)&&void 0!==t?t:"")||(c?null:o.id);return(0,l.jsx)(a,{tooltip:d||void 0,disabled:r||o.disabled,Icon:c,onClick:n(s,o,i)})}class v extends o.Component{constructor(e){var t,s;super(e),this.stateHandler=async(e,t)=>{if(e===this.props.control.stateId&&t){const e=await this.props.controlStateHandler(this.props.deviceId,this.props.control)();null!==e&&void 0!==e&&e.ts&&(!this.state.ts||e.ts>this.state.ts)&&this.setState({value:e.val,ts:e.ts})}},this.state={value:null===(t=e.control.state)||void 0===t?void 0:t.val,ts:null===(s=e.control.state)||void 0===s?void 0:s.ts}}async componentDidMount(){if(this.props.control.stateId){const e=this.props.socket.subscribeState(this.props.control.stateId,this.stateHandler);e instanceof Promise&&await e}}componentWillUnmount(){this.props.control.stateId&&this.props.socket.unsubscribeState(this.props.control.stateId,this.stateHandler)}static getDerivedStateFromProps(e,t){var s,o;return null!==(s=e.control.state)&&void 0!==s&&s.ts&&(!t.ts||(null===(o=e.control.state)||void 0===o?void 0:o.ts)>t.ts)?{value:e.control.state.val,ts:e.control.state.ts}:null}async sendControl(e,t,s){const o=await this.props.controlHandler(e,t,s)();null!==o&&void 0!==o&&o.ts&&(!this.state.ts||(null===o||void 0===o?void 0:o.ts)>this.state.ts)&&this.setState({value:o.val,ts:o.ts})}renderButton(){var e;const t=x(null!==(e=this.props.control.description)&&void 0!==e?e:""),s=p(this.props.control,this.props.colors,this.state.value);return this.props.control.label?(0,l.jsx)(i.Button,{disabled:this.props.disabled,title:t,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!0),startIcon:s,children:x(this.props.control.label)}):(0,l.jsx)(i.Fab,{size:"small",disabled:this.props.disabled,title:t,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!0),children:s})}renderSwitch(){var e;const t=x(null!==(e=this.props.control.description)&&void 0!==e?e:"");return(0,l.jsx)(i.Switch,{disabled:this.props.disabled,title:t,checked:!!this.state.value,onChange:e=>this.sendControl(this.props.deviceId,this.props.control,e.target.checked)})}getColor(){let e;return this.state.value?e=this.props.control.colorOn||"primary":"switch"===this.props.control.type&&(e=this.props.control.color),"primary"===e?this.props.colors.primary:"secondary"===e?this.props.colors.secondary:e}renderSelect(){return null}renderSlider(){return null}renderColor(){return null}renderIcon(){var e;const t=x(null!==(e=this.props.control.description)&&void 0!==e?e:""),s=p(this.props.control,this.props.colors,this.state.value),o=this.getColor(),n=o===this.props.colors.primary||o===this.props.colors.secondary?{}:{color:o},r=o===this.props.colors.primary?"primary":o===this.props.colors.secondary?"secondary":void 0;return this.props.control.label?(0,l.jsx)(i.Button,{disabled:this.props.disabled,title:t,color:r,style:n,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!this.state.value),startIcon:s,children:x(this.props.control.label)}):(n.width=34,n.height=34,n.minHeight=34,(0,l.jsx)(i.Fab,{disabled:this.props.disabled,size:"small",title:t,color:r,style:n,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!this.state.value),children:s}))}render(){return"button"===this.props.control.type?this.renderButton():"icon"===this.props.control.type?this.renderIcon():"switch"===this.props.control.type?this.renderSwitch():(0,l.jsx)("div",{style:{color:"red"},children:this.props.control.type})}}const f={tooltip:{pointerEvents:"none"}};function g(e){if(!e.status)return null;let t;t="string"===typeof e.status?{connection:e.status}:e.status;const s={fill:"#00ac00"},o={fill:"#ff0000"},r={fill:"#ff9900"};let a=null;return"number"===typeof t.battery&&(a=t.battery>=96&&t.battery<=100?(0,l.jsx)(n.BatteryFull,{style:s}):t.battery>=90&&t.battery<=95?(0,l.jsx)(n.Battery90,{style:s}):t.battery>=80&&t.battery<=89?(0,l.jsx)(n.Battery80,{style:s}):t.battery>=60&&t.battery<=79?(0,l.jsx)(n.Battery60,{style:s}):t.battery>=50&&t.battery<=59?(0,l.jsx)(n.Battery50,{style:s}):t.battery>=30&&t.battery<=49?(0,l.jsx)(n.Battery30,{style:s}):t.battery>=20&&t.battery<=29?(0,l.jsx)(n.Battery20,{style:o}):(0,l.jsx)(n.BatteryAlert,{style:o})),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:["connected"===t.connection&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,l.jsx)(i.Tooltip,{title:x("connectedIconTooltip"),slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:(0,l.jsx)(n.Link,{style:s})})})}),"disconnected"===t.connection&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,l.jsx)(i.Tooltip,{title:x("disconnectedIconTooltip"),slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:(0,l.jsx)(n.LinkOff,{style:o})})})}),t.rssi&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,l.jsx)(i.Tooltip,{title:"RSSI",slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,l.jsx)(n.NetworkCheck,{}),(0,l.jsx)("p",{style:{fontSize:"small",margin:0},children:t.rssi})]})})}),"number"===typeof t.battery&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,l.jsx)(i.Tooltip,{title:x("batteryTooltip"),slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[a,(0,l.jsxs)("p",{style:{fontSize:"small",margin:0},children:[t.battery,"%"]})]})})}),"string"===typeof t.battery&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,l.jsx)(i.Tooltip,{title:x("batteryTooltip"),slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:["charging"===t.battery?(0,l.jsx)(n.BatteryCharging50,{}):(0,l.jsx)(n.BatteryFull,{}),"charging"!==t.battery?t.battery.includes("V")||t.battery.includes("mV")?(0,l.jsx)("p",{style:{fontSize:"small",margin:0},children:t.battery}):(0,l.jsxs)("p",{style:{fontSize:"small",margin:0},children:[(0,l.jsx)("span",{style:{marginRight:4},children:t.battery}),"mV"]}):null]})})}),"boolean"===typeof t.battery&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,l.jsx)(i.Tooltip,{title:x("batteryTooltip"),slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:t.battery?(0,l.jsx)(n.BatteryFull,{style:s}):(0,l.jsx)(n.BatteryAlert,{style:o})})})}),t.warning&&(0,l.jsx)("div",{style:{display:"flex",alignItems:"center"},children:"string"===typeof t.warning||"object"===typeof t.warning?(0,l.jsx)(i.Tooltip,{title:x(t.warning),slotProps:{popper:{sx:f.tooltip}},children:(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:(0,l.jsx)(n.Warning,{style:r})})}):(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:(0,l.jsx)(n.Warning,{style:r})})})]})}var y=s(4531);function I(e){var t,s;const{instanceId:i,socket:n,schema:r,data:a,onChange:c}=e,[d,p]=(0,o.useState)(!1);if(void 0===r)return null;const[h,u]=i.split(".",2);return(0,l.jsxs)(l.Fragment,{children:[d&&(0,l.jsx)("div",{children:d}),(0,l.jsx)(y.JsonConfigComponent,{socket:n,adapterName:h,instance:parseInt(u,10),schema:r,data:a,onError:p,onChange:e=>c(e),embedded:!0,themeName:e.themeName,themeType:e.themeType,theme:e.theme,isFloatComma:void 0===e.isFloatComma?!(null===(t=e.socket.systemConfig)||void 0===t||!t.common.isFloatComma):e.isFloatComma,dateFormat:void 0===e.dateFormat?null===(s=e.socket.systemConfig)||void 0===s?void 0:s.common.dateFormat:e.dateFormat})]})}const j=function(e){const{socket:t,manufacturer:s,model:o,deviceId:i,onImageSelect:n,uploadImagesToInstance:r}=e;return(0,l.jsx)("div",{children:(0,l.jsx)("input",{style:{opacity:0,position:"absolute",width:"45px",height:"45px",zIndex:3},type:"file",accept:"image/*",onChange:e=>{const l=e.target.files;if(!l||0===l.length)return;const a=l[0];if(a){const e=new FileReader;e.onload=e=>{if(!e.target||!e.target.result)return;const l=new Image;l.src=e.target.result,l.onload=async()=>{let e=l.width,a=l.height;e>a?e>50&&(a*=50/e,e=50):a>50&&(e*=50/a,a=50);const c=document.createElement("canvas"),d=c.getContext("2d");if(d){c.width=e,c.height=a,d.drawImage(l,0,0,e,a);const p=c.toDataURL("image/webp"),h=`${s?`${s}_`:""}${o||i}`,u=p.replace(/^data:image\/webp;base64,/,""),x=await t.writeFile64(r,h,u);console.log(`saveImage response: ${JSON.stringify(x)}`),n&&n(p)}}},e.readAsDataURL(a)}}})})};function T(e){return(0,l.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",style:e.style,className:e.className,children:(0,l.jsx)("path",{fill:"currentColor",d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})})}function b(e){return"object"===typeof e?e[r.I18n.getLanguage()]||e.en:e}class C extends o.Component{constructor(e){super(e),this.refresh=()=>{this.setState({details:null}),this.loadDetails().catch(console.error)},this.copyToClipboard=()=>{const e=this.props.device.id;r.Utils.copyToClipboard(e),alert(`${x("copied")} ${e} ${x("toClipboard")}!`)},this.state={open:!1,details:null,data:{},icon:e.device.icon,showControlDialog:!1}}async fetchIcon(){if(!this.props.device.icon){const e=r.I18n.getLanguage(),t=this.props.device.manufacturer&&"object"===typeof this.props.device.manufacturer?this.props.device.manufacturer[e]||this.props.device.manufacturer.en:this.props.device.manufacturer,s=`${t?`${t}_`:""}${(this.props.device.model&&"object"===typeof this.props.device.model?this.props.device.model[e]||this.props.device.model.en:this.props.device.model)||this.props.device.id}`;try{const e=await this.props.socket.readFile(this.props.instanceId.replace("system.adapter.",""),`${s}.webp`,!0);e?this.setState({icon:`data:image/${e.mimeType},${e.file}`}):this.setState({icon:""})}catch{this.state.icon&&this.setState({icon:""})}}}componentDidMount(){this.fetchIcon().catch((e=>console.error(e)))}async loadDetails(){console.log(`Loading device details for ${this.props.device.id}... from ${this.props.instanceId}`);const e=await this.props.socket.sendTo(this.props.instanceId,"dm:deviceDetails",this.props.device.id);console.log(`Got device details for ${this.props.device.id}:`,e),this.setState({details:e,data:(null===e||void 0===e?void 0:e.data)||{}})}renderDialog(){return this.state.open&&this.state.details?(0,l.jsxs)(i.Dialog,{open:!0,maxWidth:"md",onClose:()=>this.setState({open:!1}),children:[(0,l.jsx)(i.DialogContent,{children:(0,l.jsx)(I,{instanceId:this.props.instanceId,socket:this.props.socket,schema:this.state.details.schema,data:this.state.data,onChange:e=>this.setState({data:e}),themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat})}),(0,l.jsx)(i.DialogActions,{children:(0,l.jsx)(i.Button,{disabled:!this.props.alive,variant:"contained",color:"primary",onClick:()=>this.setState({open:!1}),autoFocus:!0,children:x("closeButtonText")})})]}):null}renderControlDialog(){var e;if(!this.state.showControlDialog||!this.props.alive)return null;const t={primary:"#111",secondary:"#888"};return(0,l.jsxs)(i.Dialog,{open:!0,onClose:()=>this.setState({showControlDialog:!1}),children:[(0,l.jsxs)(i.DialogTitle,{children:[this.props.title,(0,l.jsx)(i.IconButton,{style:{position:"absolute",top:5,right:5,zIndex:10},onClick:()=>this.setState({showControlDialog:!1}),children:(0,l.jsx)(n.Close,{})})]}),(0,l.jsx)(i.DialogContent,{style:{display:"flex",flexDirection:"column"},children:null===(e=this.props.device.controls)||void 0===e?void 0:e.map((e=>(0,l.jsx)(v,{disabled:!1,control:e,socket:this.props.socket,colors:t,deviceId:this.props.device.id,controlHandler:this.props.controlHandler,controlStateHandler:this.props.controlStateHandler},e.id)))})]})}renderControls(){var e,t,s;const o={primary:"#111",secondary:"#888"},r=null===(e=this.props.device.controls)||void 0===e?void 0:e[0];return 1!==(null===(t=this.props.device.controls)||void 0===t?void 0:t.length)||!r||"icon"!==r.type&&"switch"!==r.type||r.label?null!==(s=this.props.device.controls)&&void 0!==s&&s.length?(0,l.jsx)(i.Fab,{size:"small",disabled:!this.props.alive,onClick:()=>this.setState({showControlDialog:!0}),children:(0,l.jsx)(n.VideogameAsset,{})}):null:(0,l.jsx)(v,{disabled:!this.props.alive,control:r,colors:o,socket:this.props.socket,deviceId:this.props.device.id,controlHandler:this.props.controlHandler,controlStateHandler:this.props.controlStateHandler})}renderActions(){var e;return null!==(e=this.props.device.actions)&&void 0!==e&&e.length?this.props.device.actions.map((e=>(0,l.jsx)(m,{disabled:!this.props.alive,deviceId:this.props.device.id,action:e,deviceHandler:this.props.deviceHandler,refresh:this.refresh},e.id))):null}renderSmall(){const e=this.props.device.hasDetails,t=this.props.device.status?Array.isArray(this.props.device.status)?this.props.device.status:[this.props.device.status]:[],s=this.state.icon?(0,l.jsx)(r.IconDeviceType,{src:this.state.icon}):(0,l.jsx)(T,{});return(0,l.jsxs)(i.Card,{sx:{maxWidth:345,minWidth:200},children:[(0,l.jsx)(i.CardHeader,{sx:e=>({backgroundColor:this.props.device.color||e.palette.secondary.main,color:this.props.device.color?r.Utils.invertColor(this.props.device.color,!0):e.palette.secondary.contrastText,maxWidth:345}),avatar:(0,l.jsxs)("div",{children:[this.props.uploadImagesToInstance?(0,l.jsx)(j,{uploadImagesToInstance:this.props.uploadImagesToInstance,deviceId:this.props.device.id,manufacturer:b(this.props.device.manufacturer),model:b(this.props.device.model),onImageSelect:e=>{e&&this.setState({icon:e})},socket:this.props.socket}):null,s]}),action:e?(0,l.jsx)(i.IconButton,{"aria-label":"settings",onClick:()=>{this.state.open||(this.loadDetails().catch(console.error),this.setState({open:!0}))},children:(0,l.jsx)(n.MoreVert,{})}):null,title:this.props.title,subheader:this.props.device.manufacturer?(0,l.jsxs)("span",{children:[(0,l.jsxs)("b",{style:{marginRight:4},children:[x("manufacturer"),":"]}),b(this.props.device.manufacturer)]}):null}),(0,l.jsxs)(i.CardContent,{style:{position:"relative"},children:[null!==t&&void 0!==t&&t.length?(0,l.jsx)("div",{style:{display:"flex",position:"absolute",top:-11,background:"#88888880",padding:"0 8px",borderRadius:5,width:"calc(100% - 46px)"},children:t.map(((e,t)=>(0,l.jsx)(g,{status:e},t)))}):null,(0,l.jsx)("div",{children:(0,l.jsxs)(i.Typography,{variant:"body1",children:[(0,l.jsxs)("div",{onClick:this.copyToClipboard,style:{textOverflow:"ellipsis",overflow:"hidden"},children:[(0,l.jsx)("b",{children:"ID:"}),(0,l.jsx)("span",{style:{marginLeft:4},children:this.props.device.id.replace(/.*\.\d\./,"")})]}),this.props.device.manufacturer?(0,l.jsxs)("div",{children:[(0,l.jsxs)("b",{style:{marginRight:4},children:[x("manufacturer"),":"]}),b(this.props.device.manufacturer)]}):null,this.props.device.model?(0,l.jsxs)("div",{children:[(0,l.jsxs)("b",{style:{marginRight:4},children:[x("model"),":"]}),b(this.props.device.model)]}):null]})})]}),(0,l.jsxs)(i.CardActions,{disableSpacing:!0,children:[this.renderActions(),(0,l.jsx)("div",{style:{flexGrow:1}}),this.renderControls()]}),this.renderDialog(),this.renderControlDialog()]})}renderBig(){var e,t,s,o,a;const c={zIndex:2,maxWidth:"100%",maxHeight:"100%",color:"#FFF"},d=this.props.device.status?Array.isArray(this.props.device.status)?this.props.device.status:[this.props.device.status]:[],p=this.state.icon?(0,l.jsx)(r.IconDeviceType,{src:this.state.icon,style:c}):(0,l.jsx)(T,{style:c}),h=(null===(e=this.state.details)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.name)||this.props.title||"";return(0,l.jsxs)(i.Paper,{style:{width:300,minHeight:280,margin:10,overflow:"hidden",display:"inline-block"},children:[(0,l.jsxs)(i.Box,{sx:e=>({backgroundColor:e.palette.secondary.main}),style:{display:"flex",alignItems:"center",gap:8,paddingLeft:8,position:"relative",minHeight:60,color:"#000"},children:[(0,l.jsxs)("div",{style:{height:45,width:45,justifyContent:"center",display:"flex",alignItems:"center"},children:[this.props.uploadImagesToInstance?(0,l.jsx)(j,{uploadImagesToInstance:this.props.uploadImagesToInstance,deviceId:this.props.device.id,manufacturer:b(this.props.device.manufacturer),model:b(this.props.device.model),onImageSelect:e=>{e&&this.setState({icon:e})},socket:this.props.socket}):null,p]}),(0,l.jsx)(i.Box,{style:{fontSize:16,fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:h.length>20?h:void 0,sx:e=>({color:e.palette.secondary.contrastText}),children:(null===(s=this.state.details)||void 0===s||null===(o=s.data)||void 0===o?void 0:o.name)||this.props.title}),this.props.device.hasDetails?(0,l.jsx)(i.Fab,{disabled:!this.props.alive,size:"small",style:{right:20,bottom:-20,position:"absolute"},onClick:()=>{this.state.open||(this.loadDetails().catch(console.error),this.setState({open:!0}))},color:"primary",children:(0,l.jsx)(n.MoreVert,{})}):null]}),(0,l.jsx)("div",{style:{padding:"15px 15px 0 15px",height:41},children:d.map(((e,t)=>(0,l.jsx)(g,{status:e},t)))}),(0,l.jsxs)("div",{style:{height:"calc(100% - 116px)"},children:[(0,l.jsxs)(i.Typography,{variant:"body1",style:{padding:"20px 16px 0 16px",height:133},children:[(0,l.jsxs)("div",{onClick:this.copyToClipboard,children:[(0,l.jsx)("b",{style:{marginRight:4},children:"ID:"}),this.props.device.id.replace(/.*\.\d\./,"")]}),this.props.device.manufacturer?(0,l.jsxs)("div",{children:[(0,l.jsxs)("b",{style:{marginRight:4},children:[x("manufacturer"),":"]}),b(this.props.device.manufacturer)]}):null,this.props.device.model?(0,l.jsxs)("div",{children:[(0,l.jsxs)("b",{style:{marginRight:4},children:[x("model"),":"]}),b(this.props.device.model)]}):null]}),!(null===(a=this.props.device.actions)||void 0===a||!a.length)&&(0,l.jsxs)("div",{style:{flex:1,position:"relative",display:"flex",gap:8,paddingBottom:5,height:34,paddingLeft:10,paddingRight:10},children:[this.renderActions(),(0,l.jsx)("div",{style:{flexGrow:1}}),this.renderControls()]})]}),this.renderDialog(),this.renderControlDialog()]},this.props.id)}render(){return this.props.smallCards?this.renderSmall():this.renderBig()}}const w=C;class B extends o.Component{constructor(e){super(e),this.instanceHandler=void 0,this.deviceHandler=void 0,this.controlHandler=void 0,this.controlStateHandler=void 0,this.sendActionToInstance=(e,t,s)=>{(async()=>{this.setState({showSpinner:!0});const o=await this.props.socket.sendTo(this.props.selectedInstance,e,t),i=o.type;switch(console.log(`Response: ${o.type}`),i){case"message":console.log(`Message received: ${o.message}`),o.message&&this.setState({message:{message:o.message,handleClose:()=>this.setState({message:null},(()=>this.sendActionToInstance("dm:actionProgress",{origin:o.origin},s)))}});break;case"confirm":console.log(`Confirm received: ${o.confirm}`),o.confirm&&this.setState({confirm:{message:o.confirm,handleClose:e=>this.setState({confirm:null},(()=>this.sendActionToInstance("dm:actionProgress",{origin:o.origin,confirm:e},s)))}});break;case"form":console.log("Form received"),o.form&&this.setState({form:{...o.form,handleClose:e=>this.setState({form:null},(()=>{console.log(`Form ${JSON.stringify(e)}`),this.sendActionToInstance("dm:actionProgress",{origin:o.origin,data:e},s)}))}});break;case"progress":if(o.progress)if(this.state.progress){const e={...this.state.progress,...o.progress};this.setState({progress:e})}else this.setState({progress:o.progress});this.sendActionToInstance("dm:actionProgress",{origin:o.origin},s);break;case"result":console.log("Response content",o.result),o.result.refresh&&(!0===o.result.refresh?(console.log("Refreshing all"),this.loadData()):"instance"===o.result.refresh?console.log(`Refreshing instance infos: ${this.props.selectedInstance}`):"device"===o.result.refresh?s?(console.log(`Refreshing device infos: ${this.props.selectedInstance}`),s()):console.log('No refresh function provided to refresh "device"'):console.log("Not refreshing anything")),o.result.error&&(console.error(`Error: ${o.result.error.message}`),this.setState({showToast:o.result.error.message})),this.setState({showSpinner:!1});break;default:console.log(`Unknown response type: ${i}`),this.setState({showSpinner:!1})}})().catch(console.error)},this.sendControlToInstance=async(e,t)=>{const s=await this.props.socket.sendTo(this.props.selectedInstance,e,t),o=s.type;if(console.log(`Response: ${s.type}`),"result"===s.type){if(console.log("Response content",s.result),s.result.error)console.error(`Error: ${s.result.error.message}`),this.setState({showToast:s.result.error.message});else if(void 0!==s.result.state)return s.result.state}else console.warn("Unexpected response type",o);return null},this.state={showSpinner:!1,showToast:null,message:null,confirm:null,form:null,progress:null,showConfirmation:null,showInput:null,inputValue:null},this.instanceHandler=e=>()=>{e.confirmation?this.setState({showConfirmation:e}):e.inputBefore?this.setState({showInput:e}):this.sendActionToInstance("dm:instanceAction",{actionId:e.id})},this.deviceHandler=(e,t,s)=>()=>{t.confirmation?this.setState({showConfirmation:{...t,deviceId:e,refresh:s}}):t.inputBefore?this.setState({showInput:{...t,deviceId:e,refresh:s},inputValue:t.inputBefore.defaultValue||""}):this.sendActionToInstance("dm:deviceAction",{deviceId:e,actionId:t.id},s)},this.controlHandler=(e,t,s)=>()=>this.sendControlToInstance("dm:deviceControl",{deviceId:e,controlId:t.id,state:s}),this.controlStateHandler=(e,t)=>()=>this.sendControlToInstance("dm:deviceControlState",{deviceId:e,controlId:t.id}),this.props.registerHandler&&this.props.registerHandler((()=>this.loadData()))}loadData(){console.error("loadData not implemented")}loadDevices(){return this.props.socket.sendTo(this.props.selectedInstance,"dm:listDevices")}loadInstanceInfos(){return this.props.socket.sendTo(this.props.selectedInstance,"dm:instanceInfo")}renderMessageDialog(){var e;return this.state.message?(0,l.jsxs)(i.Dialog,{open:!0,onClose:()=>{var e;return null===(e=this.state.message)||void 0===e?void 0:e.handleClose()},hideBackdrop:!0,"aria-describedby":"message-dialog-description",children:[(0,l.jsx)(i.DialogContent,{children:(0,l.jsx)(i.DialogContentText,{id:"message-dialog-description",children:null===(e=this.state.message)||void 0===e?void 0:e.message})}),(0,l.jsx)(i.DialogActions,{children:(0,l.jsx)(i.Button,{color:"primary",onClick:()=>{var e;return null===(e=this.state.message)||void 0===e?void 0:e.handleClose()},variant:"contained",autoFocus:!0,children:x("okButtonText")})})]}):null}renderConfirmDialog(){var e;return this.state.confirm?(0,l.jsxs)(i.Dialog,{open:!0,onClose:()=>{var e;return null===(e=this.state.confirm)||void 0===e?void 0:e.handleClose()},hideBackdrop:!0,"aria-describedby":"confirm-dialog-description",children:[(0,l.jsx)(i.DialogContent,{children:(0,l.jsx)(i.DialogContentText,{id:"confirm-dialog-description",children:x(null===(e=this.state.confirm)||void 0===e?void 0:e.message)})}),(0,l.jsxs)(i.DialogActions,{children:[(0,l.jsx)(i.Button,{variant:"contained",color:"primary",onClick:()=>{var e;return null===(e=this.state.confirm)||void 0===e?void 0:e.handleClose(!0)},autoFocus:!0,children:x("yesButtonText")}),(0,l.jsx)(i.Button,{variant:"contained",color:"grey",onClick:()=>{var e;return null===(e=this.state.confirm)||void 0===e?void 0:e.handleClose(!1)},autoFocus:!0,children:x("noButtonText")})]})]}):null}renderSnackbar(){return(0,l.jsx)(i.Snackbar,{open:!!this.state.showToast,autoHideDuration:6e3,onClose:()=>this.setState({showToast:null}),message:this.state.showToast})}renderFormDialog(){var e,t;return this.state.form&&this.state.form.schema&&this.state.form.data?(0,l.jsxs)(i.Dialog,{open:!0,onClose:()=>{var e;return(null===(e=this.state.form)||void 0===e?void 0:e.handleClose)&&this.state.form.handleClose()},hideBackdrop:!0,children:[null!==(e=this.state.form)&&void 0!==e&&e.title?(0,l.jsx)(i.DialogTitle,{children:x(null===(t=this.state.form)||void 0===t?void 0:t.title)}):null,(0,l.jsx)(i.DialogContent,{children:(0,l.jsx)(I,{instanceId:this.props.selectedInstance,schema:this.state.form.schema,data:this.state.form.data,socket:this.props.socket,onChange:e=>{console.log("handleFormChange",{data:e});const t={...this.state.form};t&&(t.data=e,this.setState({form:t}))},themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat})}),(0,l.jsxs)(i.DialogActions,{children:[(0,l.jsx)(i.Button,{variant:"contained",color:"primary",onClick:()=>{var e,t;return(null===(e=this.state.form)||void 0===e?void 0:e.handleClose)&&this.state.form.handleClose(null===(t=this.state.form)||void 0===t?void 0:t.data)},autoFocus:!0,children:x("okButtonText")}),(0,l.jsx)(i.Button,{variant:"contained",color:"grey",onClick:()=>{var e;return(null===(e=this.state.form)||void 0===e?void 0:e.handleClose)&&this.state.form.handleClose()},children:x("cancelButtonText")})]})]}):null}renderProgressDialog(){var e,t;return null!==(e=this.state.progress)&&void 0!==e&&e.open?(0,l.jsx)(i.Dialog,{open:!0,onClose:()=>{},hideBackdrop:!0,children:(0,l.jsx)(i.LinearProgress,{variant:"determinate",value:(null===(t=this.state.progress)||void 0===t?void 0:t.progress)||0})}):null}renderContent(){return null}renderSpinner(){var e;return this.state.showSpinner||null!==(e=this.state.progress)&&void 0!==e&&e.open||this.state.message||this.state.confirm||this.state.form?(0,l.jsx)(i.Backdrop,{style:{zIndex:1e3},open:!0,children:(0,l.jsx)(i.CircularProgress,{})}):null}renderConfirmationDialog(){return this.state.showConfirmation?(0,l.jsxs)(i.Dialog,{open:!0,onClose:()=>this.setState({showConfirmation:null}),children:[(0,l.jsx)(i.DialogTitle,{children:x(!0===this.state.showConfirmation.confirmation?x("areYouSureText"):x(this.state.showConfirmation.confirmation))}),(0,l.jsxs)(i.DialogActions,{children:[(0,l.jsx)(i.Button,{variant:"contained",color:"primary",onClick:()=>{if(!this.state.showConfirmation)return;const e=this.state.showConfirmation;this.setState({showConfirmation:null},(()=>{e.deviceId?this.sendActionToInstance("dm:deviceAction",{actionId:e.id,deviceId:e.deviceId},e.refresh):this.sendActionToInstance("dm:instanceAction",{actionId:e.id})}))},autoFocus:!0,startIcon:(0,l.jsx)(n.Check,{}),children:x("yesButtonText")}),(0,l.jsx)(i.Button,{variant:"contained",color:"grey",onClick:()=>this.setState({showConfirmation:null}),startIcon:(0,l.jsx)(n.Close,{}),children:x("cancelButtonText")})]})]}):null}renderInputDialog(){var e;if(!this.state.showInput||!this.state.showInput.inputBefore)return null;let t=!1;return this.state.showInput.inputBefore.allowEmptyValue||"checkbox"===this.state.showInput.inputBefore.type||(t="number"===this.state.showInput.inputBefore.type||"slider"===this.state.showInput.inputBefore.type?""===this.state.inputValue||null===this.state.inputValue||!window.isFinite(this.state.inputValue):!this.state.inputValue),(0,l.jsxs)(i.Dialog,{open:!0,onClose:()=>this.setState({showInput:null}),children:[(0,l.jsx)(i.DialogTitle,{children:x("pleaseEnterValueText")}),(0,l.jsxs)(i.DialogContent,{children:["text"!==this.state.showInput.inputBefore.type&&"number"!==this.state.showInput.inputBefore.type&&this.state.showInput.inputBefore.type?null:(0,l.jsx)(i.TextField,{autoFocus:!0,margin:"dense",label:x(this.state.showInput.inputBefore.label),slotProps:{htmlInput:"number"===this.state.showInput.inputBefore.type?{min:this.state.showInput.inputBefore.min,max:this.state.showInput.inputBefore.max,step:this.state.showInput.inputBefore.step}:void 0,input:{endAdornment:this.state.inputValue?(0,l.jsx)(i.InputAdornment,{position:"end",children:(0,l.jsx)(i.IconButton,{size:"small",onClick:()=>this.setState({inputValue:""}),children:(0,l.jsx)(n.Close,{})})}):null}},type:"number"===this.state.showInput.inputBefore.type?"number":"text",fullWidth:!0,value:this.state.inputValue,onChange:e=>this.setState({inputValue:e.target.value})}),"checkbox"===this.state.showInput.inputBefore.type?(0,l.jsx)(i.FormControlLabel,{control:(0,l.jsx)(i.Checkbox,{checked:!!this.state.inputValue,autoFocus:!0,onChange:e=>this.setState({inputValue:e.target.checked})}),label:x(this.state.showInput.inputBefore.label)}):null,"select"===this.state.showInput.inputBefore.type?(0,l.jsxs)(i.FormControl,{fullWidth:!0,children:[(0,l.jsx)(i.InputLabel,{children:x(this.state.showInput.inputBefore.label)}),(0,l.jsx)(i.Select,{variant:"standard",value:this.state.inputValue,onChange:e=>this.setState({inputValue:e.target.value}),children:null===(e=this.state.showInput.inputBefore.options)||void 0===e?void 0:e.map((e=>(0,l.jsx)(i.MenuItem,{value:e.value,children:x(e.label)},e.value)))})]}):null,"slider"===this.state.showInput.inputBefore.type?(0,l.jsxs)(i.Box,{sx:{width:"100%"},children:[(0,l.jsx)(i.Typography,{gutterBottom:!0,children:x(this.state.showInput.inputBefore.label)}),(0,l.jsxs)(i.Grid2,{container:!0,spacing:2,alignItems:"center",children:[(0,l.jsx)(i.Grid2,{children:(0,l.jsx)(i.Slider,{value:"number"===typeof this.state.inputValue?this.state.inputValue:0,onChange:(e,t)=>this.setState({inputValue:t})})}),(0,l.jsx)(i.Grid2,{children:(0,l.jsx)(i.Input,{value:this.state.inputValue,size:"small",onChange:e=>this.setState({inputValue:""===e.target.value?0:Number(e.target.value)}),onBlur:()=>{var e,t;if(!this.state.showInput)return;const s=void 0===(null===(e=this.state.showInput.inputBefore)||void 0===e?void 0:e.min)?0:this.state.showInput.inputBefore.min,o=void 0===(null===(t=this.state.showInput.inputBefore)||void 0===t?void 0:t.max)?100:this.state.showInput.inputBefore.max;this.state.inputValue<s?this.setState({inputValue:s}):this.state.inputValue>o&&this.setState({inputValue:o})},inputProps:{step:this.state.showInput.inputBefore.step,min:void 0===this.state.showInput.inputBefore.min?0:this.state.showInput.inputBefore.min,max:void 0===this.state.showInput.inputBefore.max?100:this.state.showInput.inputBefore.max,type:"number"}})})]})]}):null]}),(0,l.jsxs)(i.DialogActions,{children:[(0,l.jsx)(i.Button,{variant:"contained",disabled:t,color:"primary",onClick:()=>{if(!this.state.showInput)return;const e=this.state.showInput;this.setState({showInput:null},(()=>{var t,s,o,i;e.deviceId?this.sendActionToInstance("dm:deviceAction",{actionId:e.id,deviceId:e.deviceId,value:"checkbox"===(null===(t=e.inputBefore)||void 0===t?void 0:t.type)?!!this.state.inputValue:"number"===(null===(s=e.inputBefore)||void 0===s?void 0:s.type)?parseFloat(this.state.inputValue)||0:this.state.inputValue},e.refresh):this.sendActionToInstance("dm:instanceAction",{actionId:e.id,value:"checkbox"===(null===(o=e.inputBefore)||void 0===o?void 0:o.type)?!!this.state.inputValue:"number"===(null===(i=e.inputBefore)||void 0===i?void 0:i.type)?parseFloat(this.state.inputValue)||0:this.state.inputValue})}))},startIcon:(0,l.jsx)(n.Check,{}),children:x("yesButtonText")}),(0,l.jsx)(i.Button,{variant:"contained",color:"grey",onClick:()=>this.setState({showInput:null}),startIcon:(0,l.jsx)(n.Close,{}),children:x("cancelButtonText")})]})]})}render(){return(0,l.jsxs)(l.Fragment,{children:[this.renderSnackbar(),this.renderContent(),this.renderSpinner(),this.renderConfirmDialog(),this.renderMessageDialog(),this.renderFormDialog(),this.renderProgressDialog(),this.renderConfirmationDialog(),this.renderInputDialog()]})}}const S=B;function D(e){const{action:t,instanceHandler:s}=e,o=x(null!==t&&void 0!==t&&t.description?t.description:""),i=x(null!==t&&void 0!==t&&t.title?t.title:""),n=h(t);return(0,l.jsx)(a,{tooltip:o,label:i,disabled:t.disabled,Icon:n,onClick:s(t)})}const k=JSON.parse('{"allDevicesFilteredOut":"Alle Ger\xe4te herausgefiltert","batteryTooltip":"Batterie","cancelButtonText":"Abbrechen","closeButtonText":"Schlie\xdfen","connectedIconTooltip":"Verbunden","copied":"Kopiert","disconnectedIconTooltip":"Getrennt","filterLabelText":"Nach Name filtern","instanceLabelText":"Instanz","instanceNotAlive":"Instanz ist nicht aktiv","manufacturer":"Hersteller","model":"Modell","noButtonText":"Nein","noDevicesFoundText":"Keine Ger\xe4te gefunden","noInstanceSelectedText":"Bitte Instanz ausw\xe4hlen","okButtonText":"OK","pleaseEnterValueText":"Bitte eingeben","refreshInstanceList":"Instanzliste aktualisieren","refreshTooltip":"Aktualisieren","toClipboard":"in die Zwischenablage kopiert","yesButtonText":"Ja"}'),F=JSON.parse('{"allDevicesFilteredOut":"All devices filtered out","batteryTooltip":"Battery","cancelButtonText":"Cancel","closeButtonText":"Close","connectedIconTooltip":"Connected","copied":"Copied","disconnectedIconTooltip":"Disconnected","filterLabelText":"Filter by name","instanceLabelText":"Instance","instanceNotAlive":"Instance is not alive","manufacturer":"Manufacturer","model":"Model","noButtonText":"No","noDevicesFoundText":"No devices found","noInstanceSelectedText":"Please select instance","okButtonText":"OK","pleaseEnterValueText":"Please enter","refreshInstanceList":"Refresh instance list","refreshTooltip":"Refresh","toClipboard":"to clipboard","yesButtonText":"Yes"}'),L=JSON.parse('{"allDevicesFilteredOut":"\u0412\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u044b","batteryTooltip":"\u0411\u0430\u0442\u0430\u0440\u0435\u044f","cancelButtonText":"\u041e\u0442\u043c\u0435\u043d\u0430","closeButtonText":"\u0417\u0430\u043a\u0440\u044b\u0442\u044c","connectedIconTooltip":"\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e","copied":"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e","disconnectedIconTooltip":"\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e","filterLabelText":"\u0424\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0438\u043c\u0435\u043d\u0438","instanceLabelText":"\u0415\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440","instanceNotAlive":"\u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0435 \u0436\u0438\u0432","manufacturer":"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c","model":"\u041c\u043e\u0434\u0435\u043b\u044c","noButtonText":"\u041d\u0435\u0442","noDevicesFoundText":"\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b","noInstanceSelectedText":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440","okButtonText":"\u0425\u041e\u0420\u041e\u0428\u041e","pleaseEnterValueText":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432\u0445\u043e\u0434\u0438\u0442\u0435","refreshInstanceList":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432","refreshTooltip":"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","toClipboard":"\u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0435\u043d\u0430","yesButtonText":"\u0414\u0430"}'),A=JSON.parse('{"allDevicesFilteredOut":"Todos os dispositivos foram filtrados","batteryTooltip":"Bateria","cancelButtonText":"Cancelar","closeButtonText":"Fechar","connectedIconTooltip":"Conectado","copied":"Copiado","disconnectedIconTooltip":"Desconectado","filterLabelText":"Filtrar por nome","instanceLabelText":"Inst\xe2ncia","instanceNotAlive":"A inst\xe2ncia n\xe3o est\xe1 ativa","manufacturer":"Fabricante","model":"Modelo","noButtonText":"N\xe3o","noDevicesFoundText":"Nenhum dispositivo encontrado","noInstanceSelectedText":"Selecione a inst\xe2ncia","okButtonText":"OK","pleaseEnterValueText":"Por favor, insira","refreshInstanceList":"Atualizar lista de inst\xe2ncias","refreshTooltip":"Atualizar","toClipboard":"para a \xe1rea de transfer\xeancia","yesButtonText":"Sim"}'),V=JSON.parse('{"allDevicesFilteredOut":"Alle apparaten zijn eruit gefilterd","batteryTooltip":"Batterij","cancelButtonText":"Annuleren","closeButtonText":"Dichtbij","connectedIconTooltip":"Verbonden","copied":"Gekopieerd","disconnectedIconTooltip":"Losgekoppeld","filterLabelText":"Filter op naam","instanceLabelText":"Voorbeeld","instanceNotAlive":"Instantie leeft niet","manufacturer":"Fabrikant","model":"Model","noButtonText":"Nee","noDevicesFoundText":"Geen apparaten gevonden","noInstanceSelectedText":"Selecteer een exemplaar","okButtonText":"OK","pleaseEnterValueText":"Kom binnen alstublieft","refreshInstanceList":"Ververs de exemplaarlijst","refreshTooltip":"Vernieuwen","toClipboard":"naar klembord","yesButtonText":"Ja"}'),N=JSON.parse('{"allDevicesFilteredOut":"Tous les appareils filtr\xe9s","batteryTooltip":"Batterie","cancelButtonText":"Annuler","closeButtonText":"Fermer","connectedIconTooltip":"Connect\xe9","copied":"Copi\xe9","disconnectedIconTooltip":"D\xe9branch\xe9","filterLabelText":"Filtrer par nom","instanceLabelText":"Exemple","instanceNotAlive":"L\'instance n\'est pas vivante","manufacturer":"Fabricant","model":"Mod\xe8le","noButtonText":"Non","noDevicesFoundText":"Aucun p\xe9riph\xe9rique trouv\xe9","noInstanceSelectedText":"Veuillez s\xe9lectionner une instance","okButtonText":"D\'ACCORD","pleaseEnterValueText":"Entrez s\'il vous plait","refreshInstanceList":"Actualiser la liste des instances","refreshTooltip":"Rafra\xeechir","toClipboard":"au presse-papiers","yesButtonText":"Oui"}'),z=JSON.parse('{"allDevicesFilteredOut":"Tutti i dispositivi sono stati filtrati","batteryTooltip":"Batteria","cancelButtonText":"Annulla","closeButtonText":"Vicino","connectedIconTooltip":"Connesso","copied":"Copiato","disconnectedIconTooltip":"Disconnesso","filterLabelText":"Filtra per nome","instanceLabelText":"Esempio","instanceNotAlive":"L\'istanza non \xe8 viva","manufacturer":"Produttore","model":"Modello","noButtonText":"NO","noDevicesFoundText":"Nessun dispositivo trovato","noInstanceSelectedText":"Seleziona l\'istanza","okButtonText":"OK","pleaseEnterValueText":"Prego entra","refreshInstanceList":"Aggiorna l\'elenco delle istanze","refreshTooltip":"ricaricare","toClipboard":"negli appunti","yesButtonText":"S\xcc"}'),O=JSON.parse('{"allDevicesFilteredOut":"Todos los dispositivos filtrados","batteryTooltip":"Bater\xeda","cancelButtonText":"Cancelar","closeButtonText":"Cerca","connectedIconTooltip":"Conectado","copied":"copiado","disconnectedIconTooltip":"Desconectado","filterLabelText":"Filtrar por nombre","instanceLabelText":"Instancia","instanceNotAlive":"La instancia no est\xe1 viva.","manufacturer":"Fabricante","model":"Modelo","noButtonText":"No","noDevicesFoundText":"No se encontraron dispositivos","noInstanceSelectedText":"Por favor seleccione instancia","okButtonText":"DE ACUERDO","pleaseEnterValueText":"Por favor escribe","refreshInstanceList":"Actualizar lista de instancias","refreshTooltip":"Actualizar","toClipboard":"al portapapeles","yesButtonText":"S\xed"}'),H=JSON.parse('{"allDevicesFilteredOut":"Wszystkie urz\u0105dzenia zosta\u0142y odfiltrowane","batteryTooltip":"Bateria","cancelButtonText":"Anulowa\u0107","closeButtonText":"Zamkn\u0105\u0107","connectedIconTooltip":"Po\u0142\u0105czono","copied":"Skopiowano","disconnectedIconTooltip":"Bez\u0142adny","filterLabelText":"Filtruj wed\u0142ug nazwy","instanceLabelText":"Instancja","instanceNotAlive":"Instancja nie \u017cyje","manufacturer":"Producent","model":"Model","noButtonText":"NIE","noDevicesFoundText":"Nie znaleziono urz\u0105dze\u0144","noInstanceSelectedText":"Wybierz instancj\u0119","okButtonText":"OK","pleaseEnterValueText":"Podaj","refreshInstanceList":"Od\u015bwie\u017c list\u0119 instancji","refreshTooltip":"Od\u015bwie\u017ca\u0107","toClipboard":"do schowka","yesButtonText":"Tak"}'),P=JSON.parse('{"allDevicesFilteredOut":"\u0423\u0441\u0456 \u043f\u0440\u0438\u0441\u0442\u0440\u043e\u0457 \u0432\u0456\u0434\u0444\u0456\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043e","batteryTooltip":"\u0411\u0430\u0442\u0430\u0440\u0435\u044f","cancelButtonText":"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","closeButtonText":"\u0417\u0430\u043a\u0440\u0438\u0442\u0438","connectedIconTooltip":"\u041f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e","copied":"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e","disconnectedIconTooltip":"\u0412\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e","filterLabelText":"\u0424\u0456\u043b\u044c\u0442\u0440\u0443\u0432\u0430\u0442\u0438 \u0437\u0430 \u043d\u0430\u0437\u0432\u043e\u044e","instanceLabelText":"\u0415\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440","instanceNotAlive":"\u041f\u0440\u0438\u043c\u0456\u0440\u043d\u0438\u043a \u043d\u0435 \u0436\u0438\u0432\u0438\u0439","manufacturer":"\u0412\u0438\u0440\u043e\u0431\u043d\u0438\u043a","model":"\u041c\u043e\u0434\u0435\u043b\u044c","noButtonText":"\u041d\u0435\u043c\u0430\u0454","noDevicesFoundText":"\u041f\u0440\u0438\u0441\u0442\u0440\u043e\u0457\u0432 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e","noInstanceSelectedText":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440","okButtonText":"\u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0443","pleaseEnterValueText":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430 \u0432\u0432\u0435\u0434\u0456\u0442\u044c","refreshInstanceList":"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0456\u0432","refreshTooltip":"\u041e\u043d\u043e\u0432\u0438\u0442\u0438","toClipboard":"\u0432 \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043c\u0456\u043d\u0443","yesButtonText":"\u0422\u0430\u043a"}'),$=JSON.parse('{"allDevicesFilteredOut":"\u6240\u6709\u8bbe\u5907\u5747\u88ab\u8fc7\u6ee4\u6389","batteryTooltip":"\u7535\u6c60","cancelButtonText":"\u53d6\u6d88","closeButtonText":"\u5173\u95ed","connectedIconTooltip":"\u5df2\u8fde\u63a5","copied":"\u5df2\u590d\u5236","disconnectedIconTooltip":"\u5df2\u65ad\u5f00\u8fde\u63a5","filterLabelText":"\u6309\u540d\u79f0\u8fc7\u6ee4","instanceLabelText":"\u5b9e\u4f8b","instanceNotAlive":"\u5b9e\u4f8b\u4e0d\u5b58\u5728","manufacturer":"\u5236\u9020\u5546","model":"\u578b\u53f7","noButtonText":"\u4e0d","noDevicesFoundText":"\u672a\u627e\u5230\u8bbe\u5907","noInstanceSelectedText":"\u8bf7\u9009\u62e9\u5b9e\u4f8b","okButtonText":"\u597d\u7684","pleaseEnterValueText":"\u8bf7\u8f93\u5165","refreshInstanceList":"\u5237\u65b0\u5b9e\u4f8b\u5217\u8868","refreshTooltip":"\u5237\u65b0","toClipboard":"\u5230\u526a\u8d34\u677f","yesButtonText":"\u662f\u7684"}');class R extends S{constructor(e){super(e),this.lastPropsFilter=void 0,this.lastInstance=void 0,this.lastTriggerLoad=0,this.filterTimeout=void 0,this.language=void 0,this.aliveHandler=(e,t)=>{if(e===`system.adapter.${this.props.selectedInstance}.alive`){const e=!(null===t||void 0===t||!t.val);e!==this.state.alive&&this.setState({alive:e},(()=>{e&&this.componentDidMount().catch(console.error)}))}},R.i18nInitialized||(R.i18nInitialized=!0,r.I18n.extendTranslations({en:F,de:k,ru:L,pt:A,nl:V,fr:N,it:z,es:O,pl:H,uk:P,"zh-cn":$})),Object.assign(this.state,{devices:[],filteredDevices:[],filter:"",instanceInfo:null,loading:null,alive:null}),this.lastPropsFilter=this.props.filter,this.lastInstance=this.props.selectedInstance,this.lastTriggerLoad=this.props.triggerLoad||0,this.filterTimeout=null,this.language=r.I18n.getLanguage()}async componentDidMount(){let e=!1;if(null===this.state.alive){try{const t=await this.props.socket.getState(`system.adapter.${this.props.selectedInstance}.alive`);null!==t&&void 0!==t&&t.val&&(e=!0)}catch(t){console.error(t)}if(this.setState({alive:e},(()=>this.props.socket.subscribeState(`system.adapter.${this.props.selectedInstance}.alive`,this.aliveHandler))),!e)return}else e=this.state.alive;if(!this.props.embedded&&e)try{const e=await this.loadInstanceInfos();this.setState({instanceInfo:e})}catch(t){console.error(t)}e&&this.loadData()}componentWillUnmount(){this.props.socket.unsubscribeState(`system.adapter.${this.props.selectedInstance}.alive`,this.aliveHandler)}loadData(){this.setState({loading:!0},(async()=>{console.log(`Loading devices for ${this.props.selectedInstance}...`);let e=[];try{e=await this.loadDevices(),e&&Array.isArray(e)||(console.error(`Message returned from sendTo() doesn't look like one from DeviceManagement, did you accidentally handle the message in your adapter? ${JSON.stringify(e)}`),e=[])}catch(t){console.error(t),e=[]}this.setState({devices:e,loading:!1},(()=>this.applyFilter()))}))}getText(e){return"object"===typeof e?e[this.language]||e.en:e}applyFilter(){const e=this.props.embedded?this.props.filter:this.state.filter;if(e){const t=this.state.devices.filter((t=>this.getText(t.name).toLowerCase().includes(e.toLowerCase())));this.setState({filteredDevices:t})}else this.setState({filteredDevices:this.state.devices})}handleFilterChange(e){this.setState({filter:e},(()=>{this.filterTimeout&&clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.filterTimeout=null,this.applyFilter()}),250)}))}renderContent(){var e,t;const s={padding:25};let o;return(this.props.triggerLoad||0)!==this.lastTriggerLoad&&(this.lastTriggerLoad=this.props.triggerLoad||0,setTimeout((()=>this.loadData()),50)),this.props.embedded&&this.lastPropsFilter!==this.props.filter&&(this.lastPropsFilter=this.props.filter,setTimeout((()=>this.applyFilter()),50)),this.props.embedded&&this.lastInstance!==this.props.selectedInstance&&(this.lastInstance=this.props.selectedInstance,setTimeout((()=>this.loadData()),50)),o=this.props.embedded||this.state.alive?!this.state.devices.length&&this.props.selectedInstance?(0,l.jsx)("div",{style:s,children:(0,l.jsx)("span",{children:x("noDevicesFoundText")})}):this.state.devices.length&&!this.state.filteredDevices.length?(0,l.jsx)("div",{style:s,children:(0,l.jsx)("span",{children:x("allDevicesFilteredOut")})}):this.state.filteredDevices.map((e=>(0,l.jsx)(w,{alive:!!this.state.alive,id:e.id,title:this.getText(e.name),device:e,instanceId:this.props.selectedInstance,uploadImagesToInstance:this.props.uploadImagesToInstance,deviceHandler:this.deviceHandler,controlHandler:this.controlHandler,controlStateHandler:this.controlStateHandler,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat},e.id))):(0,l.jsx)("div",{style:s,children:(0,l.jsx)("span",{children:x("instanceNotAlive")})}),this.props.embedded?(0,l.jsxs)(l.Fragment,{children:[this.state.loading?(0,l.jsx)(i.LinearProgress,{style:{width:"100%"}}):null,o]}):(0,l.jsxs)("div",{style:{width:"100%",height:"100%",overflow:"hidden"},children:[(0,l.jsxs)(i.Toolbar,{variant:"dense",style:{backgroundColor:"#777",display:"flex"},children:[this.props.title,this.props.selectedInstance?(0,l.jsx)(i.Tooltip,{title:x("refreshTooltip"),slotProps:{popper:{sx:{pointerEvents:"none"}}},children:(0,l.jsx)("span",{children:(0,l.jsx)(i.IconButton,{onClick:()=>this.loadData(),disabled:!this.state.alive,size:"small",children:(0,l.jsx)(n.Refresh,{})})})}):null,this.state.alive&&null!==(e=this.state.instanceInfo)&&void 0!==e&&null!==(t=e.actions)&&void 0!==t&&t.length?(0,l.jsx)("div",{style:{marginLeft:20},children:this.state.instanceInfo.actions.map((e=>(0,l.jsx)(D,{action:e,instanceHandler:this.instanceHandler},e.id)))}):null,(0,l.jsx)("div",{style:{flexGrow:1}}),this.state.alive?(0,l.jsx)(i.TextField,{variant:"standard",style:{width:200},size:"small",label:x("filterLabelText"),onChange:e=>this.handleFilterChange(e.target.value),value:this.state.filter,autoComplete:"off",slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.filter?(0,l.jsx)(i.InputAdornment,{position:"end",children:(0,l.jsx)(i.IconButton,{onClick:()=>this.handleFilterChange(""),edge:"end",children:(0,l.jsx)(n.Clear,{})})}):null},htmlInput:{autoComplete:"off"}}}):null]}),(0,l.jsxs)("div",{style:{width:"100%",height:"calc(100% - 56px)",marginTop:8,overflow:"auto",...this.props.style},children:[this.state.loading?(0,l.jsx)(i.LinearProgress,{style:{width:"100%"}}):null,o]})]})}}R.i18nInitialized=!1;const E=R}}]);
|
|
2
|
-
//# sourceMappingURL=4720.a3767f97.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/js/4720.a3767f97.chunk.js","mappings":"0LAWe,SAASA,EAAcC,GAClC,MAAM,QAAEC,EAAO,MAAEC,EAAK,SAAEC,EAAQ,KAAEC,EAAI,QAAEC,GAAYL,EAE9CM,IAASJ,IACXK,EAAAA,EAAAA,KAACC,EAAAA,WAAU,CACPC,QAAQ,SACRC,MAAO,CAAEC,WAAY,GAAIC,SAExBV,IAIT,OAAID,GAEIM,EAAAA,EAAAA,KAACM,EAAAA,QAAO,CACJC,MAAOb,EACPc,UAAW,CAAEC,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,OAAQA,EACR+Q,gBAAiBvO,KAAKuO,iBAFjB/Q,EAAOc,QAMxB,MAEJxE,EAAAA,EAAAA,KAAA,OAAKG,MAAO,CAAEgT,SAAU,KAEvBjN,KAAKhC,MAAMkM,OACRpQ,EAAAA,EAAAA,KAAC4Y,EAAAA,UAAS,CACN1Y,QAAQ,WACRC,MAAO,CAAEwI,MAAO,KAChB7H,KAAK,QACLnB,MAAOmF,EAAe,mBACtBkD,SAAUC,GAAK/B,KAAK0W,mBAAmB3U,EAAEC,OAAOtE,OAChDA,MAAOsC,KAAKhC,MAAM3C,OAClB6b,aAAa,MACb5c,UAAW,CACPyY,MAAO,CACHmE,aAAc,eACdlE,aAAchT,KAAKhC,MAAM3C,QACrBvB,EAAAA,EAAAA,KAACmZ,EAAAA,eAAc,CAACxM,SAAS,MAAKtM,UAC1BL,EAAAA,EAAAA,KAACa,EAAAA,WAAU,CACPf,QAASA,IAAMoG,KAAK0W,mBAAmB,IACvCS,KAAK,MAAKhd,UAEVL,EAAAA,EAAAA,KAACsd,EAAAA,MAAK,QAGd,MAERzE,UAAW,CACPuE,aAAc,UAI1B,SAERxc,EAAAA,EAAAA,MAAA,OACIT,MAAO,CACHwI,MAAO,OACPC,OAAQ,oBACR2U,UAAW,EACXvK,SAAU,UAMP9M,KAAKzG,MAAMU,OAChBE,SAAA,CAED6F,KAAKhC,MAAMoY,SAAUtc,EAAAA,EAAAA,KAAC6X,EAAAA,eAAc,CAAC1X,MAAO,CAAEwI,MAAO,UAAe,KACpEuU,OAIjB,EAnUiBnC,EACVM,iBAAkB,ECtD7B,S","sources":["../../../dm-gui-components/src/TooltipButton.tsx","../../../dm-gui-components/src/Utils.tsx","../../../dm-gui-components/src/DeviceActionButton.tsx","../../../dm-gui-components/src/DeviceControl.tsx","../../../dm-gui-components/src/DeviceStatus.tsx","../../../dm-gui-components/src/JsonConfig.tsx","../../../dm-gui-components/src/DeviceImageUpload.tsx","../../../dm-gui-components/src/DeviceCard.tsx","../../../dm-gui-components/src/Communication.tsx","../../../dm-gui-components/src/InstanceActionButton.tsx","../../../dm-gui-components/src/DeviceList.tsx","../../../dm-gui-components/src/index.ts"],"sourcesContent":["import React from 'react';\nimport { IconButton, Tooltip, Typography } from '@mui/material';\n\ninterface TooltipButtonProps {\n tooltip?: string;\n label?: string;\n disabled?: boolean;\n Icon: React.JSX.Element | null;\n onClick?: () => void;\n}\n\nexport default function TooltipButton(props: TooltipButtonProps): React.JSX.Element {\n const { tooltip, label, disabled, Icon, onClick } = props;\n\n const text = !!label && (\n <Typography\n variant=\"button\"\n style={{ marginLeft: 4 }}\n >\n {label}\n </Typography>\n );\n\n if (tooltip) {\n return (\n <Tooltip\n title={tooltip}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <span>\n <IconButton\n onClick={onClick}\n disabled={disabled}\n size=\"small\"\n >\n {Icon}\n {text}\n </IconButton>\n </span>\n </Tooltip>\n );\n }\n\n return (\n <IconButton\n onClick={onClick}\n disabled={disabled}\n size=\"small\"\n >\n {Icon}\n {text}\n </IconButton>\n );\n}\n","import React from 'react';\n\nimport type { ControlBase } from '@iobroker/dm-utils/build/types/base';\nimport type { ActionBase } from '@iobroker/dm-utils/build/types/api';\nimport {\n Add,\n Bluetooth,\n BluetoothDisabled,\n Delete,\n Edit,\n FastForward,\n FastRewind,\n Fluorescent,\n Group,\n Info,\n Lightbulb,\n Link as LinkIcon,\n LinkOff,\n NotListedLocation,\n Pause,\n Person,\n PlayArrow,\n Power,\n QrCode,\n QuestionMark,\n Refresh,\n Search,\n Settings,\n Stop,\n Visibility,\n WbIncandescent,\n Wifi,\n WifiFind,\n WifiOff,\n} from '@mui/icons-material';\n\nimport { I18n, Icon } from '@iobroker/adapter-react-v5';\n\nfunction getFaIcon(icon: string, color?: string): React.JSX.Element | null {\n const iconStyle = icon\n .split(' ')\n .map(s => s.trim())\n .filter(s => s !== 'fa-solid');\n\n if (iconStyle.includes('fa-trash-can') || iconStyle.includes('fa-trash')) {\n return <Delete style={{ color }} />;\n }\n if (iconStyle.includes('fa-pen')) {\n return <Edit style={{ color }} />;\n }\n if (iconStyle.includes('fa-redo-alt')) {\n return <Refresh style={{ color }} />;\n }\n if (iconStyle.includes('fa-plus')) {\n return <Add style={{ color }} />;\n }\n if (iconStyle.includes('fa-qrcode') || iconStyle.includes('qrcode')) {\n return <QrCode style={{ color }} />;\n }\n if (iconStyle.includes('fa-wifi')) {\n return <Wifi style={{ color }} />;\n }\n if (iconStyle.includes('fa-wifi-slash')) {\n return <WifiOff style={{ color }} />;\n }\n if (iconStyle.includes('fa-bluetooth')) {\n return <Bluetooth style={{ color }} />;\n }\n if (iconStyle.includes('fa-bluetooth-slash')) {\n return <BluetoothDisabled style={{ color }} />;\n }\n if (iconStyle.includes('fa-eye')) {\n return <Visibility style={{ color }} />;\n }\n if (iconStyle.includes('fa-search')) {\n return <Search style={{ color }} />;\n }\n if (iconStyle.includes('fa-unlink')) {\n return <LinkOff style={{ color }} />;\n }\n if (iconStyle.includes('fa-link')) {\n return <LinkIcon style={{ color }} />;\n }\n if (iconStyle.includes('fa-search-location')) {\n return <NotListedLocation style={{ color }} />;\n }\n if (iconStyle.includes('fa-play')) {\n return <PlayArrow style={{ color }} />;\n }\n if (iconStyle.includes('fa-stop')) {\n return <Stop style={{ color }} />;\n }\n if (iconStyle.includes('fa-pause')) {\n return <Pause style={{ color }} />;\n }\n if (iconStyle.includes('forward')) {\n return <FastForward style={{ color }} />;\n }\n if (iconStyle.includes('rewind')) {\n return <FastRewind style={{ color }} />;\n }\n if (iconStyle.includes('users') || iconStyle.includes('group')) {\n return <Group style={{ color }} />;\n }\n if (iconStyle.includes('user')) {\n return <Person style={{ color }} />;\n }\n return <QuestionMark style={{ color }} />;\n}\n\nfunction getIconByName(name: string, altName?: string, color?: string): React.JSX.Element | null {\n if (name === 'edit' || name === 'rename' || altName === 'edit' || altName === 'rename') {\n return <Edit style={{ color }} />;\n }\n if (name === 'delete' || altName === 'delete') {\n return <Delete style={{ color }} />;\n }\n if (name === 'refresh' || altName === 'refresh') {\n return <Refresh style={{ color }} />;\n }\n if (\n name === 'newDevice' ||\n name === 'new' ||\n name === 'add' ||\n altName === 'newDevice' ||\n altName === 'new' ||\n altName === 'add'\n ) {\n return <Add style={{ color }} />;\n }\n if (name === 'discover' || name === 'search' || altName === 'discover' || altName === 'search') {\n return <Search style={{ color }} />;\n }\n if (name === 'unpairDevice' || name === 'unpair' || altName === 'unpairDevice' || altName === 'unpair') {\n return <LinkOff style={{ color }} />;\n }\n if (name === 'pairDevice' || name === 'pair' || altName === 'pairDevice' || altName === 'pair') {\n return <LinkIcon style={{ color }} />;\n }\n if (name === 'identify' || altName === 'identify') {\n return <NotListedLocation style={{ color }} />;\n }\n if (name === 'play' || altName === 'play') {\n return <PlayArrow style={{ color }} />;\n }\n if (name === 'stop' || altName === 'stop') {\n return <Stop style={{ color }} />;\n }\n if (name === 'pause' || altName === 'pause') {\n return <Pause style={{ color }} />;\n }\n if (name === 'forward' || name === 'next' || altName === 'forward' || altName === 'next') {\n return <FastForward style={{ color }} />;\n }\n if (name === 'rewind' || name === 'previous' || altName === 'rewind' || altName === 'previous') {\n return <FastRewind style={{ color }} />;\n }\n if (name === 'lamp' || name === 'light' || altName === 'lamp' || altName === 'light') {\n return <Lightbulb style={{ color }} />;\n }\n if (name === 'backlight' || altName === 'backlight') {\n return <Fluorescent style={{ color }} />;\n }\n if (name === 'dimmer' || altName === 'dimmer') {\n return <WbIncandescent style={{ color }} />;\n }\n if (name === 'socket' || altName === 'socket') {\n return <Power style={{ color }} />;\n }\n if (name === 'settings' || altName === 'settings') {\n return <Settings style={{ color }} />;\n }\n if (name === 'users' || name === 'group' || altName === 'users' || altName === 'group') {\n return <Group style={{ color }} />;\n }\n if (name === 'user' || altName === 'user') {\n return <Person style={{ color }} />;\n }\n if (name === 'qrcode' || altName === 'qrcode') {\n return <QrCode style={{ color }} />;\n }\n if (name === 'identify' || altName === 'identify') {\n return <WifiFind style={{ color }} />;\n }\n if (name === 'info' || altName === 'info') {\n return <Info style={{ color }} />;\n }\n return <QuestionMark style={{ color }} />;\n}\n\nexport function renderControlIcon(\n action: ControlBase,\n colors?: { primary: string; secondary: string },\n value?: string | number | boolean | null,\n): React.JSX.Element | null {\n if (!action) {\n return null;\n }\n\n let color = (value && action.colorOn) || action.color || (action.state ? 'primary' : 'inherit');\n\n if (colors) {\n if (color === 'primary') {\n color = colors.primary;\n } else if (color === 'secondary') {\n color = colors.secondary;\n }\n }\n\n if (action.icon?.startsWith('fa-') || action.icon?.startsWith('fas')) {\n return getFaIcon(action.icon, color);\n }\n if (value && action.iconOn?.startsWith('data:image')) {\n return (\n <Icon\n src={action.iconOn}\n style={{ color }}\n />\n );\n }\n if (action.icon?.startsWith('data:image')) {\n return (\n <Icon\n src={action.icon}\n style={{ color }}\n />\n );\n }\n return getIconByName(action.id, action.icon, color);\n}\n\nexport function renderActionIcon(action: ActionBase): React.JSX.Element | null {\n if (!action) {\n return null;\n }\n\n if (action.icon?.startsWith('fa-') || action.icon?.startsWith('fas')) {\n return getFaIcon(action.icon, action.color);\n }\n if (action.icon?.startsWith('data:image')) {\n return (\n <Icon\n src={action.icon}\n style={{ color: action.color }}\n />\n );\n }\n return getIconByName(action.id, action.icon, action.color);\n}\n\nlet language: ioBroker.Languages;\n\n/**\n * Get Translation\n */\nexport function getTranslation(\n /** Text to translate */\n text: ioBroker.StringOrTranslated,\n): string {\n language = language || I18n.getLanguage();\n\n if (typeof text === 'object') {\n return text[language] || text.en;\n }\n\n return I18n.t(text);\n}\n","import React from 'react';\n\nimport type { ActionBase, DeviceAction } from '@iobroker/dm-utils';\nimport TooltipButton from './TooltipButton';\nimport { renderActionIcon, getTranslation } from './Utils';\n\ninterface DeviceActionButtonProps {\n deviceId: string;\n action: DeviceAction;\n refresh: () => void;\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n disabled?: boolean;\n}\n\nexport default function DeviceActionButton(props: DeviceActionButtonProps): React.JSX.Element {\n const { deviceId, action, refresh, deviceHandler, disabled } = props;\n\n const icon = renderActionIcon(action);\n\n const tooltip = getTranslation(action.description ?? '') || (icon ? null : action.id);\n\n return (\n <TooltipButton\n tooltip={tooltip || undefined}\n disabled={disabled || action.disabled}\n Icon={icon}\n onClick={deviceHandler(deviceId, action, refresh)}\n />\n );\n}\n","import React, { Component, type JSX } from 'react';\nimport { Button, Fab, Switch } from '@mui/material';\n\nimport type { Connection } from '@iobroker/adapter-react-v5';\nimport type { ControlBase, ControlState, DeviceControl } from '@iobroker/dm-utils';\n\nimport { renderControlIcon, getTranslation } from './Utils';\n\ninterface DeviceControlProps {\n deviceId: string;\n /** Control object */\n control: DeviceControl;\n socket: Connection;\n /** Control handler to set the state */\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n /** Control handler to read the state */\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n colors: { primary: string; secondary: string };\n disabled?: boolean;\n}\n\ninterface DeviceControlState {\n value?: ControlState;\n ts?: number;\n}\n\n/**\n * Device Control component\n */\nexport default class DeviceControlComponent extends Component<DeviceControlProps, DeviceControlState> {\n constructor(props: DeviceControlProps) {\n super(props);\n this.state = {\n value: props.control.state?.val,\n ts: props.control.state?.ts,\n };\n }\n\n async componentDidMount(): Promise<void> {\n if (this.props.control.stateId) {\n const mayBePromise = this.props.socket.subscribeState(this.props.control.stateId, this.stateHandler);\n if (mayBePromise instanceof Promise) {\n await mayBePromise;\n }\n }\n }\n\n stateHandler = async (id: string, state: ioBroker.State): Promise<void> => {\n if (id === this.props.control.stateId && state) {\n // request new state\n const newState: ioBroker.State | null = await this.props.controlStateHandler(\n this.props.deviceId,\n this.props.control,\n )();\n if (newState?.ts && (!this.state.ts || newState.ts > this.state.ts)) {\n this.setState({\n value: newState.val,\n ts: newState.ts,\n });\n }\n }\n };\n\n componentWillUnmount(): void {\n if (this.props.control.stateId) {\n this.props.socket.unsubscribeState(this.props.control.stateId, this.stateHandler);\n }\n }\n\n static getDerivedStateFromProps(\n props: DeviceControlProps,\n state: DeviceControlState,\n ): Partial<DeviceControlState> | null {\n if (props.control.state?.ts && (!state.ts || props.control.state?.ts > state.ts)) {\n return {\n value: props.control.state.val,\n ts: props.control.state.ts,\n };\n }\n\n return null;\n }\n\n async sendControl(deviceId: string, control: ControlBase, value: ControlState): Promise<void> {\n const result = await this.props.controlHandler(deviceId, control, value)();\n if (result?.ts && (!this.state.ts || result?.ts > this.state.ts)) {\n this.setState({\n value: result.val,\n ts: result.ts,\n });\n }\n }\n\n renderButton(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n\n if (!this.props.control.label) {\n return (\n <Fab\n size=\"small\"\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, true)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n renderSwitch(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n // const icon = renderIcon(this.props.control, this.props.colors, this.state.value);\n\n return (\n <Switch\n disabled={this.props.disabled}\n title={tooltip}\n checked={!!this.state.value}\n onChange={e => this.sendControl(this.props.deviceId, this.props.control, e.target.checked)}\n />\n );\n }\n\n getColor(): string | undefined {\n let color: string | undefined;\n if (this.state.value) {\n color = this.props.control.colorOn || 'primary';\n } else if (this.props.control.type === 'switch') {\n color = this.props.control.color;\n }\n if (color === 'primary') {\n return this.props.colors.primary;\n }\n if (color === 'secondary') {\n return this.props.colors.secondary;\n }\n return color;\n }\n\n // TODO: implement the following render methods\n // eslint-disable-next-line react/no-unused-class-component-methods,class-methods-use-this\n renderSelect(): JSX.Element | null {\n return null;\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods,class-methods-use-this\n renderSlider(): JSX.Element | null {\n return null;\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods,class-methods-use-this\n renderColor(): JSX.Element | null {\n return null;\n }\n\n renderIcon(): JSX.Element {\n const tooltip = getTranslation(this.props.control.description ?? '');\n const icon = renderControlIcon(this.props.control, this.props.colors, this.state.value);\n const color = this.getColor();\n const style: React.CSSProperties | undefined =\n color === this.props.colors.primary || color === this.props.colors.secondary ? {} : { color };\n const colorProps =\n color === this.props.colors.primary\n ? 'primary'\n : color === this.props.colors.secondary\n ? 'secondary'\n : undefined;\n\n if (!this.props.control.label) {\n style.width = 34;\n style.height = 34;\n style.minHeight = 34;\n\n return (\n <Fab\n disabled={this.props.disabled}\n size=\"small\"\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n >\n {icon}\n </Fab>\n );\n }\n return (\n <Button\n disabled={this.props.disabled}\n title={tooltip}\n color={colorProps}\n style={style}\n onClick={() => this.sendControl(this.props.deviceId, this.props.control, !this.state.value)}\n startIcon={icon}\n >\n {getTranslation(this.props.control.label)}\n </Button>\n );\n }\n\n render(): JSX.Element {\n if (this.props.control.type === 'button') {\n return this.renderButton();\n }\n\n if (this.props.control.type === 'icon') {\n return this.renderIcon();\n }\n\n if (this.props.control.type === 'switch') {\n return this.renderSwitch();\n }\n\n return <div style={{ color: 'red' }}>{this.props.control.type}</div>;\n }\n}\n","import React from 'react';\nimport { Tooltip } from '@mui/material';\n\nimport {\n Link as LinkIcon,\n LinkOff as LinkOffIcon,\n NetworkCheck as NetworkCheckIcon,\n Battery20 as Battery20Icon,\n Battery30 as Battery30Icon,\n Battery50 as Battery50Icon,\n Battery60 as Battery60Icon,\n Battery80 as Battery80Icon,\n Battery90 as Battery90Icon,\n BatteryFull as BatteryFullIcon,\n BatteryAlert as BatteryAlertIcon,\n Warning as WarningIcon,\n BatteryCharging50 as BatteryCharging50Icon,\n} from '@mui/icons-material';\n\nimport type { DeviceStatus } from '@iobroker/dm-utils';\n\nimport { getTranslation } from './Utils';\n\nconst styles: Record<string, React.CSSProperties> = {\n tooltip: {\n pointerEvents: 'none',\n },\n};\n\ninterface DeviceStatusProps {\n status: DeviceStatus | null;\n}\n/**\n * Device Status component\n *\n * @param params - Parameters\n * @param params.status - Status object, e.g. { connection: 'connected', battery: 100, rssi: -50 }\n */\nexport default function DeviceStatus(params: DeviceStatusProps): React.JSX.Element | null {\n if (!params.status) {\n return null;\n }\n\n let status: DeviceStatus;\n\n if (typeof params.status === 'string') {\n status = {\n connection: params.status,\n };\n } else {\n status = params.status;\n }\n\n const iconStyleOK = {\n fill: '#00ac00',\n };\n const iconStyleNotOK = {\n fill: '#ff0000',\n };\n const iconStyleWarning = {\n fill: '#ff9900',\n };\n\n let batteryIconTooltip: React.ReactNode = null;\n if (typeof status.battery === 'number') {\n if (status.battery >= 96 && status.battery <= 100) {\n batteryIconTooltip = <BatteryFullIcon style={iconStyleOK} />;\n } else if (status.battery >= 90 && status.battery <= 95) {\n batteryIconTooltip = <Battery90Icon style={iconStyleOK} />;\n } else if (status.battery >= 80 && status.battery <= 89) {\n batteryIconTooltip = <Battery80Icon style={iconStyleOK} />;\n } else if (status.battery >= 60 && status.battery <= 79) {\n batteryIconTooltip = <Battery60Icon style={iconStyleOK} />;\n } else if (status.battery >= 50 && status.battery <= 59) {\n batteryIconTooltip = <Battery50Icon style={iconStyleOK} />;\n } else if (status.battery >= 30 && status.battery <= 49) {\n batteryIconTooltip = <Battery30Icon style={iconStyleOK} />;\n } else if (status.battery >= 20 && status.battery <= 29) {\n batteryIconTooltip = <Battery20Icon style={iconStyleNotOK} />;\n } else {\n batteryIconTooltip = <BatteryAlertIcon style={iconStyleNotOK} />;\n }\n }\n\n return (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {status.connection === 'connected' && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Tooltip\n title={getTranslation('connectedIconTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <LinkIcon style={iconStyleOK} />\n </div>\n </Tooltip>\n </div>\n )}\n\n {status.connection === 'disconnected' && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Tooltip\n title={getTranslation('disconnectedIconTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <LinkOffIcon style={iconStyleNotOK} />\n </div>\n </Tooltip>\n </div>\n )}\n\n {status.rssi && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Tooltip\n title=\"RSSI\"\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <NetworkCheckIcon />\n <p style={{ fontSize: 'small', margin: 0 }}>{status.rssi}</p>\n </div>\n </Tooltip>\n </div>\n )}\n\n {typeof status.battery === 'number' && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Tooltip\n title={getTranslation('batteryTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {batteryIconTooltip}\n <p style={{ fontSize: 'small', margin: 0 }}>{status.battery}%</p>\n </div>\n </Tooltip>\n </div>\n )}\n\n {typeof status.battery === 'string' && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Tooltip\n title={getTranslation('batteryTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {status.battery === 'charging' ? <BatteryCharging50Icon /> : <BatteryFullIcon />}\n {status.battery !== 'charging' ? (\n status.battery.includes('V') || status.battery.includes('mV') ? (\n <p style={{ fontSize: 'small', margin: 0 }}>{status.battery}</p>\n ) : (\n <p style={{ fontSize: 'small', margin: 0 }}>\n <span style={{ marginRight: 4 }}>{status.battery}</span>\n mV\n </p>\n )\n ) : null}\n </div>\n </Tooltip>\n </div>\n )}\n\n {typeof status.battery === 'boolean' && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <Tooltip\n title={getTranslation('batteryTooltip')}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n {status.battery ? (\n <BatteryFullIcon style={iconStyleOK} />\n ) : (\n <BatteryAlertIcon style={iconStyleNotOK} />\n )}\n </div>\n </Tooltip>\n </div>\n )}\n\n {status.warning && (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {typeof status.warning === 'string' || typeof status.warning === 'object' ? (\n <Tooltip\n title={getTranslation(status.warning)}\n slotProps={{ popper: { sx: styles.tooltip } }}\n >\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <WarningIcon style={iconStyleWarning} />\n </div>\n </Tooltip>\n ) : (\n <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>\n <WarningIcon style={iconStyleWarning} />\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import React, { useState } from 'react';\nimport type { Connection, AdminConnection, ThemeName, ThemeType, IobTheme } from '@iobroker/adapter-react-v5';\nimport { JsonConfigComponent, type ConfigItemPanel } from '@iobroker/json-config';\n\ninterface JsonConfigDmProps {\n instanceId: string;\n socket: Connection;\n schema: ConfigItemPanel;\n data: Record<string, any>;\n onChange: (data: Record<string, any>) => void;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma?: boolean;\n dateFormat?: string;\n}\n\nexport default function JsonConfig(props: JsonConfigDmProps): React.JSX.Element | null {\n const { instanceId, socket, schema, data, onChange } = props;\n const [error, setError] = useState(false);\n\n if (schema === undefined) {\n return null;\n }\n\n const [adapterName, instance] = instanceId.split('.', 2);\n\n return (\n <>\n {error && <div>{error}</div>}\n <JsonConfigComponent\n socket={socket as any as AdminConnection}\n adapterName={adapterName}\n instance={parseInt(instance, 10)}\n schema={schema}\n data={data}\n onError={setError}\n onChange={(_data: Record<string, any>) => onChange(_data)}\n embedded\n themeName={props.themeName}\n themeType={props.themeType}\n theme={props.theme}\n isFloatComma={\n props.isFloatComma === undefined\n ? !!props.socket.systemConfig?.common.isFloatComma\n : props.isFloatComma\n }\n dateFormat={\n props.dateFormat === undefined\n ? (props.socket.systemConfig?.common.dateFormat as string)\n : props.dateFormat\n }\n />\n </>\n );\n\n /*\n JSON adapter config:\n className={classes.scroll}\n socket={socket}\n theme={this.props.theme}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n adapterName={this.props.adapterName}\n instance={this.props.instance}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n schema={this.state.schema}\n common={this.state.common}\n data={this.state.data}\n updateData={this.state.updateData}\n onError={(error) => this.setState({ error })}\n onChange={(data, changed) => this.setState({ data, changed })}\n customs={{ configCustomEasyAccess: ConfigCustomEasyAccess }}\n Object custom:\n instanceObj={instanceObj}\n customObj={customObj}\n custom={true}\n className={ '' }\n adapterName={adapter}\n instance={parseInt(instance.split('.').pop(), 10) || 0}\n socket={this.props.socket}\n theme={this.props.theme}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n multiEdit={this.props.objectIDs.length > 1}\n\n schema={this.jsonConfigs[adapter].json}\n data={data}\n onError={error =>\n this.setState({error}, () => this.props.onError && this.props.onError(error))}\n onValueChange={(attr, value) => {\n console.log(attr + ' => ' + value);\n const newValues = JSON.parse(JSON.stringify(this.state.newValues));\n newValues[instance] = newValues[instance] || {};\n if (this.commonConfig[instance][attr] === value) {\n delete newValues[instance][attr];\n if (!Object.keys(newValues[instance]).length) {\n delete newValues[instance];\n }\n } else {\n newValues[instance][attr] = value;\n }\n this.setState({newValues, hasChanges: this.isChanged(newValues)}, () =>\n this.props.onChange && this.props.onChange(this.state.hasChanges));\n }}\n */\n}\n","import React, { type ChangeEvent, type ChangeEventHandler } from 'react';\nimport type { Connection } from '@iobroker/adapter-react-v5';\n\ninterface DeviceImageUploadProps {\n socket: Connection;\n manufacturer?: string;\n model?: string;\n deviceId: string;\n onImageSelect: (image: string) => void;\n uploadImagesToInstance: string;\n}\n\nfunction DeviceImageUpload(params: DeviceImageUploadProps): React.JSX.Element | null {\n const { socket, manufacturer, model, deviceId, onImageSelect, uploadImagesToInstance } = params;\n\n const handleImageUpload: ChangeEventHandler<HTMLInputElement> = (event: ChangeEvent<HTMLInputElement>): void => {\n const target = event.target as HTMLInputElement;\n const files: FileList | null = target.files;\n if (!files || files.length === 0) {\n return;\n }\n\n const file = files[0];\n\n if (file) {\n const reader = new FileReader();\n\n reader.onload = (e: ProgressEvent<FileReader>): void => {\n if (!e.target || !e.target.result) {\n return;\n }\n\n const img = new Image();\n img.src = e.target.result as string;\n\n img.onload = async () => {\n const maxWidth = 50;\n const maxHeight = 50;\n let width = img.width;\n let height = img.height;\n\n if (width > height) {\n if (width > maxWidth) {\n height *= maxWidth / width;\n width = maxWidth;\n }\n } else if (height > maxHeight) {\n width *= maxHeight / height;\n height = maxHeight;\n }\n\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (ctx) {\n canvas.width = width;\n canvas.height = height;\n ctx.drawImage(img, 0, 0, width, height);\n\n const resizedImage = canvas.toDataURL('image/webp');\n\n // Build the file name from a manufacturer and model, if not available, use device id\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || deviceId}`;\n const base64Data = resizedImage.replace(/^data:image\\/webp;base64,/, '');\n const response = await socket.writeFile64(uploadImagesToInstance, fileName, base64Data);\n console.log(`saveImage response: ${JSON.stringify(response)}`);\n\n if (onImageSelect) {\n onImageSelect(resizedImage);\n }\n }\n };\n };\n\n reader.readAsDataURL(file);\n }\n };\n\n const imageUploadButtonStyle: React.CSSProperties = {\n // make the button invisible but still clickable\n opacity: 0,\n position: 'absolute',\n width: '45px',\n height: '45px',\n zIndex: 3,\n };\n\n return (\n <div>\n <input\n style={imageUploadButtonStyle}\n type=\"file\"\n accept=\"image/*\"\n onChange={handleImageUpload}\n />\n </div>\n );\n}\n\nexport default DeviceImageUpload;\n","import React, { Component, type JSX } from 'react';\n\nimport {\n Button,\n Typography,\n Dialog,\n DialogActions,\n DialogContent,\n IconButton,\n Fab,\n DialogTitle,\n Card,\n CardActions,\n CardHeader,\n CardContent,\n Paper,\n Box,\n} from '@mui/material';\n\nimport { MoreVert as MoreVertIcon, VideogameAsset as ControlIcon, Close as CloseIcon } from '@mui/icons-material';\n\nimport {\n Utils,\n type Connection,\n I18n,\n type ThemeName,\n type ThemeType,\n type IobTheme,\n IconDeviceType,\n} from '@iobroker/adapter-react-v5';\nimport type { DeviceDetails, DeviceInfo, ActionBase, ControlBase, ControlState } from '@iobroker/dm-utils';\n\nimport DeviceActionButton from './DeviceActionButton';\nimport DeviceControlComponent from './DeviceControl';\nimport DeviceStatusComponent from './DeviceStatus';\nimport JsonConfig from './JsonConfig';\nimport DeviceImageUpload from './DeviceImageUpload';\nimport { getTranslation } from './Utils';\n\nfunction NoImageIcon(props: { style?: React.CSSProperties; className?: string }): JSX.Element {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n style={props.style}\n className={props.className}\n >\n <path\n fill=\"currentColor\"\n d=\"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z\"\n />\n </svg>\n );\n}\n\ninterface DeviceCardProps {\n title?: string;\n /* Device ID */\n id: string;\n device: DeviceInfo;\n instanceId: string;\n socket: Connection;\n /* Instance, where the images should be uploaded to */\n uploadImagesToInstance?: string;\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n smallCards?: boolean;\n alive: boolean;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n}\n\nfunction getText(text: ioBroker.StringOrTranslated | undefined): string | undefined {\n if (typeof text === 'object') {\n return text[I18n.getLanguage()] || text.en;\n }\n\n return text;\n}\n\ninterface DeviceCardState {\n open: boolean;\n details: DeviceDetails | null;\n data: Record<string, any>;\n icon: string | undefined;\n showControlDialog: boolean;\n}\n\n/**\n * Device Card Component\n */\nclass DeviceCard extends Component<DeviceCardProps, DeviceCardState> {\n constructor(props: DeviceCardProps) {\n super(props);\n\n this.state = {\n open: false,\n details: null,\n data: {},\n icon: props.device.icon,\n showControlDialog: false,\n };\n }\n\n async fetchIcon(): Promise<void> {\n if (!this.props.device.icon) {\n const lang = I18n.getLanguage();\n const manufacturer =\n this.props.device.manufacturer && typeof this.props.device.manufacturer === 'object'\n ? this.props.device.manufacturer[lang] || this.props.device.manufacturer.en\n : this.props.device.manufacturer;\n const model =\n this.props.device.model && typeof this.props.device.model === 'object'\n ? this.props.device.model[lang] || this.props.device.model.en\n : this.props.device.model;\n\n // try to load the icon from file storage\n const fileName = `${manufacturer ? `${manufacturer}_` : ''}${model || this.props.device.id}`;\n\n try {\n const file = await this.props.socket.readFile(\n this.props.instanceId.replace('system.adapter.', ''),\n `${fileName}.webp`,\n true,\n );\n if (file) {\n this.setState({ icon: `data:image/${file.mimeType},${file.file}` });\n } else {\n this.setState({ icon: '' });\n }\n // const response = await fetch(url);\n // if (response.ok) {\n // const blob = await response.blob();\n // const reader = new FileReader();\n // reader.onloadend = () => {\n // setIcon(reader.result);\n // };\n // reader.readAsDataURL(blob);\n // } else {\n // throw new Error('Response not ok');\n // }\n } catch {\n if (this.state.icon) {\n this.setState({ icon: '' });\n }\n }\n }\n }\n\n componentDidMount(): void {\n this.fetchIcon().catch(e => console.error(e));\n }\n\n /**\n * Load the device details\n */\n async loadDetails(): Promise<void> {\n console.log(`Loading device details for ${this.props.device.id}... from ${this.props.instanceId}`);\n const details: DeviceDetails | null = await this.props.socket.sendTo(\n this.props.instanceId,\n 'dm:deviceDetails',\n this.props.device.id,\n );\n console.log(`Got device details for ${this.props.device.id}:`, details);\n this.setState({ details, data: details?.data || {} });\n }\n\n /**\n * Refresh the device details\n */\n refresh = (): void => {\n this.setState({ details: null });\n this.loadDetails().catch(console.error);\n };\n\n /**\n * Copy the device ID to the clipboard\n */\n copyToClipboard = (): void => {\n const textToCopy = this.props.device.id;\n Utils.copyToClipboard(textToCopy);\n alert(`${getTranslation('copied')} ${textToCopy} ${getTranslation('toClipboard')}!`);\n };\n\n renderDialog(): JSX.Element | null {\n if (!this.state.open || !this.state.details) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n maxWidth=\"md\"\n onClose={() => this.setState({ open: false })}\n >\n <DialogContent>\n <JsonConfig\n instanceId={this.props.instanceId}\n socket={this.props.socket}\n schema={this.state.details.schema}\n data={this.state.data}\n onChange={(data: Record<string, any>) => this.setState({ data })}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n disabled={!this.props.alive}\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.setState({ open: false })}\n autoFocus\n >\n {getTranslation('closeButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderControlDialog(): JSX.Element | null {\n if (!this.state.showControlDialog || !this.props.alive) {\n return null;\n }\n const colors = { primary: '#111', secondary: '#888' };\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showControlDialog: false })}\n >\n <DialogTitle>\n {this.props.title}\n <IconButton\n style={{\n position: 'absolute',\n top: 5,\n right: 5,\n zIndex: 10,\n }}\n onClick={() => this.setState({ showControlDialog: false })}\n >\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>\n {this.props.device.controls?.map(control => (\n <DeviceControlComponent\n disabled={false}\n key={control.id}\n control={control}\n socket={this.props.socket}\n colors={colors}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n ))}\n </DialogContent>\n </Dialog>\n );\n }\n\n renderControls(): JSX.Element | null {\n const colors = { primary: '#111', secondary: '#888' };\n const firstControl = this.props.device.controls?.[0];\n if (\n this.props.device.controls?.length === 1 &&\n firstControl &&\n (firstControl.type === 'icon' || firstControl.type === 'switch') &&\n !firstControl.label\n ) {\n // control can be placed in button icon\n return (\n <DeviceControlComponent\n disabled={!this.props.alive}\n control={firstControl}\n colors={colors}\n socket={this.props.socket}\n deviceId={this.props.device.id}\n controlHandler={this.props.controlHandler}\n controlStateHandler={this.props.controlStateHandler}\n />\n );\n }\n\n if (this.props.device.controls?.length) {\n // place button and show controls dialog\n return (\n <Fab\n size=\"small\"\n disabled={!this.props.alive}\n onClick={() => this.setState({ showControlDialog: true })}\n >\n <ControlIcon />\n </Fab>\n );\n }\n return null;\n }\n\n renderActions(): JSX.Element[] | null {\n return this.props.device.actions?.length\n ? this.props.device.actions.map(a => (\n <DeviceActionButton\n disabled={!this.props.alive}\n key={a.id}\n deviceId={this.props.device.id}\n action={a}\n deviceHandler={this.props.deviceHandler}\n refresh={this.refresh}\n />\n ))\n : null;\n }\n\n renderSmall(): JSX.Element {\n const hasDetails = this.props.device.hasDetails;\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? <IconDeviceType src={this.state.icon} /> : <NoImageIcon />;\n\n return (\n <Card\n sx={{\n maxWidth: 345,\n minWidth: 200,\n }}\n >\n <CardHeader\n sx={theme => ({\n backgroundColor: this.props.device.color || theme.palette.secondary.main,\n color: this.props.device.color\n ? Utils.invertColor(this.props.device.color, true)\n : theme.palette.secondary.contrastText,\n maxWidth: 345,\n })}\n avatar={\n <div>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={getText(this.props.device.manufacturer)}\n model={getText(this.props.device.model)}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n }\n action={\n hasDetails ? (\n <IconButton\n aria-label=\"settings\"\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n >\n <MoreVertIcon />\n </IconButton>\n ) : null\n }\n title={this.props.title}\n subheader={\n this.props.device.manufacturer ? (\n <span>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {getText(this.props.device.manufacturer)}\n </span>\n ) : null\n }\n />\n <CardContent style={{ position: 'relative' }}>\n {status?.length ? (\n <div\n style={{\n display: 'flex',\n position: 'absolute',\n top: -11,\n background: '#88888880',\n padding: '0 8px',\n borderRadius: 5,\n width: 'calc(100% - 46px)',\n }}\n >\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n status={s}\n />\n ))}\n </div>\n ) : null}\n <div>\n <Typography variant=\"body1\">\n <div\n onClick={this.copyToClipboard}\n style={{ textOverflow: 'ellipsis', overflow: 'hidden' }}\n >\n <b>ID:</b>\n <span style={{ marginLeft: 4 }}>{this.props.device.id.replace(/.*\\.\\d\\./, '')}</span>\n </div>\n {this.props.device.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {getText(this.props.device.manufacturer)}\n </div>\n ) : null}\n {this.props.device.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {getText(this.props.device.model)}\n </div>\n ) : null}\n </Typography>\n </div>\n </CardContent>\n <CardActions disableSpacing>\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </CardActions>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Card>\n );\n }\n\n renderBig(): JSX.Element {\n const cardStyle: React.CSSProperties = {\n width: 300,\n minHeight: 280,\n margin: 10,\n overflow: 'hidden',\n display: 'inline-block',\n };\n const headerStyle: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n paddingLeft: 8,\n position: 'relative',\n minHeight: 60,\n color: '#000',\n };\n const imgAreaStyle: React.CSSProperties = {\n height: 45,\n width: 45,\n justifyContent: 'center',\n display: 'flex',\n alignItems: 'center',\n };\n const imgStyle: React.CSSProperties = {\n zIndex: 2,\n maxWidth: '100%',\n maxHeight: '100%',\n color: '#FFF',\n };\n const titleStyle: React.CSSProperties = {\n fontSize: 16,\n fontWeight: 'bold',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n };\n const detailsButtonStyle: React.CSSProperties = {\n right: 20,\n bottom: -20,\n position: 'absolute',\n };\n const bodyStyle: React.CSSProperties = {\n height: 'calc(100% - 116px)',\n };\n const deviceInfoStyle: React.CSSProperties = {\n padding: '20px 16px 0 16px',\n height: 133,\n };\n const statusStyle: React.CSSProperties = {\n padding: '15px 15px 0 15px',\n height: 41,\n };\n const status = !this.props.device.status\n ? []\n : Array.isArray(this.props.device.status)\n ? this.props.device.status\n : [this.props.device.status];\n\n const icon = this.state.icon ? (\n <IconDeviceType\n src={this.state.icon}\n style={imgStyle}\n />\n ) : (\n <NoImageIcon style={imgStyle} />\n );\n\n const title: string = this.state.details?.data?.name || this.props.title || '';\n\n return (\n <Paper\n style={cardStyle}\n key={this.props.id}\n >\n <Box\n sx={theme => ({ backgroundColor: theme.palette.secondary.main })}\n style={headerStyle}\n >\n <div style={imgAreaStyle}>\n {this.props.uploadImagesToInstance ? (\n <DeviceImageUpload\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceId={this.props.device.id}\n manufacturer={getText(this.props.device.manufacturer)}\n model={getText(this.props.device.model)}\n onImageSelect={(imageData: string): void => {\n if (imageData) {\n this.setState({ icon: imageData });\n }\n }}\n socket={this.props.socket}\n />\n ) : null}\n {icon}\n </div>\n <Box\n style={titleStyle}\n title={title.length > 20 ? title : undefined}\n sx={theme => ({ color: theme.palette.secondary.contrastText })}\n >\n {this.state.details?.data?.name || this.props.title}\n </Box>\n {this.props.device.hasDetails ? (\n <Fab\n disabled={!this.props.alive}\n size=\"small\"\n style={detailsButtonStyle}\n onClick={() => {\n if (!this.state.open) {\n this.loadDetails().catch(console.error);\n this.setState({ open: true });\n }\n }}\n color=\"primary\"\n >\n <MoreVertIcon />\n </Fab>\n ) : null}\n </Box>\n <div style={statusStyle}>\n {status.map((s, i) => (\n <DeviceStatusComponent\n key={i}\n status={s}\n />\n ))}\n </div>\n <div style={bodyStyle}>\n <Typography\n variant=\"body1\"\n style={deviceInfoStyle}\n >\n <div onClick={this.copyToClipboard}>\n <b style={{ marginRight: 4 }}>ID:</b>\n {this.props.device.id.replace(/.*\\.\\d\\./, '')}\n </div>\n {this.props.device.manufacturer ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('manufacturer')}:</b>\n {getText(this.props.device.manufacturer)}\n </div>\n ) : null}\n {this.props.device.model ? (\n <div>\n <b style={{ marginRight: 4 }}>{getTranslation('model')}:</b>\n {getText(this.props.device.model)}\n </div>\n ) : null}\n </Typography>\n {!!this.props.device.actions?.length && (\n <div\n style={{\n flex: 1,\n position: 'relative',\n display: 'flex',\n gap: 8,\n paddingBottom: 5,\n height: 34,\n paddingLeft: 10,\n paddingRight: 10,\n }}\n >\n {this.renderActions()}\n <div style={{ flexGrow: 1 }} />\n {this.renderControls()}\n </div>\n )}\n </div>\n {this.renderDialog()}\n {this.renderControlDialog()}\n </Paper>\n );\n }\n\n render(): JSX.Element {\n if (this.props.smallCards) {\n return this.renderSmall();\n }\n\n return this.renderBig();\n }\n}\n\nexport default DeviceCard;\n","import React, { Component } from 'react';\n\nimport {\n Backdrop,\n Box,\n Button,\n Checkbox,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControl,\n FormControlLabel,\n Grid2,\n IconButton,\n Input,\n InputAdornment,\n InputLabel,\n LinearProgress,\n MenuItem,\n Select,\n Slider,\n Snackbar,\n TextField,\n Typography,\n} from '@mui/material';\n\nimport { Close, Check } from '@mui/icons-material';\n\nimport type { Connection, AdminConnection, ThemeName, ThemeType, IobTheme } from '@iobroker/adapter-react-v5';\nimport { type ConfigItemPanel } from '@iobroker/json-config';\nimport type {\n ActionBase,\n ControlBase,\n ControlState,\n DeviceInfo,\n DeviceRefresh,\n InstanceDetails,\n} from '@iobroker/dm-utils';\n\nimport { getTranslation } from './Utils';\nimport JsonConfig from './JsonConfig';\n\ndeclare module '@mui/material/Button' {\n interface ButtonPropsColorOverrides {\n grey: true;\n }\n}\n\nexport type CommunicationProps = {\n /** Socket connection */\n socket: Connection;\n /** Instance to communicate with device-manager backend, like `adapterName.X` */\n selectedInstance: string; // adapterName.X\n registerHandler?: (handler: null | ((command: string) => void)) => void;\n themeName: ThemeName;\n themeType: ThemeType;\n theme: IobTheme;\n isFloatComma: boolean;\n dateFormat: string;\n};\n\ninterface CommunicationForm {\n title?: string | null | undefined;\n schema?: ConfigItemPanel;\n data?: Record<string, any>;\n handleClose?: (data?: Record<string, any>) => void;\n}\n\ninterface InputAction extends ActionBase {\n /** If it is a device action */\n deviceId?: string;\n /** Optional refresh function to execute */\n refresh?: () => void;\n}\n\nexport type CommunicationState = {\n showSpinner: boolean;\n showToast: string | null;\n message: {\n message: string;\n handleClose: () => void;\n } | null;\n confirm: {\n message: string;\n handleClose: (confirmation?: boolean) => void;\n } | null;\n form: CommunicationForm | null;\n progress: {\n open: boolean;\n progress: number;\n } | null;\n showConfirmation: InputAction | null;\n showInput: InputAction | null;\n inputValue: string | boolean | number | null;\n};\n\ninterface DmResponse {\n /* Type of message */\n type: 'message' | 'confirm' | 'progress' | 'result' | 'form';\n /* Origin */\n origin: string;\n}\n\ninterface DmControlResponse extends DmResponse {\n result: {\n error?: {\n code: number;\n message: string;\n };\n state?: ioBroker.State;\n deviceId: string;\n controlId: string;\n };\n}\n\ninterface Message {\n actionId?: string;\n deviceId?: string;\n value?: unknown;\n origin?: string;\n confirm?: boolean;\n data?: any;\n}\n\ninterface DmActionResponse extends DmResponse {\n result: {\n refresh?: DeviceRefresh;\n error?: {\n code: number;\n message: string;\n };\n };\n message?: string;\n confirm?: string;\n form?: any;\n progress?: {\n open: boolean;\n progress: number;\n };\n}\n\n/**\n * Device List Component\n */\nclass Communication<P extends CommunicationProps, S extends CommunicationState> extends Component<P, S> {\n // eslint-disable-next-line react/no-unused-class-component-methods\n instanceHandler: (action: ActionBase) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n deviceHandler: (deviceId: string, action: ActionBase, refresh: () => void) => () => void;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlHandler: (\n deviceId: string,\n control: ControlBase,\n state: ControlState,\n ) => () => Promise<ioBroker.State | null>;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n controlStateHandler: (deviceId: string, control: ControlBase) => () => Promise<ioBroker.State | null>;\n\n constructor(props: P) {\n super(props);\n\n this.state = {\n showSpinner: false,\n showToast: null,\n message: null,\n confirm: null,\n form: null,\n progress: null,\n showConfirmation: null,\n showInput: null,\n inputValue: null,\n } as S;\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.instanceHandler = action => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: action });\n return;\n }\n if (action.inputBefore) {\n this.setState({ showInput: action });\n return;\n }\n\n this.sendActionToInstance('dm:instanceAction', { actionId: action.id });\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.deviceHandler = (deviceId, action, refresh) => () => {\n if (action.confirmation) {\n this.setState({ showConfirmation: { ...action, deviceId, refresh } });\n return;\n }\n if (action.inputBefore) {\n this.setState({\n showInput: { ...action, deviceId, refresh },\n inputValue: action.inputBefore.defaultValue || '',\n });\n return;\n }\n\n this.sendActionToInstance('dm:deviceAction', { deviceId, actionId: action.id }, refresh);\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlHandler = (deviceId, control, state) => () =>\n this.sendControlToInstance('dm:deviceControl', { deviceId, controlId: control.id, state });\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n this.controlStateHandler = (deviceId, control) => () =>\n this.sendControlToInstance('dm:deviceControlState', { deviceId, controlId: control.id });\n\n if (this.props.registerHandler) {\n this.props.registerHandler(() => this.loadData());\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n loadData(): void {\n console.error('loadData not implemented');\n }\n\n sendActionToInstance = (command: `dm:${string}`, messageToSend: Message, refresh?: () => void): void => {\n const send = async (): Promise<void> => {\n this.setState({ showSpinner: true });\n const response: DmActionResponse = await this.props.socket.sendTo(\n this.props.selectedInstance,\n command,\n messageToSend,\n );\n\n const type: string = response.type;\n console.log(`Response: ${response.type}`);\n switch (type) {\n case 'message':\n console.log(`Message received: ${response.message}`);\n if (response.message) {\n this.setState({\n message: {\n message: response.message,\n handleClose: () =>\n this.setState({ message: null }, () =>\n this.sendActionToInstance(\n 'dm:actionProgress',\n { origin: response.origin },\n refresh,\n ),\n ),\n },\n });\n }\n break;\n\n case 'confirm':\n console.log(`Confirm received: ${response.confirm}`);\n if (response.confirm) {\n this.setState({\n confirm: {\n message: response.confirm,\n handleClose: (confirm?: boolean) =>\n this.setState({ confirm: null }, () =>\n this.sendActionToInstance(\n 'dm:actionProgress',\n {\n origin: response.origin,\n confirm,\n },\n refresh,\n ),\n ),\n },\n });\n }\n break;\n\n case 'form':\n console.log('Form received');\n if (response.form) {\n this.setState({\n form: {\n ...response.form,\n handleClose: (data: any) =>\n this.setState({ form: null }, () => {\n console.log(`Form ${JSON.stringify(data)}`);\n this.sendActionToInstance(\n 'dm:actionProgress',\n {\n origin: response.origin,\n data,\n },\n refresh,\n );\n }),\n },\n });\n }\n break;\n\n case 'progress':\n if (response.progress) {\n if (this.state.progress) {\n const progress = { ...this.state.progress, ...response.progress };\n this.setState({ progress });\n } else {\n this.setState({ progress: response.progress });\n }\n }\n this.sendActionToInstance('dm:actionProgress', { origin: response.origin }, refresh);\n break;\n\n case 'result':\n console.log('Response content', response.result);\n if (response.result.refresh) {\n if (response.result.refresh === true) {\n console.log('Refreshing all');\n this.loadData();\n } else if (response.result.refresh === 'instance') {\n console.log(`Refreshing instance infos: ${this.props.selectedInstance}`);\n } else if (response.result.refresh === 'device') {\n if (!refresh) {\n console.log('No refresh function provided to refresh \"device\"');\n } else {\n console.log(`Refreshing device infos: ${this.props.selectedInstance}`);\n refresh();\n }\n } else {\n console.log('Not refreshing anything');\n }\n }\n if (response.result.error) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message });\n }\n this.setState({ showSpinner: false });\n break;\n\n default:\n console.log(`Unknown response type: ${type}`);\n this.setState({ showSpinner: false });\n break;\n }\n };\n\n void send().catch(console.error);\n };\n\n sendControlToInstance = async (\n command: string,\n messageToSend: { deviceId: string; controlId: string; state?: ControlState },\n ): Promise<null | ioBroker.State> => {\n const response: DmControlResponse = await this.props.socket.sendTo(\n this.props.selectedInstance,\n command,\n messageToSend,\n );\n const type = response.type;\n console.log(`Response: ${response.type}`);\n if (response.type === 'result') {\n console.log('Response content', response.result);\n if (response.result.error) {\n console.error(`Error: ${response.result.error.message}`);\n this.setState({ showToast: response.result.error.message });\n } else if (response.result.state !== undefined) {\n return response.result.state;\n }\n } else {\n console.warn('Unexpected response type', type);\n }\n\n return null;\n };\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n loadDevices(): Promise<DeviceInfo[]> {\n return this.props.socket.sendTo(this.props.selectedInstance, 'dm:listDevices');\n }\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n loadInstanceInfos(): Promise<InstanceDetails> {\n return this.props.socket.sendTo(this.props.selectedInstance, 'dm:instanceInfo');\n }\n\n renderMessageDialog(): React.JSX.Element | null {\n if (!this.state.message) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => this.state.message?.handleClose()}\n hideBackdrop\n aria-describedby=\"message-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"message-dialog-description\">{this.state.message?.message}</DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n color=\"primary\"\n onClick={() => this.state.message?.handleClose()}\n variant=\"contained\"\n autoFocus\n >\n {getTranslation('okButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderConfirmDialog(): React.JSX.Element | null {\n if (!this.state.confirm) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => this.state.confirm?.handleClose()}\n hideBackdrop\n aria-describedby=\"confirm-dialog-description\"\n >\n <DialogContent>\n <DialogContentText id=\"confirm-dialog-description\">\n {getTranslation(this.state.confirm?.message)}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => this.state.confirm?.handleClose(true)}\n autoFocus\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.state.confirm?.handleClose(false)}\n autoFocus\n >\n {getTranslation('noButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderSnackbar(): React.JSX.Element {\n return (\n <Snackbar\n open={!!this.state.showToast}\n autoHideDuration={6_000}\n onClose={() => this.setState({ showToast: null })}\n message={this.state.showToast}\n />\n );\n }\n\n renderFormDialog(): React.JSX.Element | null {\n if (!this.state.form || !this.state.form.schema || !this.state.form.data) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.state.form?.handleClose && this.state.form.handleClose()}\n hideBackdrop\n >\n {this.state.form?.title ? <DialogTitle>{getTranslation(this.state.form?.title)}</DialogTitle> : null}\n <DialogContent>\n <JsonConfig\n instanceId={this.props.selectedInstance}\n schema={this.state.form.schema}\n data={this.state.form.data}\n socket={this.props.socket as AdminConnection}\n onChange={(data: Record<string, any>) => {\n console.log('handleFormChange', { data });\n const form: CommunicationForm | null | undefined = { ...this.state.form };\n if (form) {\n form.data = data;\n this.setState({ form });\n }\n }}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() =>\n this.state.form?.handleClose && this.state.form.handleClose(this.state.form?.data)\n }\n autoFocus\n >\n {getTranslation('okButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.state.form?.handleClose && this.state.form.handleClose()}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderProgressDialog(): React.JSX.Element | null {\n if (!this.state.progress?.open) {\n return null;\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => {}}\n hideBackdrop\n >\n <LinearProgress\n variant=\"determinate\"\n value={this.state.progress?.progress || 0}\n />\n </Dialog>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n renderContent(): React.JSX.Element | React.JSX.Element[] | null {\n return null;\n }\n\n renderSpinner(): React.JSX.Element | null {\n if (\n !this.state.showSpinner &&\n !this.state.progress?.open &&\n !this.state.message &&\n !this.state.confirm &&\n !this.state.form\n ) {\n return null;\n }\n return (\n <Backdrop\n style={{ zIndex: 1000 }}\n open={!0}\n >\n <CircularProgress />\n </Backdrop>\n );\n }\n\n renderConfirmationDialog(): React.JSX.Element | null {\n if (!this.state.showConfirmation) {\n return null;\n }\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showConfirmation: null })}\n >\n <DialogTitle>\n {getTranslation(\n this.state.showConfirmation.confirmation === true\n ? getTranslation('areYouSureText')\n : getTranslation(this.state.showConfirmation.confirmation as ioBroker.StringOrTranslated),\n )}\n </DialogTitle>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={() => {\n if (!this.state.showConfirmation) {\n return;\n }\n\n const showConfirmation = this.state.showConfirmation;\n this.setState({ showConfirmation: null }, () => {\n if (showConfirmation.deviceId) {\n this.sendActionToInstance(\n 'dm:deviceAction',\n { actionId: showConfirmation.id, deviceId: showConfirmation.deviceId },\n showConfirmation.refresh,\n );\n } else {\n this.sendActionToInstance('dm:instanceAction', { actionId: showConfirmation.id });\n }\n });\n }}\n autoFocus\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showConfirmation: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n renderInputDialog(): React.JSX.Element | null {\n if (!this.state.showInput || !this.state.showInput.inputBefore) {\n return null;\n }\n let okDisabled = false;\n if (!this.state.showInput.inputBefore.allowEmptyValue && this.state.showInput.inputBefore.type !== 'checkbox') {\n if (\n this.state.showInput.inputBefore.type === 'number' ||\n this.state.showInput.inputBefore.type === 'slider'\n ) {\n okDisabled =\n this.state.inputValue === '' ||\n this.state.inputValue === null ||\n !window.isFinite(this.state.inputValue as number);\n } else {\n okDisabled = !this.state.inputValue;\n }\n }\n\n return (\n <Dialog\n open={!0}\n onClose={() => this.setState({ showInput: null })}\n >\n <DialogTitle>{getTranslation('pleaseEnterValueText')}</DialogTitle>\n <DialogContent>\n {this.state.showInput.inputBefore.type === 'text' ||\n this.state.showInput.inputBefore.type === 'number' ||\n !this.state.showInput.inputBefore.type ? (\n <TextField\n autoFocus\n margin=\"dense\"\n label={getTranslation(this.state.showInput.inputBefore.label)}\n slotProps={{\n htmlInput:\n this.state.showInput.inputBefore.type === 'number'\n ? {\n min: this.state.showInput.inputBefore.min,\n max: this.state.showInput.inputBefore.max,\n step: this.state.showInput.inputBefore.step,\n }\n : undefined,\n input: {\n endAdornment: this.state.inputValue ? (\n <InputAdornment position=\"end\">\n <IconButton\n size=\"small\"\n onClick={() => this.setState({ inputValue: '' })}\n >\n <Close />\n </IconButton>\n </InputAdornment>\n ) : null,\n },\n }}\n type={this.state.showInput.inputBefore.type === 'number' ? 'number' : 'text'}\n fullWidth\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'checkbox' ? (\n <FormControlLabel\n control={\n <Checkbox\n checked={!!this.state.inputValue}\n autoFocus\n onChange={e => this.setState({ inputValue: e.target.checked })}\n />\n }\n label={getTranslation(this.state.showInput.inputBefore.label)}\n />\n ) : null}\n {this.state.showInput.inputBefore.type === 'select' ? (\n <FormControl fullWidth>\n <InputLabel>{getTranslation(this.state.showInput.inputBefore.label)}</InputLabel>\n <Select\n variant=\"standard\"\n value={this.state.inputValue}\n onChange={e => this.setState({ inputValue: e.target.value })}\n >\n {this.state.showInput.inputBefore.options?.map(item => (\n <MenuItem\n key={item.value}\n value={item.value}\n >\n {getTranslation(item.label)}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n ) : null}\n {this.state.showInput.inputBefore.type === 'slider' ? (\n <Box sx={{ width: '100%' }}>\n <Typography gutterBottom>\n {getTranslation(this.state.showInput.inputBefore.label)}\n </Typography>\n <Grid2\n container\n spacing={2}\n alignItems=\"center\"\n >\n <Grid2>\n <Slider\n value={typeof this.state.inputValue === 'number' ? this.state.inputValue : 0}\n onChange={(event: Event, newValue: number) =>\n this.setState({ inputValue: newValue })\n }\n />\n </Grid2>\n <Grid2>\n <Input\n value={this.state.inputValue}\n size=\"small\"\n onChange={e =>\n this.setState({\n inputValue: e.target.value === '' ? 0 : Number(e.target.value),\n })\n }\n onBlur={() => {\n if (!this.state.showInput) {\n return;\n }\n\n const min =\n this.state.showInput.inputBefore?.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min;\n const max =\n this.state.showInput.inputBefore?.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max;\n\n if ((this.state.inputValue as number) < min) {\n this.setState({ inputValue: min });\n } else if ((this.state.inputValue as number) > max) {\n this.setState({ inputValue: max });\n }\n }}\n inputProps={{\n step: this.state.showInput.inputBefore.step,\n min:\n this.state.showInput.inputBefore.min === undefined\n ? 0\n : this.state.showInput.inputBefore.min,\n max:\n this.state.showInput.inputBefore.max === undefined\n ? 100\n : this.state.showInput.inputBefore.max,\n type: 'number',\n }}\n />\n </Grid2>\n </Grid2>\n </Box>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n disabled={okDisabled}\n color=\"primary\"\n onClick={() => {\n if (!this.state.showInput) {\n return;\n }\n\n const showInput = this.state.showInput;\n this.setState({ showInput: null }, () => {\n if (showInput.deviceId) {\n this.sendActionToInstance(\n 'dm:deviceAction',\n {\n actionId: showInput.id,\n deviceId: showInput.deviceId,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n },\n showInput.refresh,\n );\n } else {\n this.sendActionToInstance('dm:instanceAction', {\n actionId: showInput.id,\n value:\n showInput.inputBefore?.type === 'checkbox'\n ? !!this.state.inputValue\n : showInput.inputBefore?.type === 'number'\n ? parseFloat(this.state.inputValue as string) || 0\n : this.state.inputValue,\n });\n }\n });\n }}\n startIcon={<Check />}\n >\n {getTranslation('yesButtonText')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"grey\"\n onClick={() => this.setState({ showInput: null })}\n startIcon={<Close />}\n >\n {getTranslation('cancelButtonText')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n }\n\n render(): React.JSX.Element {\n return (\n <>\n {this.renderSnackbar()}\n {this.renderContent()}\n {this.renderSpinner()}\n {this.renderConfirmDialog()}\n {this.renderMessageDialog()}\n {this.renderFormDialog()}\n {this.renderProgressDialog()}\n {this.renderConfirmationDialog()}\n {this.renderInputDialog()}\n </>\n );\n }\n}\n\nexport default Communication;\n","import React from 'react';\n\nimport type { ActionBase, InstanceAction } from '@iobroker/dm-utils';\n\nimport TooltipButton from './TooltipButton';\nimport { getTranslation, renderActionIcon } from './Utils';\n\ninterface InstanceActionButtonProps {\n action: InstanceAction;\n instanceHandler: (action: ActionBase) => () => void;\n}\n\nexport default function InstanceActionButton(params: InstanceActionButtonProps): React.JSX.Element | null {\n const { action, instanceHandler } = params;\n\n const tooltip = getTranslation(action?.description ? action.description : '');\n const title = getTranslation(action?.title ? action.title : '');\n\n const icon = renderActionIcon(action);\n\n return (\n <TooltipButton\n tooltip={tooltip}\n label={title}\n disabled={action.disabled}\n Icon={icon}\n onClick={instanceHandler(action)}\n />\n );\n}\n","import React, { type JSX } from 'react';\nimport { IconButton, InputAdornment, TextField, Toolbar, Tooltip, LinearProgress } from '@mui/material';\n\nimport { Clear, Refresh } from '@mui/icons-material';\n\nimport { I18n } from '@iobroker/adapter-react-v5';\nimport type { DeviceInfo, InstanceDetails } from '@iobroker/dm-utils';\n\nimport DeviceCard from './DeviceCard';\nimport { getTranslation } from './Utils';\nimport Communication, { type CommunicationProps, type CommunicationState } from './Communication';\nimport InstanceActionButton from './InstanceActionButton';\n\nimport de from './i18n/de.json';\nimport en from './i18n/en.json';\nimport ru from './i18n/ru.json';\nimport pt from './i18n/pt.json';\nimport nl from './i18n/nl.json';\nimport fr from './i18n/fr.json';\nimport it from './i18n/it.json';\nimport es from './i18n/es.json';\nimport pl from './i18n/pl.json';\nimport uk from './i18n/uk.json';\nimport zhCn from './i18n/zh-cn.json';\n\ninterface DeviceListProps extends CommunicationProps {\n /** Instance to upload images to, like `adapterName.X` */\n uploadImagesToInstance?: string;\n /** Filter devices with this string */\n filter?: string;\n /** If this component is used in GUI with own toolbar. `false` if this list is used with multiple instances and true if only with one (in this case, it will monitor alive itself */\n embedded?: boolean;\n /** If embedded, this text is shown in the toolbar */\n title?: string;\n /** Style of a component that displays all devices */\n style?: React.CSSProperties;\n /** Use small cards for devices */\n smallCards?: boolean;\n /** To trigger the reload of devices, just change this variable */\n triggerLoad?: number;\n}\n\ninterface DeviceListState extends CommunicationState {\n devices: DeviceInfo[];\n filteredDevices: DeviceInfo[];\n filter: string;\n instanceInfo: InstanceDetails;\n loading: boolean;\n alive: boolean | null;\n triggerLoad: number;\n}\n\n/**\n * Device List Component\n */\nexport default class DeviceList extends Communication<DeviceListProps, DeviceListState> {\n static i18nInitialized = false;\n\n private lastPropsFilter: string | undefined;\n\n private lastInstance: string;\n\n private lastTriggerLoad = 0;\n\n private filterTimeout: ReturnType<typeof setTimeout> | null;\n\n private readonly language: ioBroker.Languages;\n\n constructor(props: DeviceListProps) {\n super(props);\n\n if (!DeviceList.i18nInitialized) {\n DeviceList.i18nInitialized = true;\n I18n.extendTranslations({\n en,\n de,\n ru,\n pt,\n nl,\n fr,\n it,\n es,\n pl,\n uk,\n 'zh-cn': zhCn,\n });\n }\n\n Object.assign(this.state, {\n devices: [],\n filteredDevices: [],\n filter: '',\n instanceInfo: null,\n loading: null,\n alive: null,\n });\n\n this.lastPropsFilter = this.props.filter;\n this.lastInstance = this.props.selectedInstance;\n this.lastTriggerLoad = this.props.triggerLoad || 0;\n this.filterTimeout = null;\n this.language = I18n.getLanguage();\n }\n\n async componentDidMount(): Promise<void> {\n let alive = false;\n if (this.state.alive === null) {\n try {\n // check if instance is alive\n const stateAlive = await this.props.socket.getState(\n `system.adapter.${this.props.selectedInstance}.alive`,\n );\n if (stateAlive?.val) {\n alive = true;\n }\n } catch (error) {\n console.error(error);\n }\n this.setState({ alive }, () =>\n this.props.socket.subscribeState(\n `system.adapter.${this.props.selectedInstance}.alive`,\n this.aliveHandler,\n ),\n );\n if (!alive) {\n return;\n }\n } else {\n alive = this.state.alive;\n }\n\n if (!this.props.embedded && alive) {\n try {\n const instanceInfo = await this.loadInstanceInfos();\n this.setState({ instanceInfo });\n } catch (error) {\n console.error(error);\n }\n }\n if (alive) {\n this.loadData();\n }\n }\n\n componentWillUnmount(): void {\n this.props.socket.unsubscribeState(`system.adapter.${this.props.selectedInstance}.alive`, this.aliveHandler);\n }\n\n aliveHandler: ioBroker.StateChangeHandler = (id: string, state: ioBroker.State | null | undefined): void => {\n if (id === `system.adapter.${this.props.selectedInstance}.alive`) {\n const alive = !!state?.val;\n if (alive !== this.state.alive) {\n this.setState({ alive }, () => {\n if (alive) {\n this.componentDidMount().catch(console.error);\n }\n });\n }\n }\n };\n\n /**\n * Load devices\n */\n override loadData(): void {\n this.setState({ loading: true }, async () => {\n console.log(`Loading devices for ${this.props.selectedInstance}...`);\n let devices: DeviceInfo[] = [];\n try {\n devices = await this.loadDevices();\n\n if (!devices || !Array.isArray(devices)) {\n console.error(\n `Message returned from sendTo() doesn't look like one from DeviceManagement, did you accidentally handle the message in your adapter? ${JSON.stringify(\n devices,\n )}`,\n );\n devices = [];\n }\n } catch (error) {\n console.error(error);\n devices = [];\n }\n\n this.setState({ devices, loading: false }, () => this.applyFilter());\n });\n }\n\n getText(text: ioBroker.StringOrTranslated): string {\n if (typeof text === 'object') {\n return text[this.language] || text.en;\n }\n\n return text;\n }\n\n applyFilter(): void {\n const filter = this.props.embedded ? this.props.filter : this.state.filter;\n\n // filter devices name\n if (filter) {\n const filteredDevices = this.state.devices.filter(device =>\n this.getText(device.name).toLowerCase().includes(filter.toLowerCase()),\n );\n this.setState({ filteredDevices });\n } else {\n this.setState({ filteredDevices: this.state.devices });\n }\n }\n\n handleFilterChange(filter: string): void {\n this.setState({ filter }, () => {\n if (this.filterTimeout) {\n clearTimeout(this.filterTimeout);\n }\n this.filterTimeout = setTimeout(() => {\n this.filterTimeout = null;\n this.applyFilter();\n }, 250);\n });\n }\n\n renderContent(): JSX.Element | JSX.Element[] | null {\n const emptyStyle: React.CSSProperties = {\n padding: 25,\n };\n\n if ((this.props.triggerLoad || 0) !== this.lastTriggerLoad) {\n this.lastTriggerLoad = this.props.triggerLoad || 0;\n setTimeout(() => this.loadData(), 50);\n }\n\n if (this.props.embedded && this.lastPropsFilter !== this.props.filter) {\n this.lastPropsFilter = this.props.filter;\n setTimeout(() => this.applyFilter(), 50);\n }\n if (this.props.embedded && this.lastInstance !== this.props.selectedInstance) {\n this.lastInstance = this.props.selectedInstance;\n setTimeout(() => this.loadData(), 50);\n }\n\n let list;\n if (!this.props.embedded && !this.state.alive) {\n list = (\n <div style={emptyStyle}>\n <span>{getTranslation('instanceNotAlive')}</span>\n </div>\n );\n } else if (!this.state.devices.length && this.props.selectedInstance) {\n list = (\n <div style={emptyStyle}>\n <span>{getTranslation('noDevicesFoundText')}</span>\n </div>\n );\n } else if (this.state.devices.length && !this.state.filteredDevices.length) {\n list = (\n <div style={emptyStyle}>\n <span>{getTranslation('allDevicesFilteredOut')}</span>\n </div>\n );\n } else {\n list = this.state.filteredDevices.map(device => (\n <DeviceCard\n alive={!!this.state.alive}\n key={device.id}\n id={device.id}\n title={this.getText(device.name)}\n device={device}\n instanceId={this.props.selectedInstance}\n uploadImagesToInstance={this.props.uploadImagesToInstance}\n deviceHandler={this.deviceHandler}\n controlHandler={this.controlHandler}\n controlStateHandler={this.controlStateHandler}\n socket={this.props.socket}\n themeName={this.props.themeName}\n themeType={this.props.themeType}\n theme={this.props.theme}\n isFloatComma={this.props.isFloatComma}\n dateFormat={this.props.dateFormat}\n />\n ));\n }\n\n if (this.props.embedded) {\n return (\n <>\n {this.state.loading ? <LinearProgress style={{ width: '100%' }} /> : null}\n {list}\n </>\n );\n }\n\n return (\n <div style={{ width: '100%', height: '100%', overflow: 'hidden' }}>\n <Toolbar\n variant=\"dense\"\n style={{ backgroundColor: '#777', display: 'flex' }}\n >\n {this.props.title}\n {this.props.selectedInstance ? (\n <Tooltip\n title={getTranslation('refreshTooltip')}\n slotProps={{ popper: { sx: { pointerEvents: 'none' } } }}\n >\n <span>\n <IconButton\n onClick={() => this.loadData()}\n disabled={!this.state.alive}\n size=\"small\"\n >\n <Refresh />\n </IconButton>\n </span>\n </Tooltip>\n ) : null}\n {this.state.alive && this.state.instanceInfo?.actions?.length ? (\n <div style={{ marginLeft: 20 }}>\n {this.state.instanceInfo.actions.map(action => (\n <InstanceActionButton\n key={action.id}\n action={action}\n instanceHandler={this.instanceHandler}\n />\n ))}\n </div>\n ) : null}\n\n <div style={{ flexGrow: 1 }} />\n\n {this.state.alive ? (\n <TextField\n variant=\"standard\"\n style={{ width: 200 }}\n size=\"small\"\n label={getTranslation('filterLabelText')}\n onChange={e => this.handleFilterChange(e.target.value)}\n value={this.state.filter}\n autoComplete=\"off\"\n slotProps={{\n input: {\n autoComplete: 'new-password',\n endAdornment: this.state.filter ? (\n <InputAdornment position=\"end\">\n <IconButton\n onClick={() => this.handleFilterChange('')}\n edge=\"end\"\n >\n <Clear />\n </IconButton>\n </InputAdornment>\n ) : null,\n },\n htmlInput: {\n autoComplete: 'off',\n },\n }}\n />\n ) : null}\n </Toolbar>\n <div\n style={{\n width: '100%',\n height: 'calc(100% - 56px)',\n marginTop: 8,\n overflow: 'auto',\n // justifyContent: 'center',\n // alignItems: 'stretch',\n // display: 'grid',\n // columnGap: 8,\n // rowGap: 8,\n ...this.props.style,\n }}\n >\n {this.state.loading ? <LinearProgress style={{ width: '100%' }} /> : null}\n {list}\n </div>\n </div>\n );\n }\n}\n","import DeviceList from './DeviceList';\n\nexport default DeviceList;\n"],"names":["TooltipButton","props","tooltip","label","disabled","Icon","onClick","text","_jsx","Typography","variant","style","marginLeft","children","Tooltip","title","slotProps","popper","sx","pointerEvents","_jsxs","IconButton","size","getFaIcon","icon","color","iconStyle","split","map","s","trim","filter","includes","Delete","Edit","Refresh","Add","QrCode","Wifi","WifiOff","Bluetooth","BluetoothDisabled","Visibility","Search","LinkOff","LinkIcon","NotListedLocation","PlayArrow","Stop","Pause","FastForward","FastRewind","Group","Person","QuestionMark","getIconByName","name","altName","Lightbulb","Fluorescent","WbIncandescent","Power","Settings","WifiFind","Info","renderControlIcon","action","colors","value","_action$icon","_action$icon2","_action$iconOn","_action$icon3","colorOn","state","primary","secondary","startsWith","iconOn","src","id","renderActionIcon","_action$icon4","_action$icon5","_action$icon6","language","getTranslation","I18n","getLanguage","en","t","DeviceActionButton","_action$description","deviceId","refresh","deviceHandler","description","undefined","DeviceControlComponent","Component","constructor","_props$control$state","_props$control$state2","super","stateHandler","async","this","control","stateId","newState","controlStateHandler","ts","setState","val","componentDidMount","mayBePromise","socket","subscribeState","Promise","componentWillUnmount","unsubscribeState","getDerivedStateFromProps","_props$control$state3","_props$control$state4","sendControl","result","controlHandler","renderButton","_this$props$control$d","Button","startIcon","Fab","renderSwitch","_this$props$control$d2","Switch","checked","onChange","e","target","getColor","type","renderSelect","renderSlider","renderColor","renderIcon","_this$props$control$d3","colorProps","width","height","minHeight","render","styles","DeviceStatus","params","status","connection","iconStyleOK","fill","iconStyleNotOK","iconStyleWarning","batteryIconTooltip","battery","BatteryFullIcon","Battery90Icon","Battery80Icon","Battery60Icon","Battery50Icon","Battery30Icon","Battery20Icon","BatteryAlertIcon","display","alignItems","flexDirection","LinkOffIcon","rssi","NetworkCheckIcon","fontSize","margin","BatteryCharging50Icon","marginRight","warning","WarningIcon","JsonConfig","_props$socket$systemC","_props$socket$systemC2","instanceId","schema","data","error","setError","useState","adapterName","instance","_Fragment","JsonConfigComponent","parseInt","onError","_data","embedded","themeName","themeType","theme","isFloatComma","systemConfig","common","dateFormat","manufacturer","model","onImageSelect","uploadImagesToInstance","opacity","position","zIndex","accept","event","files","length","file","reader","FileReader","onload","img","Image","canvas","document","createElement","ctx","getContext","drawImage","resizedImage","toDataURL","fileName","base64Data","replace","response","writeFile64","console","log","JSON","stringify","readAsDataURL","NoImageIcon","viewBox","className","d","getText","DeviceCard","details","loadDetails","catch","copyToClipboard","textToCopy","device","Utils","alert","open","showControlDialog","fetchIcon","lang","readFile","mimeType","sendTo","renderDialog","Dialog","maxWidth","onClose","DialogContent","DialogActions","alive","autoFocus","renderControlDialog","_this$props$device$co","DialogTitle","top","right","CloseIcon","controls","renderControls","_this$props$device$co2","_this$props$device$co3","_this$props$device$co4","firstControl","ControlIcon","renderActions","_this$props$device$ac","actions","a","renderSmall","hasDetails","Array","isArray","IconDeviceType","Card","minWidth","CardHeader","backgroundColor","palette","main","invertColor","contrastText","avatar","DeviceImageUpload","imageData","MoreVertIcon","subheader","CardContent","background","padding","borderRadius","i","DeviceStatusComponent","textOverflow","overflow","CardActions","disableSpacing","flexGrow","renderBig","_this$state$details","_this$state$details$d","_this$state$details2","_this$state$details2$","_this$props$device$ac2","imgStyle","maxHeight","Paper","Box","gap","paddingLeft","justifyContent","fontWeight","whiteSpace","bottom","flex","paddingBottom","paddingRight","smallCards","Communication","instanceHandler","sendActionToInstance","command","messageToSend","showSpinner","selectedInstance","message","handleClose","origin","confirm","form","progress","loadData","showToast","send","sendControlToInstance","warn","showConfirmation","showInput","inputValue","confirmation","inputBefore","actionId","defaultValue","controlId","registerHandler","loadDevices","loadInstanceInfos","renderMessageDialog","_this$state$message2","_this$state$message","hideBackdrop","DialogContentText","_this$state$message3","renderConfirmDialog","_this$state$confirm2","_this$state$confirm","_this$state$confirm3","_this$state$confirm4","renderSnackbar","Snackbar","autoHideDuration","renderFormDialog","_this$state$form2","_this$state$form3","_this$state$form","_this$state$form4","_this$state$form5","_this$state$form6","renderProgressDialog","_this$state$progress","_this$state$progress2","LinearProgress","renderContent","renderSpinner","_this$state$progress3","Backdrop","CircularProgress","renderConfirmationDialog","Check","Close","renderInputDialog","_this$state$showInput","okDisabled","allowEmptyValue","window","isFinite","TextField","htmlInput","min","max","step","input","endAdornment","InputAdornment","fullWidth","FormControlLabel","Checkbox","FormControl","InputLabel","Select","options","item","MenuItem","gutterBottom","Grid2","container","spacing","Slider","newValue","Input","Number","onBlur","_this$state$showInput2","_this$state$showInput3","inputProps","_showInput$inputBefor","_showInput$inputBefor2","_showInput$inputBefor3","_showInput$inputBefor4","parseFloat","InstanceActionButton","DeviceList","lastPropsFilter","lastInstance","lastTriggerLoad","filterTimeout","aliveHandler","i18nInitialized","extendTranslations","de","ru","pt","nl","fr","it","es","pl","uk","zhCn","Object","assign","devices","filteredDevices","instanceInfo","loading","triggerLoad","stateAlive","getState","applyFilter","toLowerCase","handleFilterChange","clearTimeout","setTimeout","_this$state$instanceI","_this$state$instanceI2","emptyStyle","list","Toolbar","autoComplete","edge","Clear","marginTop"],"sourceRoot":""}
|