@lacneu/atrium 0.18.1 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessTab-SACgMGAi.js +1 -0
- package/dist/assets/{AdvancedFilter-CxFcwq_P.js → AdvancedFilter-D7QXVQ5_.js} +1 -1
- package/dist/assets/AgentFilesTab-DcWaUTsA.js +3 -0
- package/dist/assets/AnomaliesTab-B856xOQY.js +1 -0
- package/dist/assets/{AuditTab-C5iOM0e2.js → AuditTab-B0xwh9EC.js} +1 -1
- package/dist/assets/BridgeTab-KP5PlAMx.js +1 -0
- package/dist/assets/ChatDefaultsTab-1p-luBRT.js +1 -0
- package/dist/assets/{DataTableShell-DQ-E7MMz.js → DataTableShell-C1ZKbpq3.js} +1 -1
- package/dist/assets/{DetailChips-DLGo-JpY.js → DetailChips-Dg4YEpwe.js} +1 -1
- package/dist/assets/FeedbacksTab-Bg62mK4W.js +1 -0
- package/dist/assets/{FieldLabel-D8ek_B4M.js → FieldLabel-X2EAqICh.js} +1 -1
- package/dist/assets/FilesTab-BiW2j80D.js +1 -0
- package/dist/assets/{FilterBar-C2YZIUUe.js → FilterBar-CSA8xMkl.js} +1 -1
- package/dist/assets/GroupsTab-CevcyqNU.js +1 -0
- package/dist/assets/InstancesTab-CK-3Nvfy.js +1 -0
- package/dist/assets/IntegrationsTab-Cf2NA4f0.js +1 -0
- package/dist/assets/{KpiTab-BSPnCroi.js → KpiTab-BHkpsXb_.js} +1 -1
- package/dist/assets/PreferencesTab-DBxEQcoG.js +1 -0
- package/dist/assets/PromptInjectionsTab-ILsAUU_D.js +2 -0
- package/dist/assets/RolesTab-cg8r2k6J.js +1 -0
- package/dist/assets/ServiceAccountsTab-DV9xE6V0.js +1 -0
- package/dist/assets/SubAgentReportsTab-Cre8FArV.js +1 -0
- package/dist/assets/ThemeShowroom-DxfyV3nj.js +1 -0
- package/dist/assets/{TimeRangePicker-BrRrLGuZ.js → TimeRangePicker-CY6cFX3v.js} +1 -1
- package/dist/assets/TracesTab-C5hnZP3-.js +1 -0
- package/dist/assets/UsersTab-DDINHhFG.js +1 -0
- package/dist/assets/button-DXGXeanX.js +1 -0
- package/dist/assets/{card-DfgoJ62e.js → card-B60DsQBe.js} +1 -1
- package/dist/assets/chevrons-up-down-CeISPPN2.js +1 -0
- package/dist/assets/{compatView-DkKdPV6Y.js → compatView-BKe3swOt.js} +1 -1
- package/dist/assets/dispatchErrorInfo-DekuLV6o.js +1 -0
- package/dist/assets/{dist-uaKglBXL.js → dist-AH7-HhdT.js} +1 -1
- package/dist/assets/{dist-BUmwZkrg.js → dist-By-c_NRB.js} +1 -1
- package/dist/assets/dist-BzNYkP4V.js +44 -0
- package/dist/assets/{dist-nuTFLy00.js → dist-CWfWFr7t.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CFixeKPt.js → highlighted-body-OFNGDK62-CVA3g0hA.js} +1 -1
- package/dist/assets/index-CKlFEsq3.js +227 -0
- package/dist/assets/{index-CwMQjTTm.css → index-DnIjl_W2.css} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-BKbfiXDa.js +1 -0
- package/dist/assets/roleDescriptions-BN-dndvd.js +1 -0
- package/dist/assets/{table-DwL2Ye60.js → table-AFxsandT.js} +1 -1
- package/dist/assets/{tabs-B6uAHd27.js → tabs-9X-5Pgx3.js} +1 -1
- package/dist/assets/x-DQ_CLIEK.js +1 -0
- package/dist/index.html +8 -8
- package/package.json +1 -1
- package/dist/assets/AccessTab-TkrgrzLa.js +0 -1
- package/dist/assets/AgentFilesTab-CatKzUVP.js +0 -3
- package/dist/assets/AnomaliesTab-DSRyvaxR.js +0 -1
- package/dist/assets/BridgeTab-B7qr2P6q.js +0 -1
- package/dist/assets/ChatDefaultsTab-iOv_x32i.js +0 -1
- package/dist/assets/FeedbacksTab-CvsErlG2.js +0 -1
- package/dist/assets/FilesTab-B33o68UO.js +0 -1
- package/dist/assets/GroupsTab-CdvzID07.js +0 -1
- package/dist/assets/InstancesTab-CGkYjfNo.js +0 -1
- package/dist/assets/IntegrationsTab-CQpiJULa.js +0 -1
- package/dist/assets/PreferencesTab-C7qcojIg.js +0 -1
- package/dist/assets/PromptInjectionsTab-CogXAvHV.js +0 -2
- package/dist/assets/RolesTab--gHOFpff.js +0 -1
- package/dist/assets/ServiceAccountsTab-Cp2DaUB7.js +0 -1
- package/dist/assets/SubAgentReportsTab-UtnXHw5b.js +0 -1
- package/dist/assets/ThemeShowroom-cqNDsPWJ.js +0 -1
- package/dist/assets/TracesTab-nnYTuzmk.js +0 -1
- package/dist/assets/UsersTab-C0cFq4Am.js +0 -1
- package/dist/assets/button-C-Nb2Vgm.js +0 -1
- package/dist/assets/chevrons-up-down-BX1oFIbx.js +0 -1
- package/dist/assets/dispatchErrorInfo-B5yYJpqG.js +0 -1
- package/dist/assets/dist-dqCqhBJa.js +0 -44
- package/dist/assets/index-Chpx7q4s.js +0 -227
- package/dist/assets/mermaid-GHXKKRXX-l2fnQUrB.js +0 -1
- package/dist/assets/roleDescriptions-BAcwraVL.js +0 -1
- package/dist/assets/x-BK7YTQm6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./index-CKlFEsq3.js";export{e as Mermaid};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{am as e,cm as t,lm as n,om as r,sm as i}from"./dist-BzNYkP4V.js";var a={pending:n,user:t,admin:i,observer:r,agent:e};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-BzNYkP4V.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{aD as r,cD as i,eD as a,lD as o,n as s,nD as c,t as l,tD as u}from"./dist-BzNYkP4V.js";import{t as d}from"./dist-AH7-HhdT.js";import{dt as f,ft as p,pt as m}from"./index-CKlFEsq3.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=r(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:l=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=c({prop:r,onChange:i,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:a(),value:h,onValueChange:v,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(o.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),s=b(n);return(0,g.jsx)(p,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(o.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:a=!1,...s}=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:!a,active:p,children:(0,g.jsx)(o.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":d,"data-state":p?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:u,...s,ref:t,onMouseDown:i(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?c.onValueChange(r):e.preventDefault()}),onKeyDown:i(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&c.onValueChange(r)}),onFocus:i(e.onFocus,()=>{let e=c.activationMode!==`manual`;!p&&!a&&e&&c.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=S(O,n),l=A(c.baseId,r),d=j(c.baseId,r),f=r===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(u,{present:i||f,children:({present:n})=>(0,g.jsx)(o.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});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:s(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=l(`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:s(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:s(`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:s(`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{_D as e}from"./dist-BzNYkP4V.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-CKlFEsq3.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-BzNYkP4V.js">
|
|
44
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-AH7-HhdT.js">
|
|
45
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-By-c_NRB.js">
|
|
46
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-CWfWFr7t.js">
|
|
47
|
+
<link rel="modulepreload" crossorigin href="/assets/x-DQ_CLIEK.js">
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/assets/button-DXGXeanX.js">
|
|
49
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DnIjl_W2.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.19.1",
|
|
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{$a as r,Ga as i,Ja as a,Ka as o,Qa as s,RE as c,Wa as l,Xa as u,Ya as d,Za as f,dD as p,eo as m,io as h,no as g,qa as _,ro as v,to as y,vD as b}from"./dist-dqCqhBJa.js";import{C as x,S,X as C,b as w,x as T,y as E}from"./index-Chpx7q4s.js";var D=t(e(),1);function O(e){return e===`user`?a():e===`all`?_():o({group:e.group})}function k(e){return e===`common`?i():e===`owner`?l():o({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=b(p.admin.listUsers,{}),[t,n]=(0,D.useState)(``),i=b(p.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(S,{size:`sm`,"aria-label":v(),children:(0,A.jsx)(x,{placeholder:v()})}),(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:g()}):i===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(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:y()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:i.user.label}),(0,A.jsx)(C,{variant:`secondary`,children:i.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:m()}),i.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.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:r()}),i.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.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:d()}):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:s()}),i.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.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()}),i.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.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{Ar as r,Ax as i,BE as a,Br as o,Cr as s,Dr as c,Er as l,Fr as ee,Ir as te,Lr as ne,Mr as re,Nr as u,Or as d,Pr as ie,RE as f,Rr as ae,Si as p,Sr as m,Tr as h,Vr as g,_r as _,bi as oe,br as v,dD as y,fr as b,gr as x,hD as S,hr as C,jr as w,kr as T,mr as E,pr as se,vD as D,vr as O,wr as k,xr as A,yr as j,zr as M}from"./dist-dqCqhBJa.js";import{t as N}from"./button-C-Nb2Vgm.js";import{$ as P,A as F,B as I,C as L,F as ce,I as le,L as ue,N as de,P as fe,Q as pe,R as me,S as R,X as z,b as B,et as he,mt as V,nt as ge,ot as H,rt as _e,v as U,x as W,y as G,z as ve}from"./index-Chpx7q4s.js";import{i as K}from"./compatView-DkKdPV6Y.js";/* empty css */var q=t(e(),1),J=2e4,Y=6e4;function X(e){return typeof e!=`number`||e<=0?0:Math.round(e/J*100)}function Z(e){return e<=0?0:Math.round(e/Y*100)}function ye(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=D(y.me.getMe,{host:H}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=D(y.admin.listInstances,e!==void 0&&t?{}:`skip`),[s,c]=(0,q.useState)(null);(0,q.useEffect)(()=>{!t||!i||i.length===0||(!s||!i.some(e=>e.name===s))&&c(i[0].name)},[t,i,s]);let l=D(y.agents.listAgentsForInstance,t&&s?{instanceName:s}:`skip`),d=D(y.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),p=(0,q.useMemo)(()=>{if(e!==void 0){if(t)return s===null||l===void 0?i!==void 0&&i.length===0?[]:void 0:l.agents.map(e=>({instanceName:s,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(d!==void 0)return d.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,s,l,i,d]),[m,h]=(0,q.useState)(null);(0,q.useEffect)(()=>{!p||p.length===0||(!m||!p.some(e=>$(e)===m))&&h($(p[0]))},[p,m]);let _=p?.find(e=>$(e)===m)??null,v=S(y.agentFiles.listAgentFiles),[b,x]=(0,q.useState)({status:`idle`}),C=_?.instanceName??null,E=_?.agentId??null,se=D(y.compat.forInstance,n&&C!==null?{instanceName:C}:`skip`),O=n&&C!==null?U(se,`agentFiles`):null,k=O===null?!1:O===`loading`?null:O.blocked,A=(0,q.useCallback)(async()=>{if(!(C===null||E===null)){x({status:`loading`});try{x({status:`done`,files:(await v({instanceName:C,agentId:E})).files})}catch{x({status:`error`})}}},[v,C,E]);(0,q.useEffect)(()=>{k===!1&&A()},[A,k]);let[j,P]=(0,q.useState)(null),F=a(),I=(0,q.useMemo)(()=>new Intl.NumberFormat(F,{maximumFractionDigits:0}),[F]);return e===void 0||p===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(G,{value:s??``,onValueChange:e=>c(e),children:[(0,Q.jsx)(R,{size:`sm`,"aria-label":o(),children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(B,{children:(i??[]).map(e=>(0,Q.jsx)(W,{value:e.name,children:e.name},e.name))})]}):null,p.length>0?(0,Q.jsxs)(G,{value:m??``,onValueChange:e=>h(e),children:[(0,Q.jsx)(R,{size:`sm`,"aria-label":M(),children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(B,{children:p.map(e=>(0,Q.jsx)(W,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ae()})]}),_===null?null:O===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):O!==null&&O.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(V,{size:14,"aria-hidden":!0}),` `,K(O.gatewayVersion)]}):b.status===`loading`||b.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):b.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[te(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void A(),children:oe()})]}):b.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ne()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:b.files.map(e=>{let n=X(e.size),i=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)(z,{variant:`outline`,children:ee()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:ie({size:ye(e.size,F)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${i?` 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:u({pct:I.format(n)})}),i?(0,Q.jsx)(V,{size:14,className:`oc-afiles__warn`,"aria-label":re()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(N,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>P(e),children:t?r():T()})]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:w({used:ye(be(b.files),F),total:ye(Y,F),pct:I.format(Z(be(b.files)))})})]}),j&&_?(0,Q.jsx)(Te,{instanceName:_.instanceName,agentId:_.agentId,name:j.name,isAdmin:t,onClose:()=>P(null),onSaved:()=>void A()}):null]})}function Te({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:o,onSaved:ee}){let te=S(y.agentFiles.getAgentFile),ne=S(y.agentFiles.setAgentFile),re=F(),[u,ie]=(0,q.useState)(null),[ae,g]=(0,q.useState)(!1),[w,T]=(0,q.useState)(``),[D,M]=(0,q.useState)(!1),[L,R]=(0,q.useState)(!1),[z,B]=(0,q.useState)(!1),[V,H]=(0,q.useState)(!1),U=(0,q.useCallback)(async r=>{g(!1);try{let i=await te({instanceName:e,agentId:t,name:n});ie({content:i.content,updatedAtMs:i.updatedAtMs}),r||T(i.content),B(!1)}catch{g(!0)}},[te,e,t,n]);(0,q.useEffect)(()=>{U(!1)},[U]);async function W(){if(u!==null){R(!0),H(!1);try{await ne({instanceName:e,agentId:t,name:n,content:w,baseUpdatedAtMs:u.updatedAtMs??void 0}),re.success(m({name:n})),ee(),await U(!1)}catch(e){Ce(e)?B(!0):H(!0)}finally{R(!1)}}}let G=u!==null&&w!==u.content,K=(0,q.useMemo)(()=>u===null?null:Se(u.content,w),[u,w]),Y=w.length>J,X=a(),Z=(0,q.useMemo)(()=>new Intl.NumberFormat(X),[X]);return(0,Q.jsx)(pe,{open:!0,onOpenChange:e=>!e&&o(),children:(0,Q.jsxs)(P,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(ge,{children:[(0,Q.jsx)(_e,{children:d({name:n})}),(0,Q.jsxs)(he,{children:[c({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,l()]})]})]}),ae?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[v(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void U(!1),children:oe()})]}):u===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:w,readOnly:!r,spellCheck:!1,onChange:e=>T(e.target.value),"aria-label":d({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:h()}),z?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[j(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void U(!0),children:O()})]}):null,V?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:A()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${Y?` is-over`:``}`,children:k({count:Z.format(w.length),max:Z.format(J)})}),r?(0,Q.jsx)(N,{size:`sm`,disabled:!G||L||z,onClick:()=>M(!0),children:L?p():s()}):null]})]}),(0,Q.jsx)(de,{open:D,onOpenChange:M,children:(0,Q.jsxs)(le,{children:[(0,Q.jsxs)(ve,{children:[(0,Q.jsx)(I,{children:_({name:n})}),(0,Q.jsx)(ue,{children:x({agent:t})})]}),K?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:C({added:K.added,removed:K.removed})}),K.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:E()}),K.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,K.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:se()}),K.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(ce,{children:i()}),(0,Q.jsx)(fe,{onClick:()=>void W(),children:b()})]})]})})]})})}export{we as AgentFilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ap as r,Bp as i,Cp as ee,Dp as a,Ep as te,Fp as ne,Gp as o,Hp as re,Ip as ie,Lp as ae,Mp as s,Np as c,Op as l,Pp as u,Rp as d,Sp as f,Tp as p,Up as m,Vp as oe,Wp as h,_D as se,_p as ce,ap as g,bp as _,cp as le,dD as v,dp as ue,fp as de,gp as fe,hp as pe,ip as y,jp as me,kp as he,lp as ge,mp as b,op as x,pp as S,rp as C,sp as w,up as T,vD as E,vp as D,wp as O,xp as k,yp as A,zp as j}from"./dist-dqCqhBJa.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-Chpx7q4s.js";import{n as be}from"./TimeRangePicker-BrRrLGuZ.js";import{t as xe}from"./FilterBar-C2YZIUUe.js";import{t as Se}from"./DataTableShell-DQ-E7MMz.js";import{t as H}from"./dispatchErrorInfo-B5yYJpqG.js";var U=t(e(),1),W=n(),G=`__all__`,Ce=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function we(e){return e===`open`?o():e===`acknowledged`?h():m()}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??``,o=e.status===K?G:e.status,m=e.severity??G,h=e.kind??G,[g,y]=(0,U.useState)(G),x=ye(e.from,e.to),{from:C,to:H}=be(x),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=se(v.anomalies.resolveAnomaly),Fe=(E(v.me.getMe,{host:ve})?.permissions??[]).includes(`admin.manage`),$=E(v.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:C,to:H,anomalyStatus:o===G?void 0:o,severity:m===G?void 0:m,source:g===G?void 0:g,kind:h===G?void 0:h}}),Ie=(0,U.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Le=n!==``||o!==`open`||m!==G||g!==G||h!==G||x.kind!==`relative`||x.from!==De.from;function Re(){y(G),t({search:{status:`open`},replace:!0})}async function ze(e){if(await Pe({title:re(),description:(0,W.jsxs)(W.Fragment,{children:[oe(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,i(),` `,(0,W.jsx)(`strong`,{children:j()}),`.`,` `,d()]}),confirmLabel:ae()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(ie(),e.kind)}catch(e){Z.error(ne(),e)}}async function Be(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(u(),e.kind)}catch(e){Z.error(c(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[s(),` `,(0,W.jsx)(`strong`,{children:me()}),` `,r(),` `,(0,W.jsx)(`strong`,{children:he()}),` `,l(),` `,(0,W.jsx)(`strong`,{children:a()}),` `,te(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:p()})]}),(0,W.jsxs)(xe,{q:n,onQChange:q,searchPlaceholder:O(),timeRange:x,onTimeRangeChange:X,onReset:Re,canReset:Le,children:[(0,W.jsxs)(V,{value:o,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:ee()}),Ce.map(e=>(0,W.jsx)(B,{value:e.value,children:we(e.value)},e.value))]})]}),(0,W.jsxs)(V,{value:m,onValueChange:Y,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:f()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:k()}),Te.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:g,onValueChange:y,children:[(0,W.jsx)(F,{size:`sm`,className:`w-32`,children:(0,W.jsx)(N,{placeholder:_()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:A()}),Ee.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:h,onValueChange:Ne,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:D()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:ce()}),Ie.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Se,{title:fe(),rows:$,emptyHint:o===`open`?pe():b(),rowActions:e=>Fe&&e.status===`open`?[{label:S(),onSelect:()=>void ze(e)},{label:de(),onSelect:()=>void Be(e)}]:[],columns:[{header:ue(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:D(),cell:e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:f(),cell:e=>(0,W.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:T(),cell:e=>(0,W.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:_(),cell:e=>(0,W.jsx)(I,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:ge(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:le(),cell:e=>(0,W.jsx)(ke,{row:e}),sort:e=>e.evidence??null},{header:w(),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:[`↗ `,x()]}):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:[`↗ `,x()]}):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:g()}):e===`acknowledged`?(0,W.jsx)(I,{variant:`secondary`,children:y()}):(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{$l as r,$u as i,Bl as a,Bn as o,Cu as s,Fl as c,Gl as l,Gn as u,Gu as d,Hl as f,Hn as p,Il as m,In as h,Jl as g,Jn as _,Kl as v,Kn as y,Ku as ee,Ll as b,Ql as te,Qu as ne,Rl as re,Su as ie,Ul as ae,Un as oe,Vl as se,Vn as ce,Wl as le,Wn as ue,Xl as de,Xn as fe,Xu as pe,Yl as x,Yn as me,Yu as he,Zl as ge,Zn as _e,Zu as ve,_D as ye,_u as be,ad as xe,au as Se,bu as Ce,cu as S,dD as C,du as we,ed as Te,eu as Ee,fD as w,fu as De,gu as Oe,hD as ke,hu as Ae,id as je,iu as Me,lu as Ne,mu as Pe,nd as Fe,nu as Ie,ou as Le,pu as Re,ql as ze,qn as Be,ru as Ve,su as He,td as Ue,tu as We,uu as Ge,vD as T,vu as Ke,xu as qe,yu as Je,zl as Ye}from"./dist-dqCqhBJa.js";import{i as E,r as Xe}from"./dist-uaKglBXL.js";import{t as Ze}from"./chevrons-up-down-BX1oFIbx.js";import{i as Qe,n as D,o as $e,r as et,s as tt}from"./FieldLabel-D8ek_B4M.js";import{t as O}from"./button-C-Nb2Vgm.js";import{$ as nt,A as rt,At as it,C as k,H as at,Q as ot,S as A,St as st,U as ct,V as lt,X as j,Z as M,_ as ut,_t as dt,b as N,et as ft,jt as pt,kt as P,mt as F,nt as mt,ot as ht,rt as gt,x as I,y as L}from"./index-Chpx7q4s.js";import{a as _t,i as R,n as vt,o as z,r as B,t as yt}from"./table-DwL2Ye60.js";import{t as bt}from"./FilterBar-C2YZIUUe.js";import{a as V,n as xt,o as H,r as U,s as St,t as Ct}from"./compatView-DkKdPV6Y.js";import{t as W}from"./dispatchErrorInfo-B5yYJpqG.js";var wt=w(`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`}]]),Tt=w(`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`}]]),G=t(e(),1);function K(e){return e.filter(e=>e.state===`error`)}function Et(e){return e.reachable&&K(e.targets).length===0}function Dt(e){return e.state===`error`&&e.lastErrorCode!==null}function Ot(e){return!!e.lastDownstreamRejectCode}function q(e){return e.kind??`openclaw`}function kt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function At(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,q(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(q(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return kt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>q(e)===r)}))}function jt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,Mt={q:``,state:J,instance:J,version:J},Y={connected:0,error:1,idle:2};function Nt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Pt(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 X(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Ft(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function It(e,t,n){switch(e){case`state`:return(Y[t.state]??99)-(Y[n.state]??99);case`instance`:return X(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return X(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return H(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function Lt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Ft(t.key,e),a=Ft(t.key,r);return i&&a?0:i?1:a?-1:n*It(t.key,e,r)})}function Rt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(Y[e]??99)-(Y[t]??99))}function zt(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)=>X(e.label,t.label))}function Bt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>H(e,t)??X(e,t))}var Z=n();function Vt({connections:e,displayByInstance:t}){let[n,i]=(0,G.useState)(Mt),[o,s]=(0,G.useState)(null),c=(0,G.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]),u=(0,G.useMemo)(()=>Rt(c),[c]),d=(0,G.useMemo)(()=>zt(c),[c]),p=(0,G.useMemo)(()=>Bt(c),[c]),m=(0,G.useMemo)(()=>Lt(Pt(c,n),o),[c,n,o]);function h(e){s(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:r()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(bt,{q:n.q,onQChange:e=>i(t=>({...t,q:e})),searchPlaceholder:de(),onReset:()=>i(Mt),canReset:Nt(n),children:[(0,Z.jsxs)(L,{value:n.state,onValueChange:e=>i(t=>({...t,state:e})),children:[(0,Z.jsx)(A,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(k,{placeholder:g()})}),(0,Z.jsxs)(N,{children:[(0,Z.jsx)(I,{value:J,children:x()}),u.map(e=>(0,Z.jsx)(I,{value:e,children:Ut(e)},e))]})]}),(0,Z.jsxs)(L,{value:n.instance,onValueChange:e=>i(t=>({...t,instance:e})),children:[(0,Z.jsx)(A,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(k,{placeholder:ze()})}),(0,Z.jsxs)(N,{children:[(0,Z.jsx)(I,{value:J,children:x()}),d.map(e=>(0,Z.jsx)(I,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(L,{value:n.version,onValueChange:e=>i(t=>({...t,version:e})),children:[(0,Z.jsx)(A,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(k,{placeholder:v()})}),(0,Z.jsxs)(N,{children:[(0,Z.jsx)(I,{value:J,children:x()}),p.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))]})]})]}),m.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Z.jsxs)(yt,{className:`oc-conn__table`,children:[(0,Z.jsx)(_t,{children:(0,Z.jsxs)(z,{children:[(0,Z.jsx)(Q,{label:le(),sortKey:`target`,sort:o,onSort:h}),(0,Z.jsx)(Q,{label:ae(),sortKey:`state`,sort:o,onSort:h}),(0,Z.jsx)(Q,{label:f(),sortKey:`instance`,sort:o,onSort:h}),(0,Z.jsx)(Q,{label:se(),sortKey:`host`,sort:o,onSort:h}),(0,Z.jsx)(Q,{label:a(),sortKey:`version`,sort:o,onSort:h}),(0,Z.jsx)(R,{children:Ye()}),(0,Z.jsx)(Q,{label:re(),sortKey:`lastOk`,sort:o,onSort:h})]})}),(0,Z.jsx)(vt,{children:m.map(e=>(0,Z.jsx)(Ht,{r:e},e._id))})]})]})}function Q({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Z.jsx)(R,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Z.jsx)(Xe,{size:13,"aria-hidden":!0}):(0,Z.jsx)(E,{size:13,"aria-hidden":!0}):(0,Z.jsx)(Ze,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Ht({r:e}){let t=Dt(e)?W(e.lastErrorCode):null,n=Ot(e)?W(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsxs)(z,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(B,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(B,{children:(0,Z.jsx)(Wt,{state:e.state})}),(0,Z.jsx)(B,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(B,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(B,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(B,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:te({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(B,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(z,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(B,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[ge({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Ut(e){return e===`connected`?b():e===`error`?m():c()}function Wt({state:e}){return e===`connected`?(0,Z.jsx)(j,{variant:`secondary`,children:b()}):e===`error`?(0,Z.jsx)(j,{variant:`destructive`,children:m()}):(0,Z.jsx)(j,{variant:`outline`,children:c()})}function Gt(){return T(C.bridgeHealth.getBridgeHealth,{})}function Kt(){let e=Gt(),t=T(C.compat.getBridgeCompat,{}),n=T(C.me.getMe,{host:ht})?.role===`admin`,r=T(C.admin.listInstances,n?{}:`skip`),i=pt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=At(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&xt(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(qt,{health:e,compat:t,onSeeAnomalies:a}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:Ne()}),o.map(e=>(0,Z.jsx)(Jt,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):null]})}function qt({health:e,compat:t,onSeeAnomalies:n}){let r=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:V(t.bridgeVersion)}),` · `,me(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?_():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:He()});let i=K(e.targets),a=!e.reachable,o=Et(e),s=o?`ok`:`error`,c=new Date(e.checkedAt).toLocaleString(`fr-FR`),l=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${s}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:o?(0,Z.jsx)(P,{size:22}):a?(0,Z.jsx)(Tt,{size:22}):(0,Z.jsx)(F,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:o?Le():a?Se():Me({count:i.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(wt,{size:12,"aria-hidden":!0}),` `,Ve({time:c})]}),l?(0,Z.jsx)(`span`,{children:Ie({time:l})}):null,r]}),a?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:We()})]})}function Jt({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?St(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:Ct(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,G.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(dt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:jt(e)}),d?(0,Z.jsx)(j,{variant:d===`beyond`?`destructive`:`secondary`,children:U(d)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:_e()}),(0,Z.jsx)(Yt,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c}),(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Z.jsx)(E,{size:13,"aria-hidden":!0}):(0,Z.jsx)(it,{size:13,"aria-hidden":!0}),Ee({count:t.length})]}),f?(0,Z.jsx)(Vt,{connections:t,displayByInstance:s}):null]})}function Yt({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Be()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:u()}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:ue({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:_()}),e?(0,Z.jsx)(Qt,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(0,Z.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:V(e.version)}),(0,Z.jsx)(j,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:U(e.state)})]},e.instanceName))})]})}function Xt({instance:e,onClose:t}){return(0,Z.jsx)(ot,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(nt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(mt,{children:[(0,Z.jsx)(gt,{children:xe({instance:e.displayName??e.name})}),(0,Z.jsx)(ft,{children:je()})]}),(0,Z.jsx)(Zt,{instance:e,onClose:t})]})})}function $({label:e,result:t}){return t?t.checked?(0,Z.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,Z.jsx)(P,{"aria-hidden":!0}):(0,Z.jsx)(F,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?Re():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,De()]}):null}function Zt({instance:e,onClose:t}){let n=ye(C.admin.upsertInstanceConfig),r=ke(C.bridge.validateMediaPaths),a=rt(),[o,c]=(0,G.useState)(()=>Qe(e.config??{})),[l,u]=(0,G.useState)(!1),[f,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(null),g=o.inboundMediaMode===`shared-fs`,_=o.mediaMode===`shared-fs`,v=g||_;async function y(){p(!0),h(null);try{h(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){a.error(be(),e)}finally{p(!1)}}async function b(){u(!0);try{let r=e.config??{};await n({instanceId:e._id,config:et(o,r)}),t()}catch(e){a.error(ve(),e)}finally{u(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(D,{label:Fe(),help:pe()}),(0,Z.jsxs)(L,{value:o.mediaMode,onValueChange:e=>c({...o,mediaMode:e}),children:[(0,Z.jsx)(A,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(k,{})}),(0,Z.jsx)(N,{children:tt.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(D,{label:Ue(),help:he()}),(0,Z.jsxs)(L,{value:o.inboundMediaMode,onValueChange:e=>c({...o,inboundMediaMode:e}),children:[(0,Z.jsx)(A,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(k,{})}),(0,Z.jsx)(N,{children:$e.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(D,{label:Te(),help:ee()}),(0,Z.jsx)(M,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>c({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),v&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[g&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(D,{label:s(),help:ie()}),(0,Z.jsx)(M,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>c({...o,inboundAgentMount:e.target.value})})]}),_&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(D,{label:qe(),help:Ce()}),(0,Z.jsx)(M,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>c({...o,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(ut,{checked:o.rehydration,onCheckedChange:e=>c({...o,rehydration:e===!0})}),(0,Z.jsx)(D,{label:i(),help:d()})]}),v&&m!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:m.reachable?!m.inbound&&!m.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(F,{"aria-hidden":!0}),Ge({reason:m.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:Ae(),result:m.inbound}),(0,Z.jsx)($,{label:Pe(),result:m.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(F,{"aria-hidden":!0}),we()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[v&&(0,Z.jsxs)(O,{variant:`outline`,size:`sm`,onClick:()=>void y(),disabled:f,children:[f?(0,Z.jsx)(st,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?Ke():Je()]}),(0,Z.jsx)(O,{size:`sm`,onClick:()=>void b(),disabled:l,children:ne()})]})]})})}function Qt({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(lt,{children:[(0,Z.jsx)(ct,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?oe():p({count:e.length}),(0,Z.jsx)(E,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(at,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:ce()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(j,{variant:`secondary`,children:e},e))})]})]})}export{Kt as BridgeTab,Xt as InstanceConfigDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,Ax as i,Br as a,Qn as o,RE as s,Si as c,ar as ee,bi as te,cr as ne,dD as l,er as re,gi as ie,hD as u,hi as d,ir as f,lr as ae,nr as oe,or as p,rd as m,rr as h,sr as g,tr as se,ur as ce,vD as _}from"./dist-dqCqhBJa.js";import{t as v}from"./button-C-Nb2Vgm.js";import{A as le,B as ue,C as de,F as fe,I as pe,L as me,N as he,P as y,R as b,S as x,b as S,g as C,h as w,mt as T,v as E,x as D,y as O,z as k}from"./index-Chpx7q4s.js";import{i as A}from"./compatView-DkKdPV6Y.js";/* empty css */var j=t(e(),1),M=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function N(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 P=n();function F(){let e=u(l.agentFiles.getChatDefaults),t=u(l.agentFiles.setChatDefaults),n=le(),[F,I]=(0,j.useState)({status:`loading`}),[L,R]=(0,j.useState)({thinkingDefault:null,fastModeDefault:null}),[ge,z]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1),H=_(l.admin.listInstances,{}),[U,W]=(0,j.useState)(null);(0,j.useEffect)(()=>{!H||H.length===0||(!U||!H.some(e=>e.name===U))&&W(H[0].name)},[H,U]);let G=(H?.length??0)>1,_e=H!==void 0&&H.length===0,ve=_(l.compat.forInstance,U?{instanceName:U}:`skip`),K=U?E(ve,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,j.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,j.useRef)(0),X=(0,j.useCallback)(async()=>{let t=++Y.current;I({status:`loading`});try{let n=N(await e(J));if(Y.current!==t)return;I({status:`done`,current:n}),R(n)}catch{if(Y.current!==t)return;I({status:`error`})}},[e,J]);(0,j.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=F.status===`done`?F.current:null,Q=Z!==null&&L.thinkingDefault!==null&&L.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&L.fastModeDefault!==null&&L.fastModeDefault!==Z.fastModeDefault,ye=Q||$;async function be(){V(!0);try{await t({...J,...Q?{thinkingDefault:L.thinkingDefault}:{},...$?{fastModeDefault:L.fastModeDefault}:{}}),n.success(h()),await X()}catch(e){n.error(oe(),e)}finally{V(!1)}}let xe=(0,j.useMemo)(()=>M.map(e=>({id:e,label:C(e)})),[]),Se=(0,j.useMemo)(()=>[{id:`fast`,label:ie()},{id:`standard`,label:d()}],[]);return(0,P.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:ce()}),G&&U?(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()}),(0,P.jsxs)(O,{value:U,onValueChange:e=>W(e),disabled:B,children:[(0,P.jsx)(x,{size:`sm`,"aria-label":a(),children:(0,P.jsx)(de,{})}),(0,P.jsx)(S,{children:(H??[]).map(e=>(0,P.jsx)(D,{value:e.name,children:e.name},e.name))})]})]}):null,_e?(0,P.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:m()}):K===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):K.blocked?(0,P.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,P.jsx)(T,{size:14,"aria-hidden":!0}),` `,A(K.gatewayVersion)]}):F.status===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):F.status===`error`?(0,P.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[ee(),` `,(0,P.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:te()})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:ae()}),(0,P.jsx)(w,{options:xe,value:L.thinkingDefault,onChange:e=>R({...L,thinkingDefault:e}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()})]}),(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()}),(0,P.jsx)(w,{options:Se,value:L.fastModeDefault===null?null:L.fastModeDefault?`fast`:`standard`,onChange:e=>R({...L,fastModeDefault:e===`fast`}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:p()})]}),(0,P.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,P.jsx)(v,{size:`sm`,disabled:!ye||B,onClick:()=>z(!0),children:B?c():f()})}),(0,P.jsx)(`p`,{className:`oc-cdefaults__note`,children:se()})]}),(0,P.jsx)(he,{open:ge,onOpenChange:z,children:(0,P.jsxs)(pe,{children:[(0,P.jsxs)(k,{children:[(0,P.jsx)(ue,{children:re()}),(0,P.jsx)(me,{children:r()})]}),(0,P.jsxs)(b,{children:[(0,P.jsx)(fe,{children:i()}),(0,P.jsx)(y,{onClick:()=>void be(),children:o()})]})]})})]})}export{F as ChatDefaultsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,A_ as i,B_ as a,C_ as o,D_ as s,E_ as c,F_ as l,G_ as u,H_ as d,I_ as f,J_ as p,K_ as m,L_ as h,M_ as g,N_ as _,O_ as v,P_ as y,Q_ as b,R_ as ee,S_ as te,T_ as ne,U_ as re,V_ as ie,W_ as x,X_ as S,Y_ as C,Z_ as w,_D as T,__ as E,av as D,b_ as O,cv as k,dD as A,d_ as j,dv as M,ev as N,f_ as P,fv as F,g_ as I,h_ as L,iv as R,j_ as z,k_ as B,lv as ae,m_ as V,nv as H,ov as U,p_ as W,q_ as G,rv as K,sv as q,tv as J,uv as oe,vD as se,v_ as ce,w_ as le,x_ as ue,y_ as de,z_ as fe}from"./dist-dqCqhBJa.js";import{t as pe}from"./button-C-Nb2Vgm.js";import{j as me}from"./index-Chpx7q4s.js";import{t as he}from"./DataTableShell-DQ-E7MMz.js";var Y=t(e(),1),X=n(),Z={altered_words:()=>F(),incorrect:()=>M(),incoherence:()=>oe(),formatting:()=>ae(),latency:()=>k(),api_error:()=>q(),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:R()}):e===!1?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:K()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:D()})}function ge({data:e,closeReason:t}){let n=e.snapshot,i=T(A.feedback.respondToFeedback),[o,s]=(0,Y.useState)(e.thread),[c,l]=(0,Y.useState)(``),[g,_]=(0,Y.useState)(!1);async function v(){let t=c.trim();if(!(!t||g)){_(!0);try{await i({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),l(``)}finally{_(!1)}}}let y=[];try{y=n.contextJson?JSON.parse(n.contextJson):[]}catch{y=[]}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?` · ${H()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:J()}),(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:E()}),(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:N()}),o.length>0?(0,X.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.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`?r():b()}),(0,X.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,X.jsx)(`p`,{className:`oc-fbadmin__meta`,children:w()}),(0,X.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:S(),value:c,maxLength:2e3,rows:3,onChange:e=>l(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 v(),disabled:!c.trim()||g,children:g?C():p()})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:G()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||m()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:u()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||m()})]}):null,n.promptText?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:x()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,y.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re({count:n.contextCount??y.length,truncated:n.contextTruncated?d():``})}),(0,X.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:y.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:ie()}),(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:a()}),(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:fe()}),(0,X.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?ee({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:[h(),` `,n.clientInfo.plugins.join(`, `),(0,X.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,f()]})]}):null,n.clientInfo?.userAgent?(0,X.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function _e(){let e=se(A.feedback.listForAdmin,{}),t=T(A.feedback.readSnapshot),n=T(A.feedback.deleteFeedback),r=me(),[a,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)({});async function p(e){if(a===e._id){u(null);return}if(!d[e._id]){let n=await t({feedbackId:e._id});f(t=>({...t,[e._id]:n}))}u(e._id)}async function m(e){await r({title:W(),description:P(),confirmLabel:j(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&u(null))}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,X.jsx)(`strong`,{children:y()}),` `,_()]}),(0,X.jsx)(he,{title:g(),rows:e,emptyHint:z(),isExpanded:e=>a===e._id&&!!d[e._id],renderExpanded:e=>d[e._id]?(0,X.jsx)(ge,{data:d[e._id],closeReason:e.userCloseReason}):null,columns:[{header:i(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:B(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:v(),cell:e=>e.messageRole===`user`?s():c(),sort:e=>e.messageRole},{header:ne(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${le({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:o(),cell:e=>(0,X.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:te(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:ue(),cell:e=>e.userClosedAt==null?e.answered?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:O()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:de()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:ce()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:a===e._id?I():L(),onSelect:()=>void p(e)},{label:V(),onSelect:()=>void m(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{$T as r,Ax as i,BE as ee,BT as te,FT as ne,GT as re,HT as ie,IT as ae,JT as a,KT as o,LT as s,QT as c,RE as l,RT as u,UT as d,VT as f,WT as oe,XT as se,YT as ce,ZT as le,_D as ue,aE as p,cE as de,dD as m,dE as fe,eE as h,fE as g,gE as pe,hE as me,iE as _,lE as he,mE as ge,nE as v,oE as _e,pE as y,qT as b,rE as x,sE as S,tE as C,uE as w,vD as T,zT as E}from"./dist-dqCqhBJa.js";import{t as D}from"./button-C-Nb2Vgm.js";import{A as O,B as k,C as A,Et as j,F as M,G as N,I as P,K as F,L as I,N as ve,P as ye,R as be,S as L,Tt as xe,W as Se,X as Ce,Y as we,b as R,ht as Te,x as z,y as B,yt as Ee,z as De}from"./index-Chpx7q4s.js";import{a as Oe,i as V,n as ke,o as H,r as U,t as Ae}from"./table-DwL2Ye60.js";var W=t(e(),1),G=n(),K=`all`;function q(e){switch(e){case`image`:return p();case`audio`:return _();case`video`:return x();case`pdf`:return v();case`document`:return C();case`archive`:return h();default:return r()}}function J(){let[e,t]=(0,W.useState)(K),[n,r]=(0,W.useState)(K),[p,h]=(0,W.useState)(K),[_,v]=(0,W.useState)(K),[x,C]=(0,W.useState)(null),J=ue(m.files.softDelete),Y=O();function je(){t(K),r(K),h(K),v(K)}async function Me(){let e=x;if(C(null),e)try{await J({fileId:e.id}),Y.success(ie())}catch(e){Y.error(f(),e)}}let X=T(m.files.listMine,{direction:e===K?void 0:e,chatId:n===K?void 0:n,instanceName:p===K?void 0:p,category:_===K?void 0:_}),Ne=(0,W.useMemo)(()=>new Intl.DateTimeFormat(ee(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:l()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=X,$=e!==K||n!==K||p!==K||_!==K;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}),(0,G.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,G.jsxs)(B,{value:e,onValueChange:t,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":me(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:ge()}),(0,G.jsx)(z,{value:`inbound`,children:y()}),(0,G.jsx)(z,{value:`outbound`,children:g()})]})]}),(0,G.jsxs)(B,{value:n,onValueChange:r,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":fe(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:w()}),Q.chats.map(e=>(0,G.jsx)(z,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,G.jsxs)(B,{value:p,onValueChange:h,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":he(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:de()}),Q.instances.map(e=>(0,G.jsx)(z,{value:e,children:e},e))]})]}):null,(0,G.jsxs)(B,{value:_,onValueChange:v,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":S(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:_e()}),Q.categories.map(e=>(0,G.jsx)(z,{value:e,children:q(e)},e))]})]}),$?(0,G.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:je,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,G.jsx)(Ee,{size:14,"aria-hidden":!0}),re()]}):null]}),Z.length===0?(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:$?ae():s()}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Ae,{children:[(0,G.jsx)(Oe,{children:(0,G.jsxs)(H,{children:[(0,G.jsx)(V,{children:c()}),(0,G.jsx)(V,{children:le()}),(0,G.jsx)(V,{children:se()}),(0,G.jsx)(V,{children:ce()}),(0,G.jsx)(V,{children:a()}),(0,G.jsx)(V,{className:`text-right`,children:b()})]})}),(0,G.jsx)(ke,{children:Z.map(e=>(0,G.jsxs)(H,{children:[(0,G.jsx)(U,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,G.jsx)(U,{title:e.mimeType,children:q(e.category)}),(0,G.jsx)(U,{children:(0,G.jsx)(Ce,{variant:`secondary`,children:e.direction===`inbound`?y():g()})}),(0,G.jsx)(U,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,G.jsx)(U,{className:`whitespace-nowrap text-muted-foreground`,children:Ne.format(e.createdAt)}),(0,G.jsx)(U,{className:`text-right`,children:(0,G.jsxs)(Se,{children:[(0,G.jsx)(we,{asChild:!0,children:(0,G.jsx)(D,{variant:`ghost`,size:`icon`,"aria-label":oe(),children:(0,G.jsx)(xe,{size:16})})}),(0,G.jsxs)(N,{align:`end`,children:[e.url?(0,G.jsx)(F,{asChild:!0,children:(0,G.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,G.jsx)(j,{size:14}),o()]})}):(0,G.jsxs)(F,{disabled:!0,children:[(0,G.jsx)(j,{size:14}),u()]}),(0,G.jsxs)(F,{variant:`destructive`,onSelect:()=>C({id:e._id,filename:e.filename}),children:[(0,G.jsx)(Te,{size:14}),d()]})]})]})})]},e._id))})]}),Pe?(0,G.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:ne({cap:Fe})}):null]}),(0,G.jsx)(ve,{open:x!==null,onOpenChange:e=>!e&&C(null),children:(0,G.jsxs)(P,{children:[(0,G.jsxs)(De,{children:[(0,G.jsx)(k,{children:te()}),(0,G.jsx)(I,{children:E()})]}),(0,G.jsxs)(be,{children:[(0,G.jsx)(M,{children:i()}),(0,G.jsx)(ye,{onClick:()=>void Me(),children:d()})]})]})})]})}export{J as FilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Aa as i,Ba as a,Bi as o,Ca as s,Da as c,Ea as l,Fa as u,Fi as d,Gi as f,Ha as p,Hi as m,Ia as h,Ii as g,Ji as _,Ki as v,La as y,Li as b,Ma as ee,Na as x,Oa as S,Pa as te,Pi as C,Qi as w,Ra as ne,Ri as T,Sa as E,Ta as D,Ua as re,Ui as O,Va as k,Vi as A,Wi as j,Xi as M,Yi as N,Zi as P,_D as F,_a as ie,aa as I,ba as ae,ca as oe,dD as L,da as se,ea as ce,fD as R,fa as le,ga as ue,ha as de,ia as fe,ja as pe,ka as me,la as he,ma as z,na as ge,oa as _e,pa as ve,qi as ye,ra as be,sa as xe,ta as Se,ua as Ce,vD as B,va as we,wa as Te,xa as Ee,ya as De,za as Oe,zi as ke}from"./dist-dqCqhBJa.js";import{t as Ae}from"./x-BK7YTQm6.js";import{i as V,n as H,r as je,t as Me}from"./tabs-B6uAHd27.js";import{t as U}from"./button-C-Nb2Vgm.js";import{$ as Ne,A as W,At as Pe,C as Fe,Q as Ie,S as Le,X as G,Z as K,_ as q,_t as J,b as Re,et as ze,gt as Y,j as Be,m as Ve,nt as He,ot as Ue,rt as We,x as Ge,y as Ke}from"./index-Chpx7q4s.js";import{t as qe}from"./FilterBar-C2YZIUUe.js";import{t as Je}from"./DataTableShell-DQ-E7MMz.js";import{t as X}from"./DetailChips-DLGo-JpY.js";var Ye=R(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Xe=R(`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`}]]),Z=R(`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`}]]),Ze=R(`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`}]]),Q=t(e(),1);function Qe(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 $e(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 et(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 tt(e){switch(e){case`admin`:return Ce();case`user`:return he();case`pending`:return oe();default:return e}}function nt(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 rt(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 $=n(),it={name:``,description:``};function at(){let e=B(L.groups.listGroups,{}),t=B(L.me.getMe,{host:Ue})?.role===`admin`,n=F(L.groups.createGroup),r=F(L.groups.updateGroup),o=F(L.groups.deleteGroup),d=Be(),f=W(),[m,_]=(0,Q.useState)(!1),[v,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(it),[O,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(``),N=(0,Q.useMemo)(()=>{if(!e)return e;let t=j.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,j]);function P(){C(null),T(it),_(!0)}function ie(e){C(e),T({name:e.name,description:e.description??``}),_(!0)}async function I(){try{v?await r({groupId:v._id,name:w.name,description:w.description}):await n({name:w.name,description:w.description||void 0}),T(it),C(null),_(!1)}catch(e){f.error(b(),e)}}async function ae(e){if(await d({title:Te({name:e.name}),description:s(),confirmWord:e.name,confirmLabel:E(),cancelLabel:i(),destructive:!0}))try{await o({groupId:e._id})}catch(e){f.error(g(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:p()}),(0,$.jsx)(qe,{q:j,onQChange:M,onReset:()=>M(``),canReset:j!==``,searchPlaceholder:u()}),(0,$.jsx)(Je,{title:re(),rows:N,addLabel:k(),onAdd:t?P:void 0,emptyHint:a(),columns:[{header:Oe(),cell:e=>e.name,sort:e=>e.name},{header:ne(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(Z,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:y(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(J,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:h(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Xe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(Y,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:te(),onSelect:()=>A({groupId:e._id,name:e.name})},...t?[{label:x(),onSelect:()=>ie(e)},{label:ee(),variant:`destructive`,onSelect:()=>void ae(e)}]:[]]}),(0,$.jsx)(Ve,{open:m,onOpenChange:_,title:v?S():me(),description:c(),canSubmit:!!w.name.trim(),onSubmit:I,submitLabel:pe(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:l()}),(0,$.jsx)(K,{value:w.name,onChange:e=>T({...w,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:D()}),(0,$.jsx)(K,{value:w.description,onChange:e=>T({...w,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:O?.groupId??null,groupName:O?.name??``,open:O!==null,onOpenChange:e=>{e||A(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(Ye,{size:14,"aria-hidden":!0}),ve()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":se({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[le(),(0,$.jsx)(Pe,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=B(L.groups.getGroup,n&&e?{groupId:e}:`skip`),a=B(L.groups.listAssignableInstances,n?{}:`skip`),s=B(L.groups.listAssignableUsers,n?{}:`skip`),c=F(L.groups.addMember),l=F(L.groups.removeMember),u=F(L.groups.bulkSetMembers),f=F(L.groups.setGroupManager),p=W(),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(`members`),[ee,x]=(0,Q.useState)(1),[S,te]=(0,Q.useState)(new Set),C=(0,Q.useRef)(null),w=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),ne=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),T=i?.viewerIsAdmin===!0,E=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{g(``),v(``),b(`members`),x(1),C.current=null},[n,e]),(0,Q.useEffect)(()=>{x(1)},[h]),(0,Q.useEffect)(()=>{n&&i&&e&&C.current!==e&&(C.current=e,te(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let D=(0,Q.useMemo)(()=>s?Qe(s,h,S):[],[s,h,S]);async function re(t,n){if(e)try{n?await l({groupId:e,userId:t}):await c({groupId:e,userId:t})}catch(e){p.error(d(),e)}}async function O(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){p.error(ke(),e)}}let k=nt(D,e=>w.has(e.userId)),j=D.filter(e=>w.has(e.userId)).length,N=rt(D,ee,ot);async function P(){if(!e||D.length===0)return;let t=D.map(e=>e.userId);try{await u({groupId:e,userIds:t,member:k!==`all`})}catch(e){p.error(d(),e)}}return(0,$.jsx)(Ie,{open:n,onOpenChange:r,children:(0,$.jsxs)(Ne,{className:`oc-access`,children:[(0,$.jsxs)(He,{children:[(0,$.jsx)(We,{children:Ee({name:t})}),(0,$.jsx)(ze,{children:ae()})]}),(0,$.jsxs)(Me,{value:y,onValueChange:b,className:`oc-access__tabs`,children:[(0,$.jsxs)(je,{className:`w-full`,children:[(0,$.jsxs)(V,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ze,{size:13,"aria-hidden":!0}),De(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:w.size}):null]}),(0,$.jsxs)(V,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(J,{size:13,"aria-hidden":!0}),ie(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,$.jsxs)(V,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Xe,{size:13,"aria-hidden":!0}),M(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(H,{value:`members`,children:s===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()}):s.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:be()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:h,onChange:e=>g(e.target.value),placeholder:we(),className:`oc-access__search`}),D.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:de()}):(0,$.jsxs)($.Fragment,{children:[D.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:k===`all`?!0:k===`some`?`indeterminate`:!1,onCheckedChange:()=>void P(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(G,{variant:`outline`,className:`oc-access__count`,children:[j,` / `,D.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:N.pageItems.map(e=>{let t=w.has(e.userId),n=et(e),r=ne.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:t,onCheckedChange:()=>void re(e.userId,t),"aria-label":xe({user:n.primary})}),(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,$.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,$.jsx)(G,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&T?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?o():A(),title:r?o():A(),onClick:()=>void O(e.userId,r),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):t&&r?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":m(),title:m(),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(st,{page:N.page,pageCount:N.pageCount,onPage:x})]})]})}),(0,$.jsx)(H,{value:`agents`,children:a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()}):a.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ge()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:_,onChange:e=>v(e.target.value),placeholder:ue(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,$.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:E,query:_},`${e}-${t._id}`))})]})}),(0,$.jsx)(H,{value:`charts`,children:(0,$.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:i,query:a}){let o=B(L.groups.listAssignableAgents,{instanceName:t}),s=F(L.groups.assignAgentToGroup),c=F(L.groups.removeAgentFromGroup),l=F(L.groups.bulkSetGroupAgents),u=W(),[d,f]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{f(1)},[a]),!e)return null;let p=$e(o?.agents??[],a),m=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&p.length===0)return null;let h=p.filter(e=>e.presentInLastOk!==!1),g=nt(h,e=>i.has(`${t}/${e.agentId}`)),_=rt(p,d,ot);async function v(n,r){try{r?await c({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){u.error(C(),e)}}async function y(){if(h.length===0)return;let n=h.map(e=>e.agentId);try{await l({groupId:e,instanceName:t,agentIds:n,assigned:g!==`all`})}catch(e){u.error(C(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(J,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n}),m?(0,$.jsx)(G,{variant:`outline`,className:`oc-access__stale`,children:r()}):null]}),o===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):p.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:m?ce():Se()}):(0,$.jsxs)($.Fragment,{children:[h.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:g===`all`?!0:g===`some`?`indeterminate`:!1,onCheckedChange:()=>void y(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,_.pageItems.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),a=e.presentInLastOk===!1;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:r,disabled:a&&!r,onCheckedChange:()=>void v(e.agentId,r),"aria-label":_e({name:e.displayName??e.agentId})}),(0,$.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":P(),title:P(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):null,a?(0,$.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:w()}):null]},e.agentId)}),(0,$.jsx)(st,{page:_.page,pageCount:_.pageCount,onPage:f})]})]})}function ut({groupId:e}){let t=B(L.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=F(L.charts.assignChartToGroup),r=F(L.charts.removeChartFromGroup),i=F(L.charts.setGroupDefaultChart),a=F(L.charts.addChartToGroupPool),o=F(L.charts.removeChartFromGroupPool),s=W();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:N()});async function d(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(T(),e)}}async function p(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(T(),e)}}async function m(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(T(),e)}}async function h(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(T(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:e.selected,onCheckedChange:()=>void d(e.chartKey,e.selected),"aria-label":f({name:e.name})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":j(),title:j(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void p(e.chartKey),children:O()}):null,u?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":v({name:e.name}),title:v({name:e.name}),onClick:()=>void h(e.chartKey),children:(0,$.jsx)(Ae,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,$.jsxs)(Ke,{value:``,onValueChange:e=>void m(e),children:[(0,$.jsx)(Le,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Fe,{placeholder:ye()})}),(0,$.jsx)(Re,{children:l.map(e=>(0,$.jsx)(Ge,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:_()}):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{$h as r,$m as i,Ag as a,Ah as o,Bh as s,Cg as c,Ch as l,Dg as u,Dh as d,Eg as f,Eh as p,Fg as m,Fh as h,Gh as g,Hh as _,Ig as v,Ih as y,Jh as b,Ju as x,Kh as S,Lg as C,Lh as w,Mg as T,Mh as E,Ng as ee,Nh as te,Og as ne,Oh as re,Pg as ie,Ph as ae,Qh as oe,Qm as se,Rh as ce,Sg as le,Sh as ue,Tg as de,Th as fe,Uh as pe,Vh as me,Wh as he,Xh as ge,Yh as _e,Zh as ve,Zm as ye,_D as D,_g as be,_h as xe,ag as Se,ah as Ce,bg as we,bh as Te,cg as Ee,ch as De,dD as O,dg as Oe,dh as ke,eg as k,eh as Ae,fg as je,fh as Me,gg as Ne,gh as Pe,hD as A,hg as Fe,hh as Ie,ig as Le,ih as Re,jg as ze,jh as Be,kg as Ve,kh as He,lg as Ue,lh as We,mg as Ge,mh as Ke,ng as qe,nh as Je,og as Ye,oh as Xe,pg as Ze,ph as Qe,qh as j,qu as $e,rg as et,rh as tt,sg as nt,sh as rt,tg as it,th as at,ug as ot,uh as st,vD as M,vS as ct,vg as lt,vh as N,wg as ut,wh as dt,xg as ft,xh as pt,yS as mt,yg as ht,yh as gt,zh as _t}from"./dist-dqCqhBJa.js";import{a as vt,c as yt}from"./FieldLabel-D8ek_B4M.js";import{t as P}from"./button-C-Nb2Vgm.js";import{$ as F,A as I,C as L,H as bt,Q as R,S as z,U as xt,V as St,X as B,Z as V,_ as H,b as U,et as W,j as Ct,m as wt,nt as G,rt as K,x as q,y as J}from"./index-Chpx7q4s.js";import{t as Tt}from"./DataTableShell-DQ-E7MMz.js";import{InstanceConfigDialog as Et}from"./BridgeTab-B7qr2P6q.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Dt=new Set(X),Ot=`conversational`;function kt(e){let t=new Set((e??[]).filter(e=>Dt.has(e)));return t.size===0?[Ot]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:vt},At={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function jt(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 Mt(){let e=M(O.admin.listInstances,{}),t=M(O.agents.listAllInstanceAgents,{}),n=D(O.admin.upsertInstance),r=D(O.admin.deleteInstance),i=I(),[o,s]=(0,Y.useState)(!1),[l,d]=(0,Y.useState)(Q),[p,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[S,w]=(0,Y.useState)(null);async function E(){try{await n({instanceId:S??void 0,name:l.name,gatewayUrl:l.gatewayUrl,bridgeUrl:l.bridgeUrl||void 0,displayName:l.displayName||void 0,kind:l.kind,gatewayVersion:l.gatewayVersion||void 0,gatewayHttpUrl:l.gatewayHttpUrl||void 0,streamTransport:l.streamTransport}),d(Q),w(null),s(!1)}catch(e){i.error(m(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ie(),(0,Z.jsx)(`strong`,{children:ee()}),T()]}),(0,Z.jsx)(Tt,{title:ze(),rows:e,addLabel:a(),onAdd:()=>{w(null),d(Q),s(!0)},emptyHint:Ve(),columns:[{header:ne(),cell:e=>e.name,sort:e=>e.name},{header:u(),cell:e=>(0,Z.jsx)(B,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:f(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:de(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:C(),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)(B,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?se():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:ft(),onSelect:()=>{w(e._id),d(jt(e)),s(!0)}},{label:v(),onSelect:()=>h(e.name)},{label:Ye(),onSelect:()=>b(e)},{label:ut(),onSelect:()=>_(e)},{label:c(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:c(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(wt,{open:o,onOpenChange:s,title:S?we():le(),description:lt(),canSubmit:!!(l.name&&l.gatewayUrl),onSubmit:E,submitLabel:be(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Ne(),children:[(0,Z.jsx)(V,{value:l.name,disabled:S!==null,onChange:e=>d({...l,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ht()}):null]}),(0,Z.jsx)($,{label:Fe(),children:(0,Z.jsxs)(J,{value:l.kind,onValueChange:e=>d({...l,kind:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(L,{})}),(0,Z.jsxs)(U,{children:[(0,Z.jsx)(q,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(q,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:Ge(),children:(0,Z.jsx)(V,{value:l.gatewayUrl,onChange:e=>d({...l,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Ze(),children:(0,Z.jsx)(V,{value:l.bridgeUrl,placeholder:je(),onChange:e=>d({...l,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Oe(),children:(0,Z.jsx)(V,{value:l.displayName,onChange:e=>d({...l,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:x(),children:[(0,Z.jsxs)(J,{value:l.streamTransport,onValueChange:e=>d({...l,streamTransport:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(L,{})}),(0,Z.jsx)(U,{children:yt.map(e=>(0,Z.jsx)(q,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:$e()})]}),(0,Z.jsx)($,{label:ot(),children:(0,Z.jsx)(V,{value:l.gatewayVersion,placeholder:Ue(),onChange:e=>d({...l,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:Ee(),children:(0,Z.jsx)(V,{value:l.gatewayHttpUrl,placeholder:nt(),onChange:e=>d({...l,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Ht,{instanceName:p,open:p!==null,onOpenChange:e=>{e||h(null)}}),g?(0,Z.jsx)(Et,{instance:g,onClose:()=>_(null)},g._id):null,y?(0,Z.jsx)(Nt,{instance:y,onClose:()=>b(null)},y._id):null]})}function Nt({instance:e,onClose:t}){let n=M(O.instanceSecrets.listInstanceSecretStatus,{}),r=At[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)(R,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(F,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(K,{children:Se({instance:e.displayName??e.name})}),(0,Z.jsx)(W,{children:Le()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(It,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ft,{instance:e})}),(0,Z.jsx)(Pt,{instance:e})]})})}function Pt({instance:e}){let t=A(O.instanceSync.forceInstanceSync),n=I(),[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(ce());break;case`no_agents`:n.success(y());break;case`no_bridge_url`:n.error(h());break;case`deploy_misconfigured`:n.error(ae());break;case`unauthorized`:n.error(E());break;case`not_served`:n.error(Be());break;default:n.error(te());break}}catch(e){n.error(w(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?_t():s()})})]})}function Ft({instance:e}){let t=M(O.bridgeAuth.listBridgeAuthStatus,{}),n=A(O.bridgeAuth.mintBridgeSecret),i=D(O.bridgeAuth.revokeBridgeSecret),a=I(),[o,s]=(0,Y.useState)(!1),[c,u]=(0,Y.useState)(null),[f,m]=(0,Y.useState)(!1),h=(t??[]).find(t=>t.instanceId===e._id),g=h!==void 0;async function _(){if(!o){s(!0);try{u((await n({instanceId:e._id})).plaintext),m(!1)}catch(e){a.error(l(),e)}finally{s(!1)}}}async function v(){if(!o){s(!0);try{await i({instanceId:e._id}),u(null),a.success(dt())}catch(e){a.error(l(),e)}finally{s(!1)}}}async function y(){if(c)try{await navigator.clipboard.writeText(c),m(!0)}catch{}}return(0,Z.jsxs)($,{label:He(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:re()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(B,{variant:g?`outline`:`secondary`,children:g?`${k()} · ${h.prefix}…${h.lastFour}`:r()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(P,{size:`sm`,onClick:()=>void _(),disabled:o,children:g?p():d()}),g?(0,Z.jsx)(P,{size:`sm`,variant:`destructive`,onClick:()=>void v(),disabled:o,children:fe()}):null]})]}),c?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:ue()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:c}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:f?mt():ct()})]}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>{u(null),m(!1)},children:pt()})]}):null]})}function It({instanceId:e,field:t,updatedAt:n}){let i=A(O.instanceSecrets.setInstanceSecret),a=D(O.instanceSecrets.clearInstanceSecret),o=A(O.deviceIdentity.generateDeviceIdentity),s=I(),[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),v=n!==null,y=t===`deviceIdentity`,x=t===`token`?et():t===`deviceIdentity`?qe():it();async function C(){if(!(!c.trim()||u)){d(!0);try{await i({instanceId:e,field:t,plaintext:c}),l(``),p(null),h(!1),s.success(b())}catch(e){s.error(j(),e)}finally{d(!1)}}}async function w(){if(!u){d(!0);try{await a({instanceId:e,field:t}),p(null),h(!1),s.success(S())}catch(e){s.error(j(),e)}finally{d(!1)}}}async function T(){if(!u){d(!0);try{p(await o({instanceId:e})),h(!1),s.success(pe())}catch(e){s.error(me(),e)}finally{d(!1)}}}let E=f?`openclaw devices approve ${f.id}`:``;async function ee(){if(E)try{await navigator.clipboard.writeText(E),h(!0)}catch{}}return(0,Z.jsxs)($,{label:x,children:[y?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:he()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(B,{variant:v?`outline`:`secondary`,children:v?k():r()}),(0,Z.jsx)(V,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:v?ve():oe(),onChange:e=>l(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(P,{size:`sm`,onClick:()=>void C(),disabled:u||c.trim().length===0,children:ge()}),y?(0,Z.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void T(),disabled:u,children:g()}):null,v?(0,Z.jsx)(P,{size:`sm`,variant:`destructive`,onClick:()=>void w(),disabled:u,children:_e()}):null]})]}),f?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:pe()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:E}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void ee(),children:m?mt():ct()})]}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>{p(null),h(!1)},children:pt()})]}):null]})}var Lt={conversational:Qe,documentary:ke},Rt={conversational:Me,documentary:st},zt=e=>(Lt[e]??(()=>e))(),Bt=e=>(Rt[e]??(()=>``))();function Vt({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:xe()}),t.map(e=>(0,Z.jsx)(B,{variant:`secondary`,className:`oc-agenttype__chip`,title:Bt(e),children:zt(e)},e)),(0,Z.jsxs)(St,{children:[(0,Z.jsx)(xt,{asChild:!0,children:(0,Z.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Pe()})}),(0,Z.jsxs)(bt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:Ie()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:Ke()}),(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)(H,{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:zt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Bt(r)})]})]},r)})})]})]})]})}function Ht({instanceName:e,open:t,onOpenChange:n}){let r=M(O.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),a=D(O.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=D(O.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=D(O.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=kt(r);e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=D(O.agents.removeInstanceAgent),l=Ct(),u=I();async function d(t,n){if(e)try{await a({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(N(),e)}}async function f(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){u.error(N(),e)}}async function p(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await s({instanceName:e,agentId:t,types:i})}catch(e){u.error(N(),e)}}async function m(t,n){if(e&&await l({title:rt({name:n}),description:Xe(),confirmLabel:Ce(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(Re())}catch(e){u.error(N(),e)}}return(0,Z.jsx)(R,{open:t,onOpenChange:n,children:(0,Z.jsxs)(F,{className:`oc-access`,children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(K,{children:Te({name:e??``})}),(0,Z.jsx)(W,{children:gt()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:tt()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Je():r.discovery.lastPollOk?at():Ae({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:i()}):(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)(H,{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)(B,{variant:`outline`,className:`oc-access__gone`,children:ye()}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void m(e.agentId,i),children:De()})]}):n?(0,Z.jsx)(B,{variant:`default`,children:se()}):(0,Z.jsx)(P,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void f(e.agentId),children:We()})]}),e.enabled?(0,Z.jsx)(Vt,{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{Mt 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,Av as i,Bv as a,Cv as o,Dv as s,Ev as c,Fv as l,Gv as u,Hv as ee,Iv as te,Jv as ne,Kv as re,Lv as ie,Mv as ae,Nv as d,Ov as oe,Pv as f,Qv as p,Rv as se,Sv as m,Tv as h,Uv as g,Vv as _,Wv as v,Xv as y,Yv as b,Zv as ce,_D as x,_t as le,_v as S,ay as C,bv as w,dD as T,dt as E,ey as D,ft as O,gt as k,gv as A,hD as j,ht as M,hv as N,iy as P,jv as F,kv as I,mt as L,mv as R,ny as z,pt as B,pv as V,qv as H,ry as U,ty as W,ut as ue,vD as de,vt as fe,vv as pe,wv as me,xv as he,yv as ge,zv as _e}from"./dist-dqCqhBJa.js";import{t as G}from"./button-C-Nb2Vgm.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-Chpx7q4s.js";import{t as we}from"./DataTableShell-DQ-E7MMz.js";var J=t(e(),1),Y=n();function Te(){let e=de(T.integrations.status.status,{}),t=x(T.admin.setIntegrationConfig),[n,E]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&E(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:C()});let O=n,j=(e,t,n)=>E({...O,[e]:{...O[e],[t]:n}}),M=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[P(),` `,(0,Y.jsx)(`strong`,{children:U()}),` `,z()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:W()}):(0,Y.jsx)(K,{variant:`outline`,children:D()}):(0,Y.jsx)(K,{variant:`outline`,children:r()}),note:ce(),children:[(0,Y.jsx)(Z,{label:b(),children:(0,Y.jsx)(q,{value:O.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>j(`langfuse`,`host`,e.target.value),onBlur:()=>M(`langfuse`,{host:O.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:u(),checked:O.langfuse.enabled??!0,onChange:e=>{j(`langfuse`,`enabled`,e),M(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:W()}):(0,Y.jsx)(K,{variant:`outline`,children:D()}):(0,Y.jsx)(K,{variant:`outline`,children:r()}),note:y(),children:[(0,Y.jsx)(Z,{label:ne(),children:(0,Y.jsx)(q,{value:O.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>j(`opik`,`baseUrl`,e.target.value),onBlur:()=>M(`opik`,{baseUrl:O.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:H(),children:(0,Y.jsx)(q,{value:O.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||re(),onChange:e=>j(`opik`,`workspace`,e.target.value),onBlur:()=>M(`opik`,{workspace:O.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:u(),checked:O.opik.enabled??!0,onChange:e=>{j(`opik`,`enabled`,e),M(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:W()}):(0,Y.jsx)(K,{variant:`outline`,children:D()}):(0,Y.jsx)(K,{variant:`outline`,children:fe()}),note:le(),children:[(0,Y.jsx)(Z,{label:k(),children:(0,Y.jsx)(q,{value:O.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>j(`otlp`,`endpoint`,e.target.value),onBlur:()=>M(`otlp`,{endpoint:O.otlp.endpoint??``})})}),(0,Y.jsx)(Ee,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:u(),checked:O.otlp.enabled??!0,onChange:e=>{j(`otlp`,`enabled`,e),M(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:v(),status:(0,Y.jsx)(K,{variant:`outline`,children:p()}),note:g(),children:[(0,Y.jsx)(Z,{label:ee(),children:(0,Y.jsx)($,{value:O.tts.auto??`off`,options:[[`off`,_()],[`always`,a()],[`inbound`,_e()],[`tagged`,se()]],onChange:e=>{j(`tts`,`auto`,e),M(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:ie(),children:(0,Y.jsx)($,{value:O.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,te()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{j(`tts`,`provider`,e),M(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:l(),children:(0,Y.jsx)(q,{value:O.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>j(`tts`,`model`,e.target.value),onBlur:()=>M(`tts`,{model:O.tts.model??``})})}),(0,Y.jsx)(Z,{label:f(),children:(0,Y.jsx)(q,{value:O.tts.voice??``,placeholder:d(),onChange:e=>j(`tts`,`voice`,e.target.value),onBlur:()=>M(`tts`,{voice:O.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:ae(),status:(0,Y.jsx)(K,{variant:`outline`,children:p()}),note:e.secrets.openai?F():i(),children:[(0,Y.jsx)(Q,{label:I(),checked:O.talk.enabled??!1,onChange:e=>{j(`talk`,`enabled`,e),M(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:oe(),children:(0,Y.jsx)($,{value:O.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{j(`talk`,`realtimeProvider`,e),M(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:s(),children:(0,Y.jsx)(q,{value:O.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>j(`talk`,`realtimeModel`,e.target.value),onBlur:()=>M(`talk`,{realtimeModel:O.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:f(),children:(0,Y.jsx)(q,{value:O.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>j(`talk`,`voice`,e.target.value),onBlur:()=>M(`talk`,{voice:O.talk.voice??``})})}),(0,Y.jsx)(Z,{label:c(),children:(0,Y.jsx)($,{value:O.talk.transport??`webrtc`,options:[[`webrtc`,h()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{j(`talk`,`transport`,e),M(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:me(),children:(0,Y.jsx)(q,{value:O.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>j(`talk`,`speechLocale`,e.target.value),onBlur:()=>M(`talk`,{speechLocale:O.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:o(),checked:O.talk.interruptOnSpeech??!0,onChange:e=>{j(`talk`,`interruptOnSpeech`,e),M(`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:m()}),(0,Y.jsx)(K,{variant:`outline`,children:he()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[w(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(we,{title:ge(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:pe(),columns:[{header:S(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:A(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:N(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:R(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:V(),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=j(T.integrations.otlpSecret.setOtlpHeaders),n=x(T.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:M(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?L():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:O()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:s,onClick:()=>void n({}),children:E()}):null]}),a?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:a}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:ue()})]})}export{Te as IntegrationsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,AE as i,BC as a,CE as o,DE as s,EE as c,FC as l,GC as u,HC as d,IC as f,JC as p,KC as m,LC as ee,MC as h,NC as g,NE as _,OE as te,PC as ne,QC as re,RC as v,RE as ie,SE as ae,TE as oe,UC as se,VC as ce,WC as le,XC as ue,YC as de,ZC as fe,_D as y,_g as b,aw as x,bE as S,cw as C,dD as w,ew as T,iw as E,jC as D,kE as O,lw as k,nw as A,ow as j,qC as M,rw as N,sw as P,tw as F,uw as I,vD as L,vE as R,wE as z,xE as B,yE as V,zC as pe}from"./dist-dqCqhBJa.js";import{t as H}from"./button-C-Nb2Vgm.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-Chpx7q4s.js";var q=t(e(),1),J=[{id:`messages`,label:()=>I()},{id:`composer`,label:()=>k()},{id:`sidebar`,label:()=>C()},{id:`other`,label:()=>P()}],Y={showSource:{category:`messages`,label:()=>j(),help:()=>x()},showReport:{category:`messages`,label:()=>E(),help:()=>N()},copyAssistant:{category:`messages`,label:()=>A()},copyUser:{category:`messages`,label:()=>F()},showDelete:{category:`messages`,label:()=>T()},showTools:{category:`messages`,label:()=>r(),help:()=>re()},voiceInput:{category:`composer`,label:()=>fe(),help:()=>ue()},showChatAge:{category:`sidebar`,label:()=>de(),help:()=>p()},showChatProvider:{category:`sidebar`,label:()=>M(),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:()=>l()};function De({prefKey:e,ui:t}){let n=y(w.admin.setUiPrefDefault),r=y(w.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:pe()}),(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:g()}),(0,$.jsx)(K,{value:`off`,children:h()}),(0,$.jsx)(K,{value:`inherit`,children:D()})]})]}),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":v()}),v()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=L(w.me.getMe,{host:G}),o=i?.ui,s=Z(i?.role)&&n,c=y(w.me.setUiPref).withOptimisticUpdate(ge),l=(0,q.useMemo)(()=>o?be(Object.keys(o.effective),e):[],[o,e]);return o?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":a()}),a()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:ee()}),(0,$.jsx)(`p`,{children:f()}),(0,$.jsx)(`p`,{children:ne()})]}):null,(0,$.jsx)(U,{value:e,onChange:e=>t(e.target.value),placeholder:u(),"aria-label":u(),className:`mb-2`}),l.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:le()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:l.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=o.locked[e],a=o.effective[e],l=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${l&&!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:se()}):l?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:d()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void c({key:e,value:null}),children:ce()}):null,(0,$.jsx)(W,{checked:a,disabled:i,onCheckedChange:t=>void c({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(De,{prefKey:e,ui:o}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:ie()})}function ke(){let e=L(w.me.getMe,{host:G}),t=y(w.me.setLocale),n=y(w.me.setMyName),r=me(),a=e?.locale??`default`,l=e?.name??``,[u,d]=(0,q.useState)(null),f=u??l,p=f.trim()!==l.trim();async function m(){try{await n({name:f}),d(null),r.success(c())}catch(e){r.error(oe(),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:i()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:O()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(U,{className:`max-w-xs`,value:f,maxLength:120,placeholder:te(),onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&p&&(e.preventDefault(),m())}}),(0,$.jsx)(H,{size:`sm`,disabled:!p,onClick:()=>void m(),children:b()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:z()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:a===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?V():e===`en`?R():_()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:B()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:S()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Au as r,Bu as i,Du as a,Eu as o,Fu as s,Hu as c,Iu as l,Lu as u,Mu as d,Nu as f,Ou as p,Pu as m,Qu as h,Ru as g,Tu as _,Uu as v,Vu as y,Wu as b,Zu as x,_D as S,dD as C,ju as w,ku as T,vD as E,zu as D}from"./dist-dqCqhBJa.js";import{d as O,f as k,i as A,l as j,n as M,r as N,t as P,u as F}from"./FieldLabel-D8ek_B4M.js";import{t as I}from"./button-C-Nb2Vgm.js";import{A as L,C as R,S as z,_ as B,b as V,x as H,y as U}from"./index-Chpx7q4s.js";/* empty css */var W=t(e(),1),G=n(),K={media_delivery:{label:D,help:g},documentary_fetch:{label:u,help:l},inbound_files:{label:s,help:m}},q={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
-
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`},J={outboundDir:a,references:o,files:_};function Y(){let e=E(C.admin.listInstances,{}),[t,n]=(0,W.useState)(null);if(e===void 0)return(0,G.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,G.jsx)(`div`,{className:`oc-injtab`,children:(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:d()})});let r=e.find(e=>e._id===t)??e[0];return(0,G.jsxs)(`div`,{className:`oc-injtab`,children:[(0,G.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,G.jsx)(M,{label:b(),help:v()}),(0,G.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,G.jsx)(`span`,{children:f()}),(0,G.jsxs)(U,{value:r._id,onValueChange:e=>n(e),children:[(0,G.jsx)(z,{size:`sm`,className:`min-w-44`,children:(0,G.jsx)(R,{})}),(0,G.jsx)(V,{children:e.map(e=>(0,G.jsx)(H,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,G.jsx)(X,{instance:r},r._id)]})}function X({instance:e}){let t=S(C.admin.upsertInstanceConfig),n=L(),r=e.config??{},[i,a]=(0,W.useState)(()=>A(r)),[o,s]=(0,W.useState)(!1),c=i.promptInjections,l=(e,t)=>a({...i,promptInjections:{...c,[e]:{...c[e],...t}}});async function u(){s(!0);try{await t({instanceId:e._id,config:N(i,r)})}catch(e){n.error(x(),e)}finally{s(!1)}}return(0,G.jsxs)(`div`,{className:`oc-injtab__body`,children:[F.map(e=>(0,G.jsx)(Z,{injKey:e,def:j[e],i18n:K[e],row:c[e]??{enabled:!0,template:j[e].defaultTemplate},onChange:t=>l(e,t)},e)),(0,G.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,G.jsx)(I,{size:`sm`,onClick:()=>void u(),disabled:o,children:h()})})]})}function Z({injKey:e,def:t,i18n:n,row:a,onChange:o}){let[s,l]=(0,W.useState)(!1),u=a.template.trim()!==t.defaultTemplate,d=t.togglable&&!a.enabled,f=Object.fromEntries(t.placeholders.map(e=>[e,q[e]??`{${e}}`])),m=O(e,a),h=m?k(m,f):``;return(0,G.jsxs)(`section`,{className:`oc-injcard`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,G.jsxs)(`label`,{className:`oc-field--row`,children:[(0,G.jsx)(B,{checked:a.enabled,onCheckedChange:e=>o({enabled:e===!0})}),(0,G.jsx)(M,{label:n.label(),help:n.help()})]}):(0,G.jsx)(M,{label:n.label(),help:n.help()}),u&&(0,G.jsx)(`span`,{className:`oc-injection__badge`,children:y()})]}),(0,G.jsx)(`textarea`,{className:`oc-injcard__text`,value:a.template,disabled:d,rows:8,spellCheck:!1,onChange:e=>o({template:e.target.value})}),(0,G.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:i()}),t.placeholders.map(e=>(0,G.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,G.jsx)(`code`,{children:`{${e}}`}),(0,G.jsx)(P,{text:(J[e]??(()=>e))()})]},e))]}),(0,G.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>l(e=>!e),children:s?r():w()}),u&&(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>o({template:t.defaultTemplate}),children:c()})]})]}),s&&(0,G.jsx)(`div`,{className:`oc-injcard__preview`,children:h?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:h}),(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:T()})]}):(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:p()})})]})}export{Y as PromptInjectionsTab};
|
|
@@ -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 s,Fm as c,Jp as l,Kp as u,Mm as d,Nm as f,Om as p,Pm as m,Qp as ee,Sm as h,Tm as g,Xp as _,Yp as v,Zp as y,_D as b,_m as x,bm as te,cm as ne,dD as S,dm as re,em as ie,fm as ae,gm as C,hm as w,jm as T,km as E,lm as D,mm as O,om as k,pm as A,qp as j,sm as M,um as N,vD as P,vm as F,wm as I,xm as L,ym as R}from"./dist-dqCqhBJa.js";import{t as z}from"./button-C-Nb2Vgm.js";import{A as B,X as V,Z as H,_ as U,j as W,m as G,xt as K}from"./index-Chpx7q4s.js";import{t as q}from"./roleDescriptions-BAcwraVL.js";var J=t(e(),1),Y=n(),X=[{group:()=>c(),keys:[{key:`traces.read`,label:()=>i()},{key:`traces.read.content`,label:()=>E(),phi:!0},{key:`traces.write`,label:()=>p()}]},{group:()=>m(),keys:[{key:`kpi.read`,label:()=>i()},{key:`kpi.write`,label:()=>p()}]},{group:()=>f(),keys:[{key:`openclaw.query`,label:()=>o()},{key:`anomalies.read`,label:()=>s()},{key:`anomalies.report`,label:()=>g()}]},{group:()=>d(),keys:[{key:`chats.read`,label:()=>i()},{key:`selfheal`,label:()=>a()}]},{group:()=>T(),keys:[{key:`admin.manage`,label:()=>I()}]}],oe=X.flatMap(e=>e.keys.map(e=>e.key));function Z(e){return e.includes(`*`)}var Q={key:``,name:``,description:``};function $(){let e=P(S.apiKeys.listRoles,{}),t=b(S.apiKeys.createRole),n=b(S.apiKeys.ensureRolesSeeded),i=b(S.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(S.apiKeys.listRoles,{});r&&e.setQuery(S.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),a=W(),o=B(),[s,c]=(0,J.useState)(!1),[d,f]=(0,J.useState)(Q),[p,m]=(0,J.useState)(new Set);(0,J.useEffect)(()=>{n({}).catch(e=>{o.error(L(),e)})},[n,o]);let g=e??[];async function T(e,t){if(Z(e.permissions)||p.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await a({title:te({name:e.name}),description:R(),confirmLabel:F()}))){m(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){o.error(x(),e)}finally{m(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function E(){try{await t({key:d.key,name:d.name,description:d.description||void 0,permissions:[]}),f(Q),c(!1)}catch(e){o.error(C(),e)}}let I=e===void 0,$=!I&&g.length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[w(),` `,(0,Y.jsx)(`code`,{children:`admin`}),` `,O(),` `,(0,Y.jsx)(`code`,{children:`traces.read.content`}),` `,A()]}),(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:ae()}),(0,Y.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,Y.jsx)(z,{size:`sm`,onClick:()=>{f(Q),c(!0)},children:re()})})]}),I?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:N()}):$?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:D()}):(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:ne()}),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?h({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:g.map(e=>{let t=Z(e.permissions),n=p.has(e._id);return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,Y.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,Y.jsxs)(V,{variant:`outline`,className:`gap-1`,children:[(0,Y.jsx)(K,{}),` `,M()]}):(0,Y.jsx)(V,{variant:`secondary`,children:k()})]}),q(e)?(0,Y.jsx)(`p`,{className:`oc-matrix__roledesc`,children:q(e)}):null]}),oe.map(i=>(0,Y.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,Y.jsx)(U,{checked:t||e.permissions.includes(i),disabled:t||n,"aria-label":`${e.key} · ${i}`,title:t?ie():n?r():i,onCheckedChange:()=>void T(e,i)})},i))]},e.key)})})]})})]}),(0,Y.jsx)(G,{open:s,onOpenChange:c,title:ee(),description:y(),canSubmit:!!(d.key&&d.name),onSubmit:E,submitLabel:_(),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:v()}),(0,Y.jsx)(H,{value:d.key,placeholder:l(),onChange:e=>f({...d,key:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:j()}),(0,Y.jsx)(H,{value:d.name,onChange:e=>f({...d,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:u()}),(0,Y.jsx)(H,{value:d.description,onChange:e=>f({...d,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{$S as r,AC as i,AS as a,BS as ee,CC as te,CS as o,DC as ne,DS as s,EC as re,ES as c,FS as ie,GS as ae,HS as oe,IS as se,JS as ce,KS as le,LS as ue,MS as l,NS as u,OC as de,OS as d,PS as fe,QS as pe,RS as me,SC as he,SS as f,TC as ge,TS as _e,US as ve,VS as ye,WS as be,XS as xe,YS as Se,ZS as Ce,_C as we,_D as p,_S as Te,aC as Ee,bC as De,bS as m,cC as Oe,dC as ke,dD as h,dS as g,eC as Ae,fC as je,fS as _,gC as Me,gS as v,hC as Ne,hD as Pe,hS as y,iC as Fe,jS as b,kC as Ie,kS as x,lC as Le,mC as Re,mS as S,nC as ze,oC as Be,pC as Ve,pS as C,qS as He,rC as Ue,sC as We,tC as Ge,uC as Ke,uS as w,vC as qe,vD as T,vS as E,wC as D,wS as O,xC as Je,xS as k,yC as Ye,yS as A,zS as Xe}from"./dist-dqCqhBJa.js";import{n as j}from"./dist-nuTFLy00.js";import{i as Ze}from"./dist-uaKglBXL.js";import{t as M}from"./button-C-Nb2Vgm.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-Chpx7q4s.js";import{t as at}from"./FilterBar-C2YZIUUe.js";import{t as ot}from"./DataTableShell-DQ-E7MMz.js";import{t as st}from"./roleDescriptions-BAcwraVL.js";var K=t(e(),1),q=n(),ct=[{value:`never`,label:()=>v(),days:null},{value:`30`,label:()=>y(),days:30},{value:`90`,label:()=>S(),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??``,a=e.status??J,[o,s]=(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=T(h.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===J?void 0:o,disabled:a===J?void 0:a===`disabled`}}),d=T(h.apiKeys.listKeys,{}),f=T(h.apiKeys.listRoles,{}),_e=p(h.apiKeys.createServiceAccount),Te=p(h.apiKeys.updateServiceAccount),m=p(h.apiKeys.deleteServiceAccount),g=Pe(h.apiKeys.mintApiKey),_=p(h.apiKeys.revokeApiKey),v=tt(),y=Qe(),b=n!==``||o!==J||a!==J;function x(){s(J),t({search:{},replace:!0})}let[S,C]=(0,K.useState)(!1),[w,E]=(0,K.useState)(Y),[O,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{O?(await Te({serviceAccountId:O,name:w.name,roleKey:w.roleKey,description:w.description}),y.success(ce())):await _e({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),E(Y),k(null),C(!1)}catch(e){y.error(O?Se():xe(),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 g({serviceAccountId:e._id,expiresAt:r});X({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(He(),e)}finally{I.current=!1,F(null)}}async function mt(e){if(await v({title:le(),description:(0,q.jsxs)(q.Fragment,{children:[ae(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,be(),` `,(0,q.jsx)(`strong`,{children:ve()}),` `,oe()]}),confirmWord:e.name,confirmLabel:ye(),destructive:!0}))try{await m({serviceAccountId:e._id}),y.success(ee(),e.name)}catch(e){y.error(Xe(),e)}}async function ht(e){if(await v({title:me(),description:(0,q.jsxs)(q.Fragment,{children:[ue(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,se()]}),confirmLabel:ie(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await _({keyId:e._id})}catch(e){y.error(fe(),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:i()}),(0,q.jsxs)(at,{q:n,onQChange:c,searchPlaceholder:Ie(),onReset:x,canReset:b,children:[(0,q.jsxs)(G,{value:o,onValueChange:s,children:[(0,q.jsx)(L,{size:`sm`,className:`w-40`,children:(0,q.jsx)(P,{placeholder:de()})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:ne()}),(f??[]).map(e=>(0,q.jsx)(W,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(G,{value:a,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:re()}),(0,q.jsx)(W,{value:`active`,children:ge()}),(0,q.jsx)(W,{value:`disabled`,children:D()})]})]})]}),(0,q.jsx)(ot,{title:te(),rows:u,addLabel:he(),onAdd:()=>{E(Y),k(null),C(!0)},emptyHint:Je(),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:De(),onSelect:()=>void $(e)},{label:A.has(e._id)?Ye():qe(),onSelect:()=>Q(e._id)},{label:Me(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Ne():Re(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)($e,{})})},{header:Ve(),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:je(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:ke(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:D()}):(0,q.jsx)(R,{variant:`outline`,children:ge()})},{header:Ke(),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:Le(),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?Oe():We({count:t})})}}]}),(0,q.jsx)(rt,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:O?Be():Ue(),description:O?Ee():ze(),canSubmit:!!(w.name&&w.roleKey),onSubmit:ft,submitLabel:O?Fe():Ge(),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:Ae()}),(0,q.jsx)(z,{value:w.name,onChange:e=>E({...w,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:r()}),(0,q.jsxs)(G,{value:w.roleKey||void 0,onValueChange:e=>E({...w,roleKey:e}),children:[(0,q.jsx)(L,{className:`w-full`,children:(0,q.jsx)(P,{placeholder:pe()})}),(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===w.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:Ce()}),(0,q.jsx)(z,{value:w.description,onChange:e=>E({...w,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:[u(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:b()}),(0,q.jsx)(`th`,{children:a()}),(0,q.jsx)(`th`,{children:x()}),(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{children:s()}),(0,q.jsx)(`th`,{children:c()}),(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)?_e():O()})})]},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:o()}),(0,q.jsx)(V,{children:f({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:k()}),(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":m(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(F,{}),n?A():E()]})]}),(0,q.jsx)(it,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:Te()})})]}):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?C():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:_()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:g()}):(0,q.jsx)(R,{variant:`outline`,children:w()})}export{X as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{A as r,B as i,C as a,D as o,E as s,F as c,G as l,H as u,I as d,L as f,M as p,N as m,O as h,P as g,R as _,S as v,T as y,U as b,V as x,W as S,_ as C,_D as w,b as T,c as E,d as D,dD as O,f as k,g as A,h as j,j as M,k as N,l as P,m as F,p as I,s as ee,u as L,v as R,vD as z,w as B,x as V,y as H,z as U}from"./dist-dqCqhBJa.js";import{t as W}from"./button-C-Nb2Vgm.js";import{j as G}from"./index-Chpx7q4s.js";import{t as K}from"./DataTableShell-DQ-E7MMz.js";var q=t(e(),1),J=n(),Y={hung:()=>h(),wrong_result:()=>o(),error:()=>s(),other:()=>y()},X=e=>(e&&Y[e]?.())??e??`—`;function Z(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function Q({data:e}){let t=e.snapshot,n=w(O.subAgentReports.respondToReport),[r,i]=(0,q.useState)(e.thread),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(!1);async function u(){let t=o.trim();if(!(!t||c)){l(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{l(!1)}}}return(0,J.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,J.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,J.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[X(e.category),` · `,B({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:a()}),(0,J.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:v()}),r.length>0?(0,J.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,J.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,J.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?V():T()}),(0,J.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,J.jsx)(`p`,{className:`oc-fbadmin__meta`,children:H()}),(0,J.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:R(),value:o,maxLength:2e3,rows:3,onChange:e=>s(e.target.value.slice(0,2e3))}),(0,J.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,J.jsx)(W,{size:`sm`,onClick:()=>void u(),disabled:!o.trim()||c,children:c?A():C()})})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[j({count:t.children.length}),t.childrenTruncated?` ${F()}`:``,t.textTruncated?` ${I()}`:``]}),(0,J.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,J.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,J.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Z(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${k()}`:``]}),e.errorMessage?(0,J.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,J.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:D()}),(0,J.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:L()}),(0,J.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 $(){let e=z(O.subAgentReports.listForAdmin,{}),t=w(O.subAgentReports.readReport),n=w(O.subAgentReports.deleteReport),a=G(),[o,s]=(0,q.useState)(null),[h,v]=(0,q.useState)({});async function y(e){if(o===e._id){s(null);return}if(!h[e._id]){let n=await t({reportId:e._id});v(t=>({...t,[e._id]:n}))}s(e._id)}async function C(e){await a({title:P(),description:E(),confirmLabel:ee(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[b(),` `,(0,J.jsx)(`strong`,{children:u()}),` `,x()]}),(0,J.jsx)(K,{title:l(),rows:e,emptyHint:S(),isExpanded:e=>o===e._id&&!!h[e._id],renderExpanded:e=>h[e._id]?(0,J.jsx)(Q,{data:h[e._id]}):null,columns:[{header:i(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:U(),cell:e=>X(e.category),sort:e=>X(e.category)},{header:_(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:f(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${g({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:d(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:c(),cell:e=>e.answered?(0,J.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:m()}):(0,J.jsx)(`span`,{className:`oc-fbadmin__pill`,children:p()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?r():M(),onSelect:()=>void y(e)},{label:N(),onSelect:()=>void C(e),variant:`destructive`}]})]})}export{$ as SubAgentReportsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AT as i,Aw as a,Bw as o,CT as s,Cw as c,DT as l,Dw as u,ET as d,Ew as f,FE as p,Fw as m,Gw as h,Hw as g,IE as _,Iw as v,Jw as ee,Kw as te,Lw as ne,MT as re,Mw as ie,NT as ae,Nw as oe,OT as se,Ow as ce,PE as le,Pw as ue,Qw as de,Rw as fe,ST as pe,Sw as me,TT as he,Tw as ge,Uw as _e,Vw as ve,Ww as ye,Xw as y,Yw as be,Zw as xe,_D as b,_T as Se,_w as Ce,a as x,aT as we,bT as Te,bw as Ee,cT as De,dD as S,dT as Oe,dw as ke,eT as Ae,fD as je,fT as Me,fw as Ne,gT as Pe,gw as Fe,hD as Ie,hT as Le,hw as C,i as Re,iT as ze,jT as Be,jw as w,kT as Ve,kw as He,lT as Ue,mT as We,mw as Ge,n as Ke,nT as qe,o as T,oT as Je,pT as Ye,pw as Xe,qw as Ze,r as Qe,rT as $e,sT as et,tT as tt,uT as nt,vD as E,vE as rt,vT as it,vw as at,wT as ot,ww as st,xT as ct,xw as lt,yE as ut,yT as dt,yw as D,zw as ft}from"./dist-dqCqhBJa.js";import{n as O}from"./dist-nuTFLy00.js";import{t as pt}from"./x-BK7YTQm6.js";import{t as k}from"./button-C-Nb2Vgm.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-Chpx7q4s.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./card-DfgoJ62e.js";import{a as Dt,i as H,n as Ot,o as U,r as W,t as kt}from"./table-DwL2Ye60.js";import{t as At}from"./TimeRangePicker-BrRrLGuZ.js";import{t as jt}from"./FilterBar-C2YZIUUe.js";import{t as Mt}from"./AdvancedFilter-CxFcwq_P.js";var G=je(`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(ue());if(e.size>Bt)throw Error(oe());let{source:n,width:r,height:i,cleanup:o}=await Gt(e);try{let o=e.type===`image/svg+xml`,s=Math.min(Vt/r,Ht/i,o?1/0:1),c=Math.max(1,Math.round(r*s)),l=Math.max(1,Math.round(i*s)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(w());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=It(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(w());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);q(e.data,f.width,f.height)?Rt(e.data,t.variantFor===`dark`?Pt:Ft):zt(e.data),m.putImageData(e,0,0)}let h=q(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Y(p,`image/webp`,Ut)??await Y(p,`image/png`);if(!g)throw Error(a());return{blob:g,hasAlpha:h}}finally{o()}}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(ie())),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`?_():e===`dark`?p():le()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Ke(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Xt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":T(),title:T(),children:(0,X.jsx)(mt,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=E(S.charts.listMyCharts),r=b(S.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:he()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:s(),subtitle:pe(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?ct():n.via===`owner`?Te():dt({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:it()}):null]})}function $t(){let e=b(S.charts.importChart),[t,n]=(0,K.useState)(``),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[u,d]=(0,K.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{a(await t.text())}catch{s(y())}}}async function p(){if(s(null),l(!1),t.trim()===``){s(ee());return}let r;try{r=JSON.parse(i)}catch{s(y());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:$e()})]}),(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:qe()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:tt(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ae()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:r(),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`}),de(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:u,onClick:()=>void p(),children:xe()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:be()}):null]})]})}function en({chart:e}){let t=Ie(S.charts.setChartLogo),n=b(S.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,s]=(0,K.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(null),i(!0);try{let{blob:i,hasAlpha:o}=await Wt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=c(e),n=c(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ve():o()}),(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?fe():ft(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:v()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:ne()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:g()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:m()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=E(S.me.getMe,{host:z}),n=b(S.charts.addChartDomain),r=b(S.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function p(){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 m(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:He()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ge()}):d.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":st({domain:e}),onClick:()=>void m(e),children:(0,X.jsx)(pt,{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:u(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void p(),children:f()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}),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=b(S.charts.updateChart),n=b(S.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,l]=(0,K.useState)(()=>nn(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1);function g(){o(e.name),l(nn(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function _(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(y());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}h(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{h(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(D()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:g,children:ye()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:_e()})]})})]}),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:lt()}),(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:x()}),(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":x()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?Re():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Qe()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ee()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,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:m,onClick:()=>void _(),children:c()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:me()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function an(){let e=E(S.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:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:h()}):(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=b(S.charts.addChartToGroupPool),r=b(S.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?nt():e.kind===`custom`&&e.scope===`personal`?C():Oe()}),e.isGlobalDefault?(0,X.jsx)(F,{variant:`default`,children:Ue()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:et()}),(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":we({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(pt,{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:Je()})}),(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:De()}):null]})]})}function sn({chart:e}){let t=b(S.charts.promoteChartToCommon),n=b(S.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(D()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(F,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?Ge():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Fe({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:Xe()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ne()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=b(S.admin.setDefaultThemeMode),a=b(S.admin.setDefaultLocale),o=b(S.charts.setDefaultChart),c=E(S.charts.listChartsAdmin),u=E(S.groups.listGroups,{}),f=e??`system`,p=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:l()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),(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:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),(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:s()}),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)),(c??[]).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:Le()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:We()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(on,{chart:e,groups:u??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Me()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).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:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ce()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()}):(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:ae()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:re()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:f===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,X.jsx)(k,{variant:p===e?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e}),children:e===`fr`?ut():rt()},e))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]})]})}function ln(){let e=E(S.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:se()}),(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)(O,{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{$d as r,$y as i,Ay as a,Cf as o,Cy as s,Df as c,Dy as l,Ef as u,Ey as d,Fy as f,Gd as p,Gy as m,Hy as h,Iy as g,Jd as _,Jy as v,Kd as y,Ky as b,My as x,Ny as ee,Of as te,Oy as S,Py as C,Qd as ne,Qy as w,Sf as re,Sy as T,Tf as ie,Ty as E,Uy as ae,Vy as oe,Wy as D,Xd as se,Xy as O,Yd as ce,Yy as k,Zd as le,Zy as A,_D as j,_f as ue,ab as M,af as de,bf as fe,cb as pe,cf as me,dD as N,db as he,df as ge,eb as _e,ef as ve,fD as P,ff as ye,gf as be,hf as xe,ib as Se,if as Ce,jy as F,kf as we,ky as Te,lb as Ee,lf as De,mf as Oe,nb as ke,nf as Ae,ob as je,of as Me,pf as Ne,qd as Pe,qy as Fe,rb as Ie,rf as Le,sb as Re,sf as ze,tb as Be,tf as Ve,ub as He,uf as Ue,vD as I,vf as We,wf as Ge,wy as Ke,xf as qe,yf as Je}from"./dist-dqCqhBJa.js";import{n as Ye}from"./dist-nuTFLy00.js";import{t as Xe}from"./x-BK7YTQm6.js";import{i as L,n as R,r as Ze,t as Qe}from"./tabs-B6uAHd27.js";import{t as z}from"./button-C-Nb2Vgm.js";import{$ as $e,C as B,Ct as et,Dt as tt,Mt as nt,Q as rt,S as V,X as H,a as it,b as U,et as at,i as ot,jt as st,k as ct,nt as lt,o as ut,ot as dt,r as ft,rt as pt,wt as mt,x as W,y as G}from"./index-Chpx7q4s.js";import{n as K}from"./TimeRangePicker-BrRrLGuZ.js";import{t as q}from"./FilterBar-C2YZIUUe.js";import{t as ht}from"./AdvancedFilter-CxFcwq_P.js";import{t as gt}from"./DataTableShell-DQ-E7MMz.js";var _t=P(`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=P(`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`?b():n===`agent`?`${m()} - ${r}`:e}function bt(){let e=I(N.me.getMe,{host:dt})?.role===`admin`,t=I(N.deliveryTiming.getDeliveryStatus,{}),n=j(N.deliveryTiming.startDeliveryRecord),r=j(N.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:he()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:He()})]}),e?(0,Y.jsx)(z,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?pe():Ee()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(H,{variant:`secondary`,children:Re()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:je({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?Ie():Se()})}),i?(0,Y.jsx)(xt,{isAdmin:e}):null]})}function xt({isAdmin:e}){let t=I(N.deliveryTiming.listDeliverySessions,{}),n=j(N.deliveryTiming.deleteDeliverySessions),[r,a]=(0,J.useState)(``),[o,c]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:p,to:m}=K(l),g=l.to===`now`?1/0:m,_=r.trim()!==``||o!==`all`||l!==X,y=()=>{a(``),c(`all`),u(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))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=p&&t.startedAt<=g).map(e=>({...e,_id:e.sessionId}))},[t,r,o,p,g]),x=e=>{let t=new Set((b??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(q,{q:r,onQChange:a,searchPlaceholder:Be(),timeRange:l,onTimeRangeChange:u,onReset:y,canReset:_,children:(0,Y.jsxs)(G,{value:o,onValueChange:e=>c(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(B,{})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{value:`all`,children:_e()}),(0,Y.jsx)(W,{value:`active`,children:i()}),(0,Y.jsx)(W,{value:`stopped`,children:w()})]})]})}),(0,Y.jsx)(gt,{title:ke(),rows:b,emptyHint:s(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(z,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?ae():D(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(_t,{size:15,"aria-hidden":!0}):(0,Y.jsx)(mt,{size:15,"aria-hidden":!0})})},{header:A(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:O(),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:k(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:v(),sort:e=>e.startedBy,cell:e=>yt(e.startedBy)},{header:Fe(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(H,{variant:`secondary`,children:i()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:w()})}],rowActions:e?e=>[{label:h(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:h(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(St,{sessionId:e.sessionId})})]})}function St({sessionId:e}){let t=I(N.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ct,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(ct(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:oe()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:M()});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,` `,T()]}),(0,Y.jsxs)(z,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ye,{size:13,"aria-hidden":!0}):(0,Y.jsx)(tt,{size:13,"aria-hidden":!0}),t?Ke():E()]})]}),(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:C()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:ee()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:x()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(F(),r.bridge),i(a(),r.A),i(Te(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:S()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:l()})]})}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=nt({from:`/settings/traces`}),t=st({from:`/settings/traces`}),n=e.limit,i=e.kind,a=e.statusClass??Q,s=e.principalType??Q,l=e.direction??Q,d=e.roleKey??Q,p=e.q??``,m=ft(e.from,e.to),h=(0,J.useMemo)(()=>ut(e.adv),[e.adv]),{from:v,to:y}=K(m),[b,x]=(0,J.useState)(null),[ee,S]=(0,J.useState)(null),C=e=>void t({search:t=>({...t,limit:e})}),w=e=>void t({search:t=>({...t,kind:e})}),T=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),E=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),ae=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),oe=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,...it(e)})}),k=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),A=I(N.observability.listEvents,{limit:n}),j=I(N.observability.listEvents,{limit:n,kind:i===Tt?void 0:i,filter:{q:p||void 0,from:v,to:y,statusClass:a===Q?void 0:a,principalType:s===Q?void 0:s,direction:l===Q?void 0:l,roleKey:d===Q?void 0:d,advanced:h.length>0?h:void 0}}),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])e.add(t.kind);return[...e].sort()},[A]),pe=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[A]),he=p!==``||a!==Q||s!==Q||l!==Q||d!==Q||h.length>0||m.kind!==`relative`||m.from!==kt.from;function _e(){t({search:{limit:100,kind:`all`},replace:!0})}let P=b?A?.filter(e=>e.correlationId===b):j,[Se,F]=(0,J.useState)(`events`);return(0,Y.jsxs)(Qe,{value:Se,onValueChange:e=>F(e),children:[(0,Y.jsxs)(Ze,{className:`w-full`,children:[(0,Y.jsxs)(L,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(et,{size:13,"aria-hidden":!0}),g()]}),(0,Y.jsxs)(L,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(vt,{size:13,"aria-hidden":!0}),f()]})]}),(0,Y.jsx)(R,{value:`latency`,children:(0,Y.jsx)(bt,{})}),(0,Y.jsxs)(R,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[we(),(0,Y.jsx)(`strong`,{children:te()}),c(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:u()})]}),(0,Y.jsxs)(q,{q:p,onQChange:T,searchPlaceholder:ie(),timeRange:m,onTimeRangeChange:O,onReset:_e,canReset:he,children:[(0,Y.jsxs)(G,{value:a,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(B,{placeholder:Ge()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{value:Q,children:o()}),Et.map(e=>(0,Y.jsx)(W,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:s,onValueChange:ae,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(B,{placeholder:re()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{value:Q,children:qe()}),Dt.map(e=>(0,Y.jsx)(W,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:l,onValueChange:oe,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(B,{placeholder:fe()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{value:Q,children:Je()}),Ot.map(e=>(0,Y.jsx)(W,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:d,onValueChange:D,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(B,{placeholder:We()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{value:Q,children:ue()}),pe.map(e=>(0,Y.jsx)(W,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:i,onValueChange:w,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(B,{placeholder:be()})}),(0,Y.jsxs)(U,{children:[(0,Y.jsx)(W,{value:Tt,children:xe()}),M.map(e=>(0,Y.jsx)(W,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:String(n),onValueChange:e=>C(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(B,{})}),(0,Y.jsx)(U,{children:wt.map(e=>(0,Y.jsx)(W,{value:String(e),children:Oe({count:e})},e))})]})]}),(0,Y.jsx)(ht,{fields:At,seed:h,onChange:k}),b?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:Ne(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[ye(),(0,Y.jsx)(`code`,{children:$(b)})]}),(0,Y.jsx)(Xe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:ge()})]})}):null,(0,Y.jsx)(gt,{title:Ue(),rows:P,emptyHint:b?De():me(),columns:[{header:ze(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:Me(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(H,{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":Ce(),children:`✓`})}},{header:Le(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(H,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ae(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(H,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Ve(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(H,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ve(),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:r(),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:ne(),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:le(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:se(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ce(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>S(e),children:_()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(Pt,{row:ee,onClose:()=>S(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)(rt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)($e,{className:`max-w-lg`,children:[(0,Y.jsxs)(lt,{children:[(0,Y.jsxs)(pt,{className:`oc-traces__meta-title`,children:[Pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(H,{variant:`outline`,children:y()})]}),(0,Y.jsx)(at,{children:p()})]}),(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{$g as r,Bg as i,Gg as a,Hg as o,Ig as s,Jg as c,Kg as l,Lg as u,Qg as d,Rg as ee,Ug as te,Vg as ne,Wg as re,Xg as ie,Yg as ae,Zg as oe,_D as f,_d as p,_g as se,a_ as ce,c_ as m,cd as h,dD as g,dd as _,e_ as le,fd as v,gd as y,hd as b,i_ as ue,l_ as x,ld as S,md as C,n_ as de,o_ as fe,od as w,pd as T,qg as pe,r_ as E,s_ as me,sd as D,t_ as he,u_ as O,ud as k,vD as A,vd as j,zg as ge}from"./dist-dqCqhBJa.js";import{t as M}from"./button-C-Nb2Vgm.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-Chpx7q4s.js";import{t as De}from"./FilterBar-C2YZIUUe.js";import{t as Oe}from"./DataTableShell-DQ-E7MMz.js";import{t as ke}from"./DetailChips-DLGo-JpY.js";var Z=t(e(),1),Q=n();function Ae({profileId:e,userLabel:t,open:n,onOpenChange:r}){let i=A(g.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),a=A(g.agents.listUserAgents,n&&e?{profileId:e}:`skip`),o=new Set((a??[]).map(e=>`${e.instanceName}/${e.agentId}`)),s=(a??[]).find(e=>e.isDefault)??null,c=s?`${s.instanceName}/${s.agentId}`:null,l=new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=[...(i?.agents??[]).map(e=>({...e,outOfPool:!1})),...(a??[]).filter(e=>!l.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,state:e.state,outOfPool:!0}))],d=new Map;for(let e of u){let t=d.get(e.instanceName)??[];t.push(e),d.set(e.instanceName,t)}return(0,Q.jsx)(z,{open:n,onOpenChange:r,children:(0,Q.jsxs)(N,{className:`oc-access`,children:[(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(Ee,{children:j({user:t})}),(0,Q.jsx)(ye,{children:p()})]}),i?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:i.inGroup?y():b()}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:C()}):u.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:_()}):[...d.entries()].map(([t,n])=>(0,Q.jsx)(je,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:o,defaultKey:c},t))})]})})}function je({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=f(g.agents.assignAgent),s=f(g.agents.removeAgent),c=f(g.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(T(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(v(),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":k({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:S()}):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":w(),title:w(),onClick:()=>void d(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?O():x({count:r})})}),(0,Q.jsxs)(I,{align:`start`,className:`w-52`,children:[(0,Q.jsx)(Te,{children:m()}),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??``,p=e.role??$,m=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),h=e=>void t({search:t=>({...t,role:e===$?void 0:e})}),_=A(g.admin.listUsers,{filter:{q:n||void 0,role:p===$?void 0:p},withAgents:!0}),v=A(g.me.getMe,{host:we}),y=f(g.admin.setRole),b=f(g.admin.setUserPermissions),x=f(g.admin.startImpersonation),S=f(g.admin.deleteUser),C=f(g.admin.setUserName),w=xe(),T=R(),D=P(),[O,k]=(0,Z.useState)(null),j=(0,Z.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of _??[])e.add(t.role);return[...e]},[_]),M=n!==``||p!==$;function N(){t({search:{},replace:!0})}async function I(e){try{await y(e)}catch(e){D.error(me(),e)}}async function L(e){try{await b(e)}catch(e){D.error(fe(),e)}}async function z(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await w({title:r(),description:d({user:t}),confirmWord:oe(),confirmLabel:ie(),destructive:!0}))try{await S({profileId:e._id}),D.success(c({user:t}))}catch(e){D.error(ae(),e)}}async function V(e){let t=e.email||e.name||e.userId.slice(0,8),n=await T({title:l(),label:a({user:t}),placeholder:re(),defaultValue:e.name??``,confirmLabel:se()});if(n!==null)try{await C({profileId:e._id,name:n}),D.success(te())}catch(e){D.error(o(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(De,{q:n,onQChange:m,searchPlaceholder:ce(),onReset:N,canReset:M,children:(0,Q.jsxs)(X,{value:p,onValueChange:h,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:E(),rows:_,emptyHint:de(),rowActions:e=>{let t=[{label:s(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:pe(),onSelect:()=>void V(e)}];return e.userId!==v?.userId&&t.push({label:he(),onSelect:()=>void x({profileId:e._id})},{label:le(),variant:`destructive`,onSelect:()=>void z(e)}),t},columns:[{header:ne(),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:i(),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:ge(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:ee()}):(0,Q.jsx)(Me,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),L({profileId:e._id,permissions:[...n]})}})},{header:u(),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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n,oD as r,t as i}from"./dist-dqCqhBJa.js";e();var a=t(),o=i(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:e,variant:t=`default`,size:i=`default`,asChild:s=!1,...c}){return(0,a.jsx)(s?r:`button`,{"data-slot":`button`,"data-variant":t,"data-size":i,className:n(o({variant:t,size:i,className:e})),...c})}export{o as n,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fD as e}from"./dist-dqCqhBJa.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$o as e,Jo as t,Ko as n,Qo as r,Xo as i,Yo as a,Zo as o,_s as s,as as c,bs as l,cs as u,ds as d,es as f,fs as p,gs as m,hs as h,is as g,ls as _,ms as v,ns as y,os as b,ps as x,qo as S,rs as C,ss as w,ts as T,us as E,vs as D,ys as O}from"./dist-dqCqhBJa.js";var k={AGENT_NOT_FOUND:()=>({label:l(),hint:O()}),AUTH_TOKEN_MISMATCH:()=>({label:D(),hint:s()}),DEVICE_SIGNING_FAILED:()=>({label:m(),hint:h()}),SESSION_SCOPE_DENIED:()=>({label:v(),hint:x()}),GATEWAY_TIMEOUT:()=>({label:p(),hint:d()}),GATEWAY_DISCONNECTED:()=>({label:E(),hint:_()}),ATTACHMENT_TOO_LARGE:()=>({label:b(),hint:c()}),ATTACHMENT_REJECTED:()=>({label:g(),hint:C()}),BRIDGE_UNREACHABLE:()=>({label:u(),hint:w()}),INVALID_REQUEST:()=>({label:y(),hint:T()}),NOT_CONFIGURED:()=>({label:f(),hint:e()}),UNROUTED:()=>({label:r(),hint:o()}),UPSTREAM_ERROR:()=>({label:i(),hint:a()}),UNKNOWN:()=>({label:t(),hint:S()})};function A(e){return e?k[e]?.()??{label:e,hint:n()}:k.UNKNOWN()}export{A as t};
|