@lacneu/atrium 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessTab-7ikPRDrZ.js +1 -0
- package/dist/assets/AdvancedFilter-gsdcm_1A.js +1 -0
- package/dist/assets/AgentFilesTab-DLXgboNK.js +3 -0
- package/dist/assets/AnomaliesTab-CcTaJJF7.js +1 -0
- package/dist/assets/AuditTab-B51XdrS-.js +1 -0
- package/dist/assets/BridgeTab-B0fJjtmW.js +1 -0
- package/dist/assets/ChatDefaultsTab-IJWE_sxZ.js +1 -0
- package/dist/assets/{DataTableShell-DX6BeIdv.js → DataTableShell-DzK-qEdq.js} +1 -1
- package/dist/assets/{DetailChips-DEmmi2OP.js → DetailChips-BIvUUZKQ.js} +1 -1
- package/dist/assets/FeedbacksTab-CRF5np-W.js +1 -0
- package/dist/assets/FieldLabel-Cz-9BS36.js +75 -0
- package/dist/assets/FilesTab-CUEzcwu7.js +1 -0
- package/dist/assets/FilterBar-CZN4zOuy.js +1 -0
- package/dist/assets/GroupsTab-q8FOBA9S.js +1 -0
- package/dist/assets/InstancesTab-Dl2EJUgc.js +1 -0
- package/dist/assets/IntegrationsTab-hTzia7mx.js +1 -0
- package/dist/assets/KpiTab-DI8vQ1LD.js +1 -0
- package/dist/assets/PreferencesTab-7nFPybn0.js +1 -0
- package/dist/assets/PromptInjectionsTab-R-YFEPfz.js +4 -0
- package/dist/assets/RolesTab-DTUfolk3.js +1 -0
- package/dist/assets/ServiceAccountsTab-WYurhM36.js +1 -0
- package/dist/assets/SubAgentReportsTab-DAd0x6y2.js +1 -0
- package/dist/assets/ThemeShowroom-BclE06WS.js +1 -0
- package/dist/assets/TimeRangePicker-DVDywKqe.js +1 -0
- package/dist/assets/TracesTab-sUddGVLv.js +1 -0
- package/dist/assets/UsersTab-DY-84glO.js +1 -0
- package/dist/assets/button-C3T_nXdg.js +1 -0
- package/dist/assets/{card-DLmrH_wl.js → card-DESvIpRK.js} +1 -1
- package/dist/assets/chevrons-up-down-RW5J1Q7S.js +1 -0
- package/dist/assets/{compatView-CAGz-_Jd.js → compatView-A0wf8Ngm.js} +1 -1
- package/dist/assets/dispatchErrorInfo-CG5-z2lD.js +1 -0
- package/dist/assets/dist-B1tb-c2t.js +1 -0
- package/dist/assets/dist-BJuS9RKK.js +44 -0
- package/dist/assets/dist-C5xpMIpa.js +5 -0
- package/dist/assets/dist-CpS8aq8T.js +1 -0
- package/dist/assets/{highlighted-body-OFNGDK62-BA8RVPgm.js → highlighted-body-OFNGDK62-CLCx-LYW.js} +1 -1
- package/dist/assets/{index-CzWyoOI1.css → index-BJ8KUScf.css} +1 -1
- package/dist/assets/index-DgeJfwWI.js +229 -0
- package/dist/assets/localePickerView-C2RmOS86.js +1 -0
- package/dist/assets/locales-CPjguROj.js +1 -0
- package/dist/assets/mermaid-GHXKKRXX-BKfbghLf.js +1 -0
- package/dist/assets/roleDescriptions-D-TCtebQ.js +1 -0
- package/dist/assets/{table-CeOSuZF-.js → table-Dgu2YiDE.js} +1 -1
- package/dist/assets/tabs-bHkQWa8h.js +1 -0
- package/dist/assets/x-DzHSe3Kh.js +1 -0
- package/dist/index.html +13 -9
- package/package.json +1 -1
- package/dist/assets/AccessTab-D4e7sR36.js +0 -1
- package/dist/assets/AdvancedFilter-BruZmihw.js +0 -1
- package/dist/assets/AgentFilesTab-BkJP6wns.js +0 -3
- package/dist/assets/AnomaliesTab-DWscg89L.js +0 -1
- package/dist/assets/AuditTab-D0Wedb1v.js +0 -1
- package/dist/assets/BridgeTab-C3V0alh4.js +0 -1
- package/dist/assets/ChatDefaultsTab-DvXAKUwq.js +0 -1
- package/dist/assets/FeedbacksTab-D-GXqU4B.js +0 -1
- package/dist/assets/FieldLabel-JjysLGoF.js +0 -38
- package/dist/assets/FilesTab-DCKOgdaA.js +0 -1
- package/dist/assets/FilterBar-DaPqbYlS.js +0 -1
- package/dist/assets/GroupsTab-D5ES5Ud8.js +0 -1
- package/dist/assets/InstancesTab-B0pZvNmW.js +0 -1
- package/dist/assets/IntegrationsTab-CqJfXR9z.js +0 -1
- package/dist/assets/KpiTab-Dvvt84nD.js +0 -1
- package/dist/assets/PreferencesTab-BE4ACEs8.js +0 -1
- package/dist/assets/PromptInjectionsTab-WJ5pfSFJ.js +0 -4
- package/dist/assets/RolesTab-CJJaeVgk.js +0 -1
- package/dist/assets/ServiceAccountsTab-B8kVXJ46.js +0 -1
- package/dist/assets/SubAgentReportsTab-DMoB3156.js +0 -1
- package/dist/assets/ThemeShowroom-YuvACoB7.js +0 -1
- package/dist/assets/TimeRangePicker-BGMAlmom.js +0 -1
- package/dist/assets/TracesTab-D2MjU6w8.js +0 -1
- package/dist/assets/UsersTab-D2y50PeG.js +0 -1
- package/dist/assets/button-0kksS-se.js +0 -1
- package/dist/assets/chevrons-up-down-Cvv3i-sc.js +0 -1
- package/dist/assets/dispatchErrorInfo-DKlnpjsd.js +0 -1
- package/dist/assets/dist-BurVRsW0.js +0 -1
- package/dist/assets/dist-C-3gq7wS.js +0 -1
- package/dist/assets/dist-CdSwEQWH.js +0 -44
- package/dist/assets/dist-nAUDMYxE.js +0 -5
- package/dist/assets/index-H4lBiMmR.js +0 -229
- package/dist/assets/mermaid-GHXKKRXX-aX3bC-kI.js +0 -1
- package/dist/assets/roleDescriptions-CizW5_c4.js +0 -1
- package/dist/assets/tabs-Czyis8Bg.js +0 -1
- package/dist/assets/x-D7klnZcV.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$O as i,AO as a,BO as o,CO as s,D as c,DO as l,E as u,EO as d,FO as f,GD as p,GO as m,HO as h,IO as g,JD as _,JO as v,KD as y,KO as b,LO as x,MO as ee,NO as te,OO as ne,PO as re,QD as ie,QO as ae,RO as oe,SA as se,SO as ce,TA as S,TO as le,UO as ue,VO as de,WO as fe,XD as pe,XO as me,YD as C,YO as he,ZD as ge,ZO as _e,_O as ve,_r as w,aO as ye,ak as be,bO as xe,cO as Se,ck as Ce,dO as T,dk as we,eO as Te,ek as Ee,fA as De,fO as Oe,fk as ke,gO as Ae,gr as je,hO as Me,hr as Ne,iO as Pe,ik as Fe,jO as Ie,kO as Le,lO as Re,lk as ze,mA as Be,mO as Ve,n as He,nO as Ue,nk as We,oO as Ge,ok as Ke,pA as qe,pO as Je,pk as Ye,qD as Xe,qO as Ze,rO as Qe,rk as $e,sO as et,sk as tt,tO as nt,tk as rt,uO as it,uk as at,vO as ot,vr as E,wA as D,wO as st,xO as ct,yO as lt,zO as ut}from"./dist-BJuS9RKK.js";import{n as O}from"./dist-B1tb-c2t.js";import{t as k}from"./x-DzHSe3Kh.js";import{t as A}from"./button-C3T_nXdg.js";import{$ as j,C as M,J as dt,Ot as N,Q as ft,S as P,X as pt,Y as F,Z as mt,_ as I,b as L,ct as ht,et as R,kt as gt,lt as z,q as _t,st as vt,x as B,y as V}from"./index-DgeJfwWI.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-DESvIpRK.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-Dgu2YiDE.js";import{t as kt}from"./TimeRangePicker-DVDywKqe.js";import{t as At}from"./FilterBar-CZN4zOuy.js";import{t as jt}from"./AdvancedFilter-gsdcm_1A.js";var G=c(`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`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(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 It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(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 Rt(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 zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Ve());if(e.size>zt)throw Error(Je());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/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=Ft(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);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(it());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(Oe())),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 Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={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 $({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`?Be():e===`dark`?qe():De()}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:He(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(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":E(),title:E(),children:(0,X.jsx)(gt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=S(u.charts.listMyCharts),r=D(u.charts.setMyChart);async function a(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:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Fe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:$e(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?rt():n.via===`owner`?Ee():i({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 a(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ae()}):null]})}function Qt(){let e=D(u.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[d,p]=(0,K.useState)(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{i(await t.text())}catch{s(a())}}}async function h(){if(s(null),l(!1),t.trim()===``){s(ne());return}let o;try{o=JSON.parse(r)}catch{s(a());return}p(!0);try{await e({name:t.trim(),tokens:o}),l(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{p(!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:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:x()})]}),(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:g()}),(0,X.jsx)(R,{value:t,onChange:e=>n(e.target.value),placeholder:f(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:re()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:te(),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)(G,{className:`size-4`}),ee(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void m(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:d,onClick:()=>void h(),children:Ie()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Le()}):null]})]})}function $t({chart:e}){let t=se(u.charts.setChartLogo),n=D(u.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function 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,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ct():xe()}),(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)(G,{className:`size-4`}),t?ot():lt(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:Ae()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:ve()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ce()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Me()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=S(u.me.getMe,{host:z}),n=D(u.charts.addChartDomain),r=D(u.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){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 p(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:Re()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ye()}):d.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Pe({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{value:i,onChange:e=>a(e.target.value),placeholder:et(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(),children:Ge()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Se()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=D(u.charts.updateChart),n=D(u.charts.deleteChart),[i,o]=(0,K.useState)(!1),[c,l]=(0,K.useState)(e.name),[d,f]=(0,K.useState)(()=>tn(e.tokens)),[p,m]=(0,K.useState)(e.tokens.bpm??0),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1);function y(){l(e.name),f(tn(e.tokens)),m(e.tokens.bpm??0),g(null),o(!0)}async function b(){if(e.chartId===void 0)return;g(null);let n;try{n=JSON.parse(d)}catch{g(a());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;p>0?e.bpm=p:delete e.bpm}v(!0);try{await t({chartId:e.chartId,name:c.trim(),tokens:n}),o(!1)}catch(e){g(e instanceof Error?e.message:String(e))}finally{v(!1)}}async function x(){if(e.chartId!==void 0&&window.confirm(r()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:y,children:st()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void x(),children:s()})]})})]}),i?(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:nt()}),(0,X.jsx)(R,{value:c,onChange:e=>l(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:w()}),(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:p,onChange:e=>m(Number(e.target.value)),"aria-label":w()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:p===0?je():`${p} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ne()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Te()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:d,onChange:e=>f(e.target.value),rows:10,spellCheck:!1})]}),h?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:h}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:_,onClick:()=>void b(),children:Qe()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>o(!1),children:Ue()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=S(u.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:l()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:le()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=D(u.charts.addChartToGroupPool),r=D(u.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,s=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?fe():e.kind===`custom`&&e.scope===`personal`?C():m()}),e.isGlobalDefault?(0,X.jsx)(j,{variant:`default`,children:ue()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:de()}),(a??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ut({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(P,{size:`sm`,className:`w-56`,children:(0,X.jsx)(M,{placeholder:o()})}),(0,X.jsx)(L,{children:c.map(e=>(0,X.jsx)(B,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:h()}):null]})]})}function on({chart:e}){let t=D(u.charts.promoteChartToCommon),n=D(u.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(r()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?_():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:pe({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:Xe()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void a(),children:y()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=D(u.admin.setDefaultThemeMode),i=D(u.admin.setDefaultLocale),a=D(u.charts.setDefaultChart),o=S(u.charts.listChartsAdmin),s=S(u.groups.listGroups,{}),c=e??`system`,l=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:tt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:$e()}),ht.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({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:he()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:s??[]},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:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:b()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).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:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:p()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:c===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:we()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(A,{variant:l===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()})]})]})}function cn(){let e=S(u.me.getMe,{host:z}),t=vt(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)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Ce()}),(0,X.jsxs)($,{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)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(R,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(P,{className:`w-56`,children:(0,X.jsx)(M,{placeholder:`Select…`})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(B,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(B,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(I,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{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)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(V,{value:o,onValueChange:s,children:[(0,X.jsx)(P,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes directions`}),(0,X.jsx)(B,{value:`inbound`,children:`inbound`}),(0,X.jsx)(B,{value:`outbound`,children:`outbound`}),(0,X.jsx)(B,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(V,{value:c,onValueChange:l,children:[(0,X.jsx)(P,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(B,{value:`info`,children:`info`}),(0,X.jsx)(B,{value:`warn`,children:`warn`}),(0,X.jsx)(B,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{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)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(_t,{children:[(0,X.jsx)(ft,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(dt,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(mt,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(mt,{}),(0,X.jsx)(F,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{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)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(I,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(I,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(j,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$f as r,Gf as i,Jf as a,Kf as o,Qf as s,Wf as c,Xf as l,Yf as u,Zf as d,_t as f,bt as p,ep as m,gt as h,ht as g,mt as _,np as v,qf as y,tp as b,vt as x,yt as S}from"./dist-BJuS9RKK.js";import{t as C}from"./button-C3T_nXdg.js";import{dt as w,et as T,ft as E,jt as D,k as O,pt as k,ut as A,xt as j}from"./index-DgeJfwWI.js";var M=t(e(),1),N={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function P(e,t){let n=e.trim();if(n===`now`)return t;let r=/^now-(\d+)([smhdw])$/.exec(n);if(r===null)return null;let i=Number(r[1]),a=N[r[2]];return!Number.isFinite(i)||a===void 0?null:t-i*a}function F(e,t=Date.now()){return e.kind===`absolute`?{from:e.from,to:e.to}:{from:P(e.from,t)??t-N.h,to:P(e.to,t)??t}}var I=[{label:v(),from:`now-5m`},{label:b(),from:`now-15m`},{label:m(),from:`now-30m`},{label:r(),from:`now-1h`},{label:s(),from:`now-3h`},{label:d(),from:`now-6h`},{label:l(),from:`now-12h`},{label:u(),from:`now-24h`},{label:a(),from:`now-2d`},{label:y(),from:`now-7d`},{label:o(),from:`now-30d`},{label:i(),from:`now-90d`},{label:c(),from:`now-520w`}];function L(e){return O(e,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function R(e){if(e.kind===`relative`){let t=I.find(t=>t.from===e.from&&e.to===`now`);return t?t.label:`${e.from} → ${e.to}`}return`${L(e.from)} → ${L(e.to)}`}function z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function B(e){if(e===``)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function V(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:t!==``&&Number.isFinite(Number(t))?Number(t):e}var H=n();function U(e){let[t,n]=(0,M.useState)(0);return(0,M.useEffect)(()=>{if(e.kind!==`relative`)return;let t=window.setInterval(()=>n(e=>e+1),3e4);return()=>window.clearInterval(t)},[e.kind]),(0,M.useMemo)(()=>{let{from:t,to:n}=F(e);return e.kind===`absolute`?{from:t,to:n}:{from:W(t),to:W(n)}},[e,t])}function W(e){return Math.floor(e/6e4)*6e4}function G({value:e,onChange:t}){let[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(``),o=F(e),[s,c]=(0,M.useState)(()=>z(o.from)),[l,u]=(0,M.useState)(()=>z(o.to));function d(t){if(t){let t=F(e);c(z(t.from)),u(z(t.to)),a(``)}r(t)}function m(e){t({kind:`relative`,from:e,to:`now`}),r(!1)}function v(){let e=B(s),n=B(l);e===null||n===null||(t({kind:`absolute`,from:e,to:n}),r(!1))}let y=(0,M.useMemo)(()=>{let e=i.trim().toLowerCase();return e===``?I:I.filter(t=>t.label.toLowerCase().includes(e)||t.from.toLowerCase().includes(e))},[i]),b=B(s)!==null&&B(l)!==null;return(0,H.jsxs)(E,{open:n,onOpenChange:d,children:[(0,H.jsx)(k,{asChild:!0,children:(0,H.jsxs)(C,{variant:`outline`,size:`sm`,className:`oc-timerange__trigger`,children:[(0,H.jsx)(D,{}),R(e)]})}),(0,H.jsx)(w,{children:(0,H.jsx)(A,{align:`end`,sideOffset:6,className:`oc-timerange__panel z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,children:(0,H.jsxs)(`div`,{className:`oc-timerange__cols`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__absolute`,children:[(0,H.jsx)(`div`,{className:`oc-timerange__section-title`,children:p()}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:S()}),(0,H.jsx)(T,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`oc-field`,children:[(0,H.jsx)(`span`,{className:`oc-field__label`,children:x()}),(0,H.jsx)(T,{type:`datetime-local`,value:l,onChange:e=>u(e.target.value)})]}),(0,H.jsx)(C,{size:`sm`,className:`oc-timerange__apply`,disabled:!b,onClick:v,children:f()})]}),(0,H.jsxs)(`div`,{className:`oc-timerange__relative`,children:[(0,H.jsxs)(`div`,{className:`oc-timerange__search`,children:[(0,H.jsx)(j,{className:`oc-timerange__search-icon`,"aria-hidden":!0}),(0,H.jsx)(T,{value:i,onChange:e=>a(e.target.value),placeholder:h(),"aria-label":g()})]}),(0,H.jsx)(`ul`,{className:`oc-timerange__list`,children:y.length===0?(0,H.jsx)(`li`,{className:`oc-timerange__empty`,children:_()}):y.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsx)(`button`,{type:`button`,className:`oc-timerange__option`+(e.kind===`relative`&&e.from===t.from&&e.to===`now`?` is-active`:``),onClick:()=>m(t.from),children:t.label})},t.from))})]})]})})})]})}export{U as n,V as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,AC as i,Ah as a,BC as o,Bh as s,CC as c,Ch as l,D as u,DC as d,Dh as f,E as p,EC as m,Eh as h,FC as g,Fh as _,G as v,Gh as y,HC as b,Hh as x,IC as S,Ih as C,Jh as ee,K as w,Kh as te,LC as T,Lh as ne,MC as E,Mh as re,NC as D,Nh as ie,OC as ae,Oh as oe,PC as se,Ph as ce,Qh as le,RC as ue,Rh as de,SC as fe,Sh as pe,TA as O,TC as k,Th as me,UC as A,Uh as he,VC as ge,Vh as _e,WC as ve,Wh as ye,Xh as be,Yh as xe,Zh as Se,aC as j,bC as M,bh as N,cC as P,dC as Ce,eg as we,fC as Te,hC as Ee,iC as De,ig as Oe,jC as F,jh as ke,kC as Ae,kh as je,lC as Me,mC as Ne,nC as Pe,ng as Fe,oC as Ie,pC as Le,q as Re,qh as ze,rC as Be,rg as Ve,sC as He,tC as Ue,tg as We,uC as Ge,wA as I,wC as Ke,wh as qe,xC as L,xh as Je,zC as Ye,zh as Xe}from"./dist-BJuS9RKK.js";import{n as Ze}from"./dist-B1tb-c2t.js";import{t as Qe}from"./x-DzHSe3Kh.js";import{i as R,n as z,r as $e,t as et}from"./tabs-bHkQWa8h.js";import{t as B}from"./button-C3T_nXdg.js";import{$ as V,A as tt,At as nt,C as H,Dt as rt,Et as it,Ft as at,M as ot,Pt as st,S as U,a as ct,at as lt,b as W,i as ut,k as G,lt as dt,nt as ft,o as pt,ot as mt,r as ht,rt as gt,tt as _t,x as K,y as q}from"./index-DgeJfwWI.js";import{n as vt}from"./TimeRangePicker-DVDywKqe.js";import{t as yt}from"./FilterBar-CZN4zOuy.js";import{t as bt}from"./AdvancedFilter-gsdcm_1A.js";import{t as xt}from"./DataTableShell-DzK-qEdq.js";var St=u(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?k():n===`agent`?`${Ke()} - ${r}`:e}function Tt(){let e=O(p.me.getMe,{host:dt})?.role===`admin`,t=O(p.deliveryTiming.getDeliveryStatus,{}),n=I(p.deliveryTiming.startDeliveryRecord),r=I(p.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=t?.recording??!1,u=async()=>{c(!0);try{l?await r({}):await n({})}finally{c(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:ve()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:A()})]}),e?(0,Y.jsx)(B,{variant:l?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void u(),children:l?ge():b()}):null]}),l?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(V,{variant:`secondary`,children:o()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Ye({time:tt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?S():T()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=O(p.deliveryTiming.listDeliverySessions,{}),n=I(p.deliveryTiming.deleteDeliverySessions),[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[f,h]=(0,J.useState)(null),{from:_,to:v}=vt(l),y=l.to===`now`?1/0:v,b=r.trim()!==``||o!==`all`||l!==X,x=()=>{a(``),s(`all`),u(X)},S=(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>=_&&t.startedAt<=y).map(e=>({...e,_id:e.sessionId}))},[t,r,o,_,y]),C=e=>{let t=new Set((S??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),f!==null&&r.includes(f)&&h(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:a,searchPlaceholder:se(),timeRange:l,onTimeRangeChange:u,onReset:x,canReset:b,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)(W,{children:[(0,Y.jsx)(K,{value:`all`,children:D()}),(0,Y.jsx)(K,{value:`active`,children:E()}),(0,Y.jsx)(K,{value:`stopped`,children:F()})]})]})}),(0,Y.jsx)(xt,{title:g(),rows:S,emptyHint:Pe(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":f===e.sessionId?fe():c(),onClick:()=>h(t=>t===e.sessionId?null:e.sessionId),children:f===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(rt,{size:15,"aria-hidden":!0})})},{header:i(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:Ae(),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:G(e.stoppedAt)})},{header:ae(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:d(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:m(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(V,{variant:`secondary`,children:E()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:F()})}],rowActions:e?e=>[{label:L(),variant:`destructive`,onSelect:()=>C([e.sessionId])}]:void 0,bulkActions:e?[{label:L(),variant:`destructive`,onSelect:e=>C(e)}]:void 0,isExpanded:e=>e.sessionId===f,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=O(p.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(ot(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:M()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ue()});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,` `,Ue()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(nt,{size:13,"aria-hidden":!0}),t?Be():De()]})]}),(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:Le()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Te()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ce()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(Ge(),r.bridge),i(Me(),r.A),i(P(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:He()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:Re()},{value:`principalType`,label:w()},{value:`direction`,label:`direction`},{value:`roleKey`,label:v()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=at({from:`/settings/traces`}),t=st({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,c=e.principalType??Q,u=e.direction??Q,d=e.roleKey??Q,m=e.q??``,g=ht(e.from,e.to),v=(0,J.useMemo)(()=>pt(e.adv),[e.adv]),{from:b,to:S}=vt(g),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(null),ae=e=>void t({search:t=>({...t,limit:e})}),se=e=>void t({search:t=>({...t,kind:e})}),ue=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),fe=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),pe=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),ge=e=>void t({search:t=>({...t,...ct(e)})}),ve=e=>void t({search:t=>({...t,adv:ut(e)}),replace:!0}),j=O(p.observability.listEvents,{limit:n}),M=O(p.observability.listEvents,{limit:n,kind:i===At?void 0:i,filter:{q:m||void 0,from:b,to:S,statusClass:o===Q?void 0:o,principalType:c===Q?void 0:c,direction:u===Q?void 0:u,roleKey:d===Q?void 0:d,advanced:v.length>0?v:void 0}}),N=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),P=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),Ce=m!==``||o!==Q||c!==Q||u!==Q||d!==Q||v.length>0||g.kind!==`relative`||g.from!==Pt.from;function Te(){t({search:{limit:100,kind:`all`},replace:!0})}let De=w?j?.filter(e=>e.correlationId===w):M,[F,Ae]=(0,J.useState)(`events`);return(0,Y.jsxs)(et,{value:F,onValueChange:e=>Ae(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(it,{size:13,"aria-hidden":!0}),Ee()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),Ne()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Oe(),(0,Y.jsx)(`strong`,{children:Ve()}),Fe(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:We()})]}),(0,Y.jsxs)(yt,{q:m,onQChange:ue,searchPlaceholder:we(),timeRange:g,onTimeRangeChange:ge,onReset:Te,canReset:Ce,children:[(0,Y.jsxs)(q,{value:o,onValueChange:fe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:r()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:le()}),jt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:c,onValueChange:pe,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:Se()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:be()}),Mt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:u,onValueChange:k,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(H,{placeholder:xe()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:ee()}),Nt.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:d,onValueChange:A,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(H,{placeholder:ze()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:Q,children:te()}),P.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:i,onValueChange:se,children:[(0,Y.jsx)(U,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(H,{placeholder:y()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(K,{value:At,children:ye()}),N.map(e=>(0,Y.jsx)(K,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>ae(Number(e)),children:[(0,Y.jsx)(U,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(W,{children:kt.map(e=>(0,Y.jsx)(K,{value:String(e),children:he({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:v,onChange:ve}),w?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>T(null),title:x(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[_e(),(0,Y.jsx)(`code`,{children:$(w)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:s()})]})}):null,(0,Y.jsx)(xt,{title:Xe(),rows:De,emptyHint:w?de():ne(),columns:[{header:C(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:_(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(V,{variant:`secondary`,children:e.kind})},{header:ce(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":ie(),children:`✓`})}},{header:re(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(V,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ke(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(V,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:a(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(V,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:je(),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 ${Lt(e.status)}`,children:e.status})},{header:f(),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:h(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:me(),onClick:()=>T(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:qe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>D(e),children:l()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:E,onClose:()=>D(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(_t,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(ft,{className:`max-w-lg`,children:[(0,Y.jsxs)(lt,{children:[(0,Y.jsxs)(mt,{className:`oc-traces__meta-title`,children:[pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(V,{variant:`outline`,children:Je()})]}),(0,Y.jsx)(gt,{children:N()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ab as r,Bm as i,Cb as a,Cc as o,Db as s,E as c,Eb as l,Fb as u,Fm as d,Gm as f,Hm as p,Ib as m,Im as h,Km as g,Ky as _,Lb as v,Lm as y,Mb as b,Nb as x,Ob as ee,Pb as S,Pm as C,Rb as w,Rm as T,Sb as te,TA as E,Tb as ne,Tc as D,Um as O,Vm as k,Wm as A,_b as re,bb as ie,db as ae,fb as oe,gb as se,hb as ce,jb as le,kb as ue,mb as de,pb as fe,vb as pe,wA as j,wb as me,wc as M,xb as he,yb as ge,zb as N,zm as P}from"./dist-BJuS9RKK.js";import{t as F}from"./button-C3T_nXdg.js";import{$ as I,C as L,F as _e,Ft as ve,J as R,N as z,P as ye,Pt as be,Q as xe,S as B,X as Se,Y as Ce,_ as V,at as we,b as H,bt as U,d as W,f as Te,lt as Ee,nt as De,ot as Oe,p as G,q as ke,rt as Ae,tt as je,x as K,y as q,yt as J}from"./index-DgeJfwWI.js";import{t as Y}from"./FilterBar-CZN4zOuy.js";import{t as Me}from"./DataTableShell-DzK-qEdq.js";import{t as Ne}from"./DetailChips-BIvUUZKQ.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=E(c.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=E(c.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,l=s?`${s.instanceName}/${s.agentId}`:null,u=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).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}))],m=new Map;for(let e of d){let t=m.get(e.instanceName)??[];t.push(e),m.set(e.instanceName,t)}return(0,Z.jsx)(je,{open:n,onOpenChange:r,children:(0,Z.jsxs)(De,{className:`oc-access`,children:[(0,Z.jsxs)(we,{children:[(0,Z.jsx)(Oe,{children:g({user:t})}),(0,Z.jsx)(Ae,{children:f()})]}),i?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?A():O()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:p()}):d.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:P()}):[...m.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:l},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:a,defaultKey:o}){let s=j(c.agents.assignAgent),l=j(c.agents.removeAgent),u=j(c.agents.setDefaultAgent),f=z();if(!e)return null;async function p(n,r){try{r?await l({profileId:e,instanceName:t,agentId:n}):await s({profileId:e,instanceName:t,agentId:n})}catch(e){f.error(k(),e)}}async function m(n){try{await u({profileId:e,instanceName:t,agentId:n})}catch(e){f.error(i(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(U,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(I,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=a.has(n),i=o===n,s=e.state===`deleted`;return(0,Z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Z.jsx)(V,{checked:r,disabled:s&&!r,onCheckedChange:()=>void p(e.agentId,r),"aria-label":T({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)(I,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,e.outOfPool?(0,Z.jsx)(I,{variant:`outline`,className:`oc-access__gone`,children:h()}):null,r?i?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":d(),title:d(),children:(0,Z.jsx)(J,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":C(),title:C(),onClick:()=>void m(e.agentId),children:(0,Z.jsx)(J,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return o();case`user`:return M();case`admin`:return D();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(G[e])).length;return(0,Z.jsxs)(ke,{children:[(0,Z.jsx)(xe,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?N():w({count:r})})}),(0,Z.jsxs)(R,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(Se,{children:v()}),W.map(e=>{let r=G[e];return(0,Z.jsxs)(Ce,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(V,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Te[e]()})]},e)})]})]})}function Le(){let e=ve({from:`/settings/users`}),t=be({from:`/settings/users`}),n=e.q??``,i=e.role??Q,o=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),f=E(c.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),p=E(c.me.getMe,{host:Ee}),h=j(c.admin.setRole),g=j(c.admin.setUserPermissions),v=j(c.admin.startImpersonation),y=j(c.admin.deleteUser),C=j(c.admin.setUserName),w=ye(),T=_e(),D=z(),[O,k]=(0,X.useState)(null),A=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of f??[])e.add(t.role);return[...e]},[f]),M=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await h(e)}catch(e){D.error(m(),e)}}async function F(e){try{await g(e)}catch(e){D.error(u(),e)}}async function I(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await w({title:ee(),description:s({user:t}),confirmWord:l(),confirmLabel:ne(),destructive:!0}))try{await y({profileId:e._id}),D.success(a({user:t}))}catch(e){D.error(me(),e)}}async function R(e){let t=e.email||e.name||e.userId.slice(0,8),n=await T({title:he(),label:ie({user:t}),placeholder:ge(),defaultValue:e.name??``,confirmLabel:_()});if(n!==null)try{await C({profileId:e._id,name:n}),D.success(pe())}catch(e){D.error(re(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:o,searchPlaceholder:S(),onReset:N,canReset:M,children:(0,Z.jsxs)(q,{value:i,onValueChange:d,children:[(0,Z.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(L,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(K,{value:Q,children:x()}),A.map(e=>(0,Z.jsx)(K,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:b(),rows:f,emptyHint:le(),rowActions:e=>{let t=[{label:ae(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:te(),onSelect:()=>void R(e)}];return e.userId!==p?.userId&&t.push({label:r(),onSelect:()=>void v({profileId:e._id})},{label:ue(),variant:`destructive`,onSelect:()=>void I(e)}),t},columns:[{header:se(),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:ce(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(q,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(L,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(K,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(K,{value:`user`,children:$(`user`)}),(0,Z.jsx)(K,{value:`admin`,children:$(`admin`)})]})]})},{header:de(),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:fe()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:oe(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(U,{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:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Le as UsersTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,t as r,x as i}from"./dist-BJuS9RKK.js";e();var a=t(),o=r(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:r=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?i:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(o({variant:t,size:r,className:e})),...c})}export{o as n,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-
|
|
1
|
+
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BJuS9RKK.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-footer`,className:n(`flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3`,e),...t})}export{a,l as i,c as n,o,s as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./dist-BJuS9RKK.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ga as e,Ja as t,Ka as n,Xa as r,Ya as i,ao as a}from"./dist-BJuS9RKK.js";var o=e=>typeof e==`string`?e:null;function s(e){return/^\d+\.\d+\.\d+$/.test(e)?e.split(`.`).map(e=>Number.parseInt(e,10)):null}function c(e,t){let n=s(e),r=s(t);if(n===null||r===null)return null;for(let e=0;e<3;e++){let t=n[e]-r[e];if(t!==0)return t}return 0}function l(e,t){if(e===null||t===null)return!1;let n=c(t,e.min);return n!==null&&n>=0}function u(e,t){let n={range:null,validatedVersions:[]};if(typeof e!=`object`||!e)return n;let r=e.providers;if(typeof r!=`object`||!r)return n;let i=r[t];if(typeof i!=`object`||!i)return n;let a=i,s=null;if(typeof a.supportedRange==`object`&&a.supportedRange!==null){let e=a.supportedRange,t=o(e.min),n=o(e.maxValidated);t!==null&&n!==null&&(s={min:t,maxValidated:n})}let c=Array.isArray(a.validatedVersions)?a.validatedVersions.filter(e=>typeof e==`string`):[];return{range:s,validatedVersions:c}}function d(e,t,n){if(e===null)return`unknown`;let{range:r}=u(n,t);return l(r,e)?r!==null&&(c(e,r.maxValidated)??0)>0?`beyond`:`supported`:`unknown`}function f(e){return e===`supported`?r():e===`beyond`?i():t()}function p(e){return e??a()}function m(t){return t===null?e():n({version:t})}function h(e,t){if(typeof e!=`object`||!e)return!1;let n=e.providers;return typeof n!=`object`||!n?!1:t in n}export{p as a,m as i,h as n,c as o,f as r,u as s,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Au as e,Cu as t,Du as n,Eu as r,Fu as i,Mu as a,Nu as o,Ou as s,Pu as c,Su as l,Tu as u,_u as d,bu as f,cu as p,du as m,fu as h,gu as g,hu as _,ju as v,ku as y,lu as b,mu as x,pu as S,su as C,uu as w,vu as T,wu as E,xu as D,yu as O}from"./dist-BJuS9RKK.js";var k={AGENT_NOT_FOUND:()=>({label:i(),hint:c()}),AUTH_TOKEN_MISMATCH:()=>({label:o(),hint:a()}),DEVICE_SIGNING_FAILED:()=>({label:v(),hint:e()}),SESSION_SCOPE_DENIED:()=>({label:y(),hint:s()}),GATEWAY_TIMEOUT:()=>({label:n(),hint:r()}),GATEWAY_DISCONNECTED:()=>({label:u(),hint:E()}),ATTACHMENT_TOO_LARGE:()=>({label:D(),hint:f()}),ATTACHMENT_REJECTED:()=>({label:O(),hint:T()}),BRIDGE_UNREACHABLE:()=>({label:t(),hint:l()}),INVALID_REQUEST:()=>({label:d(),hint:g()}),NOT_CONFIGURED:()=>({label:_(),hint:x()}),UNROUTED:()=>({label:S(),hint:h()}),UPSTREAM_ERROR:()=>({label:m(),hint:w()}),UNKNOWN:()=>({label:b(),hint:p()})};function A(e){return e?k[e]?.()??{label:e,hint:C()}:k.UNKNOWN()}export{A as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t}from"./bundle-mjs-C73ZY4La.js";import{D as n}from"./dist-BJuS9RKK.js";var r=n(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),i=t(e(),1);function a(e){let t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{r as n,a as t};
|