iobroker.admin 6.2.0 → 6.2.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.
@@ -0,0 +1,3 @@
1
+ (self.webpackChunksrc_rx=self.webpackChunksrc_rx||[]).push([[7397],{98639:function(Ea,wt,c){"use strict";c.r(wt),c.d(wt,{default:function(){return ya}});var b=c(4819),e=c.n(b),oo=c(15854),y=c.n(oo),H=c(23060),xe=c(58503),te=c(72170),ao=c(66966),no=c(59357),me=c(88261),lo=c(30464),n=c(94427),rt=c(37538),it=c(22675),ro=c(45761),io=c(54198),st=c(10186),so=c(40314),co=c(3544),po=c(65228),mo=c(21936),It=c(62976),Le=c(89137),Ne=c(65853),ct=c(53626),uo=c(39),ho=c(19110),go=c(94884),fo=c(42158),kt=c(61513),dt=c(11456),oe=c(13569),ae=c(71429),V=c(94466),Lt=c(43924),vo=c(70703),yo=c(28596),Eo=c(84998),bo=c(17688),xo=c(89316),Co=c(86887),So=c(44625),et=c(59599),Nt=c(82060),Tt=c(91495),Dt=c(18624),Oe=c(3241),A=c(39323),Zt=c(79458),pt=c(85761),Rt=c(43023),Ot=c(15044),ne=c(55289),Mt=c(41728),mt=c(64263),At=c(49905),ut=c(29314),Wt,Ft,Bt,wo=null;function ht(){return ht=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=r[o])}return s},ht.apply(this,arguments)}function Io(s,t){if(s==null)return{};var r=ko(s,t),o,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);for(a=0;a<l.length;a++)o=l[a],!(t.indexOf(o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,o)||(r[o]=s[o]))}return r}function ko(s,t){if(s==null)return{};var r={},o=Object.keys(s),a,l;for(l=0;l<o.length;l++)a=o[l],!(t.indexOf(a)>=0)&&(r[a]=s[a]);return r}function ba(s,t){var r=s.title,o=s.titleId,a=Io(s,wo);return React.createElement("svg",ht({width:256,height:230,xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":o},a),r?React.createElement("title",{id:o},r):null,Wt||(Wt=React.createElement("path",{d:"M251.22 187.856c5.785 10.045 6.345 20.608 1.538 28.958-4.8 8.357-14.192 13.143-25.768 13.143h-21.816c.259-4.068.431-8.17.431-12.302 0-4.628-.215-9.198-.531-13.754l14.35-.014c3.528 0 6.38-2.867 6.38-6.403a6.46 6.46 0 0 0-.768-3.053l-91.46-158.97a6.349 6.349 0 0 0-5.54-3.24 6.374 6.374 0 0 0-5.461 3.09l-14.522 25.243c44.134 33.27 73.804 84.813 77.864 143.333.316 4.548.531 9.119.531 13.753 0 4.132-.172 8.228-.424 12.302h-71.246c.388-4.053.611-8.148.611-12.302 0-4.649-.273-9.233-.776-13.753-3.52-32.206-19.286-60.748-42.503-80.89l-10.003 17.376c17.54 16.325 29.512 38.558 32.767 63.514.59 4.505.92 9.09.92 13.753 0 4.154-.273 8.264-.74 12.302H29.01c-11.576 0-20.968-4.793-25.768-13.15-4.807-8.35-4.247-18.905 1.538-28.958l13.56-23.238a79.42 79.42 0 0 1 20.715 16.052l-8.083 13.768a6.523 6.523 0 0 0-.77 3.054 6.383 6.383 0 0 0 6.382 6.395l32.033.015c-2.687-15.356-9.772-29.21-19.918-40.183-5.979-6.445-12.963-11.9-20.738-16.074l35.77-62.15a151.427 151.427 0 0 1 21.564 14.624c30.827 25.013 51.644 61.955 55.416 103.776h19.172c-3.91-48.892-28.477-92.006-64.937-120.548a171.205 171.205 0 0 0-21.672-14.457l30.532-53.045C109.583 5.77 118.42 0 128.036 0c9.607 0 18.438 5.77 24.223 15.823l98.961 172.033z",fill:"#FB2D26"})),Ft||(Ft=React.createElement("line",{strokeWidth:33,y2:223,x2:250.40002,y1:8,x1:6.40002,stroke:"#FB2D26",fill:"none"})),Bt||(Bt=React.createElement("line",{strokeWidth:32,y2:224,x2:8.40002,y1:7,x1:247.40002,stroke:"#FB2D26",fill:"none"})))}var xa=null,Ht=c.p+"static/media/sentryNo.40627b40a3bc6107ca445e9a6cec8601.svg",Te=c(4819);const Lo=s=>({nowrap:{flexFlow:"nowrap",overflow:"hidden"},width:{width:"100%",overflow:"hidden"}}),Pt=s=>Te.createElement(n.Grid,{item:!0,container:!0,title:s.icon?"":s.tooltip||"",alignItems:"center",direction:"row",spacing:1,className:s.classes.nowrap},Te.createElement(n.Grid,{item:!0},s.icon&&Te.createElement(n.Tooltip,{title:s.tooltip||""},s.icon)),Te.createElement(n.Grid,{className:s.classes.width,item:!0},Te.createElement(n.Tooltip,{title:s.tooltip||""},Te.createElement(n.Typography,{component:"div"},s.children))));Pt.propTypes={children:y().node,icon:y().node,tooltip:y().string};var D=(0,xe.withStyles)(Lo)(Pt),W=c(56599),jt=c(43253),No=c(51402),To=c(64527),Do=c(57931),Zo=c(29480),zt=c(66447),Ro=c(39801),Oo=c(19650),Mo=c(61984);const Ao=s=>({img:{width:"100%",height:"100%"}});class Gt extends b.Component{render(){if(!this.props.links||!this.props.links.length)return null;const t=this.props.links[0].port,r=this.props.links.find(o=>o.port!==t);return e().createElement(zt.Z,{onClose:()=>this.props.onClose(),open:!0},e().createElement(Zo.Z,null,this.props.t("Links")),e().createElement(No.Z,null,this.props.links.map(o=>e().createElement(To.Z,{style:o.color?{backgroundColor:o.color,color:Mo.Z.getInvertedColor(o.color,this.props.themeType,!0)}:{},onClick:a=>{a.stopPropagation();let l=o.link;l=l.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//[$1]$2/"),window.open(l,this.props.instanceId),this.props.onClose()},key:o.name},e().createElement(Ro.Z,null,e().createElement(Oo.Z,{variant:"rounded"},e().createElement("img",{className:this.props.classes.img,src:this.props.image,alt:this.props.instanceId}))),e().createElement(Do.Z,{primary:o.name+(r?` [:${o.port}]`:"")})))))}}Gt.propTypes={links:y().array.isRequired,onClose:y().func.isRequired,t:y().func.isRequired,instanceId:y().string.isRequired,image:y().string,themeType:y().string};var $t=(0,xe.withStyles)(Ao)(Gt),Ce=c(6815);const Wo="0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",Fo="0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)",Bo=s=>({root:{position:"relative",margin:10,width:300,minHeight:200,background:s.palette.background.default,boxShadow:Wo,display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:Fo}},imageBlock:{background:"silver",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",transition:"background 0.5s"},img:{width:45,height:45,margin:"auto 0",position:"relative","&:after":{content:'""',position:"absolute",zIndex:2,top:0,left:0,width:"100%",height:"100%",background:'url("img/no-image.png") 100% 100% no-repeat',backgroundSize:"cover",backgroundColor:"#fff"}},installed:{background:"#77c7ff8c"},fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},greenText:{color:s.palette.success.dark},collapse:{height:"100%",backgroundColor:s.palette.mode==="dark"?"#4a4a4a":"#d4d4d4",position:"absolute",width:"100%",zIndex:3,marginTop:"auto",bottom:0,transition:"height 0.3s",justifyContent:"space-between",display:"flex",flexDirection:"column"},collapseOff:{height:0},close:{width:"20px",height:"20px",opacity:"0.9",cursor:"pointer",position:"relative",marginLeft:"auto",marginBottom:10,transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:"9px",content:'""',height:"20px",width:"3px",backgroundColor:"#ff4f4f",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:"9px",content:'""',height:"20px",width:"3px",backgroundColor:"#ff4f4f",transform:"rotate(-45deg)"}},footerBlock:{background:s.palette.background.default,padding:10,display:"flex",justifyContent:"space-between"},hidden:{display:"none"},buttonUpdate:{border:"1px solid",padding:"0px 7px",borderRadius:5,display:"flex",alignItems:"center",cursor:"pointer",transition:"background 0.5s","&:hover":{background:"#00800026"}},versionDate:{alignSelf:"center"},adapter:{width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",paddingLeft:8,paddingTop:16,color:s.palette.mode==="dark"?"#333":"#555"},hide:{visibility:"hidden"},button:{padding:"5px",transition:"opacity 0.2s",height:34},hiddenOpacity:{opacity:0,cursor:"default"},enabled:{color:oe.Z[400],"&:hover":{backgroundColor:oe.Z[200]}},disabled:{color:V.Z[400],"&:hover":{backgroundColor:V.Z[200]}},cardContent:{marginTop:16,paddingTop:0},sentry:{width:24,height:24,objectFit:"fill",filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)"},cardContentH5:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},marginTop10:{marginTop:10},memoryIcon:{color:"#dc8e00"},displayFlex:{display:"flex"},logLevel:{width:"100%",marginBottom:5},hostInfo:{width:"100%"},overflowAuto:{overflow:"auto"},collapseIcon:{position:"sticky",right:0,top:0,background:s.palette.mode==="dark"?"#4a4a4a":"#d4d4d4",zIndex:2},addCompact:{width:"100%",marginBottom:5},addCompactButton:{display:"flex",margin:5,justifyContent:"space-around"},scheduleIcon:{color:"#dc8e00"},marginRight5:{marginRight:5},marginLeft5:{marginLeft:5},enableButton:{display:"flex",justifyContent:"space-between"},instanceStateNotAlive1:{backgroundColor:"rgba(192, 192, 192, 0.7)"},instanceStateAliveNotConnected1:{backgroundColor:"rgba(255, 177, 0, 0.4)"},instanceStateAliveAndConnected1:{backgroundColor:"rgba(0, 255, 0, 0.4)"},instanceName:{fontSize:16,padding:4,paddingBottom:15,fontWeight:"bold"},deleting:{position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},tooltip:{pointerEvents:"none"}}),Ho=["silly","debug","info","warn","error"],gt=[{value:1,desc:"1: Logic adapters"},{value:2,desc:"2: Data provider adapters"},{value:3,desc:"3: Other adapters"}],Vt=(0,b.memo)(({adminInstance:s,classes:t,maxCompactGroupNumber:r,onDeleteInstance:o,deleteCustomSupported:a,expertMode:l,extendObject:u,getMemory:T,getRestartSchedule:N,getSchedule:k,hidden:O,hosts:R,id:w,instance:g,key:I,lang:x,openConfig:M,setCompact:d,setCompactGroup:C,setHost:Z,setLogLevel:B,setMemoryLimitMB:F,setName:z,setRestartSchedule:U,setSchedule:ge,setSentry:Et,setTier:bt,t:f,themeType:Me,deleting:Ae,item:h})=>{var p,Se;const[ot,i]=(0,b.useState)(!1),[We,Fe]=(0,b.useState)(!1),[at,Be]=(0,b.useState)(!1),[le,re]=(0,b.useState)(!1),[we,fe]=(0,b.useState)(!1),[ie,J]=(0,b.useState)(!1),[X,Y]=(0,b.useState)(!1),[q,K]=(0,b.useState)(!1),[se,Q]=(0,b.useState)(!1),[ve,ce]=(0,b.useState)(!1),[ye,de]=(0,b.useState)(!1),[Ee,pe]=(0,b.useState)(!1),[He,Pe]=(0,b.useState)(!1),[je,xt]=(0,b.useState)(!1),[ze,Ge]=(0,b.useState)(h.logLevel),[De,Ze]=(0,b.useState)(!1),[be,_]=(0,b.useState)(h.compactGroup||0),[Ie,Re]=(0,b.useState)(r),[$e,Ve]=(0,b.useState)(h.tier),[Ue,Je]=(0,b.useState)(g.host),[Ke,Qe]=(0,b.useState)(!1),[nt,Xe]=(0,b.useState)(!1);let G=!1,P,$="";ie?(P=f("Enter title for %s",g.id),G=!0):X?(P=f("Edit log level rule for %s",g.id),G=!0):q?(P=f("Please confirm"),G=!0):se?(P=f("Edit memory limit rule for %s",g.id),$=f("Default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit)"),G=!0):ve?(P=f("Edit host for %s",g.id),G=!0):ye?(P=f("Edit compact groups for %s",g.id),G=!0):Ee&&(P=f("Set tier for %s",g.id),$=f("Tiers define the order of adapters when the system starts."),G=!0);const ee=G?e().createElement(jt.Z,{title:P,help:$,open:!0,applyDisabled:ie||se,textInput:ie||se,defaultValue:ie?h.name:se?h.memoryLimitMB:"",onApply:E=>{X?(B(g,ze,De),Y(!1)):ie?(z(g,E),J(!1)):q?(K(!1),o(g,Ke),Qe(!1)):se?(F(g,E),Q(!1)):ye?(C(g,be),de(!1)):Ee?(bt(g,$e),pe(!1)):ve&&(Z(g,Ue),ce(!1))},onClose:()=>{X?(Ge(h.logLevel),Ze(!1),Y(!1)):ie?J(!1):q?K(!1):se?Q(!1):ye?(_(h.compactGroup),Re(r),de(!1)):Ee?(Ve(h.tier),pe(!1)):ve&&(Je(g.host),ce(!1))}},X&&e().createElement(n.FormControl,{className:t.logLevel,variant:"outlined"},e().createElement(n.InputLabel,null,f("log level")),e().createElement(n.Select,{variant:"standard",value:ze,fullWidth:!0,onChange:E=>Ge(E.target.value)},Ho.map(E=>e().createElement(n.MenuItem,{key:E,value:E},f(E))))),X&&e().createElement(n.FormControl,{className:t.formControl,variant:"outlined"},e().createElement(n.FormControlLabel,{control:e().createElement(n.Checkbox,{checked:De,onChange:E=>Ze(E.target.checked)}),label:f("Without restart")}),e().createElement(n.FormHelperText,null,f(De?"Will be reset to the saved log level after restart of adapter":"Log level will be saved permanently"))),ye&&e().createElement(n.FormControl,{className:t.addCompact,variant:"outlined"},e().createElement(n.InputLabel,null,f("compact groups")),e().createElement(n.Select,{variant:"standard",autoWidth:!0,onClose:E=>Be(!1),onOpen:E=>Be(!0),open:at,value:be===1?"default":be==="0"?"controller":be&&be||"default",onChange:E=>_(E.target.value)},e().createElement("div",{onClick:E=>{E.preventDefault(),E.stopPropagation()},className:t.selectStyle},e().createElement(n.Button,{color:"grey",onClick:()=>{Be(!1),_(Ie+1),Re(Ie+1)},variant:"outlined",stylevariable:"outlined"},f("Add compact group"))),e().createElement(n.MenuItem,{value:"controller"},f("with controller")),e().createElement(n.MenuItem,{value:"default"},f("default group")),Array(Ie-1).fill().map((E,j)=>e().createElement(n.MenuItem,{key:j,value:j+2},j+2)))),Ee&&e().createElement(n.FormControl,{className:t.logLevel,variant:"outlined"},e().createElement(n.InputLabel,null,f("Tiers")),e().createElement(n.Select,{variant:"standard",value:$e,fullWidth:!0,onChange:E=>Ve(E.target.value)},gt.map(E=>e().createElement(n.MenuItem,{key:E.value,value:E.value},f(E.desc))))),q&&f("Are you sure you want to delete the instance %s?",g.id),q&&a&&g.obj.common.supportCustoms&&e().createElement("br",null),q&&a&&g.obj.common.supportCustoms&&e().createElement(n.FormControlLabel,{control:e().createElement(n.Checkbox,{checked:Ke,onChange:E=>Qe(E.target.checked)}),label:f("Delete all custom object settings of this adapter too")}),ve&&e().createElement(At.Z,{themeType:Me,value:Ue,list:R,removePrefix:"system.host.",fullWidth:!0,className:t.hostInfo,onChange:E=>Je(E)})):null,Ye=je?e().createElement(Mt.default,{title:f("Please confirm"),text:f("stop_admin",s),ok:f("Stop admin"),onClose:E=>{E&&u(je,{common:{enabled:!1}}),xt(!1)}}):null,Ct=(We||ot)&&!Ae?e().createElement("div",{className:(0,H.default)(t.collapse,We?"":t.collapseOff,Ae&&t.deleting)},e().createElement(n.CardContent,{classes:{root:t.cardContent},className:t.overflowAuto},e().createElement("div",{className:t.collapseIcon},e().createElement("div",{className:t.close,onClick:()=>Fe(!1)})),e().createElement(n.Typography,{gutterBottom:!0,component:"span",variant:"body2"},e().createElement("span",{className:t.instanceName},g.id),h.stoppedWhenWebExtension!==void 0&&e().createElement(W.Z,{state:h.stoppedWhenWebExtension},f("Runs as web-extension")),h.running&&g.mode==="daemon"&&h.stoppedWhenWebExtension===void 0&&e().createElement(W.Z,{state:h.connectedToHost},f("Connected to host")),h.running&&g.mode==="daemon"&&h.stoppedWhenWebExtension===void 0&&e().createElement(W.Z,{state:h.alive},f("Heartbeat")),h.running&&h.connected!==null&&h.stoppedWhenWebExtension===void 0&&e().createElement(W.Z,{state:!!h.connected},typeof h.connected=="string"?`${f("Connected:")} ${h.connected||"-"}`:f("Connected to device or service")),e().createElement(D,{tooltip:f("Installed")},"v",g.version),h.running&&e().createElement(D,{icon:e().createElement(Oe.Z,null),tooltip:f("RAM usage")},(g.mode==="daemon"&&h.running?T(w):"-.--")+" MB"),h.running&&l&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:e().createElement(pt.Z,null),tooltip:f("events")},e().createElement("div",{className:t.displayFlex},e().createElement(n.Tooltip,{title:f("input events")},e().createElement("div",{className:t.marginRight5},"\u21E5",h.inputOutput.stateInput)),"/",e().createElement(n.Tooltip,{title:f("output events")},e().createElement("div",{className:t.marginLeft5},"\u21A6",h.inputOutput.stateOutput))))),l&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:e().createElement(Oe.Z,{className:t.memoryIcon}),tooltip:f("RAM limit")},(h.memoryLimitMB?h.memoryLimitMB:"-.--")+" MB"),e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>Q(!0)},e().createElement(A.default,null)))),l&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:h.loglevelIcon,tooltip:h.logLevelObject===h.logLevel?`${f("loglevel")} ${h.logLevel}`:`${f("saved:")} ${h.logLevelObject} / ${f("actual:")} ${h.logLevel}`},h.logLevelObject===h.logLevel?h.logLevel:`${h.logLevelObject} / ${h.logLevel}`),e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>Y(!0)},e().createElement(A.default,null)))),h.modeSchedule&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:e().createElement(Ne.Z,null),tooltip:f("schedule_group")},k(w)||"-"),e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>fe(!0)},e().createElement(A.default,null)))),l&&g.mode==="daemon"&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:e().createElement(Ne.Z,{className:t.scheduleIcon}),tooltip:f("restart")},N(w)||"-"),e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>re(!0)},e().createElement(A.default,null)))),l&&h.checkCompact&&h.compact&&h.supportCompact&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:e().createElement(Le.Z,{className:t.marginRight,color:"inherit"}),tooltip:f("compact groups")},h.compactGroup===1?"default":h.compactGroup==="0"?"controller":h.compactGroup&&h.compactGroup||"default"),e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:E=>{de(!0),E.stopPropagation()}},e().createElement(A.default,null)))),l&&e().createElement("div",{className:t.displayFlex},e().createElement(D,{icon:e().createElement(Dt.Z,{className:t.marginRight,color:"inherit"}),tooltip:f("Start order (tier)")},g.adapter==="admin"?f("Always first"):f(((p=gt.find(E=>E.value===h.tier))==null?void 0:p.desc)||gt[2])),g.adapter!=="admin"?e().createElement(n.Tooltip,{title:f("Edit start order (tier)")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:E=>{pe(!0),E.stopPropagation()}},e().createElement(A.default,null))):null),R.length>1||R.length&&((Se=R[0].common)==null?void 0:Se.name)!==g.host?e().createElement("div",{className:(0,H.default)(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Rt.Z,{className:t.marginRight}),tooltip:f("Host for this instance")},e().createElement(mt.default,{value:g.host,list:R,removePrefix:"system.host.",themeType:Me,t:f,lang:x})),e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:E=>{ce(!0),E.stopPropagation()}},e().createElement(A.default,null)))):null,e().createElement(Ce.Z,{config:h,name:"allowInstanceSettings"},e().createElement(n.Hidden,{smUp:!0},e().createElement(n.IconButton,{disabled:!g.config,size:"small",className:(0,H.default)(t.button,!g.config&&t.hiddenOpacity),onClick:()=>M(w)},e().createElement(et.default,null)))))),e().createElement("div",{className:t.footerBlock},e().createElement(Ce.Z,{config:h,name:"allowInstanceDelete"},e().createElement("div",{className:t.displayFlex},e().createElement(n.Tooltip,{title:f("Delete")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>K(!0)},e().createElement(Tt.default,null))))),l&&h.checkSentry&&e().createElement("div",{className:t.displayFlex},e().createElement(n.Tooltip,{title:"sentry"},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>Et(g)},e().createElement(n.CardMedia,{className:(0,H.default)(t.sentry,!h.sentry&&t.contrast0),component:"img",image:h.sentry?ut.Z:Ht})))),h.supportCompact&&l&&h.checkCompact&&e().createElement("div",{className:t.displayFlex},e().createElement(n.Tooltip,{title:f("compact groups")},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:()=>d(g)},e().createElement(Le.Z,{color:h.compact?"primary":"inherit"})))))):null,qe=He?e().createElement($t,{image:g.image,instanceId:g.id,links:g.links,onClose:()=>Pe(!1),t:f,themeType:Me}):null,St=(le||we)&&e().createElement(Ot.Z,{title:le&&f("Edit restart rule for %s",g.id)||we&&f("Edit schedule rule for %s",g.id),clearButton:!0,cron:le?N(w):k(w),language:ne.default.getLanguage(),onOk:E=>{le?U(g,E):we&&ge(g,E)},onClose:()=>{le?re(!1):we&&fe(!1)}});return e().createElement(n.Card,{key:I,className:(0,H.default)(t.root,O?t.hidden:"")},ee,Ye,St,Ct,qe,e().createElement("div",{className:(0,H.default)(t.imageBlock,(!h.connectedToHost||!h.alive)&&t.instanceStateNotAlive1,h.connectedToHost&&h.alive&&h.connected===!1&&t.instanceStateAliveNotConnected1,h.connectedToHost&&h.alive&&h.connected!==!1&&t.instanceStateAliveAndConnected1)},e().createElement(n.CardMedia,{className:t.img,component:"img",image:g.image||"img/no-image.png"}),e().createElement("div",{className:t.adapter},g.id),e().createElement("div",{className:t.versionDate}),e().createElement(n.Fab,{onMouseOver:()=>i(!0),onMouseOut:()=>i(!1),onClick:()=>Fe(!0),className:t.fab,color:"primary","aria-label":"add"},e().createElement(So.Z,null))),e().createElement(n.CardContent,{className:t.cardContentH5},e().createElement(n.Typography,{gutterBottom:!0,variant:"h5",component:"h5"},e().createElement("div",{onMouseMove:()=>Xe(!0),onMouseEnter:()=>Xe(!0),onMouseLeave:()=>Xe(!1),className:t.displayFlex},h.name,e().createElement(n.Tooltip,{title:f("Edit")},e().createElement(n.IconButton,{size:"small",className:(0,H.default)(t.button,!nt&&t.hiddenOpacity),onClick:()=>J(!0)},e().createElement(A.default,null))))),e().createElement("div",{className:t.marginTop10},e().createElement(n.Typography,{component:"span",className:t.enableButton},e().createElement(n.Tooltip,{title:f("Start/stop")},e().createElement("div",null,e().createElement(n.IconButton,{size:"small",onClick:E=>{E.stopPropagation(),(!h.running||g.id!==s)&&u("system.adapter."+g.id,{common:{enabled:!h.running}})},onFocus:E=>E.stopPropagation(),className:(0,H.default)(t.button,g.canStart?h.running?t.enabled:t.disabled:t.hide)},h.running?e().createElement(Zt.Z,null):e().createElement(rt.default,null)))),e().createElement(n.Hidden,{xsDown:!0},e().createElement(n.Tooltip,{title:g.config?f("Settings"):""},e().createElement("div",null,e().createElement(n.IconButton,{disabled:!g.config,size:"small",className:(0,H.default)(t.button,!g.config&&t.hiddenOpacity),onClick:()=>M(w)},e().createElement(et.default,null))))),e().createElement(n.Tooltip,{title:f("Restart")},e().createElement("div",null,e().createElement(n.IconButton,{size:"small",onClick:E=>{u("system.adapter."+g.id,{}),E.stopPropagation()},onFocus:E=>E.stopPropagation(),className:(0,H.default)(t.button,!g.canStart&&t.hide),disabled:!h.running},e().createElement(it.default,null)))),e().createElement(Ce.Z,{config:h,name:"allowInstanceLink"},e().createElement(n.Tooltip,{title:f("Instance link %s",g.id)},e().createElement("div",null,e().createElement(n.IconButton,{size:"small",className:(0,H.default)(t.button,(!g.links||!g.links[0])&&t.hide),disabled:!h.running,onClick:E=>{if(E.stopPropagation(),g.links.length===1){let j=g.links[0].link;j=j.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//$1$2/"),window.open(j,g.id)}else Pe(!0)},onFocus:E=>E.stopPropagation()},e().createElement(Nt.Z,null)))))))))});Vt.propTypes={t:y().func,lang:y().string,themeType:y().string,adminInstance:y().string,hosts:y().array,setHost:y().func,deleting:y().bool,item:y().object,deleteCustomSupported:y().bool};var Po=(0,xe.withStyles)(Bo)(Vt),jo=c(42437),Ut=c.n(jo),zo=c(8225),Go=c.n(zo),Ca=c(58691),Sa=c(52158),wa=c(41954),Ia=c(32952),ka=c(74438),La=c(40714),Na=c(89666),Ta=c(36444),Da=c(90693),Za=c(48997),tt=c(9817),Jt=c(62664),L=c(33919);const $o="0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",Vo="0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)",Uo=s=>({root:{position:"relative",margin:10,width:300,minHeight:200,background:s.palette.background.default,boxShadow:$o,display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:Vo}},row:{paddingLeft:8,paddingRight:16,padding:0},imageBlock:{background:"silver",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",transition:"background 0.5s"},img:{width:45,height:45,margin:"auto 0",position:"relative","&:after":{content:'""',position:"absolute",zIndex:2,top:0,left:0,width:"100%",height:"100%",background:'url("img/no-image.png") 100% 100% no-repeat',backgroundSize:"cover",backgroundColor:"#fff"}},installed:{background:"#77c7ff8c"},update:{background:"#10ff006b"},fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},greenText:{color:s.palette.success.dark},collapse:{height:"100%",backgroundColor:"silver",position:"absolute",width:"100%",zIndex:3,marginTop:"auto",bottom:0,transition:"height 0.3s",justifyContent:"space-between",display:"flex",flexDirection:"column"},collapseOff:{height:0},close:{width:"20px",height:"20px",opacity:"0.9",cursor:"pointer",position:"relative",marginLeft:"auto",marginBottom:10,transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:"9px",content:'""',height:"20px",width:"3px",backgroundColor:"#ff4f4f",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:"9px",content:'""',height:"20px",width:"3px",backgroundColor:"#ff4f4f",transform:"rotate(-45deg)"}},footerBlock:{background:s.palette.background.default,padding:10,display:"flex",justifyContent:"space-between"},hidden:{display:"none"},invisible:{opacity:0},buttonUpdate:{border:"1px solid",padding:"0px 7px",borderRadius:5,display:"flex",alignItems:"center",cursor:"pointer",transition:"background 0.5s","&:hover":{background:"#00800026"}},versionDate:{alignSelf:"center"},adapter:{width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",paddingLeft:8,paddingTop:16,color:s.palette.mode==="dark"?"#333":"#555"},hide:{visibility:"hidden"},button:{padding:5,transition:"opacity 0.2s",height:34},hiddenOpacity:{opacity:0,cursor:"default"},enabled:{color:oe.Z[400],"&:hover":{backgroundColor:oe.Z[200]}},disabled:{color:V.Z[400],"&:hover":{backgroundColor:V.Z[200]}},instanceName:{fontSize:16,paddingLeft:32,paddingBottom:5,fontWeight:"bold"},cardContent:{marginTop:16,paddingTop:0},smallAvatar:{width:24,height:24},statusIndicator:{marginTop:12},statusIcon_green:{border:"2px solid grey",borderRadius:2},statusIcon_red:{border:"2px solid grey",borderRadius:20},statusIcon_orange:{border:0,borderRadius:0},statusIcon_orangeDevice:{border:0,borderRadius:0},statusIcon_blue:{border:"2px solid grey",borderRadius:20},statusIcon_gray:{border:"2px solid grey",borderRadius:20},statusIcon_grey:{border:"2px solid grey",borderRadius:20},instanceIcon:{height:42,width:42},table:{minWidth:650},tableRow:{"&:nth-of-type(odd)":{backgroundColor:ae.Z[300]},"&:nth-of-type(even)":{backgroundColor:ae.Z[200]}},state:{width:s.spacing(2),height:s.spacing(2),borderRadius:"100%"},green:{color:oe.Z[700]},red:{color:V.Z[700]},grey:{color:ae.Z[700]},blue:{color:"#0055a9"},orange:{color:tt.Z[400]},orangeDevice:{color:tt.Z[300]},transparent:{color:"transparent",backgroundColor:"transparent"},paper:{height:"100%"},iframe:{height:"100%",width:"100%",border:0},silly:{},debug:{backgroundColor:ae.Z[700]},info:{backgroundColor:dt.default[700]},warn:{backgroundColor:kt.Z[700]},error:{backgroundColor:V.Z[700]},grow:{flexGrow:1},tableRender:{tableLayout:"fixed",minWidth:960,"& td":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},cards:{display:"flex",flexFlow:"wrap",justifyContent:"center"},sentry:{width:24,height:24,objectFit:"fill",filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)"},hidden1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},visible1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},visible1050:{display:"none"},hidden1050:{display:"flex"},hidden800:{display:"flex"},visible800:{display:"none"},hidden570:{display:"flex"},visible570:{display:"none"},"@media screen and (max-width: 1500px)":{hidden1250:{display:"none !important"},visible1250:{display:"flex !important"}},"@media screen and (max-width: 1300px)":{hidden1230:{display:"none !important"}},"@media screen and (max-width: 1120px)":{hidden1050:{display:"none !important"},visible1050:{display:"flex !important"}},"@media screen and (max-width: 800px)":{hidden800:{display:"none !important"},visible800:{display:"flex !important"},instanceIcon:{height:28,width:28,marginLeft:4,marginTop:8}},hidden380:{display:"flex"},"@media screen and (max-width: 650px)":{hidden570:{display:"none !important"},visible570:{display:"flex !important"}},"@media screen and (max-width: 380px)":{hidden380:{display:"none !important"},instanceId:{width:"70px !important",minWidth:"70px !important"}},"@media screen and (max-width: 480px)":{gridStyle:{minWidth:"auto !important",marginLeft:10},instanceId:{width:100},maxWidth300:{width:"250px !important"}},"@media screen and (max-width: 335px)":{gridStyle:{marginLeft:0}},displayFlex:{display:"flex"},secondaryHeading:{maxWidth:200,fontSize:12},secondaryHeadingDiv:{display:"flex",alignItems:"center",width:200},secondaryHeadingDivDiv:{whiteSpace:"nowrap",overflow:"hidden",padding:5,textOverflow:"ellipsis",maxWidth:200},formControl:{width:"100%",marginBottom:5},formControl2:{marginBottom:5,marginTop:5,width:"100%"},gridStyle:{display:"flex",minWidth:270,lineHeight:"34px",justifyContent:"space-around"},wrapperAvatar:{maxWidth:130},instanceId:{overflow:"hidden",alignSelf:"center",fontSize:16,marginLeft:5,maxWidth:150,minWidth:100,whiteSpace:"nowrap",textOverflow:"ellipsis",flexGrow:2},marginLeft:{marginLeft:5},marginRight:{marginRight:5},selectStyle:{display:"flex",margin:5,justifyContent:"space-around"},selectWrapper:{display:"flex",alignItems:"flex-end"},scheduleIcon:{color:"#dc8e00"},ram:{color:"#dc8e00"},contrast0:{filter:"contrast(0%)"},paddingRight200:{},instanceStateNotEnabled1:{backgroundColor:"rgba(192, 192, 192, 0.2)"},instanceStateNotEnabled2:{backgroundColor:"rgba(192, 192, 192, 0.15)"},instanceStateNotAlive1:{backgroundColor:"rgba(255,14,14,0.2)"},instanceStateNotAlive2:{backgroundColor:"rgba(255,14,14, 0.15)"},instanceStateAliveNotConnected1:{backgroundColor:"rgba(255, 177, 0, 0.1)"},instanceStateAliveNotConnected2:{backgroundColor:"rgba(255, 177, 0, 0.15)"},instanceStateAliveAndConnected1:{backgroundColor:"rgba(0, 255, 0, 0.1)"},instanceStateAliveAndConnected2:{backgroundColor:"rgba(0, 255, 0, 0.15)"},maxWidth300:{width:300},width150:{width:150},deleting:{position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},desktopRow:{minHeight:0},desktopIcon:{height:32,width:32,marginTop:8},desktopRowContent:{marginTop:2,marginBottom:2},desktopButton:{paddingRight:12,paddingTop:4,paddingBottom:4,paddingLeft:4},rowGridLine:{marginTop:-2},tooltip:{pointerEvents:"none"}}),Jo=["silly","debug","info","warn","error"],ft=[{value:1,desc:"1: Logic adapters"},{value:2,desc:"2: Data provider adapters"},{value:3,desc:"3: Other adapters"}],Kt=({adminInstance:s,classes:t,maxCompactGroupNumber:r,onDeleteInstance:o,deleteCustomSupported:a,expanded:l,expertMode:u,extendObject:T,getInstanceStatus:N,getMemory:k,getModeIcon:O,getRestartSchedule:R,getSchedule:w,onExpandRow:g,hosts:I,id:x,idx:M,instance:d,key:C,lang:Z,openConfig:B,setCompact:F,setCompactGroup:z,setHost:U,setLogLevel:ge,setMemoryLimitMB:Et,setName:bt,setRestartSchedule:f,setSchedule:Me,setSentry:Ae,setTier:h,t:p,themeType:Se,deleting:ot,item:i})=>{var We,Fe,at;const[Be,le]=(0,b.useState)(!1),[re,we]=(0,b.useState)(!1),[fe,ie]=(0,b.useState)(!1),[J,X]=(0,b.useState)(!1),[Y,q]=(0,b.useState)(!1),[K,se]=(0,b.useState)(!1),[Q,ve]=(0,b.useState)(!1),[ce,ye]=(0,b.useState)(!1),[de,Ee]=(0,b.useState)(!1),[pe,He]=(0,b.useState)(!1),[Pe,je]=(0,b.useState)(!1),[xt,ze]=(0,b.useState)(!1),[Ge,De]=(0,b.useState)(i.logLevel),[Ze,be]=(0,b.useState)(!1),[_,Ie]=(0,b.useState)(i.compactGroup||0),[Re,$e]=(0,b.useState)(r),[Ve,Ue]=(0,b.useState)(i.tier),[Je,Ke]=(0,b.useState)(d.host),[Qe,nt]=(0,b.useState)(!1),[Xe,G]=(0,b.useState)(!1),P=window.innerWidth>1e3;let $=!1,ee,Ye="";J?(ee=p("Enter title for %s",d.id),$=!0):Y?(ee=p("Edit log level rule for %s",d.id),$=!0):K?(ee=p("Please confirm"),$=!0):Q?(ee=p("Edit memory limit rule for %s",d.id),Ye=p("Default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit)"),$=!0):ce?(ee=p("Edit host for %s",d.id),$=!0):de?(ee=p("Edit compact groups for %s",d.id),$=!0):pe&&(ee=p("Set tier for %s",d.id),Ye=p("Tiers define the order of adapters when the system starts."),$=!0);const Ct=$?e().createElement(jt.Z,{title:ee,help:Ye,open:!0,applyDisabled:J||Q,textInput:J||Q,defaultValue:J?i.name:Q?i.memoryLimitMB:"",onApply:m=>{Y?(ge(d,Ge,Ze),q(!1)):J?(bt(d,m),X(!1)):K?(o(d,Qe),nt(!1)):Q?(Et(d,m),ve(!1)):de?(z(d,_),Ee(!1)):pe?(h(d,Ve),He(!1)):ce&&(U(d,Je),ye(!1))},onClose:()=>{Y?(De(i.logLevel),be(!1),q(!1)):J?X(!1):K?se(!1):Q?ve(!1):de?(Ie(i.compactGroup),$e(r),Ee(!1)):pe?(Ue(i.tier),He(!1)):ce&&(Ke(d.host),ye(!1))}},Y&&e().createElement(n.FormControl,{className:t.formControl,variant:"outlined"},e().createElement(n.InputLabel,null,p("log level")),e().createElement(n.Select,{variant:"standard",value:Ge,fullWidth:!0,onChange:m=>De(m.target.value)},Jo.map(m=>e().createElement(n.MenuItem,{key:m,value:m},p(m))))),Y&&e().createElement(n.FormControl,{className:t.formControl,variant:"outlined"},e().createElement(n.FormControlLabel,{control:e().createElement(n.Checkbox,{checked:Ze,onChange:m=>be(m.target.checked)}),label:p("Without restart")}),e().createElement(n.FormHelperText,null,p(Ze?"Will be reset to the saved log level after restart of adapter":"Log level will be saved permanently"))),de&&e().createElement(n.FormControl,{className:t.formControl2,variant:"outlined"},e().createElement(n.InputLabel,null,p("compact groups")),e().createElement(n.Select,{variant:"standard",autoWidth:!0,onClose:m=>le(!1),onOpen:m=>le(!0),open:Be,value:_===1?"default":_==="0"||_===0?"controller":_&&_||"default",onChange:m=>Ie(m.target.value)},e().createElement("div",{onClick:m=>{m.preventDefault(),m.stopPropagation()},className:t.selectStyle},e().createElement(n.Button,{color:"grey",onClick:()=>{le(!1),Ie(Re+1),$e(Re+1)},variant:"outlined",stylevariable:"outlined"},p("Add compact group"))),e().createElement(n.MenuItem,{value:"controller"},p("with controller")),e().createElement(n.MenuItem,{value:"default"},p("default group")),Array(Re-1).fill().map((m,ke)=>e().createElement(n.MenuItem,{key:ke,value:ke+2},ke+2)))),pe&&e().createElement(n.FormControl,{className:t.formControl,variant:"outlined"},e().createElement(n.InputLabel,null,p("Tiers")),e().createElement(n.Select,{variant:"standard",value:Ve,fullWidth:!0,onChange:m=>Ue(m.target.value)},ft.map(m=>e().createElement(n.MenuItem,{key:m.value,value:m.value},p(m.desc))))),K&&p("Are you sure you want to delete the instance %s?",d.id),K&&a&&d.obj.common.supportCustoms&&e().createElement("br",null),K&&a&&d.obj.common.supportCustoms&&e().createElement(n.FormControlLabel,{control:e().createElement(n.Checkbox,{checked:Qe,onChange:m=>nt(m.target.checked)}),label:p("Delete all custom object settings of this adapter too")}),ce&&e().createElement(At.Z,{themeType:Se,value:Je,list:I,removePrefix:"system.host.",fullWidth:!0,className:t.formControl,onChange:m=>Ke(m)})):null,qe=N(x),St=xt?e().createElement($t,{image:d.image,instanceId:d.id,links:d.links,onClose:()=>ze(!1),t:p,themeType:Se}):null,E=Pe?e().createElement(Mt.default,{title:p("Please confirm"),text:p("stop_admin",s),ok:p("Stop admin"),onClose:m=>{m&&T(Pe,{common:{enabled:!1}}),je(!1)}}):null;let j,_e,lt;if(d.mode==="schedule"&&d.schedule){try{lt=Go().toString(d.schedule,{locale:Z})}catch(m){lt=d.schedule}if(d.enabled)try{j=new Date(Ut().parseExpression(d.schedule).next()),_e=new Date(Ut().parseExpression(d.schedule).prev())}catch(m){j=null,_e=null}}const eo=[i.stoppedWhenWebExtension!==void 0?e().createElement(W.Z,{key:1,state:!0},p("Runs as web-extension")):"",d.mode==="daemon"&&i.stoppedWhenWebExtension===void 0?e().createElement(W.Z,{key:2,state:i.connectedToHost},p("Connected to host")):"",d.mode==="daemon"&&i.stoppedWhenWebExtension===void 0?e().createElement(W.Z,{key:3,state:i.alive},p("Heartbeat")):"",i.connected!==null&&i.stoppedWhenWebExtension===void 0?e().createElement(W.Z,{key:4,state:!!i.connected},typeof i.connected=="string"?p("Connected:")+" "+(i.connected||"-"):p("Connected to device or service")):"",lt?e().createElement(W.Z,{key:5,state:d.enabled},"CRON: ",lt):null,j?e().createElement(W.Z,{key:6,state:!0},p("Next start: %s",j.toLocaleDateString(Z)+" "+j.toLocaleTimeString(Z))):null,_e?e().createElement(W.Z,{key:7,state:!0},p("Last start: %s",_e.toLocaleDateString(Z)+" "+_e.toLocaleTimeString(Z))):null].filter(m=>m),to=e().createElement("div",{className:L.default.clsx(t.smallAvatar,t.statusIndicator,d.mode==="daemon"||d.mode==="schedule"?t[qe]:t.transparent,i.connectedToHost&&i.alive&&i.connected===!1&&t.orangeDevice)},O(d.mode,qe,t["statusIcon_"+qe],i.stoppedWhenWebExtension));return e().createElement(n.Accordion,{key:C,square:!0,classes:{root:ot?t.deleting:""},expanded:l===d.id&&!ot,onChange:()=>{re||fe||Y||J||K||Q||de||pe||ce||g(d.id)}},St,e().createElement(n.AccordionSummary,{classes:{root:t.row,content:P?t.desktopRowContent:void 0,expandIcon:P?t.desktopButton:void 0},className:L.default.clsx((!i.running||d.mode!=="daemon"||i.stoppedWhenWebExtension!==void 0)&&(M%2===0?t.instanceStateNotEnabled1:t.instanceStateNotEnabled2),i.running&&d.mode==="daemon"&&i.stoppedWhenWebExtension===void 0&&(!i.connectedToHost||!i.alive)&&(M%2===0?t.instanceStateNotAlive1:t.instanceStateNotAlive2),i.running&&i.connectedToHost&&i.alive&&i.connected===!1&&(M%2===0?t.instanceStateAliveNotConnected1:t.instanceStateAliveNotConnected2),i.running&&i.connectedToHost&&i.alive&&i.connected!==!1&&(M%2===0,t.instanceStateAliveAndConnected1),P&&t.desktopRow),expandIcon:e().createElement(Jt.default,null)},Ct,E,(re||fe)&&e().createElement(Ot.Z,{title:re&&p("Edit restart rule for %s",d.id)||fe&&p("Edit schedule rule for %s",d.id),clearButton:!0,cron:re?R(x):w(x),language:ne.default.getLanguage(),onOk:m=>{re?f(d,m):fe&&Me(d,m)},onClose:()=>{re?we(!1):fe&&ie(!1)}}),e().createElement(n.Grid,{container:!0,spacing:1,alignItems:"center",direction:"row",wrap:"nowrap",className:t.rowGridLine},e().createElement("div",{className:t.gridStyle},eo.length?e().createElement(n.Tooltip,{title:e().createElement("span",{style:{display:"flex",flexDirection:"column"},classes:{popper:t.tooltip}},eo)},to):to,e().createElement(n.Avatar,{variant:"square",alt:d.id,src:d.image,className:L.default.clsx(t.instanceIcon,P&&t.desktopIcon)}),e().createElement("div",{className:t.instanceId},d.id)),e().createElement(n.Tooltip,{title:p("Start/stop"),classes:{popper:t.tooltip}},e().createElement("div",null,e().createElement(n.IconButton,{size:"small",onClick:m=>{m.stopPropagation(),m.preventDefault(),i.running&&d.id===s?je("system.adapter."+d.id):T("system.adapter."+d.id,{common:{enabled:!i.running}})},onFocus:m=>m.stopPropagation(),className:L.default.clsx(t.button,d.canStart?i.running?t.enabled:t.disabled:t.hide)},i.running?e().createElement(Zt.Z,null):e().createElement(rt.default,null)))),e().createElement(Ce.Z,{config:i,name:"allowInstanceSettings"},e().createElement(n.Hidden,{xsDown:!0},e().createElement("div",null,e().createElement(n.Tooltip,{title:d.config?p("Settings"):"",classes:{popper:t.tooltip}},e().createElement("div",null,e().createElement(n.IconButton,{disabled:!d.config,size:"small",className:L.default.clsx(t.button,!d.config&&t.hiddenOpacity),onClick:m=>{m.stopPropagation(),B(x)}},e().createElement(et.default,null))))))),e().createElement(n.Tooltip,{title:p("Restart"),classes:{popper:t.tooltip}},e().createElement("div",null,e().createElement(n.IconButton,{size:"small",onClick:m=>{m.stopPropagation(),T("system.adapter."+d.id,{})},onFocus:m=>m.stopPropagation(),className:L.default.clsx(t.button,!d.canStart&&t.hide),disabled:!i.running},e().createElement(it.default,null)))),e().createElement(Ce.Z,{config:i,name:"allowInstanceLink"},e().createElement(n.Tooltip,{title:p("Instance link %s",d.id),classes:{popper:t.tooltip}},e().createElement("div",null,e().createElement(n.IconButton,{size:"small",className:L.default.clsx(t.button,(!d.links||!d.links[0])&&t.hide),disabled:!i.running,onClick:m=>{if(m.stopPropagation(),d.links.length===1){let ke=d.links[0].link;ke=ke.replace(/\/\/([0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*:[0-9a-f]*)(:\d+)?\//i,"//[$1]$2/"),window.open(ke,d.id)}else ze(!0)},onFocus:m=>m.stopPropagation()},e().createElement(Nt.Z,null))))),e().createElement(n.Typography,{className:L.default.clsx(t.secondaryHeading,t.hidden800),component:"div"},e().createElement("div",{onMouseMove:()=>G(!0),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),className:t.secondaryHeadingDiv},e().createElement("div",{className:t.secondaryHeadingDivDiv},i.name),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:L.default.clsx(t.button,!Xe&&t.hiddenOpacity),onClick:m=>{m.stopPropagation(),X(!0)}},e().createElement(A.default,null))))),u&&e().createElement("div",{className:L.default.clsx(t.hidden1250,(d.mode!=="daemon"||!i.running)&&t.invisible)},e().createElement(D,{icon:e().createElement(pt.Z,null),tooltip:p("events")},e().createElement("div",{className:t.displayFlex},e().createElement(n.Tooltip,{title:p("input events"),classes:{popper:t.tooltip}},e().createElement("div",{className:t.marginRight},"\u21E5",i.inputOutput.stateInput)),"/",e().createElement(n.Tooltip,{title:p("output events"),classes:{popper:t.tooltip}},e().createElement("div",{className:t.marginLeft},"\u21A6",i.inputOutput.stateOutput))))),u&&e().createElement(n.Tooltip,{title:i.logLevelObject===i.logLevel?`${p("loglevel")} ${i.logLevel}`:`${p("saved:")} ${i.logLevelObject} / ${p("actual:")} ${i.logLevel}`,classes:{popper:t.tooltip}},e().createElement(n.Avatar,{className:L.default.clsx(t.smallAvatar,t.hidden380,t[i.logLevel])},i.loglevelIcon)),e().createElement(n.Grid,{item:!0,className:L.default.clsx(t.hidden1050,t.width150,(d.mode!=="daemon"||!i.running)&&t.invisible)},e().createElement(D,{icon:e().createElement(Oe.Z,null),tooltip:p("RAM usage")},(d.mode==="daemon"&&i.running?k(x):"-.--")+" MB")),I.length>1||I.length&&((We=I[0].common)==null?void 0:We.name)!==d.host?e().createElement(n.Grid,{item:!0,className:L.default.clsx(t.hidden1230)},e().createElement(mt.default,{value:d.host,list:I,removePrefix:"system.host.",themeType:Se,t:p,lang:Z})):null),e().createElement("div",{className:t.hidden570},e().createElement(n.Tooltip,{title:"sentry",classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:L.default.clsx(t.button,u&&i.checkSentry?null:t.hide),onClick:m=>{m.stopPropagation(),Ae(d)}},e().createElement(n.CardMedia,{className:L.default.clsx(t.sentry,!i.sentry&&t.contrast0),component:"img",image:i.sentry?ut.Z:Ht})))),i.supportCompact?e().createElement("div",{className:t.hidden570},e().createElement(n.Tooltip,{title:p("compact groups"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:L.default.clsx(t.button,u&&i.checkCompact?null:t.hide),onClick:m=>{m.stopPropagation(),F(d)}},e().createElement(Le.Z,{color:i.compact?"primary":"inherit"})))):null),e().createElement(n.AccordionDetails,null,e().createElement(n.Grid,{container:!0,direction:"row"},e().createElement(n.Grid,{item:!0,container:!0,direction:"row",xs:10},e().createElement(n.Grid,{item:!0,container:!0,direction:"column",xs:12,sm:6,md:4},e().createElement("span",{className:t.instanceName},d.id),i.stoppedWhenWebExtension!==void 0&&e().createElement(W.Z,{state:i.stoppedWhenWebExtension},p("Runs as web-extension")),i.running&&d.mode==="daemon"&&i.stoppedWhenWebExtension===void 0&&e().createElement(W.Z,{state:i.connectedToHost},p("Connected to host")),i.running&&d.mode==="daemon"&&i.stoppedWhenWebExtension===void 0&&e().createElement(W.Z,{state:i.alive},p("Heartbeat")),i.running&&i.connected!==null&&i.stoppedWhenWebExtension===void 0&&e().createElement(W.Z,{state:!!i.connected},typeof i.connected=="string"?`${p("Connected:")} ${i.connected||"-"}`:p("Connected to device or service"))),e().createElement(n.Grid,{container:!0,item:!0,direction:"column",xs:12,sm:6,md:4},e().createElement(D,{tooltip:p("Installed")},"v",d.version)),e().createElement(n.Grid,{container:!0,item:!0,direction:"column",xs:12,sm:6,md:4,className:t.paddingRight200},u&&e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:i.loglevelIcon,tooltip:i.logLevelObject===i.logLevel?`${p("loglevel")} ${i.logLevel}`:`${p("saved:")} ${i.logLevelObject} / ${p("actual:")} ${i.logLevel}`},i.logLevelObject===i.logLevel?i.logLevel:`${i.logLevelObject} / ${i.logLevel}`),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),q(!0)}},e().createElement(A.default,null)))),i.running&&u&&e().createElement("div",{className:t.visible1250},e().createElement(D,{icon:e().createElement(pt.Z,null),tooltip:p("events")},e().createElement("div",{className:t.displayFlex},e().createElement(n.Tooltip,{title:p("input events"),classes:{popper:t.tooltip}},e().createElement("div",{className:t.marginRight},"\u21E5",i.inputOutput.stateInput)),"/",e().createElement(n.Tooltip,{title:p("output events"),classes:{popper:t.tooltip}},e().createElement("div",{className:t.marginLeft},"\u21A6",i.inputOutput.stateOutput))))),e().createElement(n.Grid,{item:!0,className:t.visible1050},e().createElement(D,{icon:e().createElement(Oe.Z,null),tooltip:p("RAM usage")},(d.mode==="daemon"&&i.running?k(x):"-.--")+" MB")),i.modeSchedule&&e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Ne.Z,null),tooltip:p("schedule_group")},w(x)||"-"),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),ie(!0)}},e().createElement(A.default,null)))),u&&d.mode==="daemon"&&e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Ne.Z,{className:t.scheduleIcon}),tooltip:p("restart")},R(x)||"-"),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),we(!0)}},e().createElement(A.default,null)))),u&&e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Oe.Z,{className:t.ram}),tooltip:p("RAM limit")},(i.memoryLimitMB?i.memoryLimitMB:"-.--")+" MB"),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),ve(!0)}},e().createElement(A.default,null)))),u&&i.checkCompact&&i.compact&&i.supportCompact&&e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Le.Z,{className:t.marginRight,color:"inherit"}),tooltip:p("compact groups")},i.compactGroup===1?"default":i.compactGroup==="0"?"controller":i.compactGroup&&i.compactGroup||"default"),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),Ee(!0)}},e().createElement(A.default,null)))),u&&e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Dt.Z,{className:t.marginRight,color:"inherit"}),tooltip:p("Start order (tier)")},d.adapter==="admin"?p("Always first"):p(((Fe=ft.find(m=>m.value===i.tier))==null?void 0:Fe.desc)||ft[2])),d.adapter!=="admin"?e().createElement(n.Tooltip,{title:p("Edit start order (tier)"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),He(!0)}},e().createElement(A.default,null))):null),e().createElement("div",{className:L.default.clsx(t.maxWidth300,t.visible800)},e().createElement(D,null,i.name),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),X(!0)}},e().createElement(A.default,null)))),I.length>1||I.length&&((at=I[0].common)==null?void 0:at.name)!==d.host?e().createElement("div",{className:L.default.clsx(t.displayFlex,t.maxWidth300)},e().createElement(D,{icon:e().createElement(Rt.Z,{className:t.marginRight}),tooltip:p("Host for this instance")},e().createElement(mt.default,{value:d.host,list:I,removePrefix:"system.host.",themeType:Se,t:p,lang:Z})),e().createElement(n.Tooltip,{title:p("Edit"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),ye(!0)}},e().createElement(A.default,null)))):null)),e().createElement("div",{className:t.displayFlex},e().createElement(Ce.Z,{config:i,name:"allowInstanceDelete"},e().createElement(n.Hidden,{smUp:!0},e().createElement(n.Tooltip,{title:p("Settings"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),B(x)}},e().createElement(et.default,null))))),e().createElement(Ce.Z,{config:i,name:"allowInstanceDelete"},e().createElement(n.Tooltip,{title:p("Delete"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:t.button,onClick:m=>{m.stopPropagation(),se(!0)}},e().createElement(Tt.default,null)))),e().createElement("div",{className:t.visible570},e().createElement(n.Tooltip,{title:"sentry",classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:L.default.clsx(t.button,u&&i.checkSentry?null:t.hide),onClick:m=>{m.stopPropagation(),Ae(d)}},e().createElement(n.CardMedia,{className:L.default.clsx(t.sentry,!i.sentry&&t.contrast0),component:"img",image:ut.Z})))),i.supportCompact?e().createElement("div",{className:t.visible570},e().createElement(n.Tooltip,{title:p("compact groups"),classes:{popper:t.tooltip}},e().createElement(n.IconButton,{size:"small",className:L.default.clsx(t.button,u&&i.checkCompact?null:t.hide),onClick:m=>{m.stopPropagation(),F(d)}},e().createElement(Le.Z,{color:i.compact?"primary":"inherit"})))):null))))};Kt.propTypes={t:y().func,themeType:y().string,adminInstance:y().string,hosts:y().array,setHost:y().func,instanceId:y().string,deleting:y().bool,onExpandRow:y().func,item:y().object,deleteCustomSupported:y().bool};var Ko=(0,xe.withStyles)(Uo)(Kt),Qo=c(85540),Xo=c(24470),Qt=c(78565),Yo=c(19974),qo=c(6774),Xt=c(628),_o=c(25309),ea=c(26021),Yt,ta=null;function vt(){return vt=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=r[o])}return s},vt.apply(this,arguments)}function oa(s,t){if(s==null)return{};var r=aa(s,t),o,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);for(a=0;a<l.length;a++)o=l[a],!(t.indexOf(o)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,o)||(r[o]=s[o]))}return r}function aa(s,t){if(s==null)return{};var r={},o=Object.keys(s),a,l;for(l=0;l<o.length;l++)a=o[l],!(t.indexOf(a)>=0)&&(r[a]=s[a]);return r}function Ra(s,t){var r=s.title,o=s.titleId,a=oa(s,ta);return React.createElement("svg",vt({xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#FB2D26",ref:t,"aria-labelledby":o},a),r?React.createElement("title",{id:o},r):null,Yt||(Yt=React.createElement("g",null,React.createElement("path",{d:"M0,0h24 M24,24H0",fill:"currentColor"}),React.createElement("path",{d:"M4.25,5.61C6.27,8.2,10,13,10,13v6c0,0.55,0.45,1,1,1h2c0.55,0,1-0.45,1-1v-6c0,0,3.72-4.8,5.74-7.39 C20.25,4.95,19.78,4,18.95,4H5.04C4.21,4,3.74,4.95,4.25,5.61z"}),React.createElement("path",{d:"M0,0h24v24H0V0z",fill:"none"}))))}var Oa=null,na=c.p+"static/media/filter.ddf40c28bbf1e138937e53be53e56274.svg";let ue=null;const la=(0,xe.makeStyles)(s=>({root:{width:"100%",padding:10},paper:{width:"100%",maxHeight:800},overflowHidden:{display:"flex",overflow:"hidden"},pre:{overflow:"auto",whiteSpace:"pre-wrap",margin:0},rowBlock:{display:"flex",width:"100%",justifyContent:"space-between",margin:"10px 0"},select:{minWidth:200},checkbox:{minWidth:160},statusIcon_1:{border:"2px solid grey",borderRadius:20,color:"grey"},statusIcon_2:{border:"2px solid grey",borderRadius:20,color:"#d32f2f"},statusIcon_3:{border:0,borderRadius:0,color:"#ffa726"},statusIcon_4:{border:"2px solid grey",borderRadius:20,color:"#0055a9"},statusIcon_5:{border:"2px solid grey",borderRadius:20},statusIcon_6:{border:"2px solid grey",borderRadius:20},menuWrapper:{display:"flex",alignItems:"center"},iconWrapper:{marginRight:10},textWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},square:{width:24,height:24,marginRight:10,filter:"invert(0%) sepia(90%) saturate(300%) hue-rotate(-537deg) brightness(99%) contrast(97%)"},statusIcon_green:{border:"2px solid grey",borderRadius:2},statusIcon_red:{border:"2px solid grey",borderRadius:20},statusIcon_orange:{border:0,borderRadius:0},statusIcon_orangeDevice:{border:0,borderRadius:0},statusIcon_blue:{border:"2px solid grey",borderRadius:20},statusIcon_gray:{border:"2px solid grey",borderRadius:20},statusIcon_grey:{border:"2px solid grey",borderRadius:20},green:{color:oe.Z[700]},red:{color:V.Z[700]},grey:{color:ae.Z[700]},blue:{color:"#0055a9"},orange:{color:tt.Z[400]},orangeDevice:{color:tt.Z[300]},icon:{width:18,height:18,marginRight:s.spacing(1),display:"inline-block"},menuValue:{whiteSpace:"nowrap"}})),ra=["none","daemon","schedule","once"],ia=(s,t)=>s===1?e().createElement(ct.Z,{className:t}):s===2?e().createElement(ct.Z,{className:t}):s===3?e().createElement(st.default,{className:t}):s===4?e().createElement(Ne.Z,{className:t}):s===5?e().createElement("div",{style:{width:20,height:20,margin:2,borderRadius:2},className:t},e().createElement("div",{style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"}})):null,yt={none:{text:"none",_class:"",status:""},disabled:{text:"disabled",_class:"statusIcon_grey",status:"grey"},not_alive:{text:"enabled, but not alive",_class:"statusIcon_red",status:"red"},alive_not_connected:{text:"enabled, alive, but not connected to controller",_class:"statusIcon_orange",status:"orange"},alive_no_device:{text:"enabled, alive, but not connected to device or service",_class:"statusIcon_orangeDevice",status:"orange"},ok:{text:"enabled and OK",_class:"statusIcon_green",status:"green"}},sa=({cb:s,filterMode:t,filterStatus:r,theme:o})=>{const a=la(),[l,u]=(0,b.useState)(!0),[T,N]=(0,b.useState)(t),[k,O]=(0,b.useState)(r),R=()=>{u(!1),ue&&(document.body.removeChild(ue),ue=null)};return e().createElement(Xt.Z,{theme:o},e().createElement(zt.Z,{onClose:R,open:l,classes:{paper:a.paper}},e().createElement(n.DialogTitle,{style:{display:"flex"}},e().createElement("div",{style:{display:"flex"}},e().createElement(n.Avatar,{variant:"square",className:a.square,src:na}),ne.default.t("Filter instances"))),e().createElement(qo.Z,{className:a.overflowHidden,dividers:!0},e().createElement(n.Card,{className:a.root},e().createElement("div",{className:a.rowBlock},e().createElement(n.FormControlLabel,{className:a.checkbox,control:e().createElement(n.Checkbox,{checked:!!T,onChange:w=>w.target.checked?N("daemon"):N(null)}),label:ne.default.t("Filter by mode")}),e().createElement(n.Select,{disabled:!T,variant:"standard",value:T||"none",className:a.select,onChange:w=>{w.target.value==="none"?N(null):N(w.target.value)}},ra.map(w=>e().createElement(n.MenuItem,{key:w,value:w},ne.default.t(w))))),e().createElement("div",{className:a.rowBlock},e().createElement(n.FormControlLabel,{className:a.checkbox,control:e().createElement(n.Checkbox,{checked:!!k,onChange:w=>w.target.checked?O("ok"):O(null)}),label:ne.default.t("Filter by status")}),e().createElement(n.Select,{disabled:!k,variant:"standard",value:k||"none",className:a.select,onChange:w=>{w.target.value==="none"?O(null):O(w.target.value)}},Object.keys(yt).map((w,g)=>e().createElement(n.MenuItem,{key:w,value:w},e().createElement("div",{className:a.menuWrapper},yt[w].status?e().createElement("div",{className:a.iconWrapper},ia(g,a[`statusIcon_${g}`])):null,e().createElement("div",{className:a.textWrapper},ne.default.t(yt[w].text))))))))),e().createElement(Yo.Z,null,e().createElement(Qt.Z,{variant:"contained",autoFocus:!0,disabled:T===t&&r===k,onClick:()=>{R(),s&&s({filterMode:T,filterStatus:k})},color:"primary",startIcon:e().createElement(ea.default,null)},ne.default.t("Apply")),e().createElement(Qt.Z,{color:"grey",variant:"contained",onClick:()=>{R(),s&&s(!1)},startIcon:e().createElement(It.default,null)},ne.default.t("Close")))))},ca=(s,t,r,o,a)=>(ue||(ue=document.createElement("div"),ue.id="renderModal",document.body.appendChild(ue)),(0,Xo.s)(ue).render(e().createElement(_o.Z,{injectFirst:!0},e().createElement(Xt.Z,{theme:a},e().createElement(sa,{cb:s,getModeIcon:o,filterMode:t,theme:a,filterStatus:r})))));var da=c(19092);const pa="0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",ma="0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)",ua=s=>({root:{position:"relative",margin:10,width:300,minHeight:200,background:s.palette.background.default,boxShadow:pa,display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:ma}},row:{paddingLeft:8,flexDirection:"row-reverse",minHeight:"48px !important",height:48,fontWeight:"bold",fontSize:16},iconStyle:{marginRight:10},wrapperName:{margin:"0 10px",display:"flex",alignItems:"center"},wrapperChildren:{width:"100%"},accordionDetails:{padding:0},accordion:{margin:"1px 0 !important"}}),qt=({name:s,key:t,children:r,classes:o,expanded:a,onExpand:l})=>e().createElement(n.Accordion,{expanded:!!a,onChange:()=>l(!a),classes:{root:o.accordion},key:t,square:!0},e().createElement(n.AccordionSummary,{classes:{root:o.row},expandIcon:e().createElement(Jt.default,null)},e().createElement("div",{className:o.wrapperName},e().createElement(da.Z,{objIconBool:!0,iconName:s,className:o.iconStyle}),s)),e().createElement(n.AccordionDetails,{className:o.accordionDetails},e().createElement("div",{className:o.wrapperChildren},r)));qt.propTypes={t:y().func,themeType:y().string,adminInstance:y().string,hosts:y().array,setHost:y().func,host:y().string,instanceId:y().string};var ha=(0,xe.withStyles)(ua)(qt),v=c(4819),ga=Object.defineProperty,fa=(s,t,r)=>t in s?ga(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r,S=(s,t,r)=>(fa(s,typeof t!="symbol"?t+"":t,r),r),he=(s,t,r)=>new Promise((o,a)=>{var l=N=>{try{T(r.next(N))}catch(k){a(k)}},u=N=>{try{T(r.throw(N))}catch(k){a(k)}},T=N=>N.done?o(N.value):Promise.resolve(N.value).then(l,u);T((r=r.apply(s,t)).next())});const va=s=>({table:{minWidth:650},tableRow:{"&:nth-of-type(odd)":{backgroundColor:ae.Z[300]},"&:nth-of-type(even)":{backgroundColor:ae.Z[200]}},smallAvatar:{width:s.spacing(3),height:s.spacing(3)},button:{padding:"5px"},enabled:{color:oe.Z[400],"&:hover":{backgroundColor:oe.Z[200]}},disabled:{color:V.Z[400],"&:hover":{backgroundColor:V.Z[200]}},hide:{visibility:"hidden"},state:{width:s.spacing(2),height:s.spacing(2),borderRadius:"100%"},green:{backgroundColor:oe.Z[700]},red:{backgroundColor:V.Z[700]},grey:{backgroundColor:ae.Z[700]},blue:{backgroundColor:dt.default[700]},transparent:{color:"transparent",backgroundColor:"transparent"},paper:{height:"100%"},iframe:{height:"100%",width:"100%",color:"#000",borderRadius:4,boxShadow:"0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",border:"0px solid #888"},silly:{},debug:{backgroundColor:ae.Z[700]},info:{backgroundColor:dt.default[700]},warn:{backgroundColor:kt.Z[700]},error:{backgroundColor:V.Z[700]},grow:{flexGrow:1},tableRender:{tableLayout:"fixed",minWidth:960,"& td":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},cards:{display:"flex",flexFlow:"wrap",justifyContent:"center"},sentry:{width:24,height:24,objectFit:"fill",filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-539deg) brightness(99%) contrast(97%)"},contrast0:{filter:"contrast(0%)"},compactButtons:{display:"inline-block",borderRadius:4,border:"1px gray dotted"},okSymbol:{width:20,height:20,margin:2,borderRadius:2},okSymbolInner:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"},square:{width:24,height:24,filter:s.palette.mode==="dark"?"brightness(0) invert(1)":"grayscale(100%)",opacity:s.palette.mode==="dark"?1:.8},primary:{filter:"invert(0%) sepia(90%) saturate(300%) hue-rotate(-537deg) brightness(99%) contrast(97%)"},filterActive:{color:s.palette.primary.main}});class _t extends b.Component{constructor(t){super(t),S(this,"translate",(o,a,l)=>a!==void 0?this.props.t(o,a,l):(this.wordCache[o]||(this.wordCache[o]=this.props.t(o)),this.wordCache[o])),S(this,"getInstances",()=>he(this,null,function*(){const o=Date.now();let a=[],l=yield this.props.instancesWorker.getInstances();if(!l){window.alert("Cannot read instances!");return}a=Object.values(l);let u=`${this.state.currentHost}.memRss`;this.states[u]=this.states[u]||(yield this.props.socket.getState(u));const T=this.states[u];let N=1,k=T?T.val:0;for(let g=0;g<a.length;g++){let I=a[g];if(!(!I||!I.common||I.common.host!==this.props.currentHostName)&&I.common.enabled&&I.common.mode==="daemon"){u=I._id+".memRss",this.states[u]=this.states[u]||(yield this.props.socket.getState(u));const x=this.states[u];k+=x?x.val:0,N++}}const O={};a.sort((g,I)=>{const x=g._id.split("."),M=I._id.split("."),d=parseInt(x[x.length-1],10),C=parseInt(M[M.length-1],10),Z=x[x.length-2],B=M[M.length-2];return Z===B?d>C?1:d<C?-1:0:Z>B?1:Z<B?-1:0});let R=1;const w={};for(let g=0;g<a.length;g++){const I=a[g],x=I?I.common:null,M=I._id.split("."),d=M[M.length-1];x.compactGroup&&typeof x.compactGroup=="number"&&R<x.compactGroup&&(R=x.compactGroup);const C={};C.id=I._id.replace("system.adapter.",""),C.obj=I,C.compact=!!x.compact,C.host=x.host,C.name=x.titleLang?x.titleLang[this.props.lang]||x.titleLang.en||x.title||"":x.title,C.image=x.icon?`adapter/${x.name}/${x.icon}`:"img/no-image.png",C.enabled=x.enabled,C.name&&typeof C.name=="object"&&(C.name=C.name[this.props.lang]||C.name.en||"");let Z=x.localLinks||x.localLink||"";Z&&typeof Z=="string"&&(Z={_default:Z});const B=Z?Object.keys(Z):[];if(B.forEach(F=>{C.links=C.links||[];let z=Z[F];typeof z=="string"&&(z={link:z});const U=Eo.Z.replaceLink(z.link,x.name,d,{objects:l,hostname:this.props.hostname,protocol:this.props.protocol,port:this.props.port,hosts:this.props.hosts,adminInstance:this.props.adminInstance})||[];U.length===1?C.links.push({name:F==="_default"?B.length===1?"":this.t("default"):this.t(F),link:U[0].url,port:U[0].port,color:z.color}):U.length>1&&U.forEach(ge=>{C.links.push({name:F==="_default"?B.length===1?"":this.t("default"):this.t(F),link:ge.url,port:ge.port,color:z.color})})}),C.canStart=!x.onlyWWW,C.config=x.adminUI.config!=="none",C.jsonConfig=x.adminUI.config==="json",C.materialize=x.adminUI.config==="materialize",C.compactMode=x.runAsCompactMode||!1,C.mode=x.mode||null,C.schedule=x.schedule||null,C.loglevel=x.loglevel||null,C.adapter=x.name||null,C.version=x.version||null,C.stoppedWhenWebExtension=C.obj.common.mode==="daemon"?C.obj.common.webExtension:void 0,C.stoppedWhenWebExtension){const F=this.states[C.id+".info.extension"]||(yield this.props.socket.getState(C.id+".info.extension"));C.stoppedWhenWebExtension=F?F.val:void 0}console.log(I._id),O[I._id]=C}console.log("getInstances: "+(Date.now()-o)),this.state.deleting&&!O["system.adapter."+this.state.deleting]&&(w.deleting=null),w.maxCompactGroupNumber=R,w.processes=N,w.mem=Math.round(k),w.instances=O,this._cacheList=null,this.setState(w)})),S(this,"getParamsLocalAndPanel",()=>he(this,null,function*(){const o=yield this.props.socket.readBaseSettings(this.state.currentHost).then(k=>{var O,R;return!!((R=(O=k.config)==null?void 0:O.system)!=null&&R.compact)}).catch(k=>window.alert(`Cannot read compact mode by host "${this.state.currentHost}": ${k}`));let a=!1,l="All";try{a=JSON.parse((window._localStorage||window.localStorage).getItem("Instances.playArrow")),l=JSON.parse((window._localStorage||window.localStorage).getItem("Instances.filterCompactGroup"))}catch(k){}const u=(window._localStorage||window.localStorage).getItem("Instances.onlyCurrentHost")==="true",T=(window._localStorage||window.localStorage).getItem("Instances.viewMode")==="true",N=(window._localStorage||window.localStorage).getItem("Instances.viewCategory")==="true";!l&&l!==0&&(l="All"),this._cacheList=null,this.setState({filterCompactGroup:l,compact:o,onlyCurrentHost:u,playArrow:a,viewMode:T,viewCategory:N})})),S(this,"onStateChange",(o,a)=>{const l=this.states[o];this.states[o]=a,(!l&&a||l&&!a||l&&a&&l.val!==a.val)&&(this.state.dialog==="config"&&this.state.dialogProp?(this.statesUpdateTimer&&clearTimeout(this.statesUpdateTimer),this.statesUpdateTimer=null,this.shouldUpdateAfterDialogClosed=!0):this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this._cacheList=null,this.forceUpdate()},1e3)))}),S(this,"extendObject",(o,a)=>this.props.socket.extendObject(o,a).catch(l=>window.alert(l))),S(this,"openConfig",o=>{Lt.Z.doNavigate("tab-instances","config",o)}),S(this,"getInstanceStatus",o=>{const a=o?o.common:null,l=(a==null?void 0:a.mode)||"";let u=l==="daemon"?"green":"blue";if(a&&a.enabled&&(!a.webExtension||!o.native.webInstance||l==="daemon")){const T=this.states[o._id+".alive"],N=this.states[o._id+".connected"],k=this.states[o._id.replace("system.adapter.","")+".info.connection"];if(a.webExtension&&o.native.webInstance){const O=this.states[o._id.replace("system.adapter.","")+".info.extension"];if(O)return O.val?"green":"red"}(!(N!=null&&N.val)||!(T!=null&&T.val))&&(u=l==="daemon"?"red":"orangeDevice"),k&&!(k!=null&&k.val)&&u!=="red"&&(u="orange")}else u=l==="daemon"?"grey":"blue";return u}),S(this,"isRunning",o=>{var a,l;return((a=o==null?void 0:o.common)==null?void 0:a.onlyWWW)||((l=o==null?void 0:o.common)==null?void 0:l.enabled)}),S(this,"isCompactGroup",o=>{var a;return((a=o==null?void 0:o.common)==null?void 0:a.compactGroup)||null}),S(this,"isCompact",o=>{var a;return((a=o==null?void 0:o.common)==null?void 0:a.runAsCompactMode)||!1}),S(this,"isCompactGroupCheck",o=>{var a;const l=this.adapters.find(({_id:u})=>u===`system.adapter.${o}`);return((a=l==null?void 0:l.common)==null?void 0:a.compact)||!1}),S(this,"getSentrySettings",o=>{var a,l;return!!((l=(a=o==null?void 0:o.common)==null?void 0:a.plugins)!=null&&l.sentry)||!1}),S(this,"isSentry",o=>{var a,l,u;return!!((l=(a=o==null?void 0:o.common)==null?void 0:a.plugins)!=null&&l.sentry)&&!((u=o==null?void 0:o.common)!=null&&u.disableDataReporting)||!1}),S(this,"getSchedule",o=>{var a;return(a=o==null?void 0:o.common)!=null&&a.schedule?o.common.schedule:""}),S(this,"getName",o=>!o||!o.common?"":o.common.titleLang?typeof o.common.titleLang=="string"?o.common.titleLang:o.common.titleLang[this.props.lang]||o.common.titleLang.en||"":o.common.title&&typeof o.common.title=="object"?o.common.title[this.props.lang]||o.common.title.en||"":o.common.title||""),S(this,"isModeSchedule",o=>{var a,l;return((a=o==null?void 0:o.common)==null?void 0:a.mode)&&((l=o==null?void 0:o.common)==null?void 0:l.mode)==="schedule"||!1}),S(this,"getMemoryLimitMB",o=>{var a;return(a=o==null?void 0:o.common)==null?void 0:a.memoryLimitMB}),S(this,"getInstanceHost",o=>{var a;return(a=o==null?void 0:o.common)==null?void 0:a.host}),S(this,"getRestartSchedule",o=>{var a;return(a=o==null?void 0:o.common)!=null&&a.restartSchedule?o.common.restartSchedule:""}),S(this,"getMemory",o=>{const a=this.states[o+".memRss"];return a?a==null?void 0:a.val:0}),S(this,"getInputOutput",o=>{const a=this.states[o+".inputCount"],l=this.states[o+".outputCount"];return{stateInput:a!=null&&a.val?a.val:0,stateOutput:l!=null&&l.val?l.val:0}}),S(this,"isAlive",o=>{const a=this.states[o+".alive"];return a?a.val:!1}),S(this,"isConnectedToHost",o=>{const a=this.states[o+".connected"];return a?a.val:!1}),S(this,"isConnected",o=>{const a=this.state.instances[o];return this.states[a.id+".info.connection"]?this.states[a.id+".info.connection"].val:null}),S(this,"getModeIcon",(o,a,l,u)=>o==="daemon"?u?v.createElement("div",{className:(0,H.default)(l,this.props.classes.okSymbol)},v.createElement("div",{className:this.props.classes.okSymbolInner})):a==="orange"?v.createElement(st.default,{className:l}):a==="green"?v.createElement("div",{className:(0,H.default)(l,this.props.classes.okSymbol)},v.createElement("div",{className:this.props.classes.okSymbolInner})):v.createElement(ct.Z,{className:l}):o==="schedule"?v.createElement(Ne.Z,{className:l}):null),S(this,"getStatusFilter",o=>{switch(o){case"not_alive":return"red";case"alive_no_device":return"orangeDevice";case"alive_not_connected":return"orange";case"ok":return"green";case"disabled":default:return"grey"}}),S(this,"setSentry",o=>{const a=!!this.isSentry(o.obj);this.extendObject("system.adapter."+o.id,{common:{disableDataReporting:a}}).then(()=>this.props.socket.setState(`system.adapter.${o.id}.plugins.sentry.enabled`,{val:!a,ack:!0}))}),S(this,"setTier",(o,a)=>this.extendObject("system.adapter."+o.id,{common:{tier:a}})),S(this,"setName",(o,a)=>this.extendObject("system.adapter."+o.id,{common:{titleLang:a}})),S(this,"setLogLevel",(o,a,l)=>{l?this.props.socket.setState(`system.adapter.${o.id}.logLevel`,a):this.extendObject("system.adapter."+o.id,{common:{loglevel:a}})}),S(this,"setSchedule",(o,a)=>{a?this.extendObject("system.adapter."+o.id,{common:{schedule:a}}):this.props.socket.getObject("system.adapter."+o.id).then(l=>{if(l.common.schedule)return delete l.common.schedule,this.props.socket.setObject(l._id,l)})}),S(this,"setMemoryLimitMB",(o,a)=>this.extendObject("system.adapter."+o.id,{common:{memoryLimitMB:a}})),S(this,"onDeleteInstance",(o,a)=>{this.setState({deleting:o.id},()=>this.props.executeCommand(`del ${o.id}${a?" --custom":""}${this.props.expertMode?" --debug":""}`))}),S(this,"setCompact",o=>this.extendObject("system.adapter."+o.id,{common:{runAsCompactMode:!this.isCompact(o.obj)}})),S(this,"setRestartSchedule",(o,a)=>{a?this.extendObject("system.adapter."+o.id,{common:{restartSchedule:a}}):this.props.socket.getObject("system.adapter."+o.id).then(l=>{if(l.common.restartSchedule)return l.common.restartSchedule="",this.props.socket.setObject(l._id,l)})}),S(this,"setHost",(o,a)=>this.extendObject("system.adapter."+o.id,{common:{host:a}})),S(this,"setCompactGroup",(o,a)=>{this.extendObject("system.adapter."+o.id,{common:{compactGroup:a==="controller"?0:a==="default"?1:parseInt(a,10)}}),this.state.maxCompactGroupNumber<a&&(this._cacheList=null,this.setState({maxCompactGroupNumber:a}))}),S(this,"onExpandRow",o=>{this.setState(a=>({expanded:a.expanded!==o?o:null}))}),S(this,"changeSetStateBool",o=>this.setState(a=>((window._localStorage||window.localStorage).setItem(`Instances.${o}`,a[o]?"false":"true"),{[o]:!a[o]}))),S(this,"changeSetState",(o,a)=>this.setState(l=>((window._localStorage||window.localStorage).setItem(`Instances.${o}`,a),{[o]:a}))),S(this,"changeStartedStopped",()=>{this._cacheList=null,this.setState(o=>{const a=o.playArrow?o.playArrow<2?2:!1:1;return(window._localStorage||window.localStorage).setItem("Instances.playArrow",JSON.stringify(a)),{playArrow:a}})}),S(this,"changeCompactGroup",o=>{this._cacheList=null,(window._localStorage||window.localStorage).setItem("Instances.filterCompactGroup",JSON.stringify(o)),this.setState({filterCompactGroup:o})});let r=[];if((window._localStorage||window.localStorage).getItem("Instances.expandedFolder"))try{r=JSON.parse((window._localStorage||window.localStorage).getItem("Instances.expandedFolder"))}catch(o){}this.state={expertMode:this.props.expertMode,runningInstances:!1,dialog:null,instances:null,dialogProp:null,states:null,playArrow:!1,onlyCurrentHost:!1,viewMode:!1,viewCategory:!1,folderOpen:!1,hostData:null,processes:null,mem:null,percent:null,memFree:null,filterText:(window._localStorage||window.localStorage).getItem("instances.filter")||"",compact:!1,maxCompactGroupNumber:1,filterCompactGroup:"All",sentry:!1,deleting:null,deleteCustomSupported:!1,currentHost:this.props.currentHost,expandedFolder:r,filterMode:(window._localStorage||window.localStorage).getItem("Instances.filterMode")?(window._localStorage||window.localStorage).getItem("Instances.filterMode")==="null"?null:(window._localStorage||window.localStorage).getItem("Instances.filterMode"):null,filterStatus:(window._localStorage||window.localStorage).getItem("Instances.filterStatus")?(window._localStorage||window.localStorage).getItem("Instances.filterStatus")==="null"?null:(window._localStorage||window.localStorage).getItem("Instances.filterStatus"):null},this.columns={instance:{onlyExpert:!1},actions:{onlyExpert:!1},title:{onlyExpert:!1},schedule:{onlyExpert:!1},restart:{onlyExpert:!0},log:{onlyExpert:!0},ramLimit:{onlyExpert:!0},events:{onlyExpert:!0},ram:{onlyExpert:!1}},this.promises={},this.states={},this.adapters=[],this.statesUpdateTimer=null,this.wordCache={},this.oneReload=!1,this.t=this.translate,this.inputRef=(0,b.createRef)()}componentDidMount(){return he(this,null,function*(){this.props.instancesWorker.registerHandler(this.getInstances),yield this.updateData();const t=yield this.props.socket.checkFeatureSupported("DEL_INSTANCE_CUSTOM");t&&this.setState({deleteCustomSupported:t})})}updateData(){return he(this,null,function*(){yield this.getParamsLocalAndPanel(),yield this.getData(),yield this.getHostsData(),yield this.getInstances()})}componentWillUnmount(){return he(this,null,function*(){this.subscribeStates(!0),this.props.instancesWorker.unregisterHandler(this.getInstances)})}getStates(t){return t&&(this.promises.states=null),this.promises.states=this.promises.states||this.props.socket.getForeignStates("system.adapter.*"),this.promises.states}static getDerivedStateFromProps(t,r){const o=Lt.Z.getLocation(),a={dialog:o.dialog,dialogProp:o.id};return t.expertMode!==r.expertMode&&(a.expertMode=t.expertMode),a}getData(t){return he(this,null,function*(){try{const r=this.props.socket.getAdapters(t),o=this.getStates(),[a,l]=yield Promise.all([o,r]);this.adapters=l||[],this.states=a||[]}catch(r){console.log(r)}!this.states||this.subscribed||(this.subscribed=!0,this.subscribeStates())})}subscribeStates(t){const r=t?this.props.socket.unsubscribeState:this.props.socket.subscribeState;r.call(this.props.socket,"system.adapter.*.alive",this.onStateChange),r.call(this.props.socket,"system.adapter.*.connected",this.onStateChange),r.call(this.props.socket,"system.adapter.*.inputCount",this.onStateChange),r.call(this.props.socket,"system.adapter.*.memRss",this.onStateChange),r.call(this.props.socket,"system.adapter.*.outputCount",this.onStateChange),r.call(this.props.socket,"system.adapter.*.logLevel",this.onStateChange),r.call(this.props.socket,"system.host.*.diskFree",this.onStateChange),r.call(this.props.socket,"system.host.*.diskSize",this.onStateChange),r.call(this.props.socket,"system.host.*.diskWarning",this.onStateChange),r.call(this.props.socket,"system.host.*.freemem",this.onStateChange),r.call(this.props.socket,"*.info.connection",this.onStateChange),r.call(this.props.socket,"*.info.extension",this.onStateChange)}getHeaders(){const t=[];return Object.keys(this.columns).forEach((r,o)=>{(!r.onlyExpert||r.onlyExpert===this.state.expertMode)&&t.push(v.createElement(no.Z,{key:o},o))}),t}getLogLevelIcon(t){return t==="debug"?v.createElement(ro.Z,null):t==="info"?v.createElement(io.default,null):t==="warn"?v.createElement(st.default,null):t==="error"?v.createElement(so.default,null):null}cacheInstances(){const t=this.state.currentHost.replace(/^system.host./,"");if(this._cacheList=Object.keys(this.state.instances).map(r=>{var o,a,l;const u=this.state.instances[r],T=this.isRunning(u.obj),N=this.isCompactGroup(u.obj),k=this.isCompactGroupCheck(u.adapter)&&this.state.compact,O=this.isCompact(u.obj),R=u.compact||!1,w=this.isAlive(r),g=this.isConnectedToHost(r),I=this.isConnected(r),x=this.getName(u.obj),M=((o=this.states[`${r}.logLevel`])==null?void 0:o.val)||u.loglevel,d=u.loglevel,C=((l=(a=u==null?void 0:u.obj)==null?void 0:a.common)==null?void 0:l.tier)||3,Z=this.getLogLevelIcon(M),B=this.getInputOutput(r),F=this.isModeSchedule(u.obj),z=this.getMemoryLimitMB(u.obj),U=this.getSentrySettings(u.obj),ge=this.isSentry(u.obj);return{id:r,running:T,host:u.host,nameId:u.id,compactGroup:N,checkCompact:k,mode:u.mode,sentry:ge,category:u.obj.common.type||"other",status:this.getInstanceStatus(u.obj),alive:w,compact:O,supportCompact:R,connectedToHost:g,connected:I,name:x,logLevel:M,logLevelObject:d,tier:C,loglevelIcon:Z,inputOutput:B,modeSchedule:F,checkSentry:U,memoryLimitMB:z,stoppedWhenWebExtension:u.stoppedWhenWebExtension,allowInstanceSettings:this.props.repository[u.adapter]?this.props.repository[u.adapter].allowInstanceSettings:!0,allowInstanceDelete:this.props.repository[u.adapter]?this.props.repository[u.adapter].allowInstanceDelete:!0,allowInstanceLink:this.props.repository[u.adapter]?this.props.repository[u.adapter].allowInstanceLink:!0}}),this.state.playArrow&&(this._cacheList=this._cacheList.filter(({running:r})=>this.state.playArrow<2?r:!r)),this.state.onlyCurrentHost&&(this._cacheList=this._cacheList.filter(({host:r})=>r===t)),this.state.filterText){const r=this.state.filterText.toLowerCase();this._cacheList=this._cacheList.filter(({name:o,nameId:a})=>o.toLowerCase().includes(r)||a.toLowerCase().includes(r))}if(this.props.expertMode&&(this.state.filterCompactGroup||this.state.filterCompactGroup===0)&&this.state.compact&&(this._cacheList=this._cacheList.filter(({compactGroup:r})=>r===this.state.filterCompactGroup||this.state.filterCompactGroup==="All"||this.state.filterCompactGroup==="default"&&(r===null||r===1)||this.state.filterCompactGroup==="controller"&&r==="0")),this.state.filterMode&&(this._cacheList=this._cacheList.filter(r=>r.mode===this.state.filterMode)),this.state.filterStatus){const r=this.getStatusFilter(this.state.filterStatus);this._cacheList=this._cacheList.filter(o=>r===o.status)}return this._cacheList}clearAllFilters(){const t={playArrow:!1,onlyCurrentHost:!1,filterCompactGroup:"All",filterMode:null,filterStatus:null,filterText:""};(window._localStorage||window.localStorage).removeItem("instances.filter"),(window._localStorage||window.localStorage).removeItem("Instances.playArrow"),(window._localStorage||window.localStorage).removeItem("Instances.onlyCurrentHost"),(window._localStorage||window.localStorage).removeItem("Instances.filterCompactGroup"),(window._localStorage||window.localStorage).removeItem("Instances.filterMode"),(window._localStorage||window.localStorage).removeItem("Instances.filterStatus"),this._cacheList=null,this.setState(t,()=>{this.inputRef.current&&(this.inputRef.current.value=""),this.cacheInstances()})}getPanels(){this._cacheList||this.cacheInstances();let t=this._cacheList.map((r,o)=>{const a=r.id,l=this.state.instances[a];return this.state.viewMode?{category:r.category,render:v.createElement(Po,{deleting:this.state.deleting===l.id,adminInstance:this.props.adminInstance,maxCompactGroupNumber:this.state.maxCompactGroupNumber,onDeleteInstance:this.onDeleteInstance,expertMode:this.props.expertMode,extendObject:this.extendObject,getMemory:this.getMemory,getRestartSchedule:()=>this.getRestartSchedule(l.obj),getSchedule:()=>this.getSchedule(l.obj),hosts:this.props.hosts,id:a,deleteCustomSupported:this.state.deleteCustomSupported,instance:l,key:l.id,openConfig:this.openConfig,setCompact:this.setCompact,setCompactGroup:this.setCompactGroup,setHost:this.setHost,setLogLevel:this.setLogLevel,setMemoryLimitMB:this.setMemoryLimitMB,setName:this.setName,setRestartSchedule:this.setRestartSchedule,setSchedule:this.setSchedule,setSentry:this.setSentry,setTier:this.setTier,t:this.t,lang:this.props.lang,themeType:this.props.themeType,item:r})}:{category:r.category,render:v.createElement(Ko,{deleting:this.state.deleting===l.id,deleteCustomSupported:this.state.deleteCustomSupported,adminInstance:this.props.adminInstance,maxCompactGroupNumber:this.state.maxCompactGroupNumber,onDeleteInstance:this.onDeleteInstance,expanded:this.state.expanded,expertMode:this.props.expertMode,extendObject:this.extendObject,getInstanceStatus:()=>this.getInstanceStatus(l.obj),getMemory:this.getMemory,getModeIcon:this.getModeIcon,getRestartSchedule:()=>this.getRestartSchedule(l.obj),getSchedule:()=>this.getSchedule(l.obj),onExpandRow:this.onExpandRow,hosts:this.props.hosts,id:a,idx:o,instance:l,key:l.id,openConfig:this.openConfig,setCompact:this.setCompact,setCompactGroup:this.setCompactGroup,setHost:this.setHost,setLogLevel:this.setLogLevel,setMemoryLimitMB:this.setMemoryLimitMB,setName:this.setName,setRestartSchedule:this.setRestartSchedule,setSchedule:this.setSchedule,setSentry:this.setSentry,setTier:this.setTier,t:this.t,lang:this.props.lang,themeType:this.props.themeType,item:r})}});if(!t.length)return v.createElement("div",{title:this.t("Click to clear all filters"),onClick:()=>this.clearAllFilters(),style:{margin:20,fontSize:26,textAlign:"center",cursor:"pointer"}},this.t("all items are filtered out"));if(!this.state.viewMode&&this.state.viewCategory){let r=[];return t.forEach(({category:o})=>!r.includes(o)&&r.push(o)),r.sort((o,a)=>o==="general"&&a!=="general"?-1:o!=="general"&&a==="general"||o>a?1:o<a?-1:0),r.map(o=>v.createElement(ha,{key:o,name:o,expanded:this.state.expandedFolder.includes(o),onExpand:a=>{const l=[...this.state.expandedFolder],u=l.indexOf(o);a?u===-1&&(l.push(o),l.sort()):u!==-1&&l.splice(u,1),(window._localStorage||window.localStorage).setItem("Instances.expandedFolder",JSON.stringify(l)),this.setState({expandedFolder:l})}},t.filter(({category:a})=>a===o).map(({render:a})=>a)))}return t.map(({render:r})=>r)}getHostsData(){return he(this,null,function*(){this.props.socket.getHostInfo(this.state.currentHost,!1,1e4).catch(l=>(l.toString().includes("May not read")||window.alert("Cannot read host information: "+l),{})).then(l=>{this._cacheList=null,this.setState({hostData:l})});let t,r=yield this.props.socket.getState(`${this.state.currentHost}.memAvailable`),o=yield this.props.socket.getState(`${this.state.currentHost}.freemem`),a=yield this.props.socket.getObject(`${this.state.currentHost}`);if(r?t=r:o&&(t=o),t){const l=(a==null?void 0:a.native.hardware.totalmem)/1048576,u=Math.round(t.val/l*100);this._cacheList=null,this.setState({percent:u,memFree:t.val})}})}handleFilterChange(t){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(r=>{this.typingTimer=null,this._cacheList=null,this.setState({filterText:r}),(window._localStorage||window.localStorage).setItem("instances.filter",r)},300,t.target.value)}render(){if(!this.state.instances)return v.createElement(ao.Z,null);const{classes:t}=this.props;if(this.props.currentHost!==this.state.currentHost&&(this.hostsTimer=this.hostsTimer||setTimeout(()=>{this.hostsTimer=null,this.setState({currentHost:this.props.currentHost},()=>he(this,null,function*(){return yield this.updateData()}))},200)),this.state.dialog==="config"&&this.state.dialogProp){const o=this.state.instances[this.state.dialogProp]||null;if(o)return v.createElement(lo.Z,{className:t.paper},v.createElement(yo.Z,{adapter:o.id.split(".")[0],adminInstance:this.props.adminInstance,className:t.iframe,configStored:this.props.configStored,dateFormat:this.props.dateFormat,icon:o.image,instance:parseInt(o.id.split(".")[1]),isFloatComma:this.props.isFloatComma,jsonConfig:o.jsonConfig,lang:this.props.lang,materialize:o.materialize,menuPadding:this.props.menuPadding,socket:this.props.socket,t:this.t,theme:this.props.theme,themeName:this.props.themeName,themeType:this.props.themeType,width:this.props.width,version:o.version,onRegisterIframeRef:a=>this.props.onRegisterIframeRef(a),onUnregisterIframeRef:a=>this.props.onUnregisterIframeRef(a)}))}this.shouldUpdateAfterDialogClosed&&(this.shouldUpdateAfterDialogClosed=!1,this.statesUpdateTimer||this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout(()=>{this.statesUpdateTimer=null,this.forceUpdate()},300)));const r=this.state.hostData?(this.state.hostData["Disk free"]?`${this.t("Disk free")}: ${Math.round(this.state.hostData["Disk free"]/(this.state.hostData["Disk size"]/100))}%, `:"")+`${this.t("Total RAM usage")}: ${this.state.mem} Mb / ${this.t("Free")}: ${this.state.percent}% = ${this.state.memFree} Mb [${this.t("Host")}: ${this.props.currentHostName} - ${this.state.processes} ${this.state.processes===1?this.t("process"):this.t("processes")}]`:null;return v.createElement(bo.Z,null,v.createElement(Co.Z,null,v.createElement(me.Z,{title:this.t("Show / hide List")},v.createElement(te.Z,{size:"large",onClick:()=>this.changeSetStateBool("viewMode")},this.state.viewMode?v.createElement(mo.default,null):v.createElement(po.Z,null))),!this.state.viewMode&&v.createElement(me.Z,{title:this.t("Category")},v.createElement(te.Z,{size:"large",onClick:()=>this.changeSetStateBool("viewCategory")},v.createElement(go.default,{color:this.state.viewCategory?"primary":"inherit"}))),!this.state.viewMode&&this.state.viewCategory&&v.createElement(v.Fragment,null,v.createElement(me.Z,{title:this.t("expand all")},v.createElement(te.Z,{size:"large",onClick:()=>{let o=[];this._cacheList.forEach(({category:a})=>!o.includes(a)&&o.push(a)),o.sort(),(window._localStorage||window.localStorage).setItem("Instances.expandedFolder",JSON.stringify(o)),this.setState({expandedFolder:o})}},v.createElement(ho.default,null))),v.createElement(me.Z,{title:this.t("collapse all")},v.createElement(te.Z,{size:"large",onClick:()=>{(window._localStorage||window.localStorage).removeItem("Instances.expandedFolder"),this.setState({expandedFolder:[]})}},v.createElement(uo.Z,null)))),v.createElement(me.Z,{title:this.t("Reload")},v.createElement(te.Z,{size:"large",onClick:()=>this.getData(!0)},v.createElement(it.default,null))),this.props.hosts.length>1?v.createElement(me.Z,{title:this.t("Show instances only for current host")},v.createElement(te.Z,{size:"large",onClick:()=>this.changeSetStateBool("onlyCurrentHost")},v.createElement(co.Z,{color:this.state.onlyCurrentHost?"primary":"inherit"}))):null,v.createElement(me.Z,{title:this.t(this.state.playArrow?this.state.playArrow<2?"Showed only running instances":"Showed only stopped instances":"Show running or stopped instances")},v.createElement(te.Z,{size:"large",onClick:()=>this.changeStartedStopped(this.state.playArrow)},v.createElement(rt.default,{style:this.state.playArrow===2?{color:"red"}:null,color:this.state.playArrow&&this.state.playArrow<2?"primary":"inherit"}))),v.createElement(me.Z,{title:this.t("Filter instances")},v.createElement(te.Z,{size:"large",onClick:()=>ca(o=>{o&&(this._cacheList=null,this.setState(o),this.changeSetState("filterMode",o.filterMode),this.changeSetState("filterStatus",o.filterStatus))},this.state.filterMode,this.state.filterStatus,this.getModeIcon,this.props.theme)},v.createElement(fo.FaFilter,{style:{width:16,height:16},className:this.state.filterMode||this.state.filterStatus?t.filterActive:""}))),this.props.expertMode&&this.state.compact?v.createElement(Qo.Z,{title:this.t("Filter specific compact group"),t:this.t,arrayItem:[{name:"All"},{name:"controller"},{name:"default"},...Array(this.state.maxCompactGroupNumber-1).fill().map((o,a)=>({name:a+2}))],buttonIcon:v.createElement(Le.Z,{style:{marginRight:4},color:"primary"}),onClick:o=>this.changeCompactGroup(o),value:this.state.filterCompactGroup}):null,v.createElement("div",{className:t.grow}),v.createElement(n.TextField,{variant:"standard",inputRef:this.inputRef,label:this.t("Filter"),style:{margin:"5px 0"},defaultValue:this.state.filterText,onChange:o=>this.handleFilterChange(o),InputProps:{endAdornment:this.state.filterText?v.createElement(n.InputAdornment,{position:"end"},v.createElement(te.Z,{size:"small",onClick:()=>{this.inputRef.current.value="",this._cacheList=null,this.setState({filterText:""}),(window._localStorage||window.localStorage).setItem("instances.filter","")}},v.createElement(It.default,null))):null}}),v.createElement("div",{className:t.grow}),v.createElement(n.Hidden,{xsDown:!0},r)),v.createElement(xo.Z,{overflow:"auto"},v.createElement("div",{className:this.state.viewMode?t.cards:""},this.getPanels(t))))}}_t.propTypes={ready:y().bool,t:y().func,lang:y().string,expertMode:y().bool,instancesWorker:y().object,hostname:y().string,hosts:y().array,protocol:y().string,adminInstance:y().string,repository:y().object,currentHost:y().string,socket:y().object,themeName:y().string,themeType:y().string,theme:y().object,systemLang:y().string,width:y().string,menuPadding:y().number,isFloatComma:y().bool,dateFormat:y().string,onRegisterIframeRef:y().func,onUnregisterIframeRef:y().func};var ya=(0,vo.default)()((0,xe.withStyles)(va)(_t))},37281:function(){}}]);
2
+
3
+ //# sourceMappingURL=7397.acb3d9d7.chunk.js.map