@lacneu/atrium 0.90.0 → 0.91.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessTab-Cwu9fJwI.js +1 -0
- package/dist/assets/AdvancedFilter-DWYTua7e.js +1 -0
- package/dist/assets/AgentFilesTab-DaYXJcuZ.js +3 -0
- package/dist/assets/AnomaliesTab-RKY5LYNV.js +1 -0
- package/dist/assets/AuditTab-CqLksOpr.js +1 -0
- package/dist/assets/BridgeTab-1RNCxXv2.js +1 -0
- package/dist/assets/ChatDefaultsTab-BuS1Ihhq.js +1 -0
- package/dist/assets/{DataTableShell-8D6YsZBo.js → DataTableShell-Dc3I5mkG.js} +1 -1
- package/dist/assets/{DetailChips-CcoyXRh4.js → DetailChips-Cj0X9b5z.js} +1 -1
- package/dist/assets/FeedbacksTab-CmhVA188.js +1 -0
- package/dist/assets/FieldLabel-BVUMb8MI.js +1 -0
- package/dist/assets/FilesTab-Bs-qAb6x.js +1 -0
- package/dist/assets/{FilterBar-6mIwprKY.js → FilterBar-Bfu-khK5.js} +1 -1
- package/dist/assets/GroupsTab-BblkD-Mw.js +1 -0
- package/dist/assets/InstancesTab-CykKru2n.js +1 -0
- package/dist/assets/IntegrationsTab-BGvWPcJJ.js +1 -0
- package/dist/assets/KpiTab-0-fYoy76.js +1 -0
- package/dist/assets/PreferencesTab-B7rx5jxG.js +1 -0
- package/dist/assets/ProjectPage-DeOofCgG.js +1 -0
- package/dist/assets/PromptInjectionsTab-iKx77mc6.js +4 -0
- package/dist/assets/RolesTab-CdpxcL32.js +1 -0
- package/dist/assets/ScheduledTab-mr_m7UIj.js +1 -0
- package/dist/assets/ServiceAccountsTab-Do5kRXXv.js +1 -0
- package/dist/assets/SubAgentReportsTab-DjKyJxXi.js +1 -0
- package/dist/assets/ThemeShowroom-wAQ75k0V.js +1 -0
- package/dist/assets/{TimeRangePicker-BIm9hRiV.js → TimeRangePicker-BqClp5BN.js} +1 -1
- package/dist/assets/{TimezoneCombobox-C8tkxJ_H.js → TimezoneCombobox-yZPA1ePa.js} +1 -1
- package/dist/assets/TracesTab-n_5fNBHX.js +1 -0
- package/dist/assets/TrashPage-DKaJKpYI.js +1 -0
- package/dist/assets/TrashTab-C5EAGQ-A.js +1 -0
- package/dist/assets/UsersTab-DIGrBmUm.js +1 -0
- package/dist/assets/VoiceTab-CaHc9iZY.js +1 -0
- package/dist/assets/{api-DL5MhfCR.js → api-IF2KQFNF.js} +5 -5
- package/dist/assets/{button-7-8JjL3V.js → button-DDPt-po9.js} +1 -1
- package/dist/assets/{card-B9HCdDy6.js → card-K4Zt5gfO.js} +1 -1
- package/dist/assets/chevrons-up-down-8nG-pF3_.js +1 -0
- package/dist/assets/{compatView-BQHXVq4U.js → compatView-CVibrgBK.js} +1 -1
- package/dist/assets/dispatchErrorInfo-CO5iC4yd.js +1 -0
- package/dist/assets/{dist-CmEdak18.js → dist-821wRD_K.js} +1 -1
- package/dist/assets/{dist-CMTRgLex.js → dist-BblNQdHV.js} +1 -1
- package/dist/assets/{dist-MdvJ0IAD.js → dist-CRdE-dec.js} +1 -1
- package/dist/assets/{dist-ymPDWJRC.js → dist-Cwenjp6w.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-qjmkILAM.js → highlighted-body-OFNGDK62-rit1TAaB.js} +1 -1
- package/dist/assets/{index-D_CCXqB1.css → index-CkNmrzkS.css} +1 -1
- package/dist/assets/index-DaLXKABQ.js +446 -0
- package/dist/assets/{list-DtdIpxEW.js → list-9tuUpKq3.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-BOZxTT7y.js +1 -0
- package/dist/assets/{pdf-DUCWZnbJ.js → pdf-BZkOsg6N.js} +1 -1
- package/dist/assets/roleDescriptions-DBJFh3-K.js +1 -0
- package/dist/assets/{table-BTGgG4wx.js → table-CnU0GqDN.js} +1 -1
- package/dist/assets/{use_paginated_query-DuQlVoOP.js → use_paginated_query-DHl8KBoi.js} +1 -1
- package/dist/assets/x-F4mR_Xu3.js +1 -0
- package/dist/index.html +9 -9
- package/package.json +1 -1
- package/dist/assets/AccessTab-mwOa46GI.js +0 -1
- package/dist/assets/AdvancedFilter-CElVO-tV.js +0 -1
- package/dist/assets/AgentFilesTab-CuOO1m34.js +0 -3
- package/dist/assets/AnomaliesTab-65bEIYCN.js +0 -1
- package/dist/assets/AuditTab-5r2mw5-1.js +0 -1
- package/dist/assets/BridgeTab-Dk2wuA3T.js +0 -1
- package/dist/assets/ChatDefaultsTab-Dj1wMzm-.js +0 -1
- package/dist/assets/FeedbacksTab-CWH2lPuA.js +0 -1
- package/dist/assets/FieldLabel-bgrA2Q9d.js +0 -1
- package/dist/assets/FilesTab-Db5uggRh.js +0 -1
- package/dist/assets/GroupsTab-BrqyEOB0.js +0 -1
- package/dist/assets/InstancesTab-Rk9a0RUX.js +0 -1
- package/dist/assets/IntegrationsTab-Dclo1rSa.js +0 -1
- package/dist/assets/KpiTab-CRbaxpEb.js +0 -1
- package/dist/assets/PreferencesTab-im6jqvtv.js +0 -1
- package/dist/assets/ProjectPage-CjC2fBK4.js +0 -1
- package/dist/assets/PromptInjectionsTab-DInOc6we.js +0 -4
- package/dist/assets/RolesTab-qQoydemP.js +0 -1
- package/dist/assets/ScheduledTab-DWXNWqAo.js +0 -1
- package/dist/assets/ServiceAccountsTab-Dh_oZo-S.js +0 -1
- package/dist/assets/SubAgentReportsTab-CsHEPcHZ.js +0 -1
- package/dist/assets/ThemeShowroom-C0MmY3pp.js +0 -1
- package/dist/assets/TracesTab-DsXHB1Vw.js +0 -1
- package/dist/assets/TrashPage-CBVMN6l3.js +0 -1
- package/dist/assets/TrashTab-CLvLvN7c.js +0 -1
- package/dist/assets/UsersTab-DeoCBWvJ.js +0 -1
- package/dist/assets/VoiceTab-Bz1b5XDw.js +0 -1
- package/dist/assets/chevrons-up-down-DdtxjO9Y.js +0 -1
- package/dist/assets/dispatchErrorInfo-pvavDSyx.js +0 -1
- package/dist/assets/index-D2_zMS9W.js +0 -327
- package/dist/assets/mermaid-GHXKKRXX-BZtSjHsR.js +0 -1
- package/dist/assets/roleDescriptions-B5tZMAnu.js +0 -1
- package/dist/assets/x-fp_NW5OK.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AM as r,BJ as i,Bj as a,CM as o,DM as s,EM as c,Gj as l,Hj as ee,Jj as u,Kj as te,OM as d,SM as f,TM as p,Uj as m,Vd as h,Vj as g,Wj as _,_M as v,aM as y,bM as b,cM as ne,dM as re,eM as ie,fM as ae,gM as oe,hM as x,iM as S,kM as C,lM as w,mM as T,nM as E,oM as D,pM as O,qj as k,rM as A,sM as j,t as M,tM as N,uM as P,vM as F,wM as I,xM as L,yM as R,zJ as z}from"./api-DL5MhfCR.js";import{t as B}from"./button-7-8JjL3V.js";import{Ht as V,In as H,Lt as U,Rt as W,Z as G,b as K,xt as q}from"./index-D2_zMS9W.js";import{t as J}from"./roleDescriptions-B5tZMAnu.js";var Y=t(e(),1),X=n(),Z=[{group:()=>r(),keys:[{key:`traces.read`,label:()=>p()},{key:`traces.read.content`,label:()=>I(),phi:!0},{key:`traces.write`,label:()=>o()}]},{group:()=>C(),keys:[{key:`kpi.read`,label:()=>p()},{key:`kpi.write`,label:()=>o()}]},{group:()=>d(),keys:[{key:`openclaw.query`,label:()=>f()},{key:`anomalies.read`,label:()=>L()},{key:`anomalies.report`,label:()=>b()}]},{group:()=>s(),keys:[{key:`chats.read`,label:()=>p()},{key:`selfheal`,label:()=>F()},{key:`media.repair`,label:()=>v()},{key:`feedback.respond`,label:()=>h()}]},{group:()=>c(),keys:[{key:`admin.manage`,label:()=>R()}]}],se=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function ce(){let e=i(M.apiKeys.listRoles,{}),t=z(M.apiKeys.createRole),n=z(M.apiKeys.ensureRolesSeeded),r=z(M.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(M.apiKeys.listRoles,{});r&&e.setQuery(M.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),o=G(),s=W(),[c,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)($),[h,v]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{s.error(x(),e)})},[n,s]);let b=e??[];async function C(e,t){if(Q(e.permissions))return;if(e.builtin){await o({title:T({name:e.name}),description:O(),confirmLabel:ae()});return}if(h.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];v(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){s.error(re(),e)}finally{v(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function F(){try{await t({key:f.key,name:f.name,description:f.description||void 0,permissions:[]}),p($),d(!1)}catch(e){s.error(P(),e)}}let I=e===void 0,L=!I&&b.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[w(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,ne(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,j()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:D()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{p($),d(!0)},children:y()})})]}),I?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:E()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?oe({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:b.map(e=>{let t=Q(e.permissions),n=h.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(U,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,N()]}):(0,X.jsx)(U,{variant:`secondary`,children:ie()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),se.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(q,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?u():n?k():r,onCheckedChange:()=>void C(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(K,{open:c,onOpenChange:d,title:te(),description:l(),canSubmit:!!(f.key&&f.name),onSubmit:F,submitLabel:_(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:m()}),(0,X.jsx)(V,{value:f.key,placeholder:ee(),onChange:e=>p({...f,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:g()}),(0,X.jsx)(V,{value:f.name,onChange:e=>p({...f,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:a()}),(0,X.jsx)(V,{value:f.description,onChange:e=>p({...f,description:e.target.value})})]})]})})]})}export{ce as RolesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$G as r,$K as i,AJ as a,AK as o,BG as s,BJ as c,CG as l,CK as u,DG as ee,DK as d,E as f,EG as p,EK as m,GG as h,HG as g,JG as te,KG as ne,LJ as _,MJ as v,MK as re,NK as ie,OG as ae,PK as oe,QG as y,SG as se,SK as ce,TG as le,TK as ue,UG as de,VG as fe,WG as pe,XG as b,YG as me,ZG as x,_G as he,aK as ge,aq as _e,bG as ve,bK as ye,cK as be,cq as xe,dK as Se,dq as Ce,eK as we,eq as Te,fG as Ee,fK as De,fq as Oe,gG as ke,gK as Ae,hG as je,iq as Me,jK as Ne,kG as Pe,kK as Fe,lK as Ie,lq as Le,mG as Re,mK as ze,mq as Be,nq as Ve,oG as He,oK as Ue,oq as We,pG as Ge,pK as Ke,pq as qe,qG as Je,rq as Ye,sK as Xe,sq as Ze,t as S,tq as Qe,uK as $e,uq as et,vG as tt,wG as nt,wK as rt,xG as it,xK as at,yG as ot,yK as st,zG as ct}from"./api-DL5MhfCR.js";import{t as lt}from"./list-DtdIpxEW.js";import{t as C}from"./button-7-8JjL3V.js";import{An as ut,At as dt,Dn as ft,Dt as pt,Ft as mt,Ht as ht,It as gt,Ln as _t,Lt as w,Mt as vt,Nt as yt,Ot as bt,Pt as xt,Rt as St,Tn as Ct,Xn as T,Xt as E,Yt as D,Zn as O,Zt as k,_t as wt,ct as A,dt as j,ft as Tt,gt as Et,ht as Dt,jn as Ot,jt as kt,kt as At,lt as M,mt as jt,pn as Mt,pt as Nt,st as N,tt as Pt,ut as P,yn as Ft}from"./index-D2_zMS9W.js";import{a as It,i as F,n as Lt,o as Rt,r as I,t as zt}from"./table-BTGgG4wx.js";import{t as Bt}from"./FilterBar-6mIwprKY.js";/* empty css */import{a as Vt,c as L,i as R,l as Ht,n as Ut,o as z,r as Wt,s as Gt,t as Kt,u as B}from"./TimezoneCombobox-C8tkxJ_H.js";var qt=f(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Jt=f(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),V=t(e(),1),H=n();function U(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function Yt({value:e,onChange:t}){let n=Ht(e),i=(0,V.useMemo)(()=>new Date,[]),[a,o]=(0,V.useState)(()=>({year:n?.year??i.getFullYear(),month:n?.month??i.getMonth()})),[s,c]=(0,V.useState)(!1),l=(0,V.useMemo)(()=>U(v()),[]),u=(0,V.useMemo)(()=>new Intl.DateTimeFormat(v(),{month:`long`,year:`numeric`}),[]),ee=(0,V.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]),d=L(a.year,a.month),f=n?.hour??9,p=n?.minute??0,m=(e,n,r,i,a)=>t(B(e,n,r,i,a)),h=(e,t,n)=>{o({year:e,month:t}),m(e,t,n,f,p)},g=e=>{let t=new Date(a.year,a.month+e,1);o({year:t.getFullYear(),month:t.getMonth()})},te=n===null?r():ee.format(new Date(n.year,n.month,n.day,n.hour,n.minute));return(0,H.jsxs)(D,{modal:!0,open:s,onOpenChange:c,children:[(0,H.jsx)(k,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:`oc-dtp__trigger`,"aria-label":we(),children:[(0,H.jsx)(qt,{size:14,"aria-hidden":!0,className:`oc-dtp__icon`}),(0,H.jsx)(`span`,{className:n===null?`oc-dtp__placeholder`:void 0,children:te})]})}),(0,H.jsxs)(E,{align:`start`,className:`oc-dtp__pop`,children:[(0,H.jsxs)(`div`,{className:`oc-dtp__head`,children:[(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":y(),onClick:()=>g(-1),children:(0,H.jsx)(O,{size:15,"aria-hidden":!0})}),(0,H.jsx)(`span`,{className:`oc-dtp__month`,children:u.format(new Date(a.year,a.month,1))}),(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__nav`,"aria-label":x(),onClick:()=>g(1),children:(0,H.jsx)(T,{size:15,"aria-hidden":!0})})]}),(0,H.jsxs)(`div`,{className:`oc-dtp__grid`,children:[l.map((e,t)=>(0,H.jsx)(`span`,{className:`oc-dtp__wd`,children:e},t)),d.map((e,t)=>{let r=n!==null&&n.year===e.year&&n.month===e.month&&n.day===e.day,a=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,H.jsx)(`button`,{type:`button`,className:`oc-dtp__day`+(e.inMonth?``:` oc-dtp__day--out`)+(r?` oc-dtp__day--sel`:``)+(a&&!r?` oc-dtp__day--today`:``),onClick:()=>h(e.year,e.month,e.day),children:e.day},t)})]}),(0,H.jsxs)(`div`,{className:`oc-dtp__time`,children:[(0,H.jsxs)(N,{value:String(f),onValueChange:e=>m(a.year,a.month,n?.day??i.getDate(),Number(e),p),children:[(0,H.jsx)(P,{size:`sm`,"aria-label":b(),children:(0,H.jsx)(j,{})}),(0,H.jsx)(A,{className:`oc-dtp__timeopts`,children:Array.from({length:24},(e,t)=>(0,H.jsx)(M,{value:String(t),children:String(t).padStart(2,`0`)},t))})]}),(0,H.jsx)(`span`,{className:`oc-dtp__colon`,children:`:`}),(0,H.jsxs)(N,{value:String(p),onValueChange:e=>m(a.year,a.month,n?.day??i.getDate(),f,Number(e)),children:[(0,H.jsx)(P,{size:`sm`,"aria-label":me(),children:(0,H.jsx)(j,{})}),(0,H.jsx)(A,{className:`oc-dtp__timeopts`,children:Array.from({length:60},(e,t)=>(0,H.jsx)(M,{value:String(t),children:String(t).padStart(2,`0`)},t))})]})]})]})]})}function W(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Xt(e,t,n){let r=e=>String(e).padStart(2,`0`);return`${e}-${r(t+1)}-${r(n)}`}function Zt(e){let t=new Map;for(let n of e){let e=W(n.atMs),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let e of t.values())e.sort((e,t)=>e.atMs-t.atMs);return t}function Qt(e,t,n){let r=new Map,i=new Date(t,n+1,0).getDate();for(let a=1;a<=i;a++){let i=e.get(Xt(t,n,a));i!==void 0&&i.length>0&&r.set(a,i.length)}return r}function $t(e){try{let t=new Intl.DateTimeFormat(e,{weekday:`narrow`});return Array.from({length:7},(e,n)=>t.format(new Date(2024,0,1+n)))}catch{return[`M`,`T`,`W`,`T`,`F`,`S`,`S`]}}function en(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+42);return{startMs:r.getTime(),endMs:i.getTime()}}function tn(e){return{startMs:new Date(e,0,1).getTime(),endMs:new Date(e+1,0,1).getTime()}}var G=3;function nn({events:e,mode:t,cursor:n,onModeChange:r,onCursorChange:i,onEventClick:a,footnote:o}){let s=v(),c=(0,V.useMemo)(()=>Zt(e),[e]),l=(0,V.useMemo)(()=>$t(s),[s]),u=(0,V.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`,year:`numeric`}),[s]),ee=(0,V.useMemo)(()=>new Intl.DateTimeFormat(s,{month:`long`}),[s]),d=(0,V.useMemo)(()=>new Intl.DateTimeFormat(s,{hour:`2-digit`,minute:`2-digit`}),[s]),f=new Date,p=e=>{if(t===`year`){i({year:n.year+e,month:n.month});return}let r=new Date(n.year,n.month+e,1);i({year:r.getFullYear(),month:r.getMonth()})},m=t===`year`?String(n.year):u.format(new Date(n.year,n.month,1));return(0,H.jsxs)(`div`,{className:`oc-cal`,children:[(0,H.jsxs)(`div`,{className:`oc-cal__head`,children:[(0,H.jsxs)(`div`,{className:`oc-cal__nav`,children:[(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":g(),onClick:()=>p(-1),children:(0,H.jsx)(O,{})}),(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,"aria-label":fe(),onClick:()=>p(1),children:(0,H.jsx)(T,{})}),(0,H.jsx)(C,{variant:`ghost`,size:`sm`,onClick:()=>i({year:f.getFullYear(),month:f.getMonth()}),children:de()})]}),(0,H.jsx)(`span`,{className:`oc-cal__title`,children:m}),(0,H.jsxs)(`div`,{className:`oc-cal__modes`,role:`group`,children:[(0,H.jsx)(C,{variant:t===`month`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`month`,onClick:()=>r(`month`),children:h()}),(0,H.jsx)(C,{variant:t===`year`?`secondary`:`ghost`,size:`sm`,"aria-pressed":t===`year`,onClick:()=>r(`year`),children:pe()})]})]}),t===`month`?(0,H.jsx)(rn,{cursor:n,byDay:c,weekdays:l,timeFmt:d,now:f,onEventClick:a}):(0,H.jsx)(an,{year:n.year,byDay:c,monthShortFmt:ee,now:f,onOpenMonth:e=>{i({year:n.year,month:e}),r(`month`)}}),o?(0,H.jsx)(`p`,{className:`oc-cal__footnote`,children:o}):null]})}function rn({cursor:e,byDay:t,weekdays:n,timeFmt:r,now:i,onEventClick:a}){let o=L(e.year,e.month);return(0,H.jsxs)(`div`,{className:`oc-cal__month`,children:[n.map((e,t)=>(0,H.jsx)(`span`,{className:`oc-cal__wd`,children:e},t)),o.map((e,n)=>{let o=t.get(Xt(e.year,e.month,e.day))??[],c=i.getFullYear()===e.year&&i.getMonth()===e.month&&i.getDate()===e.day;return(0,H.jsxs)(`div`,{className:`oc-cal__day`+(e.inMonth?``:` oc-cal__day--out`)+(c?` oc-cal__day--today`:``),children:[(0,H.jsx)(`span`,{className:`oc-cal__daynum`,children:e.day}),o.slice(0,G).map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`oc-cal__event`+(e.muted?` oc-cal__event--muted`:``)+(e.exact?` oc-cal__event--exact`:``),style:e.color?{"--cal-ev":e.color}:void 0,title:`${r.format(e.atMs)} ${e.title}`,onClick:a?()=>a(e):void 0,children:[(0,H.jsx)(`span`,{className:`oc-cal__evdot`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`oc-cal__evtime`,children:r.format(e.atMs)}),(0,H.jsx)(`span`,{className:`oc-cal__evtitle`,children:e.title})]},e.id)),o.length>G?(0,H.jsx)(`span`,{className:`oc-cal__more`,children:s({count:o.length-G})}):null]},n)})]})}function an({year:e,byDay:t,monthShortFmt:n,now:r,onOpenMonth:i}){return(0,H.jsx)(`div`,{className:`oc-cal__year`,children:Array.from({length:12},(a,o)=>{let s=Qt(t,e,o),c=L(e,o);return(0,H.jsxs)(`button`,{type:`button`,className:`oc-cal__mini`,onClick:()=>i(o),children:[(0,H.jsx)(`span`,{className:`oc-cal__mininame`,children:n.format(new Date(e,o,1))}),(0,H.jsx)(`span`,{className:`oc-cal__minigrid`,"aria-hidden":!0,children:c.map((e,t)=>{let n=e.inMonth?s.get(e.day)??0:0,i=e.inMonth&&r.getFullYear()===e.year&&r.getMonth()===e.month&&r.getDate()===e.day;return(0,H.jsx)(`span`,{className:`oc-cal__minidot`+(e.inMonth?``:` is-out`)+(n===1?` has-one`:``)+(n>1?` has-many`:``)+(i?` is-today`:``)},t)})})]},o)})})}var on={h:36e5,min:6e4,s:1e3,ms:1};function sn(e){if(e===null)return null;let t=e.trim(),n=/^every\s+(\d+(?:\.\d+)?)(h|min|s|ms)$/.exec(t);if(n!==null){let e=Number(n[1])*on[n[2]];return Number.isFinite(e)&&e>0?{kind:`every`,everyMs:e}:null}let r=/^(?:cron\s+)?([\d*,/-]+(?:\s+[\d*,/-]+){4})(?:\s*\(([^)]+)\))?$/.exec(t);if(r!==null)return{kind:`cron`,expr:r[1],tz:r[2]??null};let i=Date.parse(t);return Number.isFinite(i)?{kind:`at`,atMs:i}:null}function K(e,t,n){let r=new Set;for(let i of e.split(`,`)){let e=i,a=1,o=/^(.+)\/(\d{1,3})$/.exec(i);if(o!==null&&(e=o[1],a=Number(o[2]),a<1))return null;let s,c;if(e===`*`)s=t,c=n;else{let r=/^(\d{1,3})(?:-(\d{1,3}))?$/.exec(e);if(r===null||(s=Number(r[1]),c=r[2]===void 0?s:Number(r[2]),r[2]===void 0&&o!==null&&(c=n),s<t||c>n||s>c))return null}for(let e=s;e<=c;e+=a)r.add(e)}return r.size>0?[...r].sort((e,t)=>e-t):null}function q(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=K(t[0],0,59),r=K(t[1],0,23),i=K(t[2],1,31),a=K(t[3],1,12),o=K(t[4],0,7);if(!n||!r||!i||!a||!o)return null;let s=new Set(o.map(e=>e%7));return{minutes:n,hours:r,dom:new Set(i),months:new Set(a),dow:s,domRestricted:t[2]!==`*`,dowRestricted:t[4]!==`*`}}var cn=new Map;function J(e){let t=cn.get(e);if(t!==void 0)return t;let n=null;try{n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}catch{n=null}return cn.set(e,n),n}function Y(e,t){if(t!==null){let n=J(t);if(n!==null){let t={};for(let r of n.formatToParts(e))r.type!==`literal`&&(t[r.type]=Number(r.value));return{y:t.year,mo:t.month-1,d:t.day,h:t.hour===24?0:t.hour,mi:t.minute}}}let n=new Date(e);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate(),h:n.getHours(),mi:n.getMinutes()}}function X(e,t,n,r,i,a){if(a===null||J(a)===null)return new Date(e,t,n,r,i).getTime();let o=Date.UTC(e,t,n,r,i),s=e=>{let t=Y(e,a);return Date.UTC(t.y,t.mo,t.d,t.h,t.mi)-e},c=s(o),l=o-c,u=s(l);return u!==c&&(l=o-u),l}function Z(e,t,n,r){let i=new Map,a=(e,t)=>{e<n||e>=r||i.set(e,t||(i.get(e)??!1))};if(e?.kind===`at`)a(e.atMs,!0);else if(e?.kind===`every`){if(t!==null){let i=e.everyMs,o=Math.ceil((n-t)/i);for(let e=t+o*i,n=0;e<r&&n<400;e+=i,n++)a(e,e===t)}}else if(e?.kind===`cron`){let t=q(e.expr);if(t!==null&&t.hours.length*t.minutes.length<=400){let i=0,o=n-864e5;for(;o<r+864e5&&i<400;){let s=Y(o,e.tz);if(t.months.has(s.mo+1)){let o=new Date(Date.UTC(s.y,s.mo,s.d)).getUTCDay(),c=t.dom.has(s.d),l=t.dow.has(o);if(t.domRestricted&&t.dowRestricted?c||l:c&&l)for(let o of t.hours)for(let c of t.minutes){if(i>=400)break;let t=X(s.y,s.mo,s.d,o,c,e.tz);t>=n&&t<r&&(a(t,!1),i++)}}o=X(s.y,s.mo,s.d,12,0,e.tz)+864e5}}}return t!==null&&a(t,!0),[...i.entries()].map(([e,t])=>({atMs:e,exact:t})).sort((e,t)=>e.atMs-t.atMs).slice(0,400)}var Q=`crons`;function ln(e,t){return`${e}\u0000${t}`}function un(e,t,n){let r=[],i=new Map;for(let a of e){let{job:e}=a;if(e.id===null)continue;let o=ln(a.instanceName,e.id);i.set(o,a);let s=z(e)!==`active`,c=Z(s?null:sn(e.schedule),e.nextRunAtMs,t,n);for(let t of c)r.push({id:`${o}:${t.atMs}`,sourceId:Q,itemId:o,atMs:t.atMs,title:e.name??e.id,muted:s,exact:t.exact})}return{events:r,byItemId:i}}var $={minutes:6e4,hours:36e5,days:864e5};function dn(e){return e?.data?.code??`unknown`}function fn({status:e}){switch(Gt(e)){case`ok`:return(0,H.jsx)(w,{variant:`secondary`,children:Ke()});case`error`:return(0,H.jsx)(w,{variant:`destructive`,children:Se()});case`running`:return(0,H.jsx)(w,{variant:`outline`,children:$e()});case`other`:return(0,H.jsx)(w,{variant:`outline`,children:e});case`none`:return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}}function pn(){let e=_(S.scheduled.listMyCrons),t=_(S.scheduled.getCronDetail),n=_(S.scheduled.listCronRuns),r=_(S.scheduled.updateCron),s=_(S.scheduled.removeCron),f=_(S.scheduled.runCronNow),h=St(),g=c(S.me.getMe,{host:Pt})?.timezone,[y,de]=(0,V.useState)(null),[fe,pe]=(0,V.useState)(!1),[b,me]=(0,V.useState)(!1),[x,we]=(0,V.useState)(null),[T,E]=(0,V.useState)(null),[D,O]=(0,V.useState)(null),[k,L]=(0,V.useState)(null),[Ht,Gt]=(0,V.useState)(!1),[B,U]=(0,V.useState)(Ut),[W,Xt]=(0,V.useState)(()=>new URLSearchParams(window.location.search).get(`job`)===null&&localStorage.getItem(`oc.sched.view`)===`calendar`?`calendar`:`list`),Zt=e=>{localStorage.setItem(`oc.sched.view`,e),Xt(e)},[Qt,$t]=(0,V.useState)(`month`),[G,rn]=(0,V.useState)(()=>{let e=new Date;return{year:e.getFullYear(),month:e.getMonth()}}),an=(0,V.useMemo)(()=>{let e=[];for(let t of y??[]){if(!t.supported||t.error!==null)continue;let n=t.kind===`openclaw`&&t.manageSupported;for(let r of t.jobs)Vt(r,B)&&e.push({instanceName:t.instanceName,canEdit:n,job:r})}return e},[y,B]),on=(0,V.useMemo)(()=>Qt===`year`?tn(G.year):en(G.year,G.month),[Qt,G]),sn=(0,V.useMemo)(()=>un(an,on.startMs,on.endMs),[an,on]),K=e=>{let t=sn.byItemId.get(e.itemId);t===void 0||!t.canEdit||t.job.id===null||pn(t.instanceName,t.job)},q=(0,V.useCallback)(async()=>{pe(!0),me(!1);try{de(await e({}))}catch{me(!0)}finally{pe(!1)}},[e]);(0,V.useEffect)(()=>{q()},[q]);let cn=(0,V.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),J=(0,V.useRef)(null);(0,V.useEffect)(()=>{y!==null&&J.current!==null&&J.current.scrollIntoView({block:`center`})},[y]);let Y=(0,V.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]),X=async(e,t,n)=>{we(e);try{await t(),h.success(n),await q()}catch(e){h.toast({variant:`error`,title:d({code:dn(e)})})}finally{we(null)}},Z=(0,V.useRef)(0),Q=(0,V.useRef)(0),ln=async(e,t)=>{if(t.id===null)return;let r=++Z.current;O({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Z.current)return;O({name:t.name??t.id,entries:i})}catch(e){if(r!==Z.current)return;O(null),h.toast({variant:`error`,title:d({code:dn(e)})})}},pn=async(e,n)=>{if(n.id===null)return;let r=++Q.current;L({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%$.days===0?(s=String(e/$.days),c=`days`):e%$.hours===0?(s=String(e/$.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/$.minutes))),c=`minutes`))}if(r!==Q.current)return;L(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==Q.current)return;L(null),h.toast({variant:`error`,title:d({code:dn(e)})})}},mn=async()=>{if(k===null)return;let e={};if(k.nameDirty&&k.name.trim()===``||k.messageDirty&&k.hasMessage&&k.message.trim()===``){h.toast({variant:`error`,title:Ee()});return}if(k.nameDirty&&k.name.trim()!==``&&(e.name=k.name.trim()),k.scheduleDirty){if(k.scheduleKind===`cron`&&k.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:k.cronExpr.trim(),...k.tz.trim()===``?{}:{tz:k.tz.trim()}};else if(k.scheduleKind===`every`){let t=Number(k.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*$[k.everyUnit])})}else if(k.scheduleKind===`at`&&k.at!==``){let t=Date.parse(k.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(k.scheduleDirty&&e.schedule===void 0){h.toast({variant:`error`,title:Ge()});return}if(k.messageDirty&&k.hasMessage&&k.message.trim()!==``&&(e.message=k.message.trim()),Object.keys(e).length===0){L(null);return}let t=Q.current;Gt(!0);try{await r({instanceName:k.instanceName,jobId:k.jobId,patch:e}),h.success(p()),t===Q.current&&L(null),await q()}catch(e){h.toast({variant:`error`,title:d({code:dn(e)})})}finally{Gt(!1)}},hn=y?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,H.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:Be()}),(0,H.jsxs)(`div`,{className:`oc-sched__viewtoggle`,role:`group`,"aria-label":te(),children:[(0,H.jsx)(C,{variant:W===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":Je(),title:Je(),"aria-pressed":W===`list`,onClick:()=>Zt(`list`),children:(0,H.jsx)(lt,{})}),(0,H.jsx)(C,{variant:W===`calendar`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":ne(),title:ne(),"aria-pressed":W===`calendar`,onClick:()=>Zt(`calendar`),children:(0,H.jsx)(qt,{})})]}),(0,H.jsxs)(C,{variant:`ghost`,size:`sm`,onClick:()=>void q(),disabled:fe,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,H.jsx)(Ct,{size:14,"aria-hidden":!0}),qe()]})]}),y!==null&&hn>0?(0,H.jsxs)(Bt,{q:B.q,onQChange:e=>U(t=>({...t,q:e})),searchPlaceholder:be(),onReset:()=>U(Ut),canReset:Wt(B),children:[(0,H.jsxs)(N,{value:B.state,onValueChange:e=>U(t=>({...t,state:e})),children:[(0,H.jsx)(P,{size:`sm`,className:`w-40`,children:(0,H.jsx)(j,{})}),(0,H.jsxs)(A,{children:[(0,H.jsx)(M,{value:`all`,children:Xe()}),(0,H.jsx)(M,{value:`active`,children:Te()}),(0,H.jsx)(M,{value:`paused`,children:Qe()}),(0,H.jsx)(M,{value:`auto-disabled`,children:i()})]})]}),(0,H.jsxs)(N,{value:B.result,onValueChange:e=>U(t=>({...t,result:e})),children:[(0,H.jsx)(P,{size:`sm`,className:`w-40`,children:(0,H.jsx)(j,{})}),(0,H.jsxs)(A,{children:[(0,H.jsx)(M,{value:`all`,children:Ue()}),(0,H.jsx)(M,{value:`ok`,children:Ke()}),(0,H.jsx)(M,{value:`error`,children:Se()}),(0,H.jsx)(M,{value:`running`,children:$e()}),(0,H.jsx)(M,{value:`none`,children:Ie()})]})]})]}):null,y===null?(0,H.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":fe,children:b?Oe():a()}):W===`calendar`?(0,H.jsxs)(H.Fragment,{children:[b?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()}):null,y.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()}):(0,H.jsx)(nn,{events:sn.events,mode:Qt,cursor:G,onModeChange:$t,onCursorChange:rn,onEventClick:K,footnote:ct()})]}):(0,H.jsxs)(H.Fragment,{children:[b?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()}):null,y.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()}):null,y.map(e=>{let t=e.jobs.filter(e=>Vt(e,B)),n=Wt(B)&&e.jobs.length>0&&t.length===0;return(0,H.jsxs)(`section`,{style:{marginBottom:20},children:[y.length>1||e.error||!e.supported?(0,H.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,H.jsx)(w,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:Le({code:e.error})}):e.jobs.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:xe()}):n?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):(0,H.jsxs)(zt,{children:[(0,H.jsx)(It,{children:(0,H.jsxs)(Rt,{children:[(0,H.jsx)(F,{children:Ze()}),(0,H.jsx)(F,{children:We()}),(0,H.jsx)(F,{children:_e()}),(0,H.jsx)(F,{children:Me()}),(0,H.jsx)(F,{children:Ye()}),(0,H.jsx)(F,{children:ze()}),(0,H.jsx)(F,{children:Pe()})]})}),(0,H.jsx)(Lt,{children:t.map((t,n)=>{let a=`${e.instanceName}:${t.id??n}`,s=x===a,c=e.manageSupported,l=e.kind===`openclaw`&&c;return(0,H.jsxs)(Rt,{ref:t.id!==null&&t.id===cn?J:void 0,"data-state":t.id!==null&&t.id===cn?`selected`:void 0,children:[(0,H.jsx)(I,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Ve()}),(0,H.jsx)(I,{children:(0,H.jsx)(w,{variant:`secondary`,children:t.agentId})}),(0,H.jsxs)(I,{className:`whitespace-nowrap`,children:[(0,H.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=pt(t.schedule),n=e===null?null:bt(e);return n===null?null:(0,H.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,H.jsx)(I,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:Y.format(t.nextRunAtMs)}),(0,H.jsx)(I,{children:z(t)===`auto-disabled`?(0,H.jsx)(w,{variant:`destructive`,title:`${t.autoDisabledReason??``}${t.autoDisabledAtMs===null?``:` · ${Y.format(t.autoDisabledAtMs)}`}`,children:i()}):z(t)===`active`?(0,H.jsx)(w,{variant:`secondary`,children:Te()}):z(t)===`paused`?(0,H.jsx)(w,{variant:`outline`,children:Qe()}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,H.jsxs)(I,{children:[(0,H.jsx)(fn,{status:t.lastRunStatus}),t.lastDelivered===!1?(0,H.jsx)(w,{variant:`destructive`,title:t.lastDeliveryError??oe(),children:De()}):null]}),(0,H.jsx)(I,{className:`whitespace-nowrap`,children:t.id===null?(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):s?(0,H.jsx)(_t,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,H.jsxs)(`span`,{className:`oc-cronactions`,children:[l?(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:re(),"aria-label":re(),disabled:x!==null,onClick:()=>void X(a,async()=>{let n=await f({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},m()),children:(0,H.jsx)(Mt,{size:14,"aria-hidden":!0})}):null,l&&t.enabled!==null?(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:R(t)===`pause`?Ne():o(),"aria-label":R(t)===`pause`?Ne():o(),disabled:x!==null,onClick:()=>void X(a,()=>r({instanceName:e.instanceName,jobId:t.id,patch:{enabled:R(t)===`resume`}}),R(t)===`pause`?ue():rt()),children:R(t)===`pause`?(0,H.jsx)(Ot,{size:14,"aria-hidden":!0}):(0,H.jsx)(ft,{size:14,"aria-hidden":!0})}):null,l?(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:ae(),"aria-label":ae(),disabled:x!==null,onClick:()=>void pn(e.instanceName,t),children:(0,H.jsx)(ut,{size:14,"aria-hidden":!0})}):null,l?(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:ee(),"aria-label":ee(),disabled:x!==null,onClick:()=>void ln(e.instanceName,t),children:(0,H.jsx)(Jt,{size:14,"aria-hidden":!0})}):null,c?(0,H.jsx)(C,{variant:`ghost`,size:`icon-sm`,title:Fe(),"aria-label":Fe(),disabled:x!==null,onClick:()=>E({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,H.jsx)(Ft,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:et()})]},e.instanceName)}),hn>0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:He()}):null]}),(0,H.jsx)(At,{open:T!==null,onOpenChange:e=>{e||E(null)},children:(0,H.jsxs)(vt,{children:[(0,H.jsxs)(mt,{children:[(0,H.jsx)(gt,{children:ce()}),(0,H.jsx)(yt,{children:at({name:T?.name??``})})]}),(0,H.jsxs)(xt,{children:[(0,H.jsx)(kt,{children:ye()}),(0,H.jsx)(dt,{onClick:()=>{let e=T;E(null),e!==null&&X(`${e.instanceName}:${e.jobId}`,()=>s({instanceName:e.instanceName,jobId:e.jobId}),u())},children:st()})]})]})}),(0,H.jsx)(Tt,{open:D!==null,onOpenChange:e=>{e||(Z.current++,O(null))},children:(0,H.jsxs)(Nt,{style:{maxWidth:640},children:[(0,H.jsx)(Et,{children:(0,H.jsx)(wt,{children:le({name:D?.name??``})})}),D?.entries===null?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):D!==null&&D.entries.length===0?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:nt()}):D===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:D.entries.map((e,t)=>(0,H.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,H.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[(0,H.jsx)(fn,{status:e.status}),(0,H.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?Y.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,H.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,H.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error}),e.delivered===!1?(0,H.jsxs)(`div`,{className:`oc-cronpanel__run-undelivered`,children:[Ae({channel:e.deliveryChannel??`—`}),e.deliveryError===null?null:(0,H.jsx)(`span`,{className:`oc-cronpanel__plain`,children:e.deliveryError})]}):null]},t))})]})}),(0,H.jsx)(Tt,{open:k!==null,onOpenChange:e=>{e||(Q.current++,L(null))},children:(0,H.jsxs)(Nt,{className:`oc-cronedit`,children:[(0,H.jsxs)(Et,{children:[(0,H.jsx)(wt,{children:l()}),(0,H.jsx)(jt,{children:se()})]}),k===null?null:k.loading?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,H.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,H.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Ze()}),(0,H.jsx)(ht,{value:k.name,maxLength:200,onChange:e=>L({...k,name:e.target.value,nameDirty:!0})})]}),(0,H.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:it()}),(0,H.jsxs)(N,{value:k.scheduleKind,onValueChange:e=>L({...k,scheduleKind:e,scheduleDirty:!0}),children:[(0,H.jsx)(P,{children:(0,H.jsx)(j,{})}),(0,H.jsxs)(A,{children:[(0,H.jsx)(M,{value:`cron`,children:ve()}),(0,H.jsx)(M,{value:`every`,children:ot()}),(0,H.jsx)(M,{value:`at`,children:tt()})]})]}),k.scheduleKind===`cron`?(0,H.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,H.jsx)(ht,{value:k.cronExpr,onChange:e=>L({...k,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,H.jsx)(Kt,{value:k.tz,onChange:e=>L({...k,tz:e,scheduleDirty:!0}),fallbackTz:g??void 0})]}):k.scheduleKind===`every`?(0,H.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,H.jsx)(ht,{type:`number`,min:1,value:k.everyValue,onChange:e=>L({...k,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,H.jsxs)(N,{value:k.everyUnit,onValueChange:e=>L({...k,everyUnit:e,scheduleDirty:!0}),children:[(0,H.jsx)(P,{style:{maxWidth:160},children:(0,H.jsx)(j,{})}),(0,H.jsxs)(A,{children:[(0,H.jsx)(M,{value:`minutes`,children:he()}),(0,H.jsx)(M,{value:`hours`,children:ke()}),(0,H.jsx)(M,{value:`days`,children:je()})]})]})]}):(0,H.jsx)(Yt,{value:k.at,onChange:e=>L({...k,at:e,scheduleDirty:!0})})]}),k.hasMessage?(0,H.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,H.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ie()}),(0,H.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:k.message,onChange:e=>L({...k,message:e.target.value,messageDirty:!0})})]}):null]}),(0,H.jsxs)(Dt,{children:[(0,H.jsx)(C,{variant:`ghost`,onClick:()=>L(null),children:ye()}),(0,H.jsxs)(C,{onClick:()=>void mn(),disabled:k===null||k.loading||Ht,children:[Ht?(0,H.jsx)(_t,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,Re()]})]})]})})]})}export{pn as ScheduledTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$V as r,AH as ee,AV as i,BH as te,BJ as a,BV as o,CH as ne,DH as re,DV as s,EH as ie,FH as ae,FV as c,GH as oe,GV as l,HH as u,HV as d,IH as se,IV as f,JV as p,KH as ce,KV as m,LH as le,LJ as ue,LV as h,MH as de,MV as g,NH as fe,NV as pe,OH as me,OV as he,PH as ge,PV as _,QV as _e,RH as ve,RV as v,SH as ye,TH as be,UH as xe,UV as y,VH as b,VV as x,WH as Se,WV as S,XV as C,YV as w,ZV as Ce,_H as we,aH as Te,bH as Ee,cH as De,dH as Oe,eH as ke,fH as Ae,gH as je,hH as Me,iH as Ne,jH as Pe,jV as T,kH as Fe,kV as E,lH as Ie,mH as Le,nH as Re,oH as ze,pH as Be,qH as Ve,qV as D,rH as He,sH as Ue,t as O,tH as We,uH as Ge,vH as Ke,wH as qe,xH as Je,yH as Ye,zH as Xe,zJ as k,zV as A}from"./api-DL5MhfCR.js";import{r as Ze}from"./dist-CmEdak18.js";import{t as j}from"./button-7-8JjL3V.js";import{Ht as M,Kn as N,Lt as P,Qn as F,Rt as Qe,Xn as $e,Z as et,_t as I,b as tt,ct as L,dt as R,er as nt,ft as z,gt as B,ht as V,lt as H,mt as U,pt as rt,st as W,tr as it,ut as G,vt as K,yt as q}from"./index-D2_zMS9W.js";import{t as at}from"./FilterBar-6mIwprKY.js";import{t as ot}from"./DataTableShell-8D6YsZBo.js";import{t as st}from"./roleDescriptions-B5tZMAnu.js";var J=t(e(),1),Y=n(),ct=[{value:`never`,label:()=>pe(),days:null},{value:`30`,label:()=>g(),days:30},{value:`90`,label:()=>T(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=it({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??Z,[o,s]=(0,J.useState)(Z),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),d=a(O.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===Z?void 0:o,disabled:i===Z?void 0:i===`disabled`}}),f=a(O.apiKeys.listKeys,{}),p=a(O.apiKeys.listRoles,{}),m=k(O.apiKeys.createServiceAccount),h=k(O.apiKeys.updateServiceAccount),g=k(O.apiKeys.deleteServiceAccount),pe=ue(O.apiKeys.mintApiKey),he=k(O.apiKeys.revokeApiKey),_=et(),v=Qe(),y=n!==``||o!==Z||i!==Z;function x(){s(Z),t({search:{},replace:!0})}let[S,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(Q),[E,D]=(0,J.useState)(null),[A,N]=(0,J.useState)(new Set),[F,I]=(0,J.useState)(null),z=(0,J.useRef)(!1),[B,V]=(0,J.useState)(new Set),[U,rt]=(0,J.useState)({}),[K,q]=(0,J.useState)(null),X=(0,J.useMemo)(()=>{let e=new Map;for(let t of f??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[f]);function $(e){N(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{E?(await h({serviceAccountId:E,name:w.name,roleKey:w.roleKey,description:w.description}),v.success(Oe())):await m({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),T(Q),D(null),C(!1)}catch(e){v.error(E?Ae():Be(),e)}}function ft(e){T({name:e.name,roleKey:e.roleKey,description:e.description??``}),D(e._id),C(!0)}async function pt(e){if(z.current)return;z.current=!0;let t=U[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await pe({serviceAccountId:e._id,expiresAt:r});q({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){v.error(Ge(),e)}finally{z.current=!1,I(null)}}async function mt(e){if(await _({title:Ie(),description:(0,Y.jsxs)(Y.Fragment,{children:[De(),` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ue(),` `,(0,Y.jsx)(`strong`,{children:ze()}),` `,Te()]}),confirmWord:e.name,confirmLabel:Ne(),destructive:!0}))try{await g({serviceAccountId:e._id}),v.success(He(),e.name)}catch(e){v.error(Re(),e)}}async function ht(e){if(await _({title:We(),description:(0,Y.jsxs)(Y.Fragment,{children:[ke(),` `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,r()]}),confirmLabel:_e(),destructive:!0})&&!B.has(e._id)){V(t=>new Set(t).add(e._id));try{await he({keyId:e._id})}catch(e){v.error(Ce(),e)}finally{V(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ve()}),(0,Y.jsxs)(at,{q:n,onQChange:c,searchPlaceholder:ce(),onReset:x,canReset:y,children:[(0,Y.jsxs)(W,{value:o,onValueChange:s,children:[(0,Y.jsx)(G,{size:`sm`,className:`w-40`,children:(0,Y.jsx)(R,{placeholder:oe()})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(H,{value:Z,children:Se()}),(p??[]).map(e=>(0,Y.jsx)(H,{value:e.key,children:e.key},e._id))]})]}),(0,Y.jsxs)(W,{value:i,onValueChange:l,children:[(0,Y.jsx)(G,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(R,{})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(H,{value:Z,children:xe()}),(0,Y.jsx)(H,{value:`active`,children:u()}),(0,Y.jsx)(H,{value:`disabled`,children:b()})]})]})]}),(0,Y.jsx)(ot,{title:te(),rows:d,addLabel:Xe(),onAdd:()=>{T(Q),D(null),C(!0)},emptyHint:ve(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,Y.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:B}),rowActions:e=>[...(e.managedBy??null)===null?[{label:ge(),onSelect:()=>ft(e)},{label:le(),onSelect:()=>void pt(e)}]:[],{label:A.has(e._id)?se():ae(),onSelect:()=>$(e._id)},...(e.managedBy??null)===null?[{label:fe(),variant:`destructive`,onSelect:()=>void mt(e)}]:[]],columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?de():Pe(),onClick:()=>$(e._id),children:A.has(e._id)?(0,Y.jsx)(Ze,{}):(0,Y.jsx)($e,{})})},{header:ee(),sort:e=>e.name,cell:e=>(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{children:e.name}),e.description?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Fe(),sort:e=>e.roleKey,cell:e=>(0,Y.jsx)(P,{variant:`secondary`,children:e.roleKey})},{header:me(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,Y.jsx)(P,{variant:`destructive`,children:b()}):(0,Y.jsx)(P,{variant:`outline`,children:u()})},{header:re(),cell:e=>(0,Y.jsxs)(W,{value:U[e._id]??`never`,onValueChange:t=>rt(n=>({...n,[e._id]:t})),children:[(0,Y.jsx)(G,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(R,{})}),(0,Y.jsx)(L,{children:ct.map(e=>(0,Y.jsx)(H,{value:e.value,children:e.label()},e.value))})]})},{header:ie(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,Y.jsx)(`span`,{className:`oc-sa__keycount`,children:F===e._id?be():qe({count:t})})}}]}),(0,Y.jsx)(tt,{open:S,onOpenChange:e=>{C(e),e||D(null)},title:E?ne():Ee(),description:E?ye():Ye(),canSubmit:!!(w.name&&w.roleKey),onSubmit:dt,submitLabel:E?Je():Ke(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:we()}),(0,Y.jsx)(M,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:je()}),(0,Y.jsxs)(W,{value:w.roleKey||void 0,onValueChange:e=>T({...w,roleKey:e}),children:[(0,Y.jsx)(G,{className:`w-full`,children:(0,Y.jsx)(R,{placeholder:Me()})}),(0,Y.jsx)(L,{children:(p??[]).map(e=>(0,Y.jsxs)(H,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(p??[]).find(e=>e.key===w.roleKey),t=e?st(e):null;return t?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:Le()}),(0,Y.jsx)(M,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,Y.jsx)(ut,{minted:K,onClose:()=>q(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,Y.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,Y.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[C(),` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):(0,Y.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:p()}),(0,Y.jsx)(`th`,{children:D()}),(0,Y.jsx)(`th`,{children:m()}),(0,Y.jsx)(`th`,{children:l()}),(0,Y.jsx)(`th`,{children:S()}),(0,Y.jsx)(`th`,{children:y()}),(0,Y.jsx)(`th`,{})]})}),(0,Y.jsx)(`tbody`,{children:t.map(t=>(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`td`,{children:(0,Y.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,Y.jsx)(`td`,{children:(0,Y.jsx)(P,{variant:`secondary`,children:e.roleKey})}),(0,Y.jsx)(`td`,{children:q(t.createdAt)}),(0,Y.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,Y.jsx)(`td`,{children:pt(t.expiresAt)}),(0,Y.jsx)(`td`,{children:mt(t)}),(0,Y.jsx)(`td`,{className:`text-right`,children:!t.disabled&&(e.managedBy??null)===null?(0,Y.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?d():x()}):null})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,J.useState)(!1);async function ee(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,Y.jsx)(z,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,Y.jsxs)(rt,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,Y.jsxs)(B,{children:[(0,Y.jsx)(I,{children:o()}),(0,Y.jsx)(U,{children:A({name:e.accountName})})]}),(0,Y.jsx)(`div`,{className:`oc-sa__minted-warning`,children:v()}),(0,Y.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Y.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,Y.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void ee(),"aria-label":h(),children:[n?(0,Y.jsx)(F,{}):(0,Y.jsx)(N,{}),n?f():c()]})]}),(0,Y.jsx)(V,{children:(0,Y.jsx)(j,{onClick:()=>{r(!1),t()},children:_()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?i():q(e)}function pt(e){return e===null?`—`:K(e)}function mt(e){return e.disabled?(0,Y.jsx)(P,{variant:`destructive`,children:E()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,Y.jsx)(P,{variant:`outline`,children:he()}):(0,Y.jsx)(P,{variant:`outline`,children:s()})}export{$ as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ap as r,BJ as i,Bp as a,Cp as o,Dp as s,Ep as c,Fp as l,Gp as u,Hp as d,Ip as f,Jp as p,Kp as ee,Lp as m,Mp as h,Np as g,Op as _,Pp as v,Qp as y,Rp as b,Sp as x,Tp as S,Up as C,Vp as w,Wp as T,Xp as E,Yp as D,Zp as O,_p as k,bp as A,gp as j,hp as M,jp as N,kp as P,mp as F,qp as I,t as L,vp as R,wp as z,xp as B,yp as V,zJ as H,zp as U}from"./api-DL5MhfCR.js";import{t as W}from"./button-7-8JjL3V.js";import{Z as G,yt as K}from"./index-D2_zMS9W.js";import{t as q}from"./DataTableShell-8D6YsZBo.js";var J=t(e(),1),Y=n(),X={hung:()=>l(),wrong_result:()=>v(),error:()=>g(),other:()=>h()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=H(L.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1);async function p(){let t=l.trim();if(!(!t||d)){f(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{f(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,N({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:r()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:P()}),i.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?_():s()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:c()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:S(),value:l,maxLength:2e3,rows:3,onChange:e=>u(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void p(),disabled:!l.trim()||d,children:d?o():z()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[x({count:t.children.length}),t.childrenTruncated?` ${B()}`:``,t.textTruncated?` ${A()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${V()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:R()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:k()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=i(L.subAgentReports.listForAdmin,{}),t=H(L.subAgentReports.readReport),n=H(L.subAgentReports.deleteReport),r=G(),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function h(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function g(e){await r({title:j(),description:M(),confirmLabel:F(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[E(),` `,(0,Y.jsx)(`strong`,{children:D()}),` `,p()]}),(0,Y.jsx)(q,{title:y(),rows:e,emptyHint:O(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:I(),cell:e=>K(e.at),sort:e=>e.at},{header:ee(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:u(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:T(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${w({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:C(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:d(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:a()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:U()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?m():b(),onSelect:()=>void h(e)},{label:f(),onSelect:()=>void g(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$U as r,$W as i,AW as a,BJ as o,BU as s,BW as c,CW as l,DJ as u,DW as d,EJ as f,EW as p,FU as m,FW as h,GU as g,GW as _,HU as v,HW as y,IU as ee,IW as te,JU as ne,JW as re,KU as ie,KW as b,LJ as ae,LU as oe,LW as se,MW as ce,NW as le,OJ as ue,OW as de,PU as fe,PW as pe,QU as me,QW as he,RU as ge,RW as _e,SW as ve,TW as ye,UU as be,UW as xe,VU as Se,VW as Ce,WU as we,WW as Te,XU as Ee,XW as De,YU as Oe,YW as ke,ZU as Ae,ZW as je,_W as Me,aW as Ne,bW as Pe,cW as Fe,dW as Ie,dp as Le,eG as Re,eW as x,fW as ze,fp as S,gW as Be,hW as Ve,iW as He,jW as Ue,kW as We,lW as Ge,mW as Ke,nG as qe,nW as Je,oW as Ye,pW as Xe,pp as C,qU as Ze,qW as Qe,r as $e,rW as et,sW as tt,t as w,tG as nt,tW as rt,uW as it,up as at,vW as ot,wW as st,xW as ct,yW as T,zJ as E,zU as lt,zW as ut}from"./api-DL5MhfCR.js";import{t as D}from"./x-fp_NW5OK.js";import{t as O}from"./button-7-8JjL3V.js";import{$ as dt,Gn as ft,Gt as k,Ht as A,Jt as pt,Kt as mt,Lt as j,Qn as M,Ut as ht,Wn as N,Wt as gt,_n as P,ct as F,dt as I,et as _t,lt as L,qt as R,st as z,tt as B,ut as V,xt as H}from"./index-D2_zMS9W.js";import{t as vt}from"./localePickerView-C2RmOS86.js";import{a as yt,i as bt,n as xt,o as St,r as Ct,t as wt}from"./card-B9HCdDy6.js";import{a as Tt,i as U,n as Et,o as W,r as G,t as Dt}from"./table-BTGgG4wx.js";import{t as Ot}from"./TimeRangePicker-BIm9hRiV.js";import{t as kt}from"./FilterBar-6mIwprKY.js";import{t as At}from"./AdvancedFilter-CElVO-tV.js";var K=t(e(),1),jt=.1,Mt=[248,248,248],Nt=[24,24,24];function Pt(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Ft(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return Ft(e,t,n)>=jt}function It(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Lt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Rt=12*1024*1024,zt=480,Bt=160,Vt=.92;async function Ht(e,t={}){if(!e.type.startsWith(`image/`))throw Error(et());if(e.size>Rt)throw Error(Je());let{source:n,width:i,height:a,cleanup:o}=await Ut(e);try{let o=e.type===`image/svg+xml`,s=Math.min(zt/i,Bt/a,o?1/0:1),c=Math.max(1,Math.round(i*s)),l=Math.max(1,Math.round(a*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(x());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Pt(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(x());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);q(e.data,f.width,f.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),m.putImageData(e,0,0)}let h=q(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Y(p,`image/webp`,Vt)??await Y(p,`image/png`);if(!g)throw Error(r());return{blob:g,hasAlpha:h}}finally{o()}}async function Ut(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(rt())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?ue():e===`dark`?u():f()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:$e(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(M,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":C(),title:C(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=o(w.charts.listMyCharts),r=E(w.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:b(),subtitle:_(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Te():n.via===`owner`?xe():y({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ce()}):null]})}function Qt(){let e=E(w.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[u,f]=(0,K.useState)(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(T())}}}async function h(){if(o(null),c(!1),t.trim()===``){o(Me());return}let a;try{a=JSON.parse(r)}catch{o(T());return}f(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:d()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:p()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ye()}),(0,X.jsx)(A,{value:t,onChange:e=>n(e.target.value),placeholder:st(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:l()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:ve(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(P,{className:`size-4`}),ct(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void m(e)})]})}),(0,X.jsx)(O,{size:`sm`,disabled:u,onClick:()=>void h(),children:Pe()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:ot()}):null]})]})}function $t({chart:e}){let t=ae(w.charts.setChartLogo),n=E(w.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ht(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?it():Ge()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(P,{className:`size-4`}),t?tt():Fe(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Ne()}):null,t?(0,X.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ye()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ie()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=o(w.me.getMe,{host:B}),n=E(w.charts.addChartDomain),r=E(w.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=i.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function p(t){c(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:me()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ne()}):d.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ze({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(D,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{value:i,onChange:e=>a(e.target.value),placeholder:Ee(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(O,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void f(),children:Oe()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ae()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=E(w.charts.updateChart),n=E(w.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>$(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1);function h(){o(e.name),c($(e.tokens)),u(e.tokens.bpm??0),f(null),i(!0)}async function _(){if(e.chartId===void 0)return;f(null);let n;try{n=JSON.parse(s)}catch{f(T());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}m(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){f(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(O,{variant:`outline`,size:`sm`,onClick:h,children:Xe()}),(0,X.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:ze()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:we()}),(0,X.jsx)(A,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:S()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":S()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?Le():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:be()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(e.target.value),rows:10,spellCheck:!1})]}),d?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:d}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{size:`sm`,disabled:p,onClick:()=>void _(),children:ie()}),(0,X.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:g()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=o(w.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=E(w.charts.addChartToGroupPool),r=E(w.charts.removeChartFromGroupPool),i=e.restrictedToGroups,o=e.poolGroups,s=new Set((o??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function u(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?le():e.kind===`custom`&&e.scope===`personal`?ge():pe()}),e.isGlobalDefault?(0,X.jsx)(j,{variant:`default`,children:ce()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:a()}),(o??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":de({group:e.name}),onClick:()=>void u(e.groupId),children:(0,X.jsx)(D,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(z,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(V,{size:`sm`,className:`w-56`,children:(0,X.jsx)(I,{placeholder:We()})}),(0,X.jsx)(F,{children:c.map(e=>(0,X.jsx)(L,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ue()}):null]})]})}function an({chart:e}){let t=E(w.charts.promoteChartToCommon),n=E(w.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(v()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?oe():ge()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:lt({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ee()}):null,(0,X.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:m()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=E(w.admin.setDefaultThemeMode),a=E(w.admin.setDefaultLocale),l=E(w.charts.setDefaultChart),u=o(w.charts.listChartsAdmin),d=o(w.groups.listGroups,{}),f=e??`system`,p=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:c()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void l({name:null}),children:b()}),_t.map(e=>(0,X.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void l({name:e.key}),children:e.name},e.key)),(u??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void l({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(u??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{chart:e,groups:d??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:h()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(u??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(()=>{let e=(u??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:fe()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(O,{variant:f===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:vt().map(e=>(0,X.jsx)(O,{variant:p===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]})]})}function sn(){let e=o(w.me.getMe,{host:B}),t=dt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:je()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{children:`Default`}),(0,X.jsx)(O,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(O,{variant:`outline`,children:`Outline`}),(0,X.jsx)(O,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(O,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(O,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(O,{size:`sm`,children:`Small`}),(0,X.jsx)(O,{children:`Default`}),(0,X.jsx)(O,{size:`lg`,children:`Large`}),(0,X.jsx)(O,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(O,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(A,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(z,{value:n,onValueChange:r,children:[(0,X.jsx)(V,{className:`w-56`,children:(0,X.jsx)(I,{placeholder:`Select…`})}),(0,X.jsxs)(F,{children:[(0,X.jsx)(L,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(L,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(H,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(kt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(z,{value:o,onValueChange:s,children:[(0,X.jsx)(V,{size:`sm`,children:(0,X.jsx)(I,{})}),(0,X.jsxs)(F,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes directions`}),(0,X.jsx)(L,{value:`inbound`,children:`inbound`}),(0,X.jsx)(L,{value:`outbound`,children:`outbound`}),(0,X.jsx)(L,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(z,{value:c,onValueChange:l,children:[(0,X.jsx)(V,{size:`sm`,children:(0,X.jsx)(I,{})}),(0,X.jsxs)(F,{children:[(0,X.jsx)(L,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(L,{value:`info`,children:`info`}),(0,X.jsx)(L,{value:`warn`,children:`warn`}),(0,X.jsx)(L,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Ot,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(pt,{asChild:!0,children:(0,X.jsx)(O,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(mt,{children:`Actions`}),(0,X.jsx)(R,{}),(0,X.jsx)(k,{children:`Edit`}),(0,X.jsx)(k,{children:`Duplicate`}),(0,X.jsx)(R,{}),(0,X.jsx)(k,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(wt,{className:`w-80`,children:[(0,X.jsxs)(yt,{children:[(0,X.jsx)(St,{children:`Instance`}),(0,X.jsx)(Ct,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(xt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(bt,{className:`gap-2`,children:[(0,X.jsx)(O,{size:`sm`,children:`Save`}),(0,X.jsx)(O,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Dt,{children:[(0,X.jsx)(Tt,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(U,{className:`w-8`,children:(0,X.jsx)(H,{"aria-label":`select all`})}),(0,X.jsx)(U,{children:`Name`}),(0,X.jsx)(U,{children:`Mode`}),(0,X.jsx)(U,{className:`text-right`,children:`Status`}),(0,X.jsx)(U,{className:`w-8`})]})}),(0,X.jsx)(Et,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{children:(0,X.jsx)(H,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(G,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(M,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(G,{children:(0,X.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$I as r,$k as i,AL as a,BJ as o,BL as s,Bk as c,CL as l,DL as u,E as d,EL as f,FL as p,Fk as m,Gk as h,Gl as g,Hk as _,IL as v,Ik as y,Jk as b,Kk as x,Kl as S,LL as C,Lk as ee,ML as te,NL as w,Nk as ne,OL as T,PL as re,Pk as ie,QI as ae,Qk as oe,RL as se,Rk as ce,SL as E,TL as le,Uk as ue,VL as de,Vk as fe,Wk as pe,Wl as D,Xk as me,Yk as he,Zk as ge,_L as O,aA as _e,aL as k,bL as A,cA as ve,cL as j,dA as ye,dL as be,eA as xe,eL as Se,fA as Ce,fL as we,gA as Te,hA as Ee,iA as De,iL as Oe,jL as ke,kL as M,lA as Ae,lL as je,mA as Me,nA as Ne,nL as Pe,oA as Fe,oL as Ie,pA as Le,qk as Re,rA as ze,rL as Be,sA as Ve,sL as He,t as N,tA as Ue,tL as We,uA as Ge,uL as Ke,vL as P,wL as qe,xL as Je,yL as Ye,zJ as F,zL as Xe,zk as Ze}from"./api-DL5MhfCR.js";import{t as Qe}from"./x-fp_NW5OK.js";import{t as I}from"./button-7-8JjL3V.js";import{Hn as $e,J as L,Kn as et,Lt as R,Qn as tt,Rn as nt,U as rt,Un as it,X as z,Y as at,_t as ot,a as st,bt as ct,ct as B,dt as V,er as lt,ft as ut,gt as dt,i as ft,lt as H,mt as pt,o as mt,pt as ht,q as gt,s as _t,st as U,tr as vt,tt as yt,ut as W,yt as G}from"./index-D2_zMS9W.js";import{n as bt}from"./TimeRangePicker-BIm9hRiV.js";import{t as K}from"./FilterBar-6mIwprKY.js";import{t as xt}from"./AdvancedFilter-CElVO-tV.js";import{t as St}from"./DataTableShell-8D6YsZBo.js";var Ct=d(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?E():n===`agent`?`${Je()} - ${r}`:e}function Tt(){let e=o(N.me.getMe,{host:yt})?.role===`admin`,t=o(N.deliveryTiming.getDeliveryStatus,{}),n=F(N.deliveryTiming.startDeliveryRecord),r=F(N.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[c,l]=(0,q.useState)(!1),u=t?.recording??!1,d=async()=>{l(!0);try{u?await r({}):await n({})}finally{l(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:de()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:s()})]}),e?(0,J.jsx)(I,{variant:u?`destructive`:`default`,size:`sm`,disabled:c||t===void 0,onClick:()=>void d(),children:u?se():Xe()}):null]}),u?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(R,{variant:`secondary`,children:C()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:v({time:ct(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?w():re()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=o(N.deliveryTiming.listDeliverySessions,{}),n=F(N.deliveryTiming.deleteDeliverySessions),[i,s]=(0,q.useState)(``),[c,d]=(0,q.useState)(`all`),[p,m]=(0,q.useState)(Y),[h,g]=(0,q.useState)(null),{from:_,to:v}=bt(p),y=p.to===`now`?1/0:v,b=i.trim()!==``||c!==`all`||p!==Y,x=()=>{s(``),d(`all`),m(Y)},S=(0,q.useMemo)(()=>{if(t===void 0)return;let e=i.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(c===`all`||(c===`active`?t.active:!t.active))&&t.startedAt>=_&&t.startedAt<=y).map(e=>({...e,_id:e.sessionId}))},[t,i,c,_,y]),C=e=>{let t=new Set((S??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),h!==null&&r.includes(h)&&g(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(K,{q:i,onQChange:s,searchPlaceholder:ke(),timeRange:p,onTimeRangeChange:m,onReset:x,canReset:b,children:(0,J.jsxs)(U,{value:c,onValueChange:e=>d(e),children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:`all`,children:a()}),(0,J.jsx)(H,{value:`active`,children:M()}),(0,J.jsx)(H,{value:`stopped`,children:T()})]})]})}),(0,J.jsx)(St,{title:te(),rows:S,emptyHint:r(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":h===e.sessionId?Ye():A(),onClick:()=>g(t=>t===e.sessionId?null:e.sessionId),children:h===e.sessionId?(0,J.jsx)(it,{size:15,"aria-hidden":!0}):(0,J.jsx)($e,{size:15,"aria-hidden":!0})})},{header:u(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:f(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:le(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:qe(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:l(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(R,{variant:`secondary`,children:M()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:T()})}],rowActions:e?e=>[{label:P(),variant:`destructive`,onSelect:()=>C([e.sessionId])}]:void 0,bulkActions:e?[{label:P(),variant:`destructive`,onSelect:e=>C(e)}]:void 0,isExpanded:e=>e.sessionId===h,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=o(N.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(rt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:O()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:p()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,ae()]}),(0,J.jsxs)(I,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(tt,{size:13,"aria-hidden":!0}):(0,J.jsx)(et,{size:13,"aria-hidden":!0}),t?Se():We()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:Ke()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:je()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:j()})]})}),(0,J.jsxs)(`tbody`,{children:[i(He(),r.bridge),i(Ie(),r.A),i(k(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Be()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:S()},{value:`principalType`,label:g()},{value:`direction`,label:`direction`},{value:`roleKey`,label:D()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=vt({from:`/settings/traces`}),t=lt({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,l=e.direction??Q,u=e.roleKey??Q,d=e.q??``,f=e.correlationId,p=ft(e.from,e.to),m=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:g,to:v}=bt(p),[S,C]=(0,q.useState)(null),[te,w]=(0,q.useState)(null),ne=e=>void t({search:t=>({...t,limit:e})}),T=e=>void t({search:t=>({...t,kind:e})}),re=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ae=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),se=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),le=e=>void t({search:t=>({...t,...mt(e)})}),de=e=>void t({search:t=>({...t,adv:st(e)}),replace:!0}),D=o(N.observability.listEvents,{limit:n}),O=o(N.observability.listEvents,{limit:n,kind:r===Z?void 0:r,...f?{correlationId:f}:{},filter:{q:d||void 0,from:g,to:v,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:l===Q?void 0:l,roleKey:u===Q?void 0:u,advanced:m.length>0?m:void 0}}),k=(0,q.useMemo)(()=>{let e=new Set;for(let t of D??[])e.add(t.kind);return[...e].sort()},[D]),A=(0,q.useMemo)(()=>{let e=new Set;for(let t of D??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[D]),j=d!==``||a!==Q||s!==Q||l!==Q||u!==Q||m.length>0||p.kind!==`relative`||p.from!==Nt.from;function Se(){t({search:{limit:100,kind:`all`},replace:!0})}let Oe=S?D?.filter(e=>e.correlationId===S):O,ke=e.section,M=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)(gt,{value:ke,onValueChange:e=>M(e),children:[(0,J.jsxs)(at,{className:`w-full`,children:[(0,J.jsxs)(z,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(nt,{size:13,"aria-hidden":!0}),we()]}),(0,J.jsxs)(z,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),be()]})]}),(0,J.jsx)(L,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(L,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[Te(),(0,J.jsx)(`strong`,{children:Ee()}),Me(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Le()})]}),(0,J.jsxs)(K,{q:d,onQChange:re,searchPlaceholder:Ce(),timeRange:p,onTimeRangeChange:le,onReset:Se,canReset:j,children:[(0,J.jsxs)(U,{value:a,onValueChange:ie,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:ye()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:Q,children:Ge()}),At.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:s,onValueChange:ae,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:Ae()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:Q,children:ve()}),jt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:l,onValueChange:se,children:[(0,J.jsx)(W,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:Ve()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:Q,children:Fe()}),Mt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:u,onValueChange:E,children:[(0,J.jsx)(W,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{placeholder:_e()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:Q,children:De()}),A.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:r===Z?``:r,placeholder:ze(),"aria-label":ze(),onChange:e=>{let t=e.target.value.trim();T(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:k.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(U,{value:String(n),onValueChange:e=>ne(Number(e)),children:[(0,J.jsx)(W,{size:`sm`,className:`w-28`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(B,{children:kt.map(e=>(0,J.jsx)(H,{value:String(e),children:Ne({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:m,onChange:de}),S?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>C(null),title:Ue(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[xe(),(0,J.jsx)(`code`,{children:$(S)})]}),(0,J.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:i()})]})}):null,(0,J.jsx)(St,{title:oe(),rows:Oe,emptyHint:S?ge():me(),columns:[{header:he(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:b(),sort:e=>e.kind,cell:e=>(0,J.jsx)(R,{variant:`secondary`,children:e.kind})},{header:Re(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":x(),children:`✓`})}},{header:h(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(R,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:pe(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(R,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:ue(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:_(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:fe(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:c(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Ze(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ce(),onClick:()=>C(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ee(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:y()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:te,onClose:()=>w(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(ut,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(ht,{className:`max-w-lg`,children:[(0,J.jsxs)(dt,{children:[(0,J.jsxs)(ot,{className:`oc-traces__meta-title`,children:[m(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(R,{variant:`outline`,children:ie()})]}),(0,J.jsx)(pt,{children:ne()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{$w as t,Mk as n,Qw as r,Zw as i,aT as a,cT as o,eT as s,iT as c,lT as l,nT as u,oT as d,pE as f,rT as p,sT as m,t as h,tT as g,zJ as _}from"./api-DL5MhfCR.js";import{t as v}from"./use_paginated_query-DuQlVoOP.js";import{t as y}from"./button-7-8JjL3V.js";import{Tn as b,Z as x,h as S,m as C,vt as w,yn as T}from"./index-D2_zMS9W.js";var E=e(),D=50;function O({status:e,loadMore:t}){return e!==`CanLoadMore`&&e!==`LoadingMore`?null:(0,E.jsx)(y,{variant:`outline`,size:`sm`,className:`self-start`,disabled:e===`LoadingMore`,onClick:()=>t(50),children:i()})}function k({items:e,onRestore:t,onPurge:n}){let r=x();return(0,E.jsx)(`ul`,{className:`oc-trash__list`,children:e.map(e=>(0,E.jsxs)(`li`,{className:`oc-trash__item`,children:[(0,E.jsxs)(`div`,{className:`oc-trash__meta`,children:[(0,E.jsx)(`span`,{className:`oc-trash__title`,children:e.title||f()}),(0,E.jsxs)(`span`,{className:`oc-trash__dates`,children:[e.owner===void 0?null:(0,E.jsxs)(`span`,{className:`oc-trash__owner`,children:[e.owner,` · `]}),d({date:w(e.trashedAt)}),e.purgeAfter===null?null:` · ${a({date:C(e.purgeAfter)})}`]})]}),(0,E.jsxs)(`div`,{className:`oc-trash__actions`,children:[(0,E.jsxs)(y,{variant:`outline`,size:`sm`,onClick:()=>void t(e._id),children:[(0,E.jsx)(b,{}),` `,c()]}),(0,E.jsxs)(y,{variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:async()=>{await r({title:u(),description:g(),confirmLabel:p(),destructive:!0})&&await n(e._id)},children:[(0,E.jsx)(T,{}),` `,p()]})]})]},e._id))})}function A(){let{results:e,status:i,loadMore:a}=v(h.trash.listMyTrash,{},{initialNumItems:50}),c=S(),u=_(h.trash.restoreChat),d=_(h.trash.purgeChat),f=_(h.trash.emptyTrash),p=x();return(0,E.jsx)(`div`,{className:`oc-trash`,children:(0,E.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,E.jsxs)(`header`,{className:`oc-trash__head`,children:[(0,E.jsxs)(`h1`,{className:`oc-trash__heading`,children:[(0,E.jsx)(T,{className:`size-5`,"aria-hidden":!0}),` `,l()]}),e.length>0?(0,E.jsx)(y,{variant:`destructive`,size:`sm`,onClick:async()=>{await p({title:t(),description:r(),confirmLabel:s(),destructive:!0})&&await f({})},children:s()}):null]}),(0,E.jsx)(`p`,{className:`oc-trash__hint`,children:o({days:c})}),i===`LoadingFirstPage`?(0,E.jsx)(`p`,{className:`oc-trash__hint`,children:n()}):e.length===0?(0,E.jsx)(`p`,{className:`oc-trash__empty`,children:m()}):(0,E.jsx)(k,{items:e,onRestore:e=>u({chatId:e}),onPurge:e=>d({chatId:e})}),(0,E.jsx)(O,{status:i,loadMore:a})]})})}export{D as TRASH_PAGE,k as TrashList,O as TrashLoadMore,A as TrashPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{BJ as r,Bw as i,E as a,Fw as o,Gw as s,Hw as c,Iw as l,Kw as u,Lw as d,MJ as f,Mk as p,Mw as m,Nw as h,Pw as g,Rw as _,Uw as v,Vw as y,Ww as b,Xw as x,Yw as S,jw as C,qw as w,t as T,zJ as E,zw as D}from"./api-DL5MhfCR.js";import{t as O}from"./use_paginated_query-DuQlVoOP.js";import{t as k}from"./button-7-8JjL3V.js";import{F as A,Rt as j,Z as M,h as N,yn as P,yt as F}from"./index-D2_zMS9W.js";import{TrashList as I,TrashLoadMore as L}from"./TrashPage-CBVMN6l3.js";var R=a(`scan-search`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]),z=t(e(),1);function B(e,t){let n=e.find(e=>e.status===`running`&&!e.stale)??null,r=e.find(e=>e.mode===`dryRun`&&e.status===`done`)??null,i=e.find(e=>e.mode===`apply`&&(e.status===`done`||e.status===`refused`)&&(r===null||e.startedAt>r.startedAt))??null,a=null;return n===null?r===null||i!==null?a=`no_report`:r.applicableUntil===null||r.applicableUntil<=t?a=`expired`:r.mirrorMissing>0?a=`mirror`:r.orphans.count===0&&(a=`nothing`):a=`running`,{running:n,report:r,lastApply:i,applyBlock:a}}var V=n();function H(){let e=r(T.blobSweep.listBlobSweeps,{}),t=r(T.blobQuarantine.quarantineSettings,{}),n=E(T.blobSweep.startBlobSweep),a=M(),{toast:x}=j(),[S,O]=(0,z.useState)(!1),N=f(),I=e=>A(e,N),L=B(e??[],Date.now()),H=L.report,U=async e=>{O(!0);try{await e()}catch(e){x({title:C(),description:e.message,variant:`error`})}finally{O(!1)}},W=()=>U(()=>n({mode:`dryRun`})),G=async()=>{H!==null&&await a({title:o({count:H.orphans.count}),description:g({size:I(H.orphans.bytes)}),confirmLabel:l(),destructive:!0})&&await U(()=>n({mode:`apply`,confirms:H._id}))};return(0,V.jsxs)(`section`,{className:`oc-trash__body`,"aria-labelledby":`oc-blobsweep-title`,children:[(0,V.jsxs)(`div`,{className:`oc-trash__head`,children:[(0,V.jsx)(`h3`,{id:`oc-blobsweep-title`,className:`oc-trash__heading`,children:w()}),(0,V.jsxs)(`div`,{className:`oc-trash__actions`,children:[(0,V.jsxs)(k,{variant:`outline`,size:`sm`,disabled:S||L.running!==null,onClick:()=>void W(),children:[(0,V.jsx)(R,{}),` `,s()]}),(0,V.jsxs)(k,{variant:`ghost`,size:`sm`,className:`text-destructive`,disabled:S||L.applyBlock!==null,onClick:()=>void G(),children:[(0,V.jsx)(P,{}),` `,l()]})]})]}),(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:u({days:H?.minAgeDays??7,quarantine:t?.days??7})}),e===void 0?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:p()}):null,L.running===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:b({scanned:L.running.blobsScanned})}),e!==void 0&&H===null&&L.running===null?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:v()}):null,H===null?null:(0,V.jsxs)(`div`,{className:`oc-trash__hint`,children:[(0,V.jsx)(`p`,{children:c({date:F(H.finishedAt??H.startedAt),count:H.orphans.count,size:I(H.orphans.bytes),scanned:H.blobsScanned})}),(0,V.jsxs)(`ul`,{children:[(0,V.jsx)(`li`,{children:y({count:H.byOrigin.upload?.count??0,size:I(H.byOrigin.upload?.bytes??0)})}),(0,V.jsx)(`li`,{children:i({count:H.byOrigin.unregistered?.count??0,size:I(H.byOrigin.unregistered?.bytes??0)})})]}),H.importing>0?(0,V.jsx)(`p`,{children:D({count:H.importing})}):null,H.mirrorMissing>0?(0,V.jsx)(`p`,{className:`text-destructive`,children:_({count:H.mirrorMissing})}):null,L.applyBlock===`expired`?(0,V.jsx)(`p`,{children:d()}):null]}),L.lastApply===null?null:(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:L.lastApply.status===`refused`?m({date:F(L.lastApply.finishedAt??L.lastApply.startedAt)}):h({date:F(L.lastApply.finishedAt??L.lastApply.startedAt),count:L.lastApply.deleted.count,size:I(L.lastApply.deleted.bytes)})})]})}function U(){let{results:e,status:t,loadMore:n}=O(T.trash.adminListTrash,{},{initialNumItems:50}),r=N(),i=E(T.trash.adminRestoreChat),a=E(T.trash.adminPurgeChat);return(0,V.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:x({days:r})}),t===`LoadingFirstPage`?(0,V.jsx)(`p`,{className:`oc-trash__hint`,children:p()}):e.length===0?(0,V.jsx)(`p`,{className:`oc-trash__empty`,children:S()}):(0,V.jsx)(I,{items:e,onRestore:e=>i({chatId:e}),onPurge:e=>a({chatId:e})}),(0,V.jsx)(L,{status:t,loadMore:n}),(0,V.jsx)(H,{})]})}export{U as TrashTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,$P as i,BJ as a,BP as o,GO as s,GP as c,HP as l,JO as u,JP as d,KO as f,KP as p,My as m,Ny as h,QO as g,QP as ee,UP as te,VP as ne,WP as re,XO as _,XP as ie,YO as v,YP as ae,ZO as y,ZP as oe,aF as b,cF as se,dF as ce,eF as le,ek as x,fF as S,iF as ue,jy as C,lF as w,mF as T,nF as E,nk as D,oF as de,pF as O,qO as k,qP as fe,rF as pe,rk as A,sF as me,t as j,tF as he,tk as M,uF as ge,xP as _e,zJ as N}from"./api-DL5MhfCR.js";import{t as P}from"./button-7-8JjL3V.js";import{Cn as F,Gt as I,Jt as L,Kt as ve,Lt as R,Q as ye,Rt as z,Ut as be,Wt as xe,Z as Se,_t as Ce,bn as B,c as V,ct as H,dt as U,er as we,ft as Te,gt as W,l as Ee,lt as G,mt as De,pt as Oe,st as K,tr as ke,tt as Ae,u as q,ut as J,xt as Y}from"./index-D2_zMS9W.js";import{t as je}from"./FilterBar-6mIwprKY.js";import{t as Me}from"./DataTableShell-8D6YsZBo.js";import{t as Ne}from"./DetailChips-CcoyXRh4.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:i}){let o=a(j.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),s=a(j.agents.listUserAgents,n&&e?{profileId:e}:`skip`),c=new Set((s??[]).map(e=>`${e.instanceName}/${e.agentId}`)),l=(s??[]).find(e=>e.isDefault)??null,u=l?`${l.instanceName}/${l.agentId}`:null,d=new Set((o?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),f=[...(o?.agents??[]).map(e=>({...e,outOfPool:!1})),...(s??[]).filter(e=>!d.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],p=new Map;for(let e of f){let t=p.get(e.instanceName)??[];t.push(e),p.set(e.instanceName,t)}return(0,Z.jsx)(Te,{open:n,onOpenChange:i,children:(0,Z.jsxs)(Oe,{className:`oc-access`,children:[(0,Z.jsxs)(W,{children:[(0,Z.jsx)(Ce,{children:A({user:t})}),(0,Z.jsx)(De,{children:D()})]}),o?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:o.inGroup?M():x()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:o===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:r()}):f.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:_()}):[...p.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:c,defaultKey:u},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=N(j.agents.assignAgent),c=N(j.agents.removeAgent),l=N(j.agents.setDefaultAgent),d=z();if(!e)return null;async function p(n,r){try{r?await c({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(g(),e)}}async function m(n){try{await l({profileId:e,instanceName:t,agentId:n})}catch(e){d.error(y(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(F,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,c=e.state===`deleted`,l=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${l?` is-disabled`:``}`,children:[(0,Z.jsx)(Y,{checked:r,disabled:(c||l)&&!r,onCheckedChange:()=>void p(e.agentId,r),"aria-label":v({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,c?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:u()}):null,e.outOfPool?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:k()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":f(),title:f(),children:(0,Z.jsx)(B,{size:14,fill:`currentColor`})}):(0,Z.jsx)(P,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":s(),title:s(),disabled:l,onClick:()=>void m(e.agentId),children:(0,Z.jsx)(B,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return C();case`user`:return m();case`admin`:return h();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=V.filter(e=>n.has(q[e])).length;return(0,Z.jsxs)(be,{children:[(0,Z.jsx)(L,{asChild:!0,children:(0,Z.jsx)(P,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?T():O({count:r})})}),(0,Z.jsxs)(xe,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(ve,{children:S()}),V.map(e=>{let r=q[e];return(0,Z.jsxs)(I,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(Y,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Ee[e]()})]},e)})]})]})}function Le(){let e=ke({from:`/settings/users`}),t=we({from:`/settings/users`}),n=e.q??``,r=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=a(j.admin.listUsers,{filter:{q:n||void 0,role:r===Q?void 0:r},withAgents:!0}),m=a(j.me.getMe,{host:Ae}),h=N(j.admin.setRole),g=N(j.admin.setUserPermissions),_=N(j.admin.startImpersonation),v=N(j.admin.deleteUser),y=N(j.admin.setUserName),x=Se(),S=ye(),C=z(),[T,D]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),k=n!==``||r!==Q;function A(){t({search:{},replace:!0})}async function M(e){try{await h(e)}catch(e){C.error(ce(),e)}}async function P(e){try{await g(e)}catch(e){C.error(ge(),e)}}async function I(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:pe(),description:E({user:t}),confirmWord:he(),confirmLabel:le(),destructive:!0}))try{await v({profileId:e._id}),C.success(ee({user:t}))}catch(e){C.error(i(),e)}}async function L(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:ie(),label:ae({user:t}),placeholder:d(),defaultValue:e.name??``,confirmLabel:_e()});if(n!==null)try{await y({profileId:e._id,name:n}),C.success(fe())}catch(e){C.error(p(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:s,searchPlaceholder:w(),onReset:A,canReset:k,children:(0,Z.jsxs)(K,{value:r,onValueChange:u,children:[(0,Z.jsx)(J,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(U,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(G,{value:Q,children:se()}),O.map(e=>(0,Z.jsx)(G,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:me(),rows:f,emptyHint:de(),rowActions:e=>{let t=[{label:o(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:oe(),onSelect:()=>void L(e)}];return e.userId!==m?.userId&&t.push({label:b(),onSelect:()=>void _({profileId:e._id})},{label:ue(),variant:`destructive`,onSelect:()=>void I(e)}),t},columns:[{header:c(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:re(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(K,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,Z.jsx)(J,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(U,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(G,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(G,{value:`user`,children:$(`user`)}),(0,Z.jsx)(G,{value:`admin`,children:$(`admin`)})]})]})},{header:te(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:l()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),P({profileId:e._id,permissions:[...n]})}})},{header:ne(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(F,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:T?.profileId??null,userLabel:T?.label??``,open:T!==null,onOpenChange:e=>{e||D(null)}})]})}export{Le as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$c as r,AJ as i,As as a,BJ as o,B_ as s,Bc as c,Bs as l,Fs as u,Gc as d,Hc as f,Hs as p,Is as m,Jc as h,Kc as g,LJ as ee,Ls as _,MJ as te,Ms as v,Ps as ne,Qc as re,Uc as y,Us as b,Vc as x,Vs as S,Wc as C,Ws as ie,Xc as ae,Yc as oe,Zc as w,Zs as se,_g as ce,_s as le,al as T,cl as ue,el as de,hg as fe,il as E,js as pe,ks as me,ll as he,nl as D,ol as O,qc as k,rl as A,sl as j,t as M,tl as N,ul as P,vI as F,zJ as I}from"./api-DL5MhfCR.js";import{t as L}from"./button-7-8JjL3V.js";import{$n as R,J as z,Lt as B,Nn as ge,X as V,Y as _e,cn as ve,ct as H,dn as U,dt as W,er as ye,fn as be,ln as xe,lt as G,mn as Se,on as Ce,q as we,sn as Te,st as K,tr as Ee,tt as q,un as J,ut as Y,xt as X}from"./index-D2_zMS9W.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>A()],[`fr-FR`,()=>ie()],[`en-US`,()=>b()],[`en-GB`,()=>p()],[`de-DE`,()=>S()],[`es-ES`,()=>l()]],Oe=[[`0.75`,()=>N()],[`1`,()=>de()],[`1.25`,()=>r()],[`1.5`,()=>re()]],$=0;function ke({instance:e}){let t=I(M.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[i,o]=(0,Z.useState)(r),[c,l]=(0,Z.useState)(`idle`),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=ee(M.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),l(`idle`)},[e._id]);let g=i.enabled!==r.enabled||i.engine!==r.engine||i.lang!==r.lang||i.rate!==r.rate||i.autoRead!==r.autoRead;async function _(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=i.enabled,i.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,i.lang===`auto`?delete n.voiceLang:n.voiceLang=i.lang;let r=Number.parseFloat(i.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,i.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),l(`idle`)}catch{l(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(B,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:i.enabled,onCheckedChange:e=>o({...i,enabled:e===!0}),"aria-label":T()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:T()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()}),(0,Q.jsxs)(K,{value:i.engine,onValueChange:e=>o({...i,engine:e}),disabled:!i.enabled,children:[(0,Q.jsx)(Y,{size:`sm`,"aria-label":v(),children:(0,Q.jsx)(W,{})}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(G,{value:`browser`,children:pe()}),e.kind===`hermes`?null:(0,Q.jsx)(G,{value:`gateway`,children:a()})]})]})]}),i.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:me()}):null,i.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,Q.jsxs)(K,{value:i.lang,onValueChange:e=>o({...i,lang:e}),disabled:!i.enabled,children:[(0,Q.jsx)(Y,{size:`sm`,"aria-label":E(),children:(0,Q.jsx)(W,{})}),(0,Q.jsx)(H,{children:De.map(([e,t])=>(0,Q.jsx)(G,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,Q.jsxs)(K,{value:i.rate,onValueChange:e=>o({...i,rate:e}),disabled:!i.enabled,children:[(0,Q.jsx)(Y,{size:`sm`,"aria-label":D(),children:(0,Q.jsx)(W,{})}),(0,Q.jsx)(H,{children:Oe.map(([e,t])=>(0,Q.jsx)(G,{value:e,children:t()},e))})]})]}),i.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:i.autoRead,onCheckedChange:e=>o({...i,autoRead:e===!0}),disabled:!i.enabled,"aria-label":w()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:w()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ae()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(L,{size:`sm`,disabled:!g||c===`saving`,onClick:()=>void _(),children:c===`saving`?s():ce()}),(0,Q.jsx)(L,{variant:`outline`,size:`sm`,disabled:!i.enabled||u,onClick:()=>{let t=Number.parseFloat(i.rate)||1,n=++$;if(p(!1),U(),J(),i.engine!==`gateway`){xe(k(),{lang:ve(i.lang,te()),rate:t});return}d(!0),m({instanceName:e.name,text:k()}).then(({mime:e,audioBase64:r})=>{n===$&&Te(r,e,{rate:t})}).catch(()=>{n===$&&p(!0)}).finally(()=>d(!1))},children:u?s():oe()}),(0,Q.jsx)(L,{variant:`ghost`,size:`sm`,onClick:()=>{$++,d(!1),U(),J()},children:h()})]}),c===`error`||f?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:f?le():fe()}):null]})}function Ae({stt:e}){let t=o(M.me.getMe,{host:q}),n=I(M.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:d()}),(0,Q.jsx)(B,{variant:e?`secondary`:`outline`,children:e?x():c()}),(0,Q.jsx)(B,{variant:r?`secondary`:`destructive`,children:r?m():u()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":_()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:C()})]})}function je(){let e=o(M.admin.listInstances,{}),t=(0,Z.useMemo)(()=>be(),[]),n=(0,Z.useMemo)(()=>Ce(),[]),{section:r}=Ee({from:`/settings/voice`}),a=ye({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:P()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(B,{variant:t?`secondary`:`destructive`,children:t?he():ue()}),(0,Q.jsx)(B,{variant:n?`secondary`:`destructive`,children:n?j():O()})]}),(0,Q.jsxs)(we,{value:r,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(_e,{className:`w-full`,children:[(0,Q.jsxs)(V,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Se,{size:13,"aria-hidden":!0}),ne()]}),(0,Q.jsxs)(V,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ge,{size:13,"aria-hidden":!0}),d()]}),(0,Q.jsxs)(V,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(R,{size:13,"aria-hidden":!0}),y()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(z,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:y()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:f()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=I(M.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(B,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:se()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":F()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:F()})]})]})}export{je as VoiceTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e}from"./api-DL5MhfCR.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ao as e,Ax as t,Bx as n,Cx as r,Dx as i,Ex as a,Fx as o,Gx as s,Hx as c,Ix as l,Jx as u,Kx as d,Lx as f,Mx as p,Nx as m,Ox as h,Px as g,Rx as _,Sx as v,Tx as y,Ux as b,Vx as x,Wx as S,Xx as C,Yx as w,Zx as T,_x as E,aa as D,bx as O,da as k,fa as A,jo as j,jx as M,kx as N,la as P,ma as F,oa as I,pa as L,qx as R,ua as z,vx as B,wx as V,xx as H,yx as U,zx as W}from"./api-DL5MhfCR.js";var G={AGENT_NOT_FOUND:()=>({label:T(),hint:C()}),AUTH_TOKEN_MISMATCH:()=>({label:w(),hint:u()}),DEVICE_SIGNING_FAILED:()=>({label:R(),hint:d()}),SESSION_SCOPE_DENIED:()=>({label:s(),hint:S()}),GATEWAY_TIMEOUT:()=>({label:b(),hint:c()}),GATEWAY_DISCONNECTED:()=>({label:x(),hint:n()}),GATEWAY_RESTARTING:()=>({label:W(),hint:_()}),CONNECTION_SATURATED:()=>({label:f(),hint:l()}),DISPATCH_STALLED:()=>({label:j(),hint:e()}),ATTACHMENT_TOO_LARGE:()=>({label:m(),hint:p()}),ATTACHMENT_REJECTED:()=>({label:M(),hint:t()}),BRIDGE_UNREACHABLE:()=>({label:o(),hint:g()}),INVALID_REQUEST:()=>({label:N(),hint:h()}),chat_request_conflict:()=>({label:i(),hint:a()}),NOT_CONFIGURED:()=>({label:y(),hint:V()}),UNROUTED:()=>({label:r(),hint:v()}),attachment_name_too_long:()=>({label:I(),hint:D()}),attachment_path_refused:()=>({label:F(),hint:L()}),attachment_staging_failed:()=>({label:A(),hint:k()}),attachment_cleanup_unconfirmed:()=>({label:z(),hint:P()}),UPSTREAM_ERROR:()=>({label:H(),hint:O()}),UNKNOWN:()=>({label:U(),hint:B()})};function K(e){return e?G[e]?.()??{label:e,hint:E()}:G.UNKNOWN()}export{K as t};
|