36 lines
4.0 KiB
JavaScript
36 lines
4.0 KiB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{er as t,hi as n,mi as r}from"./control-ui-foundation-CeFMP1Ly.js";import{Da as i,To as a,b as o,ba as s,fl as c,ja as l,ml as u,va as d,vr as f,w as p,xo as m,ya as h,yr as g}from"./control-ui-core-pH6nakZ-.js";import{G as _,J as v,W as y,Z as b,at as x,h as S,m as C}from"./lit-runtime-BEtFSUCp.js";import{Cn as w,ln as T,m as E,p as D}from"./control-ui-core-DGVkFhVB.js";import{Ht as O,Lt as k,Rt as A,qt as j}from"./control-ui-core-Br5DB0Zj.js";import{In as M,Ln as N}from"./control-ui-boot-wpHCbPL9.js";import{as as P,is as F}from"./control-ui-boot-Cdpgu1Gm.js";import{n as I,t as L}from"./settings-workspace-Bo4nqRhI.js";function R(e){let t=e.result?.sessions??[];return e.error&&!e.result?_:t.length===0?v`<section class="card stack" data-dashboards-empty role="status">
|
|
<div class="list-title">${j(`dashboardsPage.emptyTitle`)}</div>
|
|
<div class="card-sub">${j(`dashboardsPage.emptyDescription`)}</div>
|
|
</section>`:v`<section class="card stack">
|
|
<div class="list" aria-label=${w(`dashboards`)}>
|
|
${S(t,e=>e.key,t=>{let r=l({face:`dashboard`,sessionKey:t.key,fallbackAgentId:e.fallbackAgentId,basePath:e.basePath,row:t,mainKey:e.mainKey}),i=n({kind:`dashboard`,path:r.href},e.basePath)??r.href;return v`<div class="list-item" data-dashboard-session=${t.key}>
|
|
<a class="list-main list-item-clickable" href=${r.href}>
|
|
<span class="list-title">${a(t.key,t)}</span>
|
|
<span class="list-sub">${t.key}</span>
|
|
</a>
|
|
<span class="list-meta">
|
|
${t.updatedAt?o(t.updatedAt):_}
|
|
<a
|
|
class="btn btn--ghost"
|
|
data-dashboard-fullscreen=${t.key}
|
|
href=${i}
|
|
aria-label=${j(`dashboardsPage.openFocusMode`)}
|
|
>
|
|
${k.maximize} ${j(`dashboardsPage.openFocusMode`)}
|
|
</a>
|
|
</span>
|
|
</div>`})}
|
|
</div>
|
|
</section>`}function z(e,t){let n=e?v`
|
|
${P({status:{error:e.error,hasLoaded:e.result!==null,stale:e.result!==null&&e.error!==null},errorMessage:e.error?j(`dashboardsPage.loadError`,{error:e.error}):void 0,onRetry:t})}
|
|
${R(e)}
|
|
`:v`<section class="card" aria-busy="true">${j(`common.loading`)}</section>`;return v`
|
|
<section class="content-header">
|
|
<div>
|
|
<div class="page-title">${w(`dashboards`)}</div>
|
|
<div class="page-sub">${j(`subtitles.dashboards`)}</div>
|
|
</div>
|
|
</section>
|
|
${I(n)}
|
|
`}function B(){return(B=e((()=>{r(),y(),C(),T(),A(),F(),L(),O(),p(),m(),i()})))()}var V;function H(){return(H=e((()=>{N(),b(),E(),u(),g(),s(),B(),V=class extends c{constructor(...e){super(...e),this.subscriptions=new f(this).effect(()=>this.context?.agentSelection,e=>(this.bindList(),e.subscribe(()=>this.bindList())))}disconnectedCallback(){this.unsubscribeList?.(),this.unsubscribeList=void 0,this.observedSessions=void 0,this.observedScopeId=void 0,this.subscriptions.clear(),super.disconnectedCallback()}willUpdate(e){e.has(`routeData`)&&(this.data=this.routeData),this.bindList()}bindList(){let e=this.context;if(!e)return;let t=e.sessions,n=e.agentSelection.state.scopeId?.trim()||null;if(t===this.observedSessions&&n===this.observedScopeId)return;this.unsubscribeList?.(),this.observedSessions=t,this.observedScopeId=n;let r=d(e),i=r=>{this.context!==e||this.observedSessions!==t||this.observedScopeId!==n||!r.result&&!r.error||(this.data=h(e,r),this.requestUpdate())};this.unsubscribeList=t.subscribeList(r,i);let a=t.listSnapshot(r);i(a),!a.result&&!a.loading&&e.gateway.snapshot.phase===`connected`&&t.refreshList({...r,force:!0})}render(){return z(this.data,()=>{let e=this.context;e?.gateway.snapshot.phase===`connected`&&e.sessions.refreshList({...d(e),force:!0})})}},t([M({context:D,subscribe:!0})],V.prototype,`context`,void 0),t([x({attribute:!1})],V.prototype,`routeData`,void 0),customElements.get(`openclaw-dashboards-page`)||customElements.define(`openclaw-dashboards-page`,V)})))()}H();
|
|
//# sourceMappingURL=dashboards-page-BIioM_7T.js.map
|