iobroker.admin 6.17.10 → 6.17.11
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/adminWww/asset-manifest.json +7 -7
- package/adminWww/index.html +1 -1
- package/adminWww/static/js/2544.9989e77c.chunk.js +2 -0
- package/adminWww/static/js/2544.9989e77c.chunk.js.map +1 -0
- package/adminWww/static/js/{5060.be28e810.chunk.js → 5060.ccc9f4db.chunk.js} +2 -2
- package/adminWww/static/js/{5060.be28e810.chunk.js.map → 5060.ccc9f4db.chunk.js.map} +1 -1
- package/adminWww/static/js/{main.0415e9f0.js → main.8487596a.js} +2 -2
- package/adminWww/static/js/{main.0415e9f0.js.map → main.8487596a.js.map} +1 -1
- package/io-package.json +2 -2
- package/package.json +1 -1
- package/adminWww/static/js/2544.27845072.chunk.js +0 -2
- package/adminWww/static/js/2544.27845072.chunk.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.js": "./static/js/main.
|
|
3
|
+
"main.js": "./static/js/main.8487596a.js",
|
|
4
4
|
"static/css/5060.fdf11545.chunk.css": "./static/css/5060.fdf11545.chunk.css",
|
|
5
|
-
"static/js/5060.
|
|
5
|
+
"static/js/5060.ccc9f4db.chunk.js": "./static/js/5060.ccc9f4db.chunk.js",
|
|
6
6
|
"static/js/4040.0d838197.chunk.js": "./static/js/4040.0d838197.chunk.js",
|
|
7
7
|
"static/js/2058.f86eab17.chunk.js": "./static/js/2058.f86eab17.chunk.js",
|
|
8
8
|
"static/js/5259.5078310d.chunk.js": "./static/js/5259.5078310d.chunk.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"static/js/5096.3a6e8bdb.chunk.js": "./static/js/5096.3a6e8bdb.chunk.js",
|
|
11
11
|
"static/js/1659.267113cb.chunk.js": "./static/js/1659.267113cb.chunk.js",
|
|
12
12
|
"static/js/2557.b3145f19.chunk.js": "./static/js/2557.b3145f19.chunk.js",
|
|
13
|
-
"static/js/2544.
|
|
13
|
+
"static/js/2544.9989e77c.chunk.js": "./static/js/2544.9989e77c.chunk.js",
|
|
14
14
|
"static/js/8176.79928d78.chunk.js": "./static/js/8176.79928d78.chunk.js",
|
|
15
15
|
"static/js/8194.e4607c20.chunk.js": "./static/js/8194.e4607c20.chunk.js",
|
|
16
16
|
"static/js/3815.99968da8.chunk.js": "./static/js/3815.99968da8.chunk.js",
|
|
@@ -360,9 +360,9 @@
|
|
|
360
360
|
"static/media/user.svg": "./static/media/user.30ee1d93abd9be26092a.svg",
|
|
361
361
|
"static/media/certificates.svg": "./static/media/certificates.ab26bafd65aff70b80b6.svg",
|
|
362
362
|
"static/media/rooms.svg": "./static/media/rooms.aaecf90b447daf78b98f.svg",
|
|
363
|
-
"main.
|
|
363
|
+
"main.8487596a.js.map": "./static/js/main.8487596a.js.map",
|
|
364
364
|
"5060.fdf11545.chunk.css.map": "./static/css/5060.fdf11545.chunk.css.map",
|
|
365
|
-
"5060.
|
|
365
|
+
"5060.ccc9f4db.chunk.js.map": "./static/js/5060.ccc9f4db.chunk.js.map",
|
|
366
366
|
"4040.0d838197.chunk.js.map": "./static/js/4040.0d838197.chunk.js.map",
|
|
367
367
|
"2058.f86eab17.chunk.js.map": "./static/js/2058.f86eab17.chunk.js.map",
|
|
368
368
|
"5259.5078310d.chunk.js.map": "./static/js/5259.5078310d.chunk.js.map",
|
|
@@ -370,7 +370,7 @@
|
|
|
370
370
|
"5096.3a6e8bdb.chunk.js.map": "./static/js/5096.3a6e8bdb.chunk.js.map",
|
|
371
371
|
"1659.267113cb.chunk.js.map": "./static/js/1659.267113cb.chunk.js.map",
|
|
372
372
|
"2557.b3145f19.chunk.js.map": "./static/js/2557.b3145f19.chunk.js.map",
|
|
373
|
-
"2544.
|
|
373
|
+
"2544.9989e77c.chunk.js.map": "./static/js/2544.9989e77c.chunk.js.map",
|
|
374
374
|
"8176.79928d78.chunk.js.map": "./static/js/8176.79928d78.chunk.js.map",
|
|
375
375
|
"8194.e4607c20.chunk.js.map": "./static/js/8194.e4607c20.chunk.js.map",
|
|
376
376
|
"3815.99968da8.chunk.js.map": "./static/js/3815.99968da8.chunk.js.map",
|
|
@@ -403,6 +403,6 @@
|
|
|
403
403
|
"9030.7d9c182b.chunk.js.map": "./static/js/9030.7d9c182b.chunk.js.map"
|
|
404
404
|
},
|
|
405
405
|
"entrypoints": [
|
|
406
|
-
"static/js/main.
|
|
406
|
+
"static/js/main.8487596a.js"
|
|
407
407
|
]
|
|
408
408
|
}
|
package/adminWww/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en" translate="no"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><meta name="theme-color" content="#000000"/><meta name="description" content="admin - ioBroker"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="stylesheet" href="./css/leaflet.css"/><link rel="manifest" href="./manifest.json" crossorigin="use-credentials"/><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./lib/js/socket.io.js"></script><script type="text/javascript" src="./lib/js/sparkline.js"></script><title>Admin</title><script>window.loginHideLogo="@@loginHideLogo@@",window.loginMotto="@@loginMotto@@",window.login="@@auth@@",window.loginLogo="@@loginLogo@@",window.loginLink="@@loginLink@@",window.loginTitle="@@loginTitle@@",window.loginBackgroundColor="@@loginBackgroundColor@@",window.loginBackgroundImage="@@loginBackgroundImage@@",window.vendorPrefix="@@vendorPrefix@@",window.disableDataReporting="@@disableDataReporting@@",window.loadingBackgroundColor="@@loadingBackgroundColor@@",window.loadingBackgroundImage="@@loadingBackgroundImage@@",window.loadingHideLogo="@@loadingHideLogo@@"</script><style>.root{background-color:rgba(255,255,255,.87);border-radius:10px}.unsupported{width:200px;background-color:#aaa;margin:auto;margin-top:3rem;padding:10px;line-height:25px;border-radius:4px;text-align:center}.leaflet-container{height:400px;width:100%}</style><script>setTimeout((()=>{const o=document.body;window.location.search.includes("?login")?(window.loginBackgroundColor&&-1===window.loginBackgroundColor.indexOf("loginBackgroundColor")&&(o.style.backgroundColor=window.loginBackgroundColor),window.loginBackgroundImage&&-1===window.loginBackgroundImage.indexOf("loginBackgroundImage")&&(o.style.backgroundImage="url("+window.loginBackgroundImage+")",o.style.backgroundSize="cover")):(window.loadingBackgroundColor&&-1===window.loadingBackgroundColor.indexOf("loadingBackgroundColor")&&(o.style.backgroundColor=window.loadingBackgroundColor),window.loadingBackgroundImage&&-1===window.loadingBackgroundImage.indexOf("loadingBackgroundImage")&&(o.style.backgroundImage="url("+window.loadingBackgroundImage+")",o.style.backgroundSize="cover"))}),0),window.addEventListener("load",(function o(n){window.removeEventListener("load",o,!1);if(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./)){const o=document.getElementById("root");o.classList.add("unsupported"),o.innerHTML="Browser is not supported. Please use Firefox or Chrome."}}),!1)</script><script defer="defer" src="static/js/main.
|
|
1
|
+
<!doctype html><html lang="en" translate="no"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><meta name="theme-color" content="#000000"/><meta name="description" content="admin - ioBroker"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="stylesheet" href="./css/leaflet.css"/><link rel="manifest" href="./manifest.json" crossorigin="use-credentials"/><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./lib/js/socket.io.js"></script><script type="text/javascript" src="./lib/js/sparkline.js"></script><title>Admin</title><script>window.loginHideLogo="@@loginHideLogo@@",window.loginMotto="@@loginMotto@@",window.login="@@auth@@",window.loginLogo="@@loginLogo@@",window.loginLink="@@loginLink@@",window.loginTitle="@@loginTitle@@",window.loginBackgroundColor="@@loginBackgroundColor@@",window.loginBackgroundImage="@@loginBackgroundImage@@",window.vendorPrefix="@@vendorPrefix@@",window.disableDataReporting="@@disableDataReporting@@",window.loadingBackgroundColor="@@loadingBackgroundColor@@",window.loadingBackgroundImage="@@loadingBackgroundImage@@",window.loadingHideLogo="@@loadingHideLogo@@"</script><style>.root{background-color:rgba(255,255,255,.87);border-radius:10px}.unsupported{width:200px;background-color:#aaa;margin:auto;margin-top:3rem;padding:10px;line-height:25px;border-radius:4px;text-align:center}.leaflet-container{height:400px;width:100%}</style><script>setTimeout((()=>{const o=document.body;window.location.search.includes("?login")?(window.loginBackgroundColor&&-1===window.loginBackgroundColor.indexOf("loginBackgroundColor")&&(o.style.backgroundColor=window.loginBackgroundColor),window.loginBackgroundImage&&-1===window.loginBackgroundImage.indexOf("loginBackgroundImage")&&(o.style.backgroundImage="url("+window.loginBackgroundImage+")",o.style.backgroundSize="cover")):(window.loadingBackgroundColor&&-1===window.loadingBackgroundColor.indexOf("loadingBackgroundColor")&&(o.style.backgroundColor=window.loadingBackgroundColor),window.loadingBackgroundImage&&-1===window.loadingBackgroundImage.indexOf("loadingBackgroundImage")&&(o.style.backgroundImage="url("+window.loadingBackgroundImage+")",o.style.backgroundSize="cover"))}),0),window.addEventListener("load",(function o(n){window.removeEventListener("load",o,!1);if(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./)){const o=document.getElementById("root");o.classList.add("unsupported"),o.innerHTML="Browser is not supported. Please use Firefox or Chrome."}}),!1)</script><script defer="defer" src="static/js/main.8487596a.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunksrc_rx=self.webpackChunksrc_rx||[]).push([[2544],{26104:(t,e,s)=>{"use strict";s.d(e,{A:()=>o});s(29183);const o="./static/media/sentry.f503457f165bb32607bc1cc0f8211ead.svg"},90869:(t,e,s)=>{"use strict";s.d(e,{A:()=>c});var o=s(29183),i=s(34715),n=s(89303),a=s(32075),r=s(26699),l=s(99277);const c=(0,i.withStyles)((t=>({modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:"flex",overflow:"hidden"},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:"absolute",right:t.spacing(1),top:t.spacing(1)},languageButtonActive:{color:t.palette.primary.main}})))((t=>{let{toggleTranslation:e,noTranslation:s,title:i,fullWidth:c,help:p,maxWidth:d,progress:h,icon:m,disableApplyIfNotChanged:u,applyButton:g,classes:x,onClose:v,children:f,titleButtonApply:b,titleButtonClose:y,onApply:j,textInput:C,defaultValue:S,overflowHidden:w,disableApply:I}=t;const[k,D]=(0,o.useState)(S);(0,o.useEffect)((()=>{D(S)}),[S]);let N=null;return m&&(N=m),(0,l.jsxs)(n.Dialog,{open:!0,maxWidth:d||"md",fullWidth:!!c,disableEscapeKeyDown:!1,onClose:v,classes:{paper:x.modalDialog},children:[i&&(0,l.jsxs)(n.DialogTitle,{children:[m?(0,l.jsx)(N,{className:x.titleIcon}):null,i,"en"!==r.I18n.getLanguage()&&e?(0,l.jsx)(n.IconButton,{size:"large",className:r.Utils.clsx(x.languageButton,s&&x.languageButtonActive),onClick:()=>e(),title:r.I18n.t("Disable/Enable translation"),children:(0,l.jsx)(a.Language,{})}):null]}),(0,l.jsxs)(n.DialogContent,{className:r.Utils.clsx(w?x.overflowHidden:null,x.content),style:{paddingTop:8},children:[C&&(0,l.jsx)(n.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"standard",size:"medium",multiline:!0,value:k,onChange:t=>D(t.target.value),InputProps:{endAdornment:k?(0,l.jsx)(n.InputAdornment,{position:"end",children:(0,l.jsx)(n.IconButton,{size:"small",onClick:()=>D(""),children:(0,l.jsx)(a.Close,{})})}):null}}),f,p?(0,l.jsx)("div",{children:p}):null]}),(0,l.jsxs)(n.DialogActions,{children:[(void 0===g||g)&&(0,l.jsx)(n.Button,{startIcon:(0,l.jsx)(a.Check,{}),disabled:I||h||u&&S===k,onClick:()=>j&&j(C?k:""),variant:"contained",color:"primary",children:r.I18n.t(b||"Ok")}),(0,l.jsx)(n.Button,{color:"grey",onClick:v,disabled:h,variant:"contained",startIcon:(0,l.jsx)(a.Close,{}),children:r.I18n.t(y||"Cancel")})]})]})}))},95712:(t,e,s)=>{"use strict";s.d(e,{A:()=>c});var o=s(29183),i=s(34715),n=s(89303),a=s(1373),r=s(99277);const l=(0,i.makeStyles)((()=>({button:{marginLeft:10,marginRight:10},icon:{marginRight:5}}))),c=t=>{let{arrayItem:e,title:s,onClick:i,value:c,contained:p,buttonIcon:d,icons:h,t:m,translateSuffix:u,noTranslation:g}=t;const[x,v]=(0,o.useState)(null);u=u||"";const f=l();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Tooltip,{title:s||"",children:(0,r.jsxs)(n.Button,{className:f.button,variant:p?"contained":"outlined",color:"primary",onClick:t=>v(t.currentTarget),children:[d||h&&(0,r.jsx)(a.A,{objIconBool:!0,iconName:c,className:f.icon}),"number"===typeof c||g?c:m(c+u)]})}),(0,r.jsx)(n.Menu,{anchorEl:x,keepMounted:!0,open:Boolean(x),onClose:()=>v(null),children:e.map(((t,e)=>{let{name:s}=t;return(0,r.jsxs)(n.MenuItem,{selected:c||0===c?s===c:0===e,disabled:c||0===c?s===c:0===e,className:"tag-card-".concat(s),style:{placeContent:"space-between"},value:s,onClick:()=>{i(s),v(null)},children:[h&&(0,r.jsx)(a.A,{objIconBool:!0,iconName:s,className:f.icon}),"number"===typeof s||g?s:m(s+u)]},s)}))})]})}},65422:(t,e,s)=>{"use strict";s.d(e,{A:()=>p});s(29183);var o=s(34715),i=s(89303),n=s(32075),a=s(58693),r=s(20501),l=s(99277);const c={checkIcon:{color:a.A[700]},cancelIcon:{color:r.A[700]},wrapperContent:{display:"flex",flexFlow:"nowrap",alignItems:"inherit"}};const p=(0,o.withStyles)(c)((function(t){return(0,l.jsxs)(i.Grid,{item:!0,container:!0,className:t.classes.wrapperContent,alignItems:"center",direction:"row",spacing:1,children:[(0,l.jsx)(i.Grid,{item:!0,children:t.state?(0,l.jsx)(n.CheckCircle,{className:t.classes.checkIcon}):(0,l.jsx)(n.Cancel,{className:t.classes.cancelIcon})}),(0,l.jsx)(i.Grid,{item:!0,children:(0,l.jsx)(i.Typography,{children:t.children})})]})}))},46547:(t,e,s)=>{"use strict";s.d(e,{A:()=>p});var o=s(29183),i=s.n(o),n=s(34715),a=s(89303),r=s(26699),l=s(99277);class c extends i().Component{render(){const{classes:t}=this.props;return(0,l.jsx)(a.Paper,{elevation:Number.isNaN(this.props.elevation)?1:this.props.elevation,className:r.Utils.clsx(t.root,{[t.overflowHidden]:"visible"!==this.props.overflow},this.props.className),children:(0,l.jsx)(a.Grid,{container:!0,direction:"column",wrap:"nowrap",className:t.container,children:this.props.children})})}}const p=(0,n.withStyles)({root:{width:"100%",height:"100%"},overflowHidden:{overflow:"hidden"},container:{height:"100%"}})(c)},76393:(t,e,s)=>{"use strict";s.d(e,{A:()=>p});var o=s(29183),i=s.n(o),n=s(34715),a=s(89303),r=s(26699),l=s(99277);class c extends i().Component{render(){const{classes:t}=this.props;return(0,l.jsx)(a.Grid,{item:!0,className:r.Utils.clsx(t.root,{[t.overflowAuto]:"auto"===this.props.overflow}),children:this.props.children})}}const p=(0,n.withStyles)({root:{height:"100%",overflow:"hidden"},overflowAuto:{overflow:"auto"}})(c)},14027:(t,e,s)=>{"use strict";s.d(e,{A:()=>n});s(29183);var o=s(89303),i=s(99277);const n=t=>(0,i.jsx)(o.Grid,{item:!0,container:!0,alignItems:"center",children:t.children})},1373:(t,e,s)=>{"use strict";s.d(e,{A:()=>l});var o=s(29183),i=s(88795),n=s(99277);const a={},r={All:"AllInclusive",messaging:"Message",communication:"WifiTethering",general:"Apps",logic:"VpnKey",alarm:"NotificationsActive","iot-systems":"SystemUpdateAlt","misc-data":"EmojiSymbols",multimedia:"PermMedia",network:"SettingsEthernet",storage:"Storage",visualization:"Visibility","climate-control":"SettingsBrightness","date-and-time":"DateRange",energy:"BatteryChargingFull",garden:"FilterVintage",geoposition:"LocationOn",hardware:"Phonelink",health:"Favorite",household:"House",infrastructure:"Apartment",lighting:"EmojiObjects",protocols:"DialerSip",utility:"PhonelinkSetup",vehicle:"AirportShuttle","visualization-icons":"BubbleChart","visualization-widgets":"Widgets",weather:"Brightness6",metering:"LinearScale"},l=t=>{let{iconName:e,className:s,adapter:l,socket:c,onClick:p,objIconBool:d}=t;const[h,m]=(0,o.useState)("");if((0,o.useEffect)((()=>{l&&c&&(a[l]=a[l]||c.getObject("system.adapter.".concat(l)),a[l].then((t=>{var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.icon)&&m("../../adapter/".concat(l,"/").concat(t.common.icon))})))}),[l,c]),l)return(0,n.jsx)("img",{onClick:t=>p&&p(t),src:h||"",className:s,alt:""});const u=i[d?r[e]||"Help":e||"Help"];return(0,n.jsx)(u,{className:s,onClick:t=>p&&p(t)})}},39069:(t,e,s)=>{"use strict";s.d(e,{A:()=>v});var o=s(29183),i=s(34715),n=s(58693),a=s(20501),r=s(34779),l=s(49098),c=s(89303),p=s(32075),d=s(26699),h=s(46689),m=s(89153),u=s(99277);const g=["silly","debug","info","warn","error"];class x extends o.Component{constructor(t){super(t),this.onObjectChange=(t,e)=>{var s,o,i,n;t==="system.adapter.".concat(this.props.adapter,".").concat(this.props.instance)&&this.setState({running:(null===e||void 0===e||null===(s=e.common)||void 0===s?void 0:s.onlyWWW)||(null===e||void 0===e||null===(o=e.common)||void 0===o?void 0:o.enabled),canStart:!(null!==e&&void 0!==e&&null!==(i=e.common)&&void 0!==i&&i.onlyWWW),logLevel:(null===e||void 0===e||null===(n=e.common)||void 0===n?void 0:n.loglevel)||"info"})},this.onStateChange=(t,e)=>{const s="system.adapter.".concat(this.props.adapter,".").concat(this.props.instance);t==="".concat(s,".alive")?this.setState({alive:!!e&&e.val}):t==="".concat(s,".connected")?this.setState({connectedToHost:!!e&&e.val}):t==="".concat(this.props.adapter,".").concat(this.props.instance,".info.connection")?this.setState({connected:e?e.val:null}):t==="".concat(this.props.adapter,".").concat(this.props.instance,".info.extension")?this.setState({extension:e?e.val:null}):t==="".concat(s,".logLevel")&&this.setState({tempLogLevel:e?e.val:null})},this.extendObject=(t,e)=>{this.props.socket.extendObject(t,e).catch((t=>window.alert(t)))},this.state={checkedExist:!1,showStopAdminDialog:!1,running:!1,canStart:!1,alive:!1,connected:!1,connectedToHost:!1,logOnTheFlyValue:!1,logLevel:"info",logLevelValue:"info",tempLogLevel:"info"},this.refIframe=null,this.registered=!1}componentDidUpdate(){var t;!this.registered&&null!==(t=this.refIframe)&&void 0!==t&&t.contentWindow&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe))}componentDidMount(){var t;const e=window.addEventListener?"addEventListener":"attachEvent",s=window[e],o="attachEvent"===e?"onmessage":"message";if(this.props.tab)this.props.socket.fileExists("".concat(this.props.adapter,".admin"),"tab.html").then((t=>{t?this.setState({checkedExist:"tab.html"}):this.props.socket.fileExists("".concat(this.props.adapter,".admin"),"tab_m.html").then((t=>t?this.setState({checkedExist:"tab_m.html"}):window.alert("Cannot find tab(_m).html")))}));else{const t="system.adapter.".concat(this.props.adapter,".").concat(this.props.instance);this.props.socket.subscribeObject(t,this.onObjectChange),this.props.socket.getObject(t).then((async e=>{var s,o,i,n,a,r,l,c;const p=await this.props.socket.getState("".concat(t,".logLevel"));await this.props.socket.subscribeState("".concat(t,".logLevel"),this.onStateChange);const d=await this.props.socket.getState("".concat(t,".alive"));await this.props.socket.subscribeState("".concat(t,".alive"),this.onStateChange);const h=await this.props.socket.getState("".concat(t,".connected"));let m,u;await this.props.socket.subscribeState("".concat(t,".connected"),this.onStateChange);try{m=await this.props.socket.getState("".concat(this.props.adapter,".").concat(this.props.instance,".info.connection")),this.props.socket.subscribeState("".concat(this.props.adapter,".").concat(this.props.instance,".info.connection"),this.onStateChange)}catch(g){m=null}try{u=await this.props.socket.getState("".concat(this.props.adapter,".").concat(this.props.instance,".info.extension")),this.props.socket.subscribeState("".concat(this.props.adapter,".").concat(this.props.instance,".info.extension"),this.onStateChange)}catch(g){u=null}this.setState({checkedExist:!0,running:(null===e||void 0===e||null===(s=e.common)||void 0===s?void 0:s.onlyWWW)||(null===e||void 0===e||null===(o=e.common)||void 0===o?void 0:o.enabled),canStart:!(null!==e&&void 0!==e&&null!==(i=e.common)&&void 0!==i&&i.onlyWWW),alive:(null===d||void 0===d?void 0:d.val)||!1,extension:u?(null===(n=u)||void 0===n?void 0:n.val)||!1:null,connectedToHost:(null===h||void 0===h?void 0:h.val)||!1,connected:m?m.val||!1:null,logLevel:(null===e||void 0===e||null===(a=e.common)||void 0===a?void 0:a.loglevel)||"info",logLevelValue:(null===e||void 0===e||null===(r=e.common)||void 0===r?void 0:r.loglevel)||"info",tempLogLevel:(null===p||void 0===p?void 0:p.val)||(null===e||void 0===e||null===(l=e.common)||void 0===l?void 0:l.loglevel)||"info",common:(null===e||void 0===e?void 0:e.common)||{},native:(null===e||void 0===e?void 0:e.native)||{},adapterDocLangs:null!==e&&void 0!==e&&null!==(c=e.common)&&void 0!==c&&c.docs?Object.keys(e.common.docs):["en"]})})).catch((t=>{console.error(t),this.setState({checkedExist:!0,running:!1})}))}!this.registered&&null!==(t=this.refIframe)&&void 0!==t&&t.contentWindow&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe)),s(o,(t=>this.closeConfig(t)),!1)}getInstanceStatus(){var t,e,s;const o=(null===(t=this.state.common)||void 0===t?void 0:t.mode)||"";let i="daemon"===o?"green":"blue";if(null===(e=this.state.common)||void 0===e||!e.enabled||this.state.common.webExtension&&null!==(s=this.state.native)&&void 0!==s&&s.webInstance&&"daemon"!==o)i="daemon"===o?"grey":"blue";else{var n;if(this.state.common.webExtension&&null!==(n=this.state.native)&&void 0!==n&&n.webInstance&&null!==this.state.extension)return this.state.extension?"green":"red";this.state.connectedToHost&&this.state.alive||(i="daemon"===o?"red":"orangeDevice"),null===this.state.connected||this.state.connected||"red"===i||(i="orange")}return i}componentWillUnmount(){const t=window.removeEventListener?"removeEventListener":"detachEvent",e=window[t],s="detachEvent"===t?"onmessage":"message";this.props.socket.unsubscribeObject("system.adapter.".concat(this.props.adapter,".").concat(this.props.instance),this.onObjectChange),e(s,(t=>this.closeConfig(t)),!1),this.registered&&this.refIframe&&this.props.onUnregisterIframeRef(this.refIframe),this.refIframe=null}closeConfig(t){"close"===t.data||"close"===t.message?this.props.easyMode?d.Router.doNavigate("easy"):d.Router.doNavigate("tab-instances"):"change"===t.data||"change"===t.message?this.props.configStored(!1):"nochange"!==t.data&&"nochange"!==t.message||this.props.configStored(!0)}renderHelpButton(){return this.props.jsonConfig?(0,u.jsx)("div",{style:{display:"inline-block",position:"absolute",right:0,top:5},children:(0,u.jsx)(c.Tooltip,{size:"small",title:this.props.t("Show help for this adapter"),children:(0,u.jsx)(c.Fab,{classes:{root:this.props.classes.button},onClick:()=>{var t;const e=null!==(t=this.state.adapterDocLangs)&&void 0!==t&&t.includes(this.props.lang)?this.props.lang:"en";window.open(m.A.getDocsLinkForAdapter({lang:e,adapterName:this.props.adapter}),"help")},children:(0,u.jsx)(p.Help,{})})})}):null}getConfigurator(){if(this.props.jsonConfig)return(0,u.jsx)(h.JsonConfig,{menuPadding:this.props.menuPadding,theme:this.props.theme,width:this.props.width,adapterName:this.props.adapter,instance:this.props.instance,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,dateFormat:this.props.dateFormat,isFloatComma:this.props.isFloatComma,configStored:this.props.configStored,t:this.props.t});const t="adapter/".concat(this.props.adapter,"/")+"".concat(this.props.tab?this.state.checkedExist:this.props.materialize?"index_m.html":"index.html","?")+"".concat(this.props.instance||0,"&newReact=true&").concat(this.props.instance||0,"&react=").concat(this.props.themeName);return this.state.checkedExist?(0,u.jsx)("iframe",{ref:t=>this&&(this.refIframe=t),title:"config",className:this.props.className,src:t}):null}returnStopAdminDialog(){return this.state.showStopAdminDialog?(0,u.jsx)(d.Confirm,{title:this.props.t("Please confirm"),text:this.props.t("stop_admin",this.props.instance),ok:this.props.t("Stop admin"),onClose:t=>{t&&this.extendObject("system.adapter.".concat(this.props.adapter,".").concat(this.props.instance),{common:{enabled:!1}}),this.setState({showStopAdminDialog:!1})}}):null}renderLogLevelDialog(){return this.state.showLogLevelDialog?(0,u.jsxs)(c.Dialog,{open:!0,onClose:()=>this.setState({showLogLevelDialog:!1}),children:[(0,u.jsx)(c.DialogTitle,{children:this.props.t("Edit log level rule for %s","".concat(this.props.adapter,".").concat(this.props.instance))}),(0,u.jsxs)(c.DialogContent,{children:[(0,u.jsxs)(c.FormControl,{className:this.props.classes.formControl,variant:"outlined",style:{marginTop:10},children:[(0,u.jsx)(c.InputLabel,{children:this.props.t("log level")}),(0,u.jsx)(c.Select,{variant:"standard",value:this.state.logLevelValue,fullWidth:!0,onChange:t=>this.setState({logLevelValue:t.target.value}),children:g.map((t=>(0,u.jsx)(c.MenuItem,{value:t,children:this.props.t(t)},t)))})]}),(0,u.jsxs)(c.FormControl,{className:this.props.classes.formControl,variant:"outlined",children:[(0,u.jsx)(c.FormControlLabel,{control:(0,u.jsx)(c.Checkbox,{checked:this.state.logOnTheFlyValue,onChange:t=>this.setState({logOnTheFlyValue:t.target.checked})}),label:this.props.t("Without restart")}),(0,u.jsx)(c.FormHelperText,{children:this.state.logOnTheFlyValue?this.props.t("Will be reset to the saved log level after restart of adapter"):this.props.t("Log level will be saved permanently")})]})]}),(0,u.jsxs)(c.DialogActions,{children:[(0,u.jsx)(c.Button,{color:"primary",variant:"contained",onClick:()=>{this.state.logOnTheFlyValue?this.props.socket.setState("system.adapter.".concat(this.props.adapter,".").concat(this.props.instance,".logLevel"),this.state.logLevelValue):this.extendObject("system.adapter.".concat(this.props.adapter,".").concat(this.props.instance),{common:{loglevel:this.state.logLevelValue}}),this.setState({showLogLevelDialog:!1})},children:this.props.t("Ok")}),(0,u.jsx)(c.Button,{color:"grey",variant:"contained",onClick:()=>this.setState({showLogLevelDialog:!1}),children:this.props.t("Cancel")})]})]}):null}render(){const{classes:t}=this.props;return(0,u.jsxs)(c.Paper,{className:t.root,children:[(0,u.jsx)(c.AppBar,{color:"default",position:"static",children:(0,u.jsxs)(c.Toolbar,{variant:"dense",children:[(0,u.jsxs)(c.Typography,{variant:"h6",color:"inherit",children:[this.props.jsonConfig?(0,u.jsx)(d.Icon,{src:this.props.icon,className:this.props.classes.instanceIcon}):null,"".concat(this.props.t("Instance settings"),": ").concat(this.props.adapter,".").concat(this.props.instance),this.props.version?(0,u.jsxs)("span",{className:d.Utils.clsx(this.props.classes.version,this.props.classes[this.getInstanceStatus()]),children:["v",this.props.version]}):null,(0,u.jsx)(c.Tooltip,{title:this.props.t("Start/stop"),children:(0,u.jsx)("span",{children:(0,u.jsx)(c.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.state.running&&"".concat(this.props.adapter,".").concat(this.props.instance)===this.props.adminInstance?this.setState({showStopAdminDialog:!0}):this.extendObject("system.adapter.".concat(this.props.adapter,".").concat(this.props.instance),{common:{enabled:!this.state.running}})},onFocus:t=>t.stopPropagation(),className:d.Utils.clsx(t.buttonControl,this.state.canStart?this.state.running?t.enabled:t.disabled:t.hide),children:this.state.running?(0,u.jsx)(p.Pause,{}):(0,u.jsx)(p.PlayArrow,{})})})}),(0,u.jsx)(c.Tooltip,{title:this.props.t("Restart"),children:(0,u.jsx)("span",{children:(0,u.jsx)(c.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),this.extendObject("system.adapter.".concat(this.props.adapter,".").concat(this.props.instance),{})},onFocus:t=>t.stopPropagation(),className:d.Utils.clsx(t.buttonControl,!this.state.canStart&&t.hide),disabled:!this.state.running,children:(0,u.jsx)(p.Refresh,{})})})}),this.state.tempLogLevel!==this.state.logLevel?(0,u.jsx)(c.Tooltip,{title:this.props.t("temporary log level"),children:(0,u.jsx)("span",{className:this.props.classes.logLevel,children:this.state.tempLogLevel})}):null,(0,u.jsx)(c.Tooltip,{title:this.props.t("log level"),children:(0,u.jsx)("span",{className:this.props.classes.logLevel,children:this.state.tempLogLevel!==this.state.logLevel?"/ ".concat(this.state.logLevel):this.state.logLevel})}),(0,u.jsx)(c.Tooltip,{title:this.props.t("Edit log level rule for %s","".concat(this.props.adapter,".").concat(this.props.instance)),children:(0,u.jsx)(c.IconButton,{style:{width:34,height:34},size:"small",onClick:t=>{t.stopPropagation(),this.setState({showLogLevelDialog:!0})},onFocus:t=>t.stopPropagation(),className:d.Utils.clsx(t.buttonControl,!this.state.canStart&&t.hide),children:(0,u.jsx)(p.Edit,{style:{width:20,height:20}})})})]}),this.renderHelpButton()]})}),this.getConfigurator(),this.returnStopAdminDialog(),this.renderLogLevelDialog()]})}}const v=(0,i.withStyles)((t=>({root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},scroll:{height:"100%",overflowY:"auto"},instanceIcon:{width:42,height:42,marginRight:t.spacing(2),verticalAlign:"middle"},button:{marginRight:5,width:36,height:36},version:{fontSize:12,opacity:.8,marginLeft:20,marginRight:10},versionAliveConnected:{color:"dark"===t.palette.mode?"#23a623":"#60ff60"},versionAliveNotConnected:{color:"#a67223"},buttonControl:{padding:5,transition:"opacity 0.2s",height:34},enabled:{color:n.A[400],"&:hover":{backgroundColor:n.A[200]}},disabled:{color:a.A[400],"&:hover":{backgroundColor:a.A[200]}},hide:{visibility:"hidden"},formControl:{width:"100%",marginBottom:5},logLevel:{fontSize:12,marginLeft:10},green:{color:n.A[700]},red:{color:a.A[700]},grey:{color:r.A[700]},blue:{color:"#0055a9"},orange:{color:l.A[400]},orangeDevice:{color:l.A[300]}})))(x)},62243:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>X});var o=s(29183),i=s(34715),n=s(89303),a=s(32075),r=s(25512),l=s(26699),c=s(89153),p=s(39069),d=s(46547),h=s(76393),m=s(14027),u=s(93277),g=s.n(u),x=s(70067),v=s.n(x),f=(s(9572),s(93356),s(67927),s(73723),s(54234),s(63393),s(45127),s(42270),s(56222),s(55039),s(33613),s(58693)),b=s(20501),y=s(49098),j=s(34779),C=s(61204),S=s(96053),w=s(65422),I=s(99277);const k=(0,i.withStyles)((()=>({nowrap:{flexFlow:"nowrap",overflow:"hidden"},width:{width:"100%",overflow:"hidden"}})))((t=>(0,I.jsxs)(n.Grid,{item:!0,container:!0,title:t.icon?"":t.tooltip||"",alignItems:"center",direction:"row",spacing:1,className:t.classes.nowrap,children:[(0,I.jsx)(n.Grid,{item:!0,children:t.icon&&(0,I.jsx)(n.Tooltip,{title:t.tooltip||"",children:t.icon})}),(0,I.jsx)(n.Grid,{className:t.classes.width,item:!0,children:(0,I.jsx)(n.Tooltip,{title:t.tooltip||"",children:(0,I.jsx)(n.Typography,{component:"div",className:t.className,children:t.children})})})]})));var D=s(26104);const N="./static/media/sentryNo.8857d2e7c7af6b25a510f4833397d0d5.svg";var L=s(90869),A=s(12758);class T extends o.Component{render(){if(!this.props.links||!this.props.links.length)return null;const t=this.props.links[0].port,e=this.props.links.find((e=>e.port!==t));return(0,I.jsxs)(n.Dialog,{onClose:()=>this.props.onClose(),open:!0,children:[(0,I.jsx)(n.DialogTitle,{children:this.props.t("Links")}),(0,I.jsx)(n.List,{children:this.props.links.map((t=>(0,I.jsxs)(n.ListItemButton,{style:t.color?{backgroundColor:t.color,color:A.A.getInvertedColor(t.color,this.props.themeType,!0)}:{},onClick:e=>{e.stopPropagation();let s=t.link;s=s.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(s,this.props.instanceId),this.props.onClose()},children:[(0,I.jsx)(n.ListItemAvatar,{children:(0,I.jsx)(n.Avatar,{variant:"rounded",children:(0,I.jsx)("img",{className:this.props.classes.img,src:this.props.image,alt:this.props.instanceId})})}),(0,I.jsx)(n.ListItemText,{primary:c.A.getText(t.name,l.I18n.getLanguage())+(e?" [:".concat(t.port,"]"):"")})]},c.A.getText(t.name,l.I18n.getLanguage()))))})]})}}const M=(0,i.withStyles)({img:{width:"100%",height:"100%"}})(T),E=["silly","debug","info","warn","error"],F=[{value:1,desc:"1: Logic adapters"},{value:2,desc:"2: Data provider adapters"},{value:3,desc:"3: Other adapters"}],W=t=>({root:{position:"relative",margin:10,width:300,minHeight:200,background:t.palette.background.default,boxShadow:"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)",display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:"0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)"}},imageBlock:{background:"silver",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",transition:"background 0.5s"},logLevel:{width:"100%",marginBottom:5},hostInfo:{width:"100%"},addCompact:{width:"100%",marginBottom:5},selectStyle:{display:"flex",margin:5,justifyContent:"space-around"},hide:{visibility:"hidden"},tooltip:{pointerEvents:"none"},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)"}},enabled:{color:f.A[400],"&:hover":{backgroundColor:f.A[200]}},disabled:{color:b.A[400],"&:hover":{backgroundColor:b.A[200]}},sentry:{width:24,height:24,objectFit:"fill",filter:"invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)"},displayFlex:{display:"flex"},marginLeft5:{marginLeft:5},marginRight5:{marginRight:5},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)"},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_grey:{border:"2px solid grey",borderRadius:20},orangeDevice:{color:y.A[300]},button:{padding:5,transition:"opacity 0.2s",height:34},hiddenOpacity:{opacity:0,cursor:"default"},smallAvatar:{width:t.spacing(3),height:t.spacing(3)},statusIndicator:{marginTop:12},green:{color:f.A[700]},red:{color:b.A[700]},grey:{color:j.A[700]},blue:{color:"#0055a9"},orange:{color:y.A[400]},transparent:{color:"transparent",backgroundColor:"transparent"},silly:{},debug:{backgroundColor:j.A[700]},info:{backgroundColor:C.A[700]},warn:{backgroundColor:S.A[700]},error:{backgroundColor:b.A[700]},scheduleIcon:{color:"#dc8e00"},memoryIcon:{color:"#dc8e00"},contrast0:{filter:"contrast(0%)"},hidden:{display:"none"},okSymbol:{width:20,height:20,margin:2,borderRadius:2},okSymbolInner:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"}});class B extends o.Component{getDefaultState(t){return{openDialog:!1,openSelectCompactGroup:!1,openDialogCron:!1,openDialogSchedule:!1,openDialogName:!1,openDialogLogLevel:!1,openDialogDelete:!1,openDialogMemoryLimit:!1,openDialogHost:!1,openDialogCompact:!1,openDialogTier:!1,showLinks:!1,showStopAdminDialog:!1,logLevel:t.item.logLevel,logOnTheFly:!1,compactGroup:t.item.compactGroup||0,maxCompactGroupNumber:t.context.maxCompactGroupNumber,tier:t.item.tier,host:t.instance.host,deleteCustom:!1,visibleEdit:!1}}static isCompact(t){var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.runAsCompactMode)||!1}isSentry(){var t;return!(null===(t=this.props.context.states["system.adapter.".concat(this.props.instance.id,".plugins.sentry.enabled")])||void 0===t||!t.val)}static getSchedule(t){var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.schedule)||""}static isRunning(t){var e,s;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.onlyWWW)||(null===t||void 0===t||null===(s=t.common)||void 0===s?void 0:s.enabled)}static isCompactGroup(t){var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.compactGroup)||null}static getSentrySettings(t){var e,s;return!(null===t||void 0===t||null===(e=t.common)||void 0===e||null===(s=e.plugins)||void 0===s||!s.sentry)}static isModeSchedule(t){var e;return"schedule"===(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.mode)}static getMemoryLimitMB(t){var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.memoryLimitMB)||0}static getRestartSchedule(t){var e;return null!==t&&void 0!==t&&null!==(e=t.common)&&void 0!==e&&e.restartSchedule?t.common.restartSchedule:""}async setCommonValue(t,e){try{this.props.context.socket.extendObject(t,{common:e})}catch(s){window.alert(s)}}toggleSentry(){const t=!this.isSentry();this.props.context.socket.setState("system.adapter.".concat(this.props.instance.id,".plugins.sentry.enabled"),t,!0).catch((t=>window.alert("Cannot set sentry: ".concat(t))))}setTier(t,e){this.setCommonValue("system.adapter.".concat(t.id),{tier:e})}setName(t,e){this.setCommonValue("system.adapter.".concat(t.id),{titleLang:e})}setLogLevel(t,e,s){s?this.props.context.socket.setState("system.adapter.".concat(t.id,".logLevel"),e):this.setCommonValue("system.adapter.".concat(t.id),{loglevel:e})}setSchedule(t,e){e?this.setCommonValue("system.adapter.".concat(t.id),{schedule:e}):this.props.context.socket.getObject("system.adapter.".concat(t.id)).then((t=>{""!==t.common.schedule&&(t.common.schedule="",this.props.context.socket.setObject(t._id,t).catch((t=>window.alert("Cannot set schedule: ".concat(t)))))})).catch((t=>window.alert("Cannot set schedule: ".concat(t))))}setMemoryLimitMB(t,e){this.setCommonValue("system.adapter.".concat(t.id),{memoryLimitMB:e})}toggleCompactMode(){this.setCommonValue("system.adapter.".concat(this.props.instance.id),{runAsCompactMode:!B.isCompact(this.props.instance.obj)})}setRestartSchedule(t,e){e?this.setCommonValue("system.adapter.".concat(t.id),{restartSchedule:e}):this.props.context.socket.getObject("system.adapter.".concat(t.id)).then((t=>{""!==t.common.restartSchedule&&(t.common.restartSchedule="",this.props.context.socket.setObject(t._id,t))}))}setHost(t,e){this.setCommonValue("system.adapter.".concat(t.id),{host:e})}setCompactGroup(t,e){e="controller"===e?0:"default"===e?1:parseInt(e,10),this.setCommonValue("system.adapter.".concat(t.id),{compactGroup:e}),this.props.context.maxCompactGroupNumber<e&&this.props.context.setMaxCompactGroupNumber(e)}getMemory(){const t=this.props.context.states["".concat(this.props.id,".memRss")];return(null===t||void 0===t?void 0:t.val)||0}renderDeleteDialog(){return(0,I.jsxs)(n.Dialog,{onClose:()=>this.setState({openDialogDelete:!1,openDialog:!1}),open:!0,children:[(0,I.jsx)(n.DialogTitle,{children:this.props.context.t("Please confirm")}),(0,I.jsxs)(n.DialogContent,{children:[1===this.state.openDialogDelete?this.props.context.t('Are you sure you want to delete the instance "%s" or whole adapter "%s"?',this.props.instance.id,this.props.instance.id.split(".")[0]):this.props.context.t("Are you sure you want to delete the instance %s?",this.props.instance.id),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&(0,I.jsx)("br",{}),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&(0,I.jsx)(n.FormControlLabel,{control:(0,I.jsx)(n.Checkbox,{checked:this.state.deleteCustom,onChange:t=>this.setState({deleteCustom:t.target.checked})}),label:this.props.context.t("Delete all custom object settings of this adapter too")})]}),(0,I.jsxs)(n.DialogActions,{children:[1===this.state.openDialogDelete?(0,I.jsx)(n.Button,{startIcon:(0,I.jsx)(a.Delete,{}),onClick:()=>{this.props.context.onDeleteInstance(this.props.instance,this.state.deleteCustom,!0),this.setState({deleteCustom:!1,openDialogDelete:!1,openDialog:!1})},variant:"contained",style:{background:"red",color:"white"},children:this.props.context.t("Delete adapter")}):null,(0,I.jsx)(n.Button,{startIcon:(0,I.jsx)(a.Delete,{}),onClick:()=>{this.props.context.onDeleteInstance(this.props.instance,this.state.deleteCustom),this.setState({deleteCustom:!1,openDialogDelete:!1,openDialog:!1})},variant:"contained",color:"primary",children:this.props.context.t("Delete instance")}),(0,I.jsx)(n.Button,{color:"grey",onClick:()=>this.setState({openDialogDelete:!1,openDialog:!1}),variant:"contained",startIcon:(0,I.jsx)(a.Close,{}),children:this.props.context.t("Cancel")})]})]})}renderEditNameDialog(){return(0,I.jsx)(L.A,{title:this.props.context.t("Enter title for %s",this.props.instance.id),disableApplyIfNotChanged:!0,textInput:!0,defaultValue:c.A.getText(this.props.item.name,this.props.context.lang),onApply:t=>{this.setName(this.props.instance,t.toString()),this.setState({openDialogName:!1,openDialog:!1})},onClose:()=>this.setState({openDialogName:!1,openDialog:!1})})}renderEditLogLevelDialog(){return(0,I.jsxs)(L.A,{title:this.props.context.t("Edit log level rule for %s",this.props.instance.id),onApply:()=>{this.setLogLevel(this.props.instance,this.state.logLevel,this.state.logOnTheFly),this.setState({openDialogLogLevel:!1,openDialog:!1})},disableApply:this.state.logLevel===this.props.item.logLevel,onClose:()=>this.setState({openDialogLogLevel:!1,logLevel:this.props.item.logLevel,openDialog:!1}),children:[(0,I.jsxs)(n.FormControl,{className:this.props.classes.logLevel,variant:"standard",children:[(0,I.jsx)(n.InputLabel,{children:this.props.context.t("log level")}),(0,I.jsx)(n.Select,{variant:"standard",value:this.state.logLevel,fullWidth:!0,onChange:t=>this.setState({logLevel:t.target.value}),children:E.map((t=>(0,I.jsx)(n.MenuItem,{value:t,children:this.props.context.t(t)},t)))})]}),(0,I.jsxs)(n.FormControl,{className:this.props.classes.formControl,variant:"outlined",children:[(0,I.jsx)(n.FormControlLabel,{control:(0,I.jsx)(n.Checkbox,{checked:this.state.logOnTheFly,onChange:t=>this.setState({logOnTheFly:t.target.checked})}),label:this.props.context.t("Without restart")}),(0,I.jsx)(n.FormHelperText,{children:this.state.logOnTheFly?this.props.context.t("Will be reset to the saved log level after restart of adapter"):this.props.context.t("Log level will be saved permanently")})]})]})}renderEditMemoryLimitDialog(){return(0,I.jsx)(L.A,{title:this.props.context.t("Edit memory limit rule for %s",this.props.instance.id),onApply:t=>{this.setMemoryLimitMB(this.props.instance,parseFloat(t.toString())||0),this.setState({openDialogMemoryLimit:!1,openDialog:!1})},disableApplyIfNotChanged:!0,textInput:!0,defaultValue:this.props.item.memoryLimitMB,help:this.props.context.t("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)"),onClose:()=>this.setState({openDialogMemoryLimit:!1,openDialog:!1})})}renderEditHostDialog(){return(0,I.jsx)(L.A,{title:this.props.context.t("Edit host for %s",this.props.instance.id),onApply:()=>{this.setHost(this.props.instance,this.state.host),this.setState({openDialogHost:!1,openDialog:!1})},disableApply:this.state.host===this.props.instance.host,onClose:()=>this.setState({openDialogHost:!1,host:this.props.instance.host,openDialog:!1}),children:(0,I.jsx)(l.SelectWithIcon,{themeType:this.props.context.themeType,value:this.state.host,list:this.props.context.hosts,removePrefix:"system.host.",fullWidth:!0,className:this.props.classes.hostInfo,onChange:t=>this.setState({host:t}),lang:this.props.context.lang,t:this.props.context.t})})}renderEditCompactGroupDialog(){return(0,I.jsx)(L.A,{title:this.props.context.t("Edit compact groups for %s",this.props.instance.id),onApply:()=>{this.setCompactGroup(this.props.instance,parseInt(this.state.compactGroup.toString(),10)||0),this.setState({openDialogCompact:!1,openDialog:!1})},disableApply:this.state.compactGroup===this.props.item.compactGroup,onClose:()=>this.setState({openDialogCompact:!1,openDialog:!1,compactGroup:this.props.item.compactGroup,maxCompactGroupNumber:this.props.context.maxCompactGroupNumber}),children:(0,I.jsxs)(n.FormControl,{className:this.props.classes.addCompact,variant:"standard",children:[(0,I.jsx)(n.InputLabel,{children:this.props.context.t("compact groups")}),(0,I.jsxs)(n.Select,{variant:"standard",autoWidth:!0,onClose:()=>this.setState({openSelectCompactGroup:!1}),onOpen:()=>this.setState({openSelectCompactGroup:!0}),open:this.state.openSelectCompactGroup,value:(1===this.state.compactGroup?"default":"0"===(this.state.compactGroup||"").toString()?"controller":this.state.compactGroup?this.state.compactGroup:"default")||"default",onChange:t=>this.setState({compactGroup:parseInt(t.target.value,10)}),children:[(0,I.jsx)("div",{onClick:t=>{t.preventDefault(),t.stopPropagation()},className:this.props.classes.selectStyle,children:(0,I.jsx)(n.Button,{color:"grey",onClick:()=>this.setState({openSelectCompactGroup:!1,compactGroup:this.state.maxCompactGroupNumber+1,maxCompactGroupNumber:this.state.maxCompactGroupNumber+1}),variant:"outlined",stylevariable:"outlined",children:this.props.context.t("Add compact group")})}),(0,I.jsx)(n.MenuItem,{value:"controller",children:this.props.context.t("with controller")}),(0,I.jsx)(n.MenuItem,{value:"default",children:this.props.context.t("default group")}),Array(this.state.maxCompactGroupNumber-1).fill(0).map(((t,e)=>(0,I.jsx)(n.MenuItem,{value:(e+2).toString(),children:e+2},e)))]})]})})}renderEditTierDialog(){return(0,I.jsx)(L.A,{title:this.props.context.t("Set tier for %s",this.props.instance.id),onApply:()=>{this.setTier(this.props.instance,this.state.tier),this.setState({openDialogTier:!1,openDialog:!1})},help:this.props.context.t("Tiers define the order of adapters when the system starts."),disableApply:this.state.tier===this.props.item.tier,onClose:()=>this.setState({openDialogTier:!1,tier:this.props.item.tier,openDialog:!1}),children:(0,I.jsxs)(n.FormControl,{className:this.props.classes.logLevel,variant:"standard",children:[(0,I.jsx)(n.InputLabel,{children:this.props.context.t("Tiers")}),(0,I.jsx)(n.Select,{variant:"standard",value:this.state.tier,fullWidth:!0,onChange:t=>this.setState({tier:parseInt(t.target.value,10)}),children:F.map((t=>(0,I.jsx)(n.MenuItem,{value:t.value,children:this.props.context.t(t.desc)},t.value)))})]})})}renderStopAdminDialog(){return this.state.showStopAdminDialog?(0,I.jsx)(l.Confirm,{title:this.props.context.t("Please confirm"),text:this.props.context.t("stop_admin",this.props.context.adminInstance),ok:this.props.context.t("Stop admin"),onClose:t=>{t&&this.setCommonValue(this.state.showStopAdminDialog,{enabled:!1}),this.setState({showStopAdminDialog:!1})}}):null}renderLinksDialog(){return this.state.showLinks?(0,I.jsx)(M,{image:this.props.instance.image,instanceId:this.props.instance.id,links:this.props.instance.links,onClose:()=>this.setState({showLinks:!1}),t:this.props.context.t,themeType:this.props.context.themeType}):null}renderCronDialog(){return(0,I.jsx)(l.ComplexCronDialog,{title:this.props.context.t("Edit restart rule for %s",this.props.instance.id),clearButton:!0,cron:B.getRestartSchedule(this.props.instance.obj),onOk:t=>this.setRestartSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogCron:!1,openDialog:!1})})}renderScheduleDialog(){return(0,I.jsx)(l.ComplexCronDialog,{title:this.props.context.t("Edit schedule rule for %s",this.props.instance.id),clearButton:!0,cron:B.getSchedule(this.props.instance.obj),onOk:t=>this.setSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogSchedule:!1,openDialog:!1})})}renderDialogs(){return this.state.openDialog?this.state.openDialogDelete?this.renderDeleteDialog():this.state.openDialogHost?this.renderEditHostDialog():this.state.openDialogTier?this.renderEditTierDialog():this.state.openDialogCompact?this.renderEditCompactGroupDialog():this.state.openDialogLogLevel?this.renderEditLogLevelDialog():this.state.openDialogName?this.renderEditNameDialog():this.state.showStopAdminDialog?this.renderStopAdminDialog():this.state.openDialogCron?this.renderCronDialog():this.state.openDialogSchedule?this.renderScheduleDialog():this.state.showLinks?this.renderLinksDialog():this.state.openDialogMemoryLimit?this.renderEditMemoryLimitDialog():null:null}renderModeIcon(t){return(0,I.jsx)("div",{className:l.Utils.clsx(this.props.classes.smallAvatar,this.props.classes.statusIndicator,"daemon"===this.props.instance.mode||"schedule"===this.props.instance.mode?this.props.classes[t]:this.props.classes.transparent,this.props.item.connectedToHost&&this.props.item.alive&&!1===this.props.item.connected&&this.props.classes.orangeDevice),children:this.getModeIcon(this.props.instance.mode,t,this.props.classes["statusIcon_".concat(t)],this.props.item.stoppedWhenWebExtension)})}getModeIcon(t,e,s,o){return"daemon"===t?o?(0,I.jsx)("div",{className:l.Utils.clsx(s,this.props.classes.okSymbol),children:(0,I.jsx)("div",{className:this.props.classes.okSymbolInner})}):"orange"===e?(0,I.jsx)(a.Warning,{className:s}):"green"===e?(0,I.jsx)("div",{className:l.Utils.clsx(s,this.props.classes.okSymbol),children:(0,I.jsx)("div",{className:this.props.classes.okSymbolInner})}):(0,I.jsx)(a.Settings,{className:s}):"schedule"===t?(0,I.jsx)(a.Schedule,{className:s}):null}renderTooltip(){const{instance:t,item:e}=this.props;let s,o,i;if("schedule"===t.mode&&t.schedule){try{i=g().toString(t.schedule,{locale:this.props.context.lang})}catch(n){i=t.schedule}if(t.enabled)try{const e=v().parseExpression(t.schedule);s=e.next().toDate(),o=e.prev().toDate()}catch(n){s=null,o=null}}return[void 0!==e.stoppedWhenWebExtension?(0,I.jsx)(w.A,{state:!0,children:this.props.context.t("Runs as web-extension")},1):"","daemon"===t.mode&&void 0===this.props.item.stoppedWhenWebExtension?(0,I.jsx)(w.A,{state:e.connectedToHost,children:this.props.context.t("Connected to host")},2):"","daemon"===t.mode&&void 0===this.props.item.stoppedWhenWebExtension?(0,I.jsx)(w.A,{state:e.alive,children:this.props.context.t("Heartbeat")},3):"",null!==this.props.item.connected&&void 0===this.props.item.stoppedWhenWebExtension?(0,I.jsx)(w.A,{state:!!e.connected,children:"string"===typeof e.connected?"".concat(this.props.context.t("Connected:")," ").concat(e.connected||"-"):this.props.context.t("Connected to device or service")},4):"",i?(0,I.jsxs)(w.A,{state:t.enabled,children:["CRON:",i]},5):null,s?(0,I.jsx)(w.A,{state:!0,children:this.props.context.t("Next start: %s","".concat(s.toLocaleDateString(this.props.context.lang)," ").concat(s.toLocaleTimeString(this.props.context.lang)))},6):null,o?(0,I.jsx)(w.A,{state:!0,children:this.props.context.t("Last start: %s","".concat(o.toLocaleDateString(this.props.context.lang)," ").concat(o.toLocaleTimeString(this.props.context.lang)))},7):null].filter((t=>t))}renderMemoryUsage(){return this.props.item.running&&(0,I.jsx)(k,{icon:(0,I.jsx)(a.Memory,{}),tooltip:this.props.context.t("RAM usage"),children:"".concat("daemon"===this.props.instance.mode?this.getMemory():"-.--"," MB")})}renderPlayPause(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Start/stop"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)("div",{children:(0,I.jsx)(n.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.item.running&&this.props.instance.id===this.props.context.adminInstance?this.setState({showStopAdminDialog:"system.adapter.".concat(this.props.instance.id)}):this.setCommonValue("system.adapter.".concat(this.props.instance.id),{enabled:!this.props.item.running})},onFocus:t=>t.stopPropagation(),className:l.Utils.clsx(this.props.classes.button,this.props.instance.canStart?this.props.item.running?this.props.classes.enabled:this.props.classes.disabled:this.props.classes.hide),children:this.props.item.running?(0,I.jsx)(a.Pause,{}):(0,I.jsx)(a.PlayArrow,{})})})})}renderSettingsButton(){return(0,I.jsx)(n.Tooltip,{title:this.props.instance.config?this.props.context.t("Settings"):"",classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)("div",{children:(0,I.jsx)(n.IconButton,{disabled:!this.props.instance.config,size:"small",className:l.Utils.clsx(this.props.classes.button,!this.props.instance.config&&this.props.classes.hiddenOpacity),onClick:t=>{t.stopPropagation(),t.preventDefault(),l.Router.doNavigate("tab-instances","config",this.props.id)},children:(0,I.jsx)(a.Build,{})})})})}renderRestartButton(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Restart"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)("div",{children:(0,I.jsx)(n.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.context.socket.extendObject("system.adapter.".concat(this.props.instance.id),{})},onFocus:t=>t.stopPropagation(),className:l.Utils.clsx(this.props.classes.button,!this.props.instance.canStart&&this.props.classes.hide),disabled:!this.props.item.running,children:(0,I.jsx)(a.Refresh,{})})})})}renderLink(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Instance link %s",this.props.instance.id),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)("div",{children:(0,I.jsx)(n.IconButton,{size:"small",className:l.Utils.clsx(this.props.classes.button,(!this.props.instance.links||!this.props.instance.links[0])&&this.props.classes.hide),disabled:!this.props.item.running,onClick:t=>{if(t.stopPropagation(),t.preventDefault(),1===this.props.instance.links.length){let t=this.props.instance.links[0].link;t=t.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(t,this.props.instance.id)}else this.setState({showLinks:!0})},onFocus:t=>t.stopPropagation(),children:(0,I.jsx)(a.Input,{})})})})}renderEditNameButton(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:l.Utils.clsx(this.props.classes.button,!this.state.visibleEdit&&this.props.classes.hiddenOpacity),onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogName:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})}renderInputOutput(){return(0,I.jsx)(k,{icon:(0,I.jsx)(a.ImportExport,{}),tooltip:this.props.context.t("events"),children:(0,I.jsxs)("div",{className:this.props.classes.displayFlex,children:[(0,I.jsx)(n.Tooltip,{title:this.props.context.t("input events"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsxs)("div",{className:this.props.classes.marginRight5,children:["\u21e5",this.props.item.inputOutput.stateInput]})}),"/",(0,I.jsx)(n.Tooltip,{title:this.props.context.t("output events"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsxs)("div",{className:this.props.classes.marginLeft5,children:["\u21a6",this.props.item.inputOutput.stateOutput]})})]})})}renderHost(){return(0,I.jsx)(l.TextWithIcon,{value:this.props.instance.host,list:this.props.context.hosts,removePrefix:"system.host.",themeType:this.props.context.themeType,lang:this.props.context.lang})}renderEditHostButton(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogHost:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})}renderSentry(){return(0,I.jsx)(n.Tooltip,{title:"sentry",classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleSentry()},children:(0,I.jsx)(n.CardMedia,{className:l.Utils.clsx(this.props.classes.sentry,!this.props.item.sentry&&this.props.classes.contrast0),component:"img",image:this.props.item.sentry?D.A:N})})})}renderCompactGroupEnabled(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("compact groups"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:l.Utils.clsx(this.props.classes.button,this.props.context.expertMode&&this.props.item.checkCompact?null:this.props.classes.hide),onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleCompactMode()},children:(0,I.jsx)(a.ViewCompact,{color:this.props.item.compact?"primary":"inherit"})})})}renderVersion(){return(0,I.jsxs)(k,{tooltip:this.props.context.t("Installed"),children:["v",this.props.instance.version]})}renderInfo(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("span",{className:this.props.classes.instanceName,children:this.props.instance.id}),void 0!==this.props.item.stoppedWhenWebExtension&&(0,I.jsx)(w.A,{state:this.props.item.stoppedWhenWebExtension,children:this.props.context.t("Runs as web-extension")}),this.props.item.running&&"daemon"===this.props.instance.mode&&void 0===this.props.item.stoppedWhenWebExtension&&(0,I.jsx)(w.A,{state:this.props.item.connectedToHost,children:this.props.context.t("Connected to host")}),this.props.item.running&&"daemon"===this.props.instance.mode&&void 0===this.props.item.stoppedWhenWebExtension&&(0,I.jsx)(w.A,{state:this.props.item.alive,children:this.props.context.t("Heartbeat")}),this.props.item.running&&null!==this.props.item.connected&&void 0===this.props.item.stoppedWhenWebExtension&&(0,I.jsx)(w.A,{state:!!this.props.item.connected,children:"string"===typeof this.props.item.connected?"".concat(this.props.context.t("Connected:")," ").concat(this.props.item.connected||"-"):this.props.context.t("Connected to device or service")})]})}renderLogLevel(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:this.props.item.loglevelIcon,tooltip:this.props.item.logLevelObject===this.props.item.logLevel?"".concat(this.props.context.t("loglevel")," ").concat(this.props.item.logLevel):"".concat(this.props.context.t("saved:")," ").concat(this.props.item.logLevelObject," / ").concat(this.props.context.t("actual:")," ").concat(this.props.item.logLevel),children:this.props.item.logLevelObject===this.props.item.logLevel?this.props.item.logLevel:"".concat(this.props.item.logLevelObject," / ").concat(this.props.item.logLevel)}),(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogLogLevel:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})]})}renderSchedule(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(a.Schedule,{}),tooltip:this.props.context.t("schedule_group"),children:B.getSchedule(this.props.instance.obj)||"-"}),(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogSchedule:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})]})}renderRestartSchedule(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(a.Schedule,{className:this.props.classes.scheduleIcon}),tooltip:this.props.context.t("restart"),children:B.getRestartSchedule(this.props.instance.obj)||"-"}),(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCron:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})]})}renderRamLimit(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(a.Memory,{className:this.props.classes.memoryIcon}),tooltip:this.props.context.t("RAM limit"),children:"".concat(this.props.item.memoryLimitMB?this.props.item.memoryLimitMB:"-.--"," MB")}),(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogMemoryLimit:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})]})}renderCompactGroup(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(a.ViewCompact,{className:this.props.classes.marginRight5,color:"inherit"}),tooltip:this.props.context.t("compact groups"),children:(1===this.props.item.compactGroup?"default":"0"===(this.props.item.compactGroup||"").toString()?"controller":this.props.item.compactGroup?this.props.item.compactGroup:"default").toString()||"default"}),(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCompact:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})})]})}renderTier(){var t;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(a.LowPriority,{className:this.props.classes.marginRight5,color:"inherit"}),tooltip:this.props.context.t("Start order (tier)"),children:"admin"===this.props.instance.adapter?this.props.context.t("Always first"):this.props.context.t((null===(t=F.find((t=>t.value===this.props.item.tier)))||void 0===t?void 0:t.desc)||F[2].desc)}),"admin"!==this.props.instance.adapter?(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Edit start order (tier)"),classes:{popper:this.props.classes.tooltip},children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogTier:!0,openDialog:!0})},children:(0,I.jsx)(a.Edit,{})})}):null]})}renderHostWithButton(){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(k,{icon:(0,I.jsx)(a.Storage,{className:this.props.classes.marginRight5}),tooltip:this.props.context.t("Host for this instance"),children:this.renderHost()}),this.renderEditHostButton()]})}renderDeleteButton(){return(0,I.jsx)(n.Tooltip,{title:this.props.context.t("Delete"),children:(0,I.jsx)(n.IconButton,{size:"small",className:this.props.classes.button,onClick:async t=>{t.stopPropagation(),t.preventDefault();const e=await this.props.context.socket.getAdapterInstances(this.props.instance.id.split(".")[0]);this.setState({openDialogDelete:e.length||!0,openDialog:!0})},children:(0,I.jsx)(a.Delete,{})})})}}var R=s(73999);const H=(0,i.withStyles)((t=>({...W(t),fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},collapse:{height:"100%",backgroundColor:"dark"===t.palette.mode?"#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:t.palette.background.default,padding:10,display:"flex",justifyContent:"space-between"},versionDate:{alignSelf:"center"},adapter:{width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",paddingLeft:8,paddingTop:16},cardContent:{marginTop:16,paddingTop:0},cardContentH5:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},marginTop10:{marginTop:10},overflowAuto:{overflow:"auto"},collapseIcon:{position:"sticky",right:0,top:0,background:"dark"===t.palette.mode?"#4a4a4a":"#d4d4d4",zIndex:2},enableButton:{display:"flex",justifyContent:"space-between"},instanceName:{fontSize:16,padding:4,paddingBottom:15,fontWeight:"bold"},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"}},instanceStateNotEnabled1:{backgroundColor:"rgba(192, 192, 192, 0.2)",color:"dark"===t.palette.mode?"#CCC":"#333"},instanceStateNotAlive1:{backgroundColor:"rgba(192, 192, 192, 0.7)",color:"dark"===t.palette.mode?"#CCC":"#333"},instanceStateAliveNotConnected1:{backgroundColor:"rgba(255, 177, 0, 0.4)",color:"dark"===t.palette.mode?"#CCC":"#333"},instanceStateAliveAndConnected1:{backgroundColor:"rgba(0, 255, 0, 0.4)",color:"dark"===t.palette.mode?"#CCC":"#333"}})))(class extends B{constructor(t){super(t),this.state=Object.assign(this.getDefaultState(t),{mouseOver:!1})}renderSecondCardInfo(){var t;if(this.props.deleting||!this.props.expanded&&!this.state.mouseOver)return null;const{classes:e,item:s,instance:o}=this.props;return(0,I.jsxs)("div",{className:l.Utils.clsx(e.collapse,this.props.expanded?"":e.collapseOff,this.props.deleting&&e.deleting),children:[(0,I.jsxs)(n.CardContent,{classes:{root:e.cardContent},className:e.overflowAuto,children:[(0,I.jsx)("div",{className:e.collapseIcon,children:(0,I.jsx)("div",{className:e.close,onClick:()=>this.props.context.onToggleExpanded(o.id)})}),(0,I.jsxs)(n.Typography,{gutterBottom:!0,component:"span",variant:"body2",children:[this.renderInfo(),this.renderVersion(),this.renderMemoryUsage(),s.running&&this.props.context.expertMode&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderInputOutput()}),this.props.context.expertMode&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderRamLimit()}),this.props.context.expertMode&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderLogLevel()}),s.modeSchedule&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderSchedule()}),this.props.context.expertMode&&"daemon"===o.mode&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderRestartSchedule()}),this.props.context.expertMode&&s.checkCompact&&s.compact&&s.supportCompact&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderCompactGroup()}),this.props.context.expertMode&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderTier()}),this.props.context.hosts.length>1||this.props.context.hosts.length&&(null===(t=this.props.context.hosts[0].common)||void 0===t?void 0:t.name)!==o.host?(0,I.jsx)("div",{className:l.Utils.clsx(e.displayFlex,e.maxWidth300),children:this.renderHostWithButton()}):null,(0,I.jsx)(R.A,{config:s,name:"allowInstanceSettings",children:(0,I.jsx)(n.Hidden,{smUp:!0,children:this.renderSettingsButton()})})]})]}),(0,I.jsxs)("div",{className:e.footerBlock,children:[(0,I.jsx)(R.A,{config:s,name:"allowInstanceDelete",children:(0,I.jsx)("div",{className:e.displayFlex,children:this.renderDeleteButton()})}),this.props.context.expertMode&&s.checkSentry&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderSentry()}),s.supportCompact&&this.props.context.expertMode&&s.checkCompact&&(0,I.jsx)("div",{className:e.displayFlex,children:this.renderCompactGroupEnabled()})]})]})}render(){const{item:t,classes:e,instance:s}=this.props;return(0,I.jsxs)(n.Card,{className:l.Utils.clsx(e.root,this.props.hidden?e.hidden:""),children:[this.state.openDialog&&this.renderDialogs(),this.renderSecondCardInfo(),(0,I.jsxs)("div",{className:l.Utils.clsx(this.props.classes.imageBlock,(!t.running||"daemon"!==s.mode||void 0!==t.stoppedWhenWebExtension)&&e.instanceStateNotEnabled1,t.running&&"daemon"===s.mode&&void 0===t.stoppedWhenWebExtension&&(!t.connectedToHost||!t.alive)&&e.instanceStateNotAlive1,t.running&&t.connectedToHost&&t.alive&&!1===t.connected&&e.instanceStateAliveNotConnected1,t.running&&t.connectedToHost&&t.alive&&!1!==t.connected&&e.instanceStateAliveAndConnected1),children:[(0,I.jsx)(n.CardMedia,{className:e.img,component:"img",image:s.image||"img/no-image.png"}),(0,I.jsx)("div",{className:e.adapter,children:s.id}),(0,I.jsx)("div",{className:e.versionDate}),this.props.expanded?null:(0,I.jsx)(n.Fab,{onMouseOver:()=>this.setState({mouseOver:!0}),onMouseOut:()=>this.setState({mouseOver:!1}),onClick:()=>this.props.context.onToggleExpanded(s.id),className:e.fab,color:"primary","aria-label":"add",children:(0,I.jsx)(a.MoreVert,{})})]}),(0,I.jsxs)(n.CardContent,{className:e.cardContentH5,children:[(0,I.jsx)(n.Typography,{gutterBottom:!0,variant:"h5",component:"h5",children:(0,I.jsxs)("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),className:e.displayFlex,children:[c.A.getText(t.name,this.props.context.lang),this.renderEditNameButton()]})}),(0,I.jsx)("div",{className:e.marginTop10,children:(0,I.jsxs)(n.Typography,{component:"span",className:e.enableButton,children:[this.renderPlayPause(),(0,I.jsx)(n.Hidden,{xsDown:!0,children:this.renderSettingsButton()}),this.renderRestartButton(),(0,I.jsx)(R.A,{config:t,name:"allowInstanceLink",children:this.renderLink()})]})})]})]})}});const G=(0,i.withStyles)((t=>({...W(t),row:{paddingLeft:8,paddingRight:16,padding:0},invisible:{opacity:0},instanceName:{fontSize:16,paddingLeft:32,paddingBottom:5,fontWeight:"bold"},instanceIcon:{height:42,width:42},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}},secondaryHeading:{maxWidth:200,fontSize:12},secondaryHeadingDiv:{display:"flex",alignItems:"center",width:200},secondaryHeadingDivDiv:{whiteSpace:"nowrap",overflow:"hidden",padding:5,textOverflow:"ellipsis",maxWidth:200},gridStyle:{display:"flex",minWidth:270,lineHeight:"34px",justifyContent:"space-around"},instanceId:{overflow:"hidden",alignSelf:"center",fontSize:16,marginLeft:5,maxWidth:150,minWidth:100,whiteSpace:"nowrap",textOverflow:"ellipsis",flexGrow:2},paddingRight200:{},maxWidth300:{width:300},width150:{width:150},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}})))(class extends B{constructor(t){super(t),this.desktop=window.innerWidth>1e3,this.state=this.getDefaultState(t)}renderDetails(){var t;const{instance:e,item:s,classes:o}=this.props;return(0,I.jsx)(n.AccordionDetails,{children:(0,I.jsxs)(n.Grid,{container:!0,direction:"row",children:[(0,I.jsxs)(n.Grid,{item:!0,container:!0,direction:"row",xs:10,children:[(0,I.jsx)(n.Grid,{item:!0,container:!0,direction:"column",xs:12,sm:6,md:4,children:this.renderInfo()}),(0,I.jsx)(n.Grid,{container:!0,item:!0,direction:"column",xs:12,sm:6,md:4,children:this.renderVersion()}),(0,I.jsxs)(n.Grid,{container:!0,item:!0,direction:"column",xs:12,sm:6,md:4,className:o.paddingRight200,children:[this.props.context.expertMode&&(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderLogLevel()}),s.running&&this.props.context.expertMode&&(0,I.jsx)("div",{className:o.visible1250,children:this.renderInputOutput()}),(0,I.jsx)(n.Grid,{item:!0,className:o.visible1050,children:this.renderMemoryUsage()}),s.modeSchedule&&(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderSchedule()}),this.props.context.expertMode&&"daemon"===e.mode&&(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderRestartSchedule()}),this.props.context.expertMode&&(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderRamLimit()}),this.props.context.expertMode&&s.checkCompact&&s.compact&&s.supportCompact&&(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderCompactGroup()}),this.props.context.expertMode&&(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderTier()}),(0,I.jsxs)("div",{className:l.Utils.clsx(o.maxWidth300,o.visible800),children:[(0,I.jsx)(k,{children:c.A.getText(s.name,this.props.context.lang)}),this.renderEditNameButton()]}),this.props.context.hosts.length>1||this.props.context.hosts.length&&(null===(t=this.props.context.hosts[0].common)||void 0===t?void 0:t.name)!==e.host?(0,I.jsx)("div",{className:l.Utils.clsx(o.displayFlex,o.maxWidth300),children:this.renderHostWithButton()}):null]})]}),(0,I.jsxs)("div",{className:o.displayFlex,children:[(0,I.jsx)(R.A,{config:s,name:"allowInstanceDelete",children:(0,I.jsx)(n.Hidden,{smUp:!0,children:this.renderSettingsButton()})}),(0,I.jsx)(R.A,{config:s,name:"allowInstanceDelete",children:this.renderDeleteButton()}),(0,I.jsx)("div",{className:o.visible570,children:this.renderSentry()}),(0,I.jsx)("div",{className:o.visible570,children:this.renderCompactGroupEnabled()})]})]})})}render(){var t;const{instance:e,item:s,classes:o}=this.props,i=this.props.context.getInstanceStatus(e.obj),r=this.renderTooltip();return(0,I.jsxs)(n.Accordion,{square:!0,classes:{root:l.Utils.clsx(this.props.deleting,this.props.hidden?o.hidden:"")},expanded:this.props.expanded&&!this.props.deleting,onChange:()=>{this.state.openDialog||this.props.context.onToggleExpanded(e.id)},children:[(0,I.jsxs)(n.AccordionSummary,{classes:{root:o.row,content:this.desktop?o.desktopRowContent:void 0},className:l.Utils.clsx((!s.running||"daemon"!==e.mode||void 0!==s.stoppedWhenWebExtension)&&(this.props.idx%2===0?o.instanceStateNotEnabled1:o.instanceStateNotEnabled2),s.running&&"daemon"===e.mode&&void 0===s.stoppedWhenWebExtension&&(!s.connectedToHost||!s.alive)&&(this.props.idx%2===0?o.instanceStateNotAlive1:o.instanceStateNotAlive2),s.running&&s.connectedToHost&&s.alive&&!1===s.connected&&(this.props.idx%2===0?o.instanceStateAliveNotConnected1:o.instanceStateAliveNotConnected2),s.running&&s.connectedToHost&&s.alive&&!1!==s.connected&&(this.props.idx,o.instanceStateAliveAndConnected1),this.desktop&&o.desktopRow),expandIcon:(0,I.jsx)(a.ExpandMore,{className:this.desktop?o.desktopButton:void 0}),children:[this.renderDialogs(),(0,I.jsxs)(n.Grid,{container:!0,spacing:1,alignItems:"center",direction:"row",wrap:"nowrap",className:o.rowGridLine,children:[(0,I.jsxs)("div",{className:o.gridStyle,children:[r.length?(0,I.jsx)(n.Tooltip,{classes:{popper:o.tooltip},title:(0,I.jsx)("span",{style:{display:"flex",flexDirection:"column"},children:r}),children:this.renderModeIcon(i)}):this.renderModeIcon(i),(0,I.jsx)(n.Avatar,{variant:"square",alt:e.id,src:e.image,className:l.Utils.clsx(o.instanceIcon,this.desktop&&o.desktopIcon)}),(0,I.jsx)("div",{className:o.instanceId,children:e.id})]}),this.renderPlayPause(),(0,I.jsx)(R.A,{config:s,name:"allowInstanceSettings",children:(0,I.jsx)(n.Hidden,{xsDown:!0,children:this.renderSettingsButton()})}),this.renderRestartButton(),(0,I.jsx)(R.A,{config:s,name:"allowInstanceLink",children:this.renderLink()}),(0,I.jsx)(n.Typography,{className:l.Utils.clsx(o.secondaryHeading,o.hidden800),component:"div",children:(0,I.jsxs)("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),className:o.secondaryHeadingDiv,children:[(0,I.jsx)("div",{className:o.secondaryHeadingDivDiv,children:c.A.getText(s.name,this.props.context.lang)}),this.renderEditNameButton()]})}),this.props.context.expertMode&&(0,I.jsx)("div",{className:l.Utils.clsx(o.hidden1250,("daemon"!==e.mode||!s.running)&&o.invisible),children:this.renderInputOutput()}),this.props.context.expertMode&&(0,I.jsx)(n.Tooltip,{title:s.logLevelObject===s.logLevel?"".concat(this.props.context.t("loglevel")," ").concat(s.logLevel):"".concat(this.props.context.t("saved:")," ").concat(s.logLevelObject," / ").concat(this.props.context.t("actual:")," ").concat(s.logLevel),classes:{popper:o.tooltip},children:(0,I.jsx)(n.Avatar,{className:l.Utils.clsx(o.smallAvatar,o.hidden380,o[s.logLevel]),children:s.loglevelIcon})}),(0,I.jsx)(n.Grid,{item:!0,className:l.Utils.clsx(o.hidden1050,o.width150,("daemon"!==e.mode||!s.running)&&o.invisible),children:this.renderMemoryUsage()}),this.props.context.hosts.length>1||this.props.context.hosts.length&&(null===(t=this.props.context.hosts[0].common)||void 0===t?void 0:t.name)!==e.host?(0,I.jsx)(n.Grid,{item:!0,className:l.Utils.clsx(o.hidden1230),children:this.renderHost()}):null]}),(0,I.jsx)("div",{className:o.hidden570,children:this.renderSentry()}),(0,I.jsx)("div",{className:o.hidden570,children:this.renderCompactGroupEnabled()})]}),this.props.expanded?this.renderDetails():null,this.renderDialogs()]})}});var _=s(95712),O=s(98325);const P="./static/media/filter.114e5246302e3d9b652b430beb900621.svg",U=(0,i.makeStyles)((t=>({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:f.A[700]},red:{color:b.A[700]},grey:{color:j.A[700]},blue:{color:"#0055a9"},orange:{color:y.A[400]},orangeDevice:{color:y.A[300]},icon:{width:18,height:18,marginRight:t.spacing(1),display:"inline-block"},menuValue:{whiteSpace:"nowrap"}}))),z=["none","daemon","schedule","once"],V=(t,e)=>1===t||2===t?(0,I.jsx)(a.Lens,{className:e}):3===t?(0,I.jsx)(a.Warning,{className:e}):4===t?(0,I.jsx)(a.Schedule,{className:e}):5===t?(0,I.jsx)("div",{style:{width:20,height:20,margin:2,borderRadius:2},className:e,children:(0,I.jsx)("div",{style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"}})}):null,J={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"}},q=t=>{let{onClose:e,filterMode:s,filterStatus:i}=t;const r=U(),[l,c]=(0,o.useState)(s),[p,d]=(0,o.useState)(i);return(0,I.jsxs)(n.Dialog,{onClose:()=>e(),open:!0,classes:{paper:r.paper},children:[(0,I.jsx)(n.DialogTitle,{style:{display:"flex"},children:(0,I.jsxs)("div",{style:{display:"flex"},children:[(0,I.jsx)(n.Avatar,{variant:"square",className:r.square,src:P}),O.default.t("Filter instances")]})}),(0,I.jsx)(n.DialogContent,{className:r.overflowHidden,dividers:!0,children:(0,I.jsxs)(n.Card,{className:r.root,children:[(0,I.jsxs)("div",{className:r.rowBlock,children:[(0,I.jsx)(n.FormControlLabel,{className:r.checkbox,control:(0,I.jsx)(n.Checkbox,{checked:!!l,onChange:t=>t.target.checked?c("daemon"):c(null)}),label:O.default.t("Filter by mode")}),(0,I.jsx)(n.Select,{disabled:!l,variant:"standard",value:l||"none",className:r.select,onChange:t=>{"none"===t.target.value?c(null):c(t.target.value)},children:z.map((t=>(0,I.jsx)(n.MenuItem,{value:t,children:O.default.t(t)},t)))})]}),(0,I.jsxs)("div",{className:r.rowBlock,children:[(0,I.jsx)(n.FormControlLabel,{className:r.checkbox,control:(0,I.jsx)(n.Checkbox,{checked:!!p,onChange:t=>t.target.checked?d("ok"):d(null)}),label:O.default.t("Filter by status")}),(0,I.jsx)(n.Select,{disabled:!p,variant:"standard",value:p||"none",className:r.select,onChange:t=>{"none"===t.target.value?d(null):d(t.target.value)},children:Object.keys(J).map(((t,e)=>(0,I.jsx)(n.MenuItem,{value:t,children:(0,I.jsxs)("div",{className:r.menuWrapper,children:[J[t].status?(0,I.jsx)("div",{className:r.iconWrapper,children:V(e,r["statusIcon_".concat(e)])}):null,(0,I.jsx)("div",{className:r.textWrapper,children:O.default.t(J[t].text)})]})},t)))})]})]})}),(0,I.jsxs)(n.DialogActions,{children:[(0,I.jsx)(n.Button,{variant:"contained",autoFocus:!0,disabled:l===s&&i===p,onClick:()=>{e({filterMode:l,filterStatus:p})},color:"primary",startIcon:(0,I.jsx)(a.Check,{}),children:O.default.t("Apply")}),(0,I.jsx)(n.Button,{color:"grey",variant:"contained",onClick:()=>e(),startIcon:(0,I.jsx)(a.Close,{}),children:O.default.t("Close")})]})]})};var $=s(89891),K=s(1373);const Y=(0,i.withStyles)((t=>({root:{position:"relative",margin:10,width:300,minHeight:200,background:t.palette.background.default,boxShadow:"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)",display:"flex",flexDirection:"column",transition:"box-shadow 0.5s","&:hover":{boxShadow:"0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)"}},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"}})))((t=>{let{name:e,key:s,children:o,classes:i,expanded:a,onExpand:r}=t;return(0,I.jsxs)(n.Accordion,{expanded:!!a,onChange:()=>r(!a),classes:{root:i.accordion},square:!0,children:[(0,I.jsx)(n.AccordionSummary,{classes:{root:i.row},expandIcon:(0,I.jsx)($.A,{}),children:(0,I.jsxs)("div",{className:i.wrapperName,children:[(0,I.jsx)(K.A,{objIconBool:!0,iconName:e,className:i.iconStyle}),e]})}),(0,I.jsx)(n.AccordionDetails,{className:i.accordionDetails,children:(0,I.jsx)("div",{className:i.wrapperChildren,children:o})})]},s)}));class Q extends o.Component{constructor(t){super(t),this.localStorage=void 0,this.statePromise=null,this.states=void 0,this.adapters=void 0,this.statesUpdateTimer=null,this.typingTimer=null,this.hostsTimer=null,this.wordCache=void 0,this.t=void 0,this.inputRef=void 0,this.subscribed=!1,this._cacheList=null,this.shouldUpdateAfterDialogClosed=!1,this.translate=(t,e,s)=>void 0!==e?this.props.t(t,e,s):(this.wordCache[t]||(this.wordCache[t]=this.props.t(t)),this.wordCache[t]),this.getInstances=async()=>{const t=Date.now();let e=[];const s=await this.props.instancesWorker.getInstances();if(!s)return void window.alert("Cannot read instances!");e=Object.values(s);let o="".concat(this.state.currentHost,".memRss");this.states[o]=this.states[o]||await this.props.socket.getState(o);const i=this.states[o];let n=1,a=i&&parseFloat(i.val)||0;for(let c=0;c<e.length;c++){const t=e[c];if(t&&t.common&&t.common.host===this.props.currentHostName&&(t.common.enabled&&"daemon"===t.common.mode)){o="".concat(t._id,".memRss"),this.states[o]=this.states[o]||await this.props.socket.getState(o);const e=this.states[o];a+=e&&parseFloat(e.val)||0,n++}}const r={};e.sort(((t,e)=>{const s=t._id.split("."),o=e._id.split("."),i=parseInt(s[s.length-1],10),n=parseInt(o[o.length-1],10),a=s[s.length-2],r=o[o.length-2];return a===r?i>n?1:i<n?-1:0:a>r?1:a<r?-1:0}));let l=1;const p={};for(let d=0;d<e.length;d++){const t=e[d],o=t?t.common:null,i=t._id.split("."),n=i[i.length-1];o.compactGroup&&"number"===typeof o.compactGroup&&l<o.compactGroup&&(l=o.compactGroup);const a={id:t._id.replace("system.adapter.",""),obj:t,compact:!!o.compact,host:o.host,name:this.getName(t),image:o.icon?"adapter/".concat(o.name,"/").concat(o.icon):"img/no-image.png",enabled:o.enabled,canStart:!o.onlyWWW,config:"none"!==o.adminUI.config,jsonConfig:"json"===o.adminUI.config,materialize:"materialize"===o.adminUI.config,compactMode:o.runAsCompactMode||!1,mode:o.mode||null,schedule:void 0===o.schedule||null===o.schedule?null:o.schedule,loglevel:o.loglevel||null,adapter:o.name||null,version:o.version||null,stoppedWhenWebExtension:"daemon"===t.common.mode?!!t.common.webExtension:void 0,links:[]},p=o.localLinks||o.localLink||"";let h=null;p&&"string"===typeof p?h={_default:p}:p&&"object"===typeof p&&(h=p);const m=h?Object.keys(h):[];if(m.forEach((t=>{let e;a.links=a.links||[],e="string"===typeof h[t]?{link:h[t]}:h[t];const i=c.A.replaceLink(e.link,o.name,n,{objects:s,hostname:this.props.hostname,protocol:this.props.protocol,port:this.props.port,hosts:this.props.hosts,adminInstance:this.props.adminInstance})||[];1===i.length?a.links.push({name:"_default"===t?1===m.length?"":this.t("default"):this.t(t),link:i[0].url,port:i[0].port,color:e.color}):i.length>1&&i.forEach((s=>{a.links.push({name:"_default"===t?1===m.length?"":this.t("default"):this.t(t),link:s.url,port:s.port,color:e.color})}))})),a.stoppedWhenWebExtension){const t=this.states["".concat(a.id,".info.extension")]||await this.props.socket.getState("".concat(a.id,".info.extension"));a.stoppedWhenWebExtension=t?!!t.val:void 0}console.log(t._id),r[t._id]=a}console.log("getInstances: ".concat(Date.now()-t)),this.state.deleting&&!r["system.adapter.".concat(this.state.deleting)]&&(p.deleting=null),p.maxCompactGroupNumber=l,p.processes=n,p.mem=Math.round(a),p.instances=r,this._cacheList=null,this.setState(p)},this.getParamsLocalAndPanel=async()=>{let t=!1;try{var e,s;t=!(null===(e=(await this.props.socket.readBaseSettings(this.state.currentHost)).config)||void 0===e||null===(s=e.system)||void 0===s||!s.compact)}catch(l){window.alert('Cannot read compact mode by host "'.concat(this.state.currentHost,'": ').concat(l))}let o=0,i="All";try{o=JSON.parse(this.localStorage.getItem("Instances.playArrow")),"true"===o.toString()?o=1:"false"===o.toString()&&(o=0),i=JSON.parse(this.localStorage.getItem("Instances.filterCompactGroup"))}catch(l){}const n="true"===this.localStorage.getItem("Instances.onlyCurrentHost"),a="true"===this.localStorage.getItem("Instances.viewMode"),r="true"===this.localStorage.getItem("Instances.viewCategory");i||0===i||(i="All"),this._cacheList=null,this.setState({filterCompactGroup:i,compact:t,onlyCurrentHost:n,playArrow:o,viewMode:a,viewCategory:r})},this.onStateChange=(t,e)=>{const s=this.states[t];this.states[t]=e,(!s&&e||s&&!e||s&&e&&s.val!==e.val)&&("config"===this.state.dialog&&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)))},this.getInstanceStatus=t=>{const e=t?t.common:null,s=(null===e||void 0===e?void 0:e.mode)||"";let o="daemon"===s?"green":"blue";if(!e||!e.enabled||e.webExtension&&t.native.webInstance&&"daemon"!==s)o="daemon"===s?"grey":"blue";else{const i=this.states["".concat(t._id,".alive")],n=this.states["".concat(t._id,".connected")],a=this.states["".concat(t._id.replace("system.adapter.",""),".info.connection")];if(e.webExtension&&t.native.webInstance){const e=this.states["".concat(t._id.replace("system.adapter.",""),".info.extension")];if(e)return e.val?"green":"red"}null!==n&&void 0!==n&&n.val&&null!==i&&void 0!==i&&i.val||(o="daemon"===s?"red":"orangeDevice"),!a||null!==a&&void 0!==a&&a.val||"red"===o||(o="orange")}return o},this.onDeleteInstance=(t,e,s)=>{this.setState({deleting:t.id},(()=>this.props.executeCommand("del ".concat(s?t.id.split(".")[0]:t.id).concat(e?" --custom":"").concat(this.props.expertMode?" --debug":""))))},this.onMaxCompactGroupNumber=t=>this.setState({maxCompactGroupNumber:t}),this.onToggleExpanded=t=>{this.setState((e=>({expanded:e.expanded!==t?t:null})))},this.changeStartedStopped=()=>{this._cacheList=null,this.setState((t=>{const e=t.playArrow?1===t.playArrow?2:0:1;return this.localStorage.setItem("Instances.playArrow",JSON.stringify(e)),{playArrow:e}}))},this.localStorage=window._localStorage||window.localStorage;let e=[];if(this.localStorage.getItem("Instances.expandedFolder"))try{e=JSON.parse(this.localStorage.getItem("Instances.expandedFolder"))}catch(s){}this.state={expertMode:this.props.expertMode,dialog:null,instances:null,dialogProp:null,playArrow:0,onlyCurrentHost:!1,viewMode:!1,viewCategory:!1,hostData:null,processes:null,mem:null,percent:null,memFree:null,filterText:this.localStorage.getItem("instances.filter")||"",compact:!1,maxCompactGroupNumber:1,filterCompactGroup:"All",deleting:null,deleteCustomSupported:!1,currentHost:this.props.currentHost,showFilterDialog:!1,expanded:"",expandedFolder:e,filterMode:this.localStorage.getItem("Instances.filterMode")?"null"===this.localStorage.getItem("Instances.filterMode")?null:this.localStorage.getItem("Instances.filterMode"):null,filterStatus:this.localStorage.getItem("Instances.filterStatus")?"null"===this.localStorage.getItem("Instances.filterStatus")?null:this.localStorage.getItem("Instances.filterStatus"):null},this.states={},this.adapters=[],this.statesUpdateTimer=null,this.wordCache={},this.t=this.translate,this.inputRef=(0,o.createRef)()}async componentDidMount(){this.props.instancesWorker.registerHandler(this.getInstances),await this.updateData();const t=await this.props.socket.checkFeatureSupported("DEL_INSTANCE_CUSTOM");t&&this.setState({deleteCustomSupported:t})}async updateData(){await this.getParamsLocalAndPanel(),await this.getData(),await this.getHostsData(),await this.getInstances()}async componentWillUnmount(){this.subscribeStates(!0),this.props.instancesWorker.unregisterHandler(this.getInstances)}getStates(t){return t&&(this.statePromise=null),this.statePromise=this.statePromise||this.props.socket.getForeignStates("system.adapter.*"),this.statePromise}static getDerivedStateFromProps(t,e){const s=l.Router.getLocation(),o={dialog:s.dialog,dialogProp:s.id};return t.expertMode!==e.expertMode&&(o.expertMode=t.expertMode),o}async getData(t){try{const e=this.props.socket.getAdapters(t),s=this.getStates(),[o,i]=await Promise.all([s,e]);this.adapters=i||[],this.states=o||{}}catch(e){console.log(e)}this.states&&(this.subscribed||(this.subscribed=!0,this.subscribeStates()))}subscribeStates(t){const e=t?this.props.socket.unsubscribeState:this.props.socket.subscribeState;e.call(this.props.socket,"system.adapter.*.alive",this.onStateChange),e.call(this.props.socket,"system.adapter.*.connected",this.onStateChange),e.call(this.props.socket,"system.adapter.*.inputCount",this.onStateChange),e.call(this.props.socket,"system.adapter.*.memRss",this.onStateChange),e.call(this.props.socket,"system.adapter.*.outputCount",this.onStateChange),e.call(this.props.socket,"system.adapter.*.logLevel",this.onStateChange),e.call(this.props.socket,"system.adapter.*.plugins.sentry.enabled",this.onStateChange),e.call(this.props.socket,"system.host.*.diskFree",this.onStateChange),e.call(this.props.socket,"system.host.*.diskSize",this.onStateChange),e.call(this.props.socket,"system.host.*.diskWarning",this.onStateChange),e.call(this.props.socket,"system.host.*.freemem",this.onStateChange),e.call(this.props.socket,"*.info.connection",this.onStateChange),e.call(this.props.socket,"*.info.extension",this.onStateChange)}isCompactGroupCheck(t){var e;const s=this.adapters.find((e=>{let{_id:s}=e;return s==="system.adapter.".concat(t)}));return(null===s||void 0===s||null===(e=s.common)||void 0===e?void 0:e.compact)||!1}getName(t){return null!==t&&void 0!==t&&t.common?t.common.titleLang?c.A.getText(t.common.titleLang,this.props.lang):c.A.getText(t.common.title,this.props.lang):""}getInputOutput(t){const e=this.states["".concat(t,".inputCount")],s=this.states["".concat(t,".outputCount")];return{stateInput:null!==e&&void 0!==e&&e.val?e.val:0,stateOutput:null!==s&&void 0!==s&&s.val?s.val:0}}isAlive(t){const e=this.states["".concat(t,".alive")];return!(null===e||void 0===e||!e.val)}isConnectedToHost(t){const e=this.states["".concat(t,".connected")];return!(null===e||void 0===e||!e.val)}isConnected(t){const e=this.state.instances[t];return this.states["".concat(e.id,".info.connection")]?!!this.states["".concat(e.id,".info.connection")].val:null}static getStatusFilter(t){switch(t){case"not_alive":return"red";case"alive_no_device":return"orangeDevice";case"alive_not_connected":return"orange";case"ok":return"green";default:return"grey"}}static getLogLevelIcon(t){return"debug"===t?(0,I.jsx)(a.BugReport,{}):"info"===t?(0,I.jsx)(a.Info,{}):"warn"===t?(0,I.jsx)(a.Warning,{}):"error"===t?(0,I.jsx)(a.Error,{}):null}isSentry(t){var e;return!(null===(e=this.states["".concat(t,".plugins.sentry.enabled")])||void 0===e||!e.val)}cacheInstances(){const t=this.state.currentHost.replace(/^system.host./,"");if(this._cacheList=Object.keys(this.state.instances).map((t=>{var e,s,o;const i=this.state.instances[t],n=B.isRunning(i.obj),a=B.isCompactGroup(i.obj),r=this.isCompactGroupCheck(i.adapter)&&this.state.compact,l=B.isCompact(i.obj),c=i.compact||!1,p=this.isAlive(t),d=this.isConnectedToHost(t),h=this.isConnected(t),m=this.getName(i.obj),u=(null===(e=this.states["".concat(t,".logLevel")])||void 0===e?void 0:e.val)||i.loglevel,g=i.loglevel,x=(null===i||void 0===i||null===(s=i.obj)||void 0===s||null===(o=s.common)||void 0===o?void 0:o.tier)||3,v=Q.getLogLevelIcon(u),f=this.getInputOutput(t),b=B.isModeSchedule(i.obj),y=B.getMemoryLimitMB(i.obj),j=B.getSentrySettings(i.obj),C=this.isSentry(t);return{id:t,running:n,host:i.host,nameId:i.id,compactGroup:a,checkCompact:r,mode:i.mode,sentry:C,category:i.obj.common.type||"other",status:this.getInstanceStatus(i.obj),alive:p,compact:l,supportCompact:c,connectedToHost:d,connected:h,name:m,logLevel:u,logLevelObject:g,tier:x,loglevelIcon:v,inputOutput:f,modeSchedule:b,checkSentry:j,memoryLimitMB:y,stoppedWhenWebExtension:i.stoppedWhenWebExtension,allowInstanceSettings:!this.props.repository[i.adapter]||this.props.repository[i.adapter].allowInstanceSettings,allowInstanceDelete:!this.props.repository[i.adapter]||this.props.repository[i.adapter].allowInstanceDelete,allowInstanceLink:!this.props.repository[i.adapter]||this.props.repository[i.adapter].allowInstanceLink}})),this.state.playArrow&&(this._cacheList=this._cacheList.filter((t=>{let{running:e}=t;return 1===this.state.playArrow?e:!e}))),this.state.onlyCurrentHost&&(this._cacheList=this._cacheList.filter((e=>{let{host:s}=e;return s===t}))),this.state.filterText){const t=this.state.filterText.toLowerCase();this._cacheList=this._cacheList.filter((e=>{let{name:s,nameId:o}=e;return s.toLowerCase().includes(t)||o.toLowerCase().includes(t)}))}if(this.props.expertMode&&(this.state.filterCompactGroup||0===this.state.filterCompactGroup)&&this.state.compact&&(this._cacheList=this._cacheList.filter((t=>{let{compactGroup:e}=t;return e===this.state.filterCompactGroup||"All"===this.state.filterCompactGroup||"default"===this.state.filterCompactGroup&&(null===e||1===e)||"controller"===this.state.filterCompactGroup&&"0"===e}))),this.state.filterMode&&(this._cacheList=this._cacheList.filter((t=>t.mode===this.state.filterMode))),this.state.filterStatus){const t=Q.getStatusFilter(this.state.filterStatus);this._cacheList=this._cacheList.filter((e=>t===e.status))}return this._cacheList}clearAllFilters(){this.localStorage.removeItem("instances.filter"),this.localStorage.removeItem("Instances.playArrow"),this.localStorage.removeItem("Instances.onlyCurrentHost"),this.localStorage.removeItem("Instances.filterCompactGroup"),this.localStorage.removeItem("Instances.filterMode"),this.localStorage.removeItem("Instances.filterStatus"),this._cacheList=null,this.setState({playArrow:0,onlyCurrentHost:!1,filterCompactGroup:"All",filterMode:null,filterStatus:null,filterText:""},(()=>{this.inputRef.current&&(this.inputRef.current.value=""),this.cacheInstances()}))}getPanels(){this._cacheList||this.cacheInstances();const t={adminInstance:this.props.adminInstance,onDeleteInstance:this.onDeleteInstance,expertMode:this.props.expertMode,hosts:this.props.hosts,socket:this.props.socket,t:this.t,lang:this.props.lang,themeType:this.props.themeType,setMaxCompactGroupNumber:this.onMaxCompactGroupNumber,maxCompactGroupNumber:this.state.maxCompactGroupNumber,deleteCustomSupported:this.state.deleteCustomSupported,states:this.states,onToggleExpanded:this.onToggleExpanded,getInstanceStatus:this.getInstanceStatus},e=this._cacheList.map(((e,s)=>{const o=e.id,i=this.state.instances[o];return this.state.viewMode?{category:e.category,render:(0,I.jsx)(H,{deleting:this.state.deleting===i.id,id:o,idx:s,instance:i,item:e,context:t,expanded:this.state.expanded===i.id},i.id)}:{category:e.category,render:(0,I.jsx)(G,{deleting:this.state.deleting===i.id,id:o,idx:s,instance:i,item:e,context:t,expanded:this.state.expanded===i.id},i.id)}}));if(!e.length)return(0,I.jsx)("div",{title:this.t("Click to clear all filters"),onClick:()=>this.clearAllFilters(),style:{margin:20,fontSize:26,textAlign:"center",cursor:"pointer"},children:this.t("all items are filtered out")});if(!this.state.viewMode&&this.state.viewCategory){const t=[];return e.forEach((e=>{let{category:s}=e;return!t.includes(s)&&t.push(s)})),t.sort(((t,e)=>"general"===t&&"general"!==e?-1:"general"!==t&&"general"===e||t>e?1:t<e?-1:0)),t.map((t=>(0,I.jsx)(Y,{name:t,expanded:this.state.expandedFolder.includes(t),onExpand:e=>{const s=[...this.state.expandedFolder],o=s.indexOf(t);e?-1===o&&(s.push(t),s.sort()):-1!==o&&s.splice(o,1),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(s)),this.setState({expandedFolder:s})},children:e.filter((e=>{let{category:s}=e;return s===t})).map((t=>{let{render:e}=t;return e}))},t)))}return e.map((t=>{let{render:e}=t;return e}))}async getHostsData(){let t;this.props.socket.getHostInfo(this.state.currentHost,!1,1e4).catch((t=>(t.toString().includes("May not read")||window.alert("Cannot read host information: ".concat(t)),{}))).then((t=>{this._cacheList=null,this.setState({hostData:t})}));const e=await this.props.socket.getState("".concat(this.state.currentHost,".memAvailable")),s=await this.props.socket.getState("".concat(this.state.currentHost,".freemem")),o=await this.props.socket.getObject("".concat(this.state.currentHost));if(e?t=e:s&&(t=s),t){const e=((null===o||void 0===o?void 0:o.native.hardware.totalmem)||0)/1048576,s=Math.round(t.val/e*100);this._cacheList=null,this.setState({percent:s,memFree:t.val})}}changeCompactGroup(t){this._cacheList=null,this.localStorage.setItem("Instances.filterCompactGroup",JSON.stringify(t)),this.setState({filterCompactGroup:t})}handleFilterChange(t){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((t=>{this.typingTimer=null,this._cacheList=null,this.setState({filterText:t}),this.localStorage.setItem("instances.filter",t)}),300,t.target.value)}renderFilterDialog(){return this.state.showFilterDialog?(0,I.jsx)(q,{filterMode:this.state.filterMode,filterStatus:this.state.filterStatus,onClose:t=>{t&&(this._cacheList=null,this.localStorage.setItem("Instances.filterMode",t.filterMode),this.localStorage.setItem("Instances.filterStatus",t.filterStatus),this.setState(t)),this.setState({showFilterDialog:!1})}}):null}render(){if(!this.state.instances)return(0,I.jsx)(n.LinearProgress,{});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},(()=>this.updateData()))}),200)),"config"===this.state.dialog&&this.state.dialogProp){const e=this.state.instances[this.state.dialogProp]||null;if(e)return(0,I.jsxs)(n.Paper,{className:t.paper,children:[this.renderFilterDialog(),(0,I.jsx)(p.A,{adapter:e.id.split(".")[0],adminInstance:this.props.adminInstance,className:t.iframe,configStored:this.props.configStored,dateFormat:this.props.dateFormat,icon:e.image,instance:parseInt(e.id.split(".")[1]),isFloatComma:this.props.isFloatComma,jsonConfig:e.jsonConfig,lang:this.props.lang,materialize:e.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:e.version,onRegisterIframeRef:t=>this.props.onRegisterIframeRef(t),onUnregisterIframeRef:t=>this.props.onUnregisterIframeRef(t)})]})}this.shouldUpdateAfterDialogClosed&&(this.shouldUpdateAfterDialogClosed=!1,this.statesUpdateTimer||this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout((()=>{this.statesUpdateTimer=null,this.forceUpdate()}),300)));const e=this.state.hostData?"".concat(this.state.hostData["Disk free"]?"".concat(this.t("Disk free"),": ").concat(Math.round(this.state.hostData["Disk free"]/(this.state.hostData["Disk size"]/100)),"%, "):"").concat(this.t("Total RAM usage"),": ").concat(this.state.mem," Mb / ")+"".concat(this.t("Free"),": ").concat(this.state.percent,"% = ").concat(this.state.memFree," Mb ")+"[".concat(this.t("Host"),": ").concat(this.props.currentHostName," - ").concat(this.state.processes," ").concat(1===this.state.processes?this.t("process"):this.t("processes"),"]"):null;return(0,I.jsxs)(d.A,{children:[this.renderFilterDialog(),(0,I.jsxs)(m.A,{children:[(0,I.jsx)(n.Tooltip,{title:this.t("Show / hide List"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>{this.setState({viewMode:!this.state.viewMode}),this.localStorage.setItem("Instances.viewMode",this.state.viewMode?"false":"true")},children:this.state.viewMode?(0,I.jsx)(a.ViewModule,{}):(0,I.jsx)(a.ViewList,{})})}),!this.state.viewMode&&(0,I.jsx)(n.Tooltip,{title:this.t("Category"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>{this.setState({viewCategory:!this.state.viewCategory}),this.localStorage.setItem("Instances.viewCategory",this.state.viewCategory?"false":"true")},children:(0,I.jsx)(a.List,{color:this.state.viewCategory?"primary":"inherit"})})}),!this.state.viewMode&&this.state.viewCategory&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(n.Tooltip,{title:this.t("expand all"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>{const t=[];this._cacheList.forEach((e=>{let{category:s}=e;return!t.includes(s)&&t.push(s)})),t.sort(),this.localStorage.setItem("Instances.expandedFolder",JSON.stringify(t)),this.setState({expandedFolder:t})},children:(0,I.jsx)(a.FolderOpen,{})})}),(0,I.jsx)(n.Tooltip,{title:this.t("collapse all"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>{this.localStorage.removeItem("Instances.expandedFolder"),this.setState({expandedFolder:[]})},children:(0,I.jsx)(a.Folder,{})})})]}),(0,I.jsx)(n.Tooltip,{title:this.t("Reload"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>this.getData(!0),children:(0,I.jsx)(a.Refresh,{})})}),this.props.hosts.length>1?(0,I.jsx)(n.Tooltip,{title:this.t("Show instances only for current host"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>{this.setState({onlyCurrentHost:!this.state.onlyCurrentHost}),this.localStorage.setItem("Instances.onlyCurrentHost",this.state.onlyCurrentHost?"false":"true")},children:(0,I.jsx)(a.Devices,{color:this.state.onlyCurrentHost?"primary":"inherit"})})}):null,(0,I.jsx)(n.Tooltip,{title:this.t(this.state.playArrow?1===this.state.playArrow?"Showed only running instances":"Showed only stopped instances":"Show running or stopped instances"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>this.changeStartedStopped(),children:(0,I.jsx)(a.PlayArrow,{style:2===this.state.playArrow?{color:"red"}:null,color:1===this.state.playArrow?"primary":"inherit"})})}),(0,I.jsx)(n.Tooltip,{title:this.t("Filter instances"),children:(0,I.jsx)(n.IconButton,{size:"large",onClick:()=>this.setState({showFilterDialog:!0}),children:(0,I.jsx)(r.YsJ,{style:{width:16,height:16},className:this.state.filterMode||this.state.filterStatus?t.filterActive:""})})}),this.props.expertMode&&this.state.compact?(0,I.jsx)(_.A,{title:this.t("Filter specific compact group"),t:this.t,arrayItem:[{name:"All"},{name:"controller"},{name:"default"},...Array(this.state.maxCompactGroupNumber-1).fill(0).map(((t,e)=>({name:e+2})))],buttonIcon:(0,I.jsx)(a.ViewCompact,{style:{marginRight:4},color:"primary"}),onClick:t=>this.changeCompactGroup(t),value:this.state.filterCompactGroup}):null,(0,I.jsx)("div",{className:t.grow}),(0,I.jsx)(n.TextField,{variant:"standard",inputRef:this.inputRef,label:this.t("Filter"),style:{margin:"5px 0"},defaultValue:this.state.filterText,onChange:t=>this.handleFilterChange(t),InputProps:{endAdornment:this.state.filterText?(0,I.jsx)(n.InputAdornment,{position:"end",children:(0,I.jsx)(n.IconButton,{size:"small",onClick:()=>{this.inputRef.current.value="",this._cacheList=null,this.setState({filterText:""}),this.localStorage.setItem("instances.filter","")},children:(0,I.jsx)(a.Close,{})})}):null}}),(0,I.jsx)("div",{className:t.grow}),(0,I.jsx)(n.Hidden,{xsDown:!0,children:e})]}),(0,I.jsx)(h.A,{overflow:"auto",children:(0,I.jsx)("div",{className:this.state.viewMode?t.cards:"",children:this.getPanels()})})]})}}const X=(0,l.withWidth)()((0,i.withStyles)((t=>({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"},cards:{display:"flex",flexFlow:"wrap",justifyContent:"center"},filterActive:{color:t.palette.primary.main}})))(Q))},86122:()=>{}}]);
|
|
2
|
+
//# sourceMappingURL=2544.9989e77c.chunk.js.map
|