iobroker.admin 7.2.3 → 7.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/adminWww/asset-manifest.json +7 -7
- package/adminWww/index.html +1 -1
- package/adminWww/static/js/471.07237cb8.chunk.js +2 -0
- package/adminWww/static/js/471.07237cb8.chunk.js.map +1 -0
- package/adminWww/static/js/{8222.6e8bc303.chunk.js → 8222.e33e3b98.chunk.js} +2 -2
- package/adminWww/static/js/8222.e33e3b98.chunk.js.map +1 -0
- package/adminWww/static/js/{main.c0c71277.js → main.c6b1bb7c.js} +2 -2
- package/adminWww/static/js/{main.c0c71277.js.map → main.c6b1bb7c.js.map} +1 -1
- package/io-package.json +2 -2
- package/package.json +5 -5
- package/adminWww/static/js/471.b6be6b3a.chunk.js +0 -2
- package/adminWww/static/js/471.b6be6b3a.chunk.js.map +0 -1
- package/adminWww/static/js/8222.6e8bc303.chunk.js.map +0 -1
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ The icons may not be reused in other projects without the proper flaticon licens
|
|
|
87
87
|
<!--
|
|
88
88
|
### **WORK IN PROGRESS**
|
|
89
89
|
-->
|
|
90
|
-
### 7.2.
|
|
90
|
+
### 7.2.4 (2024-10-08)
|
|
91
91
|
|
|
92
92
|
- (@GermanBluefox) Corrected some GUI errors
|
|
93
93
|
- (@GermanBluefox) Ignore error by opening `0_userdata.0`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.js": "./static/js/main.
|
|
3
|
+
"main.js": "./static/js/main.c6b1bb7c.js",
|
|
4
4
|
"static/css/9895.51dba240.chunk.css": "./static/css/9895.51dba240.chunk.css",
|
|
5
5
|
"static/js/9895.b7555508.chunk.js": "./static/js/9895.b7555508.chunk.js",
|
|
6
6
|
"static/js/9159.dcd6bf5f.chunk.js": "./static/js/9159.dcd6bf5f.chunk.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"static/js/5127.2ca5033c.chunk.js": "./static/js/5127.2ca5033c.chunk.js",
|
|
15
15
|
"static/js/500.dbf86f5e.chunk.js": "./static/js/500.dbf86f5e.chunk.js",
|
|
16
16
|
"static/js/4289.a1f6d0e1.chunk.js": "./static/js/4289.a1f6d0e1.chunk.js",
|
|
17
|
-
"static/js/471.
|
|
17
|
+
"static/js/471.07237cb8.chunk.js": "./static/js/471.07237cb8.chunk.js",
|
|
18
18
|
"static/js/3363.2fd11518.chunk.js": "./static/js/3363.2fd11518.chunk.js",
|
|
19
19
|
"static/js/1892.cc283965.chunk.js": "./static/js/1892.cc283965.chunk.js",
|
|
20
20
|
"static/js/8152.4bf4424b.chunk.js": "./static/js/8152.4bf4424b.chunk.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"static/js/6361.692e2230.chunk.js": "./static/js/6361.692e2230.chunk.js",
|
|
23
23
|
"static/js/4203.44502ae5.chunk.js": "./static/js/4203.44502ae5.chunk.js",
|
|
24
24
|
"static/js/8387.cc1bb362.chunk.js": "./static/js/8387.cc1bb362.chunk.js",
|
|
25
|
-
"static/js/8222.
|
|
25
|
+
"static/js/8222.e33e3b98.chunk.js": "./static/js/8222.e33e3b98.chunk.js",
|
|
26
26
|
"static/js/6157.131a9836.chunk.js": "./static/js/6157.131a9836.chunk.js",
|
|
27
27
|
"static/js/5963.4bd6244c.chunk.js": "./static/js/5963.4bd6244c.chunk.js",
|
|
28
28
|
"static/js/6309.d428f234.chunk.js": "./static/js/6309.d428f234.chunk.js",
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
"static/media/Outdoor Blinds.svg": "./static/media/Outdoor Blinds.37b85a9c060a4af48da9.svg",
|
|
356
356
|
"static/media/Upstairs.svg": "./static/media/Upstairs.441813e54e0daca0882d.svg",
|
|
357
357
|
"static/media/filter.svg": "./static/media/filter.ddf40c28bbf1e138937e53be53e56274.svg",
|
|
358
|
-
"main.
|
|
358
|
+
"main.c6b1bb7c.js.map": "./static/js/main.c6b1bb7c.js.map",
|
|
359
359
|
"9895.51dba240.chunk.css.map": "./static/css/9895.51dba240.chunk.css.map",
|
|
360
360
|
"9895.b7555508.chunk.js.map": "./static/js/9895.b7555508.chunk.js.map",
|
|
361
361
|
"9159.dcd6bf5f.chunk.js.map": "./static/js/9159.dcd6bf5f.chunk.js.map",
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
"5127.2ca5033c.chunk.js.map": "./static/js/5127.2ca5033c.chunk.js.map",
|
|
370
370
|
"500.dbf86f5e.chunk.js.map": "./static/js/500.dbf86f5e.chunk.js.map",
|
|
371
371
|
"4289.a1f6d0e1.chunk.js.map": "./static/js/4289.a1f6d0e1.chunk.js.map",
|
|
372
|
-
"471.
|
|
372
|
+
"471.07237cb8.chunk.js.map": "./static/js/471.07237cb8.chunk.js.map",
|
|
373
373
|
"3363.2fd11518.chunk.js.map": "./static/js/3363.2fd11518.chunk.js.map",
|
|
374
374
|
"1892.cc283965.chunk.js.map": "./static/js/1892.cc283965.chunk.js.map",
|
|
375
375
|
"8152.4bf4424b.chunk.js.map": "./static/js/8152.4bf4424b.chunk.js.map",
|
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
"6361.692e2230.chunk.js.map": "./static/js/6361.692e2230.chunk.js.map",
|
|
378
378
|
"4203.44502ae5.chunk.js.map": "./static/js/4203.44502ae5.chunk.js.map",
|
|
379
379
|
"8387.cc1bb362.chunk.js.map": "./static/js/8387.cc1bb362.chunk.js.map",
|
|
380
|
-
"8222.
|
|
380
|
+
"8222.e33e3b98.chunk.js.map": "./static/js/8222.e33e3b98.chunk.js.map",
|
|
381
381
|
"6157.131a9836.chunk.js.map": "./static/js/6157.131a9836.chunk.js.map",
|
|
382
382
|
"5963.4bd6244c.chunk.js.map": "./static/js/5963.4bd6244c.chunk.js.map",
|
|
383
383
|
"6309.d428f234.chunk.js.map": "./static/js/6309.d428f234.chunk.js.map",
|
|
@@ -421,6 +421,6 @@
|
|
|
421
421
|
"3834.f5d2b8e2.chunk.js.map": "./static/js/3834.f5d2b8e2.chunk.js.map"
|
|
422
422
|
},
|
|
423
423
|
"entrypoints": [
|
|
424
|
-
"static/js/main.
|
|
424
|
+
"static/js/main.c6b1bb7c.js"
|
|
425
425
|
]
|
|
426
426
|
}
|
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.c6b1bb7c.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([[471],{16244:(t,e,s)=>{"use strict";s.d(e,{A:()=>o});s(28437);const o="./static/media/sentry.e732e10c5c1ceed0955b2fec6dab33f8.svg"},79313:(t,e,s)=>{"use strict";s.d(e,{A:()=>p});var o=s(28437),i=s(67085),n=s(21839),r=s(37449),a=s(70579);const l={modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:"flex",overflow:"hidden"},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:"absolute",right:8,top:8},languageButtonActive:t=>({color:t.palette.primary.main})},p=t=>{let{toggleTranslation:e,noTranslation:s,title:p,fullWidth:c,help:d,maxWidth:h,progress:m,icon:u,disableApplyIfNotChanged:g,applyButton:x,onClose:v,children:y,titleButtonApply:f,titleButtonClose:b,onApply:j,textInput:C,defaultValue:S,overflowHidden:w,disableApply:I,theme:k}=t;const[D,L]=(0,o.useState)(S);(0,o.useEffect)((()=>{L(S)}),[S]);let A=null;u&&(A=u);const T=r.Utils.getStyle(k,l.languageButtonActive);return(0,a.jsxs)(i.Dialog,{open:!0,maxWidth:h||"md",fullWidth:!!c,disableEscapeKeyDown:!1,onClose:v,sx:{"& .MuiPaper-root":l.modalDialog},children:[p&&(0,a.jsxs)(i.DialogTitle,{children:[u?(0,a.jsx)(A,{style:l.titleIcon}):null,p,"en"!==r.I18n.getLanguage()&&e?(0,a.jsx)(i.IconButton,{size:"large",style:{...l.languageButton,...s?T:void 0},onClick:()=>e(),title:r.I18n.t("Disable/Enable translation"),children:(0,a.jsx)(n.Language,{})}):null]}),(0,a.jsxs)(i.DialogContent,{style:{...w?l.overflowHidden:void 0,...l.content,paddingTop:8},children:[C&&(0,a.jsx)(i.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"standard",size:"medium",multiline:!0,value:D,onChange:t=>L(t.target.value),slotProps:{input:{endAdornment:D?(0,a.jsx)(i.InputAdornment,{position:"end",children:(0,a.jsx)(i.IconButton,{size:"small",onClick:()=>L(""),children:(0,a.jsx)(n.Close,{})})}):null}}}),y,d?(0,a.jsx)("div",{children:d}):null]}),(0,a.jsxs)(i.DialogActions,{children:[(void 0===x||x)&&(0,a.jsx)(i.Button,{startIcon:(0,a.jsx)(n.Check,{}),disabled:I||m||g&&S===D,onClick:()=>j&&j(C?D:""),variant:"contained",color:"primary",children:r.I18n.t(f||"Ok")}),(0,a.jsx)(i.Button,{color:"grey",onClick:v,disabled:m,variant:"contained",startIcon:(0,a.jsx)(n.Close,{}),children:r.I18n.t(b||"Cancel")})]})]})}},73852:(t,e,s)=>{"use strict";s.d(e,{A:()=>l});var o=s(28437),i=s(67085),n=s(90457),r=s(70579);const a={button:{marginLeft:10,marginRight:10},icon:{marginRight:5}};const l=function(t){let{arrayItem:e,title:s,onClick:l,value:p,contained:c,buttonIcon:d,icons:h,t:m,translateSuffix:u,noTranslation:g}=t;const[x,v]=(0,o.useState)(null);return u=u||"",(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Tooltip,{title:s||"",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:(0,r.jsxs)(i.Button,{style:a.button,variant:c?"contained":"outlined",color:"primary",onClick:t=>v(t.currentTarget),children:[d||h&&(0,r.jsx)(n.A,{iconName:p,style:a.icon}),"number"===typeof p||g?p:m(p+u)]})}),(0,r.jsx)(i.Menu,{anchorEl:x,keepMounted:!0,open:Boolean(x),onClose:()=>v(null),children:e.map(((t,e)=>{let{name:s}=t;return(0,r.jsxs)(i.MenuItem,{selected:p||0===p?s===p:0===e,disabled:p||0===p?s===p:0===e,className:`tag-card-${s}`,style:{placeContent:"space-between"},value:s,onClick:()=>{l(s),v(null)},children:[h&&(0,r.jsx)(n.A,{iconName:s,style:a.icon}),"number"===typeof s||g?s:m(s+u)]},s)}))})]})}},13714:(t,e,s)=>{"use strict";s.d(e,{A:()=>p});s(28437);var o=s(67085),i=s(21839),n=s(50147),r=s(64851),a=s(70579);const l={checkIcon:{color:n.A[700]},cancelIcon:{color:r.A[700]},wrapperContent:{display:"flex",flexFlow:"nowrap",alignItems:"inherit"}};const p=function(t){return(0,a.jsxs)(o.Grid2,{container:!0,style:l.wrapperContent,alignItems:"center",direction:"row",spacing:1,children:[(0,a.jsx)(o.Grid2,{children:t.state?(0,a.jsx)(i.CheckCircle,{style:l.checkIcon}):(0,a.jsx)(i.Cancel,{style:l.cancelIcon})}),(0,a.jsx)(o.Grid2,{children:(0,a.jsx)(o.Typography,{children:t.children})})]})}},90457:(t,e,s)=>{"use strict";s.d(e,{A:()=>l});var o=s(28437),i=s(21839),n=s(70579);const r={},a={All:i.AllInclusive,messaging:i.Message,communication:i.WifiTethering,general:i.Apps,logic:i.VpnKey,alarm:i.NotificationsActive,"iot-systems":i.SystemUpdateAlt,"misc-data":i.EmojiSymbols,multimedia:i.PermMedia,network:i.SettingsEthernet,storage:i.Storage,visualization:i.Visibility,"climate-control":i.SettingsBrightness,"date-and-time":i.DateRange,energy:i.BatteryChargingFull,garden:i.FilterVintage,geoposition:i.LocationOn,hardware:i.Phonelink,health:i.Favorite,household:i.House,infrastructure:i.Apartment,lighting:i.EmojiObjects,protocols:i.DialerSip,utility:i.PhonelinkSetup,vehicle:i.AirportShuttle,"visualization-icons":i.BubbleChart,"visualization-widgets":i.Widgets,weather:i.Brightness6,metering:i.LinearScale};const l=function(t){let{iconName:e,className:s,adapter:l,socket:p,onClick:c,style:d}=t;const[h,m]=(0,o.useState)("");if((0,o.useEffect)((()=>{l&&p&&(r[l]instanceof Promise||(r[l]=p.getObject(`system.adapter.${l}`)),r[l].then((t=>{var e;return(null===t||void 0===t||null===(e=t.common)||void 0===e?void 0:e.icon)&&m(`../../adapter/${l}/${t.common.icon}`)})))}),[l,p]),l)return(0,n.jsx)("img",{onClick:t=>c&&c(t),src:h||"",className:s,style:d,alt:""});const u=a[e]||i.Help;return(0,n.jsx)(u,{className:s,style:d,onClick:t=>c&&c(t)})}},66875:(t,e,s)=>{"use strict";s.d(e,{A:()=>f});var o=s(28437),i=s(50147),n=s(64851),r=s(74681),a=s(29864),l=s(67085),p=s(21839),c=s(37449),d=s(4531),h=s(4848),m=s.n(h),u=s(17774),g=s(70579);const x=["silly","debug","info","warn","error"],v={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},scroll:{height:"100%",overflowY:"auto"},instanceIcon:{width:42,height:42,marginRight:16,verticalAlign:"middle"},button:{marginRight:5,width:36,height:36},version:{fontSize:12,opacity:.8,marginLeft:20,marginRight:10},versionAliveConnected:t=>({color:"dark"===t.palette.mode?"#23a623":"#60ff60"}),versionAliveNotConnected:{color:"#a67223"},buttonControl:{padding:"5px",transition:"opacity 0.2s",height:34},enabled:{color:i.A[400],"&:hover":{backgroundColor:i.A[200]}},disabled:{color:n.A[400],"&:hover":{backgroundColor:n.A[200]}},hide:{visibility:"hidden"},formControl:{width:"100%",marginBottom:5},logLevel:{fontSize:12,marginLeft:10},green:{color:i.A[700]},red:{color:n.A[700]},grey:{color:r.A[700]},blue:{color:"#0055a9"},orange:{color:a.A[400]},orangeDevice:{color:a.A[300]},tooltip:{pointerEvents:"none"}};class y extends o.Component{constructor(t){super(t),this.refIframe=void 0,this.registered=void 0,this.onObjectChange=(t,e)=>{var s,o,i,n;t===`system.adapter.${this.props.adapter}.${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.${this.props.adapter}.${this.props.instance}`;t===`${s}.alive`?this.setState({alive:!(null===e||void 0===e||!e.val)}):t===`${s}.connected`?this.setState({connectedToHost:!(null===e||void 0===e||!e.val)}):t===`${this.props.adapter}.${this.props.instance}.info.connection`?this.setState({connected:e?!!e.val:null}):t===`${this.props.adapter}.${this.props.instance}.info.extension`?this.setState({extension:e?!!e.val:null}):t===`${s}.logLevel`&&this.setState({tempLogLevel:e?e.val:null})},this.closeConfig=t=>{if(t.origin===window.location.origin)if("close"===t.data||"close"===t.message)this.props.easyMode?c.Router.doNavigate("easy"):c.Router.doNavigate("tab-instances");else if("change"===t.data||"change"===t.message)this.props.configStored(!1);else if("nochange"===t.data||"nochange"===t.message)this.props.configStored(!0);else if("string"===typeof t.data&&t.data.startsWith("goto:")||"string"===typeof t.message&&t.message.startsWith("goto:")){const[,e]=(t.data||t.message).split(":"),[s,o,i]=e.split("/");c.Router.doNavigate(s,o,i)}},this.state={checkedExist:!1,showStopAdminDialog:!1,running:!1,canStart:!1,alive:!1,connected:!1,connectedToHost:!1,logOnTheFlyValue:!1,logLevel:"info",logLevelValue:"info",tempLogLevel:"info",showLogLevelDialog:!1},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;if(this.props.tab)this.props.socket.fileExists(`${this.props.adapter}.admin`,"tab.html").then((t=>{if(!t)return this.props.socket.fileExists(`${this.props.adapter}.admin`,"tab_m.html").then((t=>t?this.setState({checkedExist:"tab_m.html"}):window.alert("Cannot find tab(_m).html")));this.setState({checkedExist:"tab.html"})}));else{const t=`system.adapter.${this.props.adapter}.${this.props.instance}`;this.props.socket.subscribeObject(t,this.onObjectChange),this.props.socket.getObject(t).then((async e=>{var s,o,i,n,r,a,l,p;const c=await this.props.socket.getState(`${t}.logLevel`);await this.props.socket.subscribeState(`${t}.logLevel`,this.onStateChange);const d=await this.props.socket.getState(`${t}.alive`);await this.props.socket.subscribeState(`${t}.alive`,this.onStateChange);const h=await this.props.socket.getState(`${t}.connected`);let m,u;await this.props.socket.subscribeState(`${t}.connected`,this.onStateChange);try{m=await this.props.socket.getState(`${this.props.adapter}.${this.props.instance}.info.connection`),this.props.socket.subscribeState(`${this.props.adapter}.${this.props.instance}.info.connection`,this.onStateChange)}catch{m=null}try{u=await this.props.socket.getState(`${this.props.adapter}.${this.props.instance}.info.extension`),this.props.socket.subscribeState(`${this.props.adapter}.${this.props.instance}.info.extension`,this.onStateChange)}catch{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||!d.val),extension:u?!(null===(n=u)||void 0===n||!n.val):null,connectedToHost:!(null===h||void 0===h||!h.val),connected:m?!!m.val:null,logLevel:(null===e||void 0===e||null===(r=e.common)||void 0===r?void 0:r.loglevel)||"info",logLevelValue:(null===e||void 0===e||null===(a=e.common)||void 0===a?void 0:a.loglevel)||"info",tempLogLevel:(null===c||void 0===c?void 0:c.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!==(p=e.common)&&void 0!==p&&p.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)),(window.addEventListener||window.attachEvent)(window.addEventListener?"message":"onmessage",this.closeConfig,!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(){this.props.socket.unsubscribeObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,this.onObjectChange),(window.removeEventListener||window.detachEvent)(window.removeEventListener?"message":"onmessage",this.closeConfig,!1),this.registered&&this.refIframe&&this.props.onUnregisterIframeRef(this.refIframe),this.refIframe=null}renderHelpButton(){return this.props.jsonConfig?(0,g.jsx)("div",{style:{display:"inline-block",position:"absolute",right:0,top:5},children:(0,g.jsx)(l.Tooltip,{title:this.props.t("Show help for this adapter"),slotProps:{popper:{sx:v.tooltip}},children:(0,g.jsx)(l.Fab,{sx:{"&.MuiFab-root":v.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(u.A.getDocsLinkForAdapter({lang:e,adapterName:this.props.adapter}),"help")},children:(0,g.jsx)(p.Help,{})})})}):null}getConfigurator(){if(this.props.jsonConfig)return(0,g.jsx)(d.JsonConfig,{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,DeviceManager:m()});const t=`adapter/${this.props.adapter}/${this.props.tab?this.state.checkedExist:this.props.materialize?"index_m.html":"index.html"}?${this.props.instance||0}&newReact=true&${this.props.instance||0}&react=${this.props.themeName}`;return this.state.checkedExist?(0,g.jsx)("iframe",{ref:t=>this&&(this.refIframe=t),title:"config",style:this.props.style,src:t}):null}returnStopAdminDialog(){return this.state.showStopAdminDialog?(0,g.jsx)(c.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.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{common:{enabled:!1}}).catch((t=>window.alert(t))),this.setState({showStopAdminDialog:!1})}}):null}renderLogLevelDialog(){return this.state.showLogLevelDialog?(0,g.jsxs)(l.Dialog,{open:!0,onClose:()=>this.setState({showLogLevelDialog:!1}),children:[(0,g.jsx)(l.DialogTitle,{children:this.props.t("Edit log level rule for %s",`${this.props.adapter}.${this.props.instance}`)}),(0,g.jsxs)(l.DialogContent,{children:[(0,g.jsxs)(l.FormControl,{style:{...v.formControl,marginTop:10},variant:"outlined",children:[(0,g.jsx)(l.InputLabel,{children:this.props.t("log level")}),(0,g.jsx)(l.Select,{variant:"standard",value:this.state.logLevelValue,fullWidth:!0,onChange:t=>this.setState({logLevelValue:t.target.value}),children:x.map((t=>(0,g.jsx)(l.MenuItem,{value:t,children:this.props.t(t)},t)))})]}),(0,g.jsxs)(l.FormControl,{style:v.formControl,variant:"outlined",children:[(0,g.jsx)(l.FormControlLabel,{control:(0,g.jsx)(l.Checkbox,{checked:this.state.logOnTheFlyValue,onChange:t=>this.setState({logOnTheFlyValue:t.target.checked})}),label:this.props.t("Without restart")}),(0,g.jsx)(l.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,g.jsxs)(l.DialogActions,{children:[(0,g.jsx)(l.Button,{color:"primary",variant:"contained",onClick:()=>{this.state.logOnTheFlyValue?this.props.socket.setState(`system.adapter.${this.props.adapter}.${this.props.instance}.logLevel`,this.state.logLevelValue):this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{common:{loglevel:this.state.logLevelValue}}).catch((t=>window.alert(`Cannot set log level: ${t}`))),this.setState({showLogLevelDialog:!1})},children:this.props.t("Ok")}),(0,g.jsx)(l.Button,{color:"grey",variant:"contained",onClick:()=>this.setState({showLogLevelDialog:!1}),children:this.props.t("Cancel")})]})]}):null}render(){return(0,g.jsxs)(l.Paper,{style:v.root,children:[(0,g.jsx)(l.AppBar,{color:"default",position:"static",children:(0,g.jsxs)(l.Toolbar,{variant:"dense",style:{marginLeft:8},children:[(0,g.jsxs)(l.Typography,{variant:"h6",color:"inherit",children:[(0,g.jsx)(l.IconButton,{size:"small",onClick:()=>{this.props.easyMode?c.Router.doNavigate("easy"):c.Router.doNavigate("tab-instances")},onFocus:t=>t.stopPropagation(),style:{marginRight:10,display:"none"},children:(0,g.jsx)(p.ArrowBack,{})}),this.props.jsonConfig?(0,g.jsx)(c.Icon,{src:this.props.icon,style:v.instanceIcon}):null,`${this.props.t("Instance settings")}: ${this.props.adapter}.${this.props.instance}`,this.props.version?(0,g.jsxs)("span",{style:{...v.version,...v[this.getInstanceStatus()]},children:["v",this.props.version]}):null,(0,g.jsx)(l.Tooltip,{title:this.props.t("Start/stop"),slotProps:{popper:{sx:v.tooltip}},children:(0,g.jsx)("span",{children:(0,g.jsx)(l.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.state.running&&`${this.props.adapter}.${this.props.instance}`===this.props.adminInstance?this.setState({showStopAdminDialog:!0}):this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{common:{enabled:!this.state.running}}).catch((t=>window.alert(`Cannot set log level: ${t}`)))},onFocus:t=>t.stopPropagation(),sx:{...v.buttonControl,...this.state.canStart?this.state.running?v.enabled:v.disabled:v.hide},children:this.state.running?(0,g.jsx)(p.Pause,{}):(0,g.jsx)(p.PlayArrow,{})})})}),(0,g.jsx)(l.Tooltip,{title:this.props.t("Restart"),slotProps:{popper:{sx:v.tooltip}},children:(0,g.jsx)("span",{children:(0,g.jsx)(l.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{}).catch((t=>window.alert(`Cannot set log level: ${t}`)))},onFocus:t=>t.stopPropagation(),style:{...v.buttonControl,...this.state.canStart?void 0:v.hide},disabled:!this.state.running,children:(0,g.jsx)(p.Refresh,{})})})}),this.state.tempLogLevel!==this.state.logLevel?(0,g.jsx)(l.Tooltip,{title:this.props.t("temporary log level"),slotProps:{popper:{sx:v.tooltip}},children:(0,g.jsx)("span",{style:v.logLevel,children:this.state.tempLogLevel})}):null,(0,g.jsx)(l.Tooltip,{title:this.props.t("log level"),slotProps:{popper:{sx:v.tooltip}},children:(0,g.jsx)("span",{style:v.logLevel,children:this.state.tempLogLevel!==this.state.logLevel?`/ ${this.state.logLevel}`:this.state.logLevel})}),(0,g.jsx)(l.Tooltip,{title:this.props.t("Edit log level rule for %s",`${this.props.adapter}.${this.props.instance}`),children:(0,g.jsx)(l.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),this.setState({showLogLevelDialog:!0})},onFocus:t=>t.stopPropagation(),style:{...v.buttonControl,...this.state.canStart?void 0:v.hide,width:34,height:34},children:(0,g.jsx)(p.Edit,{style:{width:20,height:20}})})})]}),this.renderHelpButton()]})}),this.getConfigurator(),this.returnStopAdminDialog(),this.renderLogLevelDialog()]})}}const f=y},73538:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>X});var o=s(28437),i=s(67085),n=s(21839),r=s(60184),a=s(37449),l=s(17774),p=s(29465),c=s(66875),d=s(5255),h=s.n(d),m=s(12493),u=s.n(m),g=(s(72994),s(83070),s(51605),s(7981),s(80204),s(58255),s(761),s(24512),s(30444),s(18173),s(80835),s(50147)),x=s(64851),v=s(29864),y=s(74681),f=s(67470),b=s(21215),j=s(13714),C=s(70579);const S={nowrap:{flexFlow:"nowrap",overflow:"hidden"},width:{width:"100%",overflow:"hidden"},tooltip:{pointerEvents:"none"}},w=t=>(0,C.jsxs)(i.Grid2,{container:!0,title:t.icon?"":t.tooltip||"",alignItems:"center",direction:"row",spacing:1,style:S.nowrap,children:[t.icon&&(0,C.jsx)(i.Grid2,{style:{minWidth:24},children:(0,C.jsx)(i.Tooltip,{title:t.tooltip||"",slotProps:{popper:{sx:S.tooltip}},children:t.icon})}),(0,C.jsx)(i.Grid2,{style:S.width,children:(0,C.jsx)(i.Tooltip,{title:t.tooltip||"",slotProps:{popper:{sx:S.tooltip}},children:(0,C.jsx)(i.Typography,{component:"div",style:t.style,children:t.children})})})]});var I=s(16244);const k=s.p+"static/media/sentryNo.40627b40a3bc6107ca445e9a6cec8601.svg";var D=s(79313);const L={img:{width:"100%",height:"100%"}};class A 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,C.jsxs)(i.Dialog,{onClose:()=>this.props.onClose(),open:!0,children:[(0,C.jsx)(i.DialogTitle,{style:{padding:"8px 0 0 0",textAlign:"center"},children:this.props.t("Links")}),(0,C.jsx)(i.List,{children:this.props.links.map((t=>(0,C.jsxs)(i.ListItemButton,{style:t.color?{backgroundColor:t.color,color:a.Utils.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,C.jsx)(i.ListItemAvatar,{children:(0,C.jsx)(i.Avatar,{variant:"rounded",children:(0,C.jsx)("img",{style:L.img,src:this.props.image,alt:this.props.instanceId})})}),(0,C.jsx)(i.ListItemText,{primary:l.A.getText(t.name,a.I18n.getLanguage())+(e?` [:${t.port}]`:"")})]},l.A.getText(t.name,a.I18n.getLanguage()))))})]})}}const T=A,$=["silly","debug","info","warn","error"],B=[{value:1,desc:"1: Logic adapters"},{value:2,desc:"2: Data provider adapters"},{value:3,desc:"3: Other adapters"}],M={root:t=>({position:"relative",m:"10px",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:g.A[400],"&:hover":{backgroundColor:g.A[200]}},disabled:{color:x.A[400],"&:hover":{backgroundColor:x.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:v.A[300]},button:{padding:"5px",transition:"opacity 0.2s",height:34},hiddenOpacity:{opacity:0,cursor:"default"},smallAvatar:{width:24,height:24},statusIndicator:{marginLeft:8},green:{color:g.A[700]},red:{color:x.A[700]},grey:{color:y.A[700]},blue:{color:"#0055a9"},orange:{color:v.A[400]},transparent:{color:"transparent",backgroundColor:"transparent"},silly:{},debug:{backgroundColor:y.A[700]},info:{backgroundColor:f.A[700]},warn:{backgroundColor:b.A[700]},error:{backgroundColor:x.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"},editButton:{minHeight:32,"& .admin-edit-button":l.A.isTouchDevice()?void 0:{display:"none",maxHeight:32},"&:hover":l.A.isTouchDevice()?void 0:{"& .admin-edit-button":{display:"block"}}}};class E extends o.Component{constructor(){super(...arguments),this.styles=void 0,this.commandClose=()=>this.setState({expanded:!1})}componentDidMount(){this.props.context.onRegisterClose(this.props.id,this.commandClose)}componentWillUnmount(){this.props.context.onRegisterClose(this.props.id,null)}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,expanded:!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.${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{await 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.${this.props.instance.id}.plugins.sentry.enabled`,t,!0).catch((t=>window.alert(`Cannot set sentry: ${t}`)))}setTier(t,e){this.setCommonValue(`system.adapter.${t.id}`,{tier:e})}setName(t,e){this.setCommonValue(`system.adapter.${t.id}`,{titleLang:e})}setLogLevel(t,e,s){s?this.props.context.socket.setState(`system.adapter.${t.id}.logLevel`,e):this.setCommonValue(`system.adapter.${t.id}`,{loglevel:e})}setSchedule(t,e){e?this.setCommonValue(`system.adapter.${t.id}`,{schedule:e}):this.props.context.socket.getObject(`system.adapter.${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: ${t}`))))})).catch((t=>window.alert(`Cannot set schedule: ${t}`)))}setMemoryLimitMB(t,e){this.setCommonValue(`system.adapter.${t.id}`,{memoryLimitMB:e})}toggleCompactMode(){this.setCommonValue(`system.adapter.${this.props.instance.id}`,{runAsCompactMode:!E.isCompact(this.props.instance.obj)})}setRestartSchedule(t,e){e?this.setCommonValue(`system.adapter.${t.id}`,{restartSchedule:e}):this.props.context.socket.getObject(`system.adapter.${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.${t.id}`,{host:e})}setCompactGroup(t,e){e="controller"===e?0:"default"===e?1:parseInt(e,10),this.setCommonValue(`system.adapter.${t.id}`,{compactGroup:e}),this.props.context.maxCompactGroupNumber<e&&this.props.context.setMaxCompactGroupNumber(e)}getMemory(){const t=this.props.context.states[`${this.props.id}.memRss`];return(null===t||void 0===t?void 0:t.val)||0}renderDeleteDialog(){return(0,C.jsxs)(i.Dialog,{onClose:()=>this.setState({openDialogDelete:!1,openDialog:!1}),open:!0,children:[(0,C.jsx)(i.DialogTitle,{children:this.props.context.t("Please confirm")}),(0,C.jsxs)(i.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,C.jsx)("br",{}),this.props.context.deleteCustomSupported&&this.props.instance.obj.common.supportCustoms&&(0,C.jsx)(i.FormControlLabel,{control:(0,C.jsx)(i.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,C.jsxs)(i.DialogActions,{children:[1===this.state.openDialogDelete?(0,C.jsx)(i.Button,{startIcon:(0,C.jsx)(n.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,C.jsx)(i.Button,{startIcon:(0,C.jsx)(n.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,C.jsx)(i.Button,{color:"grey",onClick:()=>this.setState({openDialogDelete:!1,openDialog:!1}),variant:"contained",startIcon:(0,C.jsx)(n.Close,{}),children:this.props.context.t("Cancel")})]})]})}renderEditNameDialog(){return(0,C.jsx)(D.A,{theme:this.props.context.theme,title:this.props.context.t("Enter title for %s",this.props.instance.id),disableApplyIfNotChanged:!0,textInput:!0,defaultValue:l.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,C.jsxs)(D.A,{theme:this.props.context.theme,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,C.jsxs)(i.FormControl,{style:this.styles.logLevel,variant:"standard",children:[(0,C.jsx)(i.InputLabel,{children:this.props.context.t("log level")}),(0,C.jsx)(i.Select,{variant:"standard",value:this.state.logLevel,fullWidth:!0,onChange:t=>this.setState({logLevel:t.target.value}),children:$.map((t=>(0,C.jsx)(i.MenuItem,{value:t,children:this.props.context.t(t)},t)))})]}),(0,C.jsxs)(i.FormControl,{variant:"outlined",children:[(0,C.jsx)(i.FormControlLabel,{control:(0,C.jsx)(i.Checkbox,{checked:this.state.logOnTheFly,onChange:t=>this.setState({logOnTheFly:t.target.checked})}),label:this.props.context.t("Without restart")}),(0,C.jsx)(i.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,C.jsx)(D.A,{theme:this.props.context.theme,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,C.jsx)(D.A,{theme:this.props.context.theme,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,C.jsx)(a.SelectWithIcon,{themeType:this.props.context.themeType,value:this.state.host,list:this.props.context.hosts,removePrefix:"system.host.",fullWidth:!0,style:this.styles.hostInfo,onChange:t=>this.setState({host:t}),lang:this.props.context.lang,t:this.props.context.t})})}renderEditCompactGroupDialog(){return(0,C.jsx)(D.A,{theme:this.props.context.theme,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,C.jsxs)(i.FormControl,{style:this.styles.addCompact,variant:"standard",children:[(0,C.jsx)(i.InputLabel,{children:this.props.context.t("compact groups")}),(0,C.jsxs)(i.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,C.jsx)("div",{onClick:t=>{t.preventDefault(),t.stopPropagation()},style:this.styles.selectStyle,children:(0,C.jsx)(i.Button,{color:"grey",onClick:()=>this.setState({openSelectCompactGroup:!1,compactGroup:this.state.maxCompactGroupNumber+1,maxCompactGroupNumber:this.state.maxCompactGroupNumber+1}),variant:"outlined",children:this.props.context.t("Add compact group")})}),(0,C.jsx)(i.MenuItem,{value:"controller",children:this.props.context.t("with js-controller")}),(0,C.jsx)(i.MenuItem,{value:"default",children:this.props.context.t("default group")}),Array(this.state.maxCompactGroupNumber-1).fill(0).map(((t,e)=>(0,C.jsx)(i.MenuItem,{value:(e+2).toString(),children:e+2},e)))]})]})})}renderEditTierDialog(){return(0,C.jsx)(D.A,{theme:this.props.context.theme,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,C.jsxs)(i.FormControl,{style:this.styles.logLevel,variant:"standard",children:[(0,C.jsx)(i.InputLabel,{children:this.props.context.t("Tiers")}),(0,C.jsx)(i.Select,{variant:"standard",value:this.state.tier,fullWidth:!0,onChange:t=>this.setState({tier:parseInt(t.target.value,10)}),children:B.map((t=>(0,C.jsx)(i.MenuItem,{value:t.value,children:this.props.context.t(t.desc)},t.value)))})]})})}renderStopAdminDialog(){return this.state.showStopAdminDialog?(0,C.jsx)(a.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,C.jsx)(T,{image:this.props.instance.image,instanceId:this.props.instance.id,links:this.props.instance.links,onClose:()=>this.setState({showLinks:!1,openDialog:!1}),t:this.props.context.t,themeType:this.props.context.themeType}):null}renderCronDialog(){return(0,C.jsx)(a.ComplexCronDialog,{title:this.props.context.t("Edit restart rule for %s",this.props.instance.id),clearButton:!0,cron:E.getRestartSchedule(this.props.instance.obj),onOk:t=>this.setRestartSchedule(this.props.instance,t),onClose:()=>this.setState({openDialogCron:!1,openDialog:!1})})}renderScheduleDialog(){return(0,C.jsx)(a.ComplexCronDialog,{title:this.props.context.t("Edit schedule rule for %s",this.props.instance.id),clearButton:!0,cron:E.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,C.jsx)("div",{style:{...this.styles.smallAvatar,...this.styles.statusIndicator,..."daemon"===this.props.instance.mode||"schedule"===this.props.instance.mode?this.styles[t]:this.styles.transparent,...this.props.item.connectedToHost&&this.props.item.alive&&!1===this.props.item.connected?this.styles.orangeDevice:void 0},children:this.getModeIcon(this.props.instance.mode,t,this.styles[`statusIcon_${t}`],this.props.item.stoppedWhenWebExtension)})}getModeIcon(t,e,s,o){return"daemon"===t?o?(0,C.jsx)("div",{style:{...s,...this.styles.okSymbol},children:(0,C.jsx)("div",{style:this.styles.okSymbolInner})}):"orange"===e?(0,C.jsx)(n.Warning,{style:s}):"green"===e?(0,C.jsx)("div",{style:{...s,...this.styles.okSymbol},children:(0,C.jsx)("div",{style:this.styles.okSymbolInner})}):(0,C.jsx)(n.Settings,{style:s}):"schedule"===t?(0,C.jsx)(n.Schedule,{style:s}):null}renderTooltip(){const{instance:t,item:e}=this.props;let s,o,i;if("schedule"===t.mode&&t.schedule){try{i=h().toString(t.schedule,{locale:this.props.context.lang})}catch{i=t.schedule}if(t.enabled)try{const e=u().parseExpression(t.schedule);s=e.next().toDate(),o=e.prev().toDate()}catch{s=null,o=null}}return[void 0!==e.stoppedWhenWebExtension?(0,C.jsx)(j.A,{state:!0,children:this.props.context.t("Runs as web-extension")},1):"","daemon"===t.mode&&void 0===this.props.item.stoppedWhenWebExtension?(0,C.jsx)(j.A,{state:e.connectedToHost,children:this.props.context.t("Connected to host")},2):"","daemon"===t.mode&&void 0===this.props.item.stoppedWhenWebExtension?(0,C.jsx)(j.A,{state:e.alive,children:this.props.context.t("Heartbeat")},3):"",null!==this.props.item.connected&&void 0===this.props.item.stoppedWhenWebExtension?(0,C.jsx)(j.A,{state:!!e.connected,children:"string"===typeof e.connected?`${this.props.context.t("Connected:")} ${e.connected||"-"}`:this.props.context.t("Connected to device or service")},4):"",i?(0,C.jsxs)(j.A,{state:t.enabled,children:["CRON:",i]},5):null,s?(0,C.jsx)(j.A,{state:!0,children:this.props.context.t("Next start: %s",`${s.toLocaleDateString(this.props.context.lang)} ${s.toLocaleTimeString(this.props.context.lang)}`)},6):null,o?(0,C.jsx)(j.A,{state:!0,children:this.props.context.t("Last start: %s",`${o.toLocaleDateString(this.props.context.lang)} ${o.toLocaleTimeString(this.props.context.lang)}`)},7):null].filter((t=>t))}renderMemoryUsage(){return this.props.item.running&&(0,C.jsx)(w,{icon:(0,C.jsx)(n.Memory,{}),tooltip:this.props.context.t("RAM usage"),children:`${"daemon"!==this.props.instance.mode||E.isCompact(this.props.instance.obj)?"-.--":this.getMemory()} MB`})}renderPlayPause(){return(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Start/stop"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)("div",{children:(0,C.jsx)(i.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.${this.props.instance.id}`}):this.setCommonValue(`system.adapter.${this.props.instance.id}`,{enabled:!this.props.item.running})},onFocus:t=>t.stopPropagation(),sx:{...this.styles.button,...this.props.instance.canStart?this.props.item.running?this.styles.enabled:this.styles.disabled:this.styles.hide},children:this.props.item.running?(0,C.jsx)(n.Pause,{}):(0,C.jsx)(n.PlayArrow,{})})})})}renderSettingsButton(){return(0,C.jsx)(i.Tooltip,{title:this.props.instance.config?this.props.context.t("Settings"):"",slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)("div",{children:(0,C.jsx)(i.IconButton,{disabled:!this.props.instance.config,size:"small",style:{...this.styles.button,...this.props.instance.config?void 0:this.styles.hiddenOpacity},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.saveScrollPosition(),a.Router.doNavigate("tab-instances","config",this.props.id)},children:(0,C.jsx)(n.Build,{})})})})}renderRestartButton(){return(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Restart"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)("div",{children:(0,C.jsx)(i.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.props.context.socket.extendObject(`system.adapter.${this.props.instance.id}`,{})},onFocus:t=>t.stopPropagation(),style:{...this.styles.button,...this.props.instance.canStart?void 0:this.styles.hide},disabled:!this.props.item.running,children:(0,C.jsx)(n.Refresh,{})})})})}renderLink(){return(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Instance link %s",this.props.instance.id),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)("div",{children:(0,C.jsx)(i.IconButton,{size:"small",style:{...this.styles.button,...this.props.instance.links&&this.props.instance.links[0]?void 0:this.styles.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,openDialog:!0})},onFocus:t=>t.stopPropagation(),children:(0,C.jsx)(n.Input,{})})})})}renderEditNameButton(){return(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:{...this.styles.button,...this.state.visibleEdit?void 0:this.styles.hiddenOpacity},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogName:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})}renderInputOutput(){return(0,C.jsx)(w,{icon:(0,C.jsx)(n.ImportExport,{}),tooltip:this.props.context.t("events"),children:(0,C.jsxs)("div",{style:this.styles.displayFlex,children:[(0,C.jsx)(i.Tooltip,{title:this.props.context.t("input events"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsxs)("div",{style:this.styles.marginRight5,children:["\u21e5",this.props.item.inputOutput.stateInput]})}),"/",(0,C.jsx)(i.Tooltip,{title:this.props.context.t("output events"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsxs)("div",{style:this.styles.marginLeft5,children:["\u21a6",this.props.item.inputOutput.stateOutput]})})]})})}renderHost(){return(0,C.jsx)(a.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,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",style:this.styles.button,className:"admin-edit-button",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogHost:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})}renderSentry(){return(0,C.jsx)(i.Tooltip,{title:"sentry",slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleSentry()},children:(0,C.jsx)(i.CardMedia,{style:{...this.styles.sentry,...this.props.item.sentry?void 0:this.styles.contrast0},component:"img",image:this.props.item.sentry?I.A:k})})})}renderCompactGroupEnabled(){return(0,C.jsx)(i.Tooltip,{title:this.props.context.t("compact groups"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",style:{...this.styles.button,...this.props.context.expertMode&&this.props.item.checkCompact?void 0:this.styles.hide},onClick:t=>{t.stopPropagation(),t.preventDefault(),this.toggleCompactMode()},children:(0,C.jsx)(n.ViewCompact,{color:this.props.item.compact?"primary":"inherit"})})})}renderVersion(){return(0,C.jsxs)(w,{tooltip:this.props.context.t("Installed"),children:["v",this.props.instance.version]})}renderInfo(t){return(0,C.jsxs)(C.Fragment,{children:[t?void 0:(0,C.jsx)("span",{style:this.styles.instanceName,children:this.props.instance.id}),void 0!==this.props.item.stoppedWhenWebExtension&&(0,C.jsx)(j.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,C.jsx)(j.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,C.jsx)(j.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,C.jsx)(j.A,{state:!!this.props.item.connected,children:"string"===typeof this.props.item.connected?`${this.props.context.t("Connected:")} ${this.props.item.connected||"-"}`:this.props.context.t("Connected to device or service")})]})}renderLogLevel(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:this.props.item.loglevelIcon,tooltip:this.props.item.logLevelObject===this.props.item.logLevel?`${this.props.context.t("loglevel")} ${this.props.item.logLevel}`:`${this.props.context.t("saved:")} ${this.props.item.logLevelObject} / ${this.props.context.t("actual:")} ${this.props.item.logLevel}`,children:this.props.item.logLevelObject===this.props.item.logLevel?this.props.item.logLevel:`${this.props.item.logLevelObject} / ${this.props.item.logLevel}`}),(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogLogLevel:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})]})}renderSchedule(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:(0,C.jsx)(n.Schedule,{}),tooltip:this.props.context.t("schedule_group"),children:E.getSchedule(this.props.instance.obj)||"-"}),(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogSchedule:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})]})}renderRestartSchedule(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:(0,C.jsx)(n.Schedule,{style:this.styles.scheduleIcon}),tooltip:this.props.context.t("restart"),children:E.getRestartSchedule(this.props.instance.obj)||"-"}),(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCron:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})]})}renderRamLimit(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:(0,C.jsx)(n.Memory,{style:this.styles.memoryIcon}),tooltip:this.props.context.t("RAM limit"),children:`${this.props.item.memoryLimitMB?this.props.item.memoryLimitMB:"-.--"} MB`}),(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogMemoryLimit:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})]})}renderCompactGroup(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:(0,C.jsx)(n.ViewCompact,{style:this.styles.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,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogCompact:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})})]})}renderTier(){var t;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:(0,C.jsx)(n.LowPriority,{style:this.styles.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=B.find((t=>t.value===this.props.item.tier)))||void 0===t?void 0:t.desc)||B[2].desc)}),"admin"!==this.props.instance.adapter?(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Edit start order (tier)"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",className:"admin-edit-button",style:this.styles.button,onClick:t=>{t.stopPropagation(),t.preventDefault(),this.setState({openDialogTier:!0,openDialog:!0})},children:(0,C.jsx)(n.Edit,{})})}):null]})}renderHostWithButton(){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(w,{icon:(0,C.jsx)(n.Storage,{style:this.styles.marginRight5}),tooltip:this.props.context.t("Host for this instance"),children:this.renderHost()}),this.renderEditHostButton()]})}renderDeleteButton(){return(0,C.jsx)(i.Tooltip,{title:this.props.context.t("Delete"),slotProps:{popper:{sx:this.styles.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"small",style:this.styles.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,C.jsx)(n.Delete,{})})})}render(){return(0,C.jsx)("div",{children:this.state.expanded})}}var F=s(79091);const W={...M,fab:{position:"absolute",bottom:-20,width:40,height:40,right:20},collapse:t=>({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:20,height:20,opacity:.9,cursor:"pointer",position:"relative",marginLeft:"auto",mb:"10px",transition:"all 0.6s ease","&:hover":{transform:"rotate(90deg)"},"&:before":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"#ff4f4f",transform:"rotate(45deg)"},"&:after":{position:"absolute",left:9,content:'""',height:20,width:3,backgroundColor:"#ff4f4f",transform:"rotate(-45deg)"}},footerBlock:t=>({background:t.palette.background.default,p:"10px",display:"flex",justifyContent:"space-between"}),versionDate:{alignSelf:"center"},adapter:{width:"100%",fontWeight:"bold",fontSize:16,verticalAlign:"middle",paddingLeft:8,paddingTop:16},cardContent:{mt:2,paddingTop:0},cardContentH5:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},marginTop10:{marginTop:10},overflowAuto:{overflow:"auto"},collapseIcon:t=>({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:t=>({backgroundColor:"rgba(192, 192, 192, 0.2)",color:"dark"===t.palette.mode?"#CCC":"#333"}),instanceStateNotAlive1:t=>({backgroundColor:"rgba(192, 192, 192, 0.7)",color:"dark"===t.palette.mode?"#CCC":"#333"}),instanceStateAliveNotConnected1:t=>({backgroundColor:"rgba(255, 177, 0, 0.4)",color:"dark"===t.palette.mode?"#CCC":"#333"}),instanceStateAliveAndConnected1:t=>({backgroundColor:"rgba(0, 255, 0, 0.4)",color:"dark"===t.palette.mode?"#CCC":"#333"})};const P=class extends E{constructor(t){super(t),this.styles=W,this.state=Object.assign(this.getDefaultState(t),{mouseOver:!1})}renderSecondCardInfo(){var t;if(this.props.deleting||!this.state.expanded)return null;const{item:e,instance:s}=this.props;return(0,C.jsxs)(i.Box,{component:"div",sx:a.Utils.getStyle(this.props.context.theme,W.collapse,this.state.expanded?"":W.collapseOff,this.props.deleting&&W.deleting),children:[(0,C.jsxs)(i.CardContent,{sx:{"&.MuiCardContent-root":{...W.cardContent,...W.overflowAuto}},children:[(0,C.jsx)(i.Box,{component:"div",sx:W.collapseIcon,children:(0,C.jsx)(i.Box,{component:"div",sx:W.close,onClick:()=>{this.state.openDialog||this.setState({expanded:!1},(()=>this.props.context.onToggleExpanded(this.props.id,!1)))}})}),(0,C.jsxs)(i.Typography,{gutterBottom:!0,component:"span",variant:"body2",children:[this.renderInfo(),this.renderVersion(),this.renderMemoryUsage(),e.running&&this.props.context.expertMode&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderInputOutput()}),this.props.context.expertMode&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderRamLimit()}),this.props.context.expertMode&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderLogLevel()}),e.modeSchedule&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderSchedule()}),this.props.context.expertMode&&"daemon"===s.mode&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderRestartSchedule()}),this.props.context.expertMode&&e.checkCompact&&e.compact&&e.supportCompact&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderCompactGroup()}),this.props.context.expertMode&&(0,C.jsx)("div",{style:W.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)!==s.host?(0,C.jsx)("div",{style:W.displayFlex,children:this.renderHostWithButton()}):null,(0,C.jsx)(F.A,{config:e,name:"allowInstanceSettings",children:(0,C.jsx)(i.Box,{component:"div",sx:{display:{sm:"none",xs:"inline-block"}},children:this.renderSettingsButton()})})]})]}),(0,C.jsxs)(i.Box,{component:"div",sx:W.footerBlock,children:[(0,C.jsx)(F.A,{config:e,name:"allowInstanceDelete",children:(0,C.jsx)("div",{style:W.displayFlex,children:this.renderDeleteButton()})}),this.props.context.expertMode&&e.checkSentry&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderSentry()}),e.supportCompact&&this.props.context.expertMode&&e.checkCompact&&(0,C.jsx)("div",{style:W.displayFlex,children:this.renderCompactGroupEnabled()})]})]})}render(){const{item:t,instance:e}=this.props;return(0,C.jsxs)(i.Card,{sx:a.Utils.getStyle(this.props.context.theme,W.root,this.props.hidden&&W.hidden),children:[this.state.openDialog&&this.renderDialogs(),this.renderSecondCardInfo(),(0,C.jsxs)(i.Box,{component:"div",sx:a.Utils.getStyle(this.props.context.theme,W.imageBlock,(!t.running||"daemon"!==e.mode||void 0!==t.stoppedWhenWebExtension)&&W.instanceStateNotEnabled1,t.running&&"daemon"===e.mode&&void 0===t.stoppedWhenWebExtension&&(!t.connectedToHost||!t.alive)&&W.instanceStateNotAlive1,t.running&&t.connectedToHost&&t.alive&&!1===t.connected&&W.instanceStateAliveNotConnected1,t.running&&t.connectedToHost&&t.alive&&!1!==t.connected&&W.instanceStateAliveAndConnected1),children:[(0,C.jsx)(i.CardMedia,{sx:W.img,component:"img",image:e.image||"img/no-image.png"}),(0,C.jsx)("div",{style:W.adapter,children:e.id}),(0,C.jsx)("div",{style:W.versionDate}),this.state.expanded?null:(0,C.jsx)(i.Fab,{onMouseOver:()=>this.setState({mouseOver:!0}),onMouseOut:()=>this.setState({mouseOver:!1}),onClick:()=>this.setState({expanded:!0},(()=>this.props.context.onToggleExpanded(this.props.id,!0))),style:W.fab,color:"primary","aria-label":"add",children:(0,C.jsx)(n.MoreVert,{})})]}),(0,C.jsxs)(i.CardContent,{style:W.cardContentH5,children:[(0,C.jsx)(i.Typography,{gutterBottom:!0,variant:"h5",component:"h5",children:(0,C.jsxs)("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),style:W.displayFlex,children:[l.A.getText(t.name,this.props.context.lang),this.renderEditNameButton()]})}),(0,C.jsx)("div",{style:W.marginTop10,children:(0,C.jsxs)(i.Typography,{component:"span",style:W.enableButton,children:[this.renderPlayPause(),(0,C.jsx)(i.Box,{component:"div",sx:{display:{sm:"inline-block",xs:"none"}},children:this.renderSettingsButton()}),this.renderRestartButton(),(0,C.jsx)(F.A,{config:t,name:"allowInstanceLink",children:this.renderLink()})]})})]})]})}},R={...M,row:{pl:1,pr:2,p:0},expanded:{minHeight:64},invisible:{opacity:0},instanceIcon:{height:42,width:42,"@media screen and (max-width: 800px)":{height:28,width:28,ml:"4px"}},hidden1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","@media screen and (max-width: 1500px)":{display:"none !important"}},visible1250:{display:"flex",width:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","@media screen and (max-width: 1500px)":{display:"flex !important"}},visible1050:{display:"none","@media screen and (max-width: 1120px)":{display:"flex !important"}},hidden1050:{display:"flex","@media screen and (max-width: 1120px)":{display:"none !important"}},hidden800:{display:"flex","@media screen and (max-width: 800px)":{display:"none !important"}},visible800:{display:"none","@media screen and (max-width: 800px)":{display:"flex !important"}},hidden570:{display:"flex","@media screen and (max-width: 650px)":{display:"none !important"}},visible570:{display:"none","@media screen and (max-width: 650px)":{display:"flex !important"}},hidden1230:{"@media screen and (max-width: 1300px)":{display:"none !important"}},hidden380:{display:"flex","@media screen and (max-width: 380px)":{display:"none !important"}},instanceId:{overflow:"hidden",alignSelf:"center",fontSize:16,ml:"5px",maxWidth:150,minWidth:100,whiteSpace:"nowrap",textOverflow:"ellipsis",flexGrow:2,"@media screen and (max-width: 380px)":{width:"70px !important",minWidth:"70px !important"},"@media screen and (max-width: 480px)":{width:100}},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",alignItems:"center","@media screen and (max-width: 480px)":{minWidth:"auto !important",ml:"10px"},"@media screen and (max-width: 335px)":{ml:"0px"}},paddingRight200:{},maxWidth300:{width:300,"@media screen and (max-width: 480px)":{width:"250px !important"}},width150:{width:150},desktopRow:{minHeight:0},desktopIcon:{height:32,width:32,mt:1},desktopRowContent:{mt:"2px",mb:"2px"},desktopButton:{},rowGridLine:{marginTop:-2}};const N=class extends E{constructor(t){super(t),this.desktop=window.innerWidth>1e3,this.styles=R,this.state=this.getDefaultState(t)}renderDetails(){var t;const{instance:e,item:s}=this.props;return(0,C.jsx)(i.AccordionDetails,{children:(0,C.jsxs)(i.Grid2,{container:!0,direction:"row",children:[(0,C.jsxs)(i.Grid2,{container:!0,direction:"row",size:{xs:10},children:[(0,C.jsx)(i.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},children:this.renderInfo(!0)}),(0,C.jsx)(i.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},children:this.renderVersion()}),(0,C.jsxs)(i.Grid2,{container:!0,direction:"column",size:{xs:12,sm:6,md:4},style:R.paddingRight200,children:[this.props.context.expertMode&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderLogLevel()}),s.running&&this.props.context.expertMode&&(0,C.jsx)(i.Box,{component:"div",sx:R.visible1250,children:this.renderInputOutput()}),(0,C.jsx)(i.Grid2,{sx:R.visible1050,children:this.renderMemoryUsage()}),s.modeSchedule&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderSchedule()}),this.props.context.expertMode&&"daemon"===e.mode&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderRestartSchedule()}),this.props.context.expertMode&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderRamLimit()}),this.props.context.expertMode&&s.checkCompact&&s.compact&&s.supportCompact&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderCompactGroup()}),this.props.context.expertMode&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderTier()}),(0,C.jsxs)(i.Box,{component:"div",sx:{...R.maxWidth300,...R.visible800,...R.editButton},children:[(0,C.jsx)(w,{children:l.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,C.jsx)(i.Box,{component:"div",sx:{...R.displayFlex,...R.maxWidth300,...R.editButton},children:this.renderHostWithButton()}):null]})]}),(0,C.jsxs)("div",{style:R.displayFlex,children:[(0,C.jsx)(F.A,{config:s,name:"allowInstanceDelete",children:(0,C.jsx)(i.Box,{component:"div",sx:{display:{xs:"inline-block",md:"none"}},children:this.renderSettingsButton()})}),(0,C.jsx)(i.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderRestartButton()}),(0,C.jsx)(F.A,{config:s,name:"allowInstanceLink",children:(0,C.jsx)(i.Box,{component:"div",sx:{display:{md:"none",xs:"inline-block"}},children:this.renderLink()})}),(0,C.jsx)(F.A,{config:s,name:"allowInstanceDelete",children:this.renderDeleteButton()}),(0,C.jsx)(i.Box,{component:"div",sx:R.visible570,children:this.renderSentry()}),(0,C.jsx)(i.Box,{component:"div",sx:R.visible570,children:this.renderCompactGroupEnabled()})]})]})})}render(){var t;const{instance:e,item:s}=this.props,o=this.props.context.getInstanceStatus(e.obj),r=this.renderTooltip(),a={...R.row,...(!s.running||"daemon"!==e.mode||void 0!==s.stoppedWhenWebExtension)&&(this.props.idx%2===0?R.instanceStateNotEnabled1:R.instanceStateNotEnabled2),...!s.running||"daemon"!==e.mode||void 0!==s.stoppedWhenWebExtension||s.connectedToHost&&s.alive?void 0:this.props.idx%2===0?R.instanceStateNotAlive1:R.instanceStateNotAlive2,...s.running&&s.connectedToHost&&s.alive&&!1===s.connected?this.props.idx%2===0?R.instanceStateAliveNotConnected1:R.instanceStateAliveNotConnected2:void 0,...s.running&&s.connectedToHost&&s.alive&&!1!==s.connected?this.props.idx%2===0?R.instanceStateAliveAndConnected1:R.instanceStateAliveAndConnected2:void 0,...this.desktop?R.desktopRow:void 0,...this.state.expanded&&!this.props.deleting?R.expanded:void 0};return(0,C.jsxs)(i.Accordion,{square:!0,sx:{"&.MuiAccordion-root":{...this.props.deleting?R.deleting:void 0,...this.props.hidden?R.hidden:void 0}},expanded:this.state.expanded&&!this.props.deleting,onChange:()=>{this.state.openDialog||this.setState({expanded:!this.state.expanded},(()=>this.props.context.onToggleExpanded(this.props.id,this.state.expanded)))},children:[(0,C.jsxs)(i.AccordionSummary,{sx:{"&.MuiAccordionSummary-root":a,"& .MuiAccordionSummary-content":this.desktop?R.desktopRowContent:void 0},expandIcon:(0,C.jsx)(n.ExpandMore,{style:this.desktop?R.desktopButton:void 0}),children:[this.renderDialogs(),(0,C.jsxs)(i.Grid2,{container:!0,spacing:1,alignItems:"center",direction:"row",wrap:"nowrap",style:R.rowGridLine,children:[(0,C.jsxs)(i.Box,{component:"div",style:R.gridStyle,children:[r.length?(0,C.jsx)(i.Tooltip,{slotProps:{popper:{sx:R.tooltip}},title:(0,C.jsx)("span",{style:{display:"flex",flexDirection:"column"},children:r}),children:this.renderModeIcon(o)}):this.renderModeIcon(o),(0,C.jsx)(i.Avatar,{variant:"square",alt:e.id,src:e.image,sx:{...R.instanceIcon,...this.desktop?R.desktopIcon:void 0}}),(0,C.jsx)(i.Box,{component:"div",sx:R.instanceId,children:e.id})]}),this.renderPlayPause(),(0,C.jsx)(F.A,{config:s,name:"allowInstanceSettings",children:(0,C.jsx)(i.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderSettingsButton()})}),(0,C.jsx)(i.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderRestartButton()}),(0,C.jsx)(F.A,{config:s,name:"allowInstanceLink",children:(0,C.jsx)(i.Box,{component:"div",sx:{display:{md:"inline-block",xs:"none"}},children:this.renderLink()})}),(0,C.jsx)(i.Typography,{sx:{...R.secondaryHeading,...R.hidden800},component:"div",children:(0,C.jsxs)("div",{onMouseEnter:()=>this.setState({visibleEdit:!0}),onMouseLeave:()=>this.setState({visibleEdit:!1}),style:R.secondaryHeadingDiv,children:[(0,C.jsx)("div",{style:R.secondaryHeadingDivDiv,children:l.A.getText(s.name,this.props.context.lang)}),this.renderEditNameButton()]})}),this.props.context.expertMode&&(0,C.jsx)(i.Box,{component:"div",sx:{...R.hidden1250,..."daemon"===e.mode&&s.running?void 0:R.invisible},children:this.renderInputOutput()}),this.props.context.expertMode&&(0,C.jsx)(i.Tooltip,{title:s.logLevelObject===s.logLevel?`${this.props.context.t("loglevel")} ${s.logLevel}`:`${this.props.context.t("saved:")} ${s.logLevelObject} / ${this.props.context.t("actual:")} ${s.logLevel}`,slotProps:{popper:{sx:R.tooltip}},children:(0,C.jsx)(i.Avatar,{sx:{...R.smallAvatar,...R.hidden380,...R[s.logLevel]},children:s.loglevelIcon})}),(0,C.jsx)(i.Grid2,{sx:{...R.hidden1050,...R.width150,..."daemon"===e.mode&&s.running?void 0:R.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,C.jsx)(i.Grid2,{sx:R.hidden1230,children:this.renderHost()}):null]}),(0,C.jsx)(i.Box,{component:"div",sx:R.hidden570,children:this.renderSentry()}),(0,C.jsx)(i.Box,{component:"div",sx:R.hidden570,children:this.renderCompactGroupEnabled()})]}),this.state.expanded?this.renderDetails():null,this.renderDialogs()]})}};var H=s(73852);const _=s.p+"static/media/filter.ddf40c28bbf1e138937e53be53e56274.svg",G={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:g.A[700]},red:{color:x.A[700]},grey:{color:y.A[700]},blue:{color:"#0055a9"},orange:{color:v.A[400]},orangeDevice:{color:v.A[300]},icon:{width:18,height:18,marginRight:8,display:"inline-block"},menuValue:{whiteSpace:"nowrap"}},O=["none","daemon","schedule","once"],z=(t,e)=>1===t||2===t?(0,C.jsx)(n.Lens,{style:e}):3===t?(0,C.jsx)(n.Warning,{style:e}):4===t?(0,C.jsx)(n.Schedule,{style:e}):5===t?(0,C.jsx)("div",{style:{...e,width:20,height:20,margin:2,borderRadius:2},children:(0,C.jsx)("div",{style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",borderRadius:2,margin:1,backgroundColor:"#66bb6a"}})}):null,V={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"}},U=t=>{let{onClose:e,filterMode:s,filterStatus:r}=t;const[l,p]=(0,o.useState)(s),[c,d]=(0,o.useState)(r);return(0,C.jsxs)(i.Dialog,{onClose:()=>e(),open:!0,sx:{"& .MuiDialog-paper":G.paper},children:[(0,C.jsx)(i.DialogTitle,{style:{display:"flex"},children:(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)(i.Avatar,{variant:"square",style:G.square,src:_}),a.I18n.t("Filter instances")]})}),(0,C.jsx)(i.DialogContent,{style:G.overflowHidden,dividers:!0,children:(0,C.jsxs)(i.Card,{style:G.root,children:[(0,C.jsxs)("div",{style:G.rowBlock,children:[(0,C.jsx)(i.FormControlLabel,{style:G.checkbox,control:(0,C.jsx)(i.Checkbox,{checked:!!l,onChange:t=>t.target.checked?p("daemon"):p(null)}),label:a.I18n.t("Filter by mode")}),(0,C.jsx)(i.Select,{disabled:!l,variant:"standard",value:l||"none",style:G.select,onChange:t=>{"none"===t.target.value?p(null):p(t.target.value)},children:O.map((t=>(0,C.jsx)(i.MenuItem,{value:t,children:a.I18n.t(t)},t)))})]}),(0,C.jsxs)("div",{style:G.rowBlock,children:[(0,C.jsx)(i.FormControlLabel,{style:G.checkbox,control:(0,C.jsx)(i.Checkbox,{checked:!!c,onChange:t=>t.target.checked?d("ok"):d(null)}),label:a.I18n.t("Filter by status")}),(0,C.jsx)(i.Select,{disabled:!c,variant:"standard",value:c||"none",style:G.select,onChange:t=>{"none"===t.target.value?d(null):d(t.target.value)},children:Object.keys(V).map(((t,e)=>(0,C.jsx)(i.MenuItem,{value:t,children:(0,C.jsxs)("div",{style:G.menuWrapper,children:[V[t].status?(0,C.jsx)("div",{style:G.iconWrapper,children:z(e,G[`statusIcon_${e}`])}):null,(0,C.jsx)("div",{style:G.textWrapper,children:a.I18n.t(V[t].text)})]})},t)))})]})]})}),(0,C.jsxs)(i.DialogActions,{children:[(0,C.jsx)(i.Button,{variant:"contained",autoFocus:!0,disabled:l===s&&r===c,onClick:()=>{e({filterMode:l,filterStatus:c})},color:"primary",startIcon:(0,C.jsx)(n.Check,{}),children:a.I18n.t("Apply")}),(0,C.jsx)(i.Button,{color:"grey",variant:"contained",onClick:()=>e(),startIcon:(0,C.jsx)(n.Close,{}),children:a.I18n.t("Close")})]})]})};var J=s(90457);const q={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"}};const K=function(t){let{name:e,key:s,children:o,expanded:r,onExpand:a}=t;return(0,C.jsxs)(i.Accordion,{expanded:!!r,onChange:()=>a(!r),style:q.accordion,square:!0,children:[(0,C.jsx)(i.AccordionSummary,{style:q.row,expandIcon:(0,C.jsx)(n.ExpandMore,{}),children:(0,C.jsxs)("div",{style:q.wrapperName,children:[(0,C.jsx)(J.A,{iconName:e,style:q.iconStyle}),e]})}),(0,C.jsx)(i.AccordionDetails,{style:q.accordionDetails,children:(0,C.jsx)("div",{style:q.wrapperChildren,children:o})})]},s)},Y={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:t=>({color:t.palette.primary.main}),tooltip:{pointerEvents:"none"},grow:{flexGrow:1}};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.refTabContent=void 0,this.subscribed=!1,this._cacheList=null,this.shouldUpdateAfterDialogClosed=!1,this.expanded="",this.closeCommands={},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.getObjects();if(!s)return void window.alert("Cannot read instances!");e=Object.values(s);let o=`${this.state.currentHost}.memRss`;this.states[o]=this.states[o]||await this.props.socket.getState(o);const i=this.states[o];let n=1,r=i&&parseFloat(i.val)||0;const a={};this.props.hosts.forEach((t=>a[t._id]=t));for(let l=0;l<e.length;l++){const t=e[l];if(t&&t.common&&t.common.host===this.props.currentHostName&&(t.common.enabled&&"daemon"===t.common.mode&&!E.isCompact(t))){o=`${t._id}.memRss`,this.states[o]=this.states[o]||await this.props.socket.getState(o);const e=this.states[o];r+=e&&parseFloat(e.val)||0,n++}}const c={};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),r=s[s.length-2],a=o[o.length-2];return r===a?i>n?1:i<n?-1:0:r>a?1:r<a?-1:0}));let d=1;const h={};for(let m=0;m<e.length;m++){const t=e[m],o=t.common||null,i=parseInt(t._id.split(".").pop(),10);o.compactGroup&&"number"===typeof o.compactGroup&&d<o.compactGroup&&(d=o.compactGroup);const n={id:t._id.replace("system.adapter.",""),obj:t,compact:!!o.compact,host:o.host,name:this.getName(t),image:o.icon?`adapter/${o.name}/${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&&void 0!==t.common.webExtension?!!t.common.webExtension:void 0,links:[]},r=o.localLinks||o.localLink||"";let h=null;r&&"string"===typeof r?h={_default:r}:r&&"object"===typeof r&&(h=r);const u=h?Object.keys(h):[];if(u.forEach((t=>{let e;n.links=n.links||[],e="string"===typeof h[t]?{link:h[t]}:h[t];const r=(0,p.td)(e.link,o.name,i,{instances:s,hostname:this.props.hostname,hosts:a,adminInstance:this.props.adminInstance})||[];let c=e.name||t;c="_default"===c?1===u.length?"":this.t("default"):"object"===typeof c?l.A.getText(c,this.props.lang):this.t(c),1===r.length?n.links.push({name:c,link:r[0].url,port:r[0].port,color:e.color}):r.length>1&&r.forEach((t=>{n.links.push({name:c,link:t.url,port:t.port,color:e.color})}))})),n.stoppedWhenWebExtension){const t=this.states[`${n.id}.info.extension`]||await this.props.socket.getState(`${n.id}.info.extension`);n.stoppedWhenWebExtension=t?!!t.val:void 0}console.log(t._id),c[t._id]=n}console.log("getInstances: "+(Date.now()-t));for(let l=1;l<=d;l++){const t=`${this.state.currentHost}.compactgroup${l}.memRss`;this.states[t]=this.states[t]||await this.props.socket.getState(t);const e=this.states[t];e&&(r+=e&&parseFloat(e.val)||0,n++)}this.state.deleting&&!c[`system.adapter.${this.state.deleting}`]&&(h.deleting=null),h.maxCompactGroupNumber=d,h.processes=n,h.mem=Math.round(r),h.instances=c,this._cacheList=null,this.setState(h)},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 "${this.state.currentHost}": ${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{}const n="true"===this.localStorage.getItem("Instances.onlyCurrentHost"),r="true"===this.localStorage.getItem("Instances.viewMode"),a="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:r,viewCategory:a})},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(null===e||void 0===e||!e.enabled||e.webExtension&&t.native.webInstance&&"daemon"!==s)o="daemon"===s?"grey":"blue";else{const i=this.states[`${t._id}.alive`],n=this.states[`${t._id}.connected`],r=this.states[`${t._id.replace("system.adapter.","")}.info.connection`];if(e.webExtension&&t.native.webInstance){const e=this.states[`${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"),!r||null!==r&&void 0!==r&&r.val||"red"===o||(o="orange")}return o},this.onDeleteInstance=(t,e,s)=>{this.setState({deleting:t.id},(()=>this.props.executeCommand(`del ${s?t.id.split(".")[0]:t.id}${e?" --custom":""}${this.props.expertMode?" --debug":""}`)))},this.onMaxCompactGroupNumber=t=>this.setState({maxCompactGroupNumber:t}),this.onRegisterClose=(t,e)=>{this.closeCommands[t]=e},this.saveScrollPosition=()=>{var t,e;Q.lastScrollPosition=null===(t=this.refTabContent.current)||void 0===t||null===(e=t.parentNode)||void 0===e?void 0:e.scrollTop},this.onToggleExpanded=(t,e)=>{this.expanded!==t&&e&&this.closeCommands[this.expanded]&&this.closeCommands[this.expanded](),this.expanded=e?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{}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,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)(),this.refTabContent=(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()}componentWillUnmount(){this.subscribeStates(!0),this.props.instancesWorker.unregisterHandler(this.getInstances)}getStates(t){return t&&(this.statePromise=null),this.statePromise instanceof Promise||(this.statePromise=this.props.socket.getForeignStates("system.adapter.*")),this.statePromise}static getDerivedStateFromProps(t,e){const s=a.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.${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?l.A.getText(t.common.titleLang,this.props.lang):l.A.getText(t.common.title,this.props.lang):""}getInputOutput(t){const e=this.states[`${t}.inputCount`],s=this.states[`${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[`${t}.alive`];return!(null===e||void 0===e||!e.val)}isConnectedToHost(t){const e=this.states[`${t}.connected`];return!(null===e||void 0===e||!e.val)}isConnected(t){const e=this.state.instances[t];return this.states[`${e.id}.info.connection`]?this.states[`${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,C.jsx)(n.BugReport,{}):"info"===t?(0,C.jsx)(n.Info,{}):"warn"===t?(0,C.jsx)(n.Warning,{}):"error"===t?(0,C.jsx)(n.Error,{}):null}isSentry(t){var e;return!(null===(e=this.states[`${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=E.isRunning(i.obj),r=E.isCompactGroup(i.obj),a=this.isCompactGroupCheck(i.adapter)&&this.state.compact,l=E.isCompact(i.obj),p=i.compact||!1,c=this.isAlive(t),d=this.isConnectedToHost(t),h=this.isConnected(t),m=this.getName(i.obj),u=(null===(e=this.states[`${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),y=this.getInputOutput(t),f=E.isModeSchedule(i.obj),b=E.getMemoryLimitMB(i.obj),j=E.getSentrySettings(i.obj),C=this.isSentry(t);return{id:t,running:n,host:i.host,nameId:i.id,compactGroup:r,checkCompact:a,mode:i.mode,sentry:C,category:i.obj.common.type||"other",status:this.getInstanceStatus(i.obj),alive:c,compact:l,supportCompact:p,connectedToHost:d,connected:h,name:m,logLevel:u,logLevelObject:g,tier:x,loglevelIcon:v,inputOutput:y,modeSchedule:f,checkSentry:j,memoryLimitMB:b,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,theme:this.props.theme,onRegisterClose:this.onRegisterClose},e=this._cacheList.map(((e,s)=>{const o=e.id,i=this.state.instances[o];return this.state.viewMode?{category:e.category,render:(0,C.jsx)(P,{saveScrollPosition:this.saveScrollPosition,deleting:this.state.deleting===i.id,id:o,idx:s,instance:i,item:e,context:t},i.id)}:{category:e.category,render:(0,C.jsx)(N,{saveScrollPosition:this.saveScrollPosition,deleting:this.state.deleting===i.id,id:o,idx:s,instance:i,item:e,context:t},i.id)}}));if(!e.length)return(0,C.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,C.jsx)(K,{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: ${t}`),{}))).then((t=>{this._cacheList=null,this.setState({hostData:t})}));const e=await this.props.socket.getState(`${this.state.currentHost}.memAvailable`),s=await this.props.socket.getState(`${this.state.currentHost}.freemem`),o=await this.props.socket.getObject(`${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,C.jsx)(U,{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,C.jsx)(i.LinearProgress,{});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 t=this.state.instances[this.state.dialogProp]||null;if(t)return(0,C.jsxs)(i.Paper,{style:Y.paper,children:[this.renderFilterDialog(),(0,C.jsx)(c.A,{adapter:t.id.split(".")[0],adminInstance:this.props.adminInstance,style:Y.iframe,configStored:this.props.configStored,dateFormat:this.props.dateFormat,icon:t.image,instance:parseInt(t.id.split(".")[1]),isFloatComma:this.props.isFloatComma,jsonConfig:t.jsonConfig,lang:this.props.lang,materialize:t.materialize,socket:this.props.socket,t:this.t,theme:this.props.theme,themeName:this.props.themeName,themeType:this.props.themeType,width:this.props.width,version:t.version,onRegisterIframeRef:t=>this.props.onRegisterIframeRef(t),onUnregisterIframeRef:t=>this.props.onUnregisterIframeRef(t)})]})}else Q.lastScrollPosition&&(setTimeout((t=>{var e,s;null!==(e=this.refTabContent.current)&&void 0!==e&&e.parentNode&&((null===(s=this.refTabContent.current)||void 0===s?void 0:s.parentNode).scrollTop=t)}),200,Q.lastScrollPosition),Q.lastScrollPosition=0);this.shouldUpdateAfterDialogClosed&&(this.shouldUpdateAfterDialogClosed=!1,this.statesUpdateTimer||this.statesUpdateTimer||(this.statesUpdateTimer=setTimeout((()=>{this.statesUpdateTimer=null,this.forceUpdate()}),300)));const t=this.state.hostData?`${this.state.hostData["Disk free"]?`${this.t("Disk free")}: ${Math.round(this.state.hostData["Disk free"]/(this.state.hostData["Disk size"]/100))}%, `:""}${this.t("Total RAM usage")}: ${this.state.mem} Mb / ${this.t("Free")}: ${this.state.percent}% = ${this.state.memFree} Mb [${this.t("Host")}: ${this.props.currentHostName} - ${this.state.processes} ${1===this.state.processes?this.t("process"):this.t("processes")}]`:null;return(0,C.jsxs)(a.TabContainer,{children:[this.renderFilterDialog(),(0,C.jsxs)(a.TabHeader,{children:[(0,C.jsx)(i.Tooltip,{title:this.t("Show / hide List"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.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,C.jsx)(n.ViewModule,{}):(0,C.jsx)(n.ViewList,{})})}),!this.state.viewMode&&(0,C.jsx)(i.Tooltip,{title:this.t("Category"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"large",onClick:()=>{this.setState({viewCategory:!this.state.viewCategory}),this.localStorage.setItem("Instances.viewCategory",this.state.viewCategory?"false":"true")},children:(0,C.jsx)(n.List,{color:this.state.viewCategory?"primary":"inherit"})})}),!this.state.viewMode&&this.state.viewCategory&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(i.Tooltip,{title:this.t("expand all"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.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,C.jsx)(n.FolderOpen,{})})}),(0,C.jsx)(i.Tooltip,{title:this.t("collapse all"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"large",onClick:()=>{this.localStorage.removeItem("Instances.expandedFolder"),this.setState({expandedFolder:[]})},children:(0,C.jsx)(n.Folder,{})})})]}),(0,C.jsx)(i.Tooltip,{title:this.t("Reload"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"large",onClick:()=>this.getData(!0),children:(0,C.jsx)(n.Refresh,{})})}),this.props.hosts.length>1?(0,C.jsx)(i.Tooltip,{title:this.t("Show instances only for current host"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"large",onClick:()=>{this.setState({onlyCurrentHost:!this.state.onlyCurrentHost}),this.localStorage.setItem("Instances.onlyCurrentHost",this.state.onlyCurrentHost?"false":"true")},children:(0,C.jsx)(n.Devices,{color:this.state.onlyCurrentHost?"primary":"inherit"})})}):null,(0,C.jsx)(i.Tooltip,{title:this.t(this.state.playArrow?1===this.state.playArrow?"Showed only running instances":"Showed only stopped instances":"Show running or stopped instances"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"large",onClick:()=>this.changeStartedStopped(),children:(0,C.jsx)(n.PlayArrow,{style:2===this.state.playArrow?{color:"red"}:null,color:1===this.state.playArrow?"primary":"inherit"})})}),(0,C.jsx)(i.Tooltip,{title:this.t("Filter instances"),slotProps:{popper:{sx:Y.tooltip}},children:(0,C.jsx)(i.IconButton,{size:"large",onClick:()=>this.setState({showFilterDialog:!0}),sx:this.state.filterMode||this.state.filterStatus?Y.filterActive:void 0,children:(0,C.jsx)(r.YsJ,{style:{width:16,height:16}})})}),this.props.expertMode&&this.state.compact?(0,C.jsx)(H.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,C.jsx)(n.ViewCompact,{style:{marginRight:4},color:"primary"}),onClick:t=>this.changeCompactGroup(t),value:this.state.filterCompactGroup}):null,(0,C.jsx)("div",{style:Y.grow}),(0,C.jsx)(i.TextField,{variant:"standard",inputRef:this.inputRef,label:this.t("Filter"),sx:{margin:{xs:"0 0 2px 16px",md:"5px 0 5px 0"}},defaultValue:this.state.filterText,onChange:t=>this.handleFilterChange(t),slotProps:{input:{endAdornment:this.state.filterText?(0,C.jsx)(i.InputAdornment,{position:"end",children:(0,C.jsx)(i.IconButton,{size:"small",onClick:()=>{this.inputRef.current.value="",this._cacheList=null,this.setState({filterText:""}),this.localStorage.setItem("instances.filter","")},children:(0,C.jsx)(n.Close,{})})}):null}}}),(0,C.jsx)("div",{style:Y.grow}),(0,C.jsx)(i.Box,{component:"span",sx:{display:{xs:"none",sm:"inline-block"}},children:t})]}),(0,C.jsx)(a.TabContent,{overflow:"auto",children:(0,C.jsx)("div",{ref:this.refTabContent,style:this.state.viewMode?Y.cards:void 0,children:this.getPanels()})})]})}}Q.lastScrollPosition=0;const X=(0,a.withWidth)()(Q)},21296:()=>{}}]);
|
|
2
|
+
//# sourceMappingURL=471.07237cb8.chunk.js.map
|