@lacneu/atrium 0.20.0 → 0.21.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-BpmHOH2b.js +1 -0
- package/dist/assets/{AdvancedFilter-DX4JYkKu.js → AdvancedFilter-BOBkqtk6.js} +1 -1
- package/dist/assets/AgentFilesTab-A7KIKZuy.js +3 -0
- package/dist/assets/AnomaliesTab-D1oMEdo7.js +1 -0
- package/dist/assets/AuditTab-CGfU9rSl.js +1 -0
- package/dist/assets/BridgeTab-wIiXQVx4.js +1 -0
- package/dist/assets/ChatDefaultsTab-BiAi9i7q.js +1 -0
- package/dist/assets/{DataTableShell-DBktq6d-.js → DataTableShell-DRaoMzdi.js} +1 -1
- package/dist/assets/{DetailChips-DH3IDw6I.js → DetailChips-BJRTpKvv.js} +1 -1
- package/dist/assets/FeedbacksTab-DXt9vggG.js +1 -0
- package/dist/assets/{FieldLabel-DEMPCo5Y.js → FieldLabel-DG-U2yJD.js} +1 -1
- package/dist/assets/FilesTab-D6N2e-YF.js +1 -0
- package/dist/assets/{FilterBar-Cu1qlC3G.js → FilterBar-BBJk4kP8.js} +1 -1
- package/dist/assets/GroupsTab-Bd8LlkxI.js +1 -0
- package/dist/assets/InstancesTab-0V2J2Qtq.js +1 -0
- package/dist/assets/IntegrationsTab-pGZl_dNY.js +1 -0
- package/dist/assets/{KpiTab-CmRckoHb.js → KpiTab-B3XVJcNt.js} +1 -1
- package/dist/assets/PreferencesTab-Cj6tC2ZE.js +1 -0
- package/dist/assets/PromptInjectionsTab-_BUqUmC6.js +3 -0
- package/dist/assets/RolesTab-PbMAqWrZ.js +1 -0
- package/dist/assets/ServiceAccountsTab-Bau7cms3.js +1 -0
- package/dist/assets/SubAgentReportsTab-CzaVSPFb.js +1 -0
- package/dist/assets/ThemeShowroom-COaylZ2W.js +1 -0
- package/dist/assets/{TimeRangePicker-BiV08HXf.js → TimeRangePicker-CAhWZBEI.js} +1 -1
- package/dist/assets/TracesTab-B0uGrcLJ.js +1 -0
- package/dist/assets/UsersTab-C6Ulyvwq.js +1 -0
- package/dist/assets/{button-BaP2jczn.js → button-CoB18od4.js} +1 -1
- package/dist/assets/{card-CU7PsoYg.js → card-4N7N5yEr.js} +1 -1
- package/dist/assets/chevrons-up-down-CaKfHJNA.js +1 -0
- package/dist/assets/{compatView-BHlLzBN_.js → compatView-5hziRv_l.js} +1 -1
- package/dist/assets/dispatchErrorInfo-DsgZO0if.js +1 -0
- package/dist/assets/{dist-DbxuL-_t.js → dist-B-U7A_Kp.js} +1 -1
- package/dist/assets/dist-BNEZtSYw.js +1 -0
- package/dist/assets/{dist-8unVbLZb.js → dist-BN_-yUvA.js} +1 -1
- package/dist/assets/{dist-BKPj1yrt.js → dist-C_wXViAC.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-BjMnUUGa.js → highlighted-body-OFNGDK62-ClkcrmUm.js} +1 -1
- package/dist/assets/index-B6IXWbc8.js +227 -0
- package/dist/assets/{index-FvrgGsz9.css → index-Baso9Ryo.css} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-BnwtjR3q.js +1 -0
- package/dist/assets/roleDescriptions-C3lIPjqc.js +1 -0
- package/dist/assets/{table-C5Ypy4Nm.js → table-CEVcfIlY.js} +1 -1
- package/dist/assets/{tabs-CIgCijas.js → tabs-DTsAt8vZ.js} +1 -1
- package/dist/assets/x-Dl0sHEar.js +1 -0
- package/dist/index.html +8 -8
- package/package.json +1 -1
- package/dist/assets/AccessTab-DnmomQlW.js +0 -1
- package/dist/assets/AgentFilesTab-M_jwk-Vm.js +0 -3
- package/dist/assets/AnomaliesTab-D_kmQ26T.js +0 -1
- package/dist/assets/AuditTab-BU2nYddz.js +0 -1
- package/dist/assets/BridgeTab-B4QV2N_w.js +0 -1
- package/dist/assets/ChatDefaultsTab-DkX706Gz.js +0 -1
- package/dist/assets/FeedbacksTab-DNz3elBZ.js +0 -1
- package/dist/assets/FilesTab-vGGdsYrR.js +0 -1
- package/dist/assets/GroupsTab-CiI1owjp.js +0 -1
- package/dist/assets/InstancesTab-DX1Hwp_V.js +0 -1
- package/dist/assets/IntegrationsTab-DNz616Lx.js +0 -1
- package/dist/assets/PreferencesTab-CtvFvgix.js +0 -1
- package/dist/assets/PromptInjectionsTab-URJKYApx.js +0 -3
- package/dist/assets/RolesTab-Byzw-5Kl.js +0 -1
- package/dist/assets/ServiceAccountsTab-mRDj-XeX.js +0 -1
- package/dist/assets/SubAgentReportsTab-BbTKsOCj.js +0 -1
- package/dist/assets/ThemeShowroom-v-RsWLjv.js +0 -1
- package/dist/assets/TracesTab-Cj4eWBiv.js +0 -1
- package/dist/assets/UsersTab-D4Stcb0l.js +0 -1
- package/dist/assets/chevrons-up-down-BdNhbQVr.js +0 -1
- package/dist/assets/dispatchErrorInfo-Cl5q_ZXy.js +0 -1
- package/dist/assets/dist-Dql2za7I.js +0 -1
- package/dist/assets/index-cf0xP0kN.js +0 -227
- package/dist/assets/mermaid-GHXKKRXX-DtvDzc6u.js +0 -1
- package/dist/assets/roleDescriptions-lVphvx8L.js +0 -1
- package/dist/assets/x-BpWCNC8c.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./index-B6IXWbc8.js";export{e as Mermaid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Jm as e,Xm as t,Ym as n,Zm as r,qm as i}from"./dist-B-U7A_Kp.js";var a={pending:r,user:t,admin:n,observer:e,agent:i};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o 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-B-U7A_Kp.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{HD as r,UD as i,WD as a,XD as o,ZD as s,n as c,qD as l,t as u}from"./dist-B-U7A_Kp.js";import{t as d}from"./dist-BNEZtSYw.js";import{dt as f,ft as p,pt as m}from"./index-B6IXWbc8.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=l(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,onValueChange:o,defaultValue:c,orientation:l=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=a({prop:i,onChange:o,defaultProp:c??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:r(),value:h,onValueChange:v,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(s.div,{dir:m,"data-orientation":l,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(s.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,c=S(E,n),l=b(n),u=A(c.baseId,r),d=j(c.baseId,r),p=r===c.value;return(0,g.jsx)(f,{asChild:!0,...l,focusable:!i,active:p,children:(0,g.jsx)(s.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":d,"data-state":p?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:u,...a,ref:t,onMouseDown:o(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?c.onValueChange(r):e.preventDefault()}),onKeyDown:o(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&c.onValueChange(r)}),onFocus:o(e.onFocus,()=>{let e=c.activationMode!==`manual`;!p&&!i&&e&&c.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:a,children:o,...c}=e,l=S(O,n),u=A(l.baseId,r),d=j(l.baseId,r),f=r===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(i,{present:a||f,children:({present:n})=>(0,g.jsx)(s.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:c(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=u(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:c(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:c(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:c(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aO as e}from"./dist-B-U7A_Kp.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
package/dist/index.html
CHANGED
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
|
|
39
39
|
})();
|
|
40
40
|
</script>
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-B6IXWbc8.js"></script>
|
|
42
42
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
|
|
43
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
44
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
45
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
46
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
48
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
49
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-B-U7A_Kp.js">
|
|
44
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BNEZtSYw.js">
|
|
45
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-BN_-yUvA.js">
|
|
46
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-C_wXViAC.js">
|
|
47
|
+
<link rel="modulepreload" crossorigin href="/assets/x-Dl0sHEar.js">
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/assets/button-CoB18od4.js">
|
|
49
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Baso9Ryo.css">
|
|
50
50
|
</head>
|
|
51
51
|
<body>
|
|
52
52
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacneu/atrium",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ao as r,Bo as i,Do as a,Fo as o,Io as s,Lo as c,Mo as l,No as u,Oo as d,Po as f,Ro as p,Vo as m,ZD as h,iO as g,jo as _,ko as v,wD as y,zo as b}from"./dist-DbxuL-_t.js";import{C as x,S,X as C,b as w,x as T,y as E}from"./index-cf0xP0kN.js";var D=t(e(),1);function O(e){return e===`user`?_():e===`all`?r():v({group:e.group})}function k(e){return e===`common`?d():e===`owner`?a():v({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=g(h.admin.listUsers,{}),[t,n]=(0,D.useState)(``),r=g(h.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(S,{size:`sm`,"aria-label":i(),children:(0,A.jsx)(x,{placeholder:i()})}),(0,A.jsx)(w,{children:(e??[]).map(e=>(0,A.jsx)(T,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):r===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:p()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:r.user.label}),(0,A.jsx)(C,{variant:`secondary`,children:r.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:c()}),r.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:r.groups.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:s()}),r.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:r.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(C,{variant:`default`,children:l()}):null,(0,A.jsx)(C,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(C,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:o()}),r.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:r.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(C,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:f()}),r.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:r.permissions.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$r as r,ED as i,Jr as a,Qr as o,Si as s,Xr as c,Yr as l,ZD as u,Zr as d,_i as ee,aa as f,ai as p,bi as te,ci as m,di as h,ei as g,fi as ne,gi as re,hS as _,hi as v,iO as y,ii as b,li as x,mi as ie,ni as S,oi as ae,pi as C,qr as w,ra as oe,ri as T,si as E,tO as D,ti as se,ui as O,vi as k,wD as A,xi as ce,yi as j}from"./dist-DbxuL-_t.js";import{t as M}from"./button-BaP2jczn.js";import{$ as N,A as P,B as F,C as I,F as le,I as ue,L as de,N as fe,P as pe,Q as me,R as he,S as L,X as R,b as z,et as ge,mt as B,nt as _e,ot as V,rt as ve,v as H,x as U,y as W,z as ye}from"./index-cf0xP0kN.js";import{i as G}from"./compatView-BHlLzBN_.js";/* empty css */var K=t(e(),1),q=2e4,J=6e4;function Y(e){return typeof e!=`number`||e<=0?0:Math.round(e/q*100)}function X(e){return e<=0?0:Math.round(e/J*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function be(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var xe=3;function Se(e,t){let n=new Map;for(let t of e.split(`
|
|
2
|
-
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
3
|
-
`))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<xe&&a.push(e)):t>0&&(i+=t,o.length<xe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function Ce(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function we(){let e=y(u.me.getMe,{host:V}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=y(u.admin.listInstances,e!==void 0&&t?{}:`skip`),[a,o]=(0,K.useState)(null);(0,K.useEffect)(()=>{!t||!r||r.length===0||(!a||!r.some(e=>e.name===a))&&o(r[0].name)},[t,r,a]);let c=y(u.agents.listAgentsForInstance,t&&a?{instanceName:a}:`skip`),l=y(u.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),d=(0,K.useMemo)(()=>{if(e!==void 0){if(t)return a===null||c===void 0?r!==void 0&&r.length===0?[]:void 0:c.agents.map(e=>({instanceName:a,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(l!==void 0)return l.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,a,c,r,l]),[f,p]=(0,K.useState)(null);(0,K.useEffect)(()=>{!d||d.length===0||(!f||!d.some(e=>$(e)===f))&&p($(d[0]))},[d,f]);let m=d?.find(e=>$(e)===f)??null,g=D(u.agentFiles.listAgentFiles),[_,b]=(0,K.useState)({status:`idle`}),x=m?.instanceName??null,S=m?.agentId??null,ae=y(u.compat.forInstance,n&&x!==null?{instanceName:x}:`skip`),w=n&&x!==null?H(ae,`agentFiles`):null,T=w===null?!1:w===`loading`?null:w.blocked,E=(0,K.useCallback)(async()=>{if(!(x===null||S===null)){b({status:`loading`});try{b({status:`done`,files:(await g({instanceName:x,agentId:S})).files})}catch{b({status:`error`})}}},[g,x,S]);(0,K.useEffect)(()=>{T===!1&&E()},[E,T]);let[se,N]=(0,K.useState)(null),P=i(),F=(0,K.useMemo)(()=>new Intl.NumberFormat(P,{maximumFractionDigits:0}),[P]);return e===void 0||d===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:s()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,Q.jsxs)(W,{value:a??``,onValueChange:e=>o(e),children:[(0,Q.jsx)(L,{size:`sm`,"aria-label":ce(),children:(0,Q.jsx)(I,{})}),(0,Q.jsx)(z,{children:(r??[]).map(e=>(0,Q.jsx)(U,{value:e.name,children:e.name},e.name))})]}):null,d.length>0?(0,Q.jsxs)(W,{value:f??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(L,{size:`sm`,"aria-label":te(),children:(0,Q.jsx)(I,{})}),(0,Q.jsx)(z,{children:d.map(e=>(0,Q.jsx)(U,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()})]}),m===null?null:w===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):w!==null&&w.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(B,{size:14,"aria-hidden":!0}),` `,G(w.gatewayVersion)]}):_.status===`loading`||_.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):_.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ee(),` `,(0,Q.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void E(),children:oe()})]}):_.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:k()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:_.files.map(e=>{let n=Y(e.size),r=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(R,{variant:`outline`,children:re()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:v({size:Z(e.size,P)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:ie({pct:F.format(n)})}),r?(0,Q.jsx)(B,{size:14,className:`oc-afiles__warn`,"aria-label":C()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>N(e),children:t?h():O()})]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:ne({used:Z(be(_.files),P),total:Z(J,P),pct:F.format(X(be(_.files)))})})]}),se&&m?(0,Q.jsx)(Te,{instanceName:m.instanceName,agentId:m.agentId,name:se.name,isAdmin:t,onClose:()=>N(null),onSaved:()=>void E()}):null]})}function Te({instanceName:e,agentId:t,name:n,isAdmin:s,onClose:ee,onSaved:te}){let h=D(u.agentFiles.getAgentFile),ne=D(u.agentFiles.setAgentFile),re=P(),[v,y]=(0,K.useState)(null),[ie,C]=(0,K.useState)(!1),[O,k]=(0,K.useState)(``),[ce,j]=(0,K.useState)(!1),[I,L]=(0,K.useState)(!1),[R,z]=(0,K.useState)(!1),[B,V]=(0,K.useState)(!1),H=(0,K.useCallback)(async r=>{C(!1);try{let i=await h({instanceName:e,agentId:t,name:n});y({content:i.content,updatedAtMs:i.updatedAtMs}),r||k(i.content),z(!1)}catch{C(!0)}},[h,e,t,n]);(0,K.useEffect)(()=>{H(!1)},[H]);async function U(){if(v!==null){L(!0),V(!1);try{await ne({instanceName:e,agentId:t,name:n,content:O,baseUpdatedAtMs:v.updatedAtMs??void 0}),re.success(T({name:n})),te(),await H(!1)}catch(e){Ce(e)?z(!0):V(!0)}finally{L(!1)}}}let W=v!==null&&O!==v.content,G=(0,K.useMemo)(()=>v===null?null:Se(v.content,O),[v,O]),J=O.length>q,Y=i(),X=(0,K.useMemo)(()=>new Intl.NumberFormat(Y),[Y]);return(0,Q.jsx)(me,{open:!0,onOpenChange:e=>!e&&ee(),children:(0,Q.jsxs)(N,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ve,{children:x({name:n})}),(0,Q.jsxs)(ge,{children:[m({agent:t,instance:e}),s?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,E()]})]})]}),ie?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[se(),` `,(0,Q.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void H(!1),children:oe()})]}):v===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:O,readOnly:!s,spellCheck:!1,onChange:e=>k(e.target.value),"aria-label":x({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:ae()}),R?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[g(),` `,(0,Q.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void H(!0),children:r()})]}):null,B?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:S()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${J?` is-over`:``}`,children:p({count:X.format(O.length),max:X.format(q)})}),s?(0,Q.jsx)(M,{size:`sm`,disabled:!W||I||R,onClick:()=>j(!0),children:I?f():b()}):null]})]}),(0,Q.jsx)(fe,{open:ce,onOpenChange:j,children:(0,Q.jsxs)(ue,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(F,{children:o({name:n})}),(0,Q.jsx)(de,{children:d({agent:t})})]}),G?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:c({added:G.added,removed:G.removed})}),G.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:l()}),G.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,G.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:a()}),G.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(he,{children:[(0,Q.jsx)(le,{children:_()}),(0,Q.jsx)(pe,{onClick:()=>void U(),children:w()})]})]})})]})})}export{we as AgentFilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$p as r,Am as i,Cm as a,Dm as o,Em as ee,Gp as s,Hp as c,Jp as te,Kp as ne,Om as l,Qp as re,Sm as u,Tm as d,Up as f,Wp as p,Xp as m,Yp as ie,ZD as h,Zp as ae,_m as oe,am as g,bm as se,cm as ce,dm as le,em as ue,fm as de,gm as fe,hm as pe,iO as _,im as me,km as v,lm as he,mm as ge,nm as y,om as b,pm as x,qp as S,rO as C,rm as w,sm as T,tm as E,um as D,vm as O,wm as k,xm as A,ym as j}from"./dist-DbxuL-_t.js";import{A as M,C as N,Mt as P,S as F,X as I,a as L,b as R,j as _e,jt as z,ot as ve,r as ye,x as B,y as V}from"./index-cf0xP0kN.js";import{n as be}from"./TimeRangePicker-BiV08HXf.js";import{t as xe}from"./FilterBar-Cu1qlC3G.js";import{t as Se}from"./DataTableShell-DBktq6d-.js";import{t as H}from"./dispatchErrorInfo-Cl5q_ZXy.js";var U=t(e(),1),W=n(),G=`__all__`,Ce=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function we(e){return e===`open`?i():e===`acknowledged`?v():l()}var Te=[`info`,`warn`,`critical`],Ee=[`detector`,`agent`,`user`],De={kind:`relative`,from:`now-30d`,to:`now`},Oe=200,K=`all`;function q(){let e=P({from:`/settings/anomalies`}),t=z({from:`/settings/anomalies`}),n=e.q??``,i=e.status===K?G:e.status,s=e.severity??G,c=e.kind??G,[l,f]=(0,U.useState)(G),p=ye(e.from,e.to),{from:v,to:H}=be(p),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,status:e===G?K:e})}),Y=e=>void t({search:t=>({...t,severity:e===G?void 0:e})}),Ne=e=>void t({search:t=>({...t,kind:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,...L(e)})}),Pe=_e(),Z=M(),Q=C(h.anomalies.resolveAnomaly),Fe=(_(h.me.getMe,{host:ve})?.permissions??[]).includes(`admin.manage`),$=_(h.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:v,to:H,anomalyStatus:i===G?void 0:i,severity:s===G?void 0:s,source:l===G?void 0:l,kind:c===G?void 0:c}}),Ie=(0,U.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Le=n!==``||i!==`open`||s!==G||l!==G||c!==G||p.kind!==`relative`||p.from!==De.from;function Re(){f(G),t({search:{status:`open`},replace:!0})}async function ze(e){if(await Pe({title:o(),description:(0,W.jsxs)(W.Fragment,{children:[ee(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,d(),` `,(0,W.jsx)(`strong`,{children:k()}),`.`,` `,a()]}),confirmLabel:u()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(A(),e.kind)}catch(e){Z.error(se(),e)}}async function Be(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(j(),e.kind)}catch(e){Z.error(O(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[oe(),` `,(0,W.jsx)(`strong`,{children:fe()}),` `,pe(),` `,(0,W.jsx)(`strong`,{children:ge()}),` `,x(),` `,(0,W.jsx)(`strong`,{children:de()}),` `,le(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:D()})]}),(0,W.jsxs)(xe,{q:n,onQChange:q,searchPlaceholder:he(),timeRange:p,onTimeRangeChange:X,onReset:Re,canReset:Le,children:[(0,W.jsxs)(V,{value:i,onValueChange:J,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:ce()}),Ce.map(e=>(0,W.jsx)(B,{value:e.value,children:we(e.value)},e.value))]})]}),(0,W.jsxs)(V,{value:s,onValueChange:Y,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:T()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:b()}),Te.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:l,onValueChange:f,children:[(0,W.jsx)(F,{size:`sm`,className:`w-32`,children:(0,W.jsx)(N,{placeholder:g()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:me()}),Ee.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:c,onValueChange:Ne,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:w()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:y()}),Ie.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Se,{title:E(),rows:$,emptyHint:i===`open`?ue():r(),rowActions:e=>Fe&&e.status===`open`?[{label:re(),onSelect:()=>void ze(e)},{label:ae(),onSelect:()=>void Be(e)}]:[],columns:[{header:m(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:w(),cell:e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:T(),cell:e=>(0,W.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:ie(),cell:e=>(0,W.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:g(),cell:e=>(0,W.jsx)(I,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:te(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:S(),cell:e=>(0,W.jsx)(ke,{row:e}),sort:e=>e.evidence??null},{header:ne(),cell:e=>e.correlationId?(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:Me(e.correlationId)}):(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function J(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Y(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function ke({row:e}){let t=z();if(e.kind===`subagent.failure`){let n=Y(e);return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,s()]}):null]})}let n=J(e);if(!n.dominantCode)return(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=H(n.dominantCode),i=n.sampleCorrelationId;return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,W.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,W.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,s()]}):null]})}function Ae({severity:e}){return(0,W.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function je({status:e}){return e===`open`?(0,W.jsx)(I,{variant:`destructive`,children:p()}):e===`acknowledged`?(0,W.jsx)(I,{variant:`secondary`,children:f()}):(0,W.jsx)(I,{variant:`outline`,children:c()})}function Me(e){return e.length>8?e.slice(0,8):e}export{q as AnomaliesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ah as r,Ch as i,Dh as a,Eh as o,Fh as s,Mh as c,Nh as l,Oh as u,Ph as ee,Sh as d,Th as f,ZD as p,iO as m,jh as h,kh as g,wh as _,xh as v}from"./dist-DbxuL-_t.js";import{C as y,Mt as b,S as x,a as S,b as C,i as w,jt as T,o as E,r as D,t as O,x as k,y as A}from"./index-cf0xP0kN.js";import{n as j}from"./TimeRangePicker-BiV08HXf.js";import{t as M}from"./FilterBar-Cu1qlC3G.js";import{t as N}from"./AdvancedFilter-DX4JYkKu.js";import{t as P}from"./DataTableShell-DBktq6d-.js";var F=t(e(),1),I=n(),L={kind:`relative`,from:O,to:`now`},R=`__all__`,z=[{value:`action`,label:`action`},{value:`realLabel`,label:`acteur réel`},{value:`targetLabel`,label:`au nom de`},{value:`impersonated`,label:`usurpation`},{value:`resource`,label:`ressource`},{value:`resourceId`,label:`id ressource`}];function B(){let e=b({from:`/settings/audit`}),t=T({from:`/settings/audit`}),n=e.q??``,O=e.action??R,B=e.impersonated??R,V=e.resource??R,H=D(e.from,e.to),U=(0,F.useMemo)(()=>E(e.adv),[e.adv]),{from:W,to:G}=j(H),K=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),q=e=>void t({search:t=>({...t,action:e===R?void 0:e})}),J=e=>void t({search:t=>({...t,impersonated:e===R?void 0:e})}),Y=e=>void t({search:t=>({...t,resource:e===R?void 0:e})}),X=e=>void t({search:t=>({...t,...S(e)})}),Z=e=>void t({search:t=>({...t,adv:w(e)}),replace:!0}),Q=m(p.admin.listAudit,{filter:{q:n||void 0,from:W,to:G,action:O===R?void 0:O,resource:V===R?void 0:V,impersonated:B===R?void 0:B===`yes`,advanced:U.length>0?U:void 0}}),$=(0,F.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.action);return[...e].sort()},[Q]),te=(0,F.useMemo)(()=>{let e=new Set;for(let t of Q??[])t.resource&&e.add(t.resource);return[...e].sort()},[Q]),ne=n!==``||O!==R||B!==R||V!==R||U.length>0||H.kind!==`relative`||H.from!==L.from;function re(){t({search:{},replace:!0})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[s(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:ee()})]}),(0,I.jsxs)(M,{q:n,onQChange:K,searchPlaceholder:l(),timeRange:H,onTimeRangeChange:X,onReset:re,canReset:ne,children:[(0,I.jsxs)(A,{value:O,onValueChange:q,children:[(0,I.jsx)(x,{size:`sm`,className:`w-40`,children:(0,I.jsx)(y,{placeholder:c()})}),(0,I.jsxs)(C,{children:[(0,I.jsx)(k,{value:R,children:h()}),$.map(e=>(0,I.jsx)(k,{value:e,children:e},e))]})]}),(0,I.jsxs)(A,{value:B,onValueChange:J,children:[(0,I.jsx)(x,{size:`sm`,className:`w-40`,children:(0,I.jsx)(y,{})}),(0,I.jsxs)(C,{children:[(0,I.jsx)(k,{value:R,children:r()}),(0,I.jsx)(k,{value:`yes`,children:g()}),(0,I.jsx)(k,{value:`no`,children:u()})]})]}),(0,I.jsxs)(A,{value:V,onValueChange:Y,children:[(0,I.jsx)(x,{size:`sm`,className:`w-40`,children:(0,I.jsx)(y,{placeholder:a()})}),(0,I.jsxs)(C,{children:[(0,I.jsx)(k,{value:R,children:o()}),te.map(e=>(0,I.jsx)(k,{value:e,children:e},e))]})]})]}),(0,I.jsx)(N,{fields:z,seed:U,onChange:Z}),(0,I.jsx)(P,{title:f(),rows:Q,emptyHint:_(),columns:[{header:i(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:c(),cell:e=>e.action,sort:e=>e.action},{header:d(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:v(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:a(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{B as AuditTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,Ad as i,Ar as a,Au as o,Bd as s,Bu as c,Cr as l,Cu as u,Dr as d,Du as f,Er as p,Eu as m,Fd as h,Fu as g,Gu as _,Hd as v,Hu as y,Id as ee,Iu as te,Ju as ne,Ku as b,Ld as re,Lu as ie,Mr as ae,Mu as oe,Nd as se,Nu as x,Or as ce,Ou as le,Pd as ue,Pu as de,QD as S,Qu as fe,Rd as pe,Ru as me,Sr as he,Su as ge,Tr as _e,Tu as ve,Ud as ye,Uu as be,Vu as xe,Wu as Se,Xu as Ce,Yu as we,ZD as C,Zu as Te,ad as Ee,br as De,bu as w,ed as Oe,hr as ke,iO as T,id as Ae,jr as je,ju as Me,kd as Ne,kr as Pe,ku as Fe,nd as Ie,od as Le,qu as Re,rO as ze,rd as Be,sd as Ve,tO as He,td as Ue,wr as We,wu as Ge,xr as Ke,xu as E,yr as qe,yu as D,zd as Je,zu as Ye}from"./dist-DbxuL-_t.js";import{i as O,r as Xe}from"./dist-Dql2za7I.js";import{t as Ze}from"./chevrons-up-down-BdNhbQVr.js";import{i as Qe,n as k,o as $e,r as et,s as tt}from"./FieldLabel-DEMPCo5Y.js";import{t as nt}from"./button-BaP2jczn.js";import{$ as rt,A as it,At as at,C as A,H as ot,Q as st,S as j,St as ct,U as lt,V as ut,X as M,Z as N,_ as dt,_t as ft,b as P,et as pt,jt as mt,kt as F,mt as I,nt as ht,ot as gt,rt as _t,x as L,y as R}from"./index-cf0xP0kN.js";import{a as vt,i as z,n as yt,o as B,r as V,t as bt}from"./table-C5Ypy4Nm.js";import{t as xt}from"./FilterBar-Cu1qlC3G.js";import{a as H,n as St,o as U,r as W,s as Ct,t as wt}from"./compatView-BHlLzBN_.js";import{t as G}from"./dispatchErrorInfo-Cl5q_ZXy.js";var Tt=S(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Et=S(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),K=t(e(),1);function q(e){return e.filter(e=>e.state===`error`)}function Dt(e){return e.reachable&&q(e.targets).length===0}function Ot(e){return e.state===`error`&&e.lastErrorCode!==null}function kt(e){return!!e.lastDownstreamRejectCode}function J(e){return e.kind??`openclaw`}function At(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function jt(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,J(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(J(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return At(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>J(e)===r)}))}function Mt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,Nt={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function Pt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Ft(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function It(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Lt(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return U(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function Rt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=It(t.key,e),a=It(t.key,r);return i&&a?0:i?1:a?-1:n*Lt(t.key,e,r)})}function zt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function Bt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function Vt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>U(e,t)??Z(e,t))}var Q=n();function Ht({connections:e,displayByInstance:t}){let[n,r]=(0,K.useState)(Nt),[i,a]=(0,K.useState)(null),s=(0,K.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),c=(0,K.useMemo)(()=>zt(s),[s]),l=(0,K.useMemo)(()=>Bt(s),[s]),d=(0,K.useMemo)(()=>Vt(s),[s]),p=(0,K.useMemo)(()=>Rt(Ft(s,n),i),[s,n,i]);function h(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(xt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:de(),onReset:()=>r(Nt),canReset:Pt(n),children:[(0,Q.jsxs)(R,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(A,{placeholder:oe()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(L,{value:Y,children:x()}),c.map(e=>(0,Q.jsx)(L,{value:e,children:Wt(e)},e))]})]}),(0,Q.jsxs)(R,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(A,{placeholder:Me()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(L,{value:Y,children:x()}),l.map(e=>(0,Q.jsx)(L,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(R,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(A,{placeholder:o()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(L,{value:Y,children:x()}),d.map(e=>(0,Q.jsx)(L,{value:e,children:e},e))]})]})]}),p.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):(0,Q.jsxs)(bt,{className:`oc-conn__table`,children:[(0,Q.jsx)(vt,{children:(0,Q.jsxs)(B,{children:[(0,Q.jsx)($,{label:le(),sortKey:`target`,sort:i,onSort:h}),(0,Q.jsx)($,{label:f(),sortKey:`state`,sort:i,onSort:h}),(0,Q.jsx)($,{label:m(),sortKey:`instance`,sort:i,onSort:h}),(0,Q.jsx)($,{label:ve(),sortKey:`host`,sort:i,onSort:h}),(0,Q.jsx)($,{label:Ge(),sortKey:`version`,sort:i,onSort:h}),(0,Q.jsx)(z,{children:u()}),(0,Q.jsx)($,{label:ge(),sortKey:`lastOk`,sort:i,onSort:h})]})}),(0,Q.jsx)(yt,{children:p.map(e=>(0,Q.jsx)(Ut,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(z,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(Xe,{size:13,"aria-hidden":!0}):(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Ze,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Ut({r:e}){let t=Ot(e)?G(e.lastErrorCode):null,n=kt(e)?G(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(K.Fragment,{children:[(0,Q.jsxs)(B,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(V,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(V,{children:(0,Q.jsx)(Gt,{state:e.state})}),(0,Q.jsx)(V,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(V,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(V,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(V,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:te({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(V,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(B,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(V,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[g({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Wt(e){return e===`connected`?E():e===`error`?w():D()}function Gt({state:e}){return e===`connected`?(0,Q.jsx)(M,{variant:`secondary`,children:E()}):e===`error`?(0,Q.jsx)(M,{variant:`destructive`,children:w()}):(0,Q.jsx)(M,{variant:`outline`,children:D()})}function Kt(){return T(C.bridgeHealth.getBridgeHealth,{})}function qt(){let e=Kt(),t=T(C.compat.getBridgeCompat,{}),n=T(C.me.getMe,{host:gt})?.role===`admin`,r=T(C.admin.listInstances,n?{}:`skip`),i=mt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=jt(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&St(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(Jt,{health:e,compat:t,onSeeAnomalies:a}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:Re()}),o.map(e=>(0,Q.jsx)(Yt,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}):null]})}function Jt({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,o=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:H(t.bridgeVersion)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:a(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,Pe({build:t.buildVersion??`?`})]}):null,` · `,ce(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?d():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:_()});let s=q(e.targets),l=!e.reachable,u=Dt(e),f=u?`ok`:`error`,p=new Date(e.checkedAt).toLocaleString(`fr-FR`),m=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${f}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u?(0,Q.jsx)(F,{size:22}):l?(0,Q.jsx)(Et,{size:22}):(0,Q.jsx)(I,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:u?Se():l?be():y({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Tt,{size:12,"aria-hidden":!0}),` `,xe({time:p})]}),m?(0,Q.jsx)(`span`,{children:c({time:m})}):null,o]}),l?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:G(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:Ye()})]})}function Yt({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?Ct(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:wt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,K.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(ft,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Mt(e)}),d?(0,Q.jsx)(M,{variant:d===`beyond`?`destructive`:`secondary`,children:W(d)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:ae()}),(0,Q.jsx)(Xt,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c}),(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(at,{size:13,"aria-hidden":!0}),me({count:t.length})]}),f?(0,Q.jsx)(Ht,{connections:t,displayByInstance:s}):null]})}function Xt({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:je()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:p()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:We()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:l({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:d()}),e?(0,Q.jsx)(en,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:H(e.version)}),(0,Q.jsx)(M,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:W(e.state)})]},e.instanceName))})]})}function Zt({instance:e,onClose:t}){return(0,Q.jsx)(st,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(rt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(ht,{children:[(0,Q.jsx)(_t,{children:ye({instance:e.displayName??e.name})}),(0,Q.jsx)(pt,{children:v()})]}),(0,Q.jsx)($t,{instance:e,onClose:t})]})})}function Qt({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(F,{"aria-hidden":!0}):(0,Q.jsx)(I,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?Te():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,Ce()]}):null}function $t({instance:e,onClose:t}){let n=ze(C.admin.upsertInstanceConfig),a=He(C.bridge.validateMediaPaths),o=it(),[c,l]=(0,K.useState)(()=>Qe(e.config??{})),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,g]=(0,K.useState)(null),_=c.inboundMediaMode===`shared-fs`,v=c.mediaMode===`shared-fs`,y=_||v;async function te(){p(!0),g(null);try{g(await a({instanceName:e.name,inboundMediaMode:c.inboundMediaMode,mediaMode:c.mediaMode}))}catch(e){o.error(Ue(),e)}finally{p(!1)}}async function b(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:et(c,r)}),t()}catch(e){o.error(h(),e)}finally{d(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:s(),help:ue()}),(0,Q.jsxs)(R,{value:c.mediaMode,onValueChange:e=>l({...c,mediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(A,{})}),(0,Q.jsx)(P,{children:tt.map(e=>(0,Q.jsx)(L,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Je(),help:se()}),(0,Q.jsxs)(R,{value:c.inboundMediaMode,onValueChange:e=>l({...c,inboundMediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(A,{})}),(0,Q.jsx)(P,{children:$e.map(e=>(0,Q.jsx)(L,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:pe(),help:i()}),(0,Q.jsx)(N,{type:`number`,min:1,max:4096,className:`w-full`,value:c.mediaMaxMb,onChange:e=>l({...c,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),y&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[_&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Ve(),help:Le()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:c.inboundAgentMount,onChange:e=>l({...c,inboundAgentMount:e.target.value})})]}),v&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Ee(),help:Ae()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:c.outboundAgentMount,onChange:e=>l({...c,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(dt,{checked:c.rehydration,onCheckedChange:e=>l({...c,rehydration:e===!0})}),(0,Q.jsx)(k,{label:re(),help:Ne()})]}),y&&m!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:m.reachable?!m.inbound&&!m.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),ne({reason:m.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Qt,{label:r(),result:m.inbound}),(0,Q.jsx)(Qt,{label:fe(),result:m.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),we()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[y&&(0,Q.jsxs)(nt,{variant:`outline`,size:`sm`,onClick:()=>void te(),disabled:f,children:[f?(0,Q.jsx)(ct,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?Ie():Be()]}),(0,Q.jsx)(nt,{size:`sm`,onClick:()=>void b(),disabled:u,children:ee()})]})]})})}function en({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(ut,{children:[(0,Q.jsx)(lt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?he():Ke({count:e.length}),(0,Q.jsx)(O,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(ot,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:De()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(M,{variant:`secondary`,children:e},e))})]})]})}export{qt as BridgeTab,Zt as InstanceConfigDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Br as i,Fr as a,Gr as o,Hr as s,Ir as c,Lr as l,Nr as u,Pr as d,Qi as f,Rr as p,Ur as ee,Vd as m,Vr as te,Wr as ne,ZD as h,aa as g,h as _,hS as re,iO as v,m as y,p as b,rO as x,ra as ie,tO as S,wD as C,xi as w,zr as T}from"./dist-DbxuL-_t.js";import{t as E}from"./button-BaP2jczn.js";import{A as ae,B as oe,C as D,F as se,I as ce,L as le,N as ue,P as de,R as fe,S as pe,Z as O,b as me,g as he,h as k,mt as A,v as j,x as M,y as N,z as P}from"./index-cf0xP0kN.js";import{i as F}from"./compatView-BHlLzBN_.js";/* empty css */var I=t(e(),1),L=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function ge(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}var R=n();function _e({instance:e}){let t=x(h.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,I.useState)(n===null?``:String(n)),[a,o]=(0,I.useState)(`idle`);(0,I.useEffect)(()=>{i(n===null?``:String(n)),o(`idle`)},[e._id,n]);let s=r.trim(),c=s===``?null:/^\d+$/.test(s)?Number.parseInt(s,10):NaN,u=c===null||Number.isInteger(c)&&c>=1e3&&c<=2e5,d=(c??null)!==n;async function f(){o(`saving`);try{let n={...e.config??{}};c===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=c,await t({instanceId:e._id,config:n}),o(`done`)}catch{o(`error`)}}return(0,R.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,R.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()}),(0,R.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,R.jsx)(O,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:r,onChange:e=>i(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!u}),(0,R.jsx)(E,{size:`sm`,disabled:!d||!u||a===`saving`,onClick:()=>void f(),children:a===`saving`?g():T()})]}),u?null:(0,R.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:b()}),a===`done`?(0,R.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:p()}):null,a===`error`?(0,R.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:l()}):null,(0,R.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]})}function z(){let e=S(h.agentFiles.getChatDefaults),t=S(h.agentFiles.setChatDefaults),n=ae(),[_,y]=(0,I.useState)({status:`loading`}),[b,x]=(0,I.useState)({thinkingDefault:null,fastModeDefault:null}),[O,z]=(0,I.useState)(!1),[B,V]=(0,I.useState)(!1),H=v(h.admin.listInstances,{}),[U,W]=(0,I.useState)(null);(0,I.useEffect)(()=>{!H||H.length===0||(!U||!H.some(e=>e.name===U))&&W(H[0].name)},[H,U]);let G=(H?.length??0)>1,ve=H!==void 0&&H.length===0,ye=v(h.compat.forInstance,U?{instanceName:U}:`skip`),K=U?j(ye,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,I.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,I.useRef)(0),X=(0,I.useCallback)(async()=>{let t=++Y.current;y({status:`loading`});try{let n=ge(await e(J));if(Y.current!==t)return;y({status:`done`,current:n}),x(n)}catch{if(Y.current!==t)return;y({status:`error`})}},[e,J]);(0,I.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=_.status===`done`?_.current:null,Q=Z!==null&&b.thinkingDefault!==null&&b.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&b.fastModeDefault!==null&&b.fastModeDefault!==Z.fastModeDefault,be=Q||$;async function xe(){V(!0);try{await t({...J,...Q?{thinkingDefault:b.thinkingDefault}:{},...$?{fastModeDefault:b.fastModeDefault}:{}}),n.success(p()),await X()}catch(e){n.error(l(),e)}finally{V(!1)}}let Se=(0,I.useMemo)(()=>L.map(e=>({id:e,label:he(e)})),[]),Ce=(0,I.useMemo)(()=>[{id:`fast`,label:r()},{id:`standard`,label:f()}],[]);return(0,R.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),G&&U?(0,R.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,R.jsx)(`span`,{className:`oc-cdefaults__label`,children:w()}),(0,R.jsxs)(N,{value:U,onValueChange:e=>W(e),disabled:B,children:[(0,R.jsx)(pe,{size:`sm`,"aria-label":w(),children:(0,R.jsx)(D,{})}),(0,R.jsx)(me,{children:(H??[]).map(e=>(0,R.jsx)(M,{value:e.name,children:e.name},e.name))})]})]}):null,ve?(0,R.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:m()}):K===`loading`?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):K.blocked?(0,R.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,R.jsx)(A,{size:14,"aria-hidden":!0}),` `,F(K.gatewayVersion)]}):_.status===`loading`?(0,R.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):_.status===`error`?(0,R.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[i(),` `,(0,R.jsx)(E,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:ie()})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,R.jsx)(`span`,{className:`oc-cdefaults__label`,children:ne()}),(0,R.jsx)(k,{options:Se,value:b.thinkingDefault,onChange:e=>x({...b,thinkingDefault:e}),disabled:B}),(0,R.jsx)(`p`,{className:`oc-cdefaults__help`,children:ee()})]}),(0,R.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,R.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()}),(0,R.jsx)(k,{options:Ce,value:b.fastModeDefault===null?null:b.fastModeDefault?`fast`:`standard`,onChange:e=>x({...b,fastModeDefault:e===`fast`}),disabled:B}),(0,R.jsx)(`p`,{className:`oc-cdefaults__help`,children:te()})]}),(0,R.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,R.jsx)(E,{size:`sm`,disabled:!be||B,onClick:()=>z(!0),children:B?g():T()})}),(0,R.jsx)(`p`,{className:`oc-cdefaults__note`,children:c()})]}),(()=>{let e=H?.find(e=>e.name===(U??H[0]?.name));return e?(0,R.jsx)(_e,{instance:e}):null})(),(0,R.jsx)(ue,{open:O,onOpenChange:z,children:(0,R.jsxs)(ce,{children:[(0,R.jsxs)(P,{children:[(0,R.jsx)(oe,{children:a()}),(0,R.jsx)(le,{children:d()})]}),(0,R.jsxs)(fe,{children:[(0,R.jsx)(se,{children:re()}),(0,R.jsx)(de,{onClick:()=>void xe(),children:u()})]})]})})]})}export{z as ChatDefaultsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,Av as i,Bv as a,Cv as o,Dv as s,Ev as c,Fv as l,Gv as u,Hv as d,Iv as f,Jv as p,Kv as m,Lv as ee,Mv as h,Nv as g,Ov as _,Pv as v,Q_ as y,Rv as te,Sv as ne,Tv as re,Uv as b,Vv as ie,Wv as x,X_ as S,Xv as C,Yv as w,ZD as T,Z_ as E,Zv as D,_v as O,av as k,bv as A,cv as j,dv as M,ev as N,fv as P,gv as F,hv as I,iO as L,iv as R,jv as z,kv as B,lv as ae,mv as V,nv as H,ov as U,pv as W,qv as G,rO as K,rv as q,sv as J,tv as oe,uv as se,vv as ce,wv as le,xv as ue,yv as de,zv as fe}from"./dist-DbxuL-_t.js";import{t as pe}from"./button-BaP2jczn.js";import{j as me}from"./index-cf0xP0kN.js";import{t as he}from"./DataTableShell-DBktq6d-.js";var Y=t(e(),1),X=n(),Z={altered_words:()=>D(),incorrect:()=>C(),incoherence:()=>w(),formatting:()=>p(),latency:()=>G(),api_error:()=>m(),other:()=>u()},Q=e=>Z[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:b()}):e===!1?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:d()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:x()})}function ge({data:e,closeReason:t}){let n=e.snapshot,r=K(T.feedback.respondToFeedback),[u,d]=(0,Y.useState)(e.thread),[p,m]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1);async function x(){let t=p.trim();if(!(!t||y)){b(!0);try{await r({feedbackId:e._id,text:t}),d(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),m(``)}finally{b(!1)}}}let S=[];try{S=n.contextJson?JSON.parse(n.contextJson):[]}catch{S=[]}return(0,X.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,X.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,X.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,X.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${ie()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:a()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:H()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:fe()}),u.length>0?(0,X.jsx)(`div`,{className:`oc-fbadmin__thread`,children:u.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,X.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?te():ee()}),(0,X.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,X.jsx)(`p`,{className:`oc-fbadmin__meta`,children:f()}),(0,X.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:l(),value:p,maxLength:2e3,rows:3,onChange:e=>m(e.target.value.slice(0,2e3))}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,X.jsx)(pe,{size:`sm`,onClick:()=>void x(),disabled:!p.trim()||y,children:y?v():g()})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:h()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||z()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:i()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||z()})]}):null,n.promptText?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:B()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,S.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:_({count:n.contextCount??S.length,truncated:n.contextTruncated?s():``})}),(0,X.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:S.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:c()}),(0,X.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:le()}),(0,X.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?o({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,X.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[ne(),` `,n.clientInfo.plugins.join(`, `),(0,X.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,ue()]})]}):null,n.clientInfo?.userAgent?(0,X.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function _e(){let e=L(T.feedback.listForAdmin,{}),t=K(T.feedback.readSnapshot),n=K(T.feedback.deleteFeedback),i=me(),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)({});async function l(e){if(a===e._id){o(null);return}if(!s[e._id]){let n=await t({feedbackId:e._id});c(t=>({...t,[e._id]:n}))}o(e._id)}async function u(e){await i({title:y(),description:E(),confirmLabel:S(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&o(null))}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[A(),` `,(0,X.jsx)(`strong`,{children:de()}),` `,ce()]}),(0,X.jsx)(he,{title:O(),rows:e,emptyHint:F(),isExpanded:e=>a===e._id&&!!s[e._id],renderExpanded:e=>s[e._id]?(0,X.jsx)(ge,{data:s[e._id],closeReason:e.userCloseReason}):null,columns:[{header:I(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:V(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:W(),cell:e=>e.messageRole===`user`?P():M(),sort:e=>e.messageRole},{header:se(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${ae({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:j(),cell:e=>(0,X.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:J(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:U(),cell:e=>e.userClosedAt==null?e.answered?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:k()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:R()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:q()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:a===e._id?oe():N(),onSelect:()=>void l(e)},{label:r(),onSelect:()=>void u(e),variant:`destructive`}]})]})}export{_e as FeedbacksTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,AE as ee,BE as i,CE as te,DE as ne,ED as re,EE as ie,FE as ae,GE as a,HE as o,IE as s,JE as c,KE as l,LE as u,ME as d,NE as oe,OE as se,PE as ce,QE as f,RE as le,SE as ue,TE as de,UE as p,VE as m,WE as h,XE as fe,YE as pe,ZD as g,ZE as me,eD as he,hS as ge,iO as _e,jE as ve,kE as _,nD as v,qE as y,rO as b,tD as x,wD as S,wE as C,xE as w,zE as T}from"./dist-DbxuL-_t.js";import{t as E}from"./button-BaP2jczn.js";import{A as D,B as O,C as k,Et as A,F as j,G as M,I as N,K as P,L as F,N as ye,P as be,R as xe,S as I,Tt as Se,W as Ce,X as we,Y as Te,b as L,ht as Ee,x as R,y as z,yt as De,z as Oe}from"./index-cf0xP0kN.js";import{a as ke,i as B,n as Ae,o as V,r as H,t as je}from"./table-C5Ypy4Nm.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return a();case`audio`:return h();case`video`:return p();case`pdf`:return o();case`document`:return m();case`archive`:return i();default:return T()}}function q(){let[e,t]=(0,U.useState)(G),[n,i]=(0,U.useState)(G),[a,o]=(0,U.useState)(G),[p,m]=(0,U.useState)(G),[h,T]=(0,U.useState)(null),q=b(g.files.softDelete),J=D();function Me(){t(G),i(G),o(G),m(G)}async function Ne(){let e=h;if(T(null),e)try{await q({fileId:e.id}),J.success(se())}catch(e){J.error(ne(),e)}}let Y=_e(g.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:a===G?void 0:a,category:p===G?void 0:p}),X=(0,U.useMemo)(()=>new Intl.DateTimeFormat(re(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(Y===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:S()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=Y,$=e!==G||n!==G||a!==G||p!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:v()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(z,{value:e,onValueChange:t,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":x(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:he()}),(0,W.jsx)(R,{value:`inbound`,children:r()}),(0,W.jsx)(R,{value:`outbound`,children:f()})]})]}),(0,W.jsxs)(z,{value:n,onValueChange:i,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":me(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:fe()}),Q.chats.map(e=>(0,W.jsx)(R,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(z,{value:a,onValueChange:o,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":pe(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:c()}),Q.instances.map(e=>(0,W.jsx)(R,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(z,{value:p,onValueChange:m,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":y(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:l()}),Q.categories.map(e=>(0,W.jsx)(R,{value:e,children:K(e)},e))]})]}),$?(0,W.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:Me,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(De,{size:14,"aria-hidden":!0}),ve()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?ue():te()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(je,{children:[(0,W.jsx)(ke,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:le()}),(0,W.jsx)(B,{children:u()}),(0,W.jsx)(B,{children:s()}),(0,W.jsx)(B,{children:ae()}),(0,W.jsx)(B,{children:ce()}),(0,W.jsx)(B,{className:`text-right`,children:oe()})]})}),(0,W.jsx)(Ae,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsx)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(we,{variant:`secondary`,children:e.direction===`inbound`?r():f()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:X.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(Ce,{children:[(0,W.jsx)(Te,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":ee(),children:(0,W.jsx)(Se,{size:16})})}),(0,W.jsxs)(M,{align:`end`,children:[e.url?(0,W.jsx)(P,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(A,{size:14}),d()]})}):(0,W.jsxs)(P,{disabled:!0,children:[(0,W.jsx)(A,{size:14}),C()]}),(0,W.jsxs)(P,{variant:`destructive`,onSelect:()=>T({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Ee,{size:14}),_()]})]})]})})]},e._id))})]}),Pe?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:w({cap:Fe})}):null]}),(0,W.jsx)(ye,{open:h!==null,onOpenChange:e=>!e&&T(null),children:(0,W.jsxs)(N,{children:[(0,W.jsxs)(Oe,{children:[(0,W.jsx)(O,{children:ie()}),(0,W.jsx)(F,{children:de()})]}),(0,W.jsxs)(xe,{children:[(0,W.jsx)(j,{children:ge()}),(0,W.jsx)(be,{onClick:()=>void Ne(),children:_()})]})]})})]})}export{q as FilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,Aa as i,Ba as a,Ca as o,Co as s,Da as c,Ea as l,Eo as u,Fa as d,Ga as f,Ha as p,Ia as m,Ja as h,Ka as g,La as _,Ma as v,Na as y,Oa as b,Pa as x,QD as S,Qa as ee,Ra as te,Sa as ne,So as C,Ta as re,To as w,Ua as T,Va as E,Wa as ie,Xa as D,Ya as ae,ZD as O,Za as k,_a as A,_o as j,ao as M,ba as oe,bo as se,co as N,do as ce,eo as le,fo as P,go as F,ho as ue,iO as I,io as de,ja as fe,ka as pe,lo as me,mo as he,no as ge,oo as _e,po as ve,qa as ye,rO as L,ro as be,so as xe,to as Se,uo as Ce,va as we,vo as Te,wa as Ee,wo as De,xa as R,xo as Oe,ya as ke,yo as Ae,za as je}from"./dist-DbxuL-_t.js";import{t as Me}from"./x-BpWCNC8c.js";import{i as z,n as B,r as Ne,t as Pe}from"./tabs-CIgCijas.js";import{t as V}from"./button-BaP2jczn.js";import{$ as Fe,A as H,At as Ie,C as Le,Q as Re,S as ze,X as U,Z as W,_ as G,_t as K,b as Be,et as Ve,gt as q,j as He,m as Ue,nt as We,ot as Ge,rt as Ke,x as qe,y as Je}from"./index-cf0xP0kN.js";import{t as Ye}from"./FilterBar-Cu1qlC3G.js";import{t as Xe}from"./DataTableShell-DBktq6d-.js";import{t as J}from"./DetailChips-DH3IDw6I.js";var Ze=S(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Qe=S(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Y=S(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),$e=S(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),X=t(e(),1);function et(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function tt(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function nt(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function rt(e){switch(e){case`admin`:return ye();case`user`:return g();case`pending`:return f();default:return e}}function Z(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function it(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var Q=n(),$={name:``,description:``};function at(){let e=I(O.groups.listGroups,{}),t=I(O.me.getMe,{host:Ge})?.role===`admin`,n=L(O.groups.createGroup),r=L(O.groups.updateGroup),i=L(O.groups.deleteGroup),a=He(),o=H(),[c,l]=(0,X.useState)(!1),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)($),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(``),y=(0,X.useMemo)(()=>{if(!e)return e;let t=_.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,_]);function b(){f(null),m($),l(!0)}function x(e){f(e),m({name:e.name,description:e.description??``}),l(!0)}async function S(){try{d?await r({groupId:d._id,name:p.name,description:p.description}):await n({name:p.name,description:p.description||void 0}),m($),f(null),l(!1)}catch(e){o.error(oe(),e)}}async function ee(e){if(await a({title:xe({name:e.name}),description:_e(),confirmWord:e.name,confirmLabel:M(),cancelLabel:ve(),destructive:!0}))try{await i({groupId:e._id})}catch(e){o.error(ke(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}),(0,Q.jsx)(Ye,{q:_,onQChange:v,onReset:()=>v(``),canReset:_!==``,searchPlaceholder:Te()}),(0,Q.jsx)(Xe,{title:u(),rows:y,addLabel:De(),onAdd:t?b:void 0,emptyHint:s(),columns:[{header:C(),cell:e=>e.name,sort:e=>e.name},{header:Oe(),cell:e=>(0,Q.jsx)(J,{icon:(0,Q.jsx)($e,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Q.jsx)(Y,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:se(),cell:e=>(0,Q.jsx)(J,{icon:(0,Q.jsx)(K,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:Ae(),cell:e=>(0,Q.jsx)(J,{icon:(0,Q.jsx)(Qe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Q.jsx)(q,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:j(),onSelect:()=>g({groupId:e._id,name:e.name})},...t?[{label:F(),onSelect:()=>x(e)},{label:ue(),variant:`destructive`,onSelect:()=>void ee(e)}]:[]]}),(0,Q.jsx)(Ue,{open:c,onOpenChange:l,title:d?ce():P(),description:Ce(),canSubmit:!!p.name.trim(),onSubmit:S,submitLabel:he(),children:(0,Q.jsxs)(`div`,{className:`oc-form`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:me()}),(0,Q.jsx)(W,{value:p.name,onChange:e=>m({...p,name:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:N()}),(0,Q.jsx)(W,{value:p.description,onChange:e=>m({...p,description:e.target.value})})]})]})}),(0,Q.jsx)(ct,{groupId:h?.groupId??null,groupName:h?.name??``,open:h!==null,onOpenChange:e=>{e||g(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Q.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Q.jsxs)(V,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Q.jsx)(Ze,{size:14,"aria-hidden":!0}),D()]}),(0,Q.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":h({page:e,pages:t}),children:[e,` / `,t]}),(0,Q.jsxs)(V,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[ae(),(0,Q.jsx)(Ie,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:i}){let s=I(O.groups.getGroup,n&&e?{groupId:e}:`skip`),c=I(O.groups.listAssignableInstances,n?{}:`skip`),l=I(O.groups.listAssignableUsers,n?{}:`skip`),u=L(O.groups.addMember),d=L(O.groups.removeMember),f=L(O.groups.bulkSetMembers),m=L(O.groups.setGroupManager),h=H(),[g,_]=(0,X.useState)(``),[v,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(`members`),[te,C]=(0,X.useState)(1),[w,T]=(0,X.useState)(new Set),E=(0,X.useRef)(null),D=(0,X.useMemo)(()=>new Set((s?.members??[]).map(e=>e.userId)),[s]),ae=(0,X.useMemo)(()=>new Set((s?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[s]),A=s?.viewerIsAdmin===!0,j=(0,X.useMemo)(()=>new Set((s?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[s]);(0,X.useEffect)(()=>{_(``),b(``),S(`members`),C(1),E.current=null},[n,e]),(0,X.useEffect)(()=>{C(1)},[g]),(0,X.useEffect)(()=>{n&&s&&e&&E.current!==e&&(E.current=e,T(new Set((s.members??[]).map(e=>e.userId))))},[n,s,e]);let M=(0,X.useMemo)(()=>l?et(l,g,w):[],[l,g,w]);async function oe(t,n){if(e)try{n?await d({groupId:e,userId:t}):await u({groupId:e,userId:t})}catch(e){h.error(we(),e)}}async function se(t,n){if(e)try{await m({groupId:e,userId:t,manager:!n})}catch(e){h.error(ne(),e)}}let N=Z(M,e=>D.has(e.userId)),ce=M.filter(e=>D.has(e.userId)).length,P=it(M,te,ot);async function F(){if(!e||M.length===0)return;let t=M.map(e=>e.userId);try{await f({groupId:e,userIds:t,member:N!==`all`})}catch(e){h.error(we(),e)}}return(0,Q.jsx)(Re,{open:n,onOpenChange:i,children:(0,Q.jsxs)(Fe,{className:`oc-access`,children:[(0,Q.jsxs)(We,{children:[(0,Q.jsx)(Ke,{children:de({name:t})}),(0,Q.jsx)(Ve,{children:be()})]}),(0,Q.jsxs)(Pe,{value:x,onValueChange:S,className:`oc-access__tabs`,children:[(0,Q.jsxs)(Ne,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)($e,{size:13,"aria-hidden":!0}),ge(),s?(0,Q.jsx)(U,{variant:`secondary`,className:`oc-access__tabcount`,children:D.size}):null]}),(0,Q.jsxs)(z,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(K,{size:13,"aria-hidden":!0}),le(),s?(0,Q.jsx)(U,{variant:`secondary`,className:`oc-access__tabcount`,children:j.size}):null]}),(0,Q.jsxs)(z,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Qe,{size:13,"aria-hidden":!0}),y(),s?(0,Q.jsx)(U,{variant:`secondary`,className:`oc-access__tabcount`,children:s.chartCount}):null]})]}),(0,Q.jsx)(B,{value:`members`,children:l===void 0||s===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()}):l.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:a()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(W,{value:g,onChange:e=>_(e.target.value),placeholder:Se(),className:`oc-access__search`}),M.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:ee()}):(0,Q.jsxs)(Q.Fragment,{children:[M.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(G,{checked:N===`all`?!0:N===`some`?`indeterminate`:!1,onCheckedChange:()=>void F(),"aria-label":k()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:k()}),(0,Q.jsxs)(U,{variant:`outline`,className:`oc-access__count`,children:[ce,` / `,M.length]})]}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:P.pageItems.map(e=>{let t=D.has(e.userId),n=nt(e),r=ae.has(e.userId);return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(G,{checked:t,onCheckedChange:()=>void oe(e.userId,t),"aria-label":ie({user:n.primary})}),(0,Q.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Q.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Q.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Q.jsx)(U,{variant:`outline`,className:`oc-access__role`,children:rt(e.role)}),(0,Q.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&A?(0,Q.jsx)(V,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?o():Ee(),title:r?o():Ee(),onClick:()=>void se(e.userId,r),children:(0,Q.jsx)(Y,{size:15,"aria-hidden":!0})}):t&&r?(0,Q.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":re(),title:re(),children:(0,Q.jsx)(Y,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Q.jsx)(st,{page:P.page,pageCount:P.pageCount,onPage:C})]})]})}),(0,Q.jsx)(B,{value:`agents`,children:c===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()}):c.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:je()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(W,{value:v,onChange:e=>b(e.target.value),placeholder:r(),className:`oc-access__search`}),(0,Q.jsx)(`div`,{className:`oc-access__list`,children:c.map(t=>(0,Q.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:j,query:v},`${e}-${t._id}`))})]})}),(0,Q.jsx)(B,{value:`charts`,children:(0,Q.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=I(O.groups.listAssignableAgents,{instanceName:t}),o=L(O.groups.assignAgentToGroup),s=L(O.groups.removeAgentFromGroup),c=L(O.groups.bulkSetGroupAgents),l=H(),[u,f]=(0,X.useState)(1);if((0,X.useEffect)(()=>{f(1)},[i]),!e)return null;let p=tt(a?.agents??[],i),h=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&p.length===0)return null;let g=p.filter(e=>e.presentInLastOk!==!1),v=Z(g,e=>r.has(`${t}/${e.agentId}`)),y=it(p,u,ot);async function b(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){l.error(A(),e)}}async function S(){if(g.length===0)return;let n=g.map(e=>e.agentId);try{await c({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){l.error(A(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(K,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(U,{variant:`outline`,className:`oc-access__kind`,children:n}),h?(0,Q.jsx)(U,{variant:`outline`,className:`oc-access__stale`,children:m()}):null]}),a===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:E()}):p.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:h?_():te()}):(0,Q.jsxs)(Q.Fragment,{children:[g.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(G,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void S(),"aria-label":k()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:k()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(G,{checked:i,disabled:a&&!i,onCheckedChange:()=>void b(e.agentId,i),"aria-label":T({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":x(),title:x(),children:(0,Q.jsx)(q,{size:14,fill:`currentColor`})}):null,a?(0,Q.jsx)(U,{variant:`outline`,className:`oc-access__gone`,children:d()}):null]},e.agentId)}),(0,Q.jsx)(st,{page:y.page,pageCount:y.pageCount,onPage:f})]})]})}function ut({groupId:e}){let t=I(O.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=L(O.charts.assignChartToGroup),r=L(O.charts.removeChartFromGroup),a=L(O.charts.setGroupDefaultChart),o=L(O.charts.addChartToGroupPool),s=L(O.charts.removeChartFromGroupPool),u=H();if(!e)return null;if(t===void 0)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()});let{pool:d,addable:f,canManagePool:m}=t;if(d.length===0&&!m)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:v()});async function h(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){u.error(R(),e)}}async function g(t){try{await a({groupId:e,chartKey:t})}catch(e){u.error(R(),e)}}async function _(t){try{await o({groupId:e,chartKey:t})}catch(e){u.error(R(),e)}}async function y(t){try{await s({groupId:e,chartKey:t})}catch(e){u.error(R(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-access__list`,children:d.map(e=>(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(G,{checked:e.selected,onCheckedChange:()=>void h(e.chartKey,e.selected),"aria-label":b({name:e.name})}),(0,Q.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":c(),title:c(),children:(0,Q.jsx)(q,{size:14,fill:`currentColor`})}):(0,Q.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void g(e.chartKey),children:l()}):null,m?(0,Q.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":pe({name:e.name}),title:pe({name:e.name}),onClick:()=>void y(e.chartKey),children:(0,Q.jsx)(Me,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),m?f.length>0?(0,Q.jsxs)(Je,{value:``,onValueChange:e=>void _(e),children:[(0,Q.jsx)(ze,{size:`sm`,className:`oc-access__search`,children:(0,Q.jsx)(Le,{placeholder:i()})}),(0,Q.jsx)(Be,{children:f.map(e=>(0,Q.jsx)(qe,{value:e.chartKey,children:e.name},e.chartKey))})]}):d.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):null:null]})}export{at as GroupsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$g as r,$h as i,A as a,Ag as o,Bg as s,Bh as c,Cg as l,Dg as u,Eg as d,Fg as f,Gg as p,Gh as m,Hg as h,Hh as g,Ig as _,Ih as v,Jg as y,Jh as b,Kg as x,Kh as S,Lg as ee,Lh as C,Md as w,Mg as T,Ng as te,Og as E,Pg as ne,Qg as D,Qh as O,Rg as k,Rh as A,S_ as j,Sg as M,Tg as re,Ug as ie,Uh as ae,Vg as oe,Vh as se,Wg as ce,Wh as le,Xg as ue,Xh as de,Yg as fe,Yh as pe,ZD as N,Zg as me,Zh as he,__ as ge,_g as _e,aC as ve,a_ as ye,ag as be,b_ as xe,bg as Se,c_ as Ce,cg as we,d_ as Te,dg as Ee,e_ as De,eg as Oe,f_ as ke,fg as Ae,g_ as je,gg as Me,h_ as Ne,hg as Pe,iC as Fe,iO as P,i_ as Ie,ig as Le,j as Re,jd as ze,jg as Be,kg as Ve,l_ as He,lg as Ue,m_ as We,mg as Ge,n_ as Ke,ng as qe,o_ as Je,og as F,p_ as Ye,pg as Xe,qg as Ze,qh as Qe,rO as I,r_ as $e,rg as L,s_ as et,sg as tt,tO as R,t_ as nt,tg as rt,u_ as it,ug as at,v_ as ot,vg as st,wg as ct,x_ as lt,xg as ut,y_ as dt,yg as ft,zg as z,zh as pt}from"./dist-DbxuL-_t.js";import{a as mt,c as ht}from"./FieldLabel-DEMPCo5Y.js";import{t as B}from"./button-BaP2jczn.js";import{$ as V,A as H,C as U,H as gt,Q as W,S as G,U as _t,V as vt,X as K,Z as q,_ as yt,b as bt,et as xt,j as St,m as Ct,nt as wt,rt as Tt,x as J,y as Et}from"./index-cf0xP0kN.js";import{t as Dt}from"./DataTableShell-DBktq6d-.js";import{InstanceConfigDialog as Ot}from"./BridgeTab-B4QV2N_w.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`],kt=new Set(X),At=`conversational`;function jt(e){let t=new Set((e??[]).filter(e=>kt.has(e)));return t.size===0?[At]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:mt},Mt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Nt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function Pt(){let e=P(N.admin.listInstances,{}),t=P(N.agents.listAllInstanceAgents,{}),n=I(N.admin.upsertInstance),i=I(N.admin.deleteInstance),a=H(),[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(Q),[u,d]=(0,Y.useState)(null),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null);async function b(){try{await n({instanceId:_??void 0,name:c.name,gatewayUrl:c.gatewayUrl,bridgeUrl:c.bridgeUrl||void 0,displayName:c.displayName||void 0,kind:c.kind,gatewayVersion:c.gatewayVersion||void 0,gatewayHttpUrl:c.gatewayHttpUrl||void 0,streamTransport:c.streamTransport}),l(Q),v(null),s(!1)}catch(e){a.error(xe(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[dt(),(0,Z.jsx)(`strong`,{children:ot()}),ge()]}),(0,Z.jsx)(Dt,{title:je(),rows:e,addLabel:Ne(),onAdd:()=>{v(null),l(Q),s(!0)},emptyHint:We(),columns:[{header:Ye(),cell:e=>e.name,sort:e=>e.name},{header:ke(),cell:e=>(0,Z.jsx)(K,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:Te(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:it(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:j(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(K,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?C():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:Je(),onSelect:()=>{v(e._id),l(Nt(e)),s(!0)}},{label:lt(),onSelect:()=>d(e.name)},{label:p(),onSelect:()=>g(e)},{label:He(),onSelect:()=>m(e)},{label:Ce(),variant:`destructive`,onSelect:()=>void i({instanceId:e._id})}],bulkActions:[{label:Ce(),variant:`destructive`,onSelect:e=>e.forEach(e=>void i({instanceId:e}))}]}),(0,Z.jsx)(Ct,{open:o,onOpenChange:s,title:_?ye():et(),description:$e(),canSubmit:!!(c.name&&c.gatewayUrl),onSubmit:b,submitLabel:Ke(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:nt(),children:[(0,Z.jsx)(q,{value:c.name,disabled:_!==null,onChange:e=>l({...c,name:e.target.value})}),_?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Ie()}):null]}),(0,Z.jsx)($,{label:De(),children:(0,Z.jsxs)(Et,{value:c.kind,onValueChange:e=>l({...c,kind:e}),children:[(0,Z.jsx)(G,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(U,{})}),(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(J,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(J,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:r(),children:(0,Z.jsx)(q,{value:c.gatewayUrl,onChange:e=>l({...c,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:D(),children:(0,Z.jsx)(q,{value:c.bridgeUrl,placeholder:me(),onChange:e=>l({...c,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:ue(),children:(0,Z.jsx)(q,{value:c.displayName,onChange:e=>l({...c,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:w(),children:[(0,Z.jsxs)(Et,{value:c.streamTransport,onValueChange:e=>l({...c,streamTransport:e}),children:[(0,Z.jsx)(G,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(U,{})}),(0,Z.jsx)(bt,{children:ht.map(e=>(0,Z.jsx)(J,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ze()})]}),(0,Z.jsx)($,{label:fe(),children:(0,Z.jsx)(q,{value:c.gatewayVersion,placeholder:y(),onChange:e=>l({...c,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:Ze(),children:(0,Z.jsx)(q,{value:c.gatewayHttpUrl,placeholder:x(),onChange:e=>l({...c,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Wt,{instanceName:u,open:u!==null,onOpenChange:e=>{e||d(null)}}),f?(0,Z.jsx)(Ot,{instance:f,onClose:()=>m(null)},f._id):null,h?(0,Z.jsx)(Ft,{instance:h,onClose:()=>g(null)},h._id):null]})}function Ft({instance:e,onClose:t}){let n=P(N.instanceSecrets.listInstanceSecretStatus,{}),r=Mt[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(W,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(V,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(wt,{children:[(0,Z.jsx)(Tt,{children:ce({instance:e.displayName??e.name})}),(0,Z.jsx)(xt,{children:ie()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Rt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Lt,{instance:e})}),(0,Z.jsx)(It,{instance:e})]})})}function It({instance:e}){let t=R(N.instanceSync.forceInstanceSync),n=H(),[r,i]=(0,Y.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(l());break;case`no_agents`:n.success(ut());break;case`no_bridge_url`:n.error(Se());break;case`deploy_misconfigured`:n.error(ft());break;case`unauthorized`:n.error(_e());break;case`not_served`:n.error(Me());break;default:n.error(st());break}}catch(e){n.error(M(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(B,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?ct():re()})})]})}function Lt({instance:e}){let t=P(N.bridgeAuth.listBridgeAuthStatus,{}),n=R(N.bridgeAuth.mintBridgeSecret),r=I(N.bridgeAuth.revokeBridgeSecret),i=H(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function p(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(we(),e)}finally{o(!1)}}}async function m(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(Ue())}catch(e){i.error(we(),e)}finally{o(!1)}}}async function h(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:Ge(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Xe()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(K,{variant:f?`outline`:`secondary`,children:f?`${z()} · ${d.prefix}…${d.lastFour}`:k()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(B,{size:`sm`,onClick:()=>void p(),disabled:a,children:f?Ee():Ae()}),f?(0,Z.jsx)(B,{size:`sm`,variant:`destructive`,onClick:()=>void m(),disabled:a,children:at()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:tt()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>void h(),children:l?ve():Fe()})]}),(0,Z.jsx)(B,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:F()})]}):null]})}function Rt({instanceId:e,field:t,updatedAt:n}){let r=R(N.instanceSecrets.setInstanceSecret),i=I(N.instanceSecrets.clearInstanceSecret),a=R(N.deviceIdentity.generateDeviceIdentity),c=H(),[l,p]=(0,Y.useState)(``),[m,g]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(!1),S=n!==null,C=t===`deviceIdentity`,w=t===`token`?h():t===`deviceIdentity`?oe():s();async function D(){if(!(!l.trim()||m)){g(!0);try{await r({instanceId:e,field:t,plaintext:l}),p(``),y(null),x(!1),c.success(te())}catch(e){c.error(T(),e)}finally{g(!1)}}}async function O(){if(!m){g(!0);try{await i({instanceId:e,field:t}),y(null),x(!1),c.success(Be())}catch(e){c.error(T(),e)}finally{g(!1)}}}async function A(){if(!m){g(!0);try{y(await a({instanceId:e})),x(!1),c.success(E())}catch(e){c.error(d(),e)}finally{g(!1)}}}let j=v?`openclaw devices approve ${v.id}`:``;async function M(){if(j)try{await navigator.clipboard.writeText(j),x(!0)}catch{}}return(0,Z.jsxs)($,{label:w,children:[C?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ve()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(K,{variant:S?`outline`:`secondary`,children:S?z():k()}),(0,Z.jsx)(q,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:l,placeholder:S?_():ee(),onChange:e=>p(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(B,{size:`sm`,onClick:()=>void D(),disabled:m||l.trim().length===0,children:f()}),C?(0,Z.jsx)(B,{size:`sm`,variant:`outline`,onClick:()=>void A(),disabled:m,children:o()}):null,S?(0,Z.jsx)(B,{size:`sm`,variant:`destructive`,onClick:()=>void O(),disabled:m,children:ne()}):null]})]}),v?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:E()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:u()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:j}),(0,Z.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>void M(),children:b?ve():Fe()})]}),(0,Z.jsx)(B,{size:`sm`,variant:`ghost`,onClick:()=>{y(null),x(!1)},children:F()})]}):null]})}var zt={conversational:O,documentary:de,summarizer:Re},Bt={conversational:he,documentary:pe,summarizer:a},Vt=e=>(zt[e]??(()=>e))(),Ht=e=>(Bt[e]??(()=>``))();function Ut({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:qe()}),t.map(e=>(0,Z.jsx)(K,{variant:`secondary`,className:`oc-agenttype__chip`,title:Ht(e),children:Vt(e)},e)),(0,Z.jsxs)(vt,{children:[(0,Z.jsx)(_t,{asChild:!0,children:(0,Z.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:rt()})}),(0,Z.jsxs)(gt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:Oe()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:i()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(yt,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:Vt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Ht(r)})]})]},r)})})]})]})]})}function Wt({instanceName:e,open:t,onOpenChange:n}){let r=P(N.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=I(N.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=I(N.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=I(N.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=jt(r);e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=I(N.agents.removeInstanceAgent),l=St(),u=H();async function d(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(L(),e)}}async function f(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(L(),e)}}async function p(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){u.error(L(),e)}}async function h(t,n){if(e&&await l({title:S({name:n}),description:m(),confirmLabel:le(),destructive:!0}))try{await s({instanceName:e,agentId:t}),u.success(ae())}catch(e){u.error(L(),e)}}return(0,Z.jsx)(W,{open:t,onOpenChange:n,children:(0,Z.jsxs)(V,{className:`oc-access`,children:[(0,Z.jsxs)(wt,{children:[(0,Z.jsx)(Tt,{children:be({name:e??``})}),(0,Z.jsx)(xt,{children:Le()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:g()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?se():r.discovery.lastPollOk?c():pt({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:A()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(yt,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void d(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:v()}),(0,Z.jsx)(B,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(e.agentId,i),children:Qe()})]}):n?(0,Z.jsx)(K,{variant:`default`,children:C()}):(0,Z.jsx)(B,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void f(e.agentId),children:b()})]}),e.enabled?(0,Z.jsx)(Ut,{agentId:e.agentId,types:a,onToggle:t=>void p(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Pt as InstancesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Ay as i,By as a,Cy as o,Dy as s,Ey as c,Fy as l,Gt as u,Hy as d,Iy as f,Jt as p,Kt as m,Ly as h,My as ee,Ny as te,Oy as g,Py as _,Qt as ne,Qv as re,Ry as v,Sy as ie,Ty as ae,Uy as oe,Vy as se,Wt as y,Wy as ce,Xt as le,Yt as ue,ZD as b,Zt as x,_y as S,ay as C,by as w,cy as T,dy as E,ey as D,fy as O,gy as k,hy as A,iO as j,iy as M,jy as N,ky as P,ly as F,my as I,ny as L,oy as R,py as z,qt as B,rO as V,ry as H,sy as de,tO as fe,ty as pe,uy as me,vy as he,wy as ge,xy as _e,yy as U,zy as W}from"./dist-DbxuL-_t.js";import{t as G}from"./button-BaP2jczn.js";import{C as ve,S as ye,X as K,Z as q,_ as be,b as xe,x as Se,y as Ce}from"./index-cf0xP0kN.js";import{t as we}from"./DataTableShell-DBktq6d-.js";var J=t(e(),1),Y=n();function Te(){let e=j(b.integrations.status.status,{}),t=V(b.admin.setIntegrationConfig),[n,u]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&u(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ce()});let p=n,m=(e,t,n)=>u({...p,[e]:{...p[e],[t]:n}}),y=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[oe(),` `,(0,Y.jsx)(`strong`,{children:d()}),` `,se()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:a()}):(0,Y.jsx)(K,{variant:`outline`,children:W()}):(0,Y.jsx)(K,{variant:`outline`,children:v()}),note:f(),children:[(0,Y.jsx)(Z,{label:_(),children:(0,Y.jsx)(q,{value:p.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>m(`langfuse`,`host`,e.target.value),onBlur:()=>y(`langfuse`,{host:p.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:i(),checked:p.langfuse.enabled??!0,onChange:e=>{m(`langfuse`,`enabled`,e),y(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:a()}):(0,Y.jsx)(K,{variant:`outline`,children:W()}):(0,Y.jsx)(K,{variant:`outline`,children:v()}),note:l(),children:[(0,Y.jsx)(Z,{label:te(),children:(0,Y.jsx)(q,{value:p.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>m(`opik`,`baseUrl`,e.target.value),onBlur:()=>y(`opik`,{baseUrl:p.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:ee(),children:(0,Y.jsx)(q,{value:p.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||N(),onChange:e=>m(`opik`,`workspace`,e.target.value),onBlur:()=>y(`opik`,{workspace:p.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:i(),checked:p.opik.enabled??!0,onChange:e=>{m(`opik`,`enabled`,e),y(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:a()}):(0,Y.jsx)(K,{variant:`outline`,children:W()}):(0,Y.jsx)(K,{variant:`outline`,children:ne()}),note:x(),children:[(0,Y.jsx)(Z,{label:le(),children:(0,Y.jsx)(q,{value:p.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>m(`otlp`,`endpoint`,e.target.value),onBlur:()=>y(`otlp`,{endpoint:p.otlp.endpoint??``})})}),(0,Y.jsx)(Ee,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:i(),checked:p.otlp.enabled??!0,onChange:e=>{m(`otlp`,`enabled`,e),y(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:P(),status:(0,Y.jsx)(K,{variant:`outline`,children:h()}),note:g(),children:[(0,Y.jsx)(Z,{label:s(),children:(0,Y.jsx)($,{value:p.tts.auto??`off`,options:[[`off`,c()],[`always`,ae()],[`inbound`,ge()],[`tagged`,o()]],onChange:e=>{m(`tts`,`auto`,e),y(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:ie(),children:(0,Y.jsx)($,{value:p.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,_e()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{m(`tts`,`provider`,e),y(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:w(),children:(0,Y.jsx)(q,{value:p.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>m(`tts`,`model`,e.target.value),onBlur:()=>y(`tts`,{model:p.tts.model??``})})}),(0,Y.jsx)(Z,{label:U(),children:(0,Y.jsx)(q,{value:p.tts.voice??``,placeholder:he(),onChange:e=>m(`tts`,`voice`,e.target.value),onBlur:()=>y(`tts`,{voice:p.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:S(),status:(0,Y.jsx)(K,{variant:`outline`,children:h()}),note:e.secrets.openai?k():A(),children:[(0,Y.jsx)(Q,{label:I(),checked:p.talk.enabled??!1,onChange:e=>{m(`talk`,`enabled`,e),y(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:z(),children:(0,Y.jsx)($,{value:p.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{m(`talk`,`realtimeProvider`,e),y(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:O(),children:(0,Y.jsx)(q,{value:p.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>m(`talk`,`realtimeModel`,e.target.value),onBlur:()=>y(`talk`,{realtimeModel:p.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:U(),children:(0,Y.jsx)(q,{value:p.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>m(`talk`,`voice`,e.target.value),onBlur:()=>y(`talk`,{voice:p.talk.voice??``})})}),(0,Y.jsx)(Z,{label:E(),children:(0,Y.jsx)($,{value:p.talk.transport??`webrtc`,options:[[`webrtc`,me()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{m(`talk`,`transport`,e),y(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(q,{value:p.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>m(`talk`,`speechLocale`,e.target.value),onBlur:()=>y(`talk`,{speechLocale:p.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:T(),checked:p.talk.interruptOnSpeech??!0,onChange:e=>{m(`talk`,`interruptOnSpeech`,e),y(`talk`,{interruptOnSpeech:e})}})]}),(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:de()}),(0,Y.jsx)(K,{variant:`outline`,children:R()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[C(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(we,{title:M(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:H(),columns:[{header:L(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:pe(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:D(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:r(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:re(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(be,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(Ce,{value:e,onValueChange:n,children:[(0,Y.jsx)(ye,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(ve,{})}),(0,Y.jsx)(xe,{children:t.map(([e,t])=>(0,Y.jsx)(Se,{value:e,children:t},e))})]})}function Ee({headersSet:e}){let t=fe(b.integrations.otlpSecret.setOtlpHeaders),n=V(b.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),l=async()=>{c(!0),o(null);try{await t({headersJson:r}),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}};return(0,Y.jsxs)(Z,{label:ue(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?p():B(),onChange:e=>i(e.target.value)}),(0,Y.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,Y.jsx)(G,{size:`sm`,disabled:s||r.trim().length===0,onClick:()=>void l(),children:m()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:s,onClick:()=>void n({}),children:u()}):null]}),a?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:a}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:y()})]})}export{Te as IntegrationsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aw as r,Bw as i,Cw as a,Dw as o,Ew as s,Fw as c,Gw as l,Hw as u,Iw as d,Jw as f,Kw as ee,Lw as p,Mw as m,Nw as h,Ow as g,Pw as te,Rw as ne,Sw as re,Tw as ie,Uw as ae,Vw as oe,Ww as se,Xw as ce,Yw as le,ZD as _,_w as ue,aD as de,bw as v,cD as y,dD as b,fD as x,gD as S,hD as C,iD as w,iO as T,jw as E,kw as D,lD as O,mD as k,n_ as A,oD as j,pD as M,qw as N,rO as P,sD as F,uD as I,vw as L,wD as R,ww as z,xw as B,yD as V,yw as fe,zw as pe}from"./dist-DbxuL-_t.js";import{t as H}from"./button-BaP2jczn.js";import{A as me,C as he,O as ge,S as _e,Z as U,_ as W,b as ve,ot as G,x as K,y as ye}from"./index-cf0xP0kN.js";var q=t(e(),1),J=[{id:`messages`,label:()=>ce()},{id:`composer`,label:()=>le()},{id:`sidebar`,label:()=>f()},{id:`other`,label:()=>N()}],Y={showSource:{category:`messages`,label:()=>ee(),help:()=>l()},showReport:{category:`messages`,label:()=>se(),help:()=>ae()},copyAssistant:{category:`messages`,label:()=>u()},copyUser:{category:`messages`,label:()=>oe()},showDelete:{category:`messages`,label:()=>i()},showTools:{category:`messages`,label:()=>pe(),help:()=>ne()},voiceInput:{category:`composer`,label:()=>p(),help:()=>d()},showChatAge:{category:`sidebar`,label:()=>c(),help:()=>te()},showChatProvider:{category:`sidebar`,label:()=>h(),help:()=>m()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function be(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],Se={voiceInput:`voiceInput`};function Ce(e){return xe.includes(e)}function Z(e){return e===`admin`}function we(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Q(e){return e===`on`?!0:e===`off`?!1:null}function Te(e){return Ce(e)?Se[e]:void 0}var $=n(),Ee={voiceInput:()=>B()};function De({prefKey:e,ui:t}){let n=P(_.admin.setUiPrefDefault),r=P(_.admin.setFeatureEnabled),i=Te(e),a=i?Ee[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:ie()}),(0,$.jsxs)(ye,{value:we(t.defaults[e]),onValueChange:t=>void n({key:e,value:Q(t)}),children:[(0,$.jsx)(_e,{size:`sm`,className:`w-36`,children:(0,$.jsx)(he,{})}),(0,$.jsxs)(ve,{children:[(0,$.jsx)(K,{value:`on`,children:fe()}),(0,$.jsx)(K,{value:`off`,children:L()}),(0,$.jsx)(K,{value:`inherit`,children:ue()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":z()}),z()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,i]=(0,q.useState)(!1),c=T(_.me.getMe,{host:G}),l=c?.ui,u=Z(c?.role)&&n,d=P(_.me.setUiPref).withOptimisticUpdate(ge),f=(0,q.useMemo)(()=>l?be(Object.keys(l.effective),e):[],[l,e]);return l?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(c?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>i(e===!0),"aria-label":s()}),s()]}):null,u?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:a()}),(0,$.jsx)(`p`,{children:re()}),(0,$.jsx)(`p`,{children:v()})]}):null,(0,$.jsx)(U,{value:e,onChange:e=>t(e.target.value),placeholder:E(),"aria-label":E(),className:`mb-2`}),f.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:r()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:f.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=l.locked[e],a=l.effective[e],s=l.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${s&&!i?` is-overridden`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(`span`,{className:`oc-prefs__lock`,children:D()}):s?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:g()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&s?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void d({key:e,value:null}),children:o()}):null,(0,$.jsx)(W,{checked:a,disabled:i,onCheckedChange:t=>void d({key:e,value:t===!0}),"aria-label":n})]}),u?(0,$.jsx)(De,{prefKey:e,ui:l}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:R()})}function ke(){let e=T(_.me.getMe,{host:G}),t=P(_.me.setLocale),n=P(_.me.setMyName),r=me(),i=e?.locale??`default`,a=e?.name??``,[o,s]=(0,q.useState)(null),c=o??a,l=c.trim()!==a.trim();async function u(){try{await n({name:c}),s(null),r.success(x())}catch(e){r.error(b(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:S()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:C()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(U,{className:`max-w-xs`,value:c,maxLength:120,placeholder:k(),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l&&(e.preventDefault(),u())}}),(0,$.jsx)(H,{size:`sm`,disabled:!l,onClick:()=>void u(),children:A()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:M()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:I()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:O()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:i===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?de():e===`en`?w():V()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:F()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:j()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cd as r,Dd as i,Ed as a,F as o,Fd as s,I as c,Id as l,M as u,N as d,Od as f,P as p,Sd as ee,Td as m,ZD as h,_d as g,bd as _,dd as v,fd as y,gd as b,hd as x,iO as S,ld as C,md as w,pd as T,rO as E,ud as D,vd as O,wd as k,xd as A,yd as j}from"./dist-DbxuL-_t.js";import{d as M,f as N,i as P,l as F,n as I,r as L,t as R,u as z}from"./FieldLabel-DEMPCo5Y.js";import{t as B}from"./button-BaP2jczn.js";import{A as V,C as H,S as U,_ as W,b as G,x as K,y as q}from"./index-cf0xP0kN.js";/* empty css */var J=t(e(),1),Y=n(),X={media_delivery:{label:r,help:ee},documentary_fetch:{label:A,help:_},inbound_files:{label:j,help:O},history_summary:{label:c,help:o}},Z={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
-
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
|
-
Assistant : Comparaison en cours.`,max_chars:`6000`},Q={outboundDir:v,references:D,files:C,previous_summary:p,new_messages:d,max_chars:u};function $(){let e=S(h.admin.listInstances,{}),[t,n]=(0,J.useState)(null);if(e===void 0)return(0,Y.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,Y.jsx)(`div`,{className:`oc-injtab`,children:(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:b()})});let r=e.find(e=>e._id===t)??e[0];return(0,Y.jsxs)(`div`,{className:`oc-injtab`,children:[(0,Y.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,Y.jsx)(I,{label:f(),help:i()}),(0,Y.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,Y.jsx)(`span`,{children:g()}),(0,Y.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,Y.jsx)(U,{size:`sm`,className:`min-w-44`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(G,{children:e.map(e=>(0,Y.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,Y.jsx)(te,{instance:r},r._id)]})}function te({instance:e}){let t=E(h.admin.upsertInstanceConfig),n=V(),r=e.config??{},[i,a]=(0,J.useState)(()=>P(r)),[o,c]=(0,J.useState)(!1),u=i.promptInjections,d=(e,t)=>a({...i,promptInjections:{...u,[e]:{...u[e],...t}}});async function f(){c(!0);try{await t({instanceId:e._id,config:L(i,r)})}catch(e){n.error(s(),e)}finally{c(!1)}}return(0,Y.jsxs)(`div`,{className:`oc-injtab__body`,children:[z.map(e=>(0,Y.jsx)(ne,{injKey:e,def:F[e],i18n:X[e],row:u[e]??{enabled:!0,template:F[e].defaultTemplate},onChange:t=>d(e,t)},e)),(0,Y.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,Y.jsx)(B,{size:`sm`,onClick:()=>void f(),disabled:o,children:l()})})]})}function ne({injKey:e,def:t,i18n:n,row:r,onChange:i}){let[o,s]=(0,J.useState)(!1),c=r.template.trim()!==t.defaultTemplate,l=t.togglable&&!r.enabled,u=Object.fromEntries(t.placeholders.map(e=>[e,Z[e]??`{${e}}`])),d=M(e,r),f=d?N(d,u):``;return(0,Y.jsxs)(`section`,{className:`oc-injcard`,children:[(0,Y.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,Y.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Y.jsx)(W,{checked:r.enabled,onCheckedChange:e=>i({enabled:e===!0})}),(0,Y.jsx)(I,{label:n.label(),help:n.help()})]}):(0,Y.jsx)(I,{label:n.label(),help:n.help()}),c&&(0,Y.jsx)(`span`,{className:`oc-injection__badge`,children:m()})]}),(0,Y.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:l,rows:8,spellCheck:!1,onChange:e=>i({template:e.target.value})}),(0,Y.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,Y.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,Y.jsx)(`span`,{className:`oc-injection__ph`,children:k()}),t.placeholders.map(e=>(0,Y.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,Y.jsx)(`code`,{children:`{${e}}`}),(0,Y.jsx)(R,{text:(Q[e]??(()=>e))()})]},e))]}),(0,Y.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,Y.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?w():x()}),c&&(0,Y.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>i({template:t.defaultTemplate}),children:a()})]})]}),o&&(0,Y.jsx)(`div`,{className:`oc-injcard__preview`,children:f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:f}),(0,Y.jsx)(`span`,{className:`oc-injection__ph`,children:T()})]}):(0,Y.jsx)(`span`,{className:`oc-injection__ph`,children:y()})})]})}export{$ as PromptInjectionsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Fm as i,Gm as a,Im as o,Jm as s,Km as ee,Lm as te,Mm as ne,Nm as re,Pm as c,Qm as l,Rm as u,Xm as d,Ym as f,ZD as p,Zm as m,_h as h,ah as g,bh as _,ch as v,dh as y,eh as ie,fh as b,gh as x,hh as S,iO as ae,ih as C,jm as w,lh as T,mh as E,nh as D,oh as O,ph as k,qm as A,rO as j,rh as M,sh as N,th as P,uh as F,vh as I,yh as L,zm as R}from"./dist-DbxuL-_t.js";import{t as z}from"./button-BaP2jczn.js";import{A as B,X as V,Z as H,_ as U,j as W,m as G,xt as K}from"./index-cf0xP0kN.js";import{t as q}from"./roleDescriptions-lVphvx8L.js";var J=t(e(),1),Y=n(),X=[{group:()=>_(),keys:[{key:`traces.read`,label:()=>S()},{key:`traces.read.content`,label:()=>E(),phi:!0},{key:`traces.write`,label:()=>k()}]},{group:()=>L(),keys:[{key:`kpi.read`,label:()=>S()},{key:`kpi.write`,label:()=>k()}]},{group:()=>I(),keys:[{key:`openclaw.query`,label:()=>b()},{key:`anomalies.read`,label:()=>y()},{key:`anomalies.report`,label:()=>F()}]},{group:()=>h(),keys:[{key:`chats.read`,label:()=>S()},{key:`selfheal`,label:()=>v()}]},{group:()=>x(),keys:[{key:`admin.manage`,label:()=>T()}]}],oe=X.flatMap(e=>e.keys.map(e=>e.key));function Z(e){return e.includes(`*`)}var Q={key:``,name:``,description:``};function $(){let e=ae(p.apiKeys.listRoles,{}),t=j(p.apiKeys.createRole),n=j(p.apiKeys.ensureRolesSeeded),h=j(p.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(p.apiKeys.listRoles,{});r&&e.setQuery(p.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),_=W(),v=B(),[y,b]=(0,J.useState)(!1),[x,S]=(0,J.useState)(Q),[T,E]=(0,J.useState)(new Set);(0,J.useEffect)(()=>{n({}).catch(e=>{v.error(O(),e)})},[n,v]);let k=e??[];async function F(e,t){if(Z(e.permissions)||T.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await _({title:g({name:e.name}),description:C(),confirmLabel:M()}))){E(t=>new Set(t).add(e._id));try{await h({roleId:e._id,permissions:n})}catch(e){v.error(D(),e)}finally{E(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function I(){try{await t({key:x.key,name:x.name,description:x.description||void 0,permissions:[]}),S(Q),b(!1)}catch(e){v.error(P(),e)}}let L=e===void 0,$=!L&&k.length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ie(),` `,(0,Y.jsx)(`code`,{children:`admin`}),` `,r(),` `,(0,Y.jsx)(`code`,{children:`traces.read.content`}),` `,l()]}),(0,Y.jsxs)(`div`,{className:`oc-dt`,children:[(0,Y.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,Y.jsx)(`h2`,{className:`oc-dt__title`,children:m()}),(0,Y.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,Y.jsx)(z,{size:`sm`,onClick:()=>{S(Q),b(!0)},children:d()})})]}),L?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):$?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,Y.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,Y.jsxs)(`table`,{className:`oc-matrix`,children:[(0,Y.jsxs)(`thead`,{children:[(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:A()}),X.map(e=>(0,Y.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,Y.jsx)(`tr`,{children:X.flatMap(e=>e.keys.map(e=>(0,Y.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?N({key:e.key}):e.key,children:[e.label(),e.phi?(0,Y.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,Y.jsx)(`tbody`,{children:k.map(e=>{let t=Z(e.permissions),n=T.has(e._id);return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,Y.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,Y.jsxs)(V,{variant:`outline`,className:`gap-1`,children:[(0,Y.jsx)(K,{}),` `,ee()]}):(0,Y.jsx)(V,{variant:`secondary`,children:a()})]}),q(e)?(0,Y.jsx)(`p`,{className:`oc-matrix__roledesc`,children:q(e)}):null]}),oe.map(r=>(0,Y.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,Y.jsx)(U,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?R():n?u():r,onCheckedChange:()=>void F(e,r)})},r))]},e.key)})})]})})]}),(0,Y.jsx)(G,{open:y,onOpenChange:b,title:te(),description:o(),canSubmit:!!(x.key&&x.name),onSubmit:I,submitLabel:i(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,Y.jsx)(H,{value:x.key,placeholder:re(),onChange:e=>S({...x,key:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:ne()}),(0,Y.jsx)(H,{value:x.name,onChange:e=>S({...x,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:w()}),(0,Y.jsx)(H,{value:x.description,onChange:e=>S({...x,description:e.target.value})})]})]})})]})}export{$ as RolesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,$S as i,AC as ee,BC as te,CC as ne,DC as re,EC as ie,FC as ae,GC as oe,HC as se,IC as ce,JC as le,KC as ue,LC as de,MC as fe,NC as pe,OC as me,PC as he,QC as ge,QS as a,RC as _e,SC as ve,TC as ye,UC as be,VC as xe,WC as Se,XC as Ce,XS as o,YC as we,ZC as Te,ZD as s,ZS as c,_C as l,aC as u,aw as Ee,bC as De,cC as d,cw as Oe,dC as f,dw as p,eC as m,ew as ke,fC as h,fw as Ae,gC as g,gw as je,hC as Me,hw as Ne,iC as Pe,iO as _,iw as Fe,jC as Ie,kC as Le,lC as v,lw as Re,mC as y,mw as ze,nC as b,nw as Be,oC as x,ow as Ve,pC as S,pw as He,qC as Ue,rC as C,rO as w,rw as We,sC as T,sw as Ge,tC as E,tO as Ke,tw as qe,uC as D,uw as O,vC as k,wC as Je,xC as Ye,yC as A,zC as Xe}from"./dist-DbxuL-_t.js";import{n as j}from"./dist-BKPj1yrt.js";import{i as Ze}from"./dist-Dql2za7I.js";import{t as M}from"./button-BaP2jczn.js";import{$ as N,A as Qe,At as $e,C as P,Dt as F,Mt as et,Q as I,S as L,X as R,Z as z,b as B,et as V,j as tt,jt as nt,m as rt,nt as H,rt as U,tt as it,x as W,y as G}from"./index-cf0xP0kN.js";import{t as at}from"./FilterBar-Cu1qlC3G.js";import{t as ot}from"./DataTableShell-DBktq6d-.js";import{t as st}from"./roleDescriptions-lVphvx8L.js";var K=t(e(),1),q=n(),ct=[{value:`never`,label:()=>b(),days:null},{value:`30`,label:()=>E(),days:30},{value:`90`,label:()=>m(),days:90}],lt=720*60*60*1e3,J=`__all__`,Y={name:``,roleKey:``,description:``};function X(){let e=et({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??J,[a,o]=(0,K.useState)(J),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===J?void 0:e})}),u=_(s.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===J?void 0:a,disabled:i===J?void 0:i===`disabled`}}),d=_(s.apiKeys.listKeys,{}),f=_(s.apiKeys.listRoles,{}),m=w(s.apiKeys.createServiceAccount),h=w(s.apiKeys.updateServiceAccount),g=w(s.apiKeys.deleteServiceAccount),Me=Ke(s.apiKeys.mintApiKey),Pe=w(s.apiKeys.revokeApiKey),v=tt(),y=Qe(),b=n!==``||a!==J||i!==J;function x(){o(J),t({search:{},replace:!0})}let[S,C]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Y),[D,k]=(0,K.useState)(null),[A,j]=(0,K.useState)(new Set),[N,F]=(0,K.useState)(null),I=(0,K.useRef)(!1),[V,H]=(0,K.useState)(new Set),[U,it]=(0,K.useState)({}),[lt,X]=(0,K.useState)(null),Z=(0,K.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await h({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(he())):await m({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Y),k(null),C(!1)}catch(e){y.error(D?ae():ce(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),C(!0)}async function $(e){if(I.current)return;I.current=!0;let t=U[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await Me({serviceAccountId:e._id,expiresAt:r});X({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(pe(),e)}finally{I.current=!1,F(null)}}async function mt(e){if(await v({title:fe(),description:(0,q.jsxs)(q.Fragment,{children:[Ie(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,ee(),` `,(0,q.jsx)(`strong`,{children:Le()}),` `,me()]}),confirmWord:e.name,confirmLabel:re(),destructive:!0}))try{await g({serviceAccountId:e._id}),y.success(ie(),e.name)}catch(e){y.error(ye(),e)}}async function ht(e){if(await v({title:Je(),description:(0,q.jsxs)(q.Fragment,{children:[ne(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,ve()]}),confirmLabel:Ye(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await Pe({keyId:e._id})}catch(e){y.error(De(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:je()}),(0,q.jsxs)(at,{q:n,onQChange:c,searchPlaceholder:Ne(),onReset:x,canReset:b,children:[(0,q.jsxs)(G,{value:a,onValueChange:o,children:[(0,q.jsx)(L,{size:`sm`,className:`w-40`,children:(0,q.jsx)(P,{placeholder:ze()})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:He()}),(f??[]).map(e=>(0,q.jsx)(W,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(G,{value:i,onValueChange:l,children:[(0,q.jsx)(L,{size:`sm`,className:`w-36`,children:(0,q.jsx)(P,{})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:Ae()}),(0,q.jsx)(W,{value:`active`,children:p()}),(0,q.jsx)(W,{value:`disabled`,children:O()})]})]})]}),(0,q.jsx)(ot,{title:Re(),rows:u,addLabel:Oe(),onAdd:()=>{E(Y),k(null),C(!0)},emptyHint:Ge(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Z.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:We(),onSelect:()=>pt(e)},{label:Ve(),onSelect:()=>void $(e)},{label:A.has(e._id)?Ee():Fe(),onSelect:()=>Q(e._id)},{label:Be(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?qe():ke(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)($e,{})})},{header:r(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:ge(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Te(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:O()}):(0,q.jsx)(R,{variant:`outline`,children:p()})},{header:Ce(),cell:e=>(0,q.jsxs)(G,{value:U[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(L,{size:`sm`,className:`w-32`,children:(0,q.jsx)(P,{})}),(0,q.jsx)(B,{children:ct.map(e=>(0,q.jsx)(W,{value:e.value,children:e.label()},e.value))})]})},{header:we(),sort:e=>(Z.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Z.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?le():Ue({count:t})})}}]}),(0,q.jsx)(rt,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:D?ue():be(),description:D?oe():se(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?Se():xe(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:te()}),(0,q.jsx)(z,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Xe()}),(0,q.jsxs)(G,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(L,{className:`w-full`,children:(0,q.jsx)(P,{placeholder:_e()})}),(0,q.jsx)(B,{children:(f??[]).map(e=>(0,q.jsxs)(W,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===T.roleKey),t=e?st(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:de()}),(0,q.jsx)(z,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:lt,onClose:()=>X(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[A(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:k()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:l()}),(0,q.jsx)(`th`,{children:g()}),(0,q.jsx)(`th`,{children:Me()}),(0,q.jsx)(`th`,{children:y()}),(0,q.jsx)(`th`,{children:S()}),(0,q.jsx)(`th`,{children:h()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:Z(t.createdAt)}),(0,q.jsx)(`td`,{className:Q(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:pt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?f():D()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(I,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(N,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(H,{children:[(0,q.jsx)(U,{children:v()}),(0,q.jsx)(V,{children:d({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:T()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":x(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(F,{}),n?u():Pe()]})]}),(0,q.jsx)(it,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:C()})})]}):null})}function Z(e){return new Date(e).toLocaleString(`fr-FR`)}function Q(e){return e===null?!1:Date.now()-e>lt}function ft(e){return e===null?i():new Date(e).toLocaleString(`fr-FR`)}function pt(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function $(e){return e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:a()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:c()}):(0,q.jsx)(R,{variant:`outline`,children:o()})}export{X as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,Ct as i,G as a,H as o,J as s,K as c,Q as l,St as u,Tt as d,U as f,V as p,W as m,X as h,Y as g,Z as _,ZD as v,_t as y,at as b,bt as x,ct as S,dt as C,et as w,ft as T,gt as E,ht as D,iO as O,it as k,lt as A,mt as j,nt as M,ot as N,pt as P,q as F,rO as I,rt as L,st as R,tt as z,ut as B,vt as V,wt as H,xt as U,yt as W}from"./dist-DbxuL-_t.js";import{t as G}from"./button-BaP2jczn.js";import{j as K}from"./index-cf0xP0kN.js";import{t as q}from"./DataTableShell-DBktq6d-.js";var J=t(e(),1),Y=n(),X={hung:()=>S(),wrong_result:()=>R(),error:()=>N(),other:()=>b()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=I(v.subAgentReports.respondToReport),[i,o]=(0,J.useState)(e.thread),[u,d]=(0,J.useState)(``),[f,p]=(0,J.useState)(!1);async function y(){let t=u.trim();if(!(!t||f)){p(!0);try{await n({reportId:e._id,text:t}),o(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),d(``)}finally{p(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,k({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:L()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:M()}),i.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?z():w()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:r()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:l(),value:u,maxLength:2e3,rows:3,onChange:e=>d(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(G,{size:`sm`,onClick:()=>void y(),disabled:!u.trim()||f,children:f?h():_()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[g({count:t.children.length}),t.childrenTruncated?` ${s()}`:``,t.textTruncated?` ${F()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${c()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:a()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:m()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function ee(){let e=O(v.subAgentReports.listForAdmin,{}),t=I(v.subAgentReports.readReport),n=I(v.subAgentReports.deleteReport),r=K(),[a,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function m(e){if(a===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function h(e){await r({title:f(),description:o(),confirmLabel:p(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[i(),` `,(0,Y.jsx)(`strong`,{children:u()}),` `,U()]}),(0,Y.jsx)(q,{title:d(),rows:e,emptyHint:H(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:x(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:W(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:V(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:y(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${j({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:E(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:D(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:P()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:T()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?B():C(),onSelect:()=>void m(e)},{label:A(),onSelect:()=>void h(e),variant:`destructive`}]})]})}export{ee as SubAgentReportsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as r,$w as i,AT as a,B as o,BT as s,CT as c,DT as l,ET as u,FT as d,GT as f,HT as p,IT as m,JT as h,KT as g,L as ee,LT as _,MT as v,NT as y,OT as te,PT as ne,QD as re,QT as ie,Qw as ae,R as oe,RT as se,SD as ce,ST as le,TT as ue,UT as de,VT as fe,WT as pe,XT as me,YT as he,ZD as b,ZT as ge,Zw as _e,_E as ve,_T as x,aD as ye,aE as be,aT as S,bD as xe,bT as Se,cE as Ce,cT as we,dE as Te,dT as Ee,eE as De,eT as Oe,fE as ke,fT as Ae,gE as je,gT as Me,hE as Ne,hT as Pe,iD as Fe,iE as Ie,iO as C,iT as Le,jT as Re,kT as ze,lE as w,lT as Be,mE as Ve,mT as He,n as Ue,nE as We,nT as Ge,oE as Ke,oT as qe,pE as Je,pT as Ye,qT as Xe,rE as Ze,rO as T,rT as Qe,sE as $e,sT as et,tE as tt,tO as nt,tT as E,uE as rt,uT as it,vE as at,vT as ot,wT as st,xD as ct,xT as lt,yE as ut,yT as dt,z as ft,zT as pt}from"./dist-DbxuL-_t.js";import{n as D}from"./dist-BKPj1yrt.js";import{t as O}from"./x-BpWCNC8c.js";import{t as k}from"./button-BaP2jczn.js";import{C as A,Et as mt,G as ht,J as j,K as M,S as N,Tt as P,W as gt,X as F,Y as _t,Z as I,_ as L,at as vt,b as R,it as yt,ot as z,q as bt,x as B,y as V}from"./index-cf0xP0kN.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./card-CU7PsoYg.js";import{a as Dt,i as H,n as Ot,o as U,r as W,t as kt}from"./table-C5Ypy4Nm.js";import{t as At}from"./TimeRangePicker-BiV08HXf.js";import{t as jt}from"./FilterBar-Cu1qlC3G.js";import{t as Mt}from"./AdvancedFilter-DX4JYkKu.js";var G=re(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Nt=.1,Pt=[248,248,248],Ft=[24,24,24];function It(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 Lt(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 Lt(e,t,n)>=Nt}function Rt(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 zt(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 Bt=12*1024*1024,Vt=480,Ht=160,Ut=.92;async function Wt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Se());if(e.size>Bt)throw Error(dt());let{source:n,width:r,height:i,cleanup:a}=await Gt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Vt/r,Ht/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(x());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=It(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(x());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)?Rt(e.data,t.variantFor===`dark`?Pt:Ft):zt(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`,Ut)??await Y(f,`image/png`);if(!h)throw Error(Me());return{blob:h,hasAlpha:m}}finally{a()}}async function Gt(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(ot())),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 Kt(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`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Jt(e){return e===`light`?ce():e===`dark`?ct():xe()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:s}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Ue(`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)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Xt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),s?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:s,"aria-label":o(),title:o(),children:(0,X.jsx)(mt,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=C(b.charts.listMyCharts),r=T(b.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:Te()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:w(),subtitle:Ce(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?$e():n.via===`owner`?Ke():be({group:n.via.group});return(0,X.jsx)(Zt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Kt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ie()}):null]})}function $t(){let e=T(b.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[u,f]=(0,K.useState)(!1);async function h(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),l(!1);try{i(await t.text())}catch{o(m())}}}async function g(){if(o(null),l(!1),t.trim()===``){o(ne());return}let a;try{a=JSON.parse(r)}catch{o(m());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:pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(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:p()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:fe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:s()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:pt(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),se(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void h(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:u,onClick:()=>void g(),children:_()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:d()}):null]})]})}function en({chart:e}){let t=nt(b.charts.setChartLogo),n=T(b.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.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 Wt(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`?l():u()}),(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)(k,{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?st():ue(),(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)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void m(e),children:le()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:c()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:te()}),(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:lt()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=C(b.me.getMe,{host:z}),n=T(b.charts.addChartDomain),r=T(b.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 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:Pe()}),(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:Ee()}):u.map(e=>(0,X.jsxs)(F,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":it({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:i,onChange:e=>a(e.target.value),placeholder:Ye(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:Ae()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:He()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function nn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function rn({chart:e}){let t=T(b.charts.updateChart),n=T(b.charts.deleteChart),[r,i]=(0,K.useState)(!1),[o,s]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>nn(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1);function _(){s(e.name),l(nn(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(c)}catch{p(m());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(S()))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)(k,{variant:`outline`,size:`sm`,onClick:_,children:a()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:ze()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:et()}),(0,X.jsx)(I,{value:o,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:ft()}),(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=>d(Number(e.target.value)),"aria-label":ft()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?oe():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ee()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:qe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:h,onClick:()=>void v(),children:Be()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:we()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function an(){let e=C(b.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:v()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(rn,{chart:e},e.key))})]})}function on({chart:e,groups:t}){let n=T(b.charts.addChartToGroupPool),r=T(b.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)(F,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?me():e.kind===`custom`&&e.scope===`personal`?E():ge()}),e.isGlobalDefault?(0,X.jsx)(F,{variant:`default`,children:he()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Xe()}),(a??[]).map(e=>(0,X.jsxs)(F,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":f({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(N,{size:`sm`,className:`w-56`,children:(0,X.jsx)(A,{placeholder:g()})}),(0,X.jsx)(R,{children:s.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 sn({chart:e}){let t=T(b.charts.promoteChartToCommon),n=T(b.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function a(){if(e.chartId!==void 0&&window.confirm(S()))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)(F,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Oe():E()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ge({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:i()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void a(),children:ae()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=T(b.admin.setDefaultThemeMode),a=T(b.admin.setDefaultLocale),o=T(b.charts.setDefaultChart),s=C(b.charts.listChartsAdmin),c=C(b.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:Je()}),(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:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:We()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:w()}),vt.map(e=>(0,X.jsx)(k,{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)(k,{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:tt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:De()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(on,{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:r()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ie()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(tn,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Le()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(sn,{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:ut()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void i({mode:e}),children:Jt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:je()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,X.jsx)(k,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e}),children:e===`fr`?ye():Fe()},e))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ne()})]})]})}function ln(){let e=C(b.me.getMe,{host:z}),t=yt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)($t,{}),(0,X.jsx)(an,{}),e?.role===`admin`?(0,X.jsx)(cn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function un(){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)(ln,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Ve()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(P,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(F,{children:`Default`}),(0,X.jsx)(F,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(F,{variant:`outline`,children:`Outline`}),(0,X.jsx)(F,{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)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(N,{className:`w-56`,children:(0,X.jsx)(A,{placeholder:`Select…`})}),(0,X.jsxs)(R,{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)(L,{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)(jt,{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)(N,{size:`sm`,children:(0,X.jsx)(A,{})}),(0,X.jsxs)(R,{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)(N,{size:`sm`,children:(0,X.jsx)(A,{})}),(0,X.jsxs)(R,{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)(Mt,{fields:qt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(At,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(gt,{children:[(0,X.jsx)(_t,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(P,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(bt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(M,{children:`Edit`}),(0,X.jsx)(M,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(M,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Et,{className:`w-80`,children:[(0,X.jsxs)(xt,{children:[(0,X.jsx)(wt,{children:`Instance`}),(0,X.jsx)(Tt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(Ct,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(St,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(kt,{children:[(0,X.jsx)(Dt,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(L,{"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)(Ot,{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)(L,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(F,{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)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(P,{})})})]},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{un as ThemeShowroom};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$f as r,Ab as i,Af as a,Bb as o,Bf as s,Db as c,Eb as l,Fb as u,Ff as d,Gb as f,Gf as p,Hb as m,Hf as h,Ib as g,If as _,Jb as v,Jf as y,Kb as b,Kf as x,Lb as S,Lf as ee,Mb as te,Mf as C,Nb as ne,Nf as re,Ob as ie,Pb as ae,Pf as oe,QD as w,Qf as se,Rb as T,Rf as ce,Ub as E,Uf as le,Vb as D,Vf as ue,Wb as O,Wf as de,Xb as k,Xf as fe,Yb as A,Yf as pe,ZD as j,Zf as me,_b as M,ap as he,bb as ge,cb as N,cp as _e,db as ve,dp as ye,ep as be,fb as xe,fp as Se,gb as Ce,hb as we,iO as P,ip as Te,jb as F,jf as I,kb as Ee,lb as De,lp as Oe,mb as ke,mp as Ae,np as je,op as Me,pb as Ne,pp as Pe,qb as Fe,qf as Ie,rO as L,rp as Le,sb as Re,sp as ze,tp as Be,ub as Ve,up as He,vb as Ue,xb as We,yb as Ge,zb as Ke,zf as qe}from"./dist-DbxuL-_t.js";import{n as Je}from"./dist-BKPj1yrt.js";import{t as Ye}from"./x-BpWCNC8c.js";import{i as R,n as z,r as Xe,t as Ze}from"./tabs-CIgCijas.js";import{t as B}from"./button-BaP2jczn.js";import{$ as Qe,C as V,Ct as $e,Dt as et,Mt as tt,Q as nt,S as H,X as U,a as rt,b as W,et as it,i as at,jt as ot,k as st,nt as ct,o as lt,ot as ut,r as dt,rt as ft,wt as pt,x as G,y as K}from"./index-cf0xP0kN.js";import{n as mt}from"./TimeRangePicker-BiV08HXf.js";import{t as q}from"./FilterBar-Cu1qlC3G.js";import{t as ht}from"./AdvancedFilter-DX4JYkKu.js";import{t as gt}from"./DataTableShell-DBktq6d-.js";var _t=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),vt=w(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function yt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?F():n===`agent`?`${i()} - ${r}`:e}function bt(){let e=P(j.me.getMe,{host:ut})?.role===`admin`,t=P(j.deliveryTiming.getDeliveryStatus,{}),n=L(j.deliveryTiming.startDeliveryRecord),r=L(j.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:k()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:A()})]}),e?(0,Y.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?Fe():v()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(U,{variant:`secondary`,children:b()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:f({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?m():E()})}),i?(0,Y.jsx)(xt,{isAdmin:e}):null]})}function xt({isAdmin:e}){let t=P(j.deliveryTiming.listDeliverySessions,{}),n=L(j.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[a,s]=(0,J.useState)(`all`),[l,d]=(0,J.useState)(X),[f,p]=(0,J.useState)(null),{from:m,to:h}=mt(l),_=l.to===`now`?1/0:h,v=r.trim()!==``||a!==`all`||l!==X,y=()=>{i(``),s(`all`),d(X)},b=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=m&&t.startedAt<=_).map(e=>({...e,_id:e.sessionId}))},[t,r,a,m,_]),x=e=>{let t=new Set((b??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),f!==null&&r.includes(f)&&p(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(q,{q:r,onQChange:i,searchPlaceholder:o(),timeRange:l,onTimeRangeChange:d,onReset:y,canReset:v,children:(0,Y.jsxs)(K,{value:a,onValueChange:e=>s(e),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(V,{})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(G,{value:`all`,children:Ke()}),(0,Y.jsx)(G,{value:`active`,children:T()}),(0,Y.jsx)(G,{value:`stopped`,children:S()})]})]})}),(0,Y.jsx)(gt,{title:D(),rows:b,emptyHint:N(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":f===e.sessionId?ie():Ee(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:f===e.sessionId?(0,Y.jsx)(_t,{size:15,"aria-hidden":!0}):(0,Y.jsx)(pt,{size:15,"aria-hidden":!0})})},{header:g(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:u(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.stoppedAt).toLocaleString()})},{header:ae(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:ne(),sort:e=>e.startedBy,cell:e=>yt(e.startedBy)},{header:te(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(U,{variant:`secondary`,children:T()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:S()})}],rowActions:e?e=>[{label:c(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:c(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===f,renderExpanded:e=>(0,Y.jsx)(St,{sessionId:e.sessionId})})]})}function St({sessionId:e}){let t=P(j.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ct,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(st(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ct({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:l()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:O()});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,` `,Re()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Je,{size:13,"aria-hidden":!0}):(0,Y.jsx)(et,{size:13,"aria-hidden":!0}),t?De():Ve()]})]}),(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:Ge()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ue()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:M()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(Ce(),r.bridge),i(we(),r.A),i(ke(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:xe()})]})}var wt=[50,100,200,500],Tt=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=tt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,i=e.kind,a=e.statusClass??Q,o=e.principalType??Q,c=e.direction??Q,l=e.roleKey??Q,u=e.q??``,f=dt(e.from,e.to),m=(0,J.useMemo)(()=>lt(e.adv),[e.adv]),{from:g,to:v}=mt(f),[b,S]=(0,J.useState)(null),[te,C]=(0,J.useState)(null),ne=e=>void t({search:t=>({...t,limit:e})}),ie=e=>void t({search:t=>({...t,kind:e})}),ae=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),w=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,...rt(e)})}),k=e=>void t({search:t=>({...t,adv:at(e)}),replace:!0}),A=P(j.observability.listEvents,{limit:n}),M=P(j.observability.listEvents,{limit:n,kind:i===Tt?void 0:i,filter:{q:u||void 0,from:g,to:v,statusClass:a===Q?void 0:a,principalType:o===Q?void 0:o,direction:c===Q?void 0:c,roleKey:l===Q?void 0:l,advanced:m.length>0?m:void 0}}),N=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])e.add(t.kind);return[...e].sort()},[A]),ve=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[A]),xe=u!==``||a!==Q||o!==Q||c!==Q||l!==Q||m.length>0||f.kind!==`relative`||f.from!==kt.from;function Ce(){t({search:{limit:100,kind:`all`},replace:!0})}let we=b?A?.filter(e=>e.correlationId===b):M,[F,I]=(0,J.useState)(`events`);return(0,Y.jsxs)(Ze,{value:F,onValueChange:e=>I(e),children:[(0,Y.jsxs)(Xe,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)($e,{size:13,"aria-hidden":!0}),We()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),ge()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(bt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ae(),(0,Y.jsx)(`strong`,{children:Pe()}),Se(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:ye()})]}),(0,Y.jsxs)(q,{q:u,onQChange:ae,searchPlaceholder:He(),timeRange:f,onTimeRangeChange:O,onReset:Ce,canReset:xe,children:[(0,Y.jsxs)(K,{value:a,onValueChange:w,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(V,{placeholder:Oe()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(G,{value:Q,children:_e()}),Et.map(e=>(0,Y.jsx)(G,{value:e,children:e},e))]})]}),(0,Y.jsxs)(K,{value:o,onValueChange:T,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(V,{placeholder:ze()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(G,{value:Q,children:Me()}),Dt.map(e=>(0,Y.jsx)(G,{value:e,children:e},e))]})]}),(0,Y.jsxs)(K,{value:c,onValueChange:E,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(V,{placeholder:he()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(G,{value:Q,children:Te()}),Ot.map(e=>(0,Y.jsx)(G,{value:e,children:e},e))]})]}),(0,Y.jsxs)(K,{value:l,onValueChange:D,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(V,{placeholder:Le()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(G,{value:Q,children:je()}),ve.map(e=>(0,Y.jsx)(G,{value:e,children:e},e))]})]}),(0,Y.jsxs)(K,{value:i,onValueChange:ie,children:[(0,Y.jsx)(H,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(V,{placeholder:Be()})}),(0,Y.jsxs)(W,{children:[(0,Y.jsx)(G,{value:Tt,children:be()}),N.map(e=>(0,Y.jsx)(G,{value:e,children:e},e))]})]}),(0,Y.jsxs)(K,{value:String(n),onValueChange:e=>ne(Number(e)),children:[(0,Y.jsx)(H,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(V,{})}),(0,Y.jsx)(W,{children:wt.map(e=>(0,Y.jsx)(G,{value:String(e),children:r({count:e})},e))})]})]}),(0,Y.jsx)(ht,{fields:At,seed:m,onChange:k}),b?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:se(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,Y.jsx)(`code`,{children:$(b)})]}),(0,Y.jsx)(Ye,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:fe()})]})}):null,(0,Y.jsx)(gt,{title:pe(),rows:we,emptyHint:b?y():Ie(),columns:[{header:x(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:p(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(U,{variant:`secondary`,children:e.kind})},{header:de(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":le(),children:`✓`})}},{header:h(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(U,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ue(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(U,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:s(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(U,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:qe(),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:ce(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Mt(e.status)}`,children:e.status})},{header:ee(),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:_(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:d(),onClick:()=>S(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:oe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:re()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(Pt,{row:te,onClose:()=>C(null)})]})]})}function Mt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Nt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Pt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(nt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(Qe,{className:`max-w-lg`,children:[(0,Y.jsxs)(ct,{children:[(0,Y.jsxs)(ft,{className:`oc-traces__meta-title`,children:[C(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(U,{variant:`outline`,children:I()})]}),(0,Y.jsx)(it,{children:a()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,A_ as i,B_ as a,C_ as o,D_ as s,E_ as c,F_ as l,G_ as u,Gd as d,H_ as f,I_ as ee,J_ as p,Jd as m,K_ as te,Kd as h,L_ as ne,M_ as re,N_ as ie,O_ as ae,P_ as oe,Qd as g,R_ as se,S_ as ce,T_ as le,U_ as ue,V_ as de,W_ as _,Wd as v,Xd as y,Y_ as b,Yd as x,ZD as S,Zd as C,ef as w,iO as T,j_ as fe,k_ as pe,n_ as E,nf as D,q_ as O,qd as k,rO as A,tf as j,w_ as me,x_ as he,z_ as ge}from"./dist-DbxuL-_t.js";import{t as M}from"./button-BaP2jczn.js";import{$ as N,A as P,C as F,G as I,K as L,M as R,Mt as _e,Q as z,S as B,W as V,X as H,Y as ve,_ as U,_t as W,b as G,d as K,et as ye,f as be,gt as q,j as xe,jt as Se,nt as Ce,ot as we,p as J,q as Te,rt as Ee,x as Y,y as X}from"./index-cf0xP0kN.js";import{t as De}from"./FilterBar-Cu1qlC3G.js";import{t as Oe}from"./DataTableShell-DBktq6d-.js";import{t as ke}from"./DetailChips-DH3IDw6I.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:i}){let a=T(S.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=T(S.agents.listUserAgents,n&&e?{profileId:e}:`skip`),s=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),c=(o??[]).find(e=>e.isDefault)??null,l=c?`${c.instanceName}/${c.agentId}`:null,u=new Set((a?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),d=[...(a?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!u.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],f=new Map;for(let e of d){let t=f.get(e.instanceName)??[];t.push(e),f.set(e.instanceName,t)}return(0,Q.jsx)(z,{open:n,onOpenChange:i,children:(0,Q.jsxs)(N,{className:`oc-access`,children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:D({user:t})}),(0,Q.jsx)(ye,{children:j()})]}),a?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:a.inGroup?w():r()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:g()}):d.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:x()}):[...f.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:s,defaultKey:l},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=A(S.agents.assignAgent),s=A(S.agents.removeAgent),c=A(S.agents.setDefaultAgent),l=P();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(C(),e)}}async function f(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(y(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(U,{checked:r,disabled:s&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":m({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:k()}):null,e.outOfPool?(0,Q.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:h()}):null,r?o?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":d(),title:d(),children:(0,Q.jsx)(q,{size:14,fill:`currentColor`})}):(0,Q.jsx)(M,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":v(),title:v(),onClick:()=>void f(e.agentId),children:(0,Q.jsx)(q,{size:14})}):null]},e.agentId)})]})}var $=`__all__`;function Me({granted:e,onToggle:t}){let n=new Set(e),r=K.filter(e=>n.has(J[e])).length;return(0,Q.jsxs)(V,{children:[(0,Q.jsx)(ve,{asChild:!0,children:(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?b():p({count:r})})}),(0,Q.jsxs)(I,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:O()}),K.map(e=>{let r=J[e];return(0,Q.jsxs)(L,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Q.jsx)(U,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Q.jsx)(`span`,{children:be[e]??e})]},e)})]})]})}function Ne(){let e=_e({from:`/settings/users`}),t=Se({from:`/settings/users`}),n=e.q??``,r=e.role??$,d=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),p=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),m=T(S.admin.listUsers,{filter:{q:n||void 0,role:r===$?void 0:r},withAgents:!0}),h=T(S.me.getMe,{host:we}),g=A(S.admin.setRole),v=A(S.admin.setUserPermissions),y=A(S.admin.startImpersonation),b=A(S.admin.deleteUser),x=A(S.admin.setUserName),C=xe(),w=R(),D=P(),[O,k]=(0,Z.useState)(null),j=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of m??[])e.add(t.role);return[...e]},[m]),M=n!==``||r!==$;function N(){t({search:{},replace:!0})}async function I(e){try{await g(e)}catch(e){D.error(te(),e)}}async function L(e){try{await v(e)}catch(e){D.error(u(),e)}}async function z(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:se(),description:ne({user:t}),confirmWord:ee(),confirmLabel:l(),destructive:!0}))try{await b({profileId:e._id}),D.success(ie({user:t}))}catch(e){D.error(oe(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:fe(),label:i({user:t}),placeholder:pe(),defaultValue:e.name??``,confirmLabel:E()});if(n!==null)try{await x({profileId:e._id,name:n}),D.success(ae())}catch(e){D.error(s(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:d,searchPlaceholder:_(),onReset:N,canReset:M,children:(0,Q.jsxs)(X,{value:r,onValueChange:p,children:[(0,Q.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:$,children:ue()}),j.map(e=>(0,Q.jsx)(Y,{value:e,children:e},e))]})]})}),(0,Q.jsx)(Oe,{title:f(),rows:m,emptyHint:de(),rowActions:e=>{let t=[{label:he(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:re(),onSelect:()=>void V(e)}];return e.userId!==h?.userId&&t.push({label:a(),onSelect:()=>void y({profileId:e._id})},{label:ge(),variant:`destructive`,onSelect:()=>void z(e)}),t},columns:[{header:c(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:t}),n?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:le(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Q.jsxs)(X,{value:e.role,onValueChange:t=>void I({profileId:e._id,role:t}),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-28`,children:(0,Q.jsx)(F,{})}),(0,Q.jsxs)(G,{children:[(0,Q.jsx)(Y,{value:`pending`,children:`pending`}),(0,Q.jsx)(Y,{value:`user`,children:`user`}),(0,Q.jsx)(Y,{value:`admin`,children:`admin`})]})]})},{header:me(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:o()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),L({profileId:e._id,permissions:[...n]})}})},{header:ce(),cell:e=>(0,Q.jsx)(ke,{icon:(0,Q.jsx)(W,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Q.jsx)(Ae,{profileId:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Ne as UsersTab};
|