iobroker.eos-admin 8.0.1 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NEXOWATT_EOS_BUILD_INFO.json +3 -3
- package/NEXOWATT_EOS_PREBUILT_MANIFEST.json +102 -96
- package/START_HERE_8.0.2.md +41 -0
- package/adminWww/.vite/manifest.json +278 -278
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +333 -329
- package/adminWww/assets/{AccessTime-Dpa6PKHY.js → AccessTime-5f47qrw7.js} +1 -1
- package/adminWww/assets/{AceEditor-DTzNaeVy.js → AceEditor-CJ-_Ev2E.js} +1 -1
- package/adminWww/assets/{AdapterUpdateDialog-D3y2bGHM.js → AdapterUpdateDialog-QwlPbETd.js} +3 -3
- package/adminWww/assets/Adapters-gKngfaOu.js +7 -0
- package/adminWww/assets/{AdminUtils-DDT_kD8H.js → AdminUtils-CopxRJZ2.js} +1 -1
- package/adminWww/assets/{Apps-C8LE9l6Z.js → Apps-BKnx1gzD.js} +1 -1
- package/adminWww/assets/{Book-QmHxDaHb.js → Book-DrhneQH0.js} +1 -1
- package/adminWww/assets/{Cached-f77QQBQD.js → Cached-XJmxLN4E.js} +1 -1
- package/adminWww/assets/{Computer-DFIUq-fL.js → Computer-DDMBRY5r.js} +1 -1
- package/adminWww/assets/{Config-BZDUILCW.js → Config-BwTa1LdH.js} +1 -1
- package/adminWww/assets/{ConfigManager-BMdQoiCg.js → ConfigManager-DYwC4yq9.js} +1 -1
- package/adminWww/assets/{CustomModal-B8vdCRn1.js → CustomModal-DjI4oCb8.js} +1 -1
- package/adminWww/assets/{CustomTab-DSPqif6P.js → CustomTab-_HYUrXsZ.js} +1 -1
- package/adminWww/assets/{DeleteForever-BnEM-6_v.js → DeleteForever-Caoe64_y.js} +1 -1
- package/adminWww/assets/EasyMode-CCRqFtQq.js +1 -0
- package/adminWww/assets/Enums-BTurn3-x.js +92 -0
- package/adminWww/assets/{Extension-DU1jqvic.js → Extension-D-tNJv4S.js} +1 -1
- package/adminWww/assets/{Fields-Df7Llf6U.js → Fields-C2Bn4V04.js} +1 -1
- package/adminWww/assets/{Files-Bwbw17Fb.js → Files-XdmhxGOR.js} +1 -1
- package/adminWww/assets/Hosts-DiTMe9fw.js +120 -0
- package/adminWww/assets/{InfoOutlined-l86Si1qa.js → InfoOutlined-DIGDQvu6.js} +1 -1
- package/adminWww/assets/Instances-DA6FIgRs.js +4 -0
- package/adminWww/assets/Intro-CJpwLg8Q.js +2 -0
- package/adminWww/assets/{KeyboardArrowRight-zZUJhG9e.js → KeyboardArrowRight-DVPBjTKi.js} +1 -1
- package/adminWww/assets/Logs-CA0mEMlO.js +2 -0
- package/adminWww/assets/{MoreHoriz-CR2kD-dc.js → MoreHoriz-BYaCptH0.js} +1 -1
- package/adminWww/assets/Objects-B2IC3Bce.js +301 -0
- package/adminWww/assets/{Overview-CDvnM655.js → Overview-HG8fAMFM.js} +2 -2
- package/adminWww/assets/{Pageview-DBITLOzI.js → Pageview-DFHddrKX.js} +1 -1
- package/adminWww/assets/{PersonOff-ANdO5Nu4.js → PersonOff-BwYQLD1M.js} +1 -1
- package/adminWww/assets/{PushPinOutlined-DvxsqPHo.js → PushPinOutlined-CEBeTmNm.js} +1 -1
- package/adminWww/assets/Remove-BPxvNccW.js +1 -0
- package/adminWww/assets/{Schedule-BMMrgd7j.js → Schedule-BQlh1nhQ.js} +1 -1
- package/adminWww/assets/{Star-DNdm064z.js → Star-ChMjBwLn.js} +1 -1
- package/adminWww/assets/State-UGfoS6qW.js +1 -0
- package/adminWww/assets/Storage-DrC3j-wf.js +1 -0
- package/adminWww/assets/{TextSnippet-Bywi1YuG.js → TextSnippet-BQ4TSmvS.js} +1 -1
- package/adminWww/assets/{Timeline-IQCnSLiw.js → Timeline-CEyldmz2.js} +1 -1
- package/adminWww/assets/{Timer-Be9yF62g.js → Timer-I0twtyWh.js} +1 -1
- package/adminWww/assets/{UnfoldMore-Du7-8wYn.js → UnfoldMore-_DDSfPKk.js} +1 -1
- package/adminWww/assets/{Usb-Ca47vqRv.js → Usb-Dwk7qdYu.js} +1 -1
- package/adminWww/assets/{UsedResources-BIdU7UPm.js → UsedResources-B6HWeXGX.js} +2 -2
- package/adminWww/assets/Users-DFeYuC5y.js +1 -0
- package/adminWww/assets/{ViewCompact-C3SC0jFF.js → ViewCompact-BbfomOIi.js} +1 -1
- package/adminWww/assets/ViewList-1pB5VinA.js +1 -0
- package/adminWww/assets/{ViewSidebar-kHvah-XS.js → ViewSidebar-DdedDirX.js} +1 -1
- package/adminWww/assets/{VpnKey-iMA7KrB-.js → VpnKey-o8QeqmnU.js} +1 -1
- package/adminWww/assets/{WifiTethering-Da8nW7Do.js → WifiTethering-Cp63fmkC.js} +1 -1
- package/adminWww/assets/{_virtual_mf-localSharedImportMap___mfe_internal__iobroker_admin__mf_owner__1-CpelrCgN.js → _virtual_mf-localSharedImportMap___mfe_internal__iobroker_admin__mf_owner__1-uaKFfE5p.js} +1 -1
- package/adminWww/assets/{bootstrap-D-7xcwTc.js → bootstrap-DSDOwKWU.js} +33 -33
- package/adminWww/assets/{date-fns-Bpgjk9P-.js → date-fns-ukillHs-.js} +1 -1
- package/adminWww/assets/helpers-CDcY0YJ-.js +1 -0
- package/adminWww/assets/{hostInit-huY-0clu.js → hostInit-Cd61hJHh.js} +1 -1
- package/adminWww/assets/{icons-material-Bu1f45BT.js → icons-material-Dms1APQk.js} +1 -1
- package/adminWww/assets/{index-D8vmzGp8.js → index-D6uhIclX.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-BkdptYag.js → installSVGRenderer-BR-zIijZ.js} +1 -1
- package/adminWww/assets/{lib-CE1B3iHH.js → lib-BZRGBDoe.js} +2 -2
- package/adminWww/assets/{loadShare-eager-CRNcc8D7.js → loadShare-eager-BpwDZfDr.js} +93 -93
- package/adminWww/assets/{mf-entry-bootstrap-0-f6098d8b.js → mf-entry-bootstrap-0-2d631020.js} +3 -3
- package/adminWww/assets/{pendingShares-CuQbFsaK.js → pendingShares-D1Vr_qYv.js} +2 -2
- package/adminWww/assets/{sentry-B4uGc7ut.js → sentry-BFzW-2KQ.js} +1 -1
- package/adminWww/assets/{setYear-DurmWw03.js → setYear-DhVdgUBF.js} +1 -1
- package/adminWww/css/nexowatt-native-shell.css +72 -0
- package/adminWww/index.html +21 -21
- package/adminWww/js/eos-license-link.js +9 -16
- package/adminWww/js/nexowatt-native-shell.js +2 -2
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/{remoteEntry-eos-8.0.1.js → remoteEntry-eos-8.0.2.js} +2 -2
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/web.js +25 -5
- package/build/lib/web.js.map +1 -1
- package/docs/ADMIN8_MIGRATION_8.0.0_DE.md +2 -0
- package/docs/cra/CRA_IEC_GAP_ANALYSIS_2026-09-30.md +5 -0
- package/docs/security/admin8-2026-11-04/development-1.log +4 -4
- package/docs/security/admin8-2026-11-04/development-2.log +275 -248
- package/docs/security/admin8-2026-11-05/system-fix/BACKEND_ROLE_REVIEW_DE.md +79 -0
- package/docs/security/admin8-2026-11-05/system-fix/NAVIGATION_DE.md +30 -0
- package/docs/security/admin8-2026-11-05/system-fix/REPORT_DE.md +51 -0
- package/docs/security/admin8-2026-11-05/system-fix/REVIEW_DE.md +65 -0
- package/docs/security/admin8-2026-11-05/system-fix/SCOPE_DE.md +21 -0
- package/docs/security/admin8-2026-11-05/system-fix/SYSTEM_DE.md +44 -0
- package/docs/security/admin8-2026-11-05/system-fix/archive-scan.json +12 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/README.md +46 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/integrity.json +16 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/system-browser-result.json +3607 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/system-browser.cjs +221 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/system-fixture.cjs +60 -0
- package/docs/security/admin8-2026-11-05/system-fix/evidence-sha256.json +49 -0
- package/docs/security/admin8-2026-11-05/system-fix/license-ui-tests-node22.log +80 -0
- package/docs/security/admin8-2026-11-05/system-fix/license-ui-tests-node24.log +19 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/lint.log +0 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/node22-tests.log +56 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/node24-tests.log +15 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/source-sha256.json +11 -0
- package/docs/security/admin8-2026-11-05/system-fix/path-budget.json +7 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/artifacts.log +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/audit-root.json +22 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/audit-root.stderr +1 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/backend-build.log +5 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/clean.log +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-audit.json +22 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-audit.stderr +2 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-install.log +4 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-package-lock.json +3258 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/development.log +392 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/frontend-build.log +149 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/http-node22.json +15 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/http-node24.json +15 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/inventory.log +8 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/overlay-journal.json +452 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/overlay-publish.log +10790 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/overlay-validation.json +12 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/pack.json +8104 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/pack.stderr +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/retired-801.json +68 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/seal.log +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/review-tests.log +30 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-before.log +86 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-lint.log +0 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-node22.log +44 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-test.log +13 -0
- package/docs/security/admin8-2026-11-05/system-fix/validation.json +90 -0
- package/docs/third-party/admin8/NOTICE-PROVENANCE.json +1 -1
- package/io-package.json +9 -10
- package/package.json +3 -2
- package/release-manifests/admin8-development-validation.json +42 -32
- package/reports/security/artifact-inventory.json +561 -561
- package/reports/security/inventory-summary.json +7 -7
- package/reports/security/sbom-backend-lock.cdx.json +5 -5
- package/reports/security/sbom-frontend-lock.cdx.json +5 -5
- package/reports/security/source-runtime-manifest.json +155 -155
- package/tools/nexowatt-admin8-development-check.cjs +8 -1
- package/tools/nexowatt-installer-ems-selftest.cjs +1 -1
- package/tools/nexowatt-role-security-selftest.cjs +2 -2
- package/tools/nexowatt-user-area-selftest.cjs +1 -1
- package/tools/nexowatt-v7109-clean-core-selftest.cjs +1 -1
- package/tools/vendor/eos-retired-release-files.json +196 -1
- package/adminWww/assets/Adapters-WMGNQt7g.js +0 -7
- package/adminWww/assets/EasyMode-TwIN5yxu.js +0 -1
- package/adminWww/assets/Enums-CHm2sGa-.js +0 -92
- package/adminWww/assets/Hosts-BR0g-Wxo.js +0 -120
- package/adminWww/assets/Instances-BKydFSdw.js +0 -4
- package/adminWww/assets/Intro-Dt2GzmtW.js +0 -2
- package/adminWww/assets/Logs-hbcdBDN3.js +0 -2
- package/adminWww/assets/Objects-HPx0yuOk.js +0 -301
- package/adminWww/assets/Remove-DplJatnC.js +0 -1
- package/adminWww/assets/State-Cc-tyuqB.js +0 -1
- package/adminWww/assets/Storage-COo2RkS1.js +0 -1
- package/adminWww/assets/Users-BruHA-yU.js +0 -1
- package/adminWww/assets/ViewList-DuKCnBnc.js +0 -1
- package/adminWww/assets/helpers-DBoACUHw.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$s as e,As as t,Ds as n,Eo as r,Es as i,Fo as a,Ga as o,Gi as s,Go as c,Gr as l,Hi as u,Ho as d,Hs as f,Jo as p,Js as m,Ki as ee,Li as te,Mo as h,Ms as g,No as _,Oo as v,Qo as y,Rr as b,So as x,Tr as S,Ua as ne,Us as C,Vo as w,Wi as re,Wn as ie,Wr as T,Ws as E,Xi as D,Xn as O,Yo as ae,Zo as oe,_i as se,_o as k,_s as ce,ac as le,ba as ue,bo as A,cc as de,da as fe,dc as pe,ei as me,er as he,ho as j,hs as M,jo as N,js as ge,mc as P,mo as F,ms as _e,nc as ve,qa as I,qi as ye,qo as L,r as R,si as be,ss as xe,uo as z,vs as Se,wi as Ce,zo as B}from"./loadShare-eager-BpwDZfDr.js";import{t as we}from"./Apps-BKnx1gzD.js";import{t as Te}from"./Computer-DDMBRY5r.js";import{a as Ee,i as De,n as Oe,r as ke,t as Ae}from"./Timer-I0twtyWh.js";import{t as je}from"./Extension-D-tNJv4S.js";import{t as Me}from"./InfoOutlined-DIGDQvu6.js";import{t as Ne}from"./Schedule-BQlh1nhQ.js";import{t as Pe}from"./Storage-DrC3j-wf.js";import{c as Fe,f as Ie,l as Le,p as Re,s as ze,t as V}from"./AdminUtils-CopxRJZ2.js";import{ot as Be,yt as Ve}from"./bootstrap-DSDOwKWU.js";import{i as He,n as Ue,r as We,t as Ge}from"./classPrivateFieldGet2-CBZxMSQ4.js";var Ke=168;function qe(e,n){if(e)try{return t(e,n)}catch{return}}var H={root:{display:`flex`,maxWidth:460},link:e=>({display:`flex`,width:`100%`,color:`inherit`,borderRadius:`12px`,"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:`2px`}}),card:e=>({display:`flex`,flexDirection:`column`,gap:`12px`,width:`100%`,p:`16px`,position:`relative`,overflow:`hidden`,backgroundColor:e.palette.mode===`dark`?g(e.palette.background.paper,.08):ge(e.palette.background.paper,.03),border:`1px solid`,borderColor:e.palette.divider,backgroundImage:`none`,transition:`border-color 0.15s, background-color 0.15s`,"@media (prefers-reduced-motion: reduce)":{transition:`none`}}),cardClickable:{cursor:`pointer`,"&:hover .intro-card-launch":{opacity:1}},cardOff:e=>({opacity:.45,borderStyle:`dashed`,borderColor:e.palette.text.disabled}),head:{display:`flex`,alignItems:`flex-start`,gap:`14px`},icon:{width:56,height:56,flex:`0 0 auto`,borderRadius:`14px`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`},iconOffline:{filter:`grayscale(1)`,opacity:.5},img:{width:40,height:40,objectFit:`contain`},headText:{minWidth:0,flex:1,display:`flex`,flexDirection:`column`,gap:`2px`,pr:`20px`},title:{fontSize:`0.98rem`,fontWeight:600,lineHeight:1.25,display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:2,overflow:`hidden`,wordBreak:`break-word`},meta:e=>({fontSize:`0.78rem`,lineHeight:1.35,color:e.palette.text.secondary,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}),warning:e=>({fontSize:17,ml:`4px`,verticalAlign:`-3px`,color:e.palette.warning.main}),corner:{position:`absolute`,top:16,right:16,zIndex:2,display:`flex`,alignItems:`center`,gap:`8px`},launch:e=>({fontSize:17,opacity:0,color:e.palette.text.secondary,transition:`opacity 0.15s`,"@media (prefers-reduced-motion: reduce)":{transition:`none`}}),lamp:{width:10,height:10,borderRadius:`50%`,flex:`0 0 auto`},lampOnline:e=>({backgroundColor:e.palette.success.main,boxShadow:`0 0 0 3px ${t(e.palette.success.main,.2)}`}),lampOffline:e=>({backgroundColor:e.palette.error.main,boxShadow:`0 0 0 3px ${t(e.palette.error.main,.2)}`}),lampUnknown:e=>({backgroundColor:e.palette.text.disabled}),content:e=>({flex:1,minHeight:0,overflow:`hidden`,fontSize:`0.82rem`,lineHeight:1.5,color:e.palette.text.secondary}),contentClamped:{display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:3},infoButton:{alignSelf:`flex-start`,ml:`-6px`,fontSize:`0.78rem`,minHeight:0,py:`2px`},editBar:e=>({position:`absolute`,top:8,right:8,zIndex:3,display:`flex`,gap:`2px`,borderRadius:`10px`,p:`2px`,backgroundColor:t(e.palette.background.paper,.85),backdropFilter:`blur(3px)`}),tooltip:{pointerEvents:`none`},infoTitle:{display:`flex`,alignItems:`center`,gap:`8px`,pr:`12px`},infoTitleText:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},infoBody:{fontSize:`0.9rem`,lineHeight:1.5}},U=class e extends ve{constructor(e){super(e),this.state={infoOpen:!1}}static getDerivedStateFromProps(e){return e.edit?{infoOpen:!1}:null}renderContent(){return this.props.children}openDialog(){}renderDialogs(){return null}hoverTint(e){let t=qe(e,this.props.theme.palette.mode===`dark`?.12:.07);return t?`linear-gradient(${t}, ${t})`:void 0}cardMinHeight(){return Ke}static swallow(e,t){e.preventDefault(),e.stopPropagation(),t==null||t()}renderEditBar(){return this.props.edit?E(k,{sx:H.editBar,children:[this.props.toggleActivation?C(F,{title:this.props.t(`show/hide item`),slotProps:{popper:{sx:H.tooltip}},children:C(L,{size:`small`,color:this.props.enabled?`primary`:`default`,onClick:t=>e.swallow(t,this.props.toggleActivation),children:C(o,{fontSize:`small`})})}):null,this.props.onEdit?C(F,{title:this.props.t(`Edit`),slotProps:{popper:{sx:H.tooltip}},children:C(L,{size:`small`,onClick:t=>e.swallow(t,this.props.onEdit),children:C(Ee,{fontSize:`small`})})}):null,this.props.onRemove?C(F,{title:this.props.t(`Delete`),slotProps:{popper:{sx:H.tooltip}},children:C(L,{size:`small`,color:`error`,onClick:t=>e.swallow(t,this.props.onRemove),children:C(ne,{fontSize:`small`})})}):null]}):null}renderInfoDialog(){var e,t;if(!this.props.showInfo||!this.state.infoOpen)return null;let n=(e=(t=this.props).getHostDescriptionAll)==null?void 0:e.call(t),r=()=>this.setState({infoOpen:!1});return E(N,{open:!0,onClose:r,maxWidth:`sm`,fullWidth:!0,onClick:e=>e.stopPropagation(),children:[E(a,{sx:H.infoTitle,children:[C(Me,{color:`primary`}),E(k,{sx:H.infoTitleText,children:[this.props.t(`Info`),`: `,this.props.title]}),C(L,{size:`small`,onClick:r,children:C(I,{})})]}),C(_,{dividers:!0,sx:H.infoBody,children:n==null?void 0:n.el}),E(h,{children:[C(A,{color:`grey`,variant:`outlined`,startIcon:C(he,{}),disabled:!(n!=null&&n.text),onClick:()=>{var e,t;l.copyToClipboard((n==null?void 0:n.text)||``),(e=(t=this.props).openSnackBarFunc)==null||e.call(t)},children:this.props.t(`Copy to clipboard`)}),C(A,{variant:`contained`,color:`primary`,autoFocus:!0,startIcon:C(I,{}),onClick:r,children:this.props.t(`Close`)})]})]})}render(){var t,n,r;let{theme:i}=this.props,a=this.props.color||i.palette.primary.main,o=!this.props.edit&&!!((t=this.props.action)!=null&&t.link)&&!this.props.unreachable,s=V.getText((n=this.props.action)==null?void 0:n.text,this.props.lang),u=``;if((r=this.props.action)!=null&&r.link)try{u=new URL(this.props.action.link,window.location.href).href}catch{u=this.props.action.link}return C(c,{size:{xs:12,sm:6,md:4,lg:3,xl:2},sx:l.getStyle(i,H.root,this.props.style),children:C(y,{href:o?this.props.action.link:void 0,underline:`none`,target:`_blank`,rel:`noopener noreferrer`,sx:l.getStyle(i,H.link),children:E(x,{sx:l.getStyle(i,H.card,{minHeight:this.cardMinHeight()},o&&H.cardClickable,o&&{"&:hover":{borderColor:qe(a,.7)||a,backgroundImage:this.hoverTint(a)}},this.props.edit&&!this.props.enabled&&H.cardOff,this.props.unreachable&&H.cardOff),onClick:e=>{e.stopPropagation(),this.openDialog()},children:[E(k,{sx:H.head,children:[C(k,{sx:l.getStyle(i,H.icon,{backgroundColor:this.props.color||qe(i.palette.text.primary,.07)},(this.props.offline||this.props.unreachable)&&H.iconOffline),children:C(k,{component:`img`,src:this.props.image,alt:``,sx:H.img})}),E(k,{sx:H.headText,children:[E(j,{component:`div`,sx:H.title,children:[this.props.title,this.props.warning||this.props.unreachable?C(F,{title:this.props.warning||this.props.t(`Only reachable in the local network`),slotProps:{popper:{sx:H.tooltip}},children:C(be,{sx:H.warning})}):null]}),s?C(j,{component:`div`,sx:H.meta,title:u||s,children:s}):null]})]}),o||this.props.status?E(k,{sx:H.corner,children:[o?C(ie,{className:`intro-card-launch`,sx:H.launch}):null,this.props.status?C(F,{title:this.props.t(this.props.status===`unknown`?`unknown`:this.props.status),slotProps:{popper:{sx:H.tooltip}},children:C(k,{sx:l.getStyle(i,H.lamp,this.props.status===`online`&&H.lampOnline,this.props.status===`offline`&&H.lampOffline,this.props.status===`unknown`&&H.lampUnknown)})}):null]}):null,C(k,{sx:l.getStyle(i,H.content,typeof this.props.children==`string`&&H.contentClamped),children:this.renderContent()}),this.props.showInfo&&!this.props.offline?C(A,{sx:H.infoButton,size:`small`,color:`inherit`,startIcon:C(Me,{fontSize:`small`}),disabled:this.props.disabled,onClick:t=>e.swallow(t,()=>this.setState({infoOpen:!0})),children:this.props.t(`Info`)}):null,this.renderInfoDialog(),this.renderEditBar(),this.renderDialogs()]})})})}};n();var W={rootGrid:{flexGrow:1},closeButton:e=>({position:`absolute`,right:8,top:8,color:e.palette.grey[500]}),paper:{},typography:{paddingRight:30},img:{width:`100%`,height:`100%`,objectFit:`contain`}},Je=class extends ve{constructor(t){super(t),i(this,`cameraUpdateTimer`,void 0),i(this,`cameraRef`,void 0),this.cameraUpdateTimer=null,this.cameraRef=e()}componentDidMount(){this.props.camera&&this.props.camera!==`text`&&(this.cameraUpdateTimer=setInterval(()=>this.updateCamera(),Math.max(parseInt(this.props.interval||``,10),500)),this.updateCamera())}componentWillUnmount(){this.cameraUpdateTimer&&=(clearInterval(this.cameraUpdateTimer),null)}updateCamera(){if(this.cameraRef.current){if(this.props.camera===`custom`){let e=this.props.cameraUrl;this.props.addTs&&(e.includes(`?`)?e+=`&ts=${Date.now()}`:e+=`?ts=${Date.now()}`),this.cameraRef.current.src=e}else{let e=this.props.camera.split(`.`),t=e.shift(),n=e.shift();this.props.socket.sendTo(`${t}.${n}`,`image`,{name:e.pop(),width:this.cameraRef.current.width}).then(e=>{e&&e.data&&this.cameraRef.current&&(this.cameraRef.current.src=`data:image/jpeg;base64,${e.data}`)})}}}render(){return E(N,{onClose:()=>this.props.onClose(),open:!0,maxWidth:`xl`,fullWidth:!0,fullScreen:!0,sx:{"& .MuiDialog-paper":W.paper},children:[C(a,{children:E(j,{component:`h2`,variant:`h6`,sx:{"&.MuiTypography-root":W.typography},children:[this.props.name,C(L,{size:`large`,sx:W.closeButton,onClick:()=>this.props.onClose(),children:C(I,{})})]})}),C(_,{dividers:!0,children:C(`img`,{style:W.img,src:``,alt:`camera`,ref:this.cameraRef})}),C(h,{children:C(A,{variant:`contained`,autoFocus:!0,onClick:e=>{e.stopPropagation(),this.props.onClose()},color:`primary`,startIcon:C(I,{}),children:this.props.t(`Close`)})})]})}};n();var G={cameraImg:{width:`100%`,height:`100%`,objectFit:`contain`,borderRadius:8},imgContainer:{height:`100%`,width:`100%`},hidden:{display:`none`},imgSkeleton:{transform:`initial`}},Ye=class extends U{constructor(t){super(t),i(this,`cameraRef`,void 0),i(this,`cameraUpdateTimer`,void 0),i(this,`interval`,void 0),Object.assign(this.state,{error:!1,dialog:!1,loaded:!1}),this.cameraRef=e(),this.cameraUpdateTimer=null,this.interval=t.interval||0}updateCamera(){if(this.cameraRef.current){if(this.props.camera===`custom`){let e=this.props.cameraUrl||``;this.props.addTs&&(e.includes(`?`)?e+=`&ts=${Date.now()}`:e+=`?ts=${Date.now()}`),this.cameraRef.current.src=e}else{let e=(this.props.camera||``).split(`.`),t=e.shift(),n=e.shift();this.props.socket.sendTo(`${t}.${n}`,`image`,{name:e.pop(),width:this.cameraRef.current.width}).then(e=>{e!=null&&e.data&&this.cameraRef.current&&(this.cameraRef.current.src=`data:image/jpeg;base64,${e.data}`)}).catch(e=>window.alert(`Cannot send to instance: ${e}`))}}}componentDidMount(){this.props.camera&&this.props.camera!==`text`&&(this.cameraUpdateTimer=setInterval(()=>this.updateCamera(),Math.max(parseInt(this.props.interval,10),500)),this.updateCamera())}componentWillUnmount(){this.cameraUpdateTimer&&=(clearInterval(this.cameraUpdateTimer),null)}cardMinHeight(){return 260}renderDialogs(){return this.state.dialog?C(Je,{socket:this.props.socket,camera:this.props.camera||``,name:this.props.title,t:this.props.t,onClose:()=>{this.props.camera&&this.props.camera!==`text`&&(this.cameraUpdateTimer&&clearInterval(this.cameraUpdateTimer),this.cameraUpdateTimer=setInterval(()=>this.updateCamera(),Math.max(parseInt(this.props.interval,10),500)),this.updateCamera()),this.setState({dialog:!1})},cameraUrl:this.props.cameraUrl||``}):null}handleImageLoad(){this.state.loaded||this.setState({loaded:!0,error:!1})}handleImageError(){this.state.error||this.setState({loaded:!1,error:!0})}renderContent(){var e;if(this.props.camera===`custom`){let e=this.props.cameraUrl||``;return this.props.addTs&&(e.includes(`?`)?e+=`&ts=${Date.now()}`:e+=`?ts=${Date.now()}`),E(c,{container:!0,style:G.imgContainer,sx:{alignItems:`center`,justifyContent:`center`},children:[C(`img`,{ref:this.cameraRef,src:e,alt:`Camera`,style:this.state.loaded&&!this.state.error?G.cameraImg:G.hidden,onLoad:()=>this.handleImageLoad(),onError:()=>this.handleImageError()}),!this.state.loaded&&!this.state.error&&C(M,{height:`100%`,width:`100%`,animation:`wave`,style:G.imgSkeleton}),this.state.error&&C(se,{fontSize:`large`})]})}return(e=this.props.camera)!=null&&e.startsWith(`cameras.`)?C(`img`,{ref:this.cameraRef,src:``,alt:`camera`,style:G.cameraImg}):null}render(){return this.props.camera&&this.props.camera!==`text`?this.interval!==this.props.interval&&(this.interval=this.props.interval||0,this.cameraUpdateTimer&&clearInterval(this.cameraUpdateTimer),this.cameraUpdateTimer=setInterval(()=>this.updateCamera(),Math.max(parseInt(this.props.interval,10),500))):this.cameraUpdateTimer&&=(clearInterval(this.cameraUpdateTimer),null),super.render()}};n();var K={formControl:{marginTop:32},rootGrid:{flexGrow:1},closeButton:e=>({position:`absolute`,right:8,top:8,color:e.palette.grey[500]}),paper:{},typography:{paddingRight:30},editItem:{marginTop:8},editItemSlider:{marginTop:24},labelSlider:{marginTop:16,fontSize:`1rem`},editColor:{width:`100%`},dropZone:{width:`100%`,height:100,position:`relative`},dropZoneEmpty:{},image:{height:`100%`,width:`auto`,objectFir:`contain`},uploadDiv:{position:`relative`,width:`100%`,height:100,opacity:.9},uploadDivDragging:{opacity:1},uploadCenterDiv:{margin:5,border:`3px dashed grey`,borderRadius:5,width:`calc(100% - 10px)`,height:`calc(100% - 10px)`,position:`relative`},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:`center`,position:`absolute`,top:0,bottom:0,left:0,right:0}},Xe=class e extends ve{constructor(e){super(e),i(this,`originalData`,void 0),this.state={image:``,name:e.t(`New link`),link:`http://`,linkName:``,color:``,desc:``,addTs:!0,interval:5e3,camera:`text`,cameraList:[],...e.link},this.originalData=JSON.stringify(this.getData())}getData(){return{link:this.state.link,name:this.state.name,desc:this.state.desc,linkName:this.state.linkName,color:this.state.color,image:this.state.image,addTs:this.state.addTs,camera:this.state.camera,interval:this.state.interval}}componentDidMount(){this.getCamerasInstances()}getCamerasInstances(){this.props.socket.getAdapterInstances(`cameras`,!0).then(e=>{let t=[],n=[];e.forEach(e=>{let r=e._id.replace(`system.adapter.`,``);e.common&&e.common.enabled&&n.push(this.props.socket.getState(`${e._id}.alive`).then(e=>e&&e.val&&this.props.socket.sendTo(r,`list`,null)).then(e=>e&&e.list&&e.list.forEach(e=>t.push({id:e.id,name:`${e.desc} [${r}/${e.name}]`}))))}),Promise.all(n).then(()=>this.setState({cameraList:t}))})}static getLinkNameFromLink(e){let t=e.trim().match(/^https?:\/\/([^/:]+)(:\d+)?/);return t?t[1]+(t[2]||``):``}render(){return E(N,{onClose:()=>this.props.onClose(),open:!0,maxWidth:`md`,fullWidth:!0,sx:{"& .MuiDialog-paper":K.paper},children:[C(a,{children:E(j,{component:`h2`,variant:`h6`,sx:{"&.MuiTypography-root":K.typography},children:[this.props.isNew?this.props.t(`Add new link: `):this.props.t(`Edit link`),C(L,{size:`large`,sx:K.closeButton,onClick:()=>this.props.onClose(),children:C(I,{})})]})}),C(_,{dividers:!0,children:E(c,{style:K.rootGrid,container:!0,direction:`row`,children:[C(c,{size:{xs:12,sm:6,md:8,lg:9},children:E(c,{container:!0,sx:{flexDirection:`column`},children:[E(w,{variant:`standard`,style:K.formControl,children:[C(ae,{id:`select-helper-label`,children:this.props.t(`Link type`)}),E(_e,{variant:`standard`,labelId:`select-helper-label`,value:this.state.camera,onChange:e=>this.setState({camera:e.target.value}),children:[C(xe,{value:`text`,children:C(`em`,{children:this.props.t(`Description`)})},`desc`),this.state.cameraList.map(e=>C(xe,{value:e.id,children:e.name},e.id)),C(xe,{value:`custom`,children:this.props.t(`Custom camera URL`)},`custom`)]})]}),C(z,{variant:`standard`,label:this.props.t(`URL`),value:this.state.link,style:K.editItem,onChange:t=>{let n=e.getLinkNameFromLink(this.state.link);n&&(!this.state.linkName||n===this.state.linkName)?this.setState({link:t.target.value,linkName:e.getLinkNameFromLink(t.target.value)}):this.setState({link:t.target.value})},slotProps:{input:{endAdornment:this.state.link?C(p,{position:`end`,children:C(L,{tabIndex:-1,size:`small`,onClick:()=>this.setState({link:``}),children:C(I,{})})}):null}}}),C(z,{variant:`standard`,style:K.editItem,label:this.props.t(`Name`),value:this.state.name||``,onChange:e=>this.setState({name:e.target.value}),slotProps:{input:{endAdornment:this.state.name?C(p,{position:`end`,children:C(L,{tabIndex:-1,size:`small`,onClick:()=>this.setState({name:``}),children:C(I,{})})}):null}}}),this.state.link?C(z,{variant:`standard`,style:K.editItem,label:this.props.t(`Link name`),value:this.state.linkName||``,onChange:e=>this.setState({linkName:e.target.value}),slotProps:{input:{endAdornment:this.state.linkName?C(p,{position:`end`,children:C(L,{tabIndex:-1,size:`small`,onClick:()=>this.setState({linkName:``}),children:C(I,{})})}):null}}}):null,this.state.camera===`custom`||this.state.camera===`text`?C(z,{variant:`standard`,style:K.editItem,label:this.state.camera===`custom`?this.props.t(`Camera URL`):this.props.t(`Description`),value:this.state.desc||``,onChange:e=>this.setState({desc:e.target.value}),slotProps:{input:{endAdornment:this.state.desc?C(p,{position:`end`,children:C(L,{tabIndex:-1,size:`small`,onClick:()=>this.setState({desc:``}),children:C(I,{})})}):null}}}):null,this.state.camera===`custom`?C(d,{style:K.editItem,control:C(r,{checked:this.state.addTs,onChange:e=>this.setState({addTs:e.target.checked})}),label:this.props.t(`Add timestamp to URL`)}):null,this.state.camera===`text`?null:C(j,{style:K.labelSlider,gutterBottom:!0,children:`Polling interval in ms`}),this.state.camera===`text`?null:C(ce,{style:K.editItemSlider,value:this.state.interval,getAriaValueText:()=>`${this.state.interval}ms`,onChange:(e,t)=>this.setState({interval:t}),step:100,min:500,max:6e4,valueLabelDisplay:`on`}),C(`div`,{style:{...K.editItem,width:50},children:C(z,{variant:`standard`,fullWidth:!0,label:this.props.t(`Color`),style:K.editColor,type:`color`,value:this.state.color,onChange:e=>this.setState({color:e.target.value})})}),C(T,{disabled:!1,crop:!0,maxSize:262144,icon:this.state.image,removeIconFunc:()=>this.setState({image:``}),onChange:e=>this.setState({image:e})})]})}),C(c,{size:{xs:12,sm:6,md:4,lg:3},children:this.state.camera===`text`?C(U,{image:this.state.image,title:this.state.name,action:{link:this.state.link,text:this.state.linkName},t:this.props.t,lang:this.props.lang,style:{width:`100% !important`,maxWidth:`100% !important`,marginLeft:`8px`},color:this.state.color,enabled:!0,theme:this.props.theme,children:this.state.desc}):C(Ye,{interval:this.state.interval,camera:this.state.camera,addTs:this.state.addTs,style:{width:`100% !important`,maxWidth:`100% !important`,marginLeft:`8px`},image:this.state.image,title:this.state.name,socket:this.props.socket,action:{link:this.state.link,text:this.state.linkName},t:this.props.t,lang:this.props.lang,color:this.state.color,enabled:!0,cameraUrl:this.state.desc,theme:this.props.theme})})]})}),E(h,{children:[C(A,{variant:`contained`,autoFocus:!0,onClick:()=>this.props.onClose(this.getData()),disabled:!this.props.isNew&&JSON.stringify(this.getData())===this.originalData,color:`primary`,startIcon:this.props.isNew?C(Ce,{}):C(o,{}),children:this.props.isNew?this.props.t(`Add`):this.props.t(`Save`)}),C(A,{variant:`contained`,onClick:()=>this.props.onClose(),color:`grey`,startIcon:C(I,{}),children:this.props.t(`Close`)})]})]})}},Ze=class extends m.Component{constructor(e){super(e),this.state={inProgress:!1,success:!1,error:``,finished:!1}}render(){return E(N,{open:!0,maxWidth:`lg`,fullWidth:!0,children:[C(a,{children:S.t(`Node.js upgrade`)}),E(_,{style:{height:100,padding:`0 20px`,overflow:`hidden`},children:[this.state.finished?null:C(j,{children:S.t(`Performing this update will restart the js-controller afterwards!`)}),this.state.inProgress?C(k,{sx:{display:`flex`,justifyContent:`center`},children:C(v,{})}):null,this.state.success?C(j,{children:S.t(`Node.js update successful, restarting controller now!`)}):null,this.state.error?C(j,{sx:{color:`red`},children:S.t(`Node.js update failed: %s`,this.state.error)}):null]}),E(h,{children:[C(A,{disabled:this.state.inProgress||this.state.finished,color:`primary`,variant:`contained`,startIcon:C(fe,{}),onClick:()=>this.updateNodeJsVersion(),children:S.t(`Upgrade`)}),C(A,{disabled:this.state.inProgress,variant:`contained`,onClick:()=>{this.props.onClose()},color:`primary`,startIcon:C(I,{}),children:S.t(`Close`)})]})]})}async updateNodeJsVersion(){this.setState({inProgress:!0});let e=await this.props.socket.upgradeOsPackages(this.props.hostId,[{name:`nodejs`}],!0);this.setState({inProgress:!1,success:e.success,error:e.error||``,finished:!0})}},Qe={ok:`#01bc69`,info:`#48b9ff`,warning:`#ffbd59`,error:`#ff5f72`},$e={ok:`Normal`,info:`Information`,warning:`Begrenzt`,error:`Störung`};function q(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function J(e,t=``){return(typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):t).replace(/\s+/g,` `).trim()||t}function et(e,t){if(e&&typeof e==`object`)return e;try{return JSON.parse(typeof e==`string`?e:``)}catch{return t}}function Y(e,t){var n;return(n=e[t])==null?void 0:n.val}function X(e){let t=q(e,0),n=t<0?`−`:``,r=Math.abs(t);return r>=1e3?`${n}${(r/1e3).toLocaleString(`de-DE`,{minimumFractionDigits:1,maximumFractionDigits:2})} kW`:`${n}${Math.round(r).toLocaleString(`de-DE`)} W`}function tt(e){let t=q(e,0);if(!t)return`noch kein Regeltick`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));return n<2?`gerade eben`:n<60?`vor ${n} s`:`vor ${Math.round(n/60)} min`}function nt(e){let t=q(e,0);if(!t)return`—`;try{return new Date(t).toLocaleTimeString(`de-DE`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}catch{return`—`}}function Z(e){let t=J(e).toLowerCase();return t===`error`?`error`:t===`warning`||t===`warn`?`warning`:t===`ok`?`ok`:`info`}function rt(e,t){let n=new Set;for(let t of Object.keys(e||{})){let e=t.match(/^(nexowatt-ui\.\d+)\.info\.adminOverview\./);e!=null&&e[1]&&n.add(e[1])}let r=[];for(let a of n){var i;let n=et(Y(e,`${a}.info.adminOverview.summaryJson`),{}),o=et(Y(e,`${a}.info.adminOverview.eventsJson`),[]),s=Math.max(q(n.updatedAt,0),q(n.generatedAt,0),q(Y(e,`${a}.info.adminOverview.updatedAt`),0),q((i=e[`${a}.info.adminOverview.summaryJson`])==null?void 0:i.ts,0)),c=Y(t,`system.adapter.${a}.alive`),l=c==null?null:c===!0||c===1||[`true`,`1`,`online`,`active`].includes(J(c).toLowerCase());r.push({instance:a,alive:l,summary:{...n,status:Z(n.status||Y(e,`${a}.info.adminOverview.status`)),headline:J(n.headline||Y(e,`${a}.info.adminOverview.headline`),`EMS-Diagnose wird aufgebaut`),reason:J(n.reason||Y(e,`${a}.info.adminOverview.reason`),``),binding:J(n.binding||Y(e,`${a}.info.adminOverview.binding`),`none`)},events:Array.isArray(o)?o:[],updatedAt:s})}return r.sort((e,t)=>{let n=e=>e===!0?2:+(e===null);return n(t.alive)-n(e.alive)||t.updatedAt-e.updatedAt||e.instance.localeCompare(t.instance)})}function it(e){let t=[],n=e.charging||{};n.available&&t.push({subsystem:`charging`,severity:q(n.faultCount,0)>0?`error`:q(n.waitingCount,0)>0?`info`:`ok`,title:`${q(n.activeCount,0)} lädt · ${q(n.waitingCount,0)} wartet · ${q(n.faultCount,0)} gestört`,reason:J(n.limiterText||n.status,`Lademanagement aktiv`),details:`Ist ${X(n.actualW)} · Soll ${X(n.targetW)}`});let r=e.storage||{};return r.available&&t.push({subsystem:`storage`,severity:r.writeOk===!1?`error`:`ok`,title:`Speicher ${J(r.topology,`aktiv`)}${r.socPct==null?``:` · SoC ${Math.round(q(r.socPct,0))} %`}`,reason:J(r.reason,`Speicherregelung aktiv`),details:`Ist ${X(r.actualW)} · Soll ${X(r.targetW)}`}),t}function at({socket:e}){let[t,n]=P(null),[r,i]=P(!0),[a,o]=P(``),[s,c]=P(()=>Date.now()),l=le(async()=>{if(document.visibilityState===`visible`)try{let[t,r]=await Promise.all([e.getForeignStates(`nexowatt-ui.*.info.adminOverview.*`),e.getForeignStates(`system.adapter.nexowatt-ui.*.alive`)]),i=rt(t||{},r||{});n(i[0]||null),o(``)}catch(e){o(J(e==null?void 0:e.message,`EMS-Diagnose konnte nicht gelesen werden`))}finally{i(!1),c(Date.now())}},[e]);de(()=>{l();let e=()=>{document.visibilityState===`visible`&&l()};document.addEventListener(`visibilitychange`,e);let t=window.setInterval(()=>void l(),5e3);return()=>{document.removeEventListener(`visibilitychange`,e),window.clearInterval(t)}},[l]);let u=String(window.NEXOWATT_EOS_ACCESS_ROLE||`unknown`).toLowerCase(),d=u===`admin`||u===`service`||u===`installer`||u===`installateur`,f=(t==null?void 0:t.summary)||{},p=t!=null&&t.updatedAt?Math.max(0,s-t.updatedAt):1/0,m=!!(t&&(t.alive===!1||p>2e4)),ee=Z(f.status),te=m?`error`:ee,h=Qe[te],g=f.budget||{},_=f.charging||{},v=f.storage||{},y=f.ems||{},b=f.para14a||{},x=f.tariff||{},S=f.forecast||{},ne=f.peakShaving||{},w=Math.max(0,q(g.totalW,0)),re=Math.max(0,q(g.remainingW,0)),ie=w>0?Math.max(0,Math.min(100,re/w*100)):0,T=pe(()=>(Array.isArray(f.currentDecisions)?f.currentDecisions:it(f)).slice(0,d?5:2),[f,d]),D=d?((t==null?void 0:t.events)||[]).slice(0,6):[],O=[];return J(f.binding,`none`)!==`none`&&O.push({label:`Bindend: ${J(g.bindingText||f.binding)}`,warning:!0}),b.communicationFallbackActive?O.push({label:`§14a-Fallback ${X(b.fallbackCapW)}`,warning:!0}):b.binding&&O.push({label:`§14a begrenzt`,warning:!0}),ne.active&&O.push({label:`Peak-Shaving: ${J(ne.status,`aktiv`)}`,warning:!0}),x.available&&O.push({label:`Tarif: ${J(x.state,`aktiv`)}${x.priceEurPerKwh==null?``:` · ${q(x.priceEurPerKwh).toFixed(3)} €/kWh`}`}),S.available&&O.push({label:`Prognose: ${J(S.source,`aktiv`)}${S.fresh===!1?` · veraltet`:``}`,warning:S.fresh===!1}),(y.safetyActive||y.safetyEmergencyStop||y.safetyValid===!1)&&O.push({label:`EOS Safety aktiv`,warning:!0}),!t&&!r?E(`section`,{className:`eos-ems-overview-card`,"data-nexowatt-contract":`nexowatt-ems-overview-v1`,style:{"--eos-ems-status-color":Qe.info},children:[E(`header`,{className:`eos-ems-overview-header`,children:[E(`div`,{children:[C(`span`,{className:`eos-ems-overview-eyebrow`,children:`NexoWatt EMS`}),C(`h2`,{children:`Live-Diagnose`}),C(`p`,{children:a||`NexoWatt UI ist nicht installiert, offline oder der Diagnosevertrag info.adminOverview.* fehlt.`})]}),E(`div`,{className:`eos-ems-overview-state`,children:[C(`span`,{className:`eos-ems-overview-state-dot`}),C(`strong`,{children:`Nicht verfügbar`}),C(`small`,{children:`read-only`})]})]}),E(`footer`,{className:`eos-ems-overview-footer`,children:[C(`span`,{children:`Diagnose ist rein lesend.`}),C(`span`,{children:`Keine EMS-Regelung wurde verändert.`})]})]}):E(`section`,{className:`eos-ems-overview-card`,"data-nexowatt-contract":`nexowatt-ems-overview-v1`,style:{"--eos-ems-status-color":h},children:[E(`header`,{className:`eos-ems-overview-header`,children:[E(`div`,{children:[C(`span`,{className:`eos-ems-overview-eyebrow`,children:`NexoWatt EMS · Live-Diagnose`}),C(`h2`,{children:r?`EMS-Diagnose wird geladen …`:m?`EMS-Diagnose ist nicht aktuell`:J(f.headline,`EMS arbeitet normal`)}),C(`p`,{children:m?`Adapter oder Diagnosewerte sind älter als 20 Sekunden. Die dargestellten Werte dürfen nicht als aktuelle Regelentscheidung verwendet werden.`:J(f.reason,`EMS arbeitet innerhalb aller aktiven Grenzen.`)})]}),E(`div`,{className:`eos-ems-overview-state`,children:[C(`span`,{className:`eos-ems-overview-state-dot`}),C(`strong`,{children:m?`Offline / veraltet`:$e[te]}),E(`small`,{children:[(t==null?void 0:t.instance)||`nexowatt-ui`,` · `,tt(t==null?void 0:t.updatedAt)]})]})]}),E(`div`,{className:`eos-ems-overview-metrics`,children:[E(`div`,{className:`eos-ems-overview-metric`,children:[C(`span`,{children:`EMS-Budget`}),C(`strong`,{children:w>0?X(w):`nicht begrenzt`}),E(`small`,{children:[`Rest `,X(re)]})]}),E(`div`,{className:`eos-ems-overview-metric`,children:[C(`span`,{children:`Lademanagement`}),E(`strong`,{children:[X(_.actualW),` / `,X(_.targetW)]}),E(`small`,{children:[q(_.activeCount),` lädt · `,q(_.waitingCount),` wartet`]})]}),v.available?E(`div`,{className:`eos-ems-overview-metric`,children:[E(`span`,{children:[`Speicher `,J(v.topology,``)]}),E(`strong`,{children:[X(v.actualW),` / `,X(v.targetW)]}),C(`small`,{children:v.socPct==null?J(v.reason,`aktiv`):`SoC ${Math.round(q(v.socPct))} %`})]}):E(`div`,{className:`eos-ems-overview-metric`,children:[C(`span`,{children:`PV-Budget`}),C(`strong`,{children:X(g.pvBudgetW)}),E(`small`,{children:[`PV-Rest `,X(g.remainingPvW)]})]}),E(`div`,{className:`eos-ems-overview-metric`,children:[C(`span`,{children:`Letzter Regeltick`}),C(`strong`,{children:tt(y.lastTickTs||(t==null?void 0:t.updatedAt))}),C(`small`,{children:d?`Zyklus ${q(y.cycleMs)} ms`:J(y.decision,`EMS aktiv`)})]})]}),w>0?C(`div`,{className:`eos-ems-overview-budget`,title:`${ie.toFixed(1)} % Restbudget`,children:C(`span`,{style:{width:`${ie}%`}})}):null,O.length?C(`div`,{className:`eos-ems-overview-tags`,children:O.map(e=>C(`span`,{className:e.warning?`is-warning`:``,children:e.label},e.label))}):null,E(`div`,{className:`eos-ems-overview-columns`,children:[E(`div`,{className:`eos-ems-overview-panel`,children:[C(`h3`,{children:`Aktuelle Regelentscheidungen`}),T.length?T.map((e,t)=>E(`div`,{className:`eos-ems-overview-decision eos-ems-overview-decision--${Z(e.severity)}`,children:[C(`strong`,{children:J(e.title,`EMS-Entscheidung`)}),C(`span`,{children:J(e.reason,`Keine zusätzliche Begrenzung`)}),d&&e.details?C(`small`,{children:e.details}):null]},`${e.subsystem||`ems`}-${t}`)):C(`div`,{className:`eos-ems-overview-empty`,children:`Keine aktiven Regelentscheidungen. EOS arbeitet mit den aktuellen Messwerten.`})]}),E(`div`,{className:`eos-ems-overview-panel`,children:[C(`h3`,{children:d?`Letzte EMS-Ereignisse`:`Systemerklärung`}),d?D.length?D.map((e,t)=>E(`div`,{className:`eos-ems-overview-event eos-ems-overview-event--${Z(e.severity)}`,children:[C(`time`,{children:nt(e.ts)}),E(`div`,{children:[C(`strong`,{children:J(e.title,`EMS`)}),C(`span`,{children:J(e.message||e.reason,`Zustand aktualisiert`)})]})]},e.id||`${e.ts}-${t}`)):C(`div`,{className:`eos-ems-overview-empty`,children:`Noch keine Zustandsänderung im begrenzten Ereignispuffer.`}):E(`div`,{className:`eos-ems-overview-decision eos-ems-overview-decision--info`,children:[C(`strong`,{children:J(f.headline,`EMS aktiv`)}),C(`span`,{children:J(f.reason,`EOS optimiert die Anlage innerhalb aller Sicherheitsgrenzen.`)})]})]})]}),C(`footer`,{className:`eos-ems-overview-footer`,children:C(`span`,{children:`Diagnose ist rein lesend. Keine Kachel besitzt Schreibhoheit.`})})]})}He(),n(),Ue();var Q={button:{position:`absolute`,bottom:16,right:16},saveButton:e=>({backgroundColor:e.palette.success.main,right:80,"&:hover":{backgroundColor:e.palette.success.dark}}),addButton:e=>({backgroundColor:e.palette.secondary.main,right:144,"&:hover":{backgroundColor:e.palette.secondary.dark}}),closeButton:e=>({backgroundColor:e.palette.error.main,"&:hover":{backgroundColor:e.palette.error.dark}}),hostOffline:e=>({color:e.palette.error.main,fontWeight:500}),updateExists:{color:`#c28700`,marginRight:4},updateNo:{color:`#00b204`,marginRight:4},nodeUpdate:{opacity:.6},instanceNumber:{opacity:.6,fontWeight:500},hostStats:{display:`grid`,gridTemplateColumns:`auto minmax(0, 1fr)`,columnGap:`10px`,rowGap:`3px`,alignItems:`baseline`},hostStatLabel:e=>({color:e.palette.text.disabled,whiteSpace:`nowrap`}),hostStatValue:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},hostInfoStats:{display:`grid`,gridTemplateColumns:`auto auto minmax(0, 1fr)`,columnGap:`12px`,rowGap:`6px`,alignItems:`center`},hostInfoIcon:e=>({display:`flex`,alignItems:`center`,color:e.palette.text.disabled,fontSize:18,"& svg":{fontSize:18}}),hostInfoValue:{overflowWrap:`anywhere`},diskValue:{display:`flex`,alignItems:`center`,gap:`8px`},diskBar:{flex:`1 1 auto`,minWidth:60,maxWidth:160,height:8,borderRadius:4},diskText:{whiteSpace:`nowrap`},updateIcon:{cursor:`pointer`,fontSize:16},tooltip:{pointerEvents:`none`},cards:{alignContent:`flex-start`,width:`100%`,pt:`12px`,px:`8px`,pb:`64px`}},$={Uptime:V.formatSeconds,"System uptime":V.formatSeconds,RAM:V.formatRam,Speed:V.formatSpeed,"Disk size":V.formatBytes,"Disk free":V.formatBytes,timeOffset:e=>{let t=Math.abs(e),n=Math.floor(t/60),r=t%60;return`UTC${e>0?`-`:`+`}${n}${r?`:${r.toString().padStart(2,`0`)}`:``}`}};function ot(e,t,n){let r=typeof t==`number`?t:new Date().getTimezoneOffset(),i=new Date(e-r*6e4);try{return i.toLocaleString(n===`zh-cn`?`zh-CN`:n,{timeZone:`UTC`})}catch{return i.toUTCString().replace(` GMT`,``)}}function st(e){return e&&e[0].toUpperCase()+e.substring(1)}function ct(e){let t=e.toLowerCase();return t.includes(`darwin`)||t.includes(`osx`)||t.includes(`mac`)?C(te,{}):t.includes(`win`)?C(D,{}):t.includes(`bsd`)?C(u,{}):t.includes(`linux`)||t.includes(`docker`)||t.includes(`android`)?C(re,{}):C(Te,{})}function lt(e,t){switch(e){case`Platform`:case`os`:return ct(`${t.Platform||``} ${t.os||``}`);case`Architecture`:return C(De,{});case`CPUs`:case`Model`:return C(s,{});case`Speed`:return C(Oe,{});case`RAM`:return C(Be,{});case`System uptime`:return C(ke,{});case`Uptime`:return C(Ae,{});case`Node.js`:return C(ee,{});case`NPM`:return C(ye,{});case`time`:return C(Ne,{});case`timeOffset`:return C(O,{});case`adapters count`:return C(je,{});case`Disk size`:case`Disk free`:return C(Pe,{});case`Active instances`:return C(we,{});case`location`:return C(ue,{});case`alive`:case`active`:return t[e]?C(Ve,{color:`success`}):C(me,{color:`error`});default:return null}}var ut=new WeakMap,dt=new WeakMap,ft=new WeakMap,pt=class e extends m.Component{constructor(t){super(t),We(this,ut,18e5),We(this,dt,3e5),We(this,ft,6e4),i(this,`introLinksOriginal`,void 0),i(this,`deactivatedOriginal`,void 0),i(this,`remoteAccess`,null),i(this,`t`,void 0),i(this,`getDataTimeout`,void 0),i(this,`updateHostsAlive`,async t=>{let n=JSON.parse(JSON.stringify(this.state.alive)),r=[];if(t.find(e=>e.type===`deleted`))this.getDataDelayed();else if(t.forEach(e=>{!!n[e.id]!=!!e.alive&&(n[e.id]=e.alive,r.push(e.id))}),r.length){let t=JSON.parse(JSON.stringify(this.state.hostsData)),i=new Map(this.state.hostDataTimestampMap),a=Date.now();(await Promise.all(r.map(e=>this.getHostData(e,n[e])))).forEach(n=>{t[n.id]=e.preprocessHostData(n.data),i.set(n.id,a)}),this.setState({alive:n,hostsData:t,hostDataTimestampMap:i},()=>this.checkBackendTime())}}),i(this,`updateHosts`,t=>{let n=[];if(t.find(e=>!e.obj))this.getDataDelayed();else if(n=t.map(e=>e.id),n.length){let t=JSON.parse(JSON.stringify(this.state.hostsData)),r=new Map(this.state.hostDataTimestampMap),i=Date.now();Promise.all(n.map(e=>this.getHostData(e))).then(n=>{n.forEach(n=>{t[n.id]=e.preprocessHostData(n.data),r.set(n.id,i)}),this.setState({hostsData:t,hostDataTimestampMap:r})})}}),i(this,`getDataDelayed`,e=>{this.getDataTimeout&&clearTimeout(this.getDataTimeout),this.getDataTimeout=setTimeout(()=>{this.getDataTimeout=void 0,this.getData(!0).catch(e=>console.error(`Cannot get data: ${e}`))},300)}),this.state={instances:null,deactivated:[],edit:!1,link:null,introLinks:[],editLink:!1,editLinkIndex:-1,openSnackBar:!1,hasUnsavedChanges:!1,reverseProxy:null,alive:{},hostsData:{},hosts:null,hostTimeDiffMap:new Map,hostDataTimestampMap:new Map,nodeUpdateSupported:!1,nodeUpdateDialog:null},this.t=t.t}checkBackendTime(){let e=this.state.hostTimeDiffMap,t=this.state.hostDataTimestampMap,n=Date.now();for(let[r,i]of Object.entries(this.state.hostsData)){let a=Math.abs(i.time-n);e.set(r,a),t.set(r,n)}this.setState({hostTimeDiffMap:e,hostDataTimestampMap:t})}async componentDidMount(){let e=window;e.NEXOWATT_EOS_ADMIN_SOCKET=this.props.socket,e.NEXOWATT_EOS_SOCKET=this.props.socket,window.dispatchEvent(new CustomEvent(`nexowatt-eos-admin-socket-ready`));let t=[],n=!1;try{var r;let[e,i]=await Promise.all([this.props.socket.getObject(`system.adapter.${this.props.adminInstance}`),this.props.socket.checkFeatureSupported(`CONTROLLER_OS_PACKAGE_UPGRADE`)]);t=(e==null||(r=e.native)==null?void 0:r.reverseProxy)||[],n=i}catch(e){if(String(window.NEXOWATT_EOS_ACCESS_ROLE||`unknown`).toLowerCase()===`admin`)throw e}await new Promise(e=>this.setState({reverseProxy:t,nodeUpdateSupported:n},()=>e())),await this.getData(),this.props.instancesWorker.registerHandler(this.getDataDelayed),this.props.hostsWorker.registerHandler(this.updateHosts),this.props.hostsWorker.registerAliveHandler(this.updateHostsAlive),this.checkBackendTime()}componentWillUnmount(){this.getDataTimeout&&=(clearTimeout(this.getDataTimeout),void 0),this.props.instancesWorker.unregisterHandler(this.getDataDelayed),this.props.hostsWorker.unregisterHandler(this.updateHosts),this.props.hostsWorker.unregisterAliveHandler(this.updateHostsAlive)}async activateEditMode(){var e;let t=await this.props.socket.getSystemConfig(!0),n=await this.getInstances(!0,null,t),r=t!=null&&(e=t.native)!=null&&e.introLinks?t.native.introLinks:[];this.introLinksOriginal=JSON.stringify(r),this.deactivatedOriginal=JSON.parse(JSON.stringify(n.deactivated)),this.setState({instances:n.instances,deactivated:n.deactivated,edit:!0,introLinks:r,hasUnsavedChanges:!1})}deactivateEditMode(){this.state.hasUnsavedChanges,this.setState({deactivated:this.deactivatedOriginal||null,introLinks:JSON.parse(this.introLinksOriginal||`[]`),hasUnsavedChanges:!1,edit:!1},()=>{this.deactivatedOriginal=void 0,this.introLinksOriginal=void 0})}toggleCard(e,t){if(!this.state.instances||!this.state.instances.length)return;let n=JSON.parse(JSON.stringify(this.state.deactivated)),r=n.indexOf(`${e}_${t}`);r===-1?(n.push(`${e}_${t}`),n.sort()):n.splice(r,1);let i=JSON.stringify(n)!==JSON.stringify(this.deactivatedOriginal)||JSON.stringify(this.state.introLinks)!==this.introLinksOriginal;this.setState({deactivated:n,hasUnsavedChanges:i})}getInstancesCards(){return(this.state.instances||[]).map(e=>{var t;let n=`${e.id}_${e.linkName}`,r=String(window.NEXOWATT_EOS_ACCESS_ROLE||`unknown`).toLowerCase(),i=r===`admin`||r===`service`;if(!i&&/^(?:admin|xterm)(?:\.|$)/i.test(e.id))return null;let a=!i&&/^nexowatt-ui(?:\.|$)/i.test(e.id),o=i&&/^(?:admin|xterm)(?:\.|$)/i.test(e.id)||a||!((t=this.state.deactivated)!=null&&t.includes(n));if(o||this.state.edit){let t=``;if(e.link)try{t=new URL(e.link,window.location.href).host}catch{t=e.link.replace(/^https?:\/\//,``).split(`/`)[0]}if(e.id===this.props.adminInstance)return null;let n=window.isFinite(e.id.split(`.`).pop());if(n){var s;n=!!((s=this.state.instances)!=null&&s.find(t=>t.id!==e.id&&e.name===t.name&&e.id.split(`.`)[0]===t.id.split(`.`)[0]))}let r=this.state.hostsData?this.state.hostsData[e.id]:null,i;e.info&&(i=r&&typeof r==`object`?r.alive===!1?`offline`:`online`:`unknown`);let a=this.state.hostTimeDiffMap.get(e.id)??0,c=this.state.hostDataTimestampMap.get(e.id)??0,l=Date.now()-c<Ge(dt,this);return C(U,{image:e.image||``,title:E(f,{children:[e.name,n?E(`span`,{style:Q.instanceNumber,children:[`.`,e.id.split(`.`).pop()]}):null]}),action:{link:e.link||``,text:t},t:this.props.t,lang:this.props.lang,color:e.color||``,showInfo:!!e.info,status:i,edit:this.state.edit,offline:!!r&&r.alive===!1,warning:a>Ge(ut,this)&&l?this.t(`Backend time differs by %s minutes`,Math.round(a/Ge(ft,this)).toString()):void 0,enabled:o,unreachable:!!e.unreachable,disabled:!r||typeof r!=`object`,getHostDescriptionAll:()=>this.getHostDescriptionAll(e.id),toggleActivation:()=>this.toggleCard(e.id,e.linkName||``),openSnackBarFunc:()=>this.setState({openSnackBar:!0}),theme:this.props.theme,children:e.description||this.getHostDescription(e.id)},`${e.id}_${e.link}`)}return null})}toggleLinkCard(e){let t=JSON.parse(JSON.stringify(this.state.introLinks));t[e].enabled=!t[e].enabled;let n=JSON.stringify(this.state.deactivated)!==JSON.stringify(this.deactivatedOriginal)||JSON.stringify(t)!==this.introLinksOriginal;this.setState({introLinks:t,hasUnsavedChanges:n})}getLinkCards(){return(this.state.introLinks||[]).map((e,t)=>!e.enabled&&!this.state.edit?null:e.camera===`custom`?C(Ye,{image:e.image,title:e.name,action:{link:e.link,text:e.linkName},t:this.props.t,socket:this.props.socket,color:e.color,edit:this.state.edit,interval:e.interval,camera:e.camera,addTs:e.addTs,onEdit:()=>{var e;return this.setState({editLink:!0,editLinkIndex:t,link:JSON.parse(JSON.stringify((e=this.state.introLinks)==null?void 0:e[t]))})},onRemove:()=>{let e=JSON.parse(JSON.stringify(this.state.introLinks));e.splice(t,1);let n=JSON.stringify(this.state.deactivated)!==JSON.stringify(this.deactivatedOriginal)||JSON.stringify(e)!==this.introLinksOriginal;this.setState({introLinks:e,hasUnsavedChanges:n})},enabled:e.enabled,lang:this.props.lang,toggleActivation:()=>this.toggleLinkCard(t),cameraUrl:e.desc,theme:this.props.theme},`link${t}`):C(U,{image:e.image,title:e.name,action:{link:e.link,text:e.linkName},t:this.props.t,color:e.color,edit:this.state.edit,onEdit:()=>{var e;return this.setState({editLink:!0,editLinkIndex:t,link:JSON.parse(JSON.stringify((e=this.state.introLinks)==null?void 0:e[t]))})},onRemove:()=>{let e=JSON.parse(JSON.stringify(this.state.introLinks));e.splice(t,1);let n=JSON.stringify(this.state.deactivated)!==JSON.stringify(this.deactivatedOriginal)||JSON.stringify(e)!==this.introLinksOriginal;this.setState({introLinks:e,hasUnsavedChanges:n})},enabled:e.enabled,lang:this.props.lang,toggleActivation:()=>this.toggleLinkCard(t),theme:this.props.theme,children:e.desc||``},`link${t}`))}editLinkCard(){return this.state.editLink?C(Xe,{link:this.state.link,socket:this.props.socket,isNew:this.state.editLinkIndex===-1,t:this.props.t,lang:this.props.lang,theme:this.props.theme,onClose:e=>{if(e){let t=JSON.parse(JSON.stringify(this.state.introLinks));this.state.editLinkIndex===-1?(e.enabled=!0,t.push(e)):(e.enabled=t[this.state.editLinkIndex].enabled,t[this.state.editLinkIndex]=e);let n=JSON.stringify(this.state.deactivated)!==JSON.stringify(this.deactivatedOriginal)||JSON.stringify(t)!==this.introLinksOriginal;this.setState({introLinks:t,editLink:!1,hasUnsavedChanges:n,link:null})}else this.setState({editLink:!1})}}):null}getButtons(){let e=[];return this.state.edit?(e.push(C(B,{color:`primary`,size:`small`,sx:l.getStyle(this.props.theme,Q.button,Q.addButton),onClick:()=>this.setState({editLink:!0,editLinkIndex:-1,link:{}}),children:C(Ce,{})},`add`)),e.push(C(B,{size:`small`,color:`primary`,disabled:!this.state.hasUnsavedChanges,sx:l.getStyle(this.props.theme,Q.button,Q.saveButton),onClick:()=>this.saveCards(),children:C(o,{})},`save`)),e.push(C(B,{size:`small`,color:`primary`,sx:l.getStyle(this.props.theme,Q.button,Q.closeButton),onClick:()=>this.deactivateEditMode(),children:C(I,{})},`close`))):e.push(C(B,{color:`primary`,size:`small`,style:Q.button,onClick:()=>this.activateEditMode(),children:C(Ee,{})},`edit`)),e}async saveCards(){let e=await this.props.socket.getSystemConfig(!0),t=!1;JSON.stringify(e.common.intro)!==JSON.stringify(this.state.deactivated)&&(e.common.intro=this.state.deactivated||void 0,t=!0),!t&&JSON.stringify(e.native.introLinks)!==JSON.stringify(this.state.introLinks)&&(t=!0,e.native.introLinks=this.state.introLinks),t?this.props.socket.setSystemConfig(e).then(()=>this.props.showAlert(`Updated`,`success`)).catch(e=>{console.log(e),this.props.showAlert(e,`error`)}).then(()=>this.setState({edit:!1})):this.setState({edit:!1})}async getHostData(e,t){let n;if(t!==void 0)n={val:t};else try{n=await this.props.socket.getState(`${e}.alive`)}catch(t){console.error(`Cannot get state ${e}.alive: ${t}`),n={val:!1}}let r={alive:!1};if(n!=null&&n.val)try{r=await this.props.socket.getHostInfo(e,!1,1e4),r&&typeof r==`object`&&r.alive!==!1&&(r.alive=!0)}catch(t){console.error(`Cannot get host info for ${e}: ${t}`),r={alive:!1}}else r={alive:!1};let i=await this.props.socket.getForeignStates(`${e}.versions.*`);return Object.keys(i).forEach(e=>r[`_${e.split(`.`).pop()}`]=i[e].val),{id:e,data:r}}async getHostsData(t){let n=t.map(e=>this.getHostData(e._id)),r=await Promise.all(n),i={},a={},o=new Map(this.state.hostDataTimestampMap),s=Date.now();return r.forEach(t=>{i[t.id]=e.preprocessHostData(t.data),a[t.id]=!!t.data.alive,o.set(t.id,s)}),this.setState({hostDataTimestampMap:o}),{hostsData:i,alive:a}}addLinks(e,t,n,r,i,a){let o={id:e.id,name:e.name,description:e.description,color:e.color,image:e.icon,info:``},s=Ie(e.link,t.name,n,{instances:r,hostname:this.props.hostname,adminInstance:this.props.adminInstance,hosts:i}),c=this.state.reverseProxy,l=null;if(c!=null&&c.length){let e=window.location.pathname;l=c.find(t=>{if(!t.globalPath)return!1;let n=t.globalPath.endsWith(`/`)?t.globalPath:`${t.globalPath}/`;return e===n||e.startsWith(n)})||null}if(s.length>1&&(s.sort((e,t)=>(e.instance||``).localeCompare(t.instance||``,void 0,{numeric:!0})),s.splice(1)),s.length){if(o.link=s[0].url,o.port=s[0].port,this.remoteAccess){let e=ze(o.link,o.port,this.remoteAccess);e===null?o.unreachable=!0:o.link=e}else o.link=Fe(o.link,o.id,r,l)||o.link;let e=a.find(e=>e.link===o.link);e?Re(o.link,t.name,e.id.split(`.`)[0])?a[a.indexOf(e)]=o:console.log(`Double links: "${o.id}" and "${e.id}"`):a.push(o)}}static getText(e,t){return e?typeof e==`object`?e[t]||e.en||``:e||``:``}static normalizeLinks(t,n,r){if(!t.common.localLinks&&!t.common.localLink&&!t.common.welcomeScreen&&!t.common.welcomeScreenPro)return null;let i={id:t._id.replace(`system.adapter.`,``),link:``,name:e.getText(t.common.titleLang||t.common.title||t.common.name,n),order:t.common.order||1e3,intro:!0,description:e.getText(t.common.desc,n),icon:t.common.icon?`adapter/${t.common.name}/${t.common.icon}`:`img/no-image.svg`},a=[];if(t.common.localLink){if(typeof t.common.localLink==`string`)a.push({...i,link:t.common.localLink});else{let e=t.common.localLink;if(e.link){let t={...i,link:e.link};e.color&&(t.color=e.color),e.order!==void 0&&typeof e.order==`number`&&(t.order=e.order),e.icon&&e.img&&(t.icon=e.icon||e.img),a.push(t)}else console.warn(`Unknown localLink structure: ${JSON.stringify(t.common.localLink)}`)}}let o=t.common.localLinks;if(o&&typeof o==`object`&&Object.keys(o).forEach(r=>{let s=o[r];if(typeof s==`string`)a.push({...i,link:s});else{let o=s;if(o.link){let s={...i,id:t._id.replace(`system.adapter.`,``)+(r===`_default`?``:` ${r}`),link:o.link,name:i.name+(r===`_default`?``:` ${r}`)};o.color&&(s.color=o.color),o.order!==void 0&&(s.order=parseInt(o.order,10)||1e3),o.icon&&o.img&&(s.icon=o.icon||o.img),o.description&&(s.description=e.getText(o.description,n)),o.pro!==void 0&&(s.pro=typeof o.pro==`string`?o.pro:`${t.common.name}/index.html`),o.cloud!==void 0&&(s.cloud=o.cloud),o.intro!==void 0&&(s.intro=o.intro===!0),o.name&&(s.name=e.getText(o.name,n)),r===`_default`&&(s.default=!0),a.push(s)}else console.warn(`Unknown localLinks structure: ${JSON.stringify(s)}`)}}),t.common.welcomeScreen&&typeof t.common.welcomeScreen==`object`&&((Array.isArray(t.common.welcomeScreen)?t.common.welcomeScreen:[t.common.welcomeScreen]).forEach(r=>{if(r.link){let s={...i,id:`${t._id.replace(`system.adapter.`,``)} cloud`,link:`%web_protocol%://%web_bind%:%web_port%/${r.link}`,cloud:r.link};if(r.color&&(s.color=r.color),r.order!==void 0&&typeof r.order==`number`&&(s.order=r.order),r.icon&&r.img&&(s.icon=r.icon||r.img),r.localLinks){var o;let e=(o=t.common.localLinks)==null?void 0:o[r.localLinks];e&&typeof e==`string`?s.link=e:e&&typeof e==`object`&&e.link&&(s.link=e.link)}r.name&&(s.name=e.getText(r.name,n)),a.push(s)}}),t.common.welcomeScreenPro&&typeof t.common.welcomeScreenPro==`object`&&(Array.isArray(t.common.welcomeScreenPro)?t.common.welcomeScreenPro:[t.common.welcomeScreenPro]).forEach(r=>{if(r.link){let s={...i,id:`${t._id.replace(`system.adapter.`,``)} pro`,link:`%web_protocol%://%web_bind%:%web_port%/${r.link}`,pro:r.link};if(r.color&&(s.color=r.color),r.order!==void 0&&typeof r.order==`number`&&(s.order=r.order),r.icon&&r.img&&(s.icon=r.icon||r.img),r.localLinks){var o;let e=(o=t.common.localLinks)==null?void 0:o[r.localLinks];e&&typeof e==`string`?s.link=e:e&&typeof e==`object`&&e.link&&(s.link=e.link)}r.name&&(s.name=e.getText(r.name,n)),a.push(s)}})),a.forEach(e=>{e.icon.startsWith(`adapter/`)||e.icon.startsWith(`data:image/`)||e.icon.startsWith(`http://`)||e.icon.startsWith(`https://`)||e.icon===`img/no-image.svg`||(e.icon=`adapter/${t.common.name}/${e.icon}`)}),r){let e={};a.forEach(t=>{e[t.link]?(t.color&&(e[t.link].color=t.color),t.icon&&(e[t.link].icon=t.icon),t.cloud&&(e[t.link].cloud=t.cloud),t.pro&&(e[t.link].pro=t.pro),t.intro!==void 0&&(e[t.link].intro=t.intro),t.name&&typeof t.name==`object`&&(e[t.link].name=t.name),t.order!==void 0&&(e[t.link].order=t.order),t.default&&(e[t.link].default=t.default)):e[t.link]=t}),a=Object.values(e)}return a.sort((e,t)=>e.default===void 0&&t.default===void 0?e.order===void 0&&t.order===void 0?0:e.order===void 0?-1:t.order===void 0?1:e.order-t.order:e.default===void 0?-1:t.default===void 0?1:e.order===void 0&&t.order===void 0?0:e.order===void 0?-1:t.order===void 0?1:e.order-t.order),a}async getInstances(t,n,r){n=n||this.state.hosts||[];let i={};n.forEach(e=>i[e._id]=e);try{let a=await this.props.socket.getAdapterInstances(``,t),o=r.common.intro||[];Array.isArray(o)||(o=Object.keys(o),o.sort());let s=[],c={};a.forEach(e=>c[e._id]=e),this.remoteAccess=Le(c,window.location),a.forEach(t=>{if(!t)return;let n=t.common||null,r=t._id.split(`.`),a=parseInt(r.pop()||``,10),o;if(n!=null&&n.name&&typeof n.name==`object`){let e=n==null?void 0:n.name;o=e[this.props.lang]||e.en}else o=(n==null?void 0:n.name)||``;if((o!==`admin`||n.localLink!==(this.props.hostname||``))&&o!==`web`&&!(o&&o!==`vis-web-admin`&&o.match(/^vis-/)&&o!==`vis-2`)&&!(o!=null&&o.match(/^icons-/))&&n&&(n.enabled||n.onlyWWW)){let r=e.normalizeLinks(t,this.props.lang,!0);r&&r.forEach(e=>this.addLinks(e,n,a,c,i,s))}}),s.forEach(e=>{e.link&&(e.linkName=e.link.replace(`https://`,``).replace(`http://`,``).replace(/^[^_]+:/,``))}),s.sort((e,t)=>{if(e.order!==void 0||t.order!==void 0){if(e.order=e.order===void 0?1e3:e.order,t.order=t.order===void 0?1e3:t.order,e.order<t.order)return-1;if(e.order>t.order)return 1}return e.id>t.id?1:e.id<t.id?-1:0}),n==null||n.forEach(e=>{let t=e==null?void 0:e.common,n=t==null?void 0:t.name;if(typeof n==`object`&&(n&&=n[this.props.lang]||n.en),t){let r={id:e._id,name:n||``,color:``,image:t.icon||`img/no-image.svg`,info:this.t(`Info`),linkName:``};s.push(r)}});let l=[];return o.forEach(e=>{s.find(t=>e===`${t.id}_${t.linkName}`)&&l.push(e)}),o=l,{instances:s,deactivated:o}}catch(e){return console.log(e),{instances:[],deactivated:[]}}}getHostDescription(e){let t=this.state.hostsData?this.state.hostsData[e]:null;if(t&&t.alive===!1)return C(k,{sx:Q.hostOffline,children:this.props.t(`Offline`)});let n=``,r=``;if(t){try{t._nodeNewest&&t[`Node.js`]&&R.gt(t._nodeNewest,t[`Node.js`].replace(/^v/,``))&&(n=t._nodeNewest)}catch{}try{t._nodeNewest!==t._nodeNewestNext&&t._nodeNewestNext&&t[`Node.js`]&&t._nodeNewest&&R.gt(t._nodeNewestNext,t[`Node.js`].replace(/^v/,``))&&R.gt(t._nodeNewestNext,t._nodeNewest)&&(n+=(n?` / `:``)+t._nodeNewestNext)}catch{}if(n){let r=this.state.nodeUpdateSupported&&t.Platform===`linux`;n=C(F,{title:this.props.t(`Some updates available`),slotProps:{popper:{sx:Q.tooltip}},children:E(`span`,{style:{...Q.nodeUpdate,display:`inline-flex`},children:[`(`,n,`)`,r?C(fe,{style:Q.updateIcon,onClick:()=>this.setState({nodeUpdateDialog:{hostId:e,version:t._nodeNewestNext}})}):null]})})}try{t._npmNewest&&t.NPM&&R.gt(t._npmNewest,t.NPM)&&(r=t._npmNewest)}catch{}try{t._npmNewest!==t._npmNewestNext&&t._npmNewestNext&&t.NPM&&t._npmNewest&&R.gt(t._npmNewestNext,t.NPM)&&R.gt(t._npmNewestNext,t._npmNewest)&&(r+=(r?` / `:``)+t._npmNewestNext)}catch{}r&&=C(F,{title:this.props.t(`Some updates available`),slotProps:{popper:{sx:Q.tooltip}},children:E(`span`,{style:Q.nodeUpdate,children:[`(`,r,`)`]})})}return t&&typeof t==`object`?E(k,{sx:Q.hostStats,children:[C(k,{sx:Q.hostStatLabel,children:this.t(`Platform`)}),C(k,{sx:Q.hostStatValue,title:t.Platform||``,children:t.Platform||`--`}),C(k,{sx:Q.hostStatLabel,children:this.t(`RAM`)}),C(k,{sx:Q.hostStatValue,children:$.RAM(t.RAM)}),C(k,{sx:Q.hostStatLabel,children:this.t(`Node.js`)}),E(k,{sx:Q.hostStatValue,children:[C(`span`,{style:n?Q.updateExists:Q.updateNo,children:t[`Node.js`]||`--`}),n]}),C(k,{sx:Q.hostStatLabel,children:this.t(`NPM`)}),E(k,{sx:Q.hostStatValue,children:[C(`span`,{style:r?Q.updateExists:Q.updateNo,children:t.NPM||`--`}),r]})]}):E(k,{sx:Q.hostStats,children:[C(M,{width:60}),C(M,{}),C(M,{width:60}),C(M,{}),C(M,{width:60}),C(M,{}),C(M,{width:60}),C(M,{})]})}renderDiskRow(e){let t=e[`Disk size`],n=e[`Disk free`],r=t>0?Math.max(0,Math.min(100,n/t*100)):0,i=`${V.formatBytes(n)} / ${V.formatBytes(t)}`,a=r<10?`error`:r<25?`warning`:`success`;return{name:`Disk free`,text:i,value:E(k,{sx:Q.diskValue,children:[C(F,{title:`${Math.round(r)}% ${this.t(`Free`)}`,slotProps:{popper:{sx:Q.tooltip}},children:C(oe,{variant:`determinate`,value:r,color:a,sx:Q.diskBar})}),C(k,{component:`span`,sx:Q.diskText,children:i})]})}}renderHostInfoRow(e,t){let n=t[e];return e===`time`?{name:e,text:ot(n,t.timeOffset,this.props.lang)}:typeof n==`boolean`?{name:e,text:n?this.t(`Yes`):this.t(`No`)}:$[e]?{name:e,text:$[e](n,this.t)||`--`}:typeof n==`object`?{name:e,text:JSON.stringify(n)}:{name:e,text:n.toString()||`--`}}getHostDescriptionAll(e){let t=this.state.hostsData&&typeof this.state.hostsData[e]==`object`?this.state.hostsData[e]:null,n=[];if(t){for(let e of Object.keys(t))if(!(e.startsWith(`_`)||t[e]===null||t[e]===void 0)){if(e===`Disk size`&&typeof t[`Disk free`]==`number`)n.push(this.renderDiskRow(t));else if(e===`Disk free`&&typeof t[`Disk size`]==`number`)continue;else n.push(this.renderHostInfoRow(e,t))}}return{el:C(k,{sx:Q.hostInfoStats,children:n.map(e=>E(m.Fragment,{children:[C(k,{sx:Q.hostInfoIcon,children:lt(e.name,t||{})}),C(k,{sx:Q.hostStatLabel,children:st(this.t(e.name))}),C(k,{sx:Q.hostInfoValue,children:e.value??e.text})]},e.name))}),text:n.map(e=>`${st(this.t(e.name))}: ${e.text}`).join(`
|
|
2
|
+
`)}}async getData(e){try{let t=await this.props.socket.getSystemConfig(e),n=await this.props.socket.getCompactHosts(e),r=await this.getInstances(e,n,t);this.setState({instances:r.instances,hosts:n,deactivated:r.deactivated,introLinks:t&&t.native&&t.native.introLinks?t.native.introLinks:[]});let i=await this.getHostsData(n);await new Promise(e=>{this.setState(i,()=>e())})}catch(t){if(String(window.NEXOWATT_EOS_ACCESS_ROLE||`unknown`).toLowerCase()!==`admin`){try{let t=await this.getInstances(e,[],{common:{intro:[]},native:{introLinks:[]}});this.setState({instances:t.instances,hosts:[],deactivated:t.deactivated,introLinks:[],hostsData:{},alive:{}})}catch{this.setState({instances:[],hosts:[],deactivated:[],introLinks:[],hostsData:{},alive:{}})}return}window.alert(`Cannot get data: ${t}`)}}renderCopiedToast(){return C(Se,{anchorOrigin:{vertical:`bottom`,horizontal:`left`},open:this.state.openSnackBar,autoHideDuration:3e3,onClose:()=>this.setState({openSnackBar:!1}),message:this.t(`copied`)})}getOverviewRoleConfig(){let e=String(window.NEXOWATT_EOS_ACCESS_ROLE||`unknown`).toLowerCase();return e===`installer`||e===`installateur`?{role:`installer`,label:`Installateur`,text:`Inbetriebnahme, Fehlersuche, Geräte- und EMS-Diagnose – mit deinen freigegebenen Installateurrechten.`,admin:!1}:e!==`admin`&&e!==`service`?{role:`enduser`,label:`Endkunde`,text:`Energie, Laden, Gebäude und die aktuellen EMS-Entscheidungen auf einen Blick.`,admin:!1}:{role:`admin`,label:`Admin / Service`,text:`Systemstatus, Module, Dienste und Anlagenzugänge in einer modernen Serviceübersicht.`,admin:!0}}render(){return this.state.instances?E(b,{elevation:0,overflow:`visible`,children:[this.renderCopiedToast(),E(`section`,{id:`eos-native-overview-hero`,className:`eos-overview-hero eos-native-overview-hero`,"data-eos-native-react-overview":`true`,children:[E(`div`,{children:[C(`span`,{className:`eos-overview-eyebrow`,children:`NexoWatt EOS`}),C(`h1`,{children:`Übersicht`}),C(`p`,{children:this.getOverviewRoleConfig().text})]}),E(`div`,{className:`eos-overview-role`,"data-nexowatt-overview-role":this.getOverviewRoleConfig().role,children:[C(`span`,{className:`eos-overview-status-dot`}),this.getOverviewRoleConfig().label]})]}),this.state.nodeUpdateDialog?C(Ze,{onClose:()=>this.setState({nodeUpdateDialog:null}),socket:this.props.socket,...this.state.nodeUpdateDialog}):null,E(c,{container:!0,className:`eos-native-intro-grid`,spacing:2,sx:Q.cards,children:[this.getInstancesCards(),this.getLinkCards(),C(at,{socket:this.props.socket,t:this.props.t,lang:this.props.lang,theme:this.props.theme}),this.getOverviewRoleConfig().admin?C(`div`,{className:`eos-overview-edit-controls`,children:this.getButtons()}):null]}),this.getOverviewRoleConfig().admin?this.editLinkCard():null]}):C(oe,{})}static preprocessHostData(e){var t;if((t=e.dockerInformation)!=null&&t.isDocker){let t=e.dockerInformation.isOfficial?`official image`:`unofficial image`;e.dockerInformation.isOfficial&&(t+=` - ${e.dockerInformation.officialVersion}`),e.Platform=`${e.Platform} (${t})`}return delete e.dockerInformation,e}};export{pt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Os as e,Us as t}from"./loadShare-eager-BpwDZfDr.js";var n=e(t(`path`,{d:`M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2zm-1 7h5.5L14 6.5z`}),`FileCopy`),r=e(t(`path`,{d:`M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z`}),`KeyboardArrowRight`);export{n,r as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$i as e,Br as t,Bs as n,Ds as r,Es as i,Fo as a,Fs as o,Ga as s,Gr as c,Hs as l,Ji as u,Kr as d,Ln as f,Ls as p,Mo as ee,No as m,On as h,Rr as te,Ua as g,Us as _,Vo as v,Wa as ne,Ws as y,Yn as b,Zo as x,_o as S,bo as C,br as w,da as re,eo as T,ho as E,io as D,jo as O,kn as k,lo as A,mo as j,ms as M,nc as ie,no as N,oo as P,os as F,qa as I,qo as L,ro as R,si as z,ss as B,to as V,ua as H,uo as U,zr as W}from"./loadShare-eager-BpwDZfDr.js";import{t as G}from"./DeleteForever-Caoe64_y.js";import{t as K}from"./TextSnippet-BQ4TSmvS.js";import{t as q}from"./AdminUtils-CopxRJZ2.js";import{D as J,k as ae}from"./bootstrap-DSDOwKWU.js";r();var Y=3e3,oe=RegExp(`\x1B\\[\\d+m`,`g`),X=[0,1,6,24,72,168,720],se=24,ce=12e4,Z={container:{height:`100%`},table:{tableLayout:`fixed`,minWidth:960,"& td,th":{padding:`3px 4px`},"& td:nth-of-type(5)":{overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},"& td:last-of-type":{overflowWrap:`anywhere`}},row:{"@media screen and (max-width: 450px)":{"& > *":{fontSize:`8px !important`}}},rowOdd:e=>({backgroundColor:e.palette.background.default}),cell:{verticalAlign:`top`},cellName:{lineHeight:`14px`},updatedRow:{animation:`updated 1s`},formControl:{width:`100%`,"@media screen and (max-width: 450px)":{"& > *":{fontSize:`10px !important`},position:`relative`}},light_error:{color:n[800]},light_warn:{color:p[800]},light_debug:{color:o[800]},light_silly:{color:o[700]},dark_error:{color:n[200]},dark_warn:{color:p[200]},dark_debug:{color:`#b1b1b1`},dark_silly:{color:`#7e7e7e`},source:{width:200,"@media screen and (max-width: 450px)":{width:120}},pid:{width:55,"@media screen and (max-width: 450px)":{width:40}},timestamp:{width:175,"@media screen and (max-width: 450px)":{width:100}},severity:{width:80,"@media screen and (max-width: 450px)":{width:61}},message:{minWidth:300,"@media screen and (max-width: 450px)":{minWidth:150}},hidden:{display:`none`},grow:{flexGrow:1},logSize:{marginRight:`1rem`,marginLeft:`1rem`},logEstimated:{fontStyle:`italic`},closeButton:e=>({position:`absolute`,right:8,top:8,color:e.palette.grey[500]}),header:e=>({"& .MuiFormLabel-root.Mui-disabled":{color:e.palette.text.primary},"& .MuiInput-underline::before":{content:`""`,borderBottom:`none`},"@media screen and (max-width: 450px)":{"& > *":{fontSize:`10px !important`}}}),pauseButton:{minWidth:48},pauseCount:{color:p[500]},downloadLogSize:{color:o[500],marginLeft:16},downloadEntry:{display:`flex`,justifyContent:`space-between`},pidSize:{fontSize:14,width:24,height:24,display:`flex`,alignItems:`center`},messageText:{"@media screen and (max-width: 450px)":{"& > *":{fontSize:`10px !important`}}},badge:{top:10,right:10},badgeError:{},badgeWarn:{backgroundColor:p[500]},emptyButton:{width:48},icon:{width:16,height:16},iconSelect:{width:24,height:25,marginRight:4},name:{verticalAlign:`top`,display:`inline-block`,marginTop:1,marginLeft:2,overflow:`hidden`,whiteSpace:`nowrap`,width:`100%`,textOverflow:`ellipsis`},iconAndName:{whiteSpace:`nowrap`,display:`flex`},tooltip:{pointerEvents:`none`},searchError:e=>({color:e.palette.error.main,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,maxWidth:400}),searchTruncated:e=>({color:e.palette.warning.main,width:16,height:16,verticalAlign:`text-bottom`,marginLeft:4}),searchProgress:{position:`absolute`,top:0,left:0,right:0,zIndex:3}},Q=[`#ffadad30`,`#ffd6a530`,`#fdffb630`,`#caffbf30`,`#9bf6ff30`,`#a0c4ff30`,`#bdb2ff30`,`#ffc6ff30`,`#fffffc30`],$=[`rgba(255,109,109,0.1)`,`rgba(253,173,84,0.1)`,`rgba(241,255,88,0.1)`,`rgba(115,253,81,0.1)`,`rgba(71,235,255,0.1)`,`rgba(74,145,255,0.1)`,`rgba(108,85,255,0.1)`,`rgba(250,77,250,0.1)`,`rgba(255,255,105,0.1)`],le=class n extends ie{constructor(e){super(e),i(this,`severities`,void 0),i(this,`t`,void 0),i(this,`ignoreNextLogs`,!1),i(this,`lastRowRender`,0),i(this,`lastRowRenderTimeout`,null),i(this,`readLogsInProcess`,!1),i(this,`hostsTimer`,null),i(this,`scrollToEnd`,void 0),i(this,`logsRequest`,0),i(this,`searchUntil`,0),i(this,`visibleRows`,0),i(this,`logHandler`,(e,t)=>{if(this.ignoreNextLogs){this.ignoreNextLogs=!1;return}if(this.searchUntil&&(e=e.filter(e=>e.ts>this.searchUntil),!e.length))return;let n=(this.state.logs||[]).concat(e);n.length>Y&&n.splice(0,n.length-Y);let r=0,i=0,a=!1,o,s=Object.keys(this.state.sources).length,c=this.props.themeType===`dark`?$:Q;n.forEach(e=>{if(e.odd===void 0?(a=!a,e.odd=a):a=e.odd,!e.time){let t=new Date(e.ts);e.time=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,`0`)}-${t.getDate().toString().padStart(2,`0`)} ${t.getHours().toString().padStart(2,`0`)}:${t.getMinutes().toString().padStart(2,`0`)}:${t.getSeconds().toString().padStart(2,`0`)}.${t.getMilliseconds().toString().padStart(3,`0`)}`}if(e.severity===`error`?i++:e.severity===`warn`&&r++,e.from){var t,n;!this.state.sources[e.from]&&!(o!=null&&o[e.from])?(o||=JSON.parse(JSON.stringify(this.state.sources)),o[e.from]={active:!0,color:c[s%c.length],icon:this.getSourceIcon(e.from)},s++):!((t=this.state.sources[e.from])!=null&&t.active)&&!(o!=null&&(n=o[e.from])!=null&&n.active)&&(o||=JSON.parse(JSON.stringify(this.state.sources)),o[e.from].active=!0)}});let l={logs:n,logSize:(this.state.logSize??0)+t,estimatedSize:!0,logWarnings:r,logErrors:i};if(o&&(l.sources=o),this.state.reverse){let e=document.getElementById(`endOfLog`);this.scrollToEnd=!e||e.getBoundingClientRect().top<window.innerHeight}this.setState(l)}),this.state={source:(window._localStorage||window.localStorage).getItem(`Log.source`)||`1`,severity:(window._localStorage||window.localStorage).getItem(`Log.severity`)||`debug`,message:(window._localStorage||window.localStorage).getItem(`Log.message`)||``,reverse:(window._localStorage||window.localStorage).getItem(`Log.reverse`)===`true`,logDeleteDialog:!1,logDownloadDialog:null,logFiles:[],logs:null,logSize:null,logErrors:0,logWarnings:0,estimatedSize:!0,pause:0,pid:(window._localStorage||window.localStorage).getItem(`Logs.pid`)===`true`,colors:(window._localStorage||window.localStorage).getItem(`Logs.colors`)===`true`,adapters:{},sources:{},currentHost:this.props.currentHost,hosts:{},searchHours:0,searching:!1,searchError:``,searchTruncated:!1,searchInstance:``},this.scrollToEnd=this.state.reverse,this.severities={silly:0,debug:1,info:2,warn:3,error:4},this.t=e.t}prepareLogs(e){let t=0,n=0,r=!0,i=JSON.parse(JSON.stringify(this.state.sources));Object.values(i).forEach(e=>e.active=!1),e.forEach(e=>{if(r=!r,e.odd=r,!e.time){let t=new Date(e.ts);e.time=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,`0`)}-${t.getDate().toString().padStart(2,`0`)} ${t.getHours().toString().padStart(2,`0`)}:${t.getMinutes().toString().padStart(2,`0`)}:${t.getSeconds().toString().padStart(2,`0`)}.${t.getMilliseconds().toString().padStart(3,`0`)}`}e.severity===`error`?n++:e.severity===`warn`&&t++,e.from&&(i[e.from]?i[e.from].active=!0:i[e.from]={active:!0,icon:this.getSourceIcon(e.from)})});let a=0,o=this.props.themeType===`dark`?$:Q;return Object.keys(i).sort().forEach(e=>{i[e].color=o[a%o.length],a++}),{logErrors:n,logWarnings:t,sources:i}}readLogs(e,t,n){let r=++this.logsRequest;this.searchUntil=0,(this.state.searchHours||this.state.searching||this.state.searchError)&&this.setState({searchHours:0,searching:!1,searchError:``,searchTruncated:!1}),this.props.logsWorker&&this.state.hosts?this.props.logsWorker.getLogs(e,this.getRequestedLogLevel()).then(e=>{if(!e)return;if(r!==this.logsRequest){t?this.setState({logFiles:t},()=>n&&n()):n&&n();return}let i=[...e.logs];this.scrollToEnd=this.state.reverse;let a={logs:i,logSize:e.logSize,estimatedSize:!1,...this.prepareLogs(i)};t&&(a.logFiles=t),this.setState(a,()=>n&&n())}):t&&this.setState({logFiles:t},()=>n&&n())}isSearchPossible(){return!!this.state.searchInstance}static getLastSearchHours(){let e=parseInt((window._localStorage||window.localStorage).getItem(`Log.searchHours`)||``,10);return e&&X.includes(e)?e:se}async detectSearchInstance(){try{this.setState({searchInstance:await this.props.socket.getCurrentInstance()})}catch(e){console.warn(`Cannot find out the admin instance: ${e}`)}}async searchLogFiles(e){if(!this.isSearchPossible())return;e||=this.state.searchHours||n.getLastSearchHours();let t=++this.logsRequest;this.setState({searchHours:e,searching:!0,searchError:``});let r=this.state.source!==`1`&&this.state.sources[this.state.source]?this.state.source:void 0;try{var i;let n=await ae(this.props.socket,this.state.searchInstance,`admin:searchLogs`,{host:this.state.currentHost,hours:e,level:this.state.severity,source:r,text:this.state.message||void 0,maxRows:Y},ce);if(t!==this.logsRequest)return;if(!n||typeof n!=`object`||!Array.isArray(n.lines))throw Error((typeof n==`string`?n:n==null?void 0:n.error)||`no answer`);let a=[],o=0;for(let e of n.lines){let t=J(e);t&&(o&&o<=t.ts&&(t.key=o+1),o=t.key||0,t.message=q.parseColorMessage(t.message),a.push(t))}let s=n.until||Date.now();(i=this.state.logs)==null||i.forEach(e=>e.ts>s&&a.push(e)),a.length>Y&&a.splice(0,a.length-Y),this.searchUntil=s,this.scrollToEnd=this.state.reverse,this.setState({logs:a,searching:!1,searchTruncated:!!n.truncated,pause:0,...this.prepareLogs(a)})}catch(e){t===this.logsRequest&&this.setState({searching:!1,searchError:e.message||String(e)})}}handleSearchHoursChange(e){e?((window._localStorage||window.localStorage).setItem(`Log.searchHours`,e.toString()),this.searchLogFiles(e)):this.readLogs(!0)}onFilterChanged(){this.state.searchHours&&this.searchLogFiles()}exportLogs(){let e=[],t=this.state.message.toLowerCase(),n=this.state.source!==`1`&&this.state.sources[this.state.source]?this.state.source:`1`,r=this.state.logs||[],i=this.state.pause>0?this.state.pause:r.length;for(let a=0;a<i;a++){let i=r[a];if(i&&!this.getRowView(i,n,t).hidden){let t=typeof i.message==`object`?i.message.original:i.message;e.push(`${i.time} - ${i.severity}: ${(t||``).replace(oe,``)}`)}}this.state.reverse||e.reverse();let a=window.URL.createObjectURL(new Blob([`${e.join(`
|
|
2
|
+
`)}\n`],{type:`text/plain;charset=utf-8`})),o=document.createElement(`a`);o.href=a,o.download=`iobroker-log-${this.state.currentHost.replace(`system.host.`,``)}-${new Date().toISOString().replace(/[:.]/g,`-`)}.txt`,document.body.appendChild(o);try{o.click()}finally{o.remove(),setTimeout(()=>window.URL.revokeObjectURL(a),1e3)}}async readLogFiles(){let e=await this.props.socket.getLogsFiles(this.state.currentHost);if(e!=null&&e.length){let t=[];return e.reverse(),e.forEach(e=>{let n=(e.fileName.split(`/`).pop()||``).replace(/iobroker\.?/,``).replace(`.log`,``);n[0]<=`9`&&t.push({path:e,name:n})}),e.sort(),e.forEach(e=>{let n=(e.fileName.split(`/`).pop()||``).replace(/iobroker\.?/,``).replace(`.log`,``);n[0]>`9`&&t.push({path:e,name:n})}),t}return[]}componentDidMount(){this.props.logsWorker.registerHandler(this.logHandler),this.props.clearErrors(),this.props.socket.getCompactAdapters().then(async e=>{let t=await this.props.socket.getCompactHosts(),n={};t.forEach(e=>n[e._id]=e),await new Promise(t=>{this.setState({adapters:e,hosts:n},()=>t())});let r=await this.readLogFiles();this.readLogs(!0,r)}),this.detectSearchInstance()}componentWillUnmount(){this.props.logsWorker.unregisterHandler(this.logHandler),this.props.clearErrors()}getSourceIcon(e){var t;let n=e.replace(/\.\d+$/,``),r=(t=this.state.adapters[n])==null?void 0:t.icon;if(r)r.startsWith(`data:image`)||(r=`./files/${n}.admin/${r}`);else if(this.state.hosts){var i;r=((i=this.state.hosts[`system.${e}`])==null||(i=i.common)==null?void 0:i.icon)||`img/no-image.svg`}return r||``}clearLog(){var e;(e=this.props.logsWorker)==null||e.clearLines(),this.props.clearErrors(),this.logsRequest++,this.searchUntil=0,this.setState({logs:[],logSize:null,logErrors:0,logWarnings:0,searchHours:0,searching:!1,searchError:``,searchTruncated:!1})}handleMessageChange(e){(window._localStorage||window.localStorage).setItem(`Log.message`,e.target.value),this.setState({message:e.target.value})}handleSourceChange(e){(window._localStorage||window.localStorage).setItem(`Log.source`,e),this.setState({source:e},()=>this.onFilterChanged())}getRequestedLogLevel(){let e=this.state.severity;return e===`silly`||e===`debug`?void 0:e}handleSeverityChange(e){(window._localStorage||window.localStorage).setItem(`Log.severity`,e.target.value),this.setState({severity:e.target.value},()=>this.state.searchHours?this.onFilterChanged():this.readLogs(!0))}handleLogDelete(){this.props.socket.delLogs(this.state.currentHost).then(()=>this.clearLog()).then(()=>this.readLogs(!0,void 0,()=>this.setState({logDeleteDialog:!1}))).catch(e=>{this.setState({logDeleteDialog:!1}),window.alert(e)})}handleLogPause(){var e;this.setState({pause:this.state.pause?0:((e=this.state.logs)==null?void 0:e.length)??0})}static openTab(e){var t;(t=window.open(e,`_blank`))==null||t.focus()}getLogFiles(){return this.state.logFiles.map(e=>y(B,{style:Z.downloadEntry,onClick:()=>{n.openTab(e.path.fileName),this.setState({logDownloadDialog:null})},children:[e.name,_(E,{style:Z.downloadLogSize,variant:`caption`,children:q.formatBytes(e.path.size)||`-`})]},e.name))}getSeverities(){let e=[];for(let t in this.severities)e.push(_(B,{value:t,style:Z[`${this.props.themeType}_${t}`],children:t},t));return e}getSources(){let e=Object.keys(this.state.sources).sort();return e.unshift(`1`),e.map(e=>y(B,{value:e,style:{backgroundColor:!this.state.colors||e===`1`?void 0:this.state.sources[e].color,display:`flex`,alignItems:`center`},children:[e===`1`?null:_(w,{src:this.state.sources[e].icon||``,style:Z.iconSelect}),e===`1`?this.t(`Source (show all)`):e]},e))}getOneRow(e,t,n){var r,i,a;let o=(r=this.state.logs)==null?void 0:r[e];if(!o)return;let s=o.severity,{message:l,id:u,hidden:d}=this.getRowView(o,n.sourceFilter,n.filterMessage);d||n.visible++;let f=n.previousKey===o.key?e:o.key??e;n.previousKey=o.key??0,t.push(y(P,{id:n.length===e?`endOfLog`:void 0,sx:c.getStyle(this.props.theme,Z.row,o.odd&&Z.rowOdd,d&&Z.hidden,this.lastRowRender&&o.ts>this.lastRowRender&&Z.updatedRow),style:this.state.colors?{backgroundColor:((i=this.state.sources[o.from])==null?void 0:i.color)||void 0}:{},hover:!0,children:[_(N,{style:{...Z.cell,...Z.cellName},children:y(`div`,{style:Z.iconAndName,children:[_(w,{src:((a=this.state.sources[o.from])==null?void 0:a.icon)||``,style:Z.icon}),_(`div`,{style:Z.name,children:o.from})]})}),this.state.pid&&_(N,{style:{...Z.cell,...Z[`${this.props.themeType}_${s}`]},children:u}),_(N,{style:{...Z.cell,...Z[`${this.props.themeType}_${s}`]},children:o.time}),_(N,{style:{...Z.cell,...Z[`${this.props.themeType}_${s}`],fontWeight:`bold`},children:o.severity}),_(N,{style:{...Z.cell,...Z[`${this.props.themeType}_${s}`]},title:typeof l==`object`?l.original:l,children:typeof l==`object`?l.parts.map((e,t)=>_(`span`,{style:e.style,children:e.text},t)):l})]},n.keyPrefix+f))}getRowView(e,t,n){let r=e.message||``,i=``;if(typeof r!=`object`){let t=RegExp(`${e.from.replace(`.`,`\\.`).replace(`)`,`\\)`).replace(`(`,`\\(`)} \\(\\d+\\) `,`g`),n=r.match(t);n?(r=r.replace(n[0],``),i=(n[0].split(` `)[1].match(/\d+/g)||[``])[0]):r=r.replace(`${e.from} `,``)}let a=t!==`1`&&t!==e.from||this.severities[e.severity]<this.severities[this.state.severity];return!a&&n&&(a=typeof r==`object`?!r.original.toLowerCase().includes(n):!r.toLowerCase().includes(n)),{message:r,id:i,hidden:a}}getRows(){var e;let t=[],n={filterMessage:this.state.message.toLowerCase(),sourceFilter:this.state.source,previousKey:0,keyPrefix:``,length:0,visible:0},r=Object.keys(this.state.sources).sort();if(r.unshift(`1`),r.includes(n.sourceFilter)||(n.sourceFilter=`1`),n.previousKey=0,n.keyPrefix=this.state.reverse?`r`:``,n.length=this.state.pause>0?this.state.pause-1:(((e=this.state.logs)==null?void 0:e.length)??0)-1,this.state.reverse)for(let e=0;e<=n.length;e++)this.getOneRow(e,t,n);else for(let e=n.length;e>=0;e--)this.getOneRow(e,t,n);return n.length>0&&this.scrollToEnd&&(setTimeout(()=>{let e=document.getElementById(`endOfLog`);e==null||e.scrollIntoView()},200),this.scrollToEnd=!1),(!this.lastRowRender||Date.now()-this.lastRowRender>1e3)&&(this.lastRowRenderTimeout||=setTimeout(()=>{this.lastRowRenderTimeout=null,this.lastRowRender=Date.now()},1e3)),this.visibleRows=n.visible,t}renderClearDialog(){return this.state.logDeleteDialog?y(O,{onClose:()=>this.setState({logDeleteDialog:!1}),open:!0,children:[y(a,{children:[this.t(`Please confirm`),_(L,{size:`large`,sx:Z.closeButton,onClick:()=>this.setState({logDeleteDialog:!1}),children:_(I,{})})]}),_(m,{dividers:!0,children:_(E,{gutterBottom:!0,children:this.t(`Log file will be deleted. Are you sure?`)})}),y(ee,{children:[_(C,{variant:`contained`,autoFocus:!0,onClick:()=>this.handleLogDelete(),color:`primary`,startIcon:_(s,{}),children:this.t(`Ok`)}),_(C,{variant:`contained`,onClick:()=>this.setState({logDeleteDialog:!1}),color:`grey`,startIcon:_(I,{}),children:this.t(`Cancel`)})]})]}):null}changePid(){let e=!this.state.pid;(window._localStorage||window.localStorage).setItem(`Logs.pid`,e?`true`:`false`),this.setState({pid:e})}renderToolbar(){var e,n,r;let i=this.state.pause?_(E,{style:Z.pauseCount,children:(((e=this.state.logs)==null?void 0:e.length)??0)-this.state.pause}):_(f,{}),a=this.props.width===`xs`||this.props.width===`sm`,o=a?_(L,{color:`primary`,onClick:e=>this.setState({logDownloadDialog:e.currentTarget}),children:_(H,{})}):_(C,{variant:`contained`,color:`primary`,startIcon:_(H,{}),onClick:e=>this.setState({logDownloadDialog:e.currentTarget}),children:this.t(`Download log`)});return y(t,{children:[this.props.menuButtonSpace?_(S,{sx:{width:40,flexShrink:0}}):null,_(j,{title:this.props.t(`Refresh log`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,onClick:()=>this.state.searchHours?void this.searchLogFiles():this.readLogs(!0),children:_(re,{})})}),_(j,{title:this.props.t(`Pause output`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,style:Z.pauseButton,onClick:()=>this.handleLogPause(),children:i})}),_(j,{title:this.props.t(`Clear log`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,onClick:()=>this.clearLog(),children:_(g,{})})}),_(j,{title:this.props.t(`Clear on disk permanent`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,onClick:()=>this.setState({logDeleteDialog:!0}),children:_(G,{})})}),_(j,{title:this.props.t(`Show/hide PID`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,onClick:()=>this.changePid(),color:this.state.pid?`primary`:`default`,children:_(`div`,{style:Z.pidSize,children:this.props.t(`PID`)})})}),_(j,{title:this.props.t(`Show/hide colors`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,onClick:()=>{(window._localStorage||window.localStorage).setItem(`Logs.colors`,this.state.colors?`false`:`true`),this.setState({colors:!this.state.colors})},color:this.state.colors?`primary`:`default`,children:_(u,{style:{width:`0.8em`,height:`0.8em`}})})}),_(j,{title:this.props.t(`Reverse output direction`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{size:`large`,onClick:()=>{(window._localStorage||window.localStorage).setItem(`Log.reverse`,this.state.reverse?`false`:`true`),this.setState({reverse:!this.state.reverse}),setTimeout(()=>{let e=document.getElementById(`endOfLog`);e==null||e.scrollIntoView()},500)},color:this.state.reverse?`primary`:`default`,children:this.state.reverse?_(h,{}):_(k,{})})}),_(j,{title:this.props.t(`Show errors`),slotProps:{popper:{sx:Z.tooltip}},children:_(A,{badgeContent:this.state.logErrors,color:`error`,sx:{"& .MuiBadge-badge":{...Z.badge,...Z.badgeError}},children:_(L,{size:`large`,onClick:()=>{this.state.severity===`error`?this.setState({severity:`debug`},()=>this.onFilterChanged()):this.setState({severity:`error`,logErrors:0},()=>this.onFilterChanged())},color:this.state.severity===`error`?`primary`:`default`,children:_(ne,{})})})}),_(j,{title:this.props.t(`Show errors and warnings`),slotProps:{popper:{sx:Z.tooltip}},children:_(A,{badgeContent:this.state.logWarnings,color:`default`,sx:{"& .MuiBadge-badge":{...Z.badge,...Z.badgeWarn}},children:_(L,{size:`large`,onClick:()=>{this.state.severity===`warn`?this.setState({severity:`debug`},()=>this.onFilterChanged()):this.setState({severity:`warn`,logWarnings:0},()=>this.onFilterChanged())},color:this.state.severity===`warn`?`primary`:`default`,children:_(z,{})})})}),_(j,{title:this.props.t(`Export the shown entries as a text file`),slotProps:{popper:{sx:Z.tooltip}},children:_(`span`,{children:_(L,{size:`large`,disabled:!((n=this.state.logs)!=null&&n.length),onClick:()=>this.exportLogs(),children:_(K,{})})})}),_(`div`,{style:Z.grow}),(r=this.state.logFiles)!=null&&r.length?o:null,this.state.logDownloadDialog?_(F,{id:`simple-menu`,anchorEl:this.state.logDownloadDialog,keepMounted:!0,open:!!this.state.logDownloadDialog,onClose:()=>this.setState({logDownloadDialog:null}),children:this.getLogFiles()}):null,a?null:_(`div`,{style:Z.grow}),a?null:this.renderLogInfo(),_(S,{sx:{ml:`auto`,pl:1},children:this.props.hostSelector})]})}renderLogInfo(){return this.state.searchError?_(E,{variant:`body2`,sx:[Z.logSize,Z.searchError],title:this.state.searchError,children:this.t(`Search failed: %s`,this.state.searchError)}):this.state.searchHours?y(E,{variant:`body2`,style:Z.logSize,children:[this.t(`Hits: %s`,this.state.searching?`…`:this.visibleRows),this.state.searchTruncated&&!this.state.searching?_(j,{title:this.t(`Only the newest %s hits are shown`,Y),slotProps:{popper:{sx:Z.tooltip}},children:_(S,{component:z,sx:Z.searchTruncated})}):null]}):y(E,{variant:`body2`,title:this.state.estimatedSize?this.props.t(`Estimated size`):``,style:Z.logSize,children:[this.t(`Log size:`),` `,_(`span`,{style:this.state.estimatedSize?Z.logEstimated:void 0,children:this.state.logSize===null?`-`:q.formatBytes(this.state.logSize)})]})}renderTimeHeader(){return _(j,{title:this.t(`Search the log files in this time range`),placement:`top`,slotProps:{popper:{sx:Z.tooltip}},children:_(v,{variant:`standard`,style:Z.formControl,children:_(M,{variant:`standard`,value:this.state.searchHours,disabled:!this.isSearchPossible(),onChange:e=>this.handleSearchHoursChange(Number(e.target.value)),children:X.map(e=>_(B,{value:e,children:e?e===1?this.t(`1 hour`):e<72?this.t(`%s hours`,e):this.t(`%s days`,e/24):this.t(`Latest entries`)},e))})})})}renderTableHeader(){let t=Object.keys(this.state.sources).sort();return t.unshift(`1`),_(D,{children:y(P,{children:[_(N,{sx:Z.source,children:y(v,{variant:`standard`,sx:Z.formControl,children:[_(M,{variant:`standard`,labelId:`source-label`,value:t.includes(this.state.source)?this.state.source:`1`,onChange:e=>this.handleSourceChange(e.target.value),renderValue:e=>y(`div`,{style:{backgroundColor:!this.state.colors||e===`1`?void 0:this.state.sources[e].color,display:`flex`,alignItems:`center`},children:[e===`1`?null:_(w,{src:this.state.sources[e].icon||``,style:Z.iconSelect}),e===`1`?this.t(`Source`):e]}),children:this.getSources()}),(t.includes(this.state.source)?this.state.source:`1`)===`1`?null:_(L,{sx:{position:`absolute`,top:1,right:15,zIndex:1},size:`small`,onClick:()=>this.handleSourceChange(`1`),children:_(e,{})})]})}),this.state.pid&&_(N,{sx:Z.pid,children:_(S,{component:`div`,sx:Z.header,children:this.t(`PID`)})}),_(N,{sx:Z.timestamp,children:this.renderTimeHeader()}),_(N,{sx:Z.severity,children:_(v,{variant:`standard`,style:Z.formControl,children:_(M,{variant:`standard`,labelId:`severity-label`,value:this.state.severity,onChange:e=>this.handleSeverityChange(e),renderValue:e=>_(`span`,{style:Z[`${this.props.themeType}_${e}`],children:e}),children:this.getSeverities()})})}),_(N,{sx:Z.message,children:_(v,{variant:`standard`,style:Z.formControl,children:_(U,{variant:`standard`,sx:Z.messageText,placeholder:this.t(`Message`),onChange:e=>this.handleMessageChange(e),onKeyDown:e=>{e.key===`Enter`&&this.searchLogFiles()},value:this.state.message,slotProps:{input:{endAdornment:y(l,{children:[this.state.message?_(L,{tabIndex:-1,size:`small`,onClick:()=>{(window._localStorage||window.localStorage).removeItem(`Log.message`),this.setState({message:``})},children:_(I,{})}):null,this.isSearchPossible()?_(j,{title:this.t(`Search in the log files (Enter)`),slotProps:{popper:{sx:Z.tooltip}},children:_(L,{tabIndex:-1,size:`small`,disabled:this.state.searching,onClick:()=>this.searchLogFiles(),children:_(b,{})})}):null]})}}})})})]})})}render(){if(!this.state.logs)return _(x,{});this.state.logFiles===null&&!this.readLogsInProcess&&(this.readLogsInProcess=!0,setTimeout(()=>this.readLogFiles().then(e=>{this.readLogsInProcess=!1,this.setState({logFiles:e})}),100)),this.props.currentHost!==this.state.currentHost&&(this.hostsTimer=this.hostsTimer||setTimeout(()=>{this.hostsTimer=null,this.setState({currentHost:this.props.currentHost,logs:[],logFiles:[]},()=>this.readLogs(!0))},200));let e=this.getRows();return y(te,{children:[this.renderToolbar(),y(W,{style:{position:`relative`},children:[this.state.searching?_(x,{sx:Z.searchProgress}):null,_(R,{style:Z.container,children:y(T,{stickyHeader:!0,size:`small`,sx:Z.table,children:[this.renderTableHeader(),_(V,{children:e})]})})]}),this.renderClearDialog()]})}},ue=d()(le);export{ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Os as e,Us as t}from"./loadShare-eager-BpwDZfDr.js";var n=e(t(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z`}),`AddBox`),r=e(t(`path`,{d:`M8 11h8v2H8zm12.1 1H22c0-2.76-2.24-5-5-5h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M19 12h-2v3h-3v2h3v3h2v-3h3v-2h-3z`}),`AddLink`),i=e(t(`path`,{d:`M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z`}),`Fullscreen`),a=e(t(`path`,{d:`M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z`}),`FullscreenExit`),o=e(t(`path`,{d:`M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z`}),`GetApp`),s=e(t(`path`,{d:`M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z`}),`KeyboardArrowLeft`),c=e(t(`path`,{d:`M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2`}),`MoreHoriz`);export{i as a,a as i,s as n,r as o,o as r,n as s,c as t};
|