@lacneu/atrium 0.64.0 → 0.65.0
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-JCA7fZ9L.js +1 -0
- package/dist/assets/AdvancedFilter-CHaC3XqK.js +1 -0
- package/dist/assets/AgentFilesTab-DFl5KrJ6.js +3 -0
- package/dist/assets/AnomaliesTab-D_2rZvDm.js +1 -0
- package/dist/assets/AuditTab-pIPOy40q.js +1 -0
- package/dist/assets/BridgeTab-BHFEZ8Tf.js +1 -0
- package/dist/assets/ChatDefaultsTab-D8voH6BO.js +1 -0
- package/dist/assets/DataTableShell-D21VGOsx.js +1 -0
- package/dist/assets/{DetailChips-KZ6IBAE_.js → DetailChips-BvOufdR5.js} +1 -1
- package/dist/assets/FeedbacksTab-D7EWcEXh.js +1 -0
- package/dist/assets/{FieldLabel-DSkWwP2e.js → FieldLabel-BkPn70WH.js} +8 -2
- package/dist/assets/FilesTab-DH_nWUT9.js +1 -0
- package/dist/assets/FilterBar-B2rdcXo-.js +1 -0
- package/dist/assets/GroupsTab-C5SRlaBh.js +1 -0
- package/dist/assets/InstancesTab-BbBfU2M8.js +1 -0
- package/dist/assets/IntegrationsTab-Bhrt_3mL.js +1 -0
- package/dist/assets/KpiTab-CqrNDV0R.js +1 -0
- package/dist/assets/PreferencesTab-cE6r_AZd.js +1 -0
- package/dist/assets/ProjectPage-CYltKiEJ.js +1 -0
- package/dist/assets/PromptInjectionsTab-8XGCJFsP.js +4 -0
- package/dist/assets/RolesTab-D-h-9bci.js +1 -0
- package/dist/assets/ScheduledTab-DqKsYZCk.js +1 -0
- package/dist/assets/ServiceAccountsTab-ugnT2ad6.js +1 -0
- package/dist/assets/SubAgentReportsTab-D6ctqPBm.js +1 -0
- package/dist/assets/ThemeShowroom-DJxNALnu.js +1 -0
- package/dist/assets/TimeRangePicker-hED8r05n.js +1 -0
- package/dist/assets/TimezoneCombobox-yOLv96pi.js +1 -0
- package/dist/assets/TracesTab-DxKuLnoV.js +1 -0
- package/dist/assets/UsersTab-wvWYaxpO.js +1 -0
- package/dist/assets/VoiceTab-DUevCd90.js +1 -0
- package/dist/assets/api-CtSSWr7U.js +44 -0
- package/dist/assets/button-wKI2Tt4J.js +1 -0
- package/dist/assets/card-CJ2aHkj_.js +1 -0
- package/dist/assets/check-C6IJbaM9.js +1 -0
- package/dist/assets/chevron-up-DXtuCSZO.js +1 -0
- package/dist/assets/chevrons-up-down-DThxT9O7.js +1 -0
- package/dist/assets/compatView-oAAoNQED.js +1 -0
- package/dist/assets/dispatchErrorInfo-BURg2cAZ.js +1 -0
- package/dist/assets/dist-BiYzLO8Z.js +1 -0
- package/dist/assets/dist-CQacamxA.js +5 -0
- package/dist/assets/dist-MF--QEbp.js +1 -0
- package/dist/assets/{highlighted-body-OFNGDK62-CB68xClL.js → highlighted-body-OFNGDK62-DyuLdYIi.js} +1 -1
- package/dist/assets/index-Dvtp4XJ3.css +1 -0
- package/dist/assets/index-gsM_dJLK.js +238 -0
- package/dist/assets/list-LOA_FvDd.js +1 -0
- package/dist/assets/mermaid-GHXKKRXX-C5M82A9X.js +1 -0
- package/dist/assets/{pdf-TGis77gc.js → pdf-1Br_HKW6.js} +1 -1
- package/dist/assets/roleDescriptions-xfA2NfTy.js +1 -0
- package/dist/assets/table-CzZqanD8.js +1 -0
- package/dist/assets/tabs-BqUPTpU0.js +1 -0
- package/dist/assets/x-Ce5BXizZ.js +1 -0
- package/dist/index.html +10 -10
- package/package.json +1 -1
- package/dist/assets/AccessTab-CBVHd2Iu.js +0 -1
- package/dist/assets/AdvancedFilter-Bt1eVvHP.js +0 -1
- package/dist/assets/AgentFilesTab-BohV-adj.js +0 -3
- package/dist/assets/AnomaliesTab-EQ_VT5g5.js +0 -1
- package/dist/assets/AuditTab-BNbnYz56.js +0 -1
- package/dist/assets/BridgeTab-BvWUat6m.js +0 -1
- package/dist/assets/ChatDefaultsTab-e5KaQK3Y.js +0 -1
- package/dist/assets/DataTableShell-C8TvrDnS.js +0 -1
- package/dist/assets/FeedbacksTab-CNE_EiBr.js +0 -1
- package/dist/assets/FilesTab-BVwtwtbk.js +0 -1
- package/dist/assets/FilterBar-D1X-NYiQ.js +0 -1
- package/dist/assets/GroupsTab-CCbkJsjt.js +0 -1
- package/dist/assets/InstancesTab-mcPK_zLE.js +0 -1
- package/dist/assets/IntegrationsTab-CelkZ3qy.js +0 -1
- package/dist/assets/KpiTab-Bci6HkZZ.js +0 -1
- package/dist/assets/PreferencesTab-C_G9wJMM.js +0 -1
- package/dist/assets/ProjectPage-Bzczemnc.js +0 -1
- package/dist/assets/PromptInjectionsTab-DB-9icKP.js +0 -4
- package/dist/assets/RolesTab-6KibifRX.js +0 -1
- package/dist/assets/ScheduledTab-D4HfwMsR.js +0 -1
- package/dist/assets/ServiceAccountsTab-BP5M1qoc.js +0 -1
- package/dist/assets/SubAgentReportsTab-clUXZIsv.js +0 -1
- package/dist/assets/ThemeShowroom-DObwBmje.js +0 -1
- package/dist/assets/TimeRangePicker-Cc-m21ii.js +0 -1
- package/dist/assets/TimezoneCombobox-bRTawtDX.js +0 -1
- package/dist/assets/TracesTab-BCArDQYw.js +0 -1
- package/dist/assets/UsersTab-htPZvQ3W.js +0 -1
- package/dist/assets/VoiceTab-DrlhpckV.js +0 -1
- package/dist/assets/button-9CDM33ms.js +0 -1
- package/dist/assets/card-cbtxUmVi.js +0 -1
- package/dist/assets/check-DP-dt0kl.js +0 -1
- package/dist/assets/chevron-up-Zim_BdlH.js +0 -1
- package/dist/assets/chevrons-up-down-Dynznz1g.js +0 -1
- package/dist/assets/compatView-zajsEi96.js +0 -1
- package/dist/assets/dispatchErrorInfo-BwVeZJIC.js +0 -1
- package/dist/assets/dist-BOEXkJhX.js +0 -1
- package/dist/assets/dist-CKeB-cox.js +0 -44
- package/dist/assets/dist-CVc9CU_a.js +0 -5
- package/dist/assets/dist-_mTpkDcR.js +0 -1
- package/dist/assets/index-Bjld8kqu.js +0 -238
- package/dist/assets/index-CjUx3yzx.css +0 -1
- package/dist/assets/list-AW1nQPBF.js +0 -1
- package/dist/assets/mermaid-GHXKKRXX-ms4fjIoL.js +0 -1
- package/dist/assets/roleDescriptions-BIxax60M.js +0 -1
- package/dist/assets/table-QZEG8lub.js +0 -1
- package/dist/assets/tabs-XFZCx7lK.js +0 -1
- package/dist/assets/x-DJVrcLrv.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,AA as i,BA as ee,CA as a,Cj as te,DA as ne,EA as o,FA as re,GA as ie,HA as ae,IA as oe,JA as se,KA as ce,LA as le,MA as ue,NA as de,OA as fe,PA as pe,QA as me,RA as he,SA as s,Sj as ge,TA as c,UA as _e,VA as ve,WA as ye,XA as be,YA as xe,ZA as Se,_A as Ce,_j as we,aA as Te,aj as Ee,bA as l,bj as De,cA as u,cL as d,cj as Oe,dA as f,dj as ke,ej as Ae,fA as p,fj as je,gA as m,gj as Me,hA as h,hj as Ne,iA as g,ij as Pe,jA as Fe,kA as Ie,lA as _,lL as v,lj as Le,mA as y,mj as Re,nj as ze,oA as b,oL as Be,oj as Ve,pA as x,pj as He,qA as Ue,rA as S,rj as We,sA as C,sj as Ge,t as w,tj as Ke,uA as T,uj as qe,vA as E,vj as D,wA as O,xA as k,xj as Je,yA as A,yj as Ye,zA as Xe}from"./api-CtSSWr7U.js";import{t as j}from"./check-C6IJbaM9.js";import{r as Ze}from"./dist-BiYzLO8Z.js";import{t as M}from"./button-wKI2Tt4J.js";import{Dt as Qe,Fn as $e,On as N,Pn as et,Z as tt,_ as nt,_t as P,bt as F,ct as I,dt as L,ft as R,gt as z,ht as B,jn as rt,jt as V,mt as H,pt as it,st as U,ut as W,vt as G,xt as K,yt as q}from"./index-gsM_dJLK.js";import{t as at}from"./FilterBar-B2rdcXo-.js";import{t as ot}from"./DataTableShell-D21VGOsx.js";import{t as st}from"./roleDescriptions-xfA2NfTy.js";var J=t(e(),1),Y=n(),ct=[{value:`never`,label:()=>_(),days:null},{value:`30`,label:()=>u(),days:30},{value:`90`,label:()=>C(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=$e({from:`/settings/serviceAccounts`}),t=et({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??Z,[o,s]=(0,J.useState)(Z),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Ce=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),Te=v(w.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===Z?void 0:o,disabled:a===Z?void 0:a===`disabled`}}),l=v(w.apiKeys.listKeys,{}),u=v(w.apiKeys.listRoles,{}),f=d(w.apiKeys.createServiceAccount),p=d(w.apiKeys.updateServiceAccount),m=d(w.apiKeys.deleteServiceAccount),h=Be(w.apiKeys.mintApiKey),g=d(w.apiKeys.revokeApiKey),_=tt(),y=Qe(),b=n!==``||o!==Z||a!==Z;function x(){s(Z),t({search:{},replace:!0})}let[S,C]=(0,J.useState)(!1),[T,E]=(0,J.useState)(Q),[O,k]=(0,J.useState)(null),[A,j]=(0,J.useState)(new Set),[N,I]=(0,J.useState)(null),L=(0,J.useRef)(!1),[R,z]=(0,J.useState)(new Set),[B,H]=(0,J.useState)({}),[it,U]=(0,J.useState)(null),X=(0,J.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[l]);function $(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{O?(await p({serviceAccountId:O,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(ve())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Q),k(null),C(!1)}catch(e){y.error(O?ae():_e(),e)}}function ft(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),C(!0)}async function pt(e){if(L.current)return;L.current=!0;let t=B[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 h({serviceAccountId:e._id,expiresAt:r});U({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(ee(),e)}finally{L.current=!1,I(null)}}async function mt(e){if(await _({title:Xe(),description:(0,Y.jsxs)(Y.Fragment,{children:[he(),` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,le(),` `,(0,Y.jsx)(`strong`,{children:oe()}),` `,re()]}),confirmWord:e.name,confirmLabel:pe(),destructive:!0}))try{await m({serviceAccountId:e._id}),y.success(de(),e.name)}catch(e){y.error(ue(),e)}}async function ht(e){if(await _({title:Fe(),description:(0,Y.jsxs)(Y.Fragment,{children:[i(),` `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Ie()]}),confirmLabel:fe(),destructive:!0})&&!R.has(e._id)){z(t=>new Set(t).add(e._id));try{await g({keyId:e._id})}catch(e){y.error(ne(),e)}finally{z(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:te()}),(0,Y.jsxs)(at,{q:n,onQChange:c,searchPlaceholder:ge(),onReset:x,canReset:b,children:[(0,Y.jsxs)(P,{value:o,onValueChange:s,children:[(0,Y.jsx)(F,{size:`sm`,className:`w-40`,children:(0,Y.jsx)(K,{placeholder:Je()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Z,children:De()}),(u??[]).map(e=>(0,Y.jsx)(q,{value:e.key,children:e.key},e._id))]})]}),(0,Y.jsxs)(P,{value:a,onValueChange:Ce,children:[(0,Y.jsx)(F,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Z,children:Ye()}),(0,Y.jsx)(q,{value:`active`,children:D()}),(0,Y.jsx)(q,{value:`disabled`,children:we()})]})]})]}),(0,Y.jsx)(ot,{title:Me(),rows:Te,addLabel:Ne(),onAdd:()=>{E(Q),k(null),C(!0)},emptyHint:Re(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,Y.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:R}),rowActions:e=>[{label:qe(),onSelect:()=>ft(e)},{label:He(),onSelect:()=>void pt(e)},{label:A.has(e._id)?je():ke(),onSelect:()=>$(e._id)},{label:Le(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Oe():Ge(),onClick:()=>$(e._id),children:A.has(e._id)?(0,Y.jsx)(Ze,{}):(0,Y.jsx)(rt,{})})},{header:Ve(),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:Ee(),sort:e=>e.roleKey,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey})},{header:Pe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,Y.jsx)(W,{variant:`destructive`,children:we()}):(0,Y.jsx)(W,{variant:`outline`,children:D()})},{header:We(),cell:e=>(0,Y.jsxs)(P,{value:B[e._id]??`never`,onValueChange:t=>H(n=>({...n,[e._id]:t})),children:[(0,Y.jsx)(F,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(G,{children:ct.map(e=>(0,Y.jsx)(q,{value:e.value,children:e.label()},e.value))})]})},{header:ze(),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:N===e._id?Ke():Ae({count:t})})}}]}),(0,Y.jsx)(nt,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:O?r():be(),description:O?me():xe(),canSubmit:!!(T.name&&T.roleKey),onSubmit:dt,submitLabel:O?Se():se(),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:Ue()}),(0,Y.jsx)(V,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:ce()}),(0,Y.jsxs)(P,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,Y.jsx)(F,{className:`w-full`,children:(0,Y.jsx)(K,{placeholder:ie()})}),(0,Y.jsx)(G,{children:(u??[]).map(e=>(0,Y.jsxs)(q,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===T.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:ye()}),(0,Y.jsx)(V,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,Y.jsx)(ut,{minted:it,onClose:()=>U(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:[o(),` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(0,Y.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{children:O()}),(0,Y.jsx)(`th`,{children:a()}),(0,Y.jsx)(`th`,{children:s()}),(0,Y.jsx)(`th`,{children:k()}),(0,Y.jsx)(`th`,{children:l()}),(0,Y.jsx)(`th`,{children:A()}),(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)(W,{variant:`secondary`,children:e.roleKey})}),(0,Y.jsx)(`td`,{children:I(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?null:(0,Y.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?E():Ce()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,J.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,Y.jsx)(L,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,Y.jsxs)(R,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,Y.jsxs)(B,{children:[(0,Y.jsx)(z,{children:m()}),(0,Y.jsx)(it,{children:h({name:e.accountName})})]}),(0,Y.jsx)(`div`,{className:`oc-sa__minted-warning`,children:y()}),(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)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":x(),children:[n?(0,Y.jsx)(j,{}):(0,Y.jsx)(N,{}),n?p():f()]})]}),(0,Y.jsx)(H,{children:(0,Y.jsx)(M,{onClick:()=>{r(!1),t()},children:T()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?b():I(e)}function pt(e){return e===null?`—`:U(e)}function mt(e){return e.disabled?(0,Y.jsx)(W,{variant:`destructive`,children:Te()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,Y.jsx)(W,{variant:`outline`,children:g()}):(0,Y.jsx)(W,{variant:`outline`,children:S()})}export{$ as ServiceAccountsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,As as i,Cs as a,Ds as o,Es as s,Jo as c,Ms as l,Os as u,Qo as d,Ss as f,Ts as p,Xo as m,Yo as h,Zo as g,_s as _,as as v,bs as y,cL as b,cs as x,ds as S,es as C,fs as w,gs as T,hs as E,is as D,js as O,ks as k,lL as A,ls as j,ms as M,ns as N,os as P,ps as F,rs as I,ss as L,t as R,ts as ee,us as z,vs as B,ws as V,xs as H,ys as U}from"./api-CtSSWr7U.js";import{t as W}from"./button-wKI2Tt4J.js";import{Z as G,ct as K}from"./index-gsM_dJLK.js";import{t as q}from"./DataTableShell-D21VGOsx.js";var J=t(e(),1),Y=n(),X={hung:()=>E(),wrong_result:()=>M(),error:()=>F(),other:()=>w()},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=b(R.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(!1);async function u(){let t=o.trim();if(!(!t||c)){l(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{l(!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),` · `,S({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:z()}),(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:j()}),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`?x():L()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:P()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:v(),value:o,maxLength:2e3,rows:3,onChange:e=>s(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 u(),disabled:!o.trim()||c,children:c?I():D()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[N({count:t.children.length}),t.childrenTruncated?` ${ee()}`:``,t.textTruncated?` ${C()}`:``]}),(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?` · ${r()}`:``]}),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:d()}),(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:g()}),(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=A(R.subAgentReports.listForAdmin,{}),t=b(R.subAgentReports.readReport),n=b(R.subAgentReports.deleteReport),r=G(),[d,g]=(0,J.useState)(null),[v,x]=(0,J.useState)({});async function S(e){if(d===e._id){g(null);return}if(!v[e._id]){let n=await t({reportId:e._id});x(t=>({...t,[e._id]:n}))}g(e._id)}async function C(e){await r({title:m(),description:h(),confirmLabel:c(),destructive:!0})&&(await n({reportId:e._id}),d===e._id&&g(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[i(),` `,(0,Y.jsx)(`strong`,{children:k()}),` `,u()]}),(0,Y.jsx)(q,{title:l(),rows:e,emptyHint:O(),isExpanded:e=>d===e._id&&!!v[e._id],renderExpanded:e=>v[e._id]?(0,Y.jsx)($,{data:v[e._id]}):null,columns:[{header:o(),cell:e=>K(e.at),sort:e=>e.at},{header:s(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:p(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:V(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${H({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:a(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:f(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:y()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:U()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:d===e._id?_():B(),onSelect:()=>void S(e)},{label:T(),onSelect:()=>void C(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,AM as i,AN as a,BM as o,CM as s,CN as c,D as l,DM as u,DN as d,EM as f,EN as p,FM as m,GM as h,Go as g,HM as ee,IM as _,JM as v,KM as te,Ko as y,LM as ne,MM as re,MN as ie,NM as ae,OM as oe,ON as se,PM as ce,QI as le,QM as ue,RM as de,SM as fe,SN as b,TM as pe,TN as me,UM as he,VM as ge,WM as _e,Wo as ve,XI as ye,XM as be,YM as x,ZI as xe,ZM as Se,_M as Ce,_N as we,aN as Te,bM as Ee,bN as De,cL as S,cN as Oe,dM as ke,dN as Ae,eN as je,fM as Me,fN as Ne,gM as Pe,gN as Fe,hM as Ie,hN as Le,iN as Re,jM as ze,jN as Be,kM as Ve,kN as He,lL as C,lN as Ue,mM as w,mN as We,nN as Ge,oL as Ke,oN as qe,pM as Je,pN as Ye,qM as Xe,qo as T,r as Ze,rN as Qe,sN as $e,t as E,tN as et,uM as tt,uN as nt,vM as D,vN as rt,wM as it,wN as at,xM as ot,xN as st,yM as ct,yN as lt,zM as ut}from"./api-CtSSWr7U.js";import{t as O}from"./check-C6IJbaM9.js";import{t as k}from"./x-Ce5BXizZ.js";import{t as A}from"./button-wKI2Tt4J.js";import{Ct as dt,Dn as ft,En as j,Ft as pt,It as M,Lt as mt,Mt as ht,Nt as gt,P as N,Pt as P,St as _t,_t as F,bt as I,jt as L,ut as R,vt as z,wt as B,xt as V,yt as H}from"./index-gsM_dJLK.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-CJ2aHkj_.js";import{a as Tt,i as U,n as Et,o as W,r as G,t as Dt}from"./table-CzZqanD8.js";import{t as Ot}from"./TimeRangePicker-hED8r05n.js";import{t as kt}from"./FilterBar-B2rdcXo-.js";import{t as At}from"./AdvancedFilter-CHaC3XqK.js";var K=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),q=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 J(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(ae());if(e.size>Rt)throw Error(re());let{source:n,width:r,height:a,cleanup:o}=await Ut(e);try{let o=e.type===`image/svg+xml`,s=Math.min(zt/r,Bt/a,o?1/0:1),c=Math.max(1,Math.round(r*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(i());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(i());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);J(e.data,f.width,f.height)?It(e.data,t.variantFor===`dark`?Mt:Nt):Lt(e.data),m.putImageData(e,0,0)}let h=J(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Wt(p,`image/webp`,Vt)??await Wt(p,`image/png`);if(!g)throw Error(Ve());return{blob:g,hasAlpha:h}}finally{o()}}async function Ut(e){if(e.type===`image/svg+xml`)return Y(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 Y(e)}async function Y(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(ze())),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 Wt(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(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__`,Kt={kind:`relative`,from:`now-24h`,to:`now`},qt=[{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 Jt(e){return e===`light`?le():e===`dark`?xe():ye()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({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:Ze(`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)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Xt,{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)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":T(),title:T(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=C(E.charts.listMyCharts),r=S(E.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:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:b(),subtitle:st(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?De():n.via===`owner`?lt():rt({group:n.via.group});return(0,X.jsx)(Zt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:we()}):null]})}function $t(){let e=S(E.charts.importChart),[t,n]=(0,q.useState)(``),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(null),[c,l]=(0,q.useState)(!1),[u,d]=(0,q.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{a(await t.text())}catch{s(x())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(Xe());return}let r;try{r=JSON.parse(i)}catch{s(x());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!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:Qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ge()})]}),(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:et()}),(0,X.jsx)(L,{value:t,onChange:e=>n(e.target.value),placeholder:je(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:r()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:ue(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),Se(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:u,onClick:()=>void p(),children:be()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:v()}):null]})]})}function en({chart:e}){let t=Ke(E.charts.setChartLogo),n=S(E.charts.removeChartLogo),[r,i]=(0,q.useState)(!1),[a,s]=(0,q.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(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){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=c(e),n=c(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`?o():ut()}),(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)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(K,{className:`size-4`}),t?ne():de(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:m()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:_()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ge()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=C(E.me.getMe,{host:B}),n=S(E.charts.addChartDomain),r=S(E.charts.removeChartDomain),[i,a]=(0,q.useState)(``),[o,c]=(0,q.useState)(null),[l,d]=(0,q.useState)(!1);if(t?.role!==`admin`)return null;let p=e.domains??[];async function m(){let t=i.trim();if(t!==``){c(null),d(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{d(!1)}}}async function h(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:oe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:p.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:it()}):p.map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":s({domain:e}),onClick:()=>void h(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(L,{value:i,onChange:e=>a(e.target.value),placeholder:f(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&m()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void m(),children:pe()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:u()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=S(E.charts.updateChart),n=S(E.charts.deleteChart),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(e.name),[s,c]=(0,q.useState)(()=>$(e.tokens)),[l,u]=(0,q.useState)(e.tokens.bpm??0),[d,f]=(0,q.useState)(null),[p,m]=(0,q.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(x());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 v(){if(e.chartId!==void 0&&window.confirm(D()))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)(A,{variant:`outline`,size:`sm`,onClick:h,children:he()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ee()})]})})]}),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:Ee()}),(0,X.jsx)(L,{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:y()}),(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":y()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?g():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ve()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ct()}),(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)(A,{size:`sm`,disabled:p,onClick:()=>void _(),children:fe()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:ot()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function rn(){let e=C(E.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:te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:h()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=S(E.charts.addChartToGroupPool),r=S(E.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(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)(R,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ue():e.kind===`custom`&&e.scope===`personal`?w():nt()}),e.isGlobalDefault?(0,X.jsx)(R,{variant:`default`,children:Oe()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:qe()}),(a??[]).map(e=>(0,X.jsxs)(R,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Re({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(F,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(I,{size:`sm`,className:`w-56`,children:(0,X.jsx)(V,{placeholder:Te()})}),(0,X.jsx)(z,{children:s.map(e=>(0,X.jsx)(H,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()}):null]})]})}function on({chart:e}){let t=S(E.charts.promoteChartToCommon),n=S(E.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(D()))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)(R,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Je():w()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ie({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Me()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ke()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=S(E.admin.setDefaultThemeMode),i=S(E.admin.setDefaultLocale),o=S(E.charts.setDefaultChart),s=C(E.charts.listChartsAdmin),c=C(E.groups.listGroups,{}),l=e??`system`,u=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:p()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(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:Fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:b()}),dt.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({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:We()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ye()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:c??[]},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:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).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)(tn,{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:Ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:tt()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{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:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(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:a()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:vt().map(e=>(0,X.jsx)(A,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]})]})}function cn(){let e=C(E.me.getMe,{host:B}),t=_t(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)($t,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,q.useState)(!0),[n,r]=(0,q.useState)(`per-user`),[i,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(Z),[c,l]=(0,q.useState)(Z),[u,f]=(0,q.useState)(Kt),p=i!==``||o!==Z||c!==Z;function m(){a(``),s(Z),l(Z),f(Kt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:d()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(j,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{children:`Default`}),(0,X.jsx)(R,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(R,{variant:`outline`,children:`Outline`}),(0,X.jsx)(R,{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)(L,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(F,{value:n,onValueChange:r,children:[(0,X.jsx)(I,{className:`w-56`,children:(0,X.jsx)(V,{placeholder:`Select…`})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(H,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(H,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(N,{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:f,onReset:m,canReset:p,children:[(0,X.jsxs)(F,{value:o,onValueChange:s,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes directions`}),(0,X.jsx)(H,{value:`inbound`,children:`inbound`}),(0,X.jsx)(H,{value:`outbound`,children:`outbound`}),(0,X.jsx)(H,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(F,{value:c,onValueChange:l,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(H,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(H,{value:`info`,children:`info`}),(0,X.jsx)(H,{value:`warn`,children:`warn`}),(0,X.jsx)(H,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(At,{fields:qt,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:f})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(ht,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(j,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{children:`Edit`}),(0,X.jsx)(P,{children:`Duplicate`}),(0,X.jsx)(M,{}),(0,X.jsx)(P,{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)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{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)(N,{"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)(N,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(G,{className:`font-medium`,children:e.n}),(0,X.jsx)(G,{children:(0,X.jsx)(R,{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)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(G,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(j,{})})})]},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{ln as ThemeShowroom};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{C_ as r,Fi as i,Ii as a,Li as o,Mi as s,Ni as c,Pi as l,S_ as u,__ as d,b_ as f,d_ as p,f_ as m,g_ as h,h_ as g,ji as _,m_ as v,p_ as y,v_ as b,x_ as x,y_ as S}from"./api-CtSSWr7U.js";import{t as C}from"./button-wKI2Tt4J.js";import{Ht as w,Ut as T,Vt as E,Wt as D,ct as O,jt as k,kn as A,sn as j}from"./index-gsM_dJLK.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:r(),from:`now-5m`},{label:u(),from:`now-15m`},{label:x(),from:`now-30m`},{label:f(),from:`now-1h`},{label:S(),from:`now-3h`},{label:b(),from:`now-6h`},{label:d(),from:`now-12h`},{label:h(),from:`now-24h`},{label:g(),from:`now-2d`},{label:v(),from:`now-7d`},{label:y(),from:`now-30d`},{label:m(),from:`now-90d`},{label:p(),from:`now-520w`}];function L(e){return O(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[u,d]=(0,M.useState)(``),f=F(e),[p,m]=(0,M.useState)(()=>z(f.from)),[h,g]=(0,M.useState)(()=>z(f.to));function v(t){if(t){let t=F(e);m(z(t.from)),g(z(t.to)),d(``)}r(t)}function y(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function b(){let e=B(p),n=B(h);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let x=(0,M.useMemo)(()=>{let e=u.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[u]),S=B(p)!==null&&B(h)!==null;return(0,H.jsxs)(T,{open:n,onOpenChange:v,children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(A,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(E,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:o()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:a()}),(0,H.jsx)(k,{type:`datetime-local`,value:p,onChange:e=>m(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,H.jsx)(k,{type:`datetime-local`,value:h,onChange:e=>g(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!S,onClick:b,children:l()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(k,{value:u,onChange:e=>d(e.target.value),placeholder:c(),"aria-label":s()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:x.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:_()}):x.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>y(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{MP as r,NP as i,PP as a,jP as o}from"./api-CtSSWr7U.js";import{t as s}from"./check-C6IJbaM9.js";import{t as c}from"./chevrons-up-down-DThxT9O7.js";import{Bt as l,Rt as u,jt as d,zt as f}from"./index-gsM_dJLK.js";/* empty css */var p=t(e(),1);function m(e){if(e==null||e===``)return`none`;let t=e.trim().toLowerCase();return t===`ok`||t===`success`||t===`completed`?`ok`:t===`error`||t===`failed`||t===`failure`?`error`:t===`running`||t===`in_progress`||t===`pending`?`running`:`other`}function h(e){return e===!0?`active`:e===!1?`paused`:`unknown`}var g={q:``,state:`all`,result:`all`};function _(e){return e.q.trim()!==``||e.state!==`all`||e.result!==`all`}function v(e,t){let n=t.q.trim().toLowerCase();return!(n!==``&&!`${e.name??``} ${e.agentId}`.toLowerCase().includes(n)||t.state!==`all`&&h(e.enabled)!==t.state||t.result!==`all`&&m(e.lastRunStatus)!==t.result)}function y(){try{let e=Intl.supportedValuesOf;return typeof e==`function`?e(`timeZone`):[]}catch{return[]}}function b(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}function x(e,t,n=50,r){let i=e=>e.toLowerCase().replace(/[_/]+/g,` `),a=i(t.trim()),o=(a===``?e:e.filter(e=>i(e).includes(a))).slice(0,n);return r&&r!==``&&!o.includes(r)?[r,...o].slice(0,n):o}function S(e,t){let n=(new Date(e,t,1).getDay()+6)%7,r=new Date(e,t,1-n),i=[];for(let e=0;e<42;e++){let n=new Date(r.getFullYear(),r.getMonth(),r.getDate()+e);i.push({year:n.getFullYear(),month:n.getMonth(),day:n.getDate(),inMonth:n.getMonth()===t})}return i}function C(e,t,n,r,i){let a=(e,t=2)=>String(e).padStart(t,`0`);return`${a(e,4)}-${a(t+1)}-${a(n)}T${a(r)}:${a(i)}`}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);if(t===null)return null;let[,n,r,i,a,o]=t;return{year:Number(n),month:Number(r)-1,day:Number(i),hour:Number(a),minute:Number(o)}}var T=n();function E({value:e,onChange:t,className:n,fallbackTz:m}){let h=(0,p.useMemo)(()=>y(),[]),[g,_]=(0,p.useState)(!1),[v,S]=(0,p.useState)(``);if(h.length===0)return(0,T.jsx)(d,{value:e,onChange:e=>t(e.target.value),placeholder:m||b()||`America/Toronto`,className:n});let C=x(h,v,h.length,e||void 0),w=e===``?m||b()||o():e;return(0,T.jsxs)(u,{modal:!0,open:g,onOpenChange:e=>{_(e),e||S(``)},children:[(0,T.jsx)(l,{asChild:!0,children:(0,T.jsxs)(`button`,{type:`button`,className:`oc-tzcombo__trigger${n?` ${n}`:``}`,"aria-label":a(),children:[(0,T.jsx)(`span`,{className:`oc-tzcombo__value`,children:w}),(0,T.jsx)(c,{size:14,"aria-hidden":!0,className:`oc-tzcombo__chev`})]})}),(0,T.jsxs)(f,{align:`start`,className:`oc-tzcombo__pop p-0`,children:[(0,T.jsx)(d,{autoFocus:!0,value:v,onChange:e=>S(e.target.value),placeholder:i(),className:`oc-tzcombo__search`}),(0,T.jsx)(`div`,{className:`oc-tzcombo__list`,role:`listbox`,children:C.length===0?(0,T.jsx)(`p`,{className:`oc-tzcombo__empty`,children:r()}):C.map(n=>(0,T.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===e,className:`oc-tzcombo__opt`,onClick:()=>{t(n),_(!1),S(``)},children:[(0,T.jsx)(s,{size:13,"aria-hidden":!0,className:`oc-tzcombo__check`,style:{opacity:+(n===e)}}),(0,T.jsx)(`span`,{children:n})]},n))})]})]})}export{m as a,w as c,v as i,C as l,g as n,h as o,_ as r,S as s,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,$y as i,AD as a,BD as o,CD as s,Cb as c,D as l,DD as u,Db as d,ED as f,Eb as p,FD as m,Gy as h,HD as g,ID as _,Jy as ee,Ky as v,LD as y,MD as b,Mr as x,ND as S,Nr as C,OD as w,Ob as te,PD as T,Pr as E,Qy as ne,RD as D,SD as re,Sb as ie,TD as ae,Tb as oe,VD as O,Wy as se,Xy as ce,Yy as le,Zy as ue,_b as de,aD as fe,ab as pe,bD as me,bb as he,cD as k,cL as A,cb as ge,dD as j,db as _e,eD as M,eb as ve,fD as ye,fb as be,gb as xe,hb as Se,iD as N,ib as Ce,jD as we,kD as P,lD as Te,lL as F,lb as Ee,mb as De,nD as Oe,nb as ke,oD as Ae,ob as je,pD as Me,pb as Ne,qy as Pe,rD as Fe,rb as Ie,sD as Le,sb as Re,t as I,tD as ze,tb as Be,uD as Ve,ub as He,vD as Ue,vb as We,wD as Ge,wb as Ke,xD as qe,xb as Je,yD as L,yb as Ye,zD as Xe}from"./api-CtSSWr7U.js";import{t as Ze}from"./check-C6IJbaM9.js";import{t as Qe}from"./x-Ce5BXizZ.js";import{i as R,n as z,r as $e,t as et}from"./tabs-BqUPTpU0.js";import{t as B}from"./button-wKI2Tt4J.js";import{Fn as tt,J as nt,On as rt,Pn as it,Tn as at,_t as V,a as ot,bt as H,ct as U,dt as st,ft as ct,gt as lt,ht as ut,i as dt,lt as ft,o as pt,pt as mt,s as ht,ut as W,vt as G,wt as gt,xn as _t,xt as K,yt as q}from"./index-gsM_dJLK.js";import{n as vt}from"./TimeRangePicker-hED8r05n.js";import{t as yt}from"./FilterBar-B2rdcXo-.js";import{t as bt}from"./AdvancedFilter-CHaC3XqK.js";import{t as xt}from"./DataTableShell-D21VGOsx.js";var St=l(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=l(`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`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=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`?s():n===`agent`?`${re()} - ${r}`:e}function Tt(){let e=F(I.me.getMe,{host:gt})?.role===`admin`,t=F(I.deliveryTiming.getDeliveryStatus,{}),n=A(I.deliveryTiming.startDeliveryRecord),r=A(I.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=t?.recording??!1,u=async()=>{c(!0);try{l?await r({}):await n({})}finally{c(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:g()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:O()})]}),e?(0,Y.jsx)(B,{variant:l?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void u(),children:l?Xe():o()}):null]}),l?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:D()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:y({time:ft(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?T():m()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=F(I.deliveryTiming.listDeliverySessions,{}),n=A(I.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[d,p]=(0,J.useState)(null),{from:m,to:h}=vt(c),g=c.to===`now`?1/0:h,_=r.trim()!==``||o!==`all`||c!==X,ee=()=>{i(``),s(`all`),l(X)},v=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,r,o,m,g]),y=e=>{let t=new Set((v??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&p(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:i,searchPlaceholder:b(),timeRange:c,onTimeRangeChange:l,onReset:ee,canReset:_,children:(0,Y.jsxs)(V,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:`all`,children:we()}),(0,Y.jsx)(q,{value:`active`,children:a()}),(0,Y.jsx)(q,{value:`stopped`,children:P()})]})]})}),(0,Y.jsx)(xt,{title:S(),rows:v,emptyHint:M(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?me():qe(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(at,{size:15,"aria-hidden":!0})})},{header:w(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:U(e.startedAt)})},{header:u(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:U(e.stoppedAt)})},{header:f(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:ae(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:Ge(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:a()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:P()})}],rowActions:e?e=>[{label:L(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:L(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=F(I.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ue()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:_()});let i=e.segments,a=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,r()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(rt,{size:13,"aria-hidden":!0}),t?ze():Oe()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:j()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ve()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Te()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(k(),i.bridge),a(Le(),i.A),a(Ae(),i.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:N()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:E()},{value:`principalType`,label:C()},{value:`direction`,label:`direction`},{value:`roleKey`,label:x()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=tt({from:`/settings/traces`}),t=it({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,o=e.principalType??Q,s=e.direction??Q,l=e.roleKey??Q,u=e.q??``,f=dt(e.from,e.to),m=(0,J.useMemo)(()=>ht(e.adv),[e.adv]),{from:h,to:g}=vt(f),[_,v]=(0,J.useState)(null),[y,b]=(0,J.useState)(null),x=e=>void t({search:t=>({...t,limit:e})}),S=e=>void t({search:t=>({...t,kind:e})}),C=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),w=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),re=e=>void t({search:t=>({...t,...pt(e)})}),ae=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),O=F(I.observability.listEvents,{limit:n}),se=F(I.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:u||void 0,from:h,to:g,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:s===Q?void 0:s,roleKey:l===Q?void 0:l,advanced:m.length>0?m:void 0}}),fe=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])e.add(t.kind);return[...e].sort()},[O]),me=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[O]),k=u!==``||a!==Q||o!==Q||s!==Q||l!==Q||m.length>0||f.kind!==`relative`||f.from!==Pt.from;function A(){t({search:{limit:100,kind:`all`},replace:!0})}let j=_?O?.filter(e=>e.correlationId===_):se,M=e.section,N=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:M,onValueChange:e=>N(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(_t,{size:13,"aria-hidden":!0}),Me()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),ye()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[te(),(0,Y.jsx)(`strong`,{children:d()}),p(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:oe()})]}),(0,Y.jsxs)(yt,{q:u,onQChange:C,searchPlaceholder:Ke(),timeRange:f,onTimeRangeChange:re,onReset:A,canReset:k,children:[(0,Y.jsxs)(V,{value:a,onValueChange:w,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:c()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:ie()}),jt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:o,onValueChange:T,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Je()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:he()}),Mt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:s,onValueChange:E,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(K,{placeholder:Ye()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:We()}),Nt.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:l,onValueChange:D,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(K,{placeholder:de()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:Q,children:xe()}),me.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:r,onValueChange:S,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(K,{placeholder:Se()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(q,{value:At,children:De()}),fe.map(e=>(0,Y.jsx)(q,{value:e,children:e},e))]})]}),(0,Y.jsxs)(V,{value:String(n),onValueChange:e=>x(Number(e)),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(K,{})}),(0,Y.jsx)(G,{children:kt.map(e=>(0,Y.jsx)(q,{value:String(e),children:Ne({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:m,onChange:ae}),_?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>v(null),title:be(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[_e(),(0,Y.jsx)(`code`,{children:$(_)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:He()})]})}):null,(0,Y.jsx)(xt,{title:Ee(),rows:j,emptyHint:_?ge():Re(),columns:[{header:je(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:U(e.at)})},{header:pe(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:Ce(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":Ie(),children:`✓`})}},{header:ke(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(W,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Be(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:ve(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:i(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ne(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:ue(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:ce(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:le(),onClick:()=>v(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ee(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>b(e),children:Pe()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:y,onClose:()=>b(null)})]})]})}function Lt(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 Rt(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 zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(st,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(ct,{className:`max-w-lg`,children:[(0,Y.jsxs)(ut,{children:[(0,Y.jsxs)(lt,{className:`oc-traces__meta-title`,children:[v(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:h()})]}),(0,Y.jsx)(mt,{children:se()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,Cw as i,Gw as a,Hw as o,Jd as s,Jw as c,Kw as l,Qw as u,Uw as d,Ww as ee,Xd as f,Xw as te,Yd as p,Yw as ne,Zw as re,aT as ie,ay as m,cL as h,cT as ae,cy as g,dT as oe,dy as _,eT as se,fT as ce,fy as v,gT as y,gy as b,hT as x,hy as S,iT as le,iy as C,lL as w,lT as ue,ly as T,mT as E,my as D,nT as de,oT as fe,oy as O,pT as pe,py as k,qw as me,rT as he,sT as ge,sy as A,t as j,tT as _e,uT as ve,uy as M}from"./api-CtSSWr7U.js";import{t as N}from"./button-wKI2Tt4J.js";import{Dt as P,Fn as F,Ft as I,Lt as L,Mt as ye,Nt as be,P as R,Pn as xe,Pt as Se,Q as Ce,Z as we,_t as z,an as B,bt as V,c as H,dt as Te,ft as Ee,gt as De,ht as Oe,l as U,on as W,pt as ke,u as G,ut as K,vt as q,wt as Ae,xt as J,yt as Y}from"./index-gsM_dJLK.js";import{t as je}from"./FilterBar-B2rdcXo-.js";import{t as Me}from"./DataTableShell-D21VGOsx.js";import{t as Ne}from"./DetailChips-BvOufdR5.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=w(j.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=w(j.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.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}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,Z.jsx)(Te,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Ee,{className:`oc-access`,children:[(0,Z.jsxs)(Oe,{children:[(0,Z.jsx)(De,{children:b({user:t})}),(0,Z.jsx)(ke,{children:S()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?D():k()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:v()}):u.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:T()}):[...d.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=h(j.agents.assignAgent),s=h(j.agents.removeAgent),c=h(j.agents.setDefaultAgent),l=P();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(_(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(M(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(W,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(R,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":g({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,s?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:A()}):null,e.outOfPool?(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:O()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":m(),title:m(),children:(0,Z.jsx)(B,{size:14,fill:`currentColor`})}):(0,Z.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":C(),title:C(),disabled:c,onClick:()=>void d(e.agentId),children:(0,Z.jsx)(B,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return s();case`user`:return p();case`admin`:return f();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=H.filter(e=>n.has(G[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(L,{asChild:!0,children:(0,Z.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?y():x({count:r})})}),(0,Z.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(I,{children:E()}),H.map(e=>{let r=G[e];return(0,Z.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(R,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:U[e]()})]},e)})]})]})}function Le(){let e=F({from:`/settings/users`}),t=xe({from:`/settings/users`}),n=e.q??``,s=e.role??Q,f=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),p=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),m=w(j.admin.listUsers,{filter:{q:n||void 0,role:s===Q?void 0:s},withAgents:!0}),g=w(j.me.getMe,{host:Ae}),_=h(j.admin.setRole),v=h(j.admin.setUserPermissions),y=h(j.admin.startImpersonation),b=h(j.admin.deleteUser),x=h(j.admin.setUserName),S=we(),C=Ce(),T=P(),[E,D]=(0,X.useState)(null),O=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of m??[])e.add(t.role);return[...e]},[m]),k=n!==``||s!==Q;function A(){t({search:{},replace:!0})}async function M(e){try{await _(e)}catch(e){T.error(pe(),e)}}async function N(e){try{await v(e)}catch(e){T.error(ce(),e)}}async function I(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await S({title:ie(),description:le({user:t}),confirmWord:he(),confirmLabel:de(),destructive:!0}))try{await b({profileId:e._id}),T.success(se({user:t}))}catch(e){T.error(_e(),e)}}async function L(e){let t=e.email||e.name||e.userId.slice(0,8),n=await C({title:u(),label:re({user:t}),placeholder:te(),defaultValue:e.name??``,confirmLabel:i()});if(n!==null)try{await x({profileId:e._id,name:n}),T.success(ne())}catch(e){T.error(c(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:f,searchPlaceholder:oe(),onReset:A,canReset:k,children:(0,Z.jsxs)(z,{value:s,onValueChange:p,children:[(0,Z.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(J,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(Y,{value:Q,children:ve()}),O.map(e=>(0,Z.jsx)(Y,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:ue(),rows:m,emptyHint:ae(),rowActions:e=>{let t=[{label:o(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:r(),onSelect:()=>void L(e)}];return e.userId!==g?.userId&&t.push({label:ge(),onSelect:()=>void y({profileId:e._id})},{label:fe(),variant:`destructive`,onSelect:()=>void I(e)}),t},columns:[{header:me(),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:l(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(z,{value:e.role,onValueChange:t=>void M({profileId:e._id,role:t}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(J,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(Y,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(Y,{value:`user`,children:$(`user`)}),(0,Z.jsx)(Y,{value:`admin`,children:$(`admin`)})]})]})},{header:a(),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:ee()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),N({profileId:e._id,permissions:[...n]})}})},{header:d(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(W,{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:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||D(null)}})]})}export{Le as UsersTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,An as i,At as a,Bl as o,Bn as s,Ct as ee,Dt as c,Fn as l,Ft as u,Gn as d,Hl as te,Hn as f,In as p,It as m,Jn as h,Kn as g,Ln as _,Lt as v,Mn as y,Nn as b,Nt as x,Ot as ne,Pn as S,Pt as re,Qn as ie,Rn as ae,St as oe,Tt as C,Un as w,Vn as se,Wn as ce,Wt as le,Xn as ue,Yn as T,Zn as E,bE as D,cL as O,cd as k,eL as A,jn as de,kn as fe,kt as pe,lL as j,nL as M,oL as N,qn as P,t as F,ut as I,wt as L,zn as R}from"./api-CtSSWr7U.js";import{i as z,n as B,r as me,t as he}from"./tabs-BqUPTpU0.js";import{t as V}from"./button-wKI2Tt4J.js";import{$t as H,Fn as ge,Jt as _e,Nn as ve,P as U,Pn as ye,Qt as W,Xt as be,Yt as xe,Zt as Se,_t as G,bt as K,en as Ce,gn as we,nn as Te,ut as q,vt as J,wt as Ee,xt as Y,yt as X}from"./index-gsM_dJLK.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>g()],[`fr-FR`,()=>v()],[`en-US`,()=>m()],[`en-GB`,()=>u()],[`de-DE`,()=>re()],[`es-ES`,()=>x()]],Oe=[[`0.75`,()=>ce()],[`1`,()=>w()],[`1.25`,()=>f()],[`1.5`,()=>se()]],$=0;function ke({instance:e}){let t=O(F.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,a]=(0,Z.useState)(r),[c,l]=(0,Z.useState)(`idle`),[u,f]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(!1),v=N(F.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{a({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 y=i.enabled!==r.enabled||i.engine!==r.engine||i.lang!==r.lang||i.rate!==r.rate||i.autoRead!==r.autoRead;async function b(){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)(q,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:i.enabled,onCheckedChange:e=>a({...i,enabled:e===!0}),"aria-label":h()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:h()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:C()}),(0,Q.jsxs)(G,{value:i.engine,onValueChange:e=>a({...i,engine:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":C(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(X,{value:`browser`,children:L()}),e.kind===`hermes`?null:(0,Q.jsx)(X,{value:`gateway`,children:ee()})]})]})]}),i.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:oe()}):null,i.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:P()}),(0,Q.jsxs)(G,{value:i.lang,onValueChange:e=>a({...i,lang:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":P(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:De.map(([e,t])=>(0,Q.jsx)(X,{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)(G,{value:i.rate,onValueChange:e=>a({...i,rate:e}),disabled:!i.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":d(),children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:Oe.map(([e,t])=>(0,Q.jsx)(X,{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)(U,{checked:i.autoRead,onCheckedChange:e=>a({...i,autoRead:e===!0}),disabled:!i.enabled,"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:R()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!y||c===`saving`,onClick:()=>void b(),children:c===`saving`?k():te()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!i.enabled||u,onClick:()=>{let t=Number.parseFloat(i.rate)||1,n=++$;if(g(!1),H(),W(),i.engine!==`gateway`){Se(p(),{lang:be(i.lang,M()),rate:t});return}f(!0),v({instanceName:e.name,text:p()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&g(!0)}).finally(()=>f(!1))},children:u?k():ae()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),H(),W()},children:_()})]}),c===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?I():o()}):null]})}function Ae({stt:e}){let t=j(F.me.getMe,{host:Ee}),n=O(F.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,o=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:S()}),(0,Q.jsx)(q,{variant:e?`secondary`:`outline`,children:e?i():fe()}),(0,Q.jsx)(q,{variant:r?`secondary`:`destructive`,children:r?pe():ne()})]}),o?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":a()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:b()})]})}function je(){let e=j(F.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ce(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:i}=ge({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:r()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(q,{variant:t?`secondary`:`destructive`,children:t?ie():E()}),(0,Q.jsx)(q,{variant:n?`secondary`:`destructive`,children:n?ue():T()})]}),(0,Q.jsxs)(he,{value:i,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(me,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),c()]}),(0,Q.jsxs)(z,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(we,{size:13,"aria-hidden":!0}),S()]}),(0,Q.jsxs)(z,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),y()]})]}),(0,Q.jsx)(B,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(B,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(B,{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:de()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=O(F.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)(q,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(U,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]})]})}export{je as VoiceTab};
|