@lacneu/atrium 0.85.0 → 0.85.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-CJCDBiaW.js → AccessTab-ywlRqoTS.js} +1 -1
- package/dist/assets/{AdvancedFilter-CmqNZu_M.js → AdvancedFilter-CO3ZakuW.js} +1 -1
- package/dist/assets/AgentFilesTab-CvXCF_f1.js +3 -0
- package/dist/assets/AnomaliesTab-BMfAE9Qr.js +1 -0
- package/dist/assets/AuditTab-BehmjVX5.js +1 -0
- package/dist/assets/BridgeTab-DKBERQMd.js +1 -0
- package/dist/assets/ChatDefaultsTab-C8FtADCX.js +1 -0
- package/dist/assets/{DataTableShell-Bp21I3Sa.js → DataTableShell-BzQgqnDl.js} +1 -1
- package/dist/assets/{DetailChips-C-bSKLSo.js → DetailChips-CDv5mOES.js} +1 -1
- package/dist/assets/FeedbacksTab-DQcwy0Me.js +1 -0
- package/dist/assets/{FieldLabel-DnoUrdP6.js → FieldLabel-vGVJ37ds.js} +1 -1
- package/dist/assets/FilesTab-DeGdJZGF.js +1 -0
- package/dist/assets/{FilterBar-BEH_6bM0.js → FilterBar-CGSxi-Sq.js} +1 -1
- package/dist/assets/{GroupsTab-2S4-4DEw.js → GroupsTab-x0erQjsA.js} +1 -1
- package/dist/assets/InstancesTab-CnKKPdic.js +1 -0
- package/dist/assets/IntegrationsTab-BZw_cojT.js +1 -0
- package/dist/assets/KpiTab-S-L5_TFu.js +1 -0
- package/dist/assets/PreferencesTab-DUVgQOJg.js +1 -0
- package/dist/assets/ProjectPage-BOCy2rBV.js +1 -0
- package/dist/assets/PromptInjectionsTab-D4Fidxot.js +4 -0
- package/dist/assets/RolesTab-Cz26-VUr.js +1 -0
- package/dist/assets/ScheduledTab-0Y-eXTYR.js +1 -0
- package/dist/assets/ServiceAccountsTab-Ca9wLDNe.js +1 -0
- package/dist/assets/{SubAgentReportsTab-CGIgLHbU.js → SubAgentReportsTab-PgfR3Za8.js} +1 -1
- package/dist/assets/ThemeShowroom-CHxCts7H.js +1 -0
- package/dist/assets/{TimeRangePicker-BLR06n4q.js → TimeRangePicker-DIGmrYqi.js} +1 -1
- package/dist/assets/{TimezoneCombobox-BCW5wGMI.js → TimezoneCombobox-CkPBJSKF.js} +1 -1
- package/dist/assets/TracesTab-BXHNDCiG.js +1 -0
- package/dist/assets/UsersTab-BtRT9A-D.js +1 -0
- package/dist/assets/VoiceTab-DdNwsqNA.js +1 -0
- package/dist/assets/{api-BQ0aanqI.js → api-D7og-4qA.js} +5 -5
- package/dist/assets/{button-fRwanC8A.js → button-Ch1cRvCe.js} +1 -1
- package/dist/assets/{card-32xKkcxL.js → card-B1-0rWzO.js} +1 -1
- package/dist/assets/chevrons-up-down-DIadyetY.js +1 -0
- package/dist/assets/{compatView-DpGQyRLb.js → compatView-BWt5iAM2.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-ewyxlsi8.js → dispatchErrorInfo-wT9RzbRF.js} +1 -1
- package/dist/assets/{dist-1AiitW4a.js → dist-B-EkxEVF.js} +1 -1
- package/dist/assets/{dist-D0h7Lxln.js → dist-CKlOMNhM.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-VT1ZCfFj.js → highlighted-body-OFNGDK62-C65VoJ0F.js} +1 -1
- package/dist/assets/index-Dn5iHsqH.js +324 -0
- package/dist/assets/{list-Xw7SYbpI.js → list-CJY1g2_K.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-DWyfHcK6.js +1 -0
- package/dist/assets/{pdf-8l00TRRt.js → pdf-DUS0iuq7.js} +1 -1
- package/dist/assets/roleDescriptions-BkEeX-KS.js +1 -0
- package/dist/assets/{table-C-VvV11v.js → table-CKpkQP4H.js} +1 -1
- package/dist/assets/{tabs-2ZLK5UDX.js → tabs-CnkwmnFT.js} +1 -1
- package/dist/assets/x-bVQAMbfU.js +1 -0
- package/dist/index.html +6 -6
- package/package.json +1 -1
- package/dist/assets/AgentFilesTab-BYc1XpJg.js +0 -3
- package/dist/assets/AnomaliesTab-YiqG3uTQ.js +0 -1
- package/dist/assets/AuditTab-CZc-pW3U.js +0 -1
- package/dist/assets/BridgeTab-BT_BSF0n.js +0 -1
- package/dist/assets/ChatDefaultsTab-BsdSiwzt.js +0 -1
- package/dist/assets/FeedbacksTab-BavteSVK.js +0 -1
- package/dist/assets/FilesTab-DeTXsMYY.js +0 -1
- package/dist/assets/InstancesTab-DRjDvQO7.js +0 -1
- package/dist/assets/IntegrationsTab-CSQ5cpiN.js +0 -1
- package/dist/assets/KpiTab-BiAeSW0t.js +0 -1
- package/dist/assets/PreferencesTab-CnSX4xnB.js +0 -1
- package/dist/assets/ProjectPage-B93d6umO.js +0 -1
- package/dist/assets/PromptInjectionsTab-BfDEavXd.js +0 -4
- package/dist/assets/RolesTab-BZUOID8F.js +0 -1
- package/dist/assets/ScheduledTab-DJI1Ac4s.js +0 -1
- package/dist/assets/ServiceAccountsTab-SOt-hQlx.js +0 -1
- package/dist/assets/ThemeShowroom-C2eibc63.js +0 -1
- package/dist/assets/TracesTab-D7B43r0e.js +0 -1
- package/dist/assets/UsersTab-V_UeO7PH.js +0 -1
- package/dist/assets/VoiceTab-CHeITVsx.js +0 -1
- package/dist/assets/chevrons-up-down-C0r-kzFc.js +0 -1
- package/dist/assets/index-BaLBFCJc.js +0 -324
- package/dist/assets/mermaid-GHXKKRXX-BArof1-6.js +0 -1
- package/dist/assets/roleDescriptions-B5VpfCW5.js +0 -1
- package/dist/assets/x-B3RY_hjS.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$L as r,$R as i,AR as a,Au as o,BR as s,CR as c,DR as l,ER as u,FR as d,GR as f,HH as p,HR as m,IR as h,JR as g,KR as _,LR as v,MR as y,Mu as b,NR as ee,Nu as x,OR as te,PR as ne,QH as re,QL as ie,QR as ae,RR as oe,SR as se,TR as ce,UH as le,UR as ue,VR as de,WH as fe,WR as pe,XL as me,XR as he,YR as ge,ZL as _e,ZR as ve,_R as ye,_z as be,aR as xe,az as Se,bR as Ce,cR as we,cz as S,dR as Te,dz as Ee,eR as C,eU as w,ez as De,fR as Oe,fz as ke,gR as T,gz as Ae,hR as je,hz as Me,iR as E,iz as Ne,jR as Pe,ju as Fe,kR as Ie,lR as Le,lz as Re,mR as ze,mz as Be,nR as Ve,nz as He,oR as Ue,oz as We,pR as Ge,pz as Ke,qR as qe,r as Je,rR as Ye,rz as Xe,sR as Ze,sz as Qe,t as D,tR as $e,tU as O,tz as et,uR as tt,uz as nt,vR as rt,vz as it,wR as at,xR as ot,yR as st,zR as ct}from"./api-BQ0aanqI.js";import{t as k}from"./x-B3RY_hjS.js";import{t as A}from"./button-fRwanC8A.js";import{$ as j,Et as M,Fn as N,Ft as lt,G as ut,In as dt,It as P,K as ft,Lt as pt,Mt as mt,Nt as ht,Pt as F,Q as I,Wn as L,X as R,Z as z,et as B,jt as V,ln as H,q as U,ut as W}from"./index-BaLBFCJc.js";import{t as gt}from"./localePickerView-C2RmOS86.js";import{a as _t,i as vt,n as yt,o as bt,r as xt,t as St}from"./card-32xKkcxL.js";import{a as Ct,i as G,n as wt,o as K,r as q,t as Tt}from"./table-C-VvV11v.js";import{t as Et}from"./TimeRangePicker-BLR06n4q.js";import{t as Dt}from"./FilterBar-BEH_6bM0.js";import{t as Ot}from"./AdvancedFilter-CmqNZu_M.js";var J=t(e(),1),kt=.1,At=[248,248,248],jt=[24,24,24];function Mt(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 Nt(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 Pt(e,t,n){return Nt(e,t,n)>=kt}function Ft(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 It(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 Lt=12*1024*1024,Rt=480,zt=160,Bt=.92;async function Vt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(st());if(e.size>Lt)throw Error(rt());let{source:n,width:r,height:i,cleanup:a}=await Ht(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Rt/r,zt/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(T());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Mt(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(T());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);Pt(e.data,d.width,d.height)?Ft(e.data,t.variantFor===`dark`?At:jt):It(e.data),p.putImageData(e,0,0)}let m=Pt(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Bt)??await Y(f,`image/png`);if(!h)throw Error(je());return{blob:h,hasAlpha:m}}finally{a()}}async function Ht(e){if(e.type===`image/svg+xml`)return Ut(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 Ut(e)}async function Ut(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(ye())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Wt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Gt={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?fe():e===`dark`?le():p()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Je(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(L,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":x(),title:x(),children:(0,X.jsx)(dt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=O(D.charts.listMyCharts),r=w(D.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:nt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:S(),subtitle:Qe(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?We():n.via===`owner`?Se():Ne({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Wt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()}):null]})}function Qt(){let e=w(D.charts.importChart),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[c,l]=(0,J.useState)(!1),[u,f]=(0,J.useState)(!1);async function p(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),l(!1);try{i(await t.text())}catch{o(d())}}}async function g(){if(o(null),l(!1),t.trim()===``){o(ee());return}let a;try{a=JSON.parse(r)}catch{o(d());return}f(!0);try{await e({name:t.trim(),tokens:a}),l(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:de()}),(0,X.jsx)(V,{value:t,onChange:e=>n(e.target.value),placeholder:s(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ct()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:oe(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(H,{className:`size-4`}),v(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void p(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:u,onClick:()=>void g(),children:h()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:ne()}):null]})]})}function $t({chart:e}){let t=re(D.charts.setChartLogo),n=w(D.charts.removeChartLogo),[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function d(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Vt(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 f(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await d(e,n)}async function p(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 m(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await d(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function h({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?u():ce()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(H,{className:`size-4`}),t?c():at(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void f(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void m(e),children:ot()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:se()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:l()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(h,{mode:`light`}),(0,X.jsx)(h,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ce()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=O(D.me.getMe,{host:U}),n=w(D.charts.addChartDomain),r=w(D.charts.removeChartDomain),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,l]=(0,J.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,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ze()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:tt()}):u.map(e=>(0,X.jsxs)(M,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Le({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(V,{value:i,onChange:e=>a(e.target.value),placeholder:Oe(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:Te()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ge()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function $(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function tn({chart:e}){let t=w(D.charts.updateChart),n=w(D.charts.deleteChart),[r,i]=(0,J.useState)(!1),[a,s]=(0,J.useState)(e.name),[c,l]=(0,J.useState)(()=>$(e.tokens)),[u,f]=(0,J.useState)(e.tokens.bpm??0),[p,m]=(0,J.useState)(null),[h,g]=(0,J.useState)(!1);function _(){s(e.name),l($(e.tokens)),f(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(d());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:a.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(E()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:_,children:Ie()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:te()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ue()}),(0,X.jsx)(V,{value:a,onChange:e=>s(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:b()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>f(Number(e.target.value)),"aria-label":b()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?Fe():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:o()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:xe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:h,onClick:()=>void v(),children:we()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Ze()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function nn(){let e=O(D.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:y()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:a()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(tn,{chart:e},e.key))})]})}function rn({chart:e,groups:t}){let n=w(D.charts.addChartToGroupPool),r=w(D.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(M,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?ge():e.kind===`custom`&&e.scope===`personal`?C():he()}),e.isGlobalDefault?(0,X.jsx)(M,{variant:`default`,children:g()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:_()}),(a??[]).map(e=>(0,X.jsxs)(M,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":pe({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(j,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:f()})}),(0,X.jsx)(z,{children:s.map(e=>(0,X.jsx)(I,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:qe()}):null]})]})}function an({chart:e}){let t=w(D.charts.promoteChartToCommon),n=w(D.charts.deleteChart);async function i(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function a(){if(e.chartId!==void 0&&window.confirm(E()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(M,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?r():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void i(),children:ie()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void a(),children:_e()})]})]})}function on({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=w(D.admin.setDefaultThemeMode),a=w(D.admin.setDefaultLocale),o=w(D.charts.setDefaultChart),s=O(D.charts.listChartsAdmin),c=O(D.groups.listGroups,{}),l=e??`system`,u=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ke()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ee()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:He()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:S()}),ft.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:De()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(rn,{chart:e,groups:c??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(an,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:it()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:be()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Me()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:gt().map(e=>(0,X.jsx)(A,{variant:u===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]})]})}function sn(){let e=O(D.me.getMe,{host:U}),t=ut(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(nn,{}),e?.role===`admin`?(0,X.jsx)(on,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function cn(){let[e,t]=(0,J.useState)(!0),[n,r]=(0,J.useState)(`per-user`),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(Z),[c,l]=(0,J.useState)(Z),[u,d]=(0,J.useState)(Gt),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Gt)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(sn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Ke()}),(0,X.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)(Q,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(M,{children:`Default`}),(0,X.jsx)(M,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(M,{variant:`outline`,children:`Outline`}),(0,X.jsx)(M,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)(Q,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(V,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(j,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(I,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(I,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(W,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)(Q,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(Dt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(j,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(I,{value:Z,children:`Toutes directions`}),(0,X.jsx)(I,{value:`inbound`,children:`inbound`}),(0,X.jsx)(I,{value:`outbound`,children:`outbound`}),(0,X.jsx)(I,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(j,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(I,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(I,{value:`info`,children:`info`}),(0,X.jsx)(I,{value:`warn`,children:`warn`}),(0,X.jsx)(I,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(Ot,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(Et,{value:u,onChange:d})]})]})}),(0,X.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(mt,{children:[(0,X.jsx)(pt,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(lt,{children:`Actions`}),(0,X.jsx)(P,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(P,{}),(0,X.jsx)(F,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)(Q,{title:`Card`,children:(0,X.jsxs)(St,{className:`w-80`,children:[(0,X.jsxs)(_t,{children:[(0,X.jsx)(bt,{children:`Instance`}),(0,X.jsx)(xt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(yt,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(vt,{className:`gap-2`,children:[(0,X.jsx)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)(Q,{title:`Table`,children:(0,X.jsxs)(Tt,{children:[(0,X.jsx)(Ct,{children:(0,X.jsxs)(K,{children:[(0,X.jsx)(G,{className:`w-8`,children:(0,X.jsx)(W,{"aria-label":`select all`})}),(0,X.jsx)(G,{children:`Name`}),(0,X.jsx)(G,{children:`Mode`}),(0,X.jsx)(G,{className:`text-right`,children:`Status`}),(0,X.jsx)(G,{className:`w-8`})]})}),(0,X.jsx)(wt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(K,{children:[(0,X.jsx)(q,{children:(0,X.jsx)(W,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(q,{className:`font-medium`,children:e.n}),(0,X.jsx)(q,{children:(0,X.jsx)(M,{variant:`secondary`,children:e.m})}),(0,X.jsx)(q,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(L,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(q,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{cn as ThemeShowroom};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AM as i,AT as a,BM as o,CT as s,D as c,DM as l,DT as u,ET as d,FM as f,GM as p,HM as m,IM as h,JM as g,KM as _,LM as ee,MM as v,MT as y,NM as b,OM as x,OT as S,PM as C,Qw as w,RM as T,SM as E,ST as te,TT as ne,UM as re,VM as ie,WM as ae,XM as oe,Xw as se,YM as D,Yw as O,ZM as ce,Zw as k,_M as le,_T as ue,aT as de,bM as A,bT as fe,cM as j,cT as pe,dM as me,dT as he,eT as ge,eU as M,fM as _e,fT as ve,fs as ye,gM as be,gT as xe,hM as Se,hT as Ce,iT as we,jM as Te,jT as Ee,kM as De,kT as Oe,lM as ke,lT as Ae,mM as je,mT as Me,ms as Ne,nT as Pe,oT as Fe,pM as Ie,pT as Le,ps as Re,qM as ze,rT as Be,sT as Ve,t as N,tT as He,tU as P,uM as Ue,uT as We,vM as Ge,vT as Ke,wT as qe,xM as Je,xT as Ye,yM as Xe,yT as F,zM as I}from"./api-BQ0aanqI.js";import{t as Ze}from"./x-B3RY_hjS.js";import{i as L,n as R,r as Qe,t as $e}from"./tabs-2ZLK5UDX.js";import{t as z}from"./button-fRwanC8A.js";import{$ as B,Et as V,H as et,Kn as tt,Ln as nt,Nn as rt,Pn as it,Q as H,Wn as at,X as U,Z as W,a as ot,at as st,ct as G,et as K,i as ct,kn as lt,lt as ut,nt as dt,o as ft,ot as pt,q as mt,qn as ht,rt as gt,s as _t,tt as vt}from"./index-BaLBFCJc.js";import{n as yt}from"./TimeRangePicker-BLR06n4q.js";import{t as bt}from"./FilterBar-BEH_6bM0.js";import{t as xt}from"./AdvancedFilter-CmqNZu_M.js";import{t as St}from"./DataTableShell-Bp21I3Sa.js";var Ct=c(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?v():n===`agent`?`${Te()} - ${r}`:e}function Tt(){let e=P(N.me.getMe,{host:mt})?.role===`admin`,t=P(N.deliveryTiming.getDeliveryStatus,{}),n=M(N.deliveryTiming.startDeliveryRecord),r=M(N.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:ce()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:oe()})]}),e?(0,J.jsx)(z,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?g():D()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(V,{variant:`secondary`,children:ze()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:_({time:ut(t.startedAt)})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?re():ae()})}),i?(0,J.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=P(N.deliveryTiming.listDeliverySessions,{}),n=M(N.deliveryTiming.deleteDeliverySessions),[r,a]=(0,q.useState)(``),[s,c]=(0,q.useState)(`all`),[l,u]=(0,q.useState)(Y),[d,p]=(0,q.useState)(null),{from:g,to:_}=yt(l),v=l.to===`now`?1/0:_,y=r.trim()!==``||s!==`all`||l!==Y,S=()=>{a(``),c(`all`),u(Y)},w=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(s===`all`||(s===`active`?t.active:!t.active))&&t.startedAt>=g&&t.startedAt<=v).map(e=>({...e,_id:e.sessionId}))},[t,r,s,g,v]),E=e=>{let t=new Set((w??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&p(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(bt,{q:r,onQChange:a,searchPlaceholder:ie(),timeRange:l,onTimeRangeChange:u,onReset:S,canReset:y,children:(0,J.jsxs)(U,{value:s,onValueChange:e=>c(e),children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:`all`,children:o()}),(0,J.jsx)(H,{value:`active`,children:I()}),(0,J.jsx)(H,{value:`stopped`,children:T()})]})]})}),(0,J.jsx)(St,{title:m(),rows:w,emptyHint:ke(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?De():i(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,J.jsx)(it,{size:15,"aria-hidden":!0}):(0,J.jsx)(rt,{size:15,"aria-hidden":!0})})},{header:ee(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:h(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:f(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:C(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:b(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(V,{variant:`secondary`,children:I()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:T()})}],rowActions:e?e=>[{label:x(),variant:`destructive`,onSelect:()=>E([e.sessionId])}]:void 0,bulkActions:e?[{label:x(),variant:`destructive`,onSelect:e=>E(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,J.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=P(N.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(et(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:l()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:p()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,j()]}),(0,J.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(at,{size:13,"aria-hidden":!0}):(0,J.jsx)(nt,{size:13,"aria-hidden":!0}),t?Ue():me()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:A()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Xe()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ge()})]})}),(0,J.jsxs)(`tbody`,{children:[i(le(),r.bridge),i(be(),r.A),i(Se(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:je()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()})]})}var kt=[50,100,200,500],Z=`all`,Q=`__all__`,At=[`2xx`,`4xx`,`5xx`],jt=[`user`,`service`,`system`],Mt=[`inbound`,`outbound`,`internal`],Nt={kind:`relative`,from:`now-30d`,to:`now`},Pt=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:Ne()},{value:`principalType`,label:Re()},{value:`direction`,label:`direction`},{value:`roleKey`,label:ye()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function Ft(){let e=ht({from:`/settings/traces`}),t=tt({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,c=e.principalType??Q,l=e.direction??Q,f=e.roleKey??Q,p=e.q??``,m=e.correlationId,h=ct(e.from,e.to),g=(0,q.useMemo)(()=>_t(e.adv),[e.adv]),{from:_,to:ee}=yt(h),[v,b]=(0,q.useState)(null),[x,C]=(0,q.useState)(null),T=e=>void t({search:t=>({...t,limit:e})}),re=e=>void t({search:t=>({...t,kind:e})}),ie=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ae=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),se=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,...ft(e)})}),ce=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),k=P(N.observability.listEvents,{limit:n}),le=P(N.observability.listEvents,{limit:n,kind:i===Z?void 0:i,...m?{correlationId:m}:{},filter:{q:p||void 0,from:_,to:ee,statusClass:o===Q?void 0:o,principalType:c===Q?void 0:c,direction:l===Q?void 0:l,roleKey:f===Q?void 0:f,advanced:g.length>0?g:void 0}}),A=(0,q.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),j=(0,q.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),me=p!==``||o!==Q||c!==Q||l!==Q||f!==Q||g.length>0||h.kind!==`relative`||h.from!==Nt.from;function M(){t({search:{limit:100,kind:`all`},replace:!0})}let _e=v?k?.filter(e=>e.correlationId===v):le,ye=e.section,be=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,J.jsxs)($e,{value:ye,onValueChange:e=>be(e),children:[(0,J.jsxs)(Qe,{className:`w-full`,children:[(0,J.jsxs)(L,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(lt,{size:13,"aria-hidden":!0}),E()]}),(0,J.jsxs)(L,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(Ct,{size:13,"aria-hidden":!0}),Je()]})]}),(0,J.jsx)(R,{value:`latency`,children:(0,J.jsx)(Tt,{})}),(0,J.jsxs)(R,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[y(),(0,J.jsx)(`strong`,{children:Ee()}),a(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:Oe()})]}),(0,J.jsxs)(bt,{q:p,onQChange:ie,searchPlaceholder:S(),timeRange:h,onTimeRangeChange:O,onReset:M,canReset:me,children:[(0,J.jsxs)(U,{value:o,onValueChange:ae,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:u()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:d()}),At.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:c,onValueChange:oe,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:ne()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:qe()}),jt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:l,onValueChange:se,children:[(0,J.jsx)(B,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{placeholder:s()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:te()}),Mt.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(U,{value:f,onValueChange:D,children:[(0,J.jsx)(B,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{placeholder:Ye()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(H,{value:Q,children:fe()}),j.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsx)(`input`,{list:`oc-trace-kinds`,className:`oc-input oc-input--sm w-44`,value:i===Z?``:i,placeholder:F(),"aria-label":F(),onChange:e=>{let t=e.target.value.trim();re(t===``?Z:t)}}),(0,J.jsx)(`datalist`,{id:`oc-trace-kinds`,children:A.map(e=>(0,J.jsx)(`option`,{value:e},e))}),(0,J.jsxs)(U,{value:String(n),onValueChange:e=>T(Number(e)),children:[(0,J.jsx)(B,{size:`sm`,className:`w-28`,children:(0,J.jsx)(K,{})}),(0,J.jsx)(W,{children:kt.map(e=>(0,J.jsx)(H,{value:String(e),children:Ke({count:e})},e))})]})]}),(0,J.jsx)(xt,{fields:Pt,seed:g,onChange:ce}),v?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:ue(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[xe(),(0,J.jsx)(`code`,{children:$(v)})]}),(0,J.jsx)(Ze,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:Ce()})]})}):null,(0,J.jsx)(St,{title:Me(),rows:_e,emptyHint:v?Le():ve(),columns:[{header:he(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:We(),sort:e=>e.kind,cell:e=>(0,J.jsx)(V,{variant:`secondary`,children:e.kind})},{header:Ae(),sort:e=>Lt(e)??null,cell:e=>{let t=Lt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":pe(),children:`✓`})}},{header:Ve(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(V,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Fe(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(V,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:de(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(V,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:we(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Be(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${It(e.status)}`,children:e.status})},{header:Pe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:He(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ge(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:r(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:w()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Rt,{row:x,onClose:()=>C(null)})]})]})}function It(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Lt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Rt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(vt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(dt,{className:`max-w-lg`,children:[(0,J.jsxs)(st,{children:[(0,J.jsxs)(pt,{className:`oc-traces__meta-title`,children:[k(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(V,{variant:`outline`,children:se()})]}),(0,J.jsx)(gt,{children:O()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{Ft as TracesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as r,CA as i,Hh as a,Qk as o,SA as s,Uh as c,Vh as l,Xk as u,Zk as d,_A as ee,_w as f,aA as p,bA as te,cA as ne,cw as m,dA as re,dw as h,eA as g,eU as _,fA as v,fw as y,gA as ie,gw as b,hA as ae,hw as x,iA as oe,jk as se,lA as ce,lw as S,mA as C,mw as w,nA as T,oA as le,pA as ue,pw as E,rA as de,sA as fe,sw as D,t as O,tA as pe,tU as k,uA as me,uw as A,vA as he,vw as j,wA as M,xA as N,yA as P,yw as F}from"./api-BQ0aanqI.js";import{t as I}from"./button-fRwanC8A.js";import{$ as L,Dt as R,Et as z,Ft as B,Kn as ge,Lt as _e,Mt as ve,Nt as ye,Pt as be,Q as V,U as xe,W as Se,X as H,Z as U,at as Ce,c as W,et as G,fn as K,l as we,mn as q,nt as Te,ot as Ee,q as De,qn as Oe,rt as ke,tt as Ae,u as J,ut as Y}from"./index-BaLBFCJc.js";import{t as je}from"./FilterBar-BEH_6bM0.js";import{t as Me}from"./DataTableShell-Bp21I3Sa.js";import{t as Ne}from"./DetailChips-C-bSKLSo.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=k(O.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=k(O.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,Z.jsx)(Ae,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Te,{className:`oc-access`,children:[(0,Z.jsxs)(Ce,{children:[(0,Z.jsx)(Ee,{children:F({user:t})}),(0,Z.jsx)(ke,{children:j()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?f():b()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:x()}):u.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:y()}):[...d.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=_(O.agents.assignAgent),s=_(O.agents.removeAgent),c=_(O.agents.setDefaultAgent),l=R();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(w(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(E(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(q,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(z,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(Y,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":h({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(z,{variant:`outline`,className:`oc-access__gone`,children:A()}):null,e.outOfPool?(0,Z.jsx)(z,{variant:`outline`,className:`oc-access__gone`,children:S()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":m(),title:m(),children:(0,Z.jsx)(K,{size:14,fill:`currentColor`})}):(0,Z.jsx)(I,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":D(),title:D(),disabled:c,onClick:()=>void d(e.agentId),children:(0,Z.jsx)(K,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return l();case`user`:return a();case`admin`:return c();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(J[e])).length;return(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(_e,{asChild:!0,children:(0,Z.jsx)(I,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?M():i({count:r})})}),(0,Z.jsxs)(ye,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(B,{children:s()}),W.map(e=>{let r=J[e];return(0,Z.jsxs)(be,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(Y,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:we[e]()})]},e)})]})]})}function Le(){let e=Oe({from:`/settings/users`}),t=ge({from:`/settings/users`}),n=e.q??``,i=e.role??Q,a=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),s=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),c=k(O.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),l=k(O.me.getMe,{host:De}),f=_(O.admin.setRole),m=_(O.admin.setUserPermissions),h=_(O.admin.startImpersonation),y=_(O.admin.deleteUser),b=_(O.admin.setUserName),x=xe(),S=Se(),w=R(),[E,D]=(0,X.useState)(null),A=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of c??[])e.add(t.role);return[...e]},[c]),j=n!==``||i!==Q;function M(){t({search:{},replace:!0})}async function F(e){try{await f(e)}catch(e){w.error(N(),e)}}async function I(e){try{await m(e)}catch(e){w.error(te(),e)}}async function z(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await x({title:ue(),description:v({user:t}),confirmWord:re(),confirmLabel:me(),destructive:!0}))try{await y({profileId:e._id}),w.success(ne({user:t}))}catch(e){w.error(ce(),e)}}async function B(e){let t=e.email||e.name||e.userId.slice(0,8),n=await S({title:le(),label:p({user:t}),placeholder:oe(),defaultValue:e.name??``,confirmLabel:se()});if(n!==null)try{await b({profileId:e._id,name:n}),w.success(de())}catch(e){w.error(T(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:a,searchPlaceholder:P(),onReset:M,canReset:j,children:(0,Z.jsxs)(H,{value:i,onValueChange:s,children:[(0,Z.jsx)(L,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{value:Q,children:he()}),A.map(e=>(0,Z.jsx)(V,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:ee(),rows:c,emptyHint:ie(),rowActions:e=>{let t=[{label:u(),onSelect:()=>D({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:fe(),onSelect:()=>void B(e)}];return e.userId!==l?.userId&&t.push({label:ae(),onSelect:()=>void h({profileId:e._id})},{label:C(),variant:`destructive`,onSelect:()=>void z(e)}),t},columns:[{header:pe(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:g(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(H,{value:e.role,onValueChange:t=>void F({profileId:e._id,role:t}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(V,{value:`user`,children:$(`user`)}),(0,Z.jsx)(V,{value:`admin`,children:$(`admin`)})]})]})},{header:r(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:o()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),I({profileId:e._id,permissions:[...n]})}})},{header:d(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(q,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:E?.profileId??null,userLabel:E?.label??``,open:E!==null,onOpenChange:e=>{e||D(null)}})]})}export{Le as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Ao as i,Ap as a,Bi as ee,Co as o,Do as s,Eo as c,JH as te,KH as l,Mo as u,Mp as ne,No as d,Oj as f,Oo as p,QH as m,Qi as h,So as g,To as _,_o as re,aa as v,ba as y,bo as b,da as x,do as S,eU as C,ea as ie,fa as ae,fo as w,go as T,ho as E,ia as oe,jo as se,ko as ce,la as le,lo as ue,mo as D,oa as O,pa as de,po as fe,ra as pe,t as k,tU as A,ta as j,th as M,ua as me,uo as N,vo as P,wo as F,xo as I,yo as L}from"./api-BQ0aanqI.js";import{i as R,n as z,r as he,t as ge}from"./tabs-2ZLK5UDX.js";import{t as B}from"./button-fRwanC8A.js";import{$ as V,$t as _e,Et as H,Gn as ve,Kn as ye,Q as U,X as W,Z as G,an as be,en as xe,et as K,in as q,nn as Se,q as Ce,qn as we,rn as J,sn as Y,tn as Te,ut as X,wn as Ee}from"./index-BaLBFCJc.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>c()],[`fr-FR`,()=>de()],[`en-US`,()=>ae()],[`en-GB`,()=>x()],[`de-DE`,()=>me()],[`es-ES`,()=>le()]],Oe=[[`0.75`,()=>F()],[`1`,()=>o()],[`1.25`,()=>g()],[`1.5`,()=>I()]],$=0;function ke({instance:e}){let t=C(k.admin.upsertInstanceConfig),n=e.config??{},i={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[o,c]=(0,Z.useState)(i),[l,u]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[g,v]=(0,Z.useState)(!1),y=m(k.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{c({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),u(`idle`)},[e._id]);let x=o.enabled!==i.enabled||o.engine!==i.engine||o.lang!==i.lang||o.rate!==i.rate||o.autoRead!==i.autoRead;async function S(){u(`saving`);try{let n={...e.config??{}};n.voiceEnabled=o.enabled,o.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,o.lang===`auto`?delete n.voiceLang:n.voiceLang=o.lang;let r=Number.parseFloat(o.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,o.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),u(`idle`)}catch{u(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(H,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:o.enabled,onCheckedChange:e=>c({...o,enabled:e===!0}),"aria-label":p()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:j()}),(0,Q.jsxs)(W,{value:o.engine,onValueChange:e=>c({...o,engine:e}),disabled:!o.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":j(),children:(0,Q.jsx)(K,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(U,{value:`browser`,children:ie()}),e.kind===`hermes`?null:(0,Q.jsx)(U,{value:`gateway`,children:r()})]})]})]}),o.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:h()}):null,o.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()}),(0,Q.jsxs)(W,{value:o.lang,onValueChange:e=>c({...o,lang:e}),disabled:!o.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":s(),children:(0,Q.jsx)(K,{})}),(0,Q.jsx)(G,{children:De.map(([e,t])=>(0,Q.jsx)(U,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()}),(0,Q.jsxs)(W,{value:o.rate,onValueChange:e=>c({...o,rate:e}),disabled:!o.enabled,children:[(0,Q.jsx)(V,{size:`sm`,"aria-label":_(),children:(0,Q.jsx)(K,{})}),(0,Q.jsx)(G,{children:Oe.map(([e,t])=>(0,Q.jsx)(U,{value:e,children:t()},e))})]})]}),o.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:o.autoRead,onCheckedChange:e=>c({...o,autoRead:e===!0}),disabled:!o.enabled,"aria-label":b()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:b()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:L()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!x||l===`saving`,onClick:()=>void S(),children:l===`saving`?M():ne()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!o.enabled||d,onClick:()=>{let t=Number.parseFloat(o.rate)||1,n=++$;if(v(!1),q(),J(),o.engine!==`gateway`){Se(T(),{lang:Te(o.lang,te()),rate:t});return}f(!0),y({instanceName:e.name,text:T()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&v(!0)}).finally(()=>f(!1))},children:d?M():P()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),q(),J()},children:re()})]}),l===`error`||g?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:g?ee():a()}):null]})}function Ae({stt:e}){let t=A(k.me.getMe,{host:Ce}),n=C(k.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:D()}),(0,Q.jsx)(H,{variant:e?`secondary`:`outline`,children:e?N():ue()}),(0,Q.jsx)(H,{variant:r?`secondary`:`destructive`,children:r?v():oe()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":O()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:O()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:fe()})]})}function je(){let e=A(k.admin.listInstances,{}),t=(0,Z.useMemo)(()=>be(),[]),n=(0,Z.useMemo)(()=>_e(),[]),{section:r}=we({from:`/settings/voice`}),a=ye({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(H,{variant:t?`secondary`:`destructive`,children:t?u():se()}),(0,Q.jsx)(H,{variant:n?`secondary`:`destructive`,children:n?i():ce()})]}),(0,Q.jsxs)(ge,{value:r,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Y,{size:13,"aria-hidden":!0}),pe()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ee,{size:13,"aria-hidden":!0}),D()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),w()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(z,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:w()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:S()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=C(k.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(H,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(X,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":f()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:f()})]})]})}export{je as VoiceTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./api-BQ0aanqI.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|