@lacneu/atrium 0.26.0 → 0.26.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-Cr5N8yhW.js → AccessTab-C_Lvzi-s.js} +1 -1
- package/dist/assets/{AdvancedFilter-B0eHnjhM.js → AdvancedFilter-DnGyDWXx.js} +1 -1
- package/dist/assets/{AgentFilesTab-DYOMoQSt.js → AgentFilesTab-mB_H9qhv.js} +1 -1
- package/dist/assets/{AnomaliesTab-nz3nwVcD.js → AnomaliesTab-DXWIdPjg.js} +1 -1
- package/dist/assets/{AuditTab-CB_hCgt6.js → AuditTab-CM3yKrcE.js} +1 -1
- package/dist/assets/{BridgeTab-DM0F3JBU.js → BridgeTab-Bba1_oYY.js} +1 -1
- package/dist/assets/{ChatDefaultsTab-BtuWRKtn.js → ChatDefaultsTab-BJWGY5p4.js} +1 -1
- package/dist/assets/{DataTableShell-_imgfnfL.js → DataTableShell-y4F1v6a9.js} +1 -1
- package/dist/assets/{DetailChips-WfEcflRX.js → DetailChips-BFrPLaU7.js} +1 -1
- package/dist/assets/{FeedbacksTab-C4iIYq5Y.js → FeedbacksTab-Dypzq2xC.js} +1 -1
- package/dist/assets/{FieldLabel-BotruMTL.js → FieldLabel-GI9NETEt.js} +1 -1
- package/dist/assets/{FilesTab-BFVLvM1M.js → FilesTab-Bo0mLlHv.js} +1 -1
- package/dist/assets/{FilterBar-BToerIZw.js → FilterBar-B_mSpGb-.js} +1 -1
- package/dist/assets/{GroupsTab-5kzQ6PtY.js → GroupsTab-BsdKKpSh.js} +1 -1
- package/dist/assets/{InstancesTab-BZpH16Od.js → InstancesTab-AFQsddYr.js} +1 -1
- package/dist/assets/{IntegrationsTab-CSl1HRb5.js → IntegrationsTab-_AZobXTN.js} +1 -1
- package/dist/assets/{KpiTab-DdSoOlaJ.js → KpiTab-DS2vaP8Y.js} +1 -1
- package/dist/assets/{PreferencesTab-s6Un7hWK.js → PreferencesTab-D5id-SH6.js} +1 -1
- package/dist/assets/{PromptInjectionsTab-DCB2c8bq.js → PromptInjectionsTab-DHLbMEQv.js} +1 -1
- package/dist/assets/{RolesTab-DNEUHTSy.js → RolesTab-DfLWu7KJ.js} +1 -1
- package/dist/assets/{ServiceAccountsTab-7Hc91j9Y.js → ServiceAccountsTab-BdNBgyiw.js} +1 -1
- package/dist/assets/{SubAgentReportsTab-DRhw4EHt.js → SubAgentReportsTab-DiGx-0oc.js} +1 -1
- package/dist/assets/{ThemeShowroom-Di-KW-H4.js → ThemeShowroom-BAS4cMDv.js} +1 -1
- package/dist/assets/{TimeRangePicker-Cm-XSScp.js → TimeRangePicker-CFCLAlKB.js} +1 -1
- package/dist/assets/{TracesTab-BR-e3nla.js → TracesTab-w5olufef.js} +1 -1
- package/dist/assets/{UsersTab-Cf7ZWEnT.js → UsersTab-DFcSXBQJ.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-BMbd79DX.js → highlighted-body-OFNGDK62-D8Rm1ZUS.js} +1 -1
- package/dist/assets/{index-Cs-A4Qz2.js → index-BlRMvXrJ.js} +70 -70
- package/dist/assets/mermaid-GHXKKRXX-CS3UuvWM.js +1 -0
- package/dist/assets/{tabs-CVbQ8jlY.js → tabs-DT8VXxMj.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/mermaid-GHXKKRXX-ClP4KTsZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{EO as r,Gb as i,Ib as a,Kb as o,Lb as s,Wb as c,_u as l,au as u,cu as d,du as f,fu as p,gu as m,hu as h,iu as g,lu as _,mu as v,ou as y,pu as b,qb as x,su as S,uu as C,vx as w,yO as T}from"./dist-Cxz8d8g5.js";import{Mt as ee,a as te,jt as ne,n as re,ot as E,r as D}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{EO as r,Gb as i,Ib as a,Kb as o,Lb as s,Wb as c,_u as l,au as u,cu as d,du as f,fu as p,gu as m,hu as h,iu as g,lu as _,mu as v,ou as y,pu as b,qb as x,su as S,uu as C,vx as w,yO as T}from"./dist-Cxz8d8g5.js";import{Mt as ee,a as te,jt as ne,n as re,ot as E,r as D}from"./index-BlRMvXrJ.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-D7I9UeSH.js";import{n as N,t as P}from"./TimeRangePicker-CFCLAlKB.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=r(T.me.getMe,{host:E})?.permissions?.includes(`traces.read`)??!1,t=r(T.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,F.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,L).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:w()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:x()}),(0,I.jsx)(j,{children:i()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(0,I.jsx)(B,{series:n})})]})]})}function B({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),r=Math.max(1,...t,...n),i=t=>6+t*468/(e.length-1),c=e=>74-e*68/r,l=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${c(e).toFixed(1)}`).join(` `),u=e[e.length-1];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{style:{color:`var(--primary)`},children:[a(),` p50 `,R(u.cP50),` `,o()]}),(0,I.jsxs)(`span`,{children:[s(),` p50 `,R(u.aP50),` `,o()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":x(),children:[(0,I.jsx)(`path`,{d:l(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:l(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:l(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:m(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:h(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:v(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:b(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:p(),unit:`/h`,group:`Assistant`,isError:!0}],H=V.length,U=[`API`,`OpenClaw`,`Chat`,`Assistant`],W=1e3,G=36e5;function K(e,t){let n=Math.max(1,Math.ceil((t-e)/G)),r=Math.min(n*H,W);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/H))}}function q(){let e=ee({from:`/settings/kpi`}),t=ne({from:`/settings/kpi`}),n=D(e.from,e.to,re,`now`),i=e=>void t({search:t=>({...t,...te(e)})}),{from:a,to:o}=N(n),{rowLimit:s,buckets:c}=K(a,o),l=r(T.kpi.listKpis,{limit:s,filter:{from:a,to:o}}),u=(0,F.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>c&&e.set(t,n.slice(n.length-c));return e},[l,c]),p=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[f(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:C()})]}),(0,I.jsx)(J,{value:n,onChange:i})]});return l===void 0?(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:_()})]}):l.length===0?(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:d()})]}):(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(u.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(Y,{config:e,series:u.get(e.metric)??[]},e.metric))})]},e):null})]})}function J({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(P,{value:e,onChange:t})})}function Y({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,I.jsxs)(M,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(j,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(k,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(ae,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:S({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:y()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:u({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":g({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{q as KpiTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AD as i,Bw as a,DD as o,ED as s,EO as c,FD as l,Gw as u,Hw as d,ID as f,Jw as p,KD as m,Kw as h,LD as ee,MD as te,ND as g,OD as ne,PD as re,Qw as _,RD as ie,TO as v,Uw as ae,VD as oe,Vw as se,Ww as ce,Xw as le,Yw as ue,Zw as de,_T as fe,aT as y,b_ as b,cT as x,dT as S,eT as C,fT as w,gT as T,hT as E,iT as D,jD as O,kD as k,lT as A,mT as j,nT as M,oT as N,pT as P,qw as F,rT as I,sT as L,tT as R,uT as z,vT as B,yO as V,zw as pe}from"./dist-Cxz8d8g5.js";import{t as H}from"./button-BOkPsnkZ.js";import{A as me,C as he,O as ge,S as _e,Z as U,_ as W,b as ve,ot as G,x as K,y as ye}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AD as i,Bw as a,DD as o,ED as s,EO as c,FD as l,Gw as u,Hw as d,ID as f,Jw as p,KD as m,Kw as h,LD as ee,MD as te,ND as g,OD as ne,PD as re,Qw as _,RD as ie,TO as v,Uw as ae,VD as oe,Vw as se,Ww as ce,Xw as le,Yw as ue,Zw as de,_T as fe,aT as y,b_ as b,cT as x,dT as S,eT as C,fT as w,gT as T,hT as E,iT as D,jD as O,kD as k,lT as A,mT as j,nT as M,oT as N,pT as P,qw as F,rT as I,sT as L,tT as R,uT as z,vT as B,yO as V,zw as pe}from"./dist-Cxz8d8g5.js";import{t as H}from"./button-BOkPsnkZ.js";import{A as me,C as he,O as ge,S as _e,Z as U,_ as W,b as ve,ot as G,x as K,y as ye}from"./index-BlRMvXrJ.js";var q=t(e(),1),J=[{id:`messages`,label:()=>B()},{id:`composer`,label:()=>fe()},{id:`sidebar`,label:()=>T()},{id:`other`,label:()=>E()}],Y={showSource:{category:`messages`,label:()=>j(),help:()=>P()},showReport:{category:`messages`,label:()=>w(),help:()=>S()},copyAssistant:{category:`messages`,label:()=>z()},copyUser:{category:`messages`,label:()=>A()},showDelete:{category:`messages`,label:()=>x()},showTools:{category:`messages`,label:()=>L(),help:()=>N()},voiceInput:{category:`composer`,label:()=>y(),help:()=>D()},showChatAge:{category:`sidebar`,label:()=>I(),help:()=>M()},showChatProvider:{category:`sidebar`,label:()=>R(),help:()=>C()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function be(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],Se={voiceInput:`voiceInput`};function Ce(e){return xe.includes(e)}function Z(e){return e===`admin`}function we(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Q(e){return e===`on`?!0:e===`off`?!1:null}function Te(e){return Ce(e)?Se[e]:void 0}var $=n(),Ee={voiceInput:()=>ae()};function De({prefKey:e,ui:t}){let n=v(V.admin.setUiPrefDefault),r=v(V.admin.setFeatureEnabled),i=Te(e),o=i?Ee[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:F()}),(0,$.jsxs)(ye,{value:we(t.defaults[e]),onValueChange:t=>void n({key:e,value:Q(t)}),children:[(0,$.jsx)(_e,{size:`sm`,className:`w-36`,children:(0,$.jsx)(he,{})}),(0,$.jsxs)(ve,{children:[(0,$.jsx)(K,{value:`on`,children:se()}),(0,$.jsx)(K,{value:`off`,children:a()}),(0,$.jsx)(K,{value:`inherit`,children:pe()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":h()}),h()]}):null]}),o?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:o}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,i]=(0,q.useState)(!1),a=c(V.me.getMe,{host:G}),o=a?.ui,s=Z(a?.role)&&n,l=v(V.me.setUiPref).withOptimisticUpdate(ge),f=(0,q.useMemo)(()=>o?be(Object.keys(o.effective),e):[],[o,e]);return o?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(a?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>i(e===!0),"aria-label":p()}),p()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:u()}),(0,$.jsx)(`p`,{children:ce()}),(0,$.jsx)(`p`,{children:d()})]}):null,(0,$.jsx)(U,{value:e,onChange:e=>t(e.target.value),placeholder:r(),"aria-label":r(),className:`mb-2`}),f.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:_()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:f.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=o.locked[e],a=o.effective[e],c=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${c&&!i?` is-overridden`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(`span`,{className:`oc-prefs__lock`,children:de()}):c?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:le()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&c?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void l({key:e,value:null}),children:ue()}):null,(0,$.jsx)(W,{checked:a,disabled:i,onCheckedChange:t=>void l({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(De,{prefKey:e,ui:o}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:m()})}function ke(){let e=c(V.me.getMe,{host:G}),t=v(V.me.setLocale),n=v(V.me.setMyName),r=me(),a=e?.locale??`default`,u=e?.name??``,[d,p]=(0,q.useState)(null),m=d??u,h=m.trim()!==u.trim();async function _(){try{await n({name:m}),p(null),r.success(re())}catch(e){r.error(g(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:ie()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ee()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(U,{className:`max-w-xs`,value:m,maxLength:120,placeholder:f(),onChange:e=>p(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h&&(e.preventDefault(),_())}}),(0,$.jsx)(H,{size:`sm`,disabled:!h,onClick:()=>void _(),children:b()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:l()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:te()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:O()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:a===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?o():e===`en`?s():oe()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:k()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ne()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,Ad as i,B as a,Bd as o,Dd as s,EO as c,Fd as l,Gd as u,H as d,Hd as f,Id as p,Kd as ee,Ld as m,Md as h,Nd as g,Od as _,Pd as v,Rd as y,TO as b,U as x,Ud as S,V as C,Vd as w,Wd as T,ef as E,jd as D,kd as O,yO as k,z as A,zd as j}from"./dist-Cxz8d8g5.js";import{d as M,f as N,i as P,l as F,n as I,r as L,t as R,u as z}from"./FieldLabel-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,Ad as i,B as a,Bd as o,Dd as s,EO as c,Fd as l,Gd as u,H as d,Hd as f,Id as p,Kd as ee,Ld as m,Md as h,Nd as g,Od as _,Pd as v,Rd as y,TO as b,U as x,Ud as S,V as C,Vd as w,Wd as T,ef as E,jd as D,kd as O,yO as k,z as A,zd as j}from"./dist-Cxz8d8g5.js";import{d as M,f as N,i as P,l as F,n as I,r as L,t as R,u as z}from"./FieldLabel-GI9NETEt.js";import{t as B}from"./button-BOkPsnkZ.js";import{A as V,C as H,S as U,_ as W,b as G,x as K,y as q}from"./index-BlRMvXrJ.js";/* empty css */var J=t(e(),1),Y=n(),X={media_delivery:{label:w,help:o},documentary_fetch:{label:j,help:y},inbound_files:{label:m,help:p},history_summary:{label:x,help:d}},Z={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
2
|
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
3
|
Assistant : Comparaison en cours.`,max_chars:`6000`},Q={outboundDir:O,references:_,files:s,previous_summary:C,new_messages:a,max_chars:A};function $(){let e=c(k.admin.listInstances,{}),[t,n]=(0,J.useState)(null);if(e===void 0)return(0,Y.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,Y.jsx)(`div`,{className:`oc-injtab`,children:(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:v()})});let r=e.find(e=>e._id===t)??e[0];return(0,Y.jsxs)(`div`,{className:`oc-injtab`,children:[(0,Y.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,Y.jsx)(I,{label:ee(),help:u()}),(0,Y.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,Y.jsx)(`span`,{children:l()}),(0,Y.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,Y.jsx)(U,{size:`sm`,className:`min-w-44`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:e.map(e=>(0,Y.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,Y.jsx)(te,{instance:r},r._id)]})}function te({instance:e}){let t=b(k.admin.upsertInstanceConfig),n=V(),i=e.config??{},[a,o]=(0,J.useState)(()=>P(i)),[s,c]=(0,J.useState)(!1),l=a.promptInjections,u=(e,t)=>o({...a,promptInjections:{...l,[e]:{...l[e],...t}}});async function d(){c(!0);try{await t({instanceId:e._id,config:L(a,i)})}catch(e){n.error(r(),e)}finally{c(!1)}}return(0,Y.jsxs)(`div`,{className:`oc-injtab__body`,children:[z.map(e=>(0,Y.jsx)(ne,{injKey:e,def:F[e],i18n:X[e],row:l[e]??{enabled:!0,template:F[e].defaultTemplate},onChange:t=>u(e,t)},e)),(0,Y.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,Y.jsx)(B,{size:`sm`,onClick:()=>void d(),disabled:s,children:E()})})]})}function ne({injKey:e,def:t,i18n:n,row:r,onChange:a}){let[o,s]=(0,J.useState)(!1),c=r.template.trim()!==t.defaultTemplate,l=t.togglable&&!r.enabled,u=Object.fromEntries(t.placeholders.map(e=>[e,Z[e]??`{${e}}`])),d=M(e,r),p=d?N(d,u):``;return(0,Y.jsxs)(`section`,{className:`oc-injcard`,children:[(0,Y.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,Y.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Y.jsx)(W,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,Y.jsx)(I,{label:n.label(),help:n.help()})]}):(0,Y.jsx)(I,{label:n.label(),help:n.help()}),c&&(0,Y.jsx)(`span`,{className:`oc-injection__badge`,children:S()})]}),(0,Y.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:l,rows:8,spellCheck:!1,onChange:e=>a({template:e.target.value})}),(0,Y.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,Y.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,Y.jsx)(`span`,{className:`oc-injection__ph`,children:f()}),t.placeholders.map(e=>(0,Y.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,Y.jsx)(`code`,{children:`{${e}}`}),(0,Y.jsx)(R,{text:(Q[e]??(()=>e))()})]},e))]}),(0,Y.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,Y.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?h():g()}),c&&(0,Y.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate}),children:T()})]})]}),o&&(0,Y.jsx)(`div`,{className:`oc-injcard__preview`,children:p?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:p}),(0,Y.jsx)(`span`,{className:`oc-injection__ph`,children:D()})]}):(0,Y.jsx)(`span`,{className:`oc-injection__ph`,children:i()})})]})}export{$ as PromptInjectionsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Ah as i,Ch as a,Dh as o,EO as s,Eh as c,Fh as l,Ih as u,Lh as d,Mh as f,Nh as p,Oh as m,Ph as h,Qm as g,Rh as _,Sh as v,TO as y,Th as b,Xm as x,Ym as S,Zm as ee,_h as te,bh as ne,dh as re,eh as ie,fh as ae,gh as C,hh as w,jh as T,kh as E,lh as D,mh as O,nh as k,ph as A,rh as j,th as M,uh as N,vh as P,wh as F,xh as I,yO as L,yh as R}from"./dist-Cxz8d8g5.js";import{t as z}from"./button-BOkPsnkZ.js";import{A as B,X as V,Z as H,_ as U,j as W,m as G,xt as K}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Ah as i,Ch as a,Dh as o,EO as s,Eh as c,Fh as l,Ih as u,Lh as d,Mh as f,Nh as p,Oh as m,Ph as h,Qm as g,Rh as _,Sh as v,TO as y,Th as b,Xm as x,Ym as S,Zm as ee,_h as te,bh as ne,dh as re,eh as ie,fh as ae,gh as C,hh as w,jh as T,kh as E,lh as D,mh as O,nh as k,ph as A,rh as j,th as M,uh as N,vh as P,wh as F,xh as I,yO as L,yh as R}from"./dist-Cxz8d8g5.js";import{t as z}from"./button-BOkPsnkZ.js";import{A as B,X as V,Z as H,_ as U,j as W,m as G,xt as K}from"./index-BlRMvXrJ.js";import{t as q}from"./roleDescriptions-mq0g_Z5c.js";var J=t(e(),1),Y=n(),X=[{group:()=>_(),keys:[{key:`traces.read`,label:()=>p()},{key:`traces.read.content`,label:()=>f(),phi:!0},{key:`traces.write`,label:()=>T()}]},{group:()=>d(),keys:[{key:`kpi.read`,label:()=>p()},{key:`kpi.write`,label:()=>T()}]},{group:()=>u(),keys:[{key:`openclaw.query`,label:()=>i()},{key:`anomalies.read`,label:()=>E()},{key:`anomalies.report`,label:()=>m()}]},{group:()=>l(),keys:[{key:`chats.read`,label:()=>p()},{key:`selfheal`,label:()=>c()}]},{group:()=>h(),keys:[{key:`admin.manage`,label:()=>o()}]}],oe=X.flatMap(e=>e.keys.map(e=>e.key));function Z(e){return e.includes(`*`)}var Q={key:``,name:``,description:``};function $(){let e=s(L.apiKeys.listRoles,{}),t=y(L.apiKeys.createRole),n=y(L.apiKeys.ensureRolesSeeded),i=y(L.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(L.apiKeys.listRoles,{});r&&e.setQuery(L.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),o=W(),c=B(),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(Q),[p,m]=(0,J.useState)(new Set);(0,J.useEffect)(()=>{n({}).catch(e=>{c.error(F(),e)})},[n,c]);let h=e??[];async function _(e,t){if(Z(e.permissions)||p.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await o({title:a({name:e.name}),description:v(),confirmLabel:I()}))){m(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){c.error(ne(),e)}finally{m(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function T(){try{await t({key:d.key,name:d.name,description:d.description||void 0,permissions:[]}),f(Q),u(!1)}catch(e){c.error(R(),e)}}let E=e===void 0,$=!E&&h.length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[P(),` `,(0,Y.jsx)(`code`,{children:`admin`}),` `,te(),` `,(0,Y.jsx)(`code`,{children:`traces.read.content`}),` `,C()]}),(0,Y.jsxs)(`div`,{className:`oc-dt`,children:[(0,Y.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,Y.jsx)(`h2`,{className:`oc-dt__title`,children:w()}),(0,Y.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,Y.jsx)(z,{size:`sm`,onClick:()=>{f(Q),u(!0)},children:O()})})]}),E?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):$?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}):(0,Y.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,Y.jsxs)(`table`,{className:`oc-matrix`,children:[(0,Y.jsxs)(`thead`,{children:[(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:re()}),X.map(e=>(0,Y.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,Y.jsx)(`tr`,{children:X.flatMap(e=>e.keys.map(e=>(0,Y.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?b({key:e.key}):e.key,children:[e.label(),e.phi?(0,Y.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,Y.jsx)(`tbody`,{children:h.map(e=>{let t=Z(e.permissions),n=p.has(e._id);return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,Y.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,Y.jsxs)(V,{variant:`outline`,className:`gap-1`,children:[(0,Y.jsx)(K,{}),` `,N()]}):(0,Y.jsx)(V,{variant:`secondary`,children:D()})]}),q(e)?(0,Y.jsx)(`p`,{className:`oc-matrix__roledesc`,children:q(e)}):null]}),oe.map(r=>(0,Y.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,Y.jsx)(U,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?j():n?k():r,onCheckedChange:()=>void _(e,r)})},r))]},e.key)})})]})})]}),(0,Y.jsx)(G,{open:l,onOpenChange:u,title:M(),description:ie(),canSubmit:!!(d.key&&d.name),onSubmit:T,submitLabel:r(),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:g()}),(0,Y.jsx)(H,{value:d.key,placeholder:ee(),onChange:e=>f({...d,key:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:x()}),(0,Y.jsx)(H,{value:d.name,onChange:e=>f({...d,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:S()}),(0,Y.jsx)(H,{value:d.description,onChange:e=>f({...d,description:e.target.value})})]})]})})]})}export{$ as RolesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,AC as i,Aw as ee,BC as a,CC as o,CO as te,Cw as ne,DC as s,Dw as re,EC as ie,EO as c,Ew as ae,FC as l,Fw as oe,GC as se,HC as ce,IC as u,Iw as le,JC as ue,KC as de,LC as d,Lw as fe,MC as f,Mw as p,NC as m,Nw as h,OC as g,Ow as pe,PC as _,Pw as me,QC as he,RC as ge,Rw as _e,SC as v,Sw as ve,TC as y,TO as b,Tw as ye,UC as be,VC as x,WC as xe,XC as Se,YC as Ce,ZC as we,_w as Te,aw as Ee,bC as S,bw as De,cw as Oe,dw as ke,ew as Ae,fw as je,gw as Me,hw as Ne,iw as Pe,jC as C,jw as Fe,kC as w,kw as Ie,lw as Le,mw as Re,nw as ze,ow as Be,pw as Ve,qC as He,rw as Ue,sw as We,tw as Ge,uw as Ke,vC as T,vw as qe,wC as E,ww as Je,xC as D,xw as Ye,yC as O,yO as k,yw as Xe,zC as A}from"./dist-Cxz8d8g5.js";import{n as j}from"./dist-CRGyTqMI.js";import{i as Ze}from"./dist-CZgL-Z5m.js";import{t as M}from"./button-BOkPsnkZ.js";import{$ as N,A as Qe,At as $e,C as P,Dt as F,Mt as et,Q as I,S as L,X as R,Z as z,b as B,et as V,j as tt,jt as nt,m as rt,nt as H,rt as U,tt as it,x as W,y as G}from"./index-Cs-A4Qz2.js";import{t as at}from"./FilterBar-BToerIZw.js";import{t as ot}from"./DataTableShell-_imgfnfL.js";import{t as st}from"./roleDescriptions-mq0g_Z5c.js";var K=t(e(),1),q=n(),ct=[{value:`never`,label:()=>E(),days:null},{value:`30`,label:()=>o(),days:30},{value:`90`,label:()=>v(),days:90}],lt=720*60*60*1e3,J=`__all__`,Y={name:``,roleKey:``,description:``};function X(){let e=et({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??J,[a,o]=(0,K.useState)(J),s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,status:e===J?void 0:e})}),l=c(k.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===J?void 0:a,disabled:i===J?void 0:i===`disabled`}}),u=c(k.apiKeys.listKeys,{}),d=c(k.apiKeys.listRoles,{}),f=b(k.apiKeys.createServiceAccount),m=b(k.apiKeys.updateServiceAccount),g=b(k.apiKeys.deleteServiceAccount),_=te(k.apiKeys.mintApiKey),ge=b(k.apiKeys.revokeApiKey),v=tt(),y=Qe(),x=n!==``||a!==J||i!==J;function S(){o(J),t({search:{},replace:!0})}let[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Y),[D,O]=(0,K.useState)(null),[A,j]=(0,K.useState)(new Set),[N,F]=(0,K.useState)(null),I=(0,K.useRef)(!1),[V,H]=(0,K.useState)(new Set),[U,it]=(0,K.useState)({}),[lt,X]=(0,K.useState)(null),Z=(0,K.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[u]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await m({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(ze())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Y),O(null),w(!1)}catch(e){y.error(D?Ue():Pe(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function $(e){if(I.current)return;I.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;F(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});X({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Ge(),e)}finally{I.current=!1,F(null)}}async function mt(e){if(await v({title:Ae(),description:(0,q.jsxs)(q.Fragment,{children:[r(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,he(),` `,(0,q.jsx)(`strong`,{children:we()}),` `,Se()]}),confirmWord:e.name,confirmLabel:Ce(),destructive:!0}))try{await g({serviceAccountId:e._id}),y.success(ue(),e.name)}catch(e){y.error(He(),e)}}async function ht(e){if(await v({title:de(),description:(0,q.jsxs)(q.Fragment,{children:[se(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,xe()]}),confirmLabel:be(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await ge({keyId:e._id})}catch(e){y.error(ce(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}),(0,q.jsxs)(at,{q:n,onQChange:s,searchPlaceholder:fe(),onReset:S,canReset:x,children:[(0,q.jsxs)(G,{value:a,onValueChange:o,children:[(0,q.jsx)(L,{size:`sm`,className:`w-40`,children:(0,q.jsx)(P,{placeholder:le()})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:oe()}),(d??[]).map(e=>(0,q.jsx)(W,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(G,{value:i,onValueChange:ie,children:[(0,q.jsx)(L,{size:`sm`,className:`w-36`,children:(0,q.jsx)(P,{})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:me()}),(0,q.jsx)(W,{value:`active`,children:h()}),(0,q.jsx)(W,{value:`disabled`,children:p()})]})]})]}),(0,q.jsx)(ot,{title:Fe(),rows:l,addLabel:ee(),onAdd:()=>{E(Y),O(null),w(!0)},emptyHint:Ie(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Z.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:ye(),onSelect:()=>pt(e)},{label:pe(),onSelect:()=>void $(e)},{label:A.has(e._id)?re():ae(),onSelect:()=>Q(e._id)},{label:Je(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?ne():ve(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)($e,{})})},{header:Ye(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:De(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Xe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:p()}):(0,q.jsx)(R,{variant:`outline`,children:h()})},{header:qe(),cell:e=>(0,q.jsxs)(G,{value:U[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(L,{size:`sm`,className:`w-32`,children:(0,q.jsx)(P,{})}),(0,q.jsx)(B,{children:ct.map(e=>(0,q.jsx)(W,{value:e.value,children:e.label()},e.value))})]})},{header:Te(),sort:e=>(Z.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Z.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?Me():Ne({count:t})})}}]}),(0,q.jsx)(rt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?Re():ke(),description:D?Ve():Ke(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?je():Le(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Oe()}),(0,q.jsx)(z,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:We()}),(0,q.jsxs)(G,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(L,{className:`w-full`,children:(0,q.jsx)(P,{placeholder:Be()})}),(0,q.jsx)(B,{children:(d??[]).map(e=>(0,q.jsxs)(W,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(d??[]).find(e=>e.key===T.roleKey),t=e?st(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ee()}),(0,q.jsx)(z,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:lt,onClose:()=>X(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[x(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:A()}),(0,q.jsx)(`th`,{children:ge()}),(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{children:u()}),(0,q.jsx)(`th`,{children:l()}),(0,q.jsx)(`th`,{children:_()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:Z(t.createdAt)}),(0,q.jsx)(`td`,{className:Q(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:pt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?m():f()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function ee(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(I,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(N,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(H,{children:[(0,q.jsx)(U,{children:C()}),(0,q.jsx)(V,{children:i({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:w()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void ee(),"aria-label":g(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(F,{}),n?s():ie()]})]}),(0,q.jsx)(it,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:y()})})]}):null})}function Z(e){return new Date(e).toLocaleString(`fr-FR`)}function Q(e){return e===null?!1:Date.now()-e>lt}function ft(e){return e===null?D():new Date(e).toLocaleString(`fr-FR`)}function pt(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function $(e){return e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:S()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:O()}):(0,q.jsx)(R,{variant:`outline`,children:T()})}export{X as ServiceAccountsTab};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,AC as i,Aw as ee,BC as a,CC as o,CO as te,Cw as ne,DC as s,Dw as re,EC as ie,EO as c,Ew as ae,FC as l,Fw as oe,GC as se,HC as ce,IC as u,Iw as le,JC as ue,KC as de,LC as d,Lw as fe,MC as f,Mw as p,NC as m,Nw as h,OC as g,Ow as pe,PC as _,Pw as me,QC as he,RC as ge,Rw as _e,SC as v,Sw as ve,TC as y,TO as b,Tw as ye,UC as be,VC as x,WC as xe,XC as Se,YC as Ce,ZC as we,_w as Te,aw as Ee,bC as S,bw as De,cw as Oe,dw as ke,ew as Ae,fw as je,gw as Me,hw as Ne,iw as Pe,jC as C,jw as Fe,kC as w,kw as Ie,lw as Le,mw as Re,nw as ze,ow as Be,pw as Ve,qC as He,rw as Ue,sw as We,tw as Ge,uw as Ke,vC as T,vw as qe,wC as E,ww as Je,xC as D,xw as Ye,yC as O,yO as k,yw as Xe,zC as A}from"./dist-Cxz8d8g5.js";import{n as j}from"./dist-CRGyTqMI.js";import{i as Ze}from"./dist-CZgL-Z5m.js";import{t as M}from"./button-BOkPsnkZ.js";import{$ as N,A as Qe,At as $e,C as P,Dt as F,Mt as et,Q as I,S as L,X as R,Z as z,b as B,et as V,j as tt,jt as nt,m as rt,nt as H,rt as U,tt as it,x as W,y as G}from"./index-BlRMvXrJ.js";import{t as at}from"./FilterBar-B_mSpGb-.js";import{t as ot}from"./DataTableShell-y4F1v6a9.js";import{t as st}from"./roleDescriptions-mq0g_Z5c.js";var K=t(e(),1),q=n(),ct=[{value:`never`,label:()=>E(),days:null},{value:`30`,label:()=>o(),days:30},{value:`90`,label:()=>v(),days:90}],lt=720*60*60*1e3,J=`__all__`,Y={name:``,roleKey:``,description:``};function X(){let e=et({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??J,[a,o]=(0,K.useState)(J),s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,status:e===J?void 0:e})}),l=c(k.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===J?void 0:a,disabled:i===J?void 0:i===`disabled`}}),u=c(k.apiKeys.listKeys,{}),d=c(k.apiKeys.listRoles,{}),f=b(k.apiKeys.createServiceAccount),m=b(k.apiKeys.updateServiceAccount),g=b(k.apiKeys.deleteServiceAccount),_=te(k.apiKeys.mintApiKey),ge=b(k.apiKeys.revokeApiKey),v=tt(),y=Qe(),x=n!==``||a!==J||i!==J;function S(){o(J),t({search:{},replace:!0})}let[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Y),[D,O]=(0,K.useState)(null),[A,j]=(0,K.useState)(new Set),[N,F]=(0,K.useState)(null),I=(0,K.useRef)(!1),[V,H]=(0,K.useState)(new Set),[U,it]=(0,K.useState)({}),[lt,X]=(0,K.useState)(null),Z=(0,K.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[u]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await m({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(ze())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Y),O(null),w(!1)}catch(e){y.error(D?Ue():Pe(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function $(e){if(I.current)return;I.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;F(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});X({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(Ge(),e)}finally{I.current=!1,F(null)}}async function mt(e){if(await v({title:Ae(),description:(0,q.jsxs)(q.Fragment,{children:[r(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,he(),` `,(0,q.jsx)(`strong`,{children:we()}),` `,Se()]}),confirmWord:e.name,confirmLabel:Ce(),destructive:!0}))try{await g({serviceAccountId:e._id}),y.success(ue(),e.name)}catch(e){y.error(He(),e)}}async function ht(e){if(await v({title:de(),description:(0,q.jsxs)(q.Fragment,{children:[se(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,xe()]}),confirmLabel:be(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await ge({keyId:e._id})}catch(e){y.error(ce(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}),(0,q.jsxs)(at,{q:n,onQChange:s,searchPlaceholder:fe(),onReset:S,canReset:x,children:[(0,q.jsxs)(G,{value:a,onValueChange:o,children:[(0,q.jsx)(L,{size:`sm`,className:`w-40`,children:(0,q.jsx)(P,{placeholder:le()})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:oe()}),(d??[]).map(e=>(0,q.jsx)(W,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(G,{value:i,onValueChange:ie,children:[(0,q.jsx)(L,{size:`sm`,className:`w-36`,children:(0,q.jsx)(P,{})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:me()}),(0,q.jsx)(W,{value:`active`,children:h()}),(0,q.jsx)(W,{value:`disabled`,children:p()})]})]})]}),(0,q.jsx)(ot,{title:Fe(),rows:l,addLabel:ee(),onAdd:()=>{E(Y),O(null),w(!0)},emptyHint:Ie(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Z.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:ye(),onSelect:()=>pt(e)},{label:pe(),onSelect:()=>void $(e)},{label:A.has(e._id)?re():ae(),onSelect:()=>Q(e._id)},{label:Je(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?ne():ve(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)($e,{})})},{header:Ye(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:De(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Xe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:p()}):(0,q.jsx)(R,{variant:`outline`,children:h()})},{header:qe(),cell:e=>(0,q.jsxs)(G,{value:U[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(L,{size:`sm`,className:`w-32`,children:(0,q.jsx)(P,{})}),(0,q.jsx)(B,{children:ct.map(e=>(0,q.jsx)(W,{value:e.value,children:e.label()},e.value))})]})},{header:Te(),sort:e=>(Z.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Z.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?Me():Ne({count:t})})}}]}),(0,q.jsx)(rt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?Re():ke(),description:D?Ve():Ke(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?je():Le(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Oe()}),(0,q.jsx)(z,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:We()}),(0,q.jsxs)(G,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(L,{className:`w-full`,children:(0,q.jsx)(P,{placeholder:Be()})}),(0,q.jsx)(B,{children:(d??[]).map(e=>(0,q.jsxs)(W,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(d??[]).find(e=>e.key===T.roleKey),t=e?st(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ee()}),(0,q.jsx)(z,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:lt,onClose:()=>X(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[x(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:A()}),(0,q.jsx)(`th`,{children:ge()}),(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{children:u()}),(0,q.jsx)(`th`,{children:l()}),(0,q.jsx)(`th`,{children:_()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:Z(t.createdAt)}),(0,q.jsx)(`td`,{className:Q(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:pt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?m():f()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function ee(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(I,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(N,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(H,{children:[(0,q.jsx)(U,{children:C()}),(0,q.jsx)(V,{children:i({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:w()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void ee(),"aria-label":g(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(F,{}),n?s():ie()]})]}),(0,q.jsx)(it,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:y()})})]}):null})}function Z(e){return new Date(e).toLocaleString(`fr-FR`)}function Q(e){return e===null?!1:Date.now()-e>lt}function ft(e){return e===null?D():new Date(e).toLocaleString(`fr-FR`)}function pt(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function $(e){return e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:S()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:O()}):(0,q.jsx)(R,{variant:`outline`,children:T()})}export{X as ServiceAccountsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,At as i,Ct as a,Dt as o,EO as s,Et as c,J as l,Mt as u,Ot as d,Q as f,St as p,TO as m,Tt as h,X as g,Y as _,Z as v,_t as y,at as b,bt as x,ct as S,dt as C,et as w,ft as T,gt as E,ht as D,it as O,jt as k,kt as A,lt as j,mt as M,nt as N,ot as P,pt as F,rt as I,st as L,tt as R,ut as z,vt as B,wt as V,xt as H,yO as U,yt as W}from"./dist-Cxz8d8g5.js";import{t as G}from"./button-BOkPsnkZ.js";import{j as K}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,At as i,Ct as a,Dt as o,EO as s,Et as c,J as l,Mt as u,Ot as d,Q as f,St as p,TO as m,Tt as h,X as g,Y as _,Z as v,_t as y,at as b,bt as x,ct as S,dt as C,et as w,ft as T,gt as E,ht as D,it as O,jt as k,kt as A,lt as j,mt as M,nt as N,ot as P,pt as F,rt as I,st as L,tt as R,ut as z,vt as B,wt as V,xt as H,yO as U,yt as W}from"./dist-Cxz8d8g5.js";import{t as G}from"./button-BOkPsnkZ.js";import{j as K}from"./index-BlRMvXrJ.js";import{t as q}from"./DataTableShell-y4F1v6a9.js";var J=t(e(),1),Y=n(),X={hung:()=>D(),wrong_result:()=>M(),error:()=>F(),other:()=>T()},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=m(U.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),` · `,C({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`?S():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:b(),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)(G,{size:`sm`,onClick:()=>void u(),disabled:!o.trim()||c,children:c?I():O()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[N({count:t.children.length}),t.childrenTruncated?` ${R()}`:``,t.textTruncated?` ${w()}`:``]}),(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:f()}),(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:v()}),(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 ee(){let e=s(U.subAgentReports.listForAdmin,{}),t=m(U.subAgentReports.readReport),n=m(U.subAgentReports.deleteReport),r=K(),[f,v]=(0,J.useState)(null),[b,S]=(0,J.useState)({});async function C(e){if(f===e._id){v(null);return}if(!b[e._id]){let n=await t({reportId:e._id});S(t=>({...t,[e._id]:n}))}v(e._id)}async function w(e){await r({title:g(),description:_(),confirmLabel:l(),destructive:!0})&&(await n({reportId:e._id}),f===e._id&&v(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[i(),` `,(0,Y.jsx)(`strong`,{children:A()}),` `,d()]}),(0,Y.jsx)(q,{title:u(),rows:e,emptyHint:k(),isExpanded:e=>f===e._id&&!!b[e._id],renderExpanded:e=>b[e._id]?(0,Y.jsx)($,{data:b[e._id]}):null,columns:[{header:o(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:c(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:h(),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:p(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:x()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:W()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:f===e._id?y():B(),onSelect:()=>void C(e)},{label:E(),onSelect:()=>void w(e),variant:`destructive`}]})]})}export{ee as SubAgentReportsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as r,AE as i,AT as a,BE as o,BT as s,CE as c,CO as l,CT as u,DD as d,DE as f,DT as p,ED as m,EE as h,EO as g,ET as _,FE as v,FT as y,G as ee,GT as te,HD as ne,HT as re,IE as ie,IT as ae,JT as oe,K as b,KT as se,LE as ce,LT as le,ME as ue,MT as de,NE as fe,NT as pe,OE as me,OT as he,PE as ge,PT as _e,QT as ve,RE as ye,RT as be,SE as xe,ST as Se,TE as Ce,TO as x,TT as we,UD as Te,UT as Ee,VE as De,VT as Oe,W as ke,WD as Ae,WT as je,XT as Me,YT as Ne,ZT as Pe,_E as Fe,aE as Ie,bE as Le,bO as Re,bT as ze,cE as Be,dE as Ve,eE as He,fE as Ue,gE as We,hE as Ge,iE as S,jE as C,jT as Ke,kE as qe,kT as Je,lE as Ye,mE as Xe,n as Ze,nE as Qe,oE as $e,pE as et,q as w,qT as tt,rE as nt,sE as rt,tE as it,uE as at,vE as ot,wE as st,wT as ct,xE as lt,xT as ut,yE as dt,yO as T,yT as ft,zE as pt,zT as E}from"./dist-Cxz8d8g5.js";import{n as D}from"./dist-CRGyTqMI.js";import{t as mt}from"./x-BimfpZdd.js";import{t as O}from"./button-BOkPsnkZ.js";import{C as k,Et as ht,G as gt,J as A,K as j,S as M,Tt as N,W as _t,X as P,Y as vt,Z as F,_ as I,at as yt,b as L,it as bt,ot as R,q as xt,x as z,y as B}from"./index-Cs-A4Qz2.js";import{a as St,i as Ct,n as wt,o as Tt,r as Et,t as Dt}from"./card-D7I9UeSH.js";import{a as Ot,i as V,n as kt,o as H,r as U,t as At}from"./table-XSL9PnTz.js";import{t as jt}from"./TimeRangePicker-Cm-XSScp.js";import{t as Mt}from"./FilterBar-BToerIZw.js";import{t as Nt}from"./AdvancedFilter-B0eHnjhM.js";var W=Re(`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`}]]),G=t(e(),1),Pt=.1,Ft=[248,248,248],It=[24,24,24];function Lt(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 Rt(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 K(e,t,n){return Rt(e,t,n)>=Pt}function zt(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 Bt(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 Vt=12*1024*1024,Ht=480,Ut=160,Wt=.92;async function Gt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(re());if(e.size>Vt)throw Error(Oe());let{source:n,width:r,height:i,cleanup:a}=await Kt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Ht/r,Ut/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(E());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Lt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(E());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);K(e.data,d.width,d.height)?zt(e.data,t.variantFor===`dark`?Ft:It):Bt(e.data),p.putImageData(e,0,0)}let m=K(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await J(f,`image/webp`,Wt)??await J(f,`image/png`);if(!h)throw Error(be());return{blob:h,hasAlpha:m}}finally{a()}}async function Kt(e){if(e.type===`image/svg+xml`)return q(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 q(e)}async function q(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(s())),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 J(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var Y=n();function qt(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 X=`__all__`,Z={kind:`relative`,from:`now-24h`,to:`now`},Jt=[{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,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Yt(e){return e===`light`?Ae():e===`dark`?Te():ne()}var Xt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Zt({tokens:e,mode:t}){let n=e.colors[t];return(0,Y.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Xt.map(e=>{let t=n[e];return(0,Y.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function $({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,Y.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:Ze(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,Y.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,Y.jsx)(Zt,{tokens:r,mode:i}):(0,Y.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,Y.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,Y.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,Y.jsx)(ht,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=g(T.charts.listMyCharts),r=x(T.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:fe()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,Y.jsx)($,{selected:e===null,title:C(),subtitle:i(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?qe():n.via===`owner`?me():f({group:n.via.group});return(0,Y.jsx)($,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>qt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:h()}):null]})}function $t(){let e=x(T.charts.importChart),[t,n]=(0,G.useState)(``),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(S())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(Qe());return}let a;try{a=JSON.parse(r)}catch{o(S());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:Ue()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:at()}),(0,Y.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:Ye(),maxLength:60})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:Be()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:rt(),rows:8,spellCheck:!1})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),$e(),(0,Y.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,Y.jsx)(O,{size:`sm`,disabled:l,onClick:()=>void f(),children:Ie()})]}),a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,Y.jsx)(`p`,{className:`oc-chart-import__ok`,children:nt()}):null]})]})}function en({chart:e}){let t=l(T.charts.setChartLogo),n=x(T.charts.removeChartLogo),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.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 Gt(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 u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function d(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 f(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 p({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Ne():oe()}),(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,Y.jsx)(`img`,{src:t,alt:``}):null}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),t?se():tt(),(0,Y.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:je()}):null,t?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:te()}):null]})}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Me()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,Y.jsx)(p,{mode:`light`}),(0,Y.jsx)(p,{mode:`dark`})]}),r?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Ee()}):null,a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=g(T.me.getMe,{host:R}),n=x(T.charts.addChartDomain),r=x(T.charts.removeChartDomain),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:le()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:pe()}):u.map(e=>(0,Y.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":de({domain:e}),onClick:()=>void f(e),children:(0,Y.jsx)(mt,{className:`size-3`})})]},e))}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(F,{value:i,onChange:e=>a(e.target.value),placeholder:y(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:_e()})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ae()}),o?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function nn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function rn({chart:e}){let t=x(T.charts.updateChart),n=x(T.charts.deleteChart),[r,i]=(0,G.useState)(!1),[o,s]=(0,G.useState)(e.name),[c,l]=(0,G.useState)(()=>nn(e.tokens)),[u,d]=(0,G.useState)(e.tokens.bpm??0),[f,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1);function _(){s(e.name),l(nn(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function v(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(c)}catch{m(S());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),i(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(p()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:_,children:ve()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Pe()})]})})]}),r?(0,Y.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:Je()}),(0,Y.jsx)(F,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:b()}),(0,Y.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,Y.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":b()}),(0,Y.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ee():`${u} BPM`})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ke()})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:he()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,disabled:h,onClick:()=>void v(),children:Ke()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:a()})]})]}):null,(0,Y.jsx)(en,{chart:e}),(0,Y.jsx)(tn,{chart:e})]})}function an(){let e=g(T.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:it()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),e!==void 0&&t.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:r()}):(0,Y.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,Y.jsx)(rn,{chart:e},e.key))})]})}function on({chart:e,groups:t}){let n=x(T.charts.addChartToGroupPool),r=x(T.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,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ot():e.kind===`custom`&&e.scope===`personal`?u():dt()}),e.isGlobalDefault?(0,Y.jsx)(P,{variant:`default`,children:Fe()}):null]}),(0,Y.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ge()}),(a??[]).map(e=>(0,Y.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":et({group:e.name}),onClick:()=>void l(e.groupId),children:(0,Y.jsx)(mt,{className:`size-3`})})]},e.groupId)),s.length>0?(0,Y.jsxs)(B,{value:``,onValueChange:e=>void c(e),children:[(0,Y.jsx)(M,{size:`sm`,className:`w-56`,children:(0,Y.jsx)(k,{placeholder:Xe()})}),(0,Y.jsx)(L,{children:s.map(e=>(0,Y.jsx)(z,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:We()}):null]})]})}function sn({chart:e}){let t=x(T.charts.promoteChartToCommon),n=x(T.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(p()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Se():u()}),e.ownerLabel?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ct({owner:e.ownerLabel})}):null]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ut()}):null,(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ze()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(T.admin.setDefaultThemeMode),i=x(T.admin.setDefaultLocale),a=x(T.charts.setDefaultChart),s=g(T.charts.listChartsAdmin),l=g(T.groups.listGroups,{}),u=e??`system`,f=t??`fr`;return(0,Y.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:v()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Ce()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:C()}),yt.map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:c()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:xe()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,Y.jsx)(on,{chart:e,groups:l??[]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:lt()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,Y.jsx)(tn,{chart:e})]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:_()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:we()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ft()}):(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,Y.jsx)(sn,{chart:e},e.key))})})()]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:De()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,Y.jsx)(O,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Yt(e)},e))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:pt()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,Y.jsx)(O,{variant:f===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?d():m()},e))}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]})]})}function ln(){let e=g(T.me.getMe,{host:R}),t=bt(e?.resolvedThemeMode);return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,Y.jsx)($t,{}),(0,Y.jsx)(an,{}),e?.role===`admin`?(0,Y.jsx)(cn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function un(){let[e,t]=(0,G.useState)(!0),[n,r]=(0,G.useState)(`per-user`),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(X),[c,l]=(0,G.useState)(X),[u,d]=(0,G.useState)(Z),f=i!==``||o!==X||c!==X;function p(){a(``),s(X),l(X),d(Z)}return(0,Y.jsxs)(`div`,{className:`oc-show`,children:[(0,Y.jsx)(ln,{}),(0,Y.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,Y.jsx)(`summary`,{className:`oc-show__title`,children:ie()}),(0,Y.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(O,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(O,{variant:`ghost`,children:`Ghost`}),(0,Y.jsx)(O,{variant:`destructive`,children:`Destructive`}),(0,Y.jsx)(O,{variant:`link`,children:`Link`})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Small`}),(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{size:`lg`,children:`Large`}),(0,Y.jsx)(O,{size:`icon`,"aria-label":`more`,children:(0,Y.jsx)(N,{})}),(0,Y.jsx)(O,{disabled:!0,children:`Disabled`})]})]}),(0,Y.jsx)(Q,{title:`Badges`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(P,{children:`Default`}),(0,Y.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(P,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,Y.jsx)(Q,{title:`Inputs & selection`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(F,{placeholder:`Text input…`}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsxs)(B,{value:n,onValueChange:r,children:[(0,Y.jsx)(M,{className:`w-56`,children:(0,Y.jsx)(k,{placeholder:`Select…`})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(z,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,Y.jsx)(z,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,Y.jsxs)(`label`,{className:`oc-show__check`,children:[(0,Y.jsx)(I,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,Y.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,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsxs)(Mt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,Y.jsxs)(B,{value:o,onValueChange:s,children:[(0,Y.jsx)(M,{size:`sm`,children:(0,Y.jsx)(k,{})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(z,{value:X,children:`Toutes directions`}),(0,Y.jsx)(z,{value:`inbound`,children:`inbound`}),(0,Y.jsx)(z,{value:`outbound`,children:`outbound`}),(0,Y.jsx)(z,{value:`internal`,children:`internal`})]})]}),(0,Y.jsxs)(B,{value:c,onValueChange:l,children:[(0,Y.jsx)(M,{size:`sm`,children:(0,Y.jsx)(k,{})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(z,{value:X,children:`Toutes sévérités`}),(0,Y.jsx)(z,{value:`info`,children:`info`}),(0,Y.jsx)(z,{value:`warn`,children:`warn`}),(0,Y.jsx)(z,{value:`critical`,children:`critical`})]})]})]}),(0,Y.jsx)(Nt,{fields:Jt,onChange:()=>{}}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,Y.jsx)(jt,{value:u,onChange:d})]})]})}),(0,Y.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,Y.jsxs)(_t,{children:[(0,Y.jsx)(vt,{asChild:!0,children:(0,Y.jsx)(O,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,Y.jsx)(N,{})})}),(0,Y.jsxs)(gt,{align:`start`,children:[(0,Y.jsx)(xt,{children:`Actions`}),(0,Y.jsx)(A,{}),(0,Y.jsx)(j,{children:`Edit`}),(0,Y.jsx)(j,{children:`Duplicate`}),(0,Y.jsx)(A,{}),(0,Y.jsx)(j,{variant:`destructive`,children:`Delete`})]})]})}),(0,Y.jsx)(Q,{title:`Card`,children:(0,Y.jsxs)(Dt,{className:`w-80`,children:[(0,Y.jsxs)(St,{children:[(0,Y.jsx)(Tt,{children:`Instance`}),(0,Y.jsx)(Et,{children:`Non-secret metadata only.`})]}),(0,Y.jsx)(wt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,Y.jsxs)(Ct,{className:`gap-2`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Save`}),(0,Y.jsx)(O,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,Y.jsx)(Q,{title:`Table`,children:(0,Y.jsxs)(At,{children:[(0,Y.jsx)(Ot,{children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{className:`w-8`,children:(0,Y.jsx)(I,{"aria-label":`select all`})}),(0,Y.jsx)(V,{children:`Name`}),(0,Y.jsx)(V,{children:`Mode`}),(0,Y.jsx)(V,{className:`text-right`,children:`Status`}),(0,Y.jsx)(V,{className:`w-8`})]})}),(0,Y.jsx)(kt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,Y.jsxs)(H,{children:[(0,Y.jsx)(U,{children:(0,Y.jsx)(I,{"aria-label":`select ${e.n}`})}),(0,Y.jsx)(U,{className:`font-medium`,children:e.n}),(0,Y.jsx)(U,{children:(0,Y.jsx)(P,{variant:`secondary`,children:e.m})}),(0,Y.jsx)(U,{className:`text-right`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,Y.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,Y.jsx)(N,{})})})]},e.n))})]})}),(0,Y.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,Y.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,Y.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,Y.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,Y.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,Y.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,Y.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,Y.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,Y.jsx)(`span`,{className:`oc-run-status__dot`}),(0,Y.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{un as ThemeShowroom};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as r,AE as i,AT as a,BE as o,BT as s,CE as c,CO as l,CT as u,DD as d,DE as f,DT as p,ED as m,EE as h,EO as g,ET as _,FE as v,FT as y,G as ee,GT as te,HD as ne,HT as re,IE as ie,IT as ae,JT as oe,K as b,KT as se,LE as ce,LT as le,ME as ue,MT as de,NE as fe,NT as pe,OE as me,OT as he,PE as ge,PT as _e,QT as ve,RE as ye,RT as be,SE as xe,ST as Se,TE as Ce,TO as x,TT as we,UD as Te,UT as Ee,VE as De,VT as Oe,W as ke,WD as Ae,WT as je,XT as Me,YT as Ne,ZT as Pe,_E as Fe,aE as Ie,bE as Le,bO as Re,bT as ze,cE as Be,dE as Ve,eE as He,fE as Ue,gE as We,hE as Ge,iE as S,jE as C,jT as Ke,kE as qe,kT as Je,lE as Ye,mE as Xe,n as Ze,nE as Qe,oE as $e,pE as et,q as w,qT as tt,rE as nt,sE as rt,tE as it,uE as at,vE as ot,wE as st,wT as ct,xE as lt,xT as ut,yE as dt,yO as T,yT as ft,zE as pt,zT as E}from"./dist-Cxz8d8g5.js";import{n as D}from"./dist-CRGyTqMI.js";import{t as mt}from"./x-BimfpZdd.js";import{t as O}from"./button-BOkPsnkZ.js";import{C as k,Et as ht,G as gt,J as A,K as j,S as M,Tt as N,W as _t,X as P,Y as vt,Z as F,_ as I,at as yt,b as L,it as bt,ot as R,q as xt,x as z,y as B}from"./index-BlRMvXrJ.js";import{a as St,i as Ct,n as wt,o as Tt,r as Et,t as Dt}from"./card-D7I9UeSH.js";import{a as Ot,i as V,n as kt,o as H,r as U,t as At}from"./table-XSL9PnTz.js";import{t as jt}from"./TimeRangePicker-CFCLAlKB.js";import{t as Mt}from"./FilterBar-B_mSpGb-.js";import{t as Nt}from"./AdvancedFilter-DnGyDWXx.js";var W=Re(`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`}]]),G=t(e(),1),Pt=.1,Ft=[248,248,248],It=[24,24,24];function Lt(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 Rt(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 K(e,t,n){return Rt(e,t,n)>=Pt}function zt(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 Bt(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 Vt=12*1024*1024,Ht=480,Ut=160,Wt=.92;async function Gt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(re());if(e.size>Vt)throw Error(Oe());let{source:n,width:r,height:i,cleanup:a}=await Kt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Ht/r,Ut/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(E());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Lt(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(E());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);K(e.data,d.width,d.height)?zt(e.data,t.variantFor===`dark`?Ft:It):Bt(e.data),p.putImageData(e,0,0)}let m=K(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await J(f,`image/webp`,Wt)??await J(f,`image/png`);if(!h)throw Error(be());return{blob:h,hasAlpha:m}}finally{a()}}async function Kt(e){if(e.type===`image/svg+xml`)return q(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 q(e)}async function q(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(s())),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 J(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var Y=n();function qt(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 X=`__all__`,Z={kind:`relative`,from:`now-24h`,to:`now`},Jt=[{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,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Yt(e){return e===`light`?Ae():e===`dark`?Te():ne()}var Xt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Zt({tokens:e,mode:t}){let n=e.colors[t];return(0,Y.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Xt.map(e=>{let t=n[e];return(0,Y.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function $({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,Y.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:Ze(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,Y.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,Y.jsx)(Zt,{tokens:r,mode:i}):(0,Y.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,Y.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,Y.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,Y.jsx)(ht,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=g(T.charts.listMyCharts),r=x(T.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:fe()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,Y.jsx)($,{selected:e===null,title:C(),subtitle:i(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?qe():n.via===`owner`?me():f({group:n.via.group});return(0,Y.jsx)($,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>qt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:h()}):null]})}function $t(){let e=x(T.charts.importChart),[t,n]=(0,G.useState)(``),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(S())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(Qe());return}let a;try{a=JSON.parse(r)}catch{o(S());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:Ue()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:at()}),(0,Y.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:Ye(),maxLength:60})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:Be()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:rt(),rows:8,spellCheck:!1})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),$e(),(0,Y.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,Y.jsx)(O,{size:`sm`,disabled:l,onClick:()=>void f(),children:Ie()})]}),a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,Y.jsx)(`p`,{className:`oc-chart-import__ok`,children:nt()}):null]})]})}function en({chart:e}){let t=l(T.charts.setChartLogo),n=x(T.charts.removeChartLogo),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.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 Gt(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 u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function d(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 f(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 p({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Ne():oe()}),(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,Y.jsx)(`img`,{src:t,alt:``}):null}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),t?se():tt(),(0,Y.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:je()}):null,t?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:te()}):null]})}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Me()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,Y.jsx)(p,{mode:`light`}),(0,Y.jsx)(p,{mode:`dark`})]}),r?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Ee()}):null,a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=g(T.me.getMe,{host:R}),n=x(T.charts.addChartDomain),r=x(T.charts.removeChartDomain),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:le()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:pe()}):u.map(e=>(0,Y.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":de({domain:e}),onClick:()=>void f(e),children:(0,Y.jsx)(mt,{className:`size-3`})})]},e))}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(F,{value:i,onChange:e=>a(e.target.value),placeholder:y(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:_e()})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ae()}),o?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function nn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function rn({chart:e}){let t=x(T.charts.updateChart),n=x(T.charts.deleteChart),[r,i]=(0,G.useState)(!1),[o,s]=(0,G.useState)(e.name),[c,l]=(0,G.useState)(()=>nn(e.tokens)),[u,d]=(0,G.useState)(e.tokens.bpm??0),[f,m]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1);function _(){s(e.name),l(nn(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function v(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(c)}catch{m(S());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),i(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(p()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:_,children:ve()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Pe()})]})})]}),r?(0,Y.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:Je()}),(0,Y.jsx)(F,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:b()}),(0,Y.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,Y.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":b()}),(0,Y.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ee():`${u} BPM`})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ke()})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:he()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,disabled:h,onClick:()=>void v(),children:Ke()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:a()})]})]}):null,(0,Y.jsx)(en,{chart:e}),(0,Y.jsx)(tn,{chart:e})]})}function an(){let e=g(T.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:it()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),e!==void 0&&t.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:r()}):(0,Y.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,Y.jsx)(rn,{chart:e},e.key))})]})}function on({chart:e,groups:t}){let n=x(T.charts.addChartToGroupPool),r=x(T.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,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ot():e.kind===`custom`&&e.scope===`personal`?u():dt()}),e.isGlobalDefault?(0,Y.jsx)(P,{variant:`default`,children:Fe()}):null]}),(0,Y.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ge()}),(a??[]).map(e=>(0,Y.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":et({group:e.name}),onClick:()=>void l(e.groupId),children:(0,Y.jsx)(mt,{className:`size-3`})})]},e.groupId)),s.length>0?(0,Y.jsxs)(B,{value:``,onValueChange:e=>void c(e),children:[(0,Y.jsx)(M,{size:`sm`,className:`w-56`,children:(0,Y.jsx)(k,{placeholder:Xe()})}),(0,Y.jsx)(L,{children:s.map(e=>(0,Y.jsx)(z,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:We()}):null]})]})}function sn({chart:e}){let t=x(T.charts.promoteChartToCommon),n=x(T.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(p()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Se():u()}),e.ownerLabel?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ct({owner:e.ownerLabel})}):null]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ut()}):null,(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ze()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(T.admin.setDefaultThemeMode),i=x(T.admin.setDefaultLocale),a=x(T.charts.setDefaultChart),s=g(T.charts.listChartsAdmin),l=g(T.groups.listGroups,{}),u=e??`system`,f=t??`fr`;return(0,Y.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:v()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Ce()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:C()}),yt.map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:c()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:xe()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,Y.jsx)(on,{chart:e,groups:l??[]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:lt()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,Y.jsx)(tn,{chart:e})]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:_()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:we()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ft()}):(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,Y.jsx)(sn,{chart:e},e.key))})})()]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:De()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,Y.jsx)(O,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Yt(e)},e))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:pt()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,Y.jsx)(O,{variant:f===e?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e}),children:e===`fr`?d():m()},e))}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]})]})}function ln(){let e=g(T.me.getMe,{host:R}),t=bt(e?.resolvedThemeMode);return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,Y.jsx)($t,{}),(0,Y.jsx)(an,{}),e?.role===`admin`?(0,Y.jsx)(cn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function un(){let[e,t]=(0,G.useState)(!0),[n,r]=(0,G.useState)(`per-user`),[i,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(X),[c,l]=(0,G.useState)(X),[u,d]=(0,G.useState)(Z),f=i!==``||o!==X||c!==X;function p(){a(``),s(X),l(X),d(Z)}return(0,Y.jsxs)(`div`,{className:`oc-show`,children:[(0,Y.jsx)(ln,{}),(0,Y.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,Y.jsx)(`summary`,{className:`oc-show__title`,children:ie()}),(0,Y.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(O,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(O,{variant:`ghost`,children:`Ghost`}),(0,Y.jsx)(O,{variant:`destructive`,children:`Destructive`}),(0,Y.jsx)(O,{variant:`link`,children:`Link`})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Small`}),(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{size:`lg`,children:`Large`}),(0,Y.jsx)(O,{size:`icon`,"aria-label":`more`,children:(0,Y.jsx)(N,{})}),(0,Y.jsx)(O,{disabled:!0,children:`Disabled`})]})]}),(0,Y.jsx)(Q,{title:`Badges`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(P,{children:`Default`}),(0,Y.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(P,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,Y.jsx)(Q,{title:`Inputs & selection`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(F,{placeholder:`Text input…`}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsxs)(B,{value:n,onValueChange:r,children:[(0,Y.jsx)(M,{className:`w-56`,children:(0,Y.jsx)(k,{placeholder:`Select…`})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(z,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,Y.jsx)(z,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,Y.jsxs)(`label`,{className:`oc-show__check`,children:[(0,Y.jsx)(I,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,Y.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,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsxs)(Mt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,Y.jsxs)(B,{value:o,onValueChange:s,children:[(0,Y.jsx)(M,{size:`sm`,children:(0,Y.jsx)(k,{})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(z,{value:X,children:`Toutes directions`}),(0,Y.jsx)(z,{value:`inbound`,children:`inbound`}),(0,Y.jsx)(z,{value:`outbound`,children:`outbound`}),(0,Y.jsx)(z,{value:`internal`,children:`internal`})]})]}),(0,Y.jsxs)(B,{value:c,onValueChange:l,children:[(0,Y.jsx)(M,{size:`sm`,children:(0,Y.jsx)(k,{})}),(0,Y.jsxs)(L,{children:[(0,Y.jsx)(z,{value:X,children:`Toutes sévérités`}),(0,Y.jsx)(z,{value:`info`,children:`info`}),(0,Y.jsx)(z,{value:`warn`,children:`warn`}),(0,Y.jsx)(z,{value:`critical`,children:`critical`})]})]})]}),(0,Y.jsx)(Nt,{fields:Jt,onChange:()=>{}}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,Y.jsx)(jt,{value:u,onChange:d})]})]})}),(0,Y.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,Y.jsxs)(_t,{children:[(0,Y.jsx)(vt,{asChild:!0,children:(0,Y.jsx)(O,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,Y.jsx)(N,{})})}),(0,Y.jsxs)(gt,{align:`start`,children:[(0,Y.jsx)(xt,{children:`Actions`}),(0,Y.jsx)(A,{}),(0,Y.jsx)(j,{children:`Edit`}),(0,Y.jsx)(j,{children:`Duplicate`}),(0,Y.jsx)(A,{}),(0,Y.jsx)(j,{variant:`destructive`,children:`Delete`})]})]})}),(0,Y.jsx)(Q,{title:`Card`,children:(0,Y.jsxs)(Dt,{className:`w-80`,children:[(0,Y.jsxs)(St,{children:[(0,Y.jsx)(Tt,{children:`Instance`}),(0,Y.jsx)(Et,{children:`Non-secret metadata only.`})]}),(0,Y.jsx)(wt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,Y.jsxs)(Ct,{className:`gap-2`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Save`}),(0,Y.jsx)(O,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,Y.jsx)(Q,{title:`Table`,children:(0,Y.jsxs)(At,{children:[(0,Y.jsx)(Ot,{children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{className:`w-8`,children:(0,Y.jsx)(I,{"aria-label":`select all`})}),(0,Y.jsx)(V,{children:`Name`}),(0,Y.jsx)(V,{children:`Mode`}),(0,Y.jsx)(V,{className:`text-right`,children:`Status`}),(0,Y.jsx)(V,{className:`w-8`})]})}),(0,Y.jsx)(kt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,Y.jsxs)(H,{children:[(0,Y.jsx)(U,{children:(0,Y.jsx)(I,{"aria-label":`select ${e.n}`})}),(0,Y.jsx)(U,{className:`font-medium`,children:e.n}),(0,Y.jsx)(U,{children:(0,Y.jsx)(P,{variant:`secondary`,children:e.m})}),(0,Y.jsx)(U,{className:`text-right`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,Y.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,Y.jsx)(N,{})})})]},e.n))})]})}),(0,Y.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,Y.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,Y.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,Y.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,Y.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,Y.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,Y.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,Y.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,Y.jsx)(`span`,{className:`oc-run-status__dot`}),(0,Y.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{un as ThemeShowroom};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Au as r,Cu as i,Du as a,Eu as o,Ou as s,Su as c,Tu as l,bu as u,ku as d,vu as f,wu as p,xu as m,yu as h}from"./dist-Cxz8d8g5.js";import{t as g}from"./button-BOkPsnkZ.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Au as r,Cu as i,Du as a,Eu as o,Ou as s,Su as c,Tu as l,bu as u,ku as d,vu as f,wu as p,xu as m,yu as h}from"./dist-Cxz8d8g5.js";import{t as g}from"./button-BOkPsnkZ.js";import{Ot as _,Z as v,ct as y,lt as b,st as x,ut as S,vt as C}from"./index-BlRMvXrJ.js";var w=t(e(),1),T={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function E(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=T[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function D(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:E(e.from,t)??t-T.h,to:E(e.to,t)??t}}var O=[{label:r(),from:`now-5m`},{label:d(),from:`now-15m`},{label:s(),from:`now-30m`},{label:a(),from:`now-1h`},{label:o(),from:`now-3h`},{label:l(),from:`now-6h`},{label:p(),from:`now-12h`},{label:i(),from:`now-24h`},{label:c(),from:`now-2d`},{label:m(),from:`now-7d`},{label:u(),from:`now-30d`},{label:h(),from:`now-90d`},{label:f(),from:`now-520w`}];function k(e){return new Date(e).toLocaleString(`fr-FR`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function A(e){if(e.kind===`relative`){let t=O.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${k(e.from)} → ${k(e.to)}`}function j(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 M(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function N(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var P=n();function F(e){let[t,n]=(0,w.useState)(0);return(0,w.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,w.useMemo)(()=>{let{from:t,to:n}=D(e);return e.kind===`absolute`?{from:t,to:n}:{from:I(t),to:I(n)}},[e,t])}function I(e){return Math.floor(e/6e4)*6e4}function L({value:e,onChange:t}){let[n,r]=(0,w.useState)(!1),[i,a]=(0,w.useState)(``),o=D(e),[s,c]=(0,w.useState)(()=>j(o.from)),[l,u]=(0,w.useState)(()=>j(o.to));function d(t){if(t){let t=D(e);c(j(t.from)),u(j(t.to)),a(``)}r(t)}function f(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function p(){let e=M(s),n=M(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let m=(0,w.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?O:O.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),h=M(s)!==null&&M(l)!==null;return(0,P.jsxs)(b,{open:n,onOpenChange:d,children:[(0,P.jsx)(S,{asChild:!0,children:(0,P.jsxs)(g,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,P.jsx)(_,{}),A(e)]})}),(0,P.jsx)(y,{children:(0,P.jsx)(x,{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,P.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,P.jsx)(`div`,{className:`oc-timerange__section-title`,children:`Plage absolue`}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`De`}),(0,P.jsx)(v,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,P.jsxs)(`label`,{className:`oc-field`,children:[(0,P.jsx)(`span`,{className:`oc-field__label`,children:`À`}),(0,P.jsx)(v,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,P.jsx)(g,{size:`sm`,className:`oc-timerange__apply`,disabled:!h,onClick:p,children:`Appliquer`})]}),(0,P.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,P.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,P.jsx)(C,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,P.jsx)(v,{value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher une plage`,"aria-label":`Rechercher une plage relative`})]}),(0,P.jsx)(`ul`,{className:`oc-timerange__list`,children:m.length===0?(0,P.jsx)(`li`,{className:`oc-timerange__empty`,children:`Aucune plage.`}):m.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>f(t.from),children:t.label})},t.from))})]})]})})})]})}export{F as n,N as r,L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$f as i,Ab as a,Ap as o,Bb as s,Cp as c,Dp as l,EO as u,Ep as d,Fb as f,Hb as p,Ib as m,Jb as h,Jf as g,Lb as _,Mb as v,Mp as y,Nb as ee,Op as te,Pb as b,Qb as x,Qf as ne,Rb as S,Sp as re,TO as C,Tp as ie,Ub as ae,Vb as w,Xb as oe,Xf as se,Yb as T,Yf as ce,Zb as le,Zf as ue,_p as de,_x as fe,ap as pe,ax as E,bO as D,bp as me,cp as he,cx as O,dp as ge,dx as k,ep as _e,ex as A,fp as ve,fx as j,gp as ye,gx as M,hp as be,hx as N,ip as xe,ix as P,jb as F,jp as Se,kb as I,kp as Ce,lp as we,lx as Te,mp as Ee,mx as De,np as Oe,nx as ke,op as Ae,ox as L,pp as je,px as Me,rp as Ne,rx as Pe,sp as Fe,sx as Ie,tp as Le,tx as Re,up as ze,ux as Be,vp as Ve,vx as He,wp as Ue,xp as We,yO as R,yp as Ge,zb as Ke}from"./dist-Cxz8d8g5.js";import{n as qe}from"./dist-CRGyTqMI.js";import{t as Je}from"./x-BimfpZdd.js";import{i as z,n as B,r as Ye,t as Xe}from"./tabs-CVbQ8jlY.js";import{t as V}from"./button-BOkPsnkZ.js";import{$ as Ze,C as H,Ct as Qe,Dt as $e,Mt as et,Q as tt,S as U,X as W,a as nt,b as G,et as rt,i as it,jt as at,k as ot,nt as st,o as ct,ot as lt,r as ut,rt as dt,wt as ft,x as K,y as q}from"./index-Cs-A4Qz2.js";import{n as pt}from"./TimeRangePicker-Cm-XSScp.js";import{t as mt}from"./FilterBar-BToerIZw.js";import{t as ht}from"./AdvancedFilter-B0eHnjhM.js";import{t as gt}from"./DataTableShell-_imgfnfL.js";var _t=D(`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`}]]),vt=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`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function yt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),i=e.slice(t+1);return n===`admin`?r():n===`agent`?`${x()} - ${i}`:e}function bt(){let e=u(R.me.getMe,{host:lt})?.role===`admin`,t=u(R.deliveryTiming.getDeliveryStatus,{}),n=C(R.deliveryTiming.startDeliveryRecord),r=C(R.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!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:He()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:fe()})]}),e?(0,Y.jsx)(V,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?N():M()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:De()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Me({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Be():k()})}),i?(0,Y.jsx)(xt,{isAdmin:e}):null]})}function xt({isAdmin:e}){let t=u(R.deliveryTiming.listDeliverySessions,{}),n=C(R.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:p,to:m}=pt(c),h=c.to===`now`?1/0:m,g=r.trim()!==``||o!==`all`||c!==X,_=()=>{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>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,o,p,h]),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)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(mt,{q:r,onQChange:i,searchPlaceholder:O(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,Y.jsxs)(q,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:`all`,children:Ie()}),(0,Y.jsx)(K,{value:`active`,children:L()}),(0,Y.jsx)(K,{value:`stopped`,children:E()})]})]})}),(0,Y.jsx)(gt,{title:Te(),rows:v,emptyHint:a(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(V,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?oe():le(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(_t,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ft,{size:15,"aria-hidden":!0})})},{header:P(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:Pe(),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:new Date(e.stoppedAt).toLocaleString()})},{header:ke(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:Re(),sort:e=>e.startedBy,cell:e=>yt(e.startedBy)},{header:A(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:L()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:E()})}],rowActions:e?e=>[{label:T(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:T(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(St,{sessionId:e.sessionId})})]})}function St({sessionId:e}){let t=u(R.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ct,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(ot(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ct({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:h()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:j()});let r=e.segments,i=(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,` `,I()]}),(0,Y.jsxs)(V,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(qe,{size:13,"aria-hidden":!0}):(0,Y.jsx)($e,{size:13,"aria-hidden":!0}),t?F():v()]})]}),(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:w()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:s()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ke()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(S(),r.bridge),i(_(),r.A),i(m(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:f()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:b()})]})}var wt=[50,100,200,500],Tt=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=et({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,f=e.direction??Q,m=e.roleKey??Q,h=e.q??``,g=ut(e.from,e.to),_=(0,J.useMemo)(()=>ct(e.adv),[e.adv]),{from:v,to:ee}=pt(g),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),oe=e=>void t({search:t=>({...t,kind:e})}),se=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),T=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ce=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),le=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,...nt(e)})}),D=e=>void t({search:t=>({...t,adv:it(e)}),replace:!0}),O=u(R.observability.listEvents,{limit:n}),k=u(R.observability.listEvents,{limit:n,kind:r===Tt?void 0:r,filter:{q:h||void 0,from:v,to:ee,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:f===Q?void 0:f,roleKey:m===Q?void 0:m,advanced:_.length>0?_:void 0}}),A=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])e.add(t.kind);return[...e].sort()},[O]),j=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[O]),M=h!==``||a!==Q||s!==Q||f!==Q||m!==Q||_.length>0||g.kind!==`relative`||g.from!==kt.from;function N(){t({search:{limit:100,kind:`all`},replace:!0})}let P=b?O?.filter(e=>e.correlationId===b):k,[F,I]=(0,J.useState)(`events`);return(0,Y.jsxs)(Xe,{value:F,onValueChange:e=>I(e),children:[(0,Y.jsxs)(Ye,{className:`w-full`,children:[(0,Y.jsxs)(z,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Qe,{size:13,"aria-hidden":!0}),ae()]}),(0,Y.jsxs)(z,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),p()]})]}),(0,Y.jsx)(B,{value:`latency`,children:(0,Y.jsx)(bt,{})}),(0,Y.jsxs)(B,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[y(),(0,Y.jsx)(`strong`,{children:Se()}),o(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Ce()})]}),(0,Y.jsxs)(mt,{q:h,onQChange:se,searchPlaceholder:te(),timeRange:g,onTimeRangeChange:E,onReset:N,canReset:M,children:[(0,Y.jsxs)(q,{value:a,onValueChange:T,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:l()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:d()}),Et.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:s,onValueChange:ce,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:ie()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:Ue()}),Dt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:f,onValueChange:le,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:c()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:re()}),Ot.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:m,onValueChange:fe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{placeholder:We()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:me()}),j.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:r,onValueChange:oe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(H,{placeholder:Ge()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Tt,children:Ve()}),A.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:wt.map(e=>(0,Y.jsx)(K,{value:String(e),children:de({count:e})},e))})]})]}),(0,Y.jsx)(ht,{fields:At,seed:_,onChange:D}),b?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:ye(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[be(),(0,Y.jsx)(`code`,{children:$(b)})]}),(0,Y.jsx)(Je,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ee()})]})}):null,(0,Y.jsx)(gt,{title:je(),rows:P,emptyHint:b?ve():ge(),columns:[{header:ze(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:we(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:he(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(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":Fe(),children:`✓`})}},{header:Ae(),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:pe(),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:xe(),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:Ne(),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:Oe(),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 ${Mt(e.status)}`,children:e.status})},{header:Le(),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:_e(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:i(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ne(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:ue()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(Pt,{row:S,onClose:()=>C(null)})]})]})}function Mt(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 Nt(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 Pt({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)(tt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(Ze,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(dt,{className:`oc-traces__meta-title`,children:[se(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:ce()})]}),(0,Y.jsx)(rt,{children:g()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$f as i,Ab as a,Ap as o,Bb as s,Cp as c,Dp as l,EO as u,Ep as d,Fb as f,Hb as p,Ib as m,Jb as h,Jf as g,Lb as _,Mb as v,Mp as y,Nb as ee,Op as te,Pb as b,Qb as x,Qf as ne,Rb as S,Sp as re,TO as C,Tp as ie,Ub as ae,Vb as w,Xb as oe,Xf as se,Yb as T,Yf as ce,Zb as le,Zf as ue,_p as de,_x as fe,ap as pe,ax as E,bO as D,bp as me,cp as he,cx as O,dp as ge,dx as k,ep as _e,ex as A,fp as ve,fx as j,gp as ye,gx as M,hp as be,hx as N,ip as xe,ix as P,jb as F,jp as Se,kb as I,kp as Ce,lp as we,lx as Te,mp as Ee,mx as De,np as Oe,nx as ke,op as Ae,ox as L,pp as je,px as Me,rp as Ne,rx as Pe,sp as Fe,sx as Ie,tp as Le,tx as Re,up as ze,ux as Be,vp as Ve,vx as He,wp as Ue,xp as We,yO as R,yp as Ge,zb as Ke}from"./dist-Cxz8d8g5.js";import{n as qe}from"./dist-CRGyTqMI.js";import{t as Je}from"./x-BimfpZdd.js";import{i as z,n as B,r as Ye,t as Xe}from"./tabs-DT8VXxMj.js";import{t as V}from"./button-BOkPsnkZ.js";import{$ as Ze,C as H,Ct as Qe,Dt as $e,Mt as et,Q as tt,S as U,X as W,a as nt,b as G,et as rt,i as it,jt as at,k as ot,nt as st,o as ct,ot as lt,r as ut,rt as dt,wt as ft,x as K,y as q}from"./index-BlRMvXrJ.js";import{n as pt}from"./TimeRangePicker-CFCLAlKB.js";import{t as mt}from"./FilterBar-B_mSpGb-.js";import{t as ht}from"./AdvancedFilter-DnGyDWXx.js";import{t as gt}from"./DataTableShell-y4F1v6a9.js";var _t=D(`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`}]]),vt=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`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function yt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),i=e.slice(t+1);return n===`admin`?r():n===`agent`?`${x()} - ${i}`:e}function bt(){let e=u(R.me.getMe,{host:lt})?.role===`admin`,t=u(R.deliveryTiming.getDeliveryStatus,{}),n=C(R.deliveryTiming.startDeliveryRecord),r=C(R.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!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:He()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:fe()})]}),e?(0,Y.jsx)(V,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?N():M()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:De()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Me({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Be():k()})}),i?(0,Y.jsx)(xt,{isAdmin:e}):null]})}function xt({isAdmin:e}){let t=u(R.deliveryTiming.listDeliverySessions,{}),n=C(R.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[c,l]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:p,to:m}=pt(c),h=c.to===`now`?1/0:m,g=r.trim()!==``||o!==`all`||c!==X,_=()=>{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>=p&&t.startedAt<=h).map(e=>({...e,_id:e.sessionId}))},[t,r,o,p,h]),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)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(mt,{q:r,onQChange:i,searchPlaceholder:O(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,Y.jsxs)(q,{value:o,onValueChange:e=>s(e),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:`all`,children:Ie()}),(0,Y.jsx)(K,{value:`active`,children:L()}),(0,Y.jsx)(K,{value:`stopped`,children:E()})]})]})}),(0,Y.jsx)(gt,{title:Te(),rows:v,emptyHint:a(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(V,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?oe():le(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(_t,{size:15,"aria-hidden":!0}):(0,Y.jsx)(ft,{size:15,"aria-hidden":!0})})},{header:P(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:Pe(),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:new Date(e.stoppedAt).toLocaleString()})},{header:ke(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:Re(),sort:e=>e.startedBy,cell:e=>yt(e.startedBy)},{header:A(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:L()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:E()})}],rowActions:e?e=>[{label:T(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:T(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(St,{sessionId:e.sessionId})})]})}function St({sessionId:e}){let t=u(R.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ct,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(ot(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ct({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:h()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:j()});let r=e.segments,i=(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,` `,I()]}),(0,Y.jsxs)(V,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(qe,{size:13,"aria-hidden":!0}):(0,Y.jsx)($e,{size:13,"aria-hidden":!0}),t?F():v()]})]}),(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:w()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:s()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ke()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(S(),r.bridge),i(_(),r.A),i(m(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:f()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:b()})]})}var wt=[50,100,200,500],Tt=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=et({from:`/settings/traces`}),t=at({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,s=e.principalType??Q,f=e.direction??Q,m=e.roleKey??Q,h=e.q??``,g=ut(e.from,e.to),_=(0,J.useMemo)(()=>ct(e.adv),[e.adv]),{from:v,to:ee}=pt(g),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),oe=e=>void t({search:t=>({...t,kind:e})}),se=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),T=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ce=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),le=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,...nt(e)})}),D=e=>void t({search:t=>({...t,adv:it(e)}),replace:!0}),O=u(R.observability.listEvents,{limit:n}),k=u(R.observability.listEvents,{limit:n,kind:r===Tt?void 0:r,filter:{q:h||void 0,from:v,to:ee,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:f===Q?void 0:f,roleKey:m===Q?void 0:m,advanced:_.length>0?_:void 0}}),A=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])e.add(t.kind);return[...e].sort()},[O]),j=(0,J.useMemo)(()=>{let e=new Set;for(let t of O??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[O]),M=h!==``||a!==Q||s!==Q||f!==Q||m!==Q||_.length>0||g.kind!==`relative`||g.from!==kt.from;function N(){t({search:{limit:100,kind:`all`},replace:!0})}let P=b?O?.filter(e=>e.correlationId===b):k,[F,I]=(0,J.useState)(`events`);return(0,Y.jsxs)(Xe,{value:F,onValueChange:e=>I(e),children:[(0,Y.jsxs)(Ye,{className:`w-full`,children:[(0,Y.jsxs)(z,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Qe,{size:13,"aria-hidden":!0}),ae()]}),(0,Y.jsxs)(z,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),p()]})]}),(0,Y.jsx)(B,{value:`latency`,children:(0,Y.jsx)(bt,{})}),(0,Y.jsxs)(B,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[y(),(0,Y.jsx)(`strong`,{children:Se()}),o(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Ce()})]}),(0,Y.jsxs)(mt,{q:h,onQChange:se,searchPlaceholder:te(),timeRange:g,onTimeRangeChange:E,onReset:N,canReset:M,children:[(0,Y.jsxs)(q,{value:a,onValueChange:T,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:l()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:d()}),Et.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:s,onValueChange:ce,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:ie()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:Ue()}),Dt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:f,onValueChange:le,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:c()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:re()}),Ot.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:m,onValueChange:fe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{placeholder:We()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Q,children:me()}),j.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:r,onValueChange:oe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(H,{placeholder:Ge()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(K,{value:Tt,children:Ve()}),A.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:wt.map(e=>(0,Y.jsx)(K,{value:String(e),children:de({count:e})},e))})]})]}),(0,Y.jsx)(ht,{fields:At,seed:_,onChange:D}),b?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:ye(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[be(),(0,Y.jsx)(`code`,{children:$(b)})]}),(0,Y.jsx)(Je,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ee()})]})}):null,(0,Y.jsx)(gt,{title:je(),rows:P,emptyHint:b?ve():ge(),columns:[{header:ze(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:we(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:he(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(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":Fe(),children:`✓`})}},{header:Ae(),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:pe(),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:xe(),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:Ne(),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:Oe(),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 ${Mt(e.status)}`,children:e.status})},{header:Le(),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:_e(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:i(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ne(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(V,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:ue()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(Pt,{row:S,onClose:()=>C(null)})]})]})}function Mt(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 Nt(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 Pt({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)(tt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(Ze,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(dt,{className:`oc-traces__meta-title`,children:[se(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:ce()})]}),(0,Y.jsx)(rt,{children:g()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,B_ as i,EO as a,G_ as o,H_ as s,J_ as c,K_ as l,Q_ as u,TO as d,U_ as f,V_ as ee,W_ as te,X_ as ne,Y_ as re,Z_ as p,_f as m,av as ie,b_ as ae,bf as h,cf as g,cv as _,df as v,dv as y,ev as oe,ff as b,fv as x,gf as S,hf as C,iv as se,lf as w,lv as ce,mf as T,nv as le,ov as ue,pf as E,pv as D,q_ as O,rv as de,sv as fe,tv as pe,uf as k,uv as me,vf as A,yO as j,yf as M,z_ as he}from"./dist-Cxz8d8g5.js";import{t as N}from"./button-BOkPsnkZ.js";import{$ as P,A as F,C as I,G as L,K as R,M as ge,Mt as _e,Q as z,S as B,W as V,X as H,Y as ve,_ as U,_t as W,b as G,d as K,et as ye,f as be,gt as q,j as xe,jt as Se,nt as Ce,ot as we,p as J,q as Te,rt as Ee,x as Y,y as X}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,B_ as i,EO as a,G_ as o,H_ as s,J_ as c,K_ as l,Q_ as u,TO as d,U_ as f,V_ as ee,W_ as te,X_ as ne,Y_ as re,Z_ as p,_f as m,av as ie,b_ as ae,bf as h,cf as g,cv as _,df as v,dv as y,ev as oe,ff as b,fv as x,gf as S,hf as C,iv as se,lf as w,lv as ce,mf as T,nv as le,ov as ue,pf as E,pv as D,q_ as O,rv as de,sv as fe,tv as pe,uf as k,uv as me,vf as A,yO as j,yf as M,z_ as he}from"./dist-Cxz8d8g5.js";import{t as N}from"./button-BOkPsnkZ.js";import{$ as P,A as F,C as I,G as L,K as R,M as ge,Mt as _e,Q as z,S as B,W as V,X as H,Y as ve,_ as U,_t as W,b as G,d as K,et as ye,f as be,gt as q,j as xe,jt as Se,nt as Ce,ot as we,p as J,q as Te,rt as Ee,x as Y,y as X}from"./index-BlRMvXrJ.js";import{t as De}from"./FilterBar-B_mSpGb-.js";import{t as Oe}from"./DataTableShell-y4F1v6a9.js";import{t as ke}from"./DetailChips-BFrPLaU7.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=a(j.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=a(j.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(o??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!u.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,state:e.state,outOfPool:!0}))],f=new Map;for(let e of d){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,Q.jsx)(z,{open:n,onOpenChange:r,children:(0,Q.jsxs)(P,{className:`oc-access`,children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:h({user:t})}),(0,Q.jsx)(ye,{children:M()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?A():m()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:S()}):d.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:E()}):[...f.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:l},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=d(j.agents.assignAgent),s=d(j.agents.removeAgent),c=d(j.agents.setDefaultAgent),l=F();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(C(),e)}}async function f(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(T(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(H,{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`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(U,{checked:r,disabled:s&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":b({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:v()}):null,e.outOfPool?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:k()}):null,r?o?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":w(),title:w(),children:(0,Q.jsx)(q,{size:14,fill:`currentColor`})}):(0,Q.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":g(),title:g(),onClick:()=>void f(e.agentId),children:(0,Q.jsx)(q,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=K.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(V,{children:[(0,Q.jsx)(ve,{asChild:!0,children:(0,Q.jsx)(N,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?D():x({count:r})})}),(0,Q.jsxs)(L,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:y()}),K.map(e=>{let r=J[e];return(0,Q.jsxs)(R,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(U,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:be[e]??e})]},e)})]})]})}function Ne(){let e=_e({from:`/settings/users`}),t=Se({from:`/settings/users`}),n=e.q??``,m=e.role??$,h=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),g=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),v=a(j.admin.listUsers,{filter:{q:n||void 0,role:m===$?void 0:m},withAgents:!0}),y=a(j.me.getMe,{host:we}),b=d(j.admin.setRole),x=d(j.admin.setUserPermissions),S=d(j.admin.startImpersonation),C=d(j.admin.deleteUser),w=d(j.admin.setUserName),T=xe(),E=ge(),D=F(),[k,A]=(0,Z.useState)(null),M=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of v??[])e.add(t.role);return[...e]},[v]),N=n!==``||m!==$;function P(){t({search:{},replace:!0})}async function L(e){try{await b(e)}catch(e){D.error(me(),e)}}async function R(e){try{await x(e)}catch(e){D.error(ce(),e)}}async function z(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await T({title:le(),description:pe({user:t}),confirmWord:oe(),confirmLabel:r(),destructive:!0}))try{await C({profileId:e._id}),D.success(p({user:t}))}catch(e){D.error(u(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await E({title:re(),label:c({user:t}),placeholder:O(),defaultValue:e.name??``,confirmLabel:ae()});if(n!==null)try{await w({profileId:e._id,name:n}),D.success(l())}catch(e){D.error(o(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:h,searchPlaceholder:_(),onReset:P,canReset:N,children:(0,Q.jsxs)(X,{value:m,onValueChange:g,children:[(0,Q.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:$,children:fe()}),M.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:ue(),rows:v,emptyHint:ie(),rowActions:e=>{let t=[{label:he(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:ne(),onSelect:()=>void V(e)}];return e.userId!==y?.userId&&t.push({label:se(),onSelect:()=>void S({profileId:e._id})},{label:de(),variant:`destructive`,onSelect:()=>void z(e)}),t},columns:[{header:te(),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,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:t}),n?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:f(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void L({profileId:e._id,role:t}),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:`pending`,children:`pending`}),(0,Q.jsx)(Y,{value:`user`,children:`user`}),(0,Q.jsx)(Y,{value:`admin`,children:`admin`})]})]})},{header:s(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:ee()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),R({profileId:e._id,permissions:[...n]})}})},{header:i(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(W,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Q.jsx)(Ae,{profileId:k?.profileId??null,userLabel:k?.label??``,open:k!==null,onOpenChange:e=>{e||A(null)}})]})}export{Ne as UsersTab};
|
package/dist/assets/{highlighted-body-OFNGDK62-BMbd79DX.js → highlighted-body-OFNGDK62-D8Rm1ZUS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{E as r,T as i,w as a}from"./index-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{E as r,T as i,w as a}from"./index-BlRMvXrJ.js";var o=t(e(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(r),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(a,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
|