@lacneu/atrium 0.50.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessTab-CTW_nnWZ.js +1 -0
- package/dist/assets/{AdvancedFilter-Bw_6N4Fp.js → AdvancedFilter-CKwZSjrh.js} +1 -1
- package/dist/assets/AgentFilesTab-q9XSjz3-.js +3 -0
- package/dist/assets/AnomaliesTab-DRfDR0J5.js +1 -0
- package/dist/assets/AuditTab-Dy6MHYXk.js +1 -0
- package/dist/assets/BridgeTab-BYuXlyxy.js +1 -0
- package/dist/assets/ChatDefaultsTab-Dcfzk7xu.js +1 -0
- package/dist/assets/{DataTableShell-HZGBUlvm.js → DataTableShell-DtJr2ebT.js} +1 -1
- package/dist/assets/{DetailChips-gFOfqX_a.js → DetailChips-CXG_QPSx.js} +1 -1
- package/dist/assets/FeedbacksTab-WlCA0v5O.js +1 -0
- package/dist/assets/{FieldLabel-pNGSpfk-.js → FieldLabel-DOYQdxs6.js} +1 -1
- package/dist/assets/FilesTab-DQ9pHjeQ.js +1 -0
- package/dist/assets/{FilterBar-DlPympG5.js → FilterBar-Csl1r1c5.js} +1 -1
- package/dist/assets/GroupsTab-i_p1qxDl.js +1 -0
- package/dist/assets/InstancesTab-C2vgcYdE.js +1 -0
- package/dist/assets/IntegrationsTab-U_Dml2lf.js +1 -0
- package/dist/assets/KpiTab-D8BAnPiK.js +1 -0
- package/dist/assets/PreferencesTab-BktDAi8P.js +1 -0
- package/dist/assets/PromptInjectionsTab-Bk59PWzu.js +4 -0
- package/dist/assets/RolesTab-DVdsW49x.js +1 -0
- package/dist/assets/ServiceAccountsTab-ZsiwQmeJ.js +1 -0
- package/dist/assets/SubAgentReportsTab-Ce0Y_sVn.js +1 -0
- package/dist/assets/ThemeShowroom-BRl6NHy2.js +1 -0
- package/dist/assets/{TimeRangePicker-Cm5l2vkz.js → TimeRangePicker-BeZLlC4Y.js} +1 -1
- package/dist/assets/TracesTab-CBN2vo1w.js +1 -0
- package/dist/assets/UsersTab-C_K650wH.js +1 -0
- package/dist/assets/VoiceTab-b4ZPVB2F.js +1 -0
- package/dist/assets/{button-B4Nos6AU.js → button-b04wLuGq.js} +1 -1
- package/dist/assets/{card-DhM6Y5He.js → card-DdBF2ct9.js} +1 -1
- package/dist/assets/chevrons-up-down-Kyw8BbOf.js +1 -0
- package/dist/assets/compatView-CONPJXEW.js +1 -0
- package/dist/assets/dispatchErrorInfo-Cs8_1qCQ.js +1 -0
- package/dist/assets/{dist-BzsC63K9.js → dist-6oi7FQ0i.js} +1 -1
- package/dist/assets/{dist-qfxevi2g.js → dist-CtUr3P8h.js} +1 -1
- package/dist/assets/{dist-BwHHVs_B.js → dist-DBet7oNc.js} +1 -1
- package/dist/assets/{dist-BTpttlbH.js → dist-HBBi9Y25.js} +5 -5
- package/dist/assets/{highlighted-body-OFNGDK62-DUhXym2u.js → highlighted-body-OFNGDK62-CJz5HJX2.js} +1 -1
- package/dist/assets/index-4Peu865E.js +238 -0
- package/dist/assets/{index-CnCsAZYf.css → index-CBZrw7d-.css} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-B47aXknL.js +1 -0
- package/dist/assets/{pdf-BjDyP8tM.js → pdf-C1wt9cpf.js} +1 -1
- package/dist/assets/roleDescriptions-onSlZ7A3.js +1 -0
- package/dist/assets/{table-BBE4oFvW.js → table-CtNwimV_.js} +1 -1
- package/dist/assets/{tabs-DlXyYN7h.js → tabs-0f19le6d.js} +1 -1
- package/dist/assets/x-DBKGK4o_.js +1 -0
- package/dist/index.html +8 -8
- package/package.json +1 -1
- package/dist/assets/AccessTab-YfxJ8TyH.js +0 -1
- package/dist/assets/AgentFilesTab-BGjK8vy-.js +0 -3
- package/dist/assets/AnomaliesTab-ClY_uTZu.js +0 -1
- package/dist/assets/AuditTab-DNV2Z66C.js +0 -1
- package/dist/assets/BridgeTab-BDp1JcI8.js +0 -1
- package/dist/assets/ChatDefaultsTab-Cuma5jME.js +0 -1
- package/dist/assets/FeedbacksTab-BaSoBVK5.js +0 -1
- package/dist/assets/FilesTab-BxjNQ6IX.js +0 -1
- package/dist/assets/GroupsTab-CUch1a_C.js +0 -1
- package/dist/assets/InstancesTab-DRWZsjZC.js +0 -1
- package/dist/assets/IntegrationsTab-C7KPWF6x.js +0 -1
- package/dist/assets/KpiTab-6QaTYyCv.js +0 -1
- package/dist/assets/PreferencesTab-CLEVHQTj.js +0 -1
- package/dist/assets/PromptInjectionsTab-CnlX7r8C.js +0 -4
- package/dist/assets/RolesTab-orl-1HS-.js +0 -1
- package/dist/assets/ServiceAccountsTab-CtwpNIDj.js +0 -1
- package/dist/assets/SubAgentReportsTab-MRixaruJ.js +0 -1
- package/dist/assets/ThemeShowroom-BCYOO2fm.js +0 -1
- package/dist/assets/TracesTab-BATP4Ee5.js +0 -1
- package/dist/assets/UsersTab-CN9dGPvE.js +0 -1
- package/dist/assets/VoiceTab-DJyEAu0o.js +0 -1
- package/dist/assets/chevrons-up-down-Du6glRFD.js +0 -1
- package/dist/assets/compatView-DwEzKEAD.js +0 -1
- package/dist/assets/dispatchErrorInfo-C27wKMfE.js +0 -1
- package/dist/assets/index-GIhUlE6M.js +0 -233
- package/dist/assets/mermaid-GHXKKRXX-D_CGWBHm.js +0 -1
- package/dist/assets/roleDescriptions-8ML7Rdme.js +0 -1
- package/dist/assets/x-BLHWZzIt.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gy as e,Jy as t,Ky as n,Yy as r,qy as i}from"./dist-HBBi9Y25.js";var a={pending:r,user:t,admin:i,observer:n,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-HBBi9Y25.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{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-HBBi9Y25.js";import{t as d}from"./dist-DBet7oNc.js";import{Dt as f,Et as p,Ot as m}from"./index-4Peu865E.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(f,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(p,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.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&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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:o(`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-HBBi9Y25.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
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
document.documentElement.dataset.motion = "static";
|
|
54
54
|
})();
|
|
55
55
|
</script>
|
|
56
|
-
<script type="module" crossorigin src="/assets/index-
|
|
56
|
+
<script type="module" crossorigin src="/assets/index-4Peu865E.js"></script>
|
|
57
57
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
|
|
58
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
59
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
60
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
61
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
62
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
63
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
64
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
58
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-HBBi9Y25.js">
|
|
59
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-DBet7oNc.js">
|
|
60
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-CtUr3P8h.js">
|
|
61
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-6oi7FQ0i.js">
|
|
62
|
+
<link rel="modulepreload" crossorigin href="/assets/x-DBKGK4o_.js">
|
|
63
|
+
<link rel="modulepreload" crossorigin href="/assets/button-b04wLuGq.js">
|
|
64
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CBZrw7d-.css">
|
|
65
65
|
</head>
|
|
66
66
|
<body>
|
|
67
67
|
<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.52.0",
|
|
4
4
|
"description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,E as i,Ju as a,Ku as o,Qu as s,Xu as c,Yu as l,Zu as u,_M as d,ad as f,cM as p,ed as m,id as h,nd as g,od as _,qu as v,rd as y,td as b}from"./dist-BTpttlbH.js";import{C as x,S,b as C,ct as w,w as T,x as E}from"./index-GIhUlE6M.js";var D=t(e(),1);function O(e){return e===`user`?c():e===`all`?l():a({group:e.group})}function k(e){return e===`common`?v():e===`owner`?o():a({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=d(i.admin.listUsers,{}),[t,n]=(0,D.useState)(``),a=d(i.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),(0,A.jsxs)(C,{value:t,onValueChange:n,children:[(0,A.jsx)(x,{size:`sm`,"aria-label":f(),children:(0,A.jsx)(T,{placeholder:f()})}),(0,A.jsx)(E,{children:(e??[]).map(e=>(0,A.jsx)(S,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):a===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(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:a.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:a.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:g()}),a.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:a.groups.map(e=>(0,A.jsx)(w,{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:b()}),a.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:a.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)(w,{variant:`default`,children:u()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{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:m()}),a.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:a.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)(w,{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:r()}),a.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:a.permissions.map(e=>(0,A.jsx)(w,{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{Ac as r,Ar as i,Bc as a,Br as o,Cc as s,Cr as c,Dc as l,Dr as u,E as d,Ec as f,Er as p,Fc as m,Fr as h,Hr as g,Ic as _,Ir as v,Lc as y,Lr as b,Mc as x,Mr as S,Nc as C,Nr as w,Oc as T,Or as E,Pc as D,Pr as O,Rc as ee,Rr as te,Sc as k,Sl as ne,Sr as A,Tc as j,Tr as M,Vc as N,Vr as P,WE as re,_M as F,_c as ie,bc as ae,cM as I,dr as L,fc as R,fr as z,gM as B,gc as oe,hc as se,hr as V,jc as ce,jr as H,kc as le,kr as ue,lr as de,mM as U,mc as fe,mr as pe,pc as me,pr as he,uM as W,ur as ge,vc as _e,wc as ve,wl as G,wr as ye,xc as be,yc as xe,zc as Se,zr as Ce}from"./dist-BTpttlbH.js";import{t as K}from"./button-B4Nos6AU.js";import{At as q,C as we,G as Te,H as Ee,J as De,K as Oe,S as ke,U as Ae,W as je,Y as Me,b as Ne,ct as Pe,dt as Fe,ft as Ie,ht as Le,mt as Re,q as ze,ut as Be,w as Ve,x as He,xt as Ue,y as We,z as J}from"./index-GIhUlE6M.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-DwEzKEAD.js";/* empty css */var Y=t(e(),1),X=2e4,Je=6e4;function Ye(e){return typeof e!=`number`||e<=0?0:Math.round(e/X*100)}function Xe(e){return e<=0?0:Math.round(e/Je*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function Ze(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var Qe=3;function $e(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<Qe&&a.push(e)):t>0&&(i+=t,o.length<Qe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function et(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function tt(){let e=F(d.me.getMe,{host:Ue}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=F(d.admin.listInstances,e!==void 0&&t?{}:`skip`),[o,s]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!i||i.length===0||(!o||!i.some(e=>e.name===o))&&s(i[0].name)},[t,i,o]);let c=F(d.agents.listAgentsForInstance,t&&o?{instanceName:o}:`skip`),l=F(d.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),u=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return o===null||c===void 0?i!==void 0&&i.length===0?[]:void 0:c.agents.map(e=>({instanceName:o,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(l!==void 0)return l.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,o,c,i,l]),[f,p]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!u||u.length===0||(!f||!u.some(e=>$(e)===f))&&p($(u[0]))},[u,f]);let h=u?.find(e=>$(e)===f)??null,g=U(d.agentFiles.listAgentFiles),[v,S]=(0,Y.useState)({status:`idle`}),w=h?.instanceName??null,T=h?.agentId??null,E=F(d.compat.forInstance,n&&w!==null?{instanceName:w}:`skip`),O=n&&w!==null?We(E,`agentFiles`):null,k=O===null?!1:O===`loading`?null:O.blocked,A=(0,Y.useCallback)(async()=>{if(!(w===null||T===null)){S({status:`loading`});try{S({status:`done`,files:(await g({instanceName:w,agentId:T})).files})}catch{S({status:`error`})}}},[g,w,T]);(0,Y.useEffect)(()=>{k===!1&&A()},[A,k]);let[j,M]=(0,Y.useState)(null),P=F(d.agentFileCuration.listCurations,t&&w!==null&&T!==null?{instanceName:w,agentId:T}:`skip`),re=F(d.agentFileCuration.curationSettings,t&&w!==null?{instanceName:w}:`skip`),ie=U(d.agentFileCuration.requestCuration),[ae,L]=(0,Y.useState)(null),[R,z]=(0,Y.useState)(null),{toast:B}=J(),oe=(0,Y.useMemo)(()=>{let e=new Map;for(let t of P??[])e.has(t.name)||e.set(t.name,t);return e},[P]),se=(0,Y.useCallback)(async e=>{if(!(w===null||T===null)){L(e);try{let t=await ie({instanceName:w,agentId:T,name:e,trigger:`manual`});t.ok?B({title:Ce(),variant:`success`}):B({title:te({reason:t.reason??`unknown`}),variant:`error`})}catch{B({title:b(),variant:`error`})}finally{L(null)}}},[ie,w,T,B]),V=W(),H=(0,Y.useMemo)(()=>new Intl.NumberFormat(V,{maximumFractionDigits:0}),[V]);return e===void 0||u===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:I()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:N()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(Ne,{value:o??``,onValueChange:e=>s(e),children:[(0,Q.jsx)(we,{size:`sm`,"aria-label":a(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:(i??[]).map(e=>(0,Q.jsx)(ke,{value:e.name,children:e.name},e.name))})]}):null,u.length>0?(0,Q.jsxs)(Ne,{value:f??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(we,{size:`sm`,"aria-label":Se(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:u.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ee()})]}),h===null?null:O===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:I()}):O!==null&&O.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(q,{size:14,"aria-hidden":!0}),` `,qe(O.gatewayVersion,O.provider)]}):v.status===`loading`||v.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:I()}):v.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[_(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void A(),children:ne()})]}):v.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:v.files.map(e=>{let n=Ye(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)(Pe,{variant:`outline`,children:m()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:D({size:Z(e.size,V)})}),(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:C({pct:H.format(n)})}),i?(0,Q.jsx)(q,{size:14,className:`oc-afiles__warn`,"aria-label":x()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>M(e),children:t?r():le()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:re?.budgetChars??null,enabled:re?.enabled??!1,curation:oe.get(e.name)??null,inFlight:ae===e.name,onCurate:()=>void se(e.name),onReview:e=>z(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:ce({used:Z(Ze(v.files),V),total:Z(Je,V),pct:H.format(Xe(Ze(v.files)))})})]}),j&&h?(0,Q.jsx)(rt,{instanceName:h.instanceName,agentId:h.agentId,name:j.name,isAdmin:t,onClose:()=>M(null),onSaved:()=>void A()}):null,R?(0,Q.jsx)(it,{curationId:R,onClose:()=>z(null),onApplied:()=>{z(null),A()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:s,onReview:c}){return i?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>c(i._id),children:P()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Pe,{variant:`outline`,className:`oc-afiles__curate-status`,children:o()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:s,children:g()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let o=U(d.agentFiles.getAgentFile),c=U(d.agentFiles.setAgentFile),u=J(),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(``),[y,b]=(0,Y.useState)(!1),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[E,D]=(0,Y.useState)(!1),O=(0,Y.useCallback)(async r=>{g(!1);try{let i=await o({instanceName:e,agentId:t,name:n});m({content:i.content,updatedAtMs:i.updatedAtMs}),r||v(i.content),w(!1)}catch{g(!0)}},[o,e,t,n]);(0,Y.useEffect)(()=>{O(!1)},[O]);async function ee(){if(p!==null){S(!0),D(!1);try{await c({instanceName:e,agentId:t,name:n,content:_,baseUpdatedAtMs:p.updatedAtMs??void 0}),u.success(k({name:n})),a(),await O(!1)}catch(e){et(e)?w(!0):D(!0)}finally{S(!1)}}}let te=p!==null&&_!==p.content,A=(0,Y.useMemo)(()=>p===null?null:$e(p.content,_),[p,_]),M=_.length>X,N=W(),P=(0,Y.useMemo)(()=>new Intl.NumberFormat(N),[N]);return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Le,{children:T({name:n})}),(0,Q.jsxs)(Ie,{children:[l({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,f()]})]})]}),h?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ae(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void O(!1),children:ne()})]}):p===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:I()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:_,readOnly:!r,spellCheck:!1,onChange:e=>v(e.target.value),"aria-label":T({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:j()}),C?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[xe(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void O(!0),children:_e()})]}):null,E?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:be()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${M?` is-over`:``}`,children:ve({count:P.format(_.length),max:P.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!te||x||C,onClick:()=>b(!0),children:x?G():s()}):null]})]}),(0,Q.jsx)(Ee,{open:y,onOpenChange:b,children:(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Me,{children:ie({name:n})}),(0,Q.jsx)(Oe,{children:oe({agent:t})})]}),A?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:se({added:A.added,removed:A.removed})}),A.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:fe()}),A.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,A.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:me()}),A.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(je,{children:re()}),(0,Q.jsx)(Ae,{onClick:()=>void ee(),children:R()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=F(d.agentFileCuration.getProposal,{curationId:e}),a=U(d.agentFileCuration.approveCuration),o=B(d.agentFileCuration.rejectCuration),{toast:s}=J(),[l,f]=(0,Y.useState)(null),[m,g]=(0,Y.useState)(!1),[_,y]=(0,Y.useState)(``),x=W(),C=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function T(){f(`approve`);try{let t=await a({curationId:e});t.ok?(s({title:v(),variant:`success`}),n()):s({title:t.reason===`conflict`?O():w({reason:t.reason??`unknown`}),variant:`error`})}catch{s({title:b(),variant:`error`})}finally{f(null)}}async function D(n){f(`reject`);try{let r=_.trim();(await o({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?s({title:n?ge():h(),variant:`success`}):s({title:i(),variant:`error`}),t()}catch{s({title:b(),variant:`error`})}finally{f(null)}}return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Fe,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Le,{children:r?S({name:r.name}):I()}),(0,Q.jsx)(Ie,{children:H()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:I()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[ue({before:Z(r.beforeSize,x),after:Z(r.proposedSize,x)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(q,{size:13,"aria-hidden":!0}),` `,E()]}):null]}),C?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:u({added:C.added,removed:C.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:de({feedback:r.feedback})}):null,C&&C.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:A()}),(0,Q.jsx)(`ul`,{children:C.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:c()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:p()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.proposedContent})]})]})]}),m?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:V()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:pe(),value:_,onChange:e=>y(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>g(!1),disabled:l!==null,children:he()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void D(!1),disabled:l!==null,children:l===`reject`?G():z()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void D(!0),disabled:l!==null,children:l===`reject`?G():L()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>g(!0),disabled:l!==null||r==null,children:M()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void T(),disabled:l!==null||r==null,children:l===`approve`?G():ye()})]})]})})}export{tt as AgentFilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Bv as i,Cy as a,E as o,Fv as s,Gv as ee,Hv as te,Iv as c,Jv as l,Kv as ne,Lv as u,Mv as d,Nv as f,Pv as p,Qv as re,Rv as m,Sy as h,Uv as ie,Vv as ae,Wv as oe,Xv as g,Yv as _,Zv as v,_M as y,_y as b,ay as se,by as ce,cy as le,dy as ue,ey as de,fy as fe,gM as pe,gy as me,hy as he,iy as ge,ly as _e,my as ve,ny as ye,oy as x,py as S,qv as C,ry as w,sy as T,ty as E,uy as D,vy as O,wy as k,xy as A,yy as j,zv as M}from"./dist-BTpttlbH.js";import{B as N,C as P,S as F,Xt as be,Yt as I,a as xe,b as L,ct as R,dt as z,et as Se,ht as B,mt as V,r as Ce,ut as H,w as U,x as W,xt as we,z as Te}from"./index-GIhUlE6M.js";import{n as Ee}from"./TimeRangePicker-Cm5l2vkz.js";import{t as De}from"./FilterBar-DlPympG5.js";import{t as Oe}from"./DataTableShell-HZGBUlvm.js";import{t as G}from"./dispatchErrorInfo-C27wKMfE.js";var K=t(e(),1),q=n(),J=`__all__`,ke=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Ae(e){return e===`open`?k():e===`acknowledged`?a():h()}var je=[`info`,`warn`,`critical`],Me=[`detector`,`agent`,`user`],Ne={kind:`relative`,from:`now-30d`,to:`now`},Pe=200,Y=`all`;function X(){let e=be({from:`/settings/anomalies`}),t=I({from:`/settings/anomalies`}),n=e.q??``,a=e.status===Y?J:e.status,s=e.severity??J,c=e.kind??J,[u,d]=(0,K.useState)(J),f=Ce(e.from,e.to),{from:p,to:m}=Ee(f),h=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),k=e=>void t({search:t=>({...t,status:e===J?Y:e})}),M=e=>void t({search:t=>({...t,severity:e===J?void 0:e})}),z=e=>void t({search:t=>({...t,kind:e===J?void 0:e})}),B=e=>void t({search:t=>({...t,...xe(e)})}),V=N(),H=Te(),G=pe(o.anomalies.resolveAnomaly),X=(y(o.me.getMe,{host:we})?.permissions??[]).includes(`admin.manage`),Z=y(o.anomalies.listAnomalies,{limit:Pe,filter:{q:n||void 0,from:p,to:m,anomalyStatus:a===J?void 0:a,severity:s===J?void 0:s,source:u===J?void 0:u,kind:c===J?void 0:c}}),Q=(0,K.useMemo)(()=>{let e=new Set;for(let t of Z??[])e.add(t.kind);return[...e].sort()},[Z]),ze=n!==``||a!==`open`||s!==J||u!==J||c!==J||f.kind!==`relative`||f.from!==Ne.from;function Be(){d(J),t({search:{status:`open`},replace:!0})}async function Ve(e){if(await V({title:A(),description:(0,q.jsxs)(q.Fragment,{children:[ce(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,j(),` `,(0,q.jsx)(`strong`,{children:O()}),`.`,` `,b()]}),confirmLabel:me()}))try{await G({anomalyId:e._id,status:`resolved`}),H.success(he(),e.kind)}catch(e){H.error(ve(),e)}}async function He(e){try{await G({anomalyId:e._id,status:`acknowledged`}),H.success(S(),e.kind)}catch(e){H.error(fe(),e)}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`oc-admin__hint`,children:[ue(),` `,(0,q.jsx)(`strong`,{children:D()}),` `,_e(),` `,(0,q.jsx)(`strong`,{children:le()}),` `,T(),` `,(0,q.jsx)(`strong`,{children:x()}),` `,se(),` `,(0,q.jsx)(`span`,{className:`oc-filter__window`,children:ge()})]}),(0,q.jsxs)(De,{q:n,onQChange:h,searchPlaceholder:w(),timeRange:f,onTimeRangeChange:B,onReset:Be,canReset:ze,children:[(0,q.jsxs)(L,{value:a,onValueChange:k,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(U,{})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:ye()}),ke.map(e=>(0,q.jsx)(F,{value:e.value,children:Ae(e.value)},e.value))]})]}),(0,q.jsxs)(L,{value:s,onValueChange:M,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(U,{placeholder:E()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:de()}),je.map(e=>(0,q.jsx)(F,{value:e,children:e},e))]})]}),(0,q.jsxs)(L,{value:u,onValueChange:d,children:[(0,q.jsx)(P,{size:`sm`,className:`w-32`,children:(0,q.jsx)(U,{placeholder:r()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:re()}),Me.map(e=>(0,q.jsx)(F,{value:e,children:e},e))]})]}),(0,q.jsxs)(L,{value:c,onValueChange:z,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(U,{placeholder:v()})}),(0,q.jsxs)(W,{children:[(0,q.jsx)(F,{value:J,children:g()}),Q.map(e=>(0,q.jsx)(F,{value:e,children:e},e))]})]})]}),(0,q.jsx)(Oe,{title:_(),rows:Z,emptyHint:a===`open`?l():C(),rowActions:e=>X&&e.status===`open`?[{label:ne(),onSelect:()=>void Ve(e)},{label:ee(),onSelect:()=>void He(e)}]:[],columns:[{header:oe(),cell:e=>(0,q.jsx)(`span`,{className:`oc-traces__time`,children:Se(e.at)}),sort:e=>e.at},{header:v(),cell:e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:E(),cell:e=>(0,q.jsx)(Le,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:ie(),cell:e=>(0,q.jsx)($,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:r(),cell:e=>(0,q.jsx)(R,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:te(),cell:e=>(0,q.jsxs)(`div`,{className:`oc-anomaly__msgcell`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),(0,q.jsx)(Ie,{row:e})]}),sort:e=>e.message},{header:ae(),cell:e=>(0,q.jsx)(Fe,{row:e}),sort:e=>e.evidence??null},{header:i(),cell:e=>e.correlationId?(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:Re(e.correlationId)}):(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Z(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 Q(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 Fe({row:e}){let t=I();if(e.kind===`subagent.failure`){let n=Q(e);return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,M()]}):null]})}let n=Z(e);if(!n.dominantCode)return(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=G(n.dominantCode),i=n.sampleCorrelationId;return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,q.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,M()]}):null]})}function Ie({row:e}){let[t,n]=(0,K.useState)(!1),r=y(o.anomalies.getAnomalyAttachments,t?{anomalyId:e._id}:`skip`);return!e.attachments||e.attachments.length===0?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>n(!0),children:[m(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,q.jsx)(H,{open:t,onOpenChange:n,children:(0,q.jsxs)(z,{className:`oc-anomaly__attachments-dialog`,children:[(0,q.jsx)(V,{children:(0,q.jsx)(B,{children:u()})}),r===void 0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:c()}):r.length===0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:s()}):(0,q.jsx)(`div`,{className:`oc-anomaly__attachments`,children:r.map(e=>(0,q.jsxs)(`section`,{className:`oc-anomaly__attachment`,children:[(0,q.jsx)(`h4`,{className:`oc-anomaly__attachment-name`,children:(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.name})}),(0,q.jsx)(`pre`,{className:`oc-anomaly__attachment-content`,children:e.content})]},e.name))})]})})]})}function Le({severity:e}){return(0,q.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function $({status:e}){return e===`open`?(0,q.jsx)(R,{variant:`destructive`,children:p()}):e===`acknowledged`?(0,q.jsx)(R,{variant:`secondary`,children:f()}):(0,q.jsx)(R,{variant:`outline`,children:d()})}function Re(e){return e.length>8?e.slice(0,8):e}export{X as AnomaliesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cb as r,Db as i,E as a,Eb as o,Ob as s,Sb as c,Sn as l,Tb as u,_M as d,_b as f,_n as p,bb as m,bn as h,gb as g,hb as _,kb as v,vb as y,vn as b,wb as x,xb as S,xn as C,yb as w,yn as T}from"./dist-BTpttlbH.js";import{C as E,S as D,Xt as O,Yt as k,a as A,b as j,et as M,i as N,o as P,r as F,t as I,w as L,x as R}from"./index-GIhUlE6M.js";import{n as ee}from"./TimeRangePicker-Cm5l2vkz.js";import{t as z}from"./FilterBar-DlPympG5.js";import{t as B}from"./AdvancedFilter-Bw_6N4Fp.js";import{t as V}from"./DataTableShell-HZGBUlvm.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:l()},{value:`realLabel`,label:C()},{value:`targetLabel`,label:h()},{value:`impersonated`,label:T()},{value:`resource`,label:b()},{value:`resourceId`,label:p()}];function q(){let e=O({from:`/settings/audit`}),t=k({from:`/settings/audit`}),n=e.q??``,l=e.action??G,p=e.impersonated??G,h=e.resource??G,b=F(e.from,e.to),C=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:T,to:I}=ee(b),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...A(e)})}),Q=e=>void t({search:t=>({...t,adv:N(e)}),replace:!0}),$=d(a.admin.listAudit,{filter:{q:n||void 0,from:T,to:I,action:l===G?void 0:l,resource:h===G?void 0:h,impersonated:p===G?void 0:p===`yes`,advanced:C.length>0?C:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||l!==G||p!==G||h!==G||C.length>0||b.kind!==`relative`||b.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[v(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:s()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:i(),timeRange:b,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(j,{value:l,onValueChange:J,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:o()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:u()}),te.map(e=>(0,U.jsx)(D,{value:e,children:e},e))]})]}),(0,U.jsxs)(j,{value:p,onValueChange:Y,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:x()}),(0,U.jsx)(D,{value:`yes`,children:r()}),(0,U.jsx)(D,{value:`no`,children:c()})]})]}),(0,U.jsxs)(j,{value:h,onValueChange:X,children:[(0,U.jsx)(E,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:S()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(D,{value:G,children:m()}),ne.map(e=>(0,U.jsx)(D,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:C,onChange:Q}),(0,U.jsx)(V,{title:w(),rows:$,emptyHint:y(),columns:[{header:f(),cell:e=>M(e.at),sort:e=>e.at},{header:o(),cell:e=>e.action,sort:e=>e.action},{header:g(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:_(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:S(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Ag as i,Ah as a,Bh as o,Bt as s,Cg as c,Ch as l,D as u,Dg as d,Dh as f,E as p,Eg as m,Eh as h,Fh as g,Gh as ee,Gs as _,Hh as te,Ht as v,Ih as y,Jh as ne,Js as b,Kh as re,Ks as x,Kt as ie,Lh as ae,Mg as oe,Mh as se,Ng as ce,Nh as le,Og as ue,Oh as de,Ph as fe,Qs as pe,Rh as me,Sh as he,Tg as ge,Th as _e,Uh as ve,Us as ye,Ut as be,Vh as xe,Vt as Se,Wh as Ce,Ws as we,Xh as Te,Xs as S,Yh as Ee,Ys as De,Zh as Oe,Zs as ke,_M as C,_h as Ae,ah as je,bg as Me,bh as Ne,ch as Pe,dh as Fe,ec as Ie,eh as w,fh as Le,gM as Re,gh as ze,hh as Be,ih as Ve,jh as He,kg as Ue,kh as T,lh as We,mM as Ge,mh as E,nh as Ke,oh as qe,ph as Je,qh as Ye,qs as Xe,rh as Ze,sh as Qe,tc as $e,th as et,uh as tt,vh as nt,wg as rt,wh as it,xh as at,yg as ot,yh as st,zh as ct,zs as lt,zt as ut}from"./dist-BTpttlbH.js";import{i as D,r as dt}from"./dist-BwHHVs_B.js";import{t as ft}from"./chevrons-up-down-Du6glRFD.js";import{i as pt,n as O,o as mt,r as ht,s as gt}from"./FieldLabel-pNGSpfk-.js";import{i as _t,n as vt,r as yt,t as bt}from"./tabs-DlXyYN7h.js";import{t as k}from"./button-B4Nos6AU.js";import{At as A,C as j,Kt as xt,Nt as St,Q as Ct,S as M,X as wt,Xt as Tt,Yt as Et,Z as Dt,b as N,ct as P,dt as Ot,et as F,ft as kt,ht as At,lt as I,m as jt,mt as Mt,p as Nt,qt as L,tt as R,ut as Pt,w as z,x as B,xt as Ft,z as It,zt as Lt}from"./index-GIhUlE6M.js";import{r as Rt}from"./locales-CPjguROj.js";import{a as zt,i as V,n as Bt,o as H,r as U,t as Vt}from"./table-BBE4oFvW.js";import{t as Ht}from"./FilterBar-DlPympG5.js";import{a as Ut,n as Wt,o as Gt,r as Kt,s as qt,t as Jt}from"./compatView-DwEzKEAD.js";import{t as W}from"./dispatchErrorInfo-C27wKMfE.js";var Yt=u(`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`}]]),Xt=u(`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 Zt(e){return e.filter(e=>e.state===`error`)}function Qt(e){return e.reachable&&Zt(e.targets).length===0}function $t(e){return Qt(e)?(e.unreachableInstances??[]).length>0?`gateways_unreachable`:`ok`:`error`}function en(e){return e.state===`error`&&e.lastErrorCode!==null}function tn(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function nn(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function rn(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,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return nn(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function q(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,an={q:``,state:J,instance:J,version:J},Y={connected:0,error:1,idle:2};function on(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function sn(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 cn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function ln(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 Gt(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function un(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=cn(t.key,e),a=cn(t.key,r);return i&&a?0:i?1:a?-1:n*ln(t.key,e,r)})}function dn(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 fn(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 pn(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>Gt(e,t)??X(e,t))}var Z=n();function mn({connections:e,displayByInstance:t}){let[n,r]=(0,G.useState)(an),[i,a]=(0,G.useState)(null),o=(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+(e.downstreamRejectCount??0),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]),s=(0,G.useMemo)(()=>dn(o),[o]),c=(0,G.useMemo)(()=>fn(o),[o]),l=(0,G.useMemo)(()=>pn(o),[o]),u=(0,G.useMemo)(()=>un(sn(o,n),i),[o,n,i]);function d(e){a(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:nt()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(Ht,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Be(),onReset:()=>r(an),canReset:on(n),children:[(0,Z.jsxs)(N,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(z,{placeholder:Je()})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(M,{value:J,children:E()}),s.map(e=>(0,Z.jsx)(M,{value:e,children:gn(e)},e))]})]}),(0,Z.jsxs)(N,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(z,{placeholder:Le()})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(M,{value:J,children:E()}),c.map(e=>(0,Z.jsx)(M,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(N,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(z,{placeholder:Fe()})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(M,{value:J,children:E()}),l.map(e=>(0,Z.jsx)(M,{value:e,children:e},e))]})]})]}),u.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:tt()}):(0,Z.jsxs)(Vt,{className:`oc-conn__table`,children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Q,{label:We(),sortKey:`target`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:Pe(),sortKey:`state`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:Qe(),sortKey:`instance`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:qe(),sortKey:`host`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:je(),sortKey:`version`,sort:i,onSort:d}),(0,Z.jsx)(V,{children:Ve()}),(0,Z.jsx)(Q,{label:Ze(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Z.jsx)(Bt,{children:u.map(e=>(0,Z.jsx)(hn,{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)(V,{"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)(dt,{size:13,"aria-hidden":!0}):(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(ft,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function hn({r:e}){let t=en(e)?W(e.lastErrorCode):null,n=tn(e)?W(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsxs)(H,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(U,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(_n,{state:e.state})}),(0,Z.jsx)(U,{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)(U,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(U,{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)(U,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:Ae({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(U,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:R(e.lastOkAt)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(H,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(U,{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?` · ${R(e.lastErrorAt)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[ze({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${R(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function gn(e){return e===`connected`?Ke():e===`error`?et():w()}function _n({state:e}){return e===`connected`?(0,Z.jsx)(P,{variant:`secondary`,children:Ke()}):e===`error`?(0,Z.jsx)(P,{variant:`destructive`,children:et()}):(0,Z.jsx)(P,{variant:`outline`,children:w()})}function vn(){return C(p.bridgeHealth.getBridgeHealth,{})}function yn(){let e=vn(),t=C(p.compat.getBridgeCompat,{}),n=C(p.me.getMe,{host:Ft})?.role===`admin`,r=C(p.admin.listInstances,n?{}:`skip`),i=C(p.agents.usageForInstances,n?{}:`skip`),a=Et(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),c=rn(e?e.targets:[],t?t.targets:[],r??[]),{section:l}=Tt({from:`/settings/bridge`}),u=Et({from:`/settings/bridge`}),d=t?.compat??null,f=t===void 0?`loading`:t===null?`nodata`:`ready`,m=d!==null&&Wt(d,`hermes`)&&!c.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(bn,{health:e,compat:t,onSeeAnomalies:o}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:ae()}),i&&i.length>0?(0,Z.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Z.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:y()}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(V,{children:be()}),(0,Z.jsx)(V,{children:v()}),(0,Z.jsx)(V,{children:Se()}),(0,Z.jsx)(V,{children:s()}),(0,Z.jsx)(V,{children:ut()})]})}),(0,Z.jsx)(Bt,{children:i.flatMap(e=>{let t=jt(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Z.jsxs)(H,{children:[(0,Z.jsx)(U,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Z.jsx)(U,{children:t.provider}),(0,Z.jsx)(U,{children:t.label}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(P,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Z.jsx)(U,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,c.length>0?(0,Z.jsxs)(bt,{value:c.some(e=>e.key===l)?l:c[0]?.key??`openclaw`,onValueChange:e=>void u({search:{section:e},replace:!0}),children:[(0,Z.jsx)(yt,{className:`w-full`,children:c.map(e=>(0,Z.jsxs)(_t,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(St,{size:13,"aria-hidden":!0}),q(e.key)]},e.key))}),c.map(e=>(0,Z.jsx)(vt,{value:e.key,children:(0,Z.jsx)(xn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:d,compatStatus:f,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,m?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:lt()}):null]})}function bn({health:e,compat:t,onSeeAnomalies:n}){let i=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,a=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,o=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Ut(t.bridgeVersion)}),a?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsxs)(`code`,{className:`oc-traces__mono`,title:r(),children:[`(`,a,`)`]})]}):null,i?(0,Z.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,pe({build:t.buildVersion??`?`})]}):null,` · `,ke(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?S():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:T()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:de()});let s=Zt(e.targets),c=!e.reachable,u=$t(e),d=e.unreachableInstances??[],p=u===`ok`?`ok`:u===`gateways_unreachable`?`warn`:`error`,m=F(e.checkedAt),g=e.startedAt==null?null:F(e.startedAt);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${p}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u===`ok`?(0,Z.jsx)(xt,{size:22}):c||u===`gateways_unreachable`?(0,Z.jsx)(Xt,{size:22}):(0,Z.jsx)(A,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:u===`ok`?f():u===`gateways_unreachable`?l({count:d.length}):c?h():_e({count:s.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(Yt,{size:12,"aria-hidden":!0}),` `,it({time:m})]}),g?(0,Z.jsx)(`span`,{children:at({time:g})}):null,o]}),u===`gateways_unreachable`?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:he({names:d.join(`, `)})}):null,c?(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:Ne()})]})}function xn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?qt(r,e):null,c=new Map;for(let e of n)c.set(e.name,e.displayName??e.name);let l=[],u=new Set;for(let n of t){if(!n.instanceName||u.has(n.instanceName))continue;u.add(n.instanceName);let t=n.gatewayVersion??null;l.push({instanceName:n.instanceName,displayName:c.get(n.instanceName)??n.instanceName,version:t,state:Jt(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(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)(St,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:q(e)}),f?(0,Z.jsx)(P,{variant:f===`beyond`?`destructive`:`secondary`,children:Kt(f)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:$e()}),(0,Z.jsx)(Cn,{providerName:q(e),support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Z.jsx)(Sn,{protocol:o}):null,(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(L,{size:13,"aria-hidden":!0}),st({count:t.length})]}),p?(0,Z.jsx)(mn,{connections:t,displayByInstance:c}):null]})}function Sn({protocol:e}){let[t,n]=(0,G.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[g(),i.length>0?(0,Z.jsx)(P,{variant:`destructive`,children:le({count:i.length})}):(0,Z.jsx)(P,{variant:`secondary`,children:fe()})]}),(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[se({version:e.vendoredVersion}),r?` · `+He({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(L,{size:13,"aria-hidden":!0}),a({count:r.gapList.length})]}),t?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function Cn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:a}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:ie({provider:a})}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:Xe({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:S()}),e?(0,Z.jsx)(En,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ye()}):(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:Ut(e.version)}),(0,Z.jsx)(P,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Kt(e.state)})]},e.instanceName))})]})}function wn({instance:e,onClose:t}){return(0,Z.jsx)(Pt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(Ot,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(Mt,{children:[(0,Z.jsx)(At,{children:ce({instance:e.displayName??e.name})}),(0,Z.jsx)(kt,{children:oe()})]}),(0,Z.jsx)(Tn,{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)(xt,{"aria-hidden":!0}):(0,Z.jsx)(A,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?xe():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,o()]}):null}function Tn({instance:e,onClose:t}){let n=Re(p.admin.upsertInstanceConfig),r=Ge(p.bridge.validateMediaPaths),a=It(),o=Rt(e.config?.contentLocale,void 0),[s,l]=(0,G.useState)(()=>pt(e.config??{},o)),[u,f]=(0,G.useState)(!1),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(null),y=s.inboundMediaMode===`shared-fs`,b=s.mediaMode===`shared-fs`,x=y||b;async function ie(){g(!0),v(null);try{v(await r({instanceName:e.name,inboundMediaMode:s.inboundMediaMode,mediaMode:s.mediaMode}))}catch(e){a.error(ee(),e)}finally{g(!1)}}async function ae(){f(!0);try{let r=e.config??{};await n({instanceId:e._id,config:ht(s,r,o)}),t()}catch(e){a.error(ge(),e)}finally{f(!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)(O,{label:i(),help:rt()}),(0,Z.jsxs)(N,{value:s.mediaMode,onValueChange:e=>l({...s,mediaMode:e}),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsx)(B,{children:gt.map(e=>(0,Z.jsx)(M,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Ue(),help:c()}),(0,Z.jsxs)(N,{value:s.inboundMediaMode,onValueChange:e=>l({...s,inboundMediaMode:e}),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsx)(B,{children:mt.map(e=>(0,Z.jsx)(M,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:ue(),help:Me()}),(0,Z.jsx)(I,{type:`number`,min:1,max:4096,className:`w-full`,value:s.mediaMaxMb,onChange:e=>l({...s,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),x&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[y&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Oe(),help:Te()}),(0,Z.jsx)(I,{className:`w-full`,spellCheck:!1,value:s.inboundAgentMount,onChange:e=>l({...s,inboundAgentMount:e.target.value})})]}),b&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Ee(),help:ne()}),(0,Z.jsx)(I,{className:`w-full`,spellCheck:!1,value:s.outboundAgentMount,onChange:e=>l({...s,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(Nt,{checked:s.rehydration,onCheckedChange:e=>l({...s,rehydration:e===!0})}),(0,Z.jsx)(O,{label:d(),help:ot()})]}),x&&_!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:_.reachable?!_.inbound&&!_.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(A,{"aria-hidden":!0}),me({reason:_.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:ve(),result:_.inbound}),(0,Z.jsx)($,{label:te(),result:_.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(A,{"aria-hidden":!0}),ct()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[x&&(0,Z.jsxs)(k,{variant:`outline`,size:`sm`,onClick:()=>void ie(),disabled:h,children:[h?(0,Z.jsx)(Lt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,h?re():Ye()]}),(0,Z.jsx)(k,{size:`sm`,onClick:()=>void ae(),disabled:u,children:m()})]})]})})}function En({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(wt,{children:[(0,Z.jsx)(Ct,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?x():_({count:e.length}),(0,Z.jsx)(D,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(Dt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:we()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(P,{variant:`secondary`,children:e},e))})]})]})}export{yn as BridgeTab,wn as InstanceConfigDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ai as r,Bc as i,Di as a,E as o,Fi as s,Gt as c,Ii as l,Mi as u,Ni as d,Oi as f,Pi as p,Sl as m,_M as h,_l as g,ac as _,cM as v,cc as y,gM as b,ic as x,jg as S,ji as C,ki as w,lc as T,mM as E,nc as D,oc as O,rc as k,sc as A,uc as j,vl as M,wl as N}from"./dist-BTpttlbH.js";import{t as P}from"./button-B4Nos6AU.js";import{At as F,C as I,S as L,b as R,d as z,f as B,lt as V,p as H,w as U,x as W,y as G}from"./index-GIhUlE6M.js";import{i as K}from"./compatView-DwEzKEAD.js";/* empty css */var q=t(e(),1),J=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function Y(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 X=n();function Z({instance:e}){let t=b(o.admin.upsertInstanceConfig),n=h(o.agents.listAgentsForInstance,{instanceName:e.name}),r=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[i,a]=(0,q.useState)(r),[s,c]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{a(r),c(`idle`)},[e._id,r]);let l=`__none__`,f=i!==r;async function p(){c(`saving`);try{let n={...e.config??{}};i===``||i===l?delete n.converterAgentId:n.converterAgentId=i,await t({instanceId:e._id,config:n}),c(`done`)}catch{c(`error`)}}let m=n?.agents??[];return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:d()}),(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:u()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsxs)(R,{value:i===``?l:i,onValueChange:e=>a(e===l?``:e),children:[(0,X.jsx)(I,{className:`oc-cdefaults__select`,"aria-label":d(),children:(0,X.jsx)(U,{placeholder:C()})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(L,{value:l,children:C()}),m.map(e=>(0,X.jsx)(L,{value:e.agentId,children:e.displayName?`${e.displayName} (${e.agentId})`:e.agentId},e.agentId))]})]}),(0,X.jsx)(P,{size:`sm`,disabled:!f||s===`saving`,onClick:()=>void p(),children:s===`saving`?N():x()})]}),s===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:k()}):null,s===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}):null]})}function Q({instance:e}){let t=b(o.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,i=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[a,s]=(0,q.useState)(n),[c,l]=(0,q.useState)(i===null?``:String(i)),[u,d]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{s(n),l(i===null?``:String(i)),d(`idle`)},[e._id,n,i]);let m=c.trim(),h=m===``?null:/^\d+$/.test(m)?Number.parseInt(m,10):NaN,g=!a||h===null||Number.isInteger(h)&&h>=4e3&&h<=6e4,_=a!==n||(h??null)!==i;async function v(){d(`saving`);try{let n={...e.config??{}};n.curationEnabled=a,!a||h===null||Number.isNaN(h)?delete n.curationBudgetChars:n.curationBudgetChars=h,await t({instanceId:e._id,config:n}),d(`done`)}catch{d(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,X.jsx)(H,{checked:a,onCheckedChange:e=>s(e===!0),"aria-label":p()}),(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:c,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!g,"aria-label":r(),disabled:!a}),(0,X.jsx)(P,{size:`sm`,disabled:!_||!g||u===`saving`,onClick:()=>void v(),children:u===`saving`?N():x()})]}),g?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:w()}),u===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:k()}):null,u===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:f()})]})}function $({instance:e}){let t=b(o.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,q.useState)(n===null?``:String(n)),[c,u]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{i(n===null?``:String(n)),u(`idle`)},[e._id,n]);let d=r.trim(),f=d===``?null:/^\d+$/.test(d)?Number.parseInt(d,10):NaN,p=f===null||Number.isInteger(f)&&f>=1e3&&f<=2e5,m=(f??null)!==n;async function h(){u(`saving`);try{let n={...e.config??{}};f===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=f,await t({instanceId:e._id,config:n}),u(`done`)}catch{u(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:l()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:r,onChange:e=>i(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!p}),(0,X.jsx)(P,{size:`sm`,disabled:!m||!p||c===`saving`,onClick:()=>void h(),children:c===`saving`?N():x()})]}),p?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:a()}),c===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:k()}):null,c===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:s()})]})}function ee(){let e=E(o.agentFiles.getChatDefaults),[t,n]=(0,q.useState)({status:`loading`}),r=h(o.admin.listInstances,{}),[a,s]=(0,q.useState)(null);(0,q.useEffect)(()=>{!r||r.length===0||(!a||!r.some(e=>e.name===a))&&s(r[0].name)},[r,a]);let l=(r?.length??0)>1,u=r!==void 0&&r.length===0,d=h(o.compat.forInstance,a?{instanceName:a}:`skip`),f=a?G(d,`configDefaults`):`loading`,p=f===`loading`?null:f.blocked,b=(0,q.useMemo)(()=>l&&a?{instanceName:a}:{},[l,a]),x=(0,q.useRef)(0),C=(0,q.useCallback)(async()=>{let t=++x.current;n({status:`loading`});try{let r=Y(await e(b));if(x.current!==t)return;n({status:`done`,current:r})}catch{if(x.current!==t)return;n({status:`error`})}},[e,b]);(0,q.useEffect)(()=>{p===!1&&(l&&!a||C())},[C,p,l,a]);let w=t.status===`done`?t.current:null,D=(0,q.useMemo)(()=>J.map(e=>({id:e,label:B(e)})),[]),k=(0,q.useMemo)(()=>[{id:`fast`,label:M()},{id:`standard`,label:g()}],[]);return(0,X.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),l&&a?(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()}),(0,X.jsxs)(R,{value:a,onValueChange:e=>s(e),children:[(0,X.jsx)(I,{size:`sm`,"aria-label":i(),children:(0,X.jsx)(U,{})}),(0,X.jsx)(W,{children:(r??[]).map(e=>(0,X.jsx)(L,{value:e.name,children:e.name},e.name))})]})]}):null,u?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:S()}):f===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):f.blocked?(0,X.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,X.jsx)(F,{size:14,"aria-hidden":!0}),` `,K(f.gatewayVersion,f.provider)]}):t.status===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):t.status===`error`?(0,X.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[_(),` `,(0,X.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void C(),children:m()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:T()}),(0,X.jsx)(z,{options:D,value:w?.thinkingDefault??null,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()}),(0,X.jsx)(z,{options:k,value:w===null||w.fastModeDefault===null?null:w.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:O()})]}),(0,X.jsx)(`p`,{className:`oc-cdefaults__note`,children:c()})]}),(()=>{let e=r?.find(e=>e.name===(a??r[0]?.name));return e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{instance:e}),(0,X.jsx)(Q,{instance:e}),(0,X.jsx)(Z,{instance:e})]}):null})()]})}export{ee as ChatDefaultsTab};
|
|
@@ -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,BC as a,CC as o,DC as s,E as c,EC as l,FC as u,GC as d,GS as f,HC as p,IC as m,JS as h,Jr as g,KS as _,Kr as v,LC as y,MC as ee,NC as te,OC as ne,PC as re,QS as ie,RC as b,SC as x,TC as S,UC as C,VC as w,WC as T,WS as E,XS as D,YS as O,ZS as k,_C as A,_M as j,aC as M,bC as N,cC as P,dC as F,eC as I,fC as L,gC as R,gM as z,hC as B,iC as V,jC as H,kC as U,lC as ae,mC as W,nC as G,oC as K,pC as q,qS as J,rC as oe,sC as se,tC as ce,uC as le,vC as ue,wC as de,xC as fe,yC as pe,zC as me}from"./dist-BTpttlbH.js";import{t as he}from"./button-B4Nos6AU.js";import{B as ge,et as _e}from"./index-GIhUlE6M.js";import{t as Y}from"./DataTableShell-HZGBUlvm.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>d(),incorrect:()=>T(),incoherence:()=>C(),formatting:()=>p(),latency:()=>w(),api_error:()=>a(),other:()=>me()},Q=e=>ve[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:y()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:m()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:b()})}function ye({data:e,closeReason:t}){let n=e.snapshot,r=z(c.feedback.respondToFeedback),[a,d]=(0,X.useState)(e.thread),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)(!1);async function _(){let t=f.trim();if(!(!t||m)){h(!0);try{await r({feedbackId:e._id,text:t}),d(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),p(``)}finally{h(!1)}}}let v=[];try{v=n.contextJson?JSON.parse(n.contextJson):[]}catch{v=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${u()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:D()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:te()}),a.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:a.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?ee():e.authorRole===`agent`?e.authorLabel??g():H()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:i()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:U(),value:f,maxLength:2e3,rows:3,onChange:e=>p(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(he,{size:`sm`,onClick:()=>void _(),disabled:!f.trim()||m,children:m?ne():s()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:l()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||S()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:de()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||S()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:o()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,v.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:x({count:n.contextCount??v.length,truncated:n.contextTruncated?fe():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:v.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:N()}),(0,Z.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,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:pe()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ue()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?A({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,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[R(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,B()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=j(c.feedback.listForAdmin,{}),t=z(c.feedback.readSnapshot),n=z(c.feedback.deleteFeedback),i=ge(),[a,o]=(0,X.useState)(null),[s,l]=(0,X.useState)({});async function u(e){if(a===e._id){o(null);return}if(!s[e._id]){let n=await t({feedbackId:e._id});l(t=>({...t,[e._id]:n}))}o(e._id)}async function d(e){await i({title:_(),description:f(),confirmLabel:E(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&o(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[W(),` `,(0,Z.jsx)(`strong`,{children:q()}),` `,L()]}),(0,Z.jsx)(Y,{title:F(),rows:e,emptyHint:le(),isExpanded:e=>a===e._id&&!!s[e._id],renderExpanded:e=>s[e._id]?(0,Z.jsx)(ye,{data:s[e._id],closeReason:e.userCloseReason}):null,columns:[{header:ae(),cell:e=>_e(e.at),sort:e=>e.at},{header:P(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:se(),cell:e=>e.messageRole===`user`?K():M(),sort:e=>e.messageRole},{header:V(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${oe({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:G(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:ce(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:I(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:r()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ie()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:v()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:k()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:a===e._id?O():h(),onSelect:()=>void u(e)},{label:J(),onSelect:()=>void d(e),variant:`destructive`}]})]})}export{be as FeedbacksTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aj as r,Bj as ee,Cj as i,Dj as a,E as o,Ej as s,Fj as te,Hj as ne,Ij as re,Lj as ie,Mj as ae,Nj as c,Oj as l,Pj as u,Qr as d,Rj as f,Sj as oe,Tj as p,Vj as se,WE as ce,Zr as le,_M as ue,_j as de,bj as fe,cM as pe,cj as me,dj as he,fj as ge,gM as _e,gj as ve,hj as m,jj as h,kj as g,lj as ye,mj as be,pj as xe,sj as Se,uM as _,uj as v,vj as y,wj as b,xj as x,yj as S,zj as C}from"./dist-BTpttlbH.js";import{t as w}from"./button-B4Nos6AU.js";import{C as T,Ft as E,G as D,H as O,Ht as k,J as A,K as j,S as M,U as Ce,Ut as N,W as we,Y as Te,b as P,ct as F,it as I,jt as Ee,nt as De,p as Oe,q as ke,rt as Ae,st as je,w as L,x as R,z as Me}from"./index-GIhUlE6M.js";import{a as Ne,i as z,n as Pe,o as B,r as V,t as Fe}from"./table-BBE4oFvW.js";var H=t(e(),1),U=n(),W=`all`;function G(e){switch(e){case`image`:return h();case`audio`:return r();case`video`:return g();case`pdf`:return l();case`document`:return a();case`archive`:return s();default:return p()}}function K(){let[e,t]=(0,H.useState)(W),[n,r]=(0,H.useState)(W),[a,s]=(0,H.useState)(W),[l,p]=(0,H.useState)(W),[h,g]=(0,H.useState)(!1),[K,q]=(0,H.useState)(null),J=_e(o.files.softDelete),Y=Me();function Ie(){t(W),r(W),s(W),p(W)}async function Le(){let e=K;if(q(null),e)try{await J({fileId:e.id}),Y.success(be())}catch(e){Y.error(xe(),e)}}let X=ue(o.files.listMine,{direction:e===W?void 0:e,chatId:n===W?void 0:n,instanceName:a===W?void 0:a,category:l===W?void 0:l,includeAutoGenerated:h||void 0}),Re=(0,H.useMemo)(()=>new Intl.DateTimeFormat(_(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:pe()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==W||n!==W||a!==W||l!==W;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:ne()}),(0,U.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,U.jsxs)(P,{value:e,onValueChange:t,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":se(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:ee()}),(0,U.jsx)(M,{value:`inbound`,children:C()}),(0,U.jsx)(M,{value:`outbound`,children:f()})]})]}),(0,U.jsxs)(P,{value:n,onValueChange:r,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":ie(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:re()}),Q.chats.map(e=>(0,U.jsx)(M,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,U.jsxs)(P,{value:a,onValueChange:s,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":te(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:u()}),Q.instances.map(e=>(0,U.jsx)(M,{value:e,children:e},e))]})]}):null,(0,U.jsxs)(P,{value:l,onValueChange:p,children:[(0,U.jsx)(T,{size:`sm`,"aria-label":c(),children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(M,{value:W,children:ae()}),Q.categories.map(e=>(0,U.jsx)(M,{value:e,children:G(e)},e))]})]}),(0,U.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,U.jsx)(Oe,{checked:h,onCheckedChange:e=>g(e===!0),"aria-label":d()}),(0,U.jsx)(`span`,{children:d()})]}),$?(0,U.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,U.jsx)(E,{size:14,"aria-hidden":!0}),de()]}):null]}),Z.length===0?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:$?me():ye()}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Fe,{children:[(0,U.jsx)(Ne,{children:(0,U.jsxs)(B,{children:[(0,U.jsx)(z,{children:b()}),(0,U.jsx)(z,{children:i()}),(0,U.jsx)(z,{children:oe()}),(0,U.jsx)(z,{children:x()}),(0,U.jsx)(z,{children:fe()}),(0,U.jsx)(z,{className:`text-right`,children:S()})]})}),(0,U.jsx)(Pe,{children:Z.map(e=>(0,U.jsxs)(B,{children:[(0,U.jsxs)(V,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,U.jsx)(F,{variant:`outline`,style:{marginLeft:6},children:le()}):null]}),(0,U.jsx)(V,{title:e.mimeType,children:G(e.category)}),(0,U.jsx)(V,{children:(0,U.jsx)(F,{variant:`secondary`,children:e.direction===`inbound`?C():f()})}),(0,U.jsx)(V,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,U.jsx)(V,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,U.jsx)(V,{className:`text-right`,children:(0,U.jsxs)(De,{children:[(0,U.jsx)(je,{asChild:!0,children:(0,U.jsx)(w,{variant:`ghost`,size:`icon`,"aria-label":ve(),children:(0,U.jsx)(k,{size:16})})}),(0,U.jsxs)(Ae,{align:`end`,children:[e.url?(0,U.jsx)(I,{asChild:!0,children:(0,U.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,U.jsx)(N,{size:14}),y()]})}):(0,U.jsxs)(I,{disabled:!0,children:[(0,U.jsx)(N,{size:14}),v()]}),(0,U.jsxs)(I,{variant:`destructive`,onSelect:()=>q({id:e._id,filename:e.filename}),children:[(0,U.jsx)(Ee,{size:14}),m()]})]})]})})]},e._id))})]}),ze?(0,U.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:Se({cap:Be})}):null]}),(0,U.jsx)(O,{open:K!==null,onOpenChange:e=>!e&&q(null),children:(0,U.jsxs)(D,{children:[(0,U.jsxs)(A,{children:[(0,U.jsx)(Te,{children:ge()}),(0,U.jsx)(j,{children:he()})]}),(0,U.jsxs)(ke,{children:[(0,U.jsx)(we,{children:ce()}),(0,U.jsx)(Ce,{onClick:()=>void Le(),children:m()})]})]})})]})}export{K as FilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,Au as i,Bl as a,Bu as o,Cu as s,D as c,Du as l,E as u,Eu as d,Fu as f,Gl as p,Gu as m,Hl as h,Hu as g,Il as _,Iu as v,Jl as y,Kl as b,Ll as x,Lu as ee,Mu as S,Nu as C,Ou as te,Pu as w,Ql as T,Rl as E,Ru as ne,Su as D,Tu as re,Ul as O,Uu as k,Vl as A,Vu as j,Wl as M,Wu as ie,Xl as N,Yl as P,Zl as F,_M as I,_u as ae,au as oe,bu as se,cu as L,du as ce,eu as le,fu as ue,gM as R,gu as z,hu as de,iu as fe,ju as pe,ku as me,lu as he,mu as ge,nu as _e,ou as ve,pu as ye,ql as be,ru as xe,su as B,tu as Se,uu as Ce,vu as we,wu as Te,xu as Ee,yu as De,zl as Oe,zu as ke}from"./dist-BTpttlbH.js";import{t as Ae}from"./x-BLHWZzIt.js";import{i as V,n as H,r as je,t as Me}from"./tabs-DlXyYN7h.js";import{t as U}from"./button-B4Nos6AU.js";import{B as Ne,C as Pe,Jt as Fe,Mt as W,Nt as G,S as Ie,b as Le,ct as K,dt as Re,ft as ze,ht as Be,lt as q,mt as Ve,p as J,qt as He,u as Ue,ut as We,w as Ge,x as Ke,xt as qe,z as Y}from"./index-GIhUlE6M.js";import{t as Je}from"./FilterBar-DlPympG5.js";import{t as Ye}from"./DataTableShell-HZGBUlvm.js";import{t as X}from"./DetailChips-gFOfqX_a.js";var Xe=c(`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=c(`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=c(`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 ue();case`user`:return ce();case`pending`:return Ce();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=I(u.groups.listGroups,{}),t=I(u.me.getMe,{host:qe})?.role===`admin`,n=R(u.groups.createGroup),r=R(u.groups.updateGroup),a=R(u.groups.deleteGroup),s=Ne(),c=Y(),[p,h]=(0,Q.useState)(!1),[_,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(it),[T,D]=(0,Q.useState)(null),[O,A]=(0,Q.useState)(``),M=(0,Q.useMemo)(()=>{if(!e)return e;let t=O.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,O]);function N(){y(null),x(it),h(!0)}function P(e){y(e),x({name:e.name,description:e.description??``}),h(!0)}async function F(){try{_?await r({groupId:_._id,name:b.name,description:b.description}):await n({name:b.name,description:b.description||void 0}),x(it),y(null),h(!1)}catch(e){c.error(Oe(),e)}}async function ae(e){if(await s({title:d({name:e.name}),description:re(),confirmWord:e.name,confirmLabel:Te(),cancelLabel:S(),destructive:!0}))try{await a({groupId:e._id})}catch(e){c.error(E(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}),(0,$.jsx)(Je,{q:O,onQChange:A,onReset:()=>A(``),canReset:O!==``,searchPlaceholder:ee()}),(0,$.jsx)(Ye,{title:m(),rows:M,addLabel:k(),onAdd:t?N:void 0,emptyHint:g(),columns:[{header:j(),cell:e=>e.name,sort:e=>e.name},{header:o(),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:ke(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(G,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ne(),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)(W,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:v(),onSelect:()=>D({groupId:e._id,name:e.name})},...t?[{label:f(),onSelect:()=>P(e)},{label:w(),variant:`destructive`,onSelect:()=>void ae(e)}]:[]]}),(0,$.jsx)(Ue,{open:p,onOpenChange:h,title:_?i():pe(),description:me(),canSubmit:!!b.name.trim(),onSubmit:F,submitLabel:C(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:te()}),(0,$.jsx)(q,{value:b.name,onChange:e=>x({...b,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:l()}),(0,$.jsx)(q,{value:b.description,onChange:e=>x({...b,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:T?.groupId??null,groupName:T?.name??``,open:T!==null,onOpenChange:e=>{e||D(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)(Fe,{size:14,"aria-hidden":!0}),de()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":ye({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[ge(),(0,$.jsx)(He,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=I(u.groups.getGroup,n&&e?{groupId:e}:`skip`),a=I(u.groups.listAssignableInstances,n?{}:`skip`),o=I(u.groups.listAssignableUsers,n?{}:`skip`),c=R(u.groups.addMember),l=R(u.groups.removeMember),d=R(u.groups.bulkSetMembers),f=R(u.groups.setGroupManager),p=Y(),[m,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(`members`),[ee,S]=(0,Q.useState)(1),[C,te]=(0,Q.useState)(new Set),w=(0,Q.useRef)(null),E=(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]),re=i?.viewerIsAdmin===!0,k=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{g(``),v(``),b(`members`),S(1),w.current=null},[n,e]),(0,Q.useEffect)(()=>{S(1)},[m]),(0,Q.useEffect)(()=>{n&&i&&e&&w.current!==e&&(w.current=e,te(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let j=(0,Q.useMemo)(()=>o?Qe(o,m,C):[],[o,m,C]);async function ie(t,n){if(e)try{n?await l({groupId:e,userId:t}):await c({groupId:e,userId:t})}catch(e){p.error(x(),e)}}async function N(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){p.error(A(),e)}}let P=nt(j,e=>E.has(e.userId)),F=j.filter(e=>E.has(e.userId)).length,L=rt(j,ee,ot);async function ce(){if(!e||j.length===0)return;let t=j.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:P!==`all`})}catch(e){p.error(x(),e)}}return(0,$.jsx)(We,{open:n,onOpenChange:r,children:(0,$.jsxs)(Re,{className:`oc-access`,children:[(0,$.jsxs)(Ve,{children:[(0,$.jsx)(Be,{children:s({name:t})}),(0,$.jsx)(ze,{children:D()})]}),(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}),Ee(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,$.jsxs)(V,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(G,{size:13,"aria-hidden":!0}),De(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:k.size}):null]}),(0,$.jsxs)(V,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Xe,{size:13,"aria-hidden":!0}),T(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(H,{value:`members`,children:o===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):o.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:oe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{value:m,onChange:e=>g(e.target.value),placeholder:se(),className:`oc-access__search`}),j.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ae()}):(0,$.jsxs)($.Fragment,{children:[j.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(J,{checked:P===`all`?!0:P===`some`?`indeterminate`:!1,onCheckedChange:()=>void ce(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(K,{variant:`outline`,className:`oc-access__count`,children:[F,` / `,j.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:L.pageItems.map(e=>{let t=E.has(e.userId),n=et(e),r=ne.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(J,{checked:t,onCheckedChange:()=>void ie(e.userId,t),"aria-label":he({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)(K,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&re?(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?h():O(),title:r?h():O(),onClick:()=>void N(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:L.page,pageCount:L.pageCount,onPage:S})]})]})}),(0,$.jsx)(H,{value:`agents`,children:a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):a.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{value:_,onChange:e=>v(e.target.value),placeholder:we(),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:k,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=I(u.groups.listAssignableAgents,{instanceName:t}),s=R(u.groups.assignAgentToGroup),c=R(u.groups.removeAgentFromGroup),l=R(u.groups.bulkSetGroupAgents),d=Y(),[f,p]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{p(1)},[a]),!e)return null;let m=$e(o?.agents??[],a),h=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&m.length===0)return null;let g=m.filter(e=>e.presentInLastOk!==!1&&e.enabled!==!1),v=nt(g,e=>i.has(`${t}/${e.agentId}`)),y=rt(m,f,ot);async function b(n,r){try{r?await c({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){d.error(_(),e)}}async function x(){if(g.length===0)return;let n=g.map(e=>e.agentId);try{await l({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){d.error(_(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(G,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n}),h?(0,$.jsx)(K,{variant:`outline`,className:`oc-access__stale`,children:Se()}):null]}),o===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ve()}):m.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:h?_e():xe()}):(0,$.jsxs)($.Fragment,{children:[g.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(J,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,a=i.has(n),o=e.presentInLastOk===!1,s=!e.enabled;return(0,$.jsxs)(`div`,{className:`oc-access__row${s?` is-disabled`:``}`,children:[(0,$.jsx)(J,{checked:a,disabled:(o||s)&&!a,onCheckedChange:()=>void b(e.agentId,a),"aria-label":L({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":r(),title:r(),children:(0,$.jsx)(W,{size:14,fill:`currentColor`})}):null,o?(0,$.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:le()}):null]},e.agentId)}),(0,$.jsx)(st,{page:y.page,pageCount:y.pageCount,onPage:p})]})]})}function ut({groupId:e}){let t=I(u.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=R(u.charts.assignChartToGroup),r=R(u.charts.removeChartFromGroup),i=R(u.charts.setGroupDefaultChart),o=R(u.charts.addChartToGroupPool),s=R(u.charts.removeChartFromGroupPool),c=Y();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()});let{pool:l,addable:d,canManagePool:f}=t;if(l.length===0&&!f)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:F()});async function m(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(a(),e)}}async function h(t){try{await i({groupId:e,chartKey:t})}catch(e){c.error(a(),e)}}async function g(t){try{await o({groupId:e,chartKey:t})}catch(e){c.error(a(),e)}}async function _(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(a(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:l.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(J,{checked:e.selected,onCheckedChange:()=>void m(e.chartKey,e.selected),"aria-label":be({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":b(),title:b(),children:(0,$.jsx)(W,{size:14,fill:`currentColor`})}):(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void h(e.chartKey),children:p()}):null,f?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":y({name:e.name}),title:y({name:e.name}),onClick:()=>void _(e.chartKey),children:(0,$.jsx)(Ae,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,$.jsxs)(Le,{value:``,onValueChange:e=>void g(e),children:[(0,$.jsx)(Pe,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Ge,{placeholder:P()})}),(0,$.jsx)(Ke,{children:d.map(e=>(0,$.jsx)(Ie,{value:e.chartKey,children:e.name},e.chartKey))})]}):l.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:N()}):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{$b as r,$i as i,$x as a,Ab as o,Ax as s,Bb as c,Bx as l,Cx as u,Dx as d,E as f,Ex as p,Fb as m,Fx as h,Gb as g,Gx as _,Hb as v,Hx as y,ID as b,Ib as x,Ix as ee,Jb as S,Jt as C,Jx as w,Kb as T,Kx as E,LD as D,Lb as O,Lx as k,Mb as te,Mx as ne,Nb as re,Nx as ie,Ox as ae,Pb as oe,Px as se,Qb as ce,Qi as le,Qx as ue,Rb as de,Rx as fe,Sg as pe,Sx as me,Tx as he,Ub as ge,Ux as _e,Vb as ve,Vx as ye,Wb as be,Wx as xe,Xb as Se,Xt as Ce,Xx as we,Yb as Te,Yt as Ee,Yx as De,Zb as A,Zi as Oe,Zx as ke,_M as j,_x as Ae,aS as je,ax as Me,bx as Ne,cS as Pe,cx as Fe,dS as Ie,dx as Le,eS as Re,ea as ze,ex as M,fS as Be,fx as Ve,gM as N,gS as He,gx as Ue,hS as We,hx as Ge,iS as Ke,ix as qe,jb as P,jx as Je,kx as Ye,lS as Xe,lx as Ze,mM as F,mS as Qe,mx as $e,nS as I,nx as L,oS as et,ox as tt,pS as nt,px as rt,qb as it,qx as at,rS as ot,rx as st,sS as ct,sx as lt,tS as ut,tx as dt,uS as ft,ux as pt,vx as mt,wx as ht,xg as gt,xx as _t,yx as vt,zb as yt,zx as bt}from"./dist-BTpttlbH.js";import{a as xt,c as St}from"./FieldLabel-pNGSpfk-.js";import{t as R}from"./button-B4Nos6AU.js";import{B as Ct,C as z,Q as wt,S as B,X as Tt,Z as Et,b as V,ct as H,dt as U,ft as W,ht as Dt,lt as G,mt as Ot,p as kt,u as At,ut as jt,w as K,x as q,z as J}from"./index-GIhUlE6M.js";import{t as Mt}from"./DataTableShell-HZGBUlvm.js";import{InstanceConfigDialog as Nt}from"./BridgeTab-BDp1JcI8.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],Pt=new Set(X),Ft=`conversational`;function It(e){let t=new Set((e??[]).filter(e=>Pt.has(e)));return t.size===0?[Ft]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:xt},Lt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Rt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,transport:e.transport??`ws`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function zt(){let e=j(f.admin.listInstances,{}),t=j(f.agents.listAllInstanceAgents,{}),n=N(f.admin.upsertInstance),r=N(f.admin.deleteInstance),i=J(),[o,s]=(0,Y.useState)(!1),[c,u]=(0,Y.useState)(Q),[d,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(null);async function ee(){try{await n({instanceId:b??void 0,name:c.name,gatewayUrl:c.gatewayUrl,bridgeUrl:c.bridgeUrl||void 0,displayName:c.displayName||void 0,kind:c.kind,transport:c.kind===`hermes`?c.transport:void 0,gatewayVersion:c.gatewayVersion||void 0,gatewayHttpUrl:c.gatewayHttpUrl||void 0,streamTransport:c.streamTransport}),u(Q),x(null),s(!1)}catch(e){i.error(Qe(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[nt(),(0,Z.jsx)(`strong`,{children:Be()}),Ie()]}),(0,Z.jsx)(Mt,{title:ft(),rows:e,addLabel:Xe(),onAdd:()=>{x(null),u(Q),s(!0)},emptyHint:Pe(),columns:[{header:ct(),cell:e=>e.name,sort:e=>e.name},{header:et(),cell:e=>(0,Z.jsx)(H,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:je(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Ke(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:He(),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)(H,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?P():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:Re(),onSelect:()=>{x(e._id),u(Rt(e)),s(!0)}},{label:We(),onSelect:()=>p(e.name)},{label:bt(),onSelect:()=>v(e)},{label:ot(),onSelect:()=>h(e)},{label:I(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:I(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(At,{open:o,onOpenChange:s,title:b?a():ut(),description:ke(),canSubmit:!!(c.name&&c.gatewayUrl),onSubmit:ee,submitLabel:we(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:De(),children:[(0,Z.jsx)(G,{value:c.name,disabled:b!==null,onChange:e=>u({...c,name:e.target.value})}),b?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ue()}):null]}),(0,Z.jsx)($,{label:w(),children:(0,Z.jsxs)(V,{value:c.kind,onValueChange:e=>u({...c,kind:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(B,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(B,{value:`hermes`,children:`Hermes`})]})]})}),c.kind===`hermes`?(0,Z.jsx)($,{label:Ce(),children:(0,Z.jsxs)(V,{value:c.transport,onValueChange:e=>u({...c,transport:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(K,{})}),(0,Z.jsxs)(q,{children:[(0,Z.jsx)(B,{value:`ws`,children:Ee()}),(0,Z.jsx)(B,{value:`rest`,children:C()})]})]})}):null,(0,Z.jsx)($,{label:at(),children:(0,Z.jsx)(G,{value:c.gatewayUrl,onChange:e=>u({...c,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:E(),children:(0,Z.jsx)(G,{value:c.bridgeUrl,placeholder:_(),onChange:e=>u({...c,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:xe(),children:(0,Z.jsx)(G,{value:c.displayName,onChange:e=>u({...c,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:pe(),children:[(0,Z.jsxs)(V,{value:c.streamTransport,onValueChange:e=>u({...c,streamTransport:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(K,{})}),(0,Z.jsx)(q,{children:St.map(e=>(0,Z.jsx)(B,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:gt()})]}),(0,Z.jsx)($,{label:_e(),children:(0,Z.jsx)(G,{value:c.gatewayVersion,placeholder:y(),onChange:e=>u({...c,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:ye(),children:(0,Z.jsx)(G,{value:c.gatewayHttpUrl,placeholder:l(),onChange:e=>u({...c,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Yt,{instanceName:d,open:d!==null,onOpenChange:e=>{e||p(null)}}),m?(0,Z.jsx)(Nt,{instance:m,onClose:()=>h(null)},m._id):null,g?(0,Z.jsx)(Bt,{instance:g,onClose:()=>v(null)},g._id):null]})}function Bt({instance:e,onClose:t}){let n=j(f.instanceSecrets.listInstanceSecretStatus,{}),r=Lt[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)(jt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(U,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(Dt,{children:fe({instance:e.displayName??e.name})}),(0,Z.jsx)(W,{children:k()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Ut,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ht,{instance:e})}),(0,Z.jsx)(Vt,{instance:e})]})})}function Vt({instance:e}){let t=F(f.instanceSync.forceInstanceSync),n=J(),[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(Ae());break;case`no_agents`:n.success(Ge());break;case`no_bridge_url`:n.error($e());break;case`deploy_misconfigured`:n.error(rt());break;case`unauthorized`:n.error(Le());break;case`not_served`:n.error(pt());break;default:n.error(Ve());break}}catch(e){n.error(Ue(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ze()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?mt():vt()})})]})}function Ht({instance:e}){let t=j(f.bridgeAuth.listBridgeAuthStatus,{}),n=F(f.bridgeAuth.mintBridgeSecret),r=N(f.bridgeAuth.revokeBridgeSecret),i=J(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),p=d!==void 0;async function m(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(L(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(st())}catch(e){i.error(L(),e)}finally{o(!1)}}}async function g(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:Fe(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:lt()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:p?`outline`:`secondary`,children:p?`${ie()} · ${d.prefix}…${d.lastFour}`:ne()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void m(),disabled:a,children:p?Me():tt()}),p?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:qe()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:dt()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void g(),children:l?D():b()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:M()})]}):null]})}function Ut({instanceId:e,field:t,updatedAt:n}){let r=F(f.instanceSecrets.setInstanceSecret),i=N(f.instanceSecrets.clearInstanceSecret),a=F(f.deviceIdentity.generateDeviceIdentity),o=J(),[c,l]=(0,Y.useState)(``),[m,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(!1),S=n!==null,C=t===`deviceIdentity`,w=t===`token`?ee():t===`deviceIdentity`?h():se();async function T(){if(!(!c.trim()||m)){g(!0);try{await r({instanceId:e,field:t,plaintext:c}),l(``),v(null),x(!1),o.success(d())}catch(e){o.error(p(),e)}finally{g(!1)}}}async function E(){if(!m){g(!0);try{await i({instanceId:e,field:t}),v(null),x(!1),o.success(he())}catch(e){o.error(p(),e)}finally{g(!1)}}}async function O(){if(!m){g(!0);try{v(await a({instanceId:e})),x(!1),o.success(me())}catch(e){o.error(Ne(),e)}finally{g(!1)}}}let k=_?`openclaw devices approve ${_.id}`:``;async function te(){if(k)try{await navigator.clipboard.writeText(k),x(!0)}catch{}}return(0,Z.jsxs)($,{label:w,children:[C?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:S?`outline`:`secondary`,children:S?ie():ne()}),(0,Z.jsx)(G,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:S?s():Je(),onChange:e=>l(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void T(),disabled:m||c.trim().length===0,children:Ye()}),C?(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void O(),disabled:m,children:ht()}):null,S?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void E(),disabled:m,children:ae()}):null]})]}),_?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:me()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:_t()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:k}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void te(),children:y?D():b()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{v(null),x(!1)},children:M()})]}):null]})}var Wt={conversational:T,documentary:be,summarizer:ze,curator:le},Gt={conversational:g,documentary:ge,summarizer:i,curator:Oe},Kt=e=>(Wt[e]??(()=>e))(),qt=e=>(Gt[e]??(()=>``))();function Jt({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:Se()}),t.map(e=>(0,Z.jsx)(H,{variant:`secondary`,className:`oc-agenttype__chip`,title:qt(e),children:Kt(e)},e)),(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(wt,{asChild:!0,children:(0,Z.jsx)(R,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Te()})}),(0,Z.jsxs)(Et,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:S()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:it()}),(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)(kt,{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:Kt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:qt(r)})]})]},r)})})]})]})]})}function Yt({instanceName:e,open:t,onOpenChange:n}){let i=j(f.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),a=N(f.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),s=N(f.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),l=N(f.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=It(r);e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),u=N(f.agents.removeInstanceAgent),d=Ct(),p=J();async function h(t,n){if(e)try{await a({instanceName:e,agentId:t,enabled:n})}catch(e){p.error(A(),e)}}async function g(t){if(e)try{await s({instanceName:e,agentId:t})}catch(e){p.error(A(),e)}}async function _(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await l({instanceName:e,agentId:t,types:i})}catch(e){p.error(A(),e)}}async function y(t,n){if(e&&await d({title:c({name:n}),description:yt(),confirmLabel:de(),destructive:!0}))try{await u({instanceName:e,agentId:t}),p.success(O())}catch(e){p.error(A(),e)}}return(0,Z.jsx)(jt,{open:t,onOpenChange:n,children:(0,Z.jsxs)(U,{className:`oc-access`,children:[(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(Dt,{children:r({name:e??``})}),(0,Z.jsx)(W,{children:ce()})]}),i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:x()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:i.discovery===null?m():i.discovery.lastPollOk?oe():re({error:i.discovery.error??`?`})}),i.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:te()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i.agents.map(e=>{let t=e.presentInLastOk===!1,n=i.defaultAgentId===e.agentId,r=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)(kt,{checked:e.enabled,disabled:t,"aria-label":r,onCheckedChange:t=>void h(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:r,children:[e.emoji?`${e.emoji} `:``,r]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(H,{variant:`outline`,className:`oc-access__gone`,children:o()}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void y(e.agentId,r),children:ve()})]}):n?(0,Z.jsx)(H,{variant:`default`,children:P()}):(0,Z.jsx)(R,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void g(e.agentId),children:v()})]}),e.enabled?(0,Z.jsx)(Jt,{agentId:e.agentId,types:a,onToggle:t=>void _(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{zt as InstancesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,E as i,JC as a,KC as o,QC as s,XC as c,YC as l,ZC as u,_M as d,_o as f,aw as p,bo as m,ew as h,gM as g,go as _,ho as v,iw as y,mM as b,mo as x,nw as S,po as C,qC as w,rw as T,tw as E,vo as D,xo as O,yo as k}from"./dist-BTpttlbH.js";import{t as A}from"./button-B4Nos6AU.js";import{ct as j,lt as M,p as N}from"./index-GIhUlE6M.js";var P=t(e(),1),F=n();function I(){let e=d(i.integrations.status.status,{}),t=g(i.admin.setIntegrationConfig),[n,f]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&f(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:p()});let _=n,v=(e,t,n)=>f({..._,[e]:{..._[e],[t]:n}}),b=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[y(),` `,(0,F.jsx)(`strong`,{children:T()}),` `,S()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(j,{variant:`secondary`,children:E()}):(0,F.jsx)(j,{variant:`outline`,children:h()}):(0,F.jsx)(j,{variant:`outline`,children:r()}),note:s(),children:[(0,F.jsx)(R,{label:c(),children:(0,F.jsx)(M,{value:_.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>v(`langfuse`,`host`,e.target.value),onBlur:()=>b(`langfuse`,{host:_.langfuse.host??``})})}),(0,F.jsx)(z,{label:o(),checked:_.langfuse.enabled??!0,onChange:e=>{v(`langfuse`,`enabled`,e),b(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(j,{variant:`secondary`,children:E()}):(0,F.jsx)(j,{variant:`outline`,children:h()}):(0,F.jsx)(j,{variant:`outline`,children:r()}),note:u(),children:[(0,F.jsx)(R,{label:l(),children:(0,F.jsx)(M,{value:_.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>v(`opik`,`baseUrl`,e.target.value),onBlur:()=>b(`opik`,{baseUrl:_.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:a(),children:(0,F.jsx)(M,{value:_.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||w(),onChange:e=>v(`opik`,`workspace`,e.target.value),onBlur:()=>b(`opik`,{workspace:_.opik.workspace??``})})}),(0,F.jsx)(z,{label:o(),checked:_.opik.enabled??!0,onChange:e=>{v(`opik`,`enabled`,e),b(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(j,{variant:`secondary`,children:E()}):(0,F.jsx)(j,{variant:`outline`,children:h()}):(0,F.jsx)(j,{variant:`outline`,children:O()}),note:m(),children:[(0,F.jsx)(R,{label:k(),children:(0,F.jsx)(M,{value:_.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>v(`otlp`,`endpoint`,e.target.value),onBlur:()=>b(`otlp`,{endpoint:_.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:o(),checked:_.otlp.enabled??!0,onChange:e=>{v(`otlp`,`enabled`,e),b(`otlp`,{enabled:e})}})]})]})}function L({title:e,status:t,note:n,children:r}){return(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,F.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function R({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-int__field`,children:[(0,F.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function z({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,F.jsx)(N,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,F.jsx)(`span`,{children:e})]})}function B({headersSet:e}){let t=b(i.integrations.otlpSecret.setOtlpHeaders),n=g(i.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),[c,l]=(0,P.useState)(!1),u=async()=>{l(!0),s(null);try{await t({headersJson:r}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,F.jsxs)(R,{label:D(),children:[(0,F.jsx)(M,{value:r,placeholder:e?f():_(),onChange:e=>a(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(A,{size:`sm`,disabled:c||r.trim().length===0,onClick:()=>void u(),children:v()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:c,onClick:()=>void n({}),children:x()}):null]}),o?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:C()})]})}export{I as IntegrationsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Am as r,Bm as i,Bw as a,Dm as o,E as s,Fm as c,Hw as l,Im as u,Lm as d,Mm as f,Mw as p,Nm as m,Om as h,Pm as g,Rm as _,Vw as v,_M as y,jm as b,jw as x,km as S,pT as C,zm as w,zw as T}from"./dist-BTpttlbH.js";import{Xt as ee,Yt as te,a as ne,n as re,r as E,xt as D}from"./index-GIhUlE6M.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-DhM6Y5He.js";import{n as N,t as P}from"./TimeRangePicker-Cm5l2vkz.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=y(s.me.getMe,{host:D})?.permissions?.includes(`traces.read`)??!1,t=y(s.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,F.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,L).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:C()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:l()}),(0,I.jsx)(j,{children:a()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):(0,I.jsx)(B,{series:n})})]})]})}function B({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),r=Math.max(1,...t,...n),i=t=>6+t*468/(e.length-1),a=e=>74-e*68/r,o=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${a(e).toFixed(1)}`).join(` `),s=e[e.length-1];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{style:{color:`var(--primary)`},children:[x(),` p50 `,R(s.cP50),` `,v()]}),(0,I.jsxs)(`span`,{children:[p(),` p50 `,R(s.aP50),` `,v()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":l(),children:[(0,I.jsx)(`path`,{d:o(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:o(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:i(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:w(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:_(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:d(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:u(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:c(),unit:`/h`,group:`Assistant`,isError:!0}],H=V.length,U=[`API`,`OpenClaw`,`Chat`,`Assistant`],W=1e3,G=36e5;function K(e,t){let n=Math.max(1,Math.ceil((t-e)/G)),r=Math.min(n*H,W);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/H))}}function q(){let e=ee({from:`/settings/kpi`}),t=te({from:`/settings/kpi`}),n=E(e.from,e.to,re,`now`),r=e=>void t({search:t=>({...t,...ne(e)})}),{from:i,to:a}=N(n),{rowLimit:o,buckets:c}=K(i,a),l=y(s.kpi.listKpis,{limit:o,filter:{from:i,to:a}}),u=(0,F.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>c&&e.set(t,n.slice(n.length-c));return e},[l,c]),d=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:m()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return l===void 0?(0,I.jsxs)(I.Fragment,{children:[d,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:f()})]}):l.length===0?(0,I.jsxs)(I.Fragment,{children:[d,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:b()})]}):(0,I.jsxs)(I.Fragment,{children:[d,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(u.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(Y,{config:e,series:u.get(e.metric)??[]},e.metric))})]},e):null})]})}function J({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(P,{value:e,onChange:t})})}function Y({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,i=n?n.value:0;return(0,I.jsxs)(M,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(j,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(k,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&i>0?` oc-kpi__value--error`:``),children:Q(i)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(ae,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:r({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:S()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:h({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":o({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{q as KpiTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,$j as i,A as a,Ak as o,Ck as s,Dk as c,E as l,Ek as u,F as d,Fk as f,G as p,Gj as ee,I as te,Ik as ne,Jj as re,Kj as ie,L as ae,M as oe,Mk as se,N as ce,Nk as m,Ok as h,P as g,Pk as le,QO as ue,Qj as de,Sk as fe,Tk as pe,Wj as me,X as he,XO as _,Xj as v,Xx as y,YO as b,Yj as x,Z as S,ZO as C,Zj as w,_M as T,_k as E,ak as D,bk as O,cM as k,ck as A,dk as j,eM as M,ek as N,fk as P,gM as F,gk as I,hk as L,ik as R,j as ge,jk as _e,kk as ve,lk as ye,mk as be,n as z,nk as B,ok as xe,pk as Se,qj as Ce,rM as we,rk as Te,sk as Ee,tk as De,uk as V,vk as Oe,wk as ke,xk as Ae,yk as je}from"./dist-BTpttlbH.js";import{t as H}from"./button-B4Nos6AU.js";import{A as Me,C as Ne,S as U,b as Pe,bt as Fe,ct as W,lt as G,p as K,vt as Ie,w as Le,x as Re,xt as q,yt as ze,z as Be}from"./index-GIhUlE6M.js";import{t as Ve}from"./localePickerView-C2RmOS86.js";var J=t(e(),1),Y=n();function He({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,Y.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:z(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-colors outline-none`,`focus-visible:ring-2 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-input`,e),...i,children:(0,Y.jsx)(`span`,{className:z(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var X=[{id:`messages`,label:()=>ne()},{id:`composer`,label:()=>f()},{id:`sidebar`,label:()=>le()},{id:`notifications`,label:()=>L()},{id:`other`,label:()=>m()}],Z={showSource:{category:`messages`,label:()=>se(),help:()=>_e()},showReport:{category:`messages`,label:()=>o(),help:()=>ve()},copyAssistant:{category:`messages`,label:()=>h()},copyUser:{category:`messages`,label:()=>c()},showDelete:{category:`messages`,label:()=>u()},showTools:{category:`messages`,label:()=>pe(),help:()=>ke()},voiceInput:{category:`composer`,label:()=>s(),help:()=>fe()},showUsage:{category:`composer`,label:()=>Ae(),help:()=>O()},autoReadAloud:{category:`composer`,label:()=>S(),help:()=>he()},showChatAge:{category:`sidebar`,label:()=>je(),help:()=>Oe()},showChatProvider:{category:`sidebar`,label:()=>E(),help:()=>I()},notifSound:{category:`notifications`,label:()=>be(),help:()=>Se()},notifSystem:{category:`notifications`,label:()=>P(),help:()=>j()},replySound:{category:`notifications`,label:()=>V(),help:()=>ye()}};function Q(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Ue(e,t){let n=Q(t.trim()),r=new Map(X.map(e=>[e.id,e.label()])),i=new Map(X.map(e=>[e.id,[]]));for(let t of e){let e=Z[t],a=e?.category??`other`;n&&!Q(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return X.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var We=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],Ge={voiceInput:`voiceInput`};function Ke(e){return We.includes(e)}function $(e){return e===`admin`}function qe(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Je(e){return e===`on`?!0:e===`off`?!1:null}function Ye(e){return Ke(e)?Ge[e]:void 0}var Xe={voiceInput:()=>r()};function Ze({prefKey:e,ui:t}){let n=F(l.admin.setUiPrefDefault),r=F(l.admin.setFeatureEnabled),i=Ye(e),a=i?Xe[e]?.():void 0;return(0,Y.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,Y.jsx)(`span`,{className:`oc-prefs__gov-label`,children:Te()}),(0,Y.jsxs)(Pe,{value:qe(t.defaults[e]),onValueChange:t=>void n({key:e,value:Je(t)}),children:[(0,Y.jsx)(Ne,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(Le,{})}),(0,Y.jsxs)(Re,{children:[(0,Y.jsx)(U,{value:`on`,children:C()}),(0,Y.jsx)(U,{value:`off`,children:_()}),(0,Y.jsx)(U,{value:`inherit`,children:b()})]})]}),i?(0,Y.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,Y.jsx)(K,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":B()}),B()]}):null]}),a?(0,Y.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function Qe({current:e,enabled:t}){let n=F(l.me.setDictationShortcut),[r,i]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=ze(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(s(!0),window.setTimeout(()=>s(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,Y.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,Y.jsxs)(`span`,{className:`oc-prefs__label`,children:[ae(),e?(0,Y.jsx)(W,{variant:`secondary`,children:Fe(e,Ie())}):null]}),(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:o?g():r?d():te()})]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:a()}):null,(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?ge():e?oe():ce()})]})]})}function $e(){let[e,t]=(0,J.useState)(``),[n,r]=(0,J.useState)(!1),i=T(l.me.getMe,{host:q}),a=i?.ui,o=$(i?.role)&&n,s=F(l.me.setUiPref).withOptimisticUpdate(Me),c=(0,J.useMemo)(()=>a?Ue(Object.keys(a.effective),e):[],[a,e]);return a?(0,Y.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(i?.role)?(0,Y.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,Y.jsx)(K,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":R()}),R()]}):null,o?(0,Y.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,Y.jsx)(`p`,{children:De()}),(0,Y.jsx)(`p`,{children:N()}),(0,Y.jsx)(`p`,{children:ue()})]}):null,(0,Y.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:A(),"aria-label":A(),className:`mb-2`}),c.length===0?(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:Ee()}):(0,Y.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,Y.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,Y.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Z[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,Y.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,Y.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,Y.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,Y.jsx)(W,{variant:`outline`,children:xe()}):l?(0,Y.jsx)(W,{variant:`secondary`,children:p()}):null]}),r?(0,Y.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,Y.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,Y.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:D()}):null,(0,Y.jsx)(He,{checked:c,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),s({key:e,value:t})},"aria-label":n})]}),o?(0,Y.jsx)(Ze,{prefKey:e,ui:a}):null]},e)})]},e.id))}),(0,Y.jsx)(Qe,{current:i?.dictationShortcut??null,enabled:a.effective.voiceInput===!0})]}):(0,Y.jsx)(`div`,{className:`oc-prefs__empty`,children:k()})}function et(){let e=T(l.me.getMe,{host:q}),t=F(l.me.setLocale),n=F(l.me.setMyName),r=Be(),a=e?.locale??`default`,o=e?.name??``,[s,c]=(0,J.useState)(null),u=s??o,d=u.trim()!==o.trim();async function f(){try{await n({name:u}),c(null),r.success(v())}catch(e){r.error(x(),e)}}return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:M()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(G,{className:`max-w-xs`,value:u,maxLength:120,placeholder:de(),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d&&(e.preventDefault(),f())}}),(0,Y.jsx)(H,{size:`sm`,disabled:!d,onClick:()=>void f(),children:y()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:w()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:re()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ce()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[Ve().map(e=>(0,Y.jsx)(H,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,Y.jsx)(H,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:we()})]}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ie()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:ee()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,Y.jsx)($e,{})]})]})}export{et as PreferencesTab};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,$t as i,E as a,Eg as o,Qt as s,Tg as c,Zt as l,_M as u,_g as d,_r as f,aa as p,ag as m,br as h,cg as g,dg as _,eg as v,fg as y,gM as ee,gg as b,gr as x,hg as S,ia as C,ig as w,lg as T,mg as E,na as D,ng as te,og as O,pg as ne,ra as re,rg as ie,sg as ae,ta as k,tg as A,ug as j,vg as M,vr as N,xr as P,yr as F}from"./dist-BTpttlbH.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as H,u as U}from"./FieldLabel-pNGSpfk-.js";import{t as W}from"./button-B4Nos6AU.js";import{C as G,S as K,b as q,p as J,w as Y,x as X,xt as oe,z as se}from"./index-GIhUlE6M.js";import{r as Z,t as ce}from"./locales-CPjguROj.js";import{t as le}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),ue={media_delivery:{label:ne,help:y},documentary_fetch:{label:_,help:j},inbound_files:{label:T,help:g},history_summary:{label:p,help:C},file_curation:{label:P,help:h}},de={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
-
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
|
-
Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
|
|
4
|
-
- [Fait 1](fait-1.md) - note du projet`},fe={outboundDir:A,references:v,files:r,previous_summary:re,new_messages:D,max_chars:k,file_name:F,budget_chars:N,feedback:f,content:x};function pe(){let e=u(a.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:O()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(B,{label:M(),help:d()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:ae()}),(0,$.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsx)(X,{children:e.map(e=>(0,$.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=ee(a.admin.upsertInstanceConfig),n=se(),r=u(a.me.getMe,{host:oe}),d=e.config??{},f=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[p,m]=(0,Q.useState)(()=>R(d,f));(0,Q.useEffect)(()=>{m(R(d,f))},[f,e._id]);let[h,g]=(0,Q.useState)(!1),_=p.promptInjections,v=(e,t)=>m({...p,promptInjections:{..._,[e]:{..._[e],...t}}});async function y(){g(!0);try{await t({instanceId:e._id,config:V(p,d,f)})}catch(e){n.error(c(),e)}finally{g(!1)}}async function b(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(c(),e)}}let x=e.config?.contentLocale??`default`,S=ce[Z(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:i()}),(0,$.jsxs)(q,{value:x,onValueChange:e=>void b(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(Y,{})}),(0,$.jsxs)(X,{children:[(0,$.jsx)(K,{value:`default`,children:l({locale:S})}),le().map(e=>(0,$.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:s()})]}),U.map(e=>(0,$.jsx)(he,{injKey:e,def:z[e],i18n:ue[e],row:_[e]??{enabled:!0,template:z[e].defaultTemplate[f]},contentLocale:f,onChange:t=>v(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(W,{size:`sm`,onClick:()=>void y(),disabled:h,children:o()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,s]=(0,Q.useState)(!1),c=r.template.trim()!==t.defaultTemplate[i],l=t.togglable&&!r.enabled,u=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),d=I(e,r,i),f=d?L(d,u):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(J,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,$.jsx)(B,{label:n.label(),help:n.help()})]}):(0,$.jsx)(B,{label:n.label(),help:n.help()}),c&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:S()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:l,rows:8,spellCheck:!1,onChange:e=>a({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:E()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(H,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?w():m()}),c&&(0,$.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:b()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:f}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:ie()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:te()})})]})}export{pe as PromptInjectionsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$y as r,Ay as i,By as a,Dy as o,E as s,Ey as c,Gr as l,Gy as u,Hy as d,Jy as f,Ky as p,My as m,Ny as h,Oy as ee,Qy as te,Ty as ne,Uy as re,Vy as g,Wy as _,Xy as v,Yy as y,Zy as b,_M as x,ab as S,cb as C,db as w,eb as ie,fb as T,gM as E,ib as D,jy as O,ky as k,lb as A,mb as j,nb as M,ob as N,pb as P,qy as F,rb as I,sb as L,tb as R,ub as z,zy as ae}from"./dist-BTpttlbH.js";import{t as B}from"./button-B4Nos6AU.js";import{B as V,Rt as H,ct as U,lt as W,p as G,u as K,z as q}from"./index-GIhUlE6M.js";import{t as J}from"./roleDescriptions-8ML7Rdme.js";var Y=t(e(),1),X=n(),Z=[{group:()=>j(),keys:[{key:`traces.read`,label:()=>A()},{key:`traces.read.content`,label:()=>C(),phi:!0},{key:`traces.write`,label:()=>L()}]},{group:()=>P(),keys:[{key:`kpi.read`,label:()=>A()},{key:`kpi.write`,label:()=>L()}]},{group:()=>T(),keys:[{key:`openclaw.query`,label:()=>N()},{key:`anomalies.read`,label:()=>S()},{key:`anomalies.report`,label:()=>D()}]},{group:()=>w(),keys:[{key:`chats.read`,label:()=>A()},{key:`selfheal`,label:()=>M()},{key:`feedback.respond`,label:()=>l()}]},{group:()=>z(),keys:[{key:`admin.manage`,label:()=>I()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=x(s.apiKeys.listRoles,{}),t=E(s.apiKeys.createRole),n=E(s.apiKeys.ensureRolesSeeded),l=E(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))}),S=V(),C=q(),[w,T]=(0,Y.useState)(!1),[D,A]=(0,Y.useState)($),[j,M]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{C.error(ie(),e)})},[n,C]);let N=e??[];async function P(e,t){if(Q(e.permissions)||j.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await S({title:r({name:e.name}),description:te(),confirmLabel:b()}))){M(t=>new Set(t).add(e._id));try{await l({roleId:e._id,permissions:n})}catch(e){C.error(v(),e)}finally{M(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function I(){try{await t({key:D.key,name:D.name,description:D.description||void 0,permissions:[]}),A($),T(!1)}catch(e){C.error(y(),e)}}let L=e===void 0,z=!L&&N.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[f(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,F(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,p()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:u()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{A($),T(!0)},children:_()})})]}),L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:re()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:g()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?R({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:N.map(e=>{let t=Q(e.permissions),n=j.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(U,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,a()]}):(0,X.jsx)(U,{variant:`secondary`,children:ae()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),oe.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(G,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?h():n?m():r,onCheckedChange:()=>void P(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(K,{open:w,onOpenChange:T,title:O(),description:i(),canSubmit:!!(D.key&&D.name),onSubmit:I,submitLabel:k(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ee()}),(0,X.jsx)(W,{value:D.key,placeholder:o(),onChange:e=>A({...D,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,X.jsx)(W,{value:D.name,onChange:e=>A({...D,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ne()}),(0,X.jsx)(W,{value:D.description,onChange:e=>A({...D,description:e.target.value})})]})]})})]})}export{se as RolesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,AD as i,AO as ee,BD as a,BO as te,CO as ne,DO as re,E as o,EO as ie,FD as s,FO as ae,GD as c,GO as oe,HD as l,HO as u,ID as d,IO as se,JD as f,JO as ce,KD as p,KO as le,LD as m,LO as ue,MD as h,MO as de,ND as g,NO as fe,OD as pe,OO as me,PD as he,PO as ge,QD as _e,RD as _,RO as ve,SO as ye,TO as be,UD as v,UO as y,VD as b,VO as xe,WD as x,WO as Se,XD as S,YD as C,ZD as w,_M as T,_O as Ce,aO as we,bO as Te,cO as Ee,dO as De,eO as Oe,fO as ke,gM as E,gO as Ae,hO as je,iO as Me,jD as D,jO as Ne,kD as O,kO as Pe,lO as Fe,mM as Ie,mO as Le,nO as Re,oO as ze,pO as Be,qD as k,qO as Ve,rO as He,sO as Ue,tO as We,uO as Ge,vO as Ke,wO as qe,xO as Je,yO as Ye,zD as A,zO as Xe}from"./dist-BTpttlbH.js";import{n as j}from"./dist-BzsC63K9.js";import{i as Ze}from"./dist-BwHHVs_B.js";import{t as M}from"./button-B4Nos6AU.js";import{$ as N,B as Qe,C as P,S as F,Wt as I,Xt as $e,Yt as et,b as L,ct as R,dt as z,et as B,ft as V,ht as H,lt as U,mt as tt,pt as nt,qt as rt,u as it,ut as W,w as G,x as K,z as at}from"./index-GIhUlE6M.js";import{t as ot}from"./FilterBar-DlPympG5.js";import{t as st}from"./DataTableShell-HZGBUlvm.js";import{t as ct}from"./roleDescriptions-8ML7Rdme.js";var q=t(e(),1),J=n(),Y=[{value:`never`,label:()=>he(),days:null},{value:`30`,label:()=>g(),days:30},{value:`90`,label:()=>h(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=$e({from:`/settings/serviceAccounts`}),t=et({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??Z,[a,s]=(0,q.useState)(Z),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),d=T(o.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===Z?void 0:a,disabled:i===Z?void 0:i===`disabled`}}),f=T(o.apiKeys.listKeys,{}),p=T(o.apiKeys.listRoles,{}),m=E(o.apiKeys.createServiceAccount),h=E(o.apiKeys.updateServiceAccount),g=E(o.apiKeys.deleteServiceAccount),pe=Ie(o.apiKeys.mintApiKey),he=E(o.apiKeys.revokeApiKey),_=Qe(),v=at(),b=n!==``||a!==Z||i!==Z;function x(){s(Z),t({search:{},replace:!0})}let[S,C]=(0,q.useState)(!1),[w,D]=(0,q.useState)(Q),[O,k]=(0,q.useState)(null),[A,j]=(0,q.useState)(new Set),[N,I]=(0,q.useState)(null),z=(0,q.useRef)(!1),[B,V]=(0,q.useState)(new Set),[H,tt]=(0,q.useState)({}),[nt,W]=(0,q.useState)(null),X=(0,q.useMemo)(()=>{let e=new Map;for(let t of f??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[f]);function $(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{O?(await h({serviceAccountId:O,name:w.name,roleKey:w.roleKey,description:w.description}),v.success(ke())):await m({name:w.name,roleKey:w.roleKey,description:w.description||void 0}),D(Q),k(null),C(!1)}catch(e){v.error(O?Be():Le(),e)}}function ft(e){D({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),C(!0)}async function pt(e){if(z.current)return;z.current=!0;let t=H[e._id]??`never`,n=Y.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await pe({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){v.error(De(),e)}finally{z.current=!1,I(null)}}async function mt(e){if(await _({title:Ge(),description:(0,J.jsxs)(J.Fragment,{children:[Fe(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ee(),` `,(0,J.jsx)(`strong`,{children:Ue()}),` `,ze()]}),confirmWord:e.name,confirmLabel:we(),destructive:!0}))try{await g({serviceAccountId:e._id}),v.success(Me(),e.name)}catch(e){v.error(He(),e)}}async function ht(e){if(await _({title:Re(),description:(0,J.jsxs)(J.Fragment,{children:[We(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Oe()]}),confirmLabel:r(),destructive:!0})&&!B.has(e._id)){V(t=>new Set(t).add(e._id));try{await he({keyId:e._id})}catch(e){v.error(_e(),e)}finally{V(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ce()}),(0,J.jsxs)(ot,{q:n,onQChange:c,searchPlaceholder:Ve(),onReset:x,canReset:b,children:[(0,J.jsxs)(L,{value:a,onValueChange:s,children:[(0,J.jsx)(P,{size:`sm`,className:`w-40`,children:(0,J.jsx)(G,{placeholder:le()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(F,{value:Z,children:oe()}),(p??[]).map(e=>(0,J.jsx)(F,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(L,{value:i,onValueChange:l,children:[(0,J.jsx)(P,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(F,{value:Z,children:Se()}),(0,J.jsx)(F,{value:`active`,children:y()}),(0,J.jsx)(F,{value:`disabled`,children:u()})]})]})]}),(0,J.jsx)(st,{title:xe(),rows:d,addLabel:te(),onAdd:()=>{D(Q),k(null),C(!0)},emptyHint:Xe(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:B}),rowActions:e=>[{label:ae(),onSelect:()=>ft(e)},{label:ve(),onSelect:()=>void pt(e)},{label:A.has(e._id)?ue():se(),onSelect:()=>$(e._id)},{label:ge(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?fe():de(),onClick:()=>$(e._id),children:A.has(e._id)?(0,J.jsx)(Ze,{}):(0,J.jsx)(rt,{})})},{header:Ne(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:ee(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Pe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(R,{variant:`destructive`,children:u()}):(0,J.jsx)(R,{variant:`outline`,children:y()})},{header:me(),cell:e=>(0,J.jsxs)(L,{value:H[e._id]??`never`,onValueChange:t=>tt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(P,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{})}),(0,J.jsx)(K,{children:Y.map(e=>(0,J.jsx)(F,{value:e.value,children:e.label()},e.value))})]})},{header:re(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?ie():be({count:t})})}}]}),(0,J.jsx)(it,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:O?qe():Je(),description:O?ne():Te(),canSubmit:!!(w.name&&w.roleKey),onSubmit:dt,submitLabel:O?ye():Ye(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:Ke()}),(0,J.jsx)(U,{value:w.name,onChange:e=>D({...w,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:Ce()}),(0,J.jsxs)(L,{value:w.roleKey||void 0,onValueChange:e=>D({...w,roleKey:e}),children:[(0,J.jsx)(P,{className:`w-full`,children:(0,J.jsx)(G,{placeholder:Ae()})}),(0,J.jsx)(K,{children:(p??[]).map(e=>(0,J.jsxs)(F,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(p??[]).find(e=>e.key===w.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:je()}),(0,J.jsx)(U,{value:w.description,onChange:e=>D({...w,description:e.target.value})})]})]})}),(0,J.jsx)(ut,{minted:nt,onClose:()=>W(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[w(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:C()}),(0,J.jsx)(`th`,{children:f()}),(0,J.jsx)(`th`,{children:k()}),(0,J.jsx)(`th`,{children:p()}),(0,J.jsx)(`th`,{children:c()}),(0,J.jsx)(`th`,{children:x()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:B(t.createdAt)}),(0,J.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:pt(t.expiresAt)}),(0,J.jsx)(`td`,{children:mt(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?v():l()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(W,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(z,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(tt,{children:[(0,J.jsx)(H,{children:b()}),(0,J.jsx)(V,{children:a({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:A()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":_(),children:[n?(0,J.jsx)(j,{}):(0,J.jsx)(I,{}),n?m():d()]})]}),(0,J.jsx)(nt,{children:(0,J.jsx)(M,{onClick:()=>{r(!1),t()},children:s()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?D():B(e)}function pt(e){return e===null?`—`:N(e)}function mt(e){return e.disabled?(0,J.jsx)(R,{variant:`destructive`,children:i()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(R,{variant:`outline`,children:O()}):(0,J.jsx)(R,{variant:`outline`,children:pe()})}export{$ as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aa as r,Ba as i,Ca as a,Da as o,E as s,Ea as c,Fa as l,Ga as u,Ha as d,Ia as f,Ja as p,Ka as m,La as h,Ma as g,Na as _,Oa as v,Pa as y,Ra as b,Sa as x,Ta as S,Ua as C,Va as w,Wa as T,_M as E,_a as D,ba as O,da as k,fa as A,gM as j,ga as M,ha as N,ja as P,ka as F,ma as I,pa as L,qa as ee,ua as R,va as z,wa as B,xa as V,ya as H,za as U}from"./dist-BTpttlbH.js";import{t as W}from"./button-B4Nos6AU.js";import{B as G,et as K}from"./index-GIhUlE6M.js";import{t as q}from"./DataTableShell-HZGBUlvm.js";var J=t(e(),1),Y=n(),X={hung:()=>P(),wrong_result:()=>r(),error:()=>F(),other:()=>v()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=j(s.subAgentReports.respondToReport),[r,i]=(0,J.useState)(e.thread),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1);async function p(){let t=l.trim();if(!(!t||d)){f(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{f(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,o({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:c()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:S()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?B():a()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:x()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:V(),value:l,maxLength:2e3,rows:3,onChange:e=>u(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void p(),disabled:!l.trim()||d,children:d?H():O()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[z({count:t.children.length}),t.childrenTruncated?` ${D()}`:``,t.textTruncated?` ${M()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${N()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:I()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:L()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=E(s.subAgentReports.listForAdmin,{}),t=j(s.subAgentReports.readReport),n=j(s.subAgentReports.deleteReport),r=G(),[a,o]=(0,J.useState)(null),[c,v]=(0,J.useState)({});async function x(e){if(a===e._id){o(null);return}if(!c[e._id]){let n=await t({reportId:e._id});v(t=>({...t,[e._id]:n}))}o(e._id)}async function S(e){await r({title:A(),description:k(),confirmLabel:R(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&o(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[m(),` `,(0,Y.jsx)(`strong`,{children:u()}),` `,T()]}),(0,Y.jsx)(q,{title:p(),rows:e,emptyHint:ee(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:C(),cell:e=>K(e.at),sort:e=>e.at},{header:d(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:w(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:i(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${h({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:U(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:b(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:f()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:l()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?_():y(),onSelect:()=>void x(e)},{label:g(),onSelect:()=>void S(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,$k as i,AA as a,BA as o,Bk as s,CA as c,D as l,DA as u,E as d,EA as f,FA as p,GA as m,Gk as h,HA as g,Hk as _,IA as v,JA as y,Jk as ee,KA as te,Kk as ne,LA as re,Lk as ie,MA as ae,NA as oe,OA as se,PA as ce,QA as le,Qk as ue,RA as de,Rk as fe,SA as b,TA as pe,UA as me,Uk as he,VA as ge,Vk as x,WA as _e,Wk as ve,XA as ye,Xk as be,YA as S,Yk as xe,ZA as Se,Zk as Ce,_A as we,_M as C,aA as Te,aM as Ee,aj as De,bA as Oe,cA as ke,ca as w,dA as Ae,eA as je,ej as Me,fA as Ne,gA as Pe,gM as T,hA as Fe,iA as Ie,iM as Le,ij as Re,jA as ze,kA as Be,lA as Ve,la as E,mA as He,mM as Ue,n as We,nA as Ge,nj as Ke,oA as qe,oM as Je,oa as Ye,pA as Xe,qA as Ze,qk as Qe,rA as D,rj as $e,sA as et,sa as tt,tA as nt,tj as rt,uA as it,vA as at,wA as ot,xA as st,yA as ct,zA as lt,zk as ut}from"./dist-BTpttlbH.js";import{n as O}from"./dist-BzsC63K9.js";import{t as dt}from"./x-BLHWZzIt.js";import{t as k}from"./button-B4Nos6AU.js";import{C as A,Ht as j,S as M,Ut as ft,_t as pt,at as mt,b as N,ct as P,gt as ht,it as F,lt as I,nt as gt,ot as L,p as R,rt as _t,st as vt,w as z,x as B,xt as V}from"./index-GIhUlE6M.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-DhM6Y5He.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-BBE4oFvW.js";import{t as kt}from"./TimeRangePicker-Cm5l2vkz.js";import{t as At}from"./FilterBar-DlPympG5.js";import{t as jt}from"./AdvancedFilter-Bw_6N4Fp.js";var G=l(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(qe());if(e.size>zt)throw Error(Te());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(D());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(D());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(Ge());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(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 Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?Je():e===`dark`?Ee():Le()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:We(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(O,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":E(),title:E(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=C(d.charts.listMyCharts),r=T(d.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:S(),subtitle:y(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?Ze():n.via===`owner`?te():m({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()}):null]})}function Qt(){let e=T(d.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[l,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1);async function g(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),p(!1);try{i(await t.text())}catch{s(b())}}}async function _(){if(s(null),p(!1),t.trim()===``){s(Oe());return}let a;try{a=JSON.parse(r)}catch{s(b());return}h(!0);try{await e({name:t.trim(),tokens:a}),p(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{h(!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:a()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(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:se()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:u(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:f()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:pe(),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`}),ot(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void g(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:m,onClick:()=>void _(),children:c()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,l?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:st()}):null]})]})}function $t({chart:e}){let t=Ue(d.charts.setChartLogo),n=T(d.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Xe():Ne()}),(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?it():Ae(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:ke()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ve()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:He()}),(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:et()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=C(d.me.getMe,{host:V}),n=T(d.charts.addChartDomain),r=T(d.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let f=e.domains??[];async function p(){let t=a.trim();if(t!==``){c(null),u(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}}async function m(t){c(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:nt()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:f.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ce()}):f.map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":be({domain:e}),onClick:()=>void m(e),children:(0,X.jsx)(dt,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:a,onChange:e=>o(e.target.value),placeholder:i(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void p(),children:ue()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:je()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=T(d.charts.updateChart),n=T(d.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[s,c]=(0,K.useState)(()=>tn(e.tokens)),[l,u]=(0,K.useState)(e.tokens.bpm??0),[f,p]=(0,K.useState)(null),[m,g]=(0,K.useState)(!1);function _(){o(e.name),c(tn(e.tokens)),u(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(s)}catch{p(b());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;l>0?e.bpm=l:delete e.bpm}g(!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{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:_,children:Pe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Fe()})]})})]}),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:Qe()}),(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:w()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:l,onChange:e=>u(Number(e.target.value)),"aria-label":w()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:l===0?tt():`${l} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ye()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ne()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:s,onChange:e=>c(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 v(),children:xe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:ee()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=C(d.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ct()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:we()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=T(d.charts.addChartToGroupPool),r=T(d.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?v():e.kind===`custom`&&e.scope===`personal`?x():re()}),e.isGlobalDefault?(0,X.jsx)(P,{variant:`default`,children:p()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:oe()}),(a??[]).map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ze({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(dt,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(N,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(z,{placeholder:ae()})}),(0,X.jsx)(B,{children:s.map(e=>(0,X.jsx)(M,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}):null]})]})}function on({chart:e}){let t=T(d.charts.promoteChartToCommon),n=T(d.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(h()))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)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?s():x()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:_({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:ut()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:fe()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let i=T(d.admin.setDefaultThemeMode),a=T(d.admin.setDefaultLocale),s=T(d.charts.setDefaultChart),c=C(d.charts.listChartsAdmin),l=C(d.groups.listGroups,{}),u=e??`system`,f=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:r()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:le()})]}),(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:me()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:g()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void s({name:null}),children:S()}),pt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({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 s({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:ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:l??[]},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:lt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(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)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ie()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:De()}),(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:u===e?`default`:`outline`,size:`sm`,onClick:()=>void i({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:$e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:f===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]})]})}function cn(){let e=C(d.me.getMe,{host:V}),t=ht(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:Me()}),(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)(j,{})}),(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)(P,{children:`Default`}),(0,X.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(P,{variant:`outline`,children:`Outline`}),(0,X.jsx)(P,{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)(N,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(z,{placeholder:`Select…`})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(M,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(R,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(N,{value:o,onValueChange:s,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes directions`}),(0,X.jsx)(M,{value:`inbound`,children:`inbound`}),(0,X.jsx)(M,{value:`outbound`,children:`outbound`}),(0,X.jsx)(M,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(N,{value:c,onValueChange:l,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(z,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(M,{value:`info`,children:`info`}),(0,X.jsx)(M,{value:`warn`,children:`warn`}),(0,X.jsx)(M,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(gt,{children:[(0,X.jsx)(vt,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(j,{})})}),(0,X.jsxs)(_t,{align:`start`,children:[(0,X.jsx)(mt,{children:`Actions`}),(0,X.jsx)(L,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(L,{}),(0,X.jsx)(F,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(R,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(R,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(P,{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)(j,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
|