@lacneu/atrium 0.62.1 → 0.63.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-CAsqZ6Oe.js +1 -0
- package/dist/assets/AdvancedFilter-CAZse6g9.js +1 -0
- package/dist/assets/{AgentFilesTab-C5GaYQ_Y.js → AgentFilesTab-BRgTx-O-.js} +2 -2
- package/dist/assets/AnomaliesTab-QOz38Dl8.js +1 -0
- package/dist/assets/AuditTab-a5iD6OvB.js +1 -0
- package/dist/assets/BridgeTab-De8R_lT4.js +1 -0
- package/dist/assets/ChatDefaultsTab-BOt-jkMY.js +1 -0
- package/dist/assets/DataTableShell-NMYUihjL.js +1 -0
- package/dist/assets/DetailChips-2kEsgn1k.js +1 -0
- package/dist/assets/FeedbacksTab-CdqQtSm1.js +1 -0
- package/dist/assets/{FieldLabel-B4QPoUJd.js → FieldLabel-C647EVei.js} +2 -2
- package/dist/assets/FilesTab-DKocgIqP.js +1 -0
- package/dist/assets/FilterBar-DHVMse_G.js +1 -0
- package/dist/assets/GroupsTab-CBVya3O8.js +1 -0
- package/dist/assets/InstancesTab-DaFyjZeq.js +1 -0
- package/dist/assets/IntegrationsTab-s2Ug2twA.js +1 -0
- package/dist/assets/KpiTab-Bxe5EM3h.js +1 -0
- package/dist/assets/PreferencesTab-D150a7hV.js +1 -0
- package/dist/assets/ProjectPage-BvCAGro7.js +1 -0
- package/dist/assets/ProjectPage-LzMKBi2V.css +1 -0
- package/dist/assets/PromptInjectionsTab-DcP-BjeV.js +4 -0
- package/dist/assets/RolesTab-DgNPzDM1.js +1 -0
- package/dist/assets/ScheduledTab-xwd7u-vS.js +1 -0
- package/dist/assets/ServiceAccountsTab-BPH6depc.js +1 -0
- package/dist/assets/SubAgentReportsTab-BPYm-SSC.js +1 -0
- package/dist/assets/ThemeShowroom-DfNiNZX7.js +1 -0
- package/dist/assets/TimeRangePicker-Dtw6LWMh.js +1 -0
- package/dist/assets/TracesTab-yLnuqGC_.js +1 -0
- package/dist/assets/UsersTab-CopN-6p5.js +1 -0
- package/dist/assets/VoiceTab-C0oik6ML.js +1 -0
- package/dist/assets/{button-Ew8nYfum.js → button-Bz9USCnz.js} +1 -1
- package/dist/assets/{card-DsVS4SLV.js → card-DKADL750.js} +1 -1
- package/dist/assets/check-Wm4Ks3tL.js +1 -0
- package/dist/assets/chevron-up-BFinjgRw.js +1 -0
- package/dist/assets/chevrons-up-down-DKu9IjDi.js +1 -0
- package/dist/assets/{compatView-DIxFDrmB.js → compatView-BHdx-XYA.js} +1 -1
- package/dist/assets/confTabs-hdeEtaLm.css +1 -0
- package/dist/assets/{dispatchErrorInfo-Bk3nl1aq.js → dispatchErrorInfo-oI5p4wEL.js} +1 -1
- package/dist/assets/dist-DiGkpPjG.js +1 -0
- package/dist/assets/dist-_9JGogtQ.js +44 -0
- package/dist/assets/{dist-ByfMfLx3.js → dist-xYoBFyN7.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CmRSAAz2.js → highlighted-body-OFNGDK62-DSCsm23K.js} +1 -1
- package/dist/assets/index-CjUx3yzx.css +1 -0
- package/dist/assets/index-DIc5ekpE.js +238 -0
- package/dist/assets/mermaid-GHXKKRXX-BsmnBvV3.js +1 -0
- package/dist/assets/{pdf-D5NQzcmE.js → pdf-D0Fddibm.js} +1 -1
- package/dist/assets/roleDescriptions-5AP7N2O_.js +1 -0
- package/dist/assets/{table-C4Hh9u_l.js → table-C8QBboJq.js} +1 -1
- package/dist/assets/{tabs-0D2gasCk.js → tabs-DSFq9Jhc.js} +1 -1
- package/dist/assets/x-CfJhGjMr.js +1 -0
- package/dist/index.html +9 -8
- package/package.json +1 -1
- package/dist/assets/AccessTab--VqMu03T.js +0 -1
- package/dist/assets/AdvancedFilter-D6zd0L5Q.js +0 -1
- package/dist/assets/AnomaliesTab-CEpTxqcV.js +0 -1
- package/dist/assets/AuditTab-DgKezBIz.js +0 -1
- package/dist/assets/BridgeTab-Db3Fo_mk.js +0 -1
- package/dist/assets/ChatDefaultsTab-Du2XiR61.js +0 -1
- package/dist/assets/DataTableShell-DMFVXfOQ.js +0 -1
- package/dist/assets/DetailChips-Cv722Djz.js +0 -1
- package/dist/assets/FeedbacksTab-CDhunzCw.js +0 -1
- package/dist/assets/FilesTab-Bdn4Tvqv.js +0 -1
- package/dist/assets/FilterBar-BaqVZ-JQ.js +0 -1
- package/dist/assets/GroupsTab-CCESqSzH.js +0 -1
- package/dist/assets/InstancesTab-CWOk0g4N.js +0 -1
- package/dist/assets/IntegrationsTab-4LOj-Ni_.js +0 -1
- package/dist/assets/KpiTab-DsgCrpnk.js +0 -1
- package/dist/assets/PreferencesTab-D8vFStwH.js +0 -1
- package/dist/assets/PromptInjectionsTab-BfKhvZll.js +0 -4
- package/dist/assets/RolesTab-CiFKtKmf.js +0 -1
- package/dist/assets/ScheduledTab-Zw2o6w8y.js +0 -1
- package/dist/assets/ServiceAccountsTab-hb25MXEz.js +0 -1
- package/dist/assets/SubAgentReportsTab-Cwu-39cc.js +0 -1
- package/dist/assets/ThemeShowroom-BWdIRzrU.js +0 -1
- package/dist/assets/TimeRangePicker-Bv-U6Bo1.js +0 -1
- package/dist/assets/TracesTab-B00Q2CXy.js +0 -1
- package/dist/assets/UsersTab-4qigDhcD.js +0 -1
- package/dist/assets/VoiceTab-CliAEaTM.js +0 -1
- package/dist/assets/chevrons-up-down-jkl77XwS.js +0 -1
- package/dist/assets/confTabs-C35Io1ep.css +0 -1
- package/dist/assets/dist-Bk4bPGS8.js +0 -1
- package/dist/assets/dist-Bkkp8jtC.js +0 -44
- package/dist/assets/dist-CqLvr3pk.js +0 -1
- package/dist/assets/index-gP_wjUtq.js +0 -238
- package/dist/assets/index-jScX6cAP.css +0 -2
- package/dist/assets/mermaid-GHXKKRXX-eLH6oHko.js +0 -1
- package/dist/assets/roleDescriptions-CSbRqH5d.js +0 -1
- package/dist/assets/x-BqwVyymF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$x as e,Qx as t,Xx as n,Yx as r,Zx as i}from"./dist-_9JGogtQ.js";var a={pending:e,user:t,admin:i,observer:n,agent:r};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{E as n}from"./dist-
|
|
1
|
+
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n}from"./dist-_9JGogtQ.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{E as r,_ as i,d as a,l as o,m as s,t as c,u as l,v as u}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{E as r,_ as i,d as a,l as o,m as s,t as c,u as l,v as u}from"./dist-_9JGogtQ.js";import{t as d}from"./dist-DiGkpPjG.js";import{Gt as f,Kt as p,Wt as m}from"./index-DIc5ekpE.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=s(_,[p]),b=p(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:c=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=a({prop:r,onChange:i,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:o(),value:h,onValueChange:v,orientation:c,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":c,...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:a=!1,...o}=e,s=S(E,n),c=b(n),l=A(s.baseId,r),d=j(s.baseId,r),f=r===s.value;return(0,g.jsx)(m,{asChild:!0,...c,focusable:!a,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":a?``:void 0,disabled:a,id:l,...o,ref:t,onMouseDown:i(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(r):e.preventDefault()}),onKeyDown:i(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&s.onValueChange(r)}),onFocus:i(e.onFocus,()=>{let e=s.activationMode!==`manual`;!f&&!a&&e&&s.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=S(O,n),c=A(s.baseId,r),d=j(s.baseId,r),f=r===s.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(l,{present:i||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:r(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=c(`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:r(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:r(`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:r(`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-_9JGogtQ.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
|
@@ -62,15 +62,16 @@
|
|
|
62
62
|
document.documentElement.dataset.motion = "static";
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
|
-
<script type="module" crossorigin src="/assets/index-
|
|
65
|
+
<script type="module" crossorigin src="/assets/index-DIc5ekpE.js"></script>
|
|
66
66
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
|
|
67
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
68
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
73
|
-
<link rel="
|
|
67
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-_9JGogtQ.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-DiGkpPjG.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-xYoBFyN7.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/check-Wm4Ks3tL.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-up-BFinjgRw.js">
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/x-CfJhGjMr.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/button-Bz9USCnz.js">
|
|
74
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CjUx3yzx.css">
|
|
74
75
|
</head>
|
|
75
76
|
<body>
|
|
76
77
|
<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.63.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{Af as r,Cf as i,Df as a,Ef as o,Ff as s,Mf as c,Nf as l,Of as u,Pf as d,RF as f,Sf as p,T as m,Tf as h,jf as g,kF as _,kf as v,wf as y,xf as b}from"./dist-Bkkp8jtC.js";import{Y as x,ct as S,lt as C,ot as w,st as T,ut as E}from"./index-gP_wjUtq.js";var D=t(e(),1);function O(e){return e===`user`?h():e===`all`?y():i({group:e.group})}function k(e){return e===`common`?p():e===`owner`?b():i({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=f(m.admin.listUsers,{}),[t,n]=(0,D.useState)(``),i=f(m.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}),(0,A.jsxs)(w,{value:t,onValueChange:n,children:[(0,A.jsx)(C,{size:`sm`,"aria-label":d(),children:(0,A.jsx)(E,{placeholder:d()})}),(0,A.jsx)(T,{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:l()}):i===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(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:c()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:i.user.label}),(0,A.jsx)(x,{variant:`secondary`,children:i.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:g()}),i.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.groups.map(e=>(0,A.jsx)(x,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:r()}),i.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(x,{variant:`default`,children:o()}):null,(0,A.jsx)(x,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(x,{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:v()}),i.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(x,{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:u()}),i.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.permissions.map(e=>(0,A.jsx)(x,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Gm as r,Hm as i,Jm as a,Km as o,Um as s,Wm as c,qm as l}from"./dist-Bkkp8jtC.js";import{i as u}from"./dist-CqLvr3pk.js";import{t as d}from"./x-BqwVyymF.js";import{t as f}from"./button-Ew8nYfum.js";import{Bt as p,X as m,ct as h,lt as g,ot as _,st as v,ut as y}from"./index-gP_wjUtq.js";import{r as b}from"./TimeRangePicker-Bv-U6Bo1.js";var x=t(e(),1),S=n(),C=[{value:`eq`,label:`=`},{value:`neq`,label:`≠`},{value:`contains`,label:a()},{value:`gt`,label:`>`},{value:`gte`,label:`≥`},{value:`lt`,label:`<`},{value:`lte`,label:`≤`}],w=1;function T(){return{id:w++,field:``,op:`eq`,value:``}}function E(e){return e.map(e=>({id:w++,field:e.field,op:e.op,value:String(e.value)}))}function D({fields:e,seed:t,onChange:n}){let a=(0,x.useRef)(t),w=!!(a.current&&a.current.length>0),[D,O]=(0,x.useState)(w),[k,A]=(0,x.useState)(()=>w?E(a.current):[]);function j(e){n(e.filter(e=>e.field!==``&&e.value!==``).map(e=>({field:e.field,op:e.op,value:b(e.value)})))}function M(e,t){let n=k.map(n=>n.id===e?{...n,...t}:n);A(n),j(n)}function N(){A(e=>[...e,T()])}function P(e){let t=k.filter(t=>t.id!==e);A(t),j(t)}let F=k.filter(e=>e.field!==``&&e.value!==``).length;return(0,S.jsxs)(`div`,{className:`oc-advfilter`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`oc-advfilter__toggle`,"aria-expanded":D,onClick:()=>O(e=>!e),children:[(0,S.jsx)(u,{className:`oc-advfilter__chevron`+(D?` is-open`:``),"aria-hidden":!0}),l(),F>0?(0,S.jsx)(`span`,{className:`oc-advfilter__count`,children:F}):null]}),D?(0,S.jsxs)(`div`,{className:`oc-advfilter__body`,children:[k.length===0?(0,S.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(0,S.jsx)(`ul`,{className:`oc-advfilter__rows`,children:k.map(t=>(0,S.jsxs)(`li`,{className:`oc-advfilter__row`,children:[(0,S.jsxs)(_,{value:t.field||void 0,onValueChange:e=>M(t.id,{field:e}),children:[(0,S.jsx)(g,{size:`sm`,className:`w-40`,children:(0,S.jsx)(y,{placeholder:r()})}),(0,S.jsx)(v,{children:e.map(e=>(0,S.jsx)(h,{value:e.value,children:e.label},e.value))})]}),(0,S.jsxs)(_,{value:t.op,onValueChange:e=>M(t.id,{op:e}),children:[(0,S.jsx)(g,{size:`sm`,className:`w-28`,children:(0,S.jsx)(y,{})}),(0,S.jsx)(v,{children:C.map(e=>(0,S.jsx)(h,{value:e.value,children:e.label},e.value))})]}),(0,S.jsx)(m,{className:`oc-advfilter__value`,value:t.value,onChange:e=>M(t.id,{value:e.target.value}),placeholder:c()}),(0,S.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":s(),onClick:()=>P(t.id),children:(0,S.jsx)(d,{})})]},t.id))}),(0,S.jsxs)(f,{variant:`outline`,size:`sm`,className:`oc-advfilter__add`,onClick:N,children:[(0,S.jsx)(p,{}),i()]})]}):null]})}export{D as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,Ab as i,Bb as ee,Cb as a,Db as te,Eb as ne,Fb as o,Gb as re,Hb as ie,Ib as ae,Jb as oe,Kb as se,LF as s,Lb as c,Mb as l,Nb as u,Ob as d,Pb as f,Qb as p,RF as m,Rb as ce,Sb as le,T as h,Tb as ue,Ub as de,Vb as fe,Wb as pe,Xb as me,Yb as he,Zb as ge,_b as g,bb as _e,ex as ve,fb as _,gb as v,hb as y,ix as b,jb as x,kb as ye,mb as S,nx as C,pb as w,qb as T,rx as E,tx as D,vb as O,wb as k,xb as A,yb as j,zb as M}from"./dist-Bkkp8jtC.js";import{A as N,Q as P,V as be,Y as F,Z as I,ct as L,gt as xe,i as Se,in as Ce,lt as R,nt as z,o as we,ot as B,rn as V,st as H,tt as U,ut as W,wt as Te}from"./index-gP_wjUtq.js";import{n as Ee}from"./TimeRangePicker-Bv-U6Bo1.js";import{t as De}from"./FilterBar-BaqVZ-JQ.js";import{t as Oe}from"./DataTableShell-DMFVXfOQ.js";import{t as G}from"./dispatchErrorInfo-Bk3nl1aq.js";var K=t(e(),1),q=n(),J=`__all__`,ke=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Ae(e){return e===`open`?b():e===`acknowledged`?E():C()}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=Ce({from:`/settings/anomalies`}),t=V({from:`/settings/anomalies`}),n=e.q??``,g=e.status===Y?J:e.status,_=e.severity??J,v=e.kind??J,[y,b]=(0,K.useState)(J),S=Se(e.from,e.to),{from:C,to:w}=Ee(S),E=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),O=e=>void t({search:t=>({...t,status:e===J?Y:e})}),j=e=>void t({search:t=>({...t,severity:e===J?void 0:e})}),P=e=>void t({search:t=>({...t,kind:e===J?void 0:e})}),I=e=>void t({search:t=>({...t,...we(e)})}),z=N(),U=Te(),G=s(h.anomalies.resolveAnomaly),X=(m(h.me.getMe,{host:xe})?.permissions??[]).includes(`admin.manage`),Z=m(h.anomalies.listAnomalies,{limit:Pe,filter:{q:n||void 0,from:C,to:w,anomalyStatus:g===J?void 0:g,severity:_===J?void 0:_,source:y===J?void 0:y,kind:v===J?void 0:v}}),Q=(0,K.useMemo)(()=>{let e=new Set;for(let t of Z??[])e.add(t.kind);return[...e].sort()},[Z]),ze=n!==``||g!==`open`||_!==J||y!==J||v!==J||S.kind!==`relative`||S.from!==Ne.from;function Be(){b(J),t({search:{status:`open`},replace:!0})}async function Ve(e){if(await z({title:D(),description:(0,q.jsxs)(q.Fragment,{children:[ve(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,r(),` `,(0,q.jsx)(`strong`,{children:p()}),`.`,` `,ge()]}),confirmLabel:me()}))try{await G({anomalyId:e._id,status:`resolved`}),U.success(he(),e.kind)}catch(e){U.error(oe(),e)}}async function He(e){try{await G({anomalyId:e._id,status:`acknowledged`}),U.success(T(),e.kind)}catch(e){U.error(se(),e)}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`oc-admin__hint`,children:[re(),` `,(0,q.jsx)(`strong`,{children:pe()}),` `,de(),` `,(0,q.jsx)(`strong`,{children:ie()}),` `,fe(),` `,(0,q.jsx)(`strong`,{children:ee()}),` `,M(),` `,(0,q.jsx)(`span`,{className:`oc-filter__window`,children:ce()})]}),(0,q.jsxs)(De,{q:n,onQChange:E,searchPlaceholder:c(),timeRange:S,onTimeRangeChange:I,onReset:Be,canReset:ze,children:[(0,q.jsxs)(B,{value:g,onValueChange:O,children:[(0,q.jsx)(R,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{})}),(0,q.jsxs)(H,{children:[(0,q.jsx)(L,{value:J,children:ae()}),ke.map(e=>(0,q.jsx)(L,{value:e.value,children:Ae(e.value)},e.value))]})]}),(0,q.jsxs)(B,{value:_,onValueChange:j,children:[(0,q.jsx)(R,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{placeholder:o()})}),(0,q.jsxs)(H,{children:[(0,q.jsx)(L,{value:J,children:f()}),je.map(e=>(0,q.jsx)(L,{value:e,children:e},e))]})]}),(0,q.jsxs)(B,{value:y,onValueChange:b,children:[(0,q.jsx)(R,{size:`sm`,className:`w-32`,children:(0,q.jsx)(W,{placeholder:u()})}),(0,q.jsxs)(H,{children:[(0,q.jsx)(L,{value:J,children:l()}),Me.map(e=>(0,q.jsx)(L,{value:e,children:e},e))]})]}),(0,q.jsxs)(B,{value:v,onValueChange:P,children:[(0,q.jsx)(R,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{placeholder:x()})}),(0,q.jsxs)(H,{children:[(0,q.jsx)(L,{value:J,children:i()}),Q.map(e=>(0,q.jsx)(L,{value:e,children:e},e))]})]})]}),(0,q.jsx)(Oe,{title:ye(),rows:Z,emptyHint:g===`open`?d():te(),rowActions:e=>X&&e.status===`open`?[{label:ne(),onSelect:()=>void Ve(e)},{label:ue(),onSelect:()=>void He(e)}]:[],columns:[{header:k(),cell:e=>(0,q.jsx)(`span`,{className:`oc-traces__time`,children:be(e.at)}),sort:e=>e.at},{header:x(),cell:e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:o(),cell:e=>(0,q.jsx)(Le,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:a(),cell:e=>(0,q.jsx)($,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:u(),cell:e=>(0,q.jsx)(F,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:le(),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:A(),cell:e=>(0,q.jsx)(Fe,{row:e}),sort:e=>e.evidence??null},{header:_e(),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=V();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:[`↗ `,j()]}):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:[`↗ `,j()]}):null]})}function Ie({row:e}){let[t,n]=(0,K.useState)(!1),r=m(h.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:[O(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,q.jsx)(I,{open:t,onOpenChange:n,children:(0,q.jsxs)(P,{className:`oc-anomaly__attachments-dialog`,children:[(0,q.jsx)(U,{children:(0,q.jsx)(z,{children:g()})}),r===void 0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:v()}):r.length===0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:y()}):(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)(F,{variant:`destructive`,children:S()}):e===`acknowledged`?(0,q.jsx)(F,{variant:`secondary`,children:w()}):(0,q.jsx)(F,{variant:`outline`,children:_()})}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{$x as r,Br as i,Fr as a,Ir as o,Lr as s,Qx as c,RF as l,Rr as u,T as d,Xx as f,Yx as p,Zx as m,aS as h,cS as g,eS as _,iS as v,lS as y,nS as b,oS as x,rS as S,sS as C,tS as w,zr as T}from"./dist-Bkkp8jtC.js";import{V as E,a as D,ct as O,i as k,in as A,lt as j,n as M,o as N,ot as P,rn as F,s as I,st as L,ut as R}from"./index-gP_wjUtq.js";import{n as ee}from"./TimeRangePicker-Bv-U6Bo1.js";import{t as z}from"./FilterBar-BaqVZ-JQ.js";import{t as B}from"./AdvancedFilter-D6zd0L5Q.js";import{t as V}from"./DataTableShell-DMFVXfOQ.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:M,to:`now`},G=`__all__`,K=[{value:`action`,label:i()},{value:`realLabel`,label:T()},{value:`targetLabel`,label:u()},{value:`impersonated`,label:s()},{value:`resource`,label:o()},{value:`resourceId`,label:a()}];function q(){let e=A({from:`/settings/audit`}),t=F({from:`/settings/audit`}),n=e.q??``,i=e.action??G,a=e.impersonated??G,o=e.resource??G,s=k(e.from,e.to),u=(0,H.useMemo)(()=>I(e.adv),[e.adv]),{from:T,to:M}=ee(s),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,...N(e)})}),Q=e=>void t({search:t=>({...t,adv:D(e)}),replace:!0}),$=l(d.admin.listAudit,{filter:{q:n||void 0,from:T,to:M,action:i===G?void 0:i,resource:o===G?void 0:o,impersonated:a===G?void 0:a===`yes`,advanced:u.length>0?u: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!==``||i!==G||a!==G||o!==G||u.length>0||s.kind!==`relative`||s.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:[y(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:g()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:C(),timeRange:s,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(P,{value:i,onValueChange:J,children:[(0,U.jsx)(j,{size:`sm`,className:`w-40`,children:(0,U.jsx)(R,{placeholder:x()})}),(0,U.jsxs)(L,{children:[(0,U.jsx)(O,{value:G,children:h()}),te.map(e=>(0,U.jsx)(O,{value:e,children:e},e))]})]}),(0,U.jsxs)(P,{value:a,onValueChange:Y,children:[(0,U.jsx)(j,{size:`sm`,className:`w-40`,children:(0,U.jsx)(R,{})}),(0,U.jsxs)(L,{children:[(0,U.jsx)(O,{value:G,children:v()}),(0,U.jsx)(O,{value:`yes`,children:S()}),(0,U.jsx)(O,{value:`no`,children:b()})]})]}),(0,U.jsxs)(P,{value:o,onValueChange:X,children:[(0,U.jsx)(j,{size:`sm`,className:`w-40`,children:(0,U.jsx)(R,{placeholder:w()})}),(0,U.jsxs)(L,{children:[(0,U.jsx)(O,{value:G,children:_()}),ne.map(e=>(0,U.jsx)(O,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:u,onChange:Q}),(0,U.jsx)(V,{title:r(),rows:$,emptyHint:c(),columns:[{header:m(),cell:e=>E(e.at),sort:e=>e.at},{header:x(),cell:e=>e.action,sort:e=>e.action},{header:f(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:p(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:w(),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{$_ as r,$g as i,A_ as a,Al as o,Bg as s,C_ as c,Cl as l,D as u,D_ as d,Dl as f,E_ as p,El as m,FF as h,Fg as g,Gg as _,Hg as v,Ig as y,Jg as b,Kg as x,LF as ee,Lg as S,O_ as te,Ol as ne,Pg as C,Qg as re,RF as w,Rg as ie,S_ as ae,Sl as oe,T,T_ as se,Tl as ce,Ug as le,Vg as ue,Wg as de,Xg as fe,Yg as pe,Zg as me,__ as he,a_ as ge,ar as _e,av as ve,b_ as ye,bl as be,c_ as xe,cv as Se,d_ as Ce,e_ as we,ev as Te,f_ as Ee,fv as De,g_ as Oe,h_ as ke,i_ as Ae,ir as je,iv as Me,j_ as Ne,k_ as Pe,kl as Fe,l_ as E,lv as Ie,m_ as Le,ml as Re,n_ as ze,o_ as Be,or as Ve,ov as He,p_ as Ue,pv as We,qg as Ge,r_ as Ke,rr as qe,rv as Je,s_ as Ye,sr as Xe,sv as Ze,t_ as Qe,u_ as $e,ur as et,uv as tt,v_ as nt,vl as rt,w_ as it,wl as at,x_ as ot,xl as st,y_ as ct,yl as lt,zg as ut}from"./dist-Bkkp8jtC.js";import{i as D,r as dt}from"./dist-CqLvr3pk.js";import{t as ft}from"./chevrons-up-down-jkl77XwS.js";import{i as pt,n as O,o as mt,r as ht,s as gt}from"./FieldLabel-B4QPoUJd.js";import{i as _t,n as vt,r as yt,t as bt}from"./tabs-0D2gasCk.js";import{t as k}from"./button-Ew8nYfum.js";import{$ as xt,$t as A,H as j,Kt as St,Lt as M,Pt as N,Q as Ct,V as wt,X as P,Y as F,Z as Tt,at as Et,ct as I,en as Dt,gt as Ot,h as kt,in as At,it as jt,lt as L,m as Mt,nt as Nt,ot as R,rn as Pt,rt as Ft,st as z,tt as It,ut as B,wt as Lt}from"./index-gP_wjUtq.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-C4Hh9u_l.js";import{t as Ht}from"./FilterBar-BaqVZ-JQ.js";import{a as Ut,n as Wt,o as Gt,r as Kt,s as qt,t as Jt}from"./compatView-DIxFDrmB.js";import{t as W}from"./dispatchErrorInfo-Bk3nl1aq.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]),c=(0,G.useMemo)(()=>dn(o),[o]),l=(0,G.useMemo)(()=>fn(o),[o]),u=(0,G.useMemo)(()=>pn(o),[o]),d=(0,G.useMemo)(()=>un(sn(o,n),i),[o,n,i]);function f(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:re()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(Ht,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:pe(),onReset:()=>r(an),canReset:on(n),children:[(0,Z.jsxs)(R,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(B,{placeholder:Ge()})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(I,{value:J,children:b()}),c.map(e=>(0,Z.jsx)(I,{value:e,children:gn(e)},e))]})]}),(0,Z.jsxs)(R,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(B,{placeholder:x()})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(I,{value:J,children:b()}),l.map(e=>(0,Z.jsx)(I,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(R,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(B,{placeholder:_()})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(I,{value:J,children:b()}),u.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))]})]})]}),d.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:de()}):(0,Z.jsxs)(Vt,{className:`oc-conn__table`,children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Q,{label:le(),sortKey:`target`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:v(),sortKey:`state`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:ue(),sortKey:`instance`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:s(),sortKey:`host`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:ut(),sortKey:`version`,sort:i,onSort:f}),(0,Z.jsx)(V,{children:ie()}),(0,Z.jsx)(Q,{label:S(),sortKey:`lastOk`,sort:i,onSort:f})]})}),(0,Z.jsx)(Bt,{children:d.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:me({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:j(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?` · ${j(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:[fe({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${j(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function gn(e){return e===`connected`?y():e===`error`?g():C()}function _n({state:e}){return e===`connected`?(0,Z.jsx)(F,{variant:`secondary`,children:y()}):e===`error`?(0,Z.jsx)(F,{variant:`destructive`,children:g()}):(0,Z.jsx)(F,{variant:`outline`,children:C()})}function vn(){return w(T.bridgeHealth.getBridgeHealth,{})}function yn(){let e=vn(),t=w(T.compat.getBridgeCompat,{}),n=w(T.me.getMe,{host:Ot})?.role===`admin`,r=w(T.admin.listInstances,n?{}:`skip`),i=w(T.agents.usageForInstances,n?{}:`skip`),a=Pt(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=rn(e?e.targets:[],t?t.targets:[],r??[]),{section:c}=At({from:`/settings/bridge`}),l=Pt({from:`/settings/bridge`}),u=t?.compat??null,d=t===void 0?`loading`:t===null?`nodata`:`ready`,f=u!==null&&Wt(u,`hermes`)&&!s.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:he()}),i&&i.length>0?(0,Z.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Z.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:Oe()}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(V,{children:Xe()}),(0,Z.jsx)(V,{children:Ve()}),(0,Z.jsx)(V,{children:_e()}),(0,Z.jsx)(V,{children:je()}),(0,Z.jsx)(V,{children:qe()})]})}),(0,Z.jsx)(Bt,{children:i.flatMap(e=>{let t=kt(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)(F,{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,s.length>0?(0,Z.jsxs)(bt,{value:s.some(e=>e.key===c)?c:s[0]?.key??`openclaw`,onValueChange:e=>void l({search:{section:e},replace:!0}),children:[(0,Z.jsx)(yt,{className:`w-full`,children:s.map(e=>(0,Z.jsxs)(_t,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(M,{size:13,"aria-hidden":!0}),q(e.key)]},e.key))}),s.map(e=>(0,Z.jsx)(vt,{value:e.key,children:(0,Z.jsx)(xn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:u,compatStatus:d,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,f?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):null]})}function bn({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=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)}),i?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsxs)(`code`,{className:`oc-traces__mono`,title:ne(),children:[`(`,i,`)`]})]}):null,r?(0,Z.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,f({build:t.buildVersion??`?`})]}):null,` · `,m(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?ce():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:E()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:xe()});let o=Zt(e.targets),s=!e.reachable,c=$t(e),l=e.unreachableInstances??[],u=c===`ok`?`ok`:c===`gateways_unreachable`?`warn`:`error`,d=wt(e.checkedAt),p=e.startedAt==null?null:wt(e.startedAt);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${u}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c===`ok`?(0,Z.jsx)(A,{size:22}):s||c===`gateways_unreachable`?(0,Z.jsx)(Xt,{size:22}):(0,Z.jsx)(N,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:c===`ok`?Ye():c===`gateways_unreachable`?Ke({count:l.length}):s?Be():ge({count:o.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}),` `,Ae({time:d})]}),p?(0,Z.jsx)(`span`,{children:Qe({time:p})}):null,a]}),c===`gateways_unreachable`?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:ze({names:l.join(`, `)})}):null,s?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:we()})]})}function xn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:a,compatReachable:s,protocol:c}){let l=r?qt(r,e):null,u=new Map;for(let e of n)u.set(e.name,e.displayName??e.name);let d=[],f=new Set;for(let n of t){if(!n.instanceName||f.has(n.instanceName))continue;f.add(n.instanceName);let t=n.gatewayVersion??null;d.push({instanceName:n.instanceName,displayName:u.get(n.instanceName)??n.instanceName,version:t,state:Jt(t,e,r)})}let p=d.map(e=>e.state),m=p.includes(`beyond`)?`beyond`:p.length>0&&p.every(e=>e===`supported`)?`supported`:null,[h,g]=(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)(M,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:q(e)}),m?(0,Z.jsx)(F,{variant:m===`beyond`?`destructive`:`secondary`,children:Kt(m)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:o()}),(0,Z.jsx)(Cn,{providerName:q(e),support:l,compatStatus:a,compatReachable:s,manifest:r,instanceRows:d}),c?(0,Z.jsx)(Sn,{protocol:c}):null,(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":h,onClick:()=>g(e=>!e),children:[h?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(Dt,{size:13,"aria-hidden":!0}),i({count:t.length})]}),h?(0,Z.jsx)(mn,{connections:t,displayByInstance:u}):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:[ke(),i.length>0?(0,Z.jsx)(F,{variant:`destructive`,children:Ue({count:i.length})}):(0,Z.jsx)(F,{variant:`secondary`,children:Le()})]}),(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ee({version:e.vendoredVersion}),r?` · `+Ce({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)(Dt,{size:13,"aria-hidden":!0}),$e({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:E()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:at()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:et({provider:a})}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:oe({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:ce()}),e?(0,Z.jsx)(En,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:rt()}):(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)(F,{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)(Tt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(Ct,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Nt,{children:We({instance:e.displayName??e.name})}),(0,Z.jsx)(xt,{children:De()})]}),(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)(A,{"aria-hidden":!0}):(0,Z.jsx)(N,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?ot():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ye()]}):null}function Tn({instance:e,onClose:t}){let n=ee(T.admin.upsertInstanceConfig),i=h(T.bridge.validateMediaPaths),o=Lt(),s=Rt(e.config?.contentLocale,void 0),[l,u]=(0,G.useState)(()=>pt(e.config??{},s)),[f,m]=(0,G.useState)(!1),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),b=l.inboundMediaMode===`shared-fs`,x=l.mediaMode===`shared-fs`,S=b||x;async function ne(){_(!0),y(null);try{y(await i({instanceName:e.name,inboundMediaMode:l.inboundMediaMode,mediaMode:l.mediaMode}))}catch(e){o.error(se(),e)}finally{_(!1)}}async function C(){m(!0);try{let r=e.config??{};await n({instanceId:e._id,config:ht(l,r,s)}),t()}catch(e){o.error(ve(),e)}finally{m(!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:tt(),help:Me()}),(0,Z.jsxs)(R,{value:l.mediaMode,onValueChange:e=>u({...l,mediaMode:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(B,{})}),(0,Z.jsx)(z,{children:gt.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Ie(),help:Je()}),(0,Z.jsxs)(R,{value:l.inboundMediaMode,onValueChange:e=>u({...l,inboundMediaMode:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(B,{})}),(0,Z.jsx)(z,{children:mt.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Se(),help:Te()}),(0,Z.jsx)(P,{type:`number`,min:1,max:4096,className:`w-full`,value:l.mediaMaxMb,onChange:e=>u({...l,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),S&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[b&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Ne(),help:a()}),(0,Z.jsx)(P,{className:`w-full`,spellCheck:!1,value:l.inboundAgentMount,onChange:e=>u({...l,inboundAgentMount:e.target.value})})]}),x&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Pe(),help:te()}),(0,Z.jsx)(P,{className:`w-full`,spellCheck:!1,value:l.outboundAgentMount,onChange:e=>u({...l,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(Mt,{checked:l.rehydration,onCheckedChange:e=>u({...l,rehydration:e===!0})}),(0,Z.jsx)(O,{label:Ze(),help:r()})]}),S&&v!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:v.reachable?!v.inbound&&!v.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(N,{"aria-hidden":!0}),nt({reason:v.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:c(),result:v.inbound}),(0,Z.jsx)($,{label:ae(),result:v.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:it()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(N,{"aria-hidden":!0}),ct()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[S&&(0,Z.jsxs)(k,{variant:`outline`,size:`sm`,onClick:()=>void ne(),disabled:g,children:[g?(0,Z.jsx)(St,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,g?p():d()]}),(0,Z.jsx)(k,{size:`sm`,onClick:()=>void C(),disabled:f,children:He()})]})]})})}function En({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(Ft,{children:[(0,Z.jsx)(Et,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?st():be({count:e.length}),(0,Z.jsx)(D,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(jt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:lt()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(F,{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{$u as r,FF as i,Fl as a,Il as o,Ku as s,LF as c,Ll as l,Ml as u,Nl as d,Pl as f,RF as p,Rl as m,T as h,Zu as g,ao as _,co as v,do as y,dv as b,hu as x,io as S,jl as C,kF as w,lo as T,lr as E,no as D,oo as O,qu as k,ro as A,so as j,uo as M,zl as N}from"./dist-Bkkp8jtC.js";import{t as P}from"./button-Ew8nYfum.js";import{Pt as F,X as I,b as L,ct as R,f as z,lt as B,m as V,ot as H,p as U,st as W,ut as G}from"./index-gP_wjUtq.js";import{i as K}from"./compatView-DIxFDrmB.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=c(h.admin.upsertInstanceConfig),n=p(h.agents.listAgentsForInstance,{instanceName:e.name}),i=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[a,o]=(0,q.useState)(i),[s,l]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{o(i),l(`idle`)},[e._id,i]);let f=`__none__`,m=a!==i;async function g(){l(`saving`);try{let n={...e.config??{}};a===``||a===f?delete n.converterAgentId:n.converterAgentId=a,await t({instanceId:e._id,config:n}),l(`done`)}catch{l(`error`)}}let _=n?.agents??[];return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()}),(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsxs)(H,{value:a===``?f:a,onValueChange:e=>o(e===f?``:e),children:[(0,X.jsx)(B,{className:`oc-cdefaults__select`,"aria-label":v(),children:(0,X.jsx)(G,{placeholder:O()})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(R,{value:f,children:O()}),_.map(e=>(0,X.jsx)(R,{value:e.agentId,children:e.displayName?`${e.displayName} (${e.agentId})`:e.agentId},e.agentId))]})]}),(0,X.jsx)(P,{size:`sm`,disabled:!m||s===`saving`,onClick:()=>void g(),children:s===`saving`?r():d()})]}),s===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:u()}):null,s===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null]})}function Q({instance:e}){let t=c(h.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,i=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[a,o]=(0,q.useState)(n),[s,l]=(0,q.useState)(i===null?``:String(i)),[f,p]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{o(n),l(i===null?``:String(i)),p(`idle`)},[e._id,n,i]);let m=s.trim(),g=m===``?null:/^\d+$/.test(m)?Number.parseInt(m,10):NaN,v=!a||g===null||Number.isInteger(g)&&g>=4e3&&g<=6e4,y=a!==n||(g??null)!==i;async function b(){p(`saving`);try{let n={...e.config??{}};n.curationEnabled=a,!a||g===null||Number.isNaN(g)?delete n.curationBudgetChars:n.curationBudgetChars=g,await t({instanceId:e._id,config:n}),p(`done`)}catch{p(`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)(V,{checked:a,onCheckedChange:e=>o(e===!0),"aria-label":T()}),(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:T()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(I,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:s,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!v,"aria-label":_(),disabled:!a}),(0,X.jsx)(P,{size:`sm`,disabled:!y||!v||f===`saving`,onClick:()=>void b(),children:f===`saving`?r():d()})]}),v?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:S()}),f===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:u()}):null,f===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:A()})]})}function $({instance:e}){let t=c(h.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[i,a]=(0,q.useState)(n===null?``:String(n)),[o,s]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{a(n===null?``:String(n)),s(`idle`)},[e._id,n]);let l=i.trim(),f=l===``?null:/^\d+$/.test(l)?Number.parseInt(l,10):NaN,p=f===null||Number.isInteger(f)&&f>=1e3&&f<=2e5,m=(f??null)!==n;async function g(){s(`saving`);try{let n={...e.config??{}};f===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=f,await t({instanceId:e._id,config:n}),s(`done`)}catch{s(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(I,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:i,onChange:e=>a(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!p}),(0,X.jsx)(P,{size:`sm`,disabled:!m||!p||o===`saving`,onClick:()=>void g(),children:o===`saving`?r():d()})]}),p?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}),o===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:u()}):null,o===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:M()})]})}function ee(){let e=i(h.agentFiles.getChatDefaults),[t,n]=(0,q.useState)({status:`loading`}),r=p(h.admin.listInstances,{}),[c,u]=(0,q.useState)(null);(0,q.useEffect)(()=>{!r||r.length===0||(!c||!r.some(e=>e.name===c))&&u(r[0].name)},[r,c]);let d=(r?.length??0)>1,_=r!==void 0&&r.length===0,v=p(h.compat.forInstance,c?{instanceName:c}:`skip`),y=c?L(v,`configDefaults`):`loading`,S=y===`loading`?null:y.blocked,C=(0,q.useMemo)(()=>d&&c?{instanceName:c}:{},[d,c]),T=(0,q.useRef)(0),D=(0,q.useCallback)(async()=>{let t=++T.current;n({status:`loading`});try{let r=Y(await e(C));if(T.current!==t)return;n({status:`done`,current:r})}catch{if(T.current!==t)return;n({status:`error`})}},[e,C]);(0,q.useEffect)(()=>{S===!1&&(d&&!c||D())},[D,S,d,c]);let O=t.status===`done`?t.current:null,A=(0,q.useMemo)(()=>J.map(e=>({id:e,label:U(e)})),[]),j=(0,q.useMemo)(()=>[{id:`fast`,label:k()},{id:`standard`,label:s()}],[]);return(0,X.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:N()}),d&&c?(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()}),(0,X.jsxs)(H,{value:c,onValueChange:e=>u(e),children:[(0,X.jsx)(B,{size:`sm`,"aria-label":x(),children:(0,X.jsx)(G,{})}),(0,X.jsx)(W,{children:(r??[]).map(e=>(0,X.jsx)(R,{value:e.name,children:e.name},e.name))})]})]}):null,_?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:b()}):y===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):y.blocked?(0,X.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,X.jsx)(F,{size:14,"aria-hidden":!0}),` `,K(y.gatewayVersion,y.provider)]}):t.status===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):t.status===`error`?(0,X.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[f(),` `,(0,X.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void D(),children:g()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:m()}),(0,X.jsx)(z,{options:A,value:O?.thinkingDefault??null,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:l()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()}),(0,X.jsx)(z,{options:j,value:O===null||O.fastModeDefault===null?null:O.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:a()})]}),(0,X.jsx)(`p`,{className:`oc-cdefaults__note`,children:E()})]}),(()=>{let e=r?.find(e=>e.name===(c??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{am as r,em as i,im as a,nm as o,om as s,rm as c,tm as l}from"./dist-Bkkp8jtC.js";import{i as u,r as d}from"./dist-CqLvr3pk.js";import{t as f}from"./chevrons-up-down-jkl77XwS.js";import{t as p}from"./button-Ew8nYfum.js";import{Bt as m,Ft as h,G as g,J as _,U as v,W as y,Yt as b,m as x,q as S}from"./index-gP_wjUtq.js";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./table-C4Hh9u_l.js";var k=t(e(),1);function A(e,t){return typeof e==`number`&&typeof t==`number`?e-t:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function j(e,t,n){return[...e].sort((e,r)=>{let i=t(e),a=t(r),o=i==null,s=a==null;if(o||s)return o&&s?0:o?1:-1;let c=A(i,a);return n===`asc`?c:-c})}var M=n();function N({title:e,rows:t,columns:n,rowActions:A,onAdd:N,addLabel:P=s(),bulkActions:F,emptyHint:I=r(),isExpanded:L,renderExpanded:R}){let[z,B]=(0,k.useState)(new Set),[V,H]=(0,k.useState)(null),U=t??[],W=V?n[V.index]:void 0,G=V&&W?.sort?j(U,W.sort,V.dir):U;function K(e){H(t=>!t||t.index!==e?{index:e,dir:`asc`}:t.dir===`asc`?{index:e,dir:`desc`}:null)}let q=+!!F+n.length+ +!!A,J=U.length>0&&z.size===U.length,Y=z.size>0&&!J;function X(){B(J?new Set:new Set(U.map(e=>e._id)))}function Z(e){B(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,M.jsxs)(`div`,{className:`oc-dt`,children:[(0,M.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,M.jsx)(`h2`,{className:`oc-dt__title`,children:e}),(0,M.jsxs)(`div`,{className:`oc-dt__bar-actions`,children:[z.size>0&&F?F.map(e=>(0,M.jsxs)(p,{size:`sm`,variant:e.variant===`destructive`?`destructive`:`outline`,onClick:()=>{e.onSelect([...z]),B(new Set)},children:[e.variant===`destructive`?(0,M.jsx)(h,{}):null,e.label,` (`,z.size,`)`]},e.label)):null,N?(0,M.jsxs)(p,{size:`sm`,onClick:N,children:[(0,M.jsx)(m,{}),` `,P]}):null]})]}),t===void 0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):U.length===0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:I}):(0,M.jsxs)(O,{children:[(0,M.jsx)(C,{children:(0,M.jsxs)(E,{children:[F?(0,M.jsx)(w,{className:`w-8`,children:(0,M.jsx)(x,{"aria-label":c(),checked:J?!0:Y?`indeterminate`:!1,onCheckedChange:X})}):null,n.map((e,t)=>{let n=V?.index===t;return e.sort?(0,M.jsx)(w,{className:e.className,"aria-sort":n?V.dir===`asc`?`ascending`:`descending`:`none`,children:(0,M.jsxs)(`button`,{type:`button`,className:`oc-dt__sort`,onClick:()=>K(t),"aria-label":i({column:e.header}),children:[e.header,n?V.dir===`asc`?(0,M.jsx)(d,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(u,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(f,{className:`oc-dt__sort-icon oc-dt__sort-icon--idle`,"aria-hidden":!0})]})},e.header):(0,M.jsx)(w,{className:e.className,children:e.header},e.header)}),A?(0,M.jsx)(w,{className:`w-8`}):null]})}),(0,M.jsx)(T,{children:G.map(e=>{let t=A?.(e)??[],r=L?.(e)??!1;return(0,M.jsxs)(k.Fragment,{children:[(0,M.jsxs)(E,{className:`group/row`,children:[F?(0,M.jsx)(D,{children:(0,M.jsx)(x,{"aria-label":o(),checked:z.has(e._id),onCheckedChange:()=>Z(e._id)})}):null,n.map(t=>(0,M.jsx)(D,{className:t.className,children:t.cell(e)},t.header)),A?(0,M.jsx)(D,{children:t.length>0?(0,M.jsxs)(v,{children:[(0,M.jsx)(_,{asChild:!0,children:(0,M.jsx)(p,{variant:`ghost`,size:`icon-sm`,"aria-label":l(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,M.jsx)(b,{})})}),(0,M.jsx)(y,{align:`end`,children:t.map((t,n)=>(0,M.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,M.jsx)(S,{}):null,(0,M.jsx)(g,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),r&&R?(0,M.jsx)(E,{className:`oc-dt__expansion`,children:(0,M.jsx)(D,{colSpan:q,className:`oc-dt__expansion-cell`,children:R(e)})}):null]},e._id)})})]})]})}export{N as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{Y as t}from"./index-gP_wjUtq.js";var n=e();function r({icon:e,total:r,items:i}){if(r===0)return(0,n.jsxs)(t,{variant:`outline`,className:`oc-group-chip oc-group-chip--empty gap-1`,children:[e,`0`]});let a=r-i.length;return(0,n.jsxs)(`div`,{className:`oc-group-detail`,children:[i.map((e,r)=>(0,n.jsxs)(t,{variant:e.highlight?`secondary`:`outline`,className:`oc-group-chip gap-1`,title:e.label,children:[e.marker,(0,n.jsx)(`span`,{className:`oc-group-chip__txt`,children:e.label})]},r)),a>0?(0,n.jsxs)(t,{variant:`outline`,className:`oc-group-chip`,children:[`+`,a]}):null]})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,Aw as i,Bw as a,CT as o,Ca as s,DT as c,Dw as l,ET as u,Fw as d,Gw as f,Hw as p,Iw as m,Jw as ee,Kw as te,LF as h,Lw as g,Mw as ne,Nw as _,OT as v,Ow as re,Pw as ie,Qw as ae,RF as y,Rw as b,ST as x,T as S,TT as C,Uw as w,Vw as T,Ww as E,Xw as D,Yw as O,Zw as k,_T as A,aT as j,bT as M,cT as N,dT as P,eT as F,fT as I,gT as L,hT as R,iT as z,jw as B,kT as V,kw as H,lT as U,mT as W,nT as G,oT as K,pT as q,qw as J,rT as oe,sT as se,tT as ce,uT as le,vT as ue,wT as de,xT as fe,xa as pe,yT as me,zw as he}from"./dist-Bkkp8jtC.js";import{t as ge}from"./button-Ew8nYfum.js";import{A as _e,V as Y}from"./index-gP_wjUtq.js";import{t as ve}from"./DataTableShell-DMFVXfOQ.js";var X=t(e(),1),Z=n(),ye={altered_words:()=>V(),incorrect:()=>v(),incoherence:()=>c(),formatting:()=>u(),latency:()=>C(),api_error:()=>de(),other:()=>o()},Q=e=>ye[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:fe()}):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:x()})}function be({data:e,reference:t,closeReason:n}){let i=e.snapshot,a=h(S.feedback.respondToFeedback),[o,c]=(0,X.useState)(e.thread),[l,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(!1);async function p(){let t=l.trim();if(!(!t||d)){f(!0);try{await a({feedbackId:e._id,text:t}),c(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{f(!1)}}}let m=[];try{m=i.contextJson?JSON.parse(i.contextJson):[]}catch{m=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:i.displayedMatchesStored,sourceWasOpen:i.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,i.messageRole,i.isRegeneration?` · ${me()}`:``,i.openclawModel?` · ${i.openclawModel}`:``,i.openclawRuntime?` (${i.openclawRuntime})`:``]}),t?(0,Z.jsx)(`code`,{className:`oc-fbadmin__ref`,style:{userSelect:`all`,marginLeft:`auto`},title:J(),children:t}):null]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ue()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,n?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:_()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:n})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:A()}),o.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.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`?L():e.authorRole===`agent`?e.authorLabel??s():R()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:W()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:q(),value:l,maxLength:2e3,rows:3,onChange:e=>u(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(ge,{size:`sm`,onClick:()=>void p(),disabled:!l.trim()||d,children:d?I():P()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:le()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:i.messageText||U()})]}),i.clientInfo?.sourceWasOpen&&i.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:N()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:i.displayedText||U()})]}):null,i.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:se()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:i.promptText})]}):null,m.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:K({count:i.contextCount??m.length,truncated:i.contextTruncated?j():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:m.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,i.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:z()}),(0,Z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[i.outboxText??``,i.outboxStatus?`\n[status: ${i.outboxStatus}]`:``]})]}):null,i.clientInfo?.extensionsDetected&&i.clientInfo.extensionsDetected.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:oe()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:i.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:G()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[i.clientInfo?.language,i.clientInfo?.timezone,i.clientInfo?.theme?ce({theme:i.clientInfo.theme}):null,i.runId?`run ${i.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,i.clientInfo?.plugins&&i.clientInfo.plugins.length>0?(0,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[F(),` `,i.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,r()]})]}):null,i.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:i.clientInfo.userAgent}):null]})]})]})}function xe(){let e=y(S.feedback.listForAdmin,{}),t=h(S.feedback.readSnapshot),n=h(S.feedback.deleteFeedback),r=_e(),[o,s]=(0,X.useState)(null),[c,u]=(0,X.useState)({});async function _(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({feedbackId:e._id});u(t=>({...t,[e._id]:n}))}s(e._id)}async function v(e){await r({title:H(),description:re(),confirmLabel:l(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&s(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ae(),` `,(0,Z.jsx)(`strong`,{children:k()}),` `,D()]}),(0,Z.jsx)(ve,{title:O(),rows:e,emptyHint:ee(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Z.jsx)(be,{data:c[e._id],reference:e.reference,closeReason:e.userCloseReason}):null,columns:[{header:te(),cell:e=>Y(e.at),sort:e=>e.at},{header:f(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:E(),cell:e=>e.messageRole===`user`?w():p(),sort:e=>e.messageRole},{header:T(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${a({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:he(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:b(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:g(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:m()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:d()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:pe()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:ie()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:o===e._id?ne():B(),onSelect:()=>void _(e)},{label:i(),onSelect:()=>void v(e),variant:`destructive`}]})]})}export{xe as FeedbacksTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,AP as ee,BP as i,CP as te,DP as a,Da as o,EP as ne,Ea as re,FP as ie,GP as s,HP as c,IP as l,JP as u,KP as d,LF as f,LP as ae,MP as oe,NP as se,OP as ce,PP as le,QP as p,RF as ue,RP as de,SP as fe,T as m,TP as pe,UP as h,VP as g,WP as _,XP as me,YP as he,ZP as ge,eF as _e,jF as ve,jP as ye,kF as be,kO as xe,kP as v,nF as y,qP as b,tF as x,wP as S,xP as C,zP as w}from"./dist-Bkkp8jtC.js";import{t as T}from"./button-Ew8nYfum.js";import{F as E,Ft as D,G as O,I as k,J as A,L as j,M,N as Se,P as Ce,R as we,U as Te,W as Ee,Xt as N,Y as P,Yt as De,ct as F,lt as I,m as Oe,ot as L,st as R,ut as z,wt as ke,z as Ae,zt as je}from"./index-gP_wjUtq.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-C4Hh9u_l.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return s();case`audio`:return _();case`video`:return h();case`pdf`:return c();case`document`:return g();case`archive`:return i();default:return w()}}function q(){let[e,t]=(0,U.useState)(G),[n,i]=(0,U.useState)(G),[s,c]=(0,U.useState)(G),[h,g]=(0,U.useState)(G),[_,w]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=f(m.files.softDelete),Y=ke();function Ie(){t(G),i(G),c(G),g(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(ce())}catch(e){Y.error(a(),e)}}let X=ue(m.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:s===G?void 0:s,category:h===G?void 0:h,includeAutoGenerated:_||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(ve(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:be()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||s!==G||h!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:y()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(L,{value:e,onValueChange:t,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":x(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:_e()}),(0,W.jsx)(F,{value:`inbound`,children:r()}),(0,W.jsx)(F,{value:`outbound`,children:p()})]})]}),(0,W.jsxs)(L,{value:n,onValueChange:i,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":ge(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:me()}),Q.chats.map(e=>(0,W.jsx)(F,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(L,{value:s,onValueChange:c,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":he(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:u()}),Q.instances.map(e=>(0,W.jsx)(F,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(L,{value:h,onValueChange:g,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":b(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:d()}),Q.categories.map(e=>(0,W.jsx)(F,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(Oe,{checked:_,onCheckedChange:e=>w(e===!0),"aria-label":o()}),(0,W.jsx)(`span`,{children:o()})]}),$?(0,W.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(je,{size:14,"aria-hidden":!0}),ye()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?fe():te()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:de()}),(0,W.jsx)(B,{children:ae()}),(0,W.jsx)(B,{children:l()}),(0,W.jsx)(B,{children:ie()}),(0,W.jsx)(B,{children:le()}),(0,W.jsx)(B,{className:`text-right`,children:se()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(P,{variant:`outline`,style:{marginLeft:6},children:re()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(P,{variant:`secondary`,children:e.direction===`inbound`?r():p()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(Te,{children:[(0,W.jsx)(A,{asChild:!0,children:(0,W.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":ee(),children:(0,W.jsx)(De,{size:16})})}),(0,W.jsxs)(Ee,{align:`end`,children:[e.url?(0,W.jsx)(O,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(N,{size:14}),oe()]})}):(0,W.jsxs)(O,{disabled:!0,children:[(0,W.jsx)(N,{size:14}),S()]}),(0,W.jsxs)(O,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(D,{size:14}),v()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:C({cap:Be})}):null]}),(0,W.jsx)(M,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(E,{children:[(0,W.jsxs)(we,{children:[(0,W.jsx)(Ae,{children:ne()}),(0,W.jsx)(k,{children:pe()})]}),(0,W.jsxs)(j,{children:[(0,W.jsx)(Ce,{children:xe()}),(0,W.jsx)(Se,{onClick:()=>void Le(),children:v()})]})]})})]})}export{q as FilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{cm as r,sm as i}from"./dist-Bkkp8jtC.js";import{t as a}from"./button-Ew8nYfum.js";import{Rt as o,X as s,zt as c}from"./index-gP_wjUtq.js";import{t as l}from"./TimeRangePicker-Bv-U6Bo1.js";var u=t(e(),1),d=n(),f=250;function p({q:e,onQChange:t,searchPlaceholder:n=r(),children:p,timeRange:m,onTimeRangeChange:h,onReset:g,canReset:_=!0}){let[v,y]=(0,u.useState)(e);(0,u.useEffect)(()=>{y(e)},[e]);let b=(0,u.useRef)(null);function x(e){y(e),b.current!==null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>t(e),f)}(0,u.useEffect)(()=>()=>{b.current!==null&&window.clearTimeout(b.current)},[]);function S(){b.current!==null&&window.clearTimeout(b.current),g()}return(0,d.jsxs)(`div`,{className:`oc-filterbar`,children:[(0,d.jsxs)(`div`,{className:`oc-filterbar__search`,children:[(0,d.jsx)(o,{className:`oc-filterbar__search-icon`,"aria-hidden":!0}),(0,d.jsx)(s,{value:v,onChange:e=>x(e.target.value),placeholder:n,"aria-label":n})]}),p?(0,d.jsx)(`div`,{className:`oc-filterbar__quick`,children:p}):null,m&&h?(0,d.jsx)(l,{value:m,onChange:h}):null,(0,d.jsxs)(a,{variant:`ghost`,size:`sm`,className:`oc-filterbar__reset`,onClick:S,disabled:!_,children:[(0,d.jsx)(c,{}),i()]})]})}export{p as t};
|
|
@@ -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,Bd as a,Cd as o,D as s,Dd as c,Ed as l,Fd as u,Gd as d,Hd as f,Id as p,Jd as m,Kd as h,LF as g,Ld as _,Md as v,Nd as y,Od as b,Pd as x,Qd as S,RF as C,Rd as w,Sd as T,T as E,Td as D,Ud as ee,Vd as O,Wd as te,Xd as ne,Yd as re,Zd as ie,_d as ae,_f as k,af as A,bd as oe,bf as j,cf as M,dd as N,df as se,ef as P,fd as ce,ff as F,gd as le,gf as ue,hd as I,hf as L,if as R,jd as z,kd as de,lf as fe,md as pe,mf as me,nf as he,of as ge,pd as _e,pf as ve,qd as ye,rf as be,sf as xe,tf as Se,uf as Ce,vd as we,vf as Te,wd as Ee,xd as De,yd as Oe,yf as ke,zd as Ae}from"./dist-Bkkp8jtC.js";import{t as je}from"./x-BqwVyymF.js";import{i as B,n as V,r as Me,t as Ne}from"./tabs-0D2gasCk.js";import{t as H}from"./button-Ew8nYfum.js";import{$ as Pe,A as Fe,It as U,Lt as W,Q as Ie,X as G,Y as K,Z as Le,ct as Re,d as ze,en as Be,gt as Ve,lt as He,m as q,nt as Ue,ot as We,st as Ge,tn as Ke,tt as qe,ut as Je,wt as J}from"./index-gP_wjUtq.js";import{t as Ye}from"./FilterBar-BaqVZ-JQ.js";import{t as Xe}from"./DataTableShell-DMFVXfOQ.js";import{t as Y}from"./DetailChips-Cv722Djz.js";var Ze=s(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),X=s(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Qe=s(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Z=t(e(),1);function $e(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 et(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 tt(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 nt(e){switch(e){case`admin`:return O();case`user`:return a();case`pending`:return Ae();default:return e}}function rt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function it(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var Q=n(),$={name:``,description:``};function at(){let e=C(E.groups.listGroups,{}),t=C(E.me.getMe,{host:Ve})?.role===`admin`,n=g(E.groups.createGroup),i=g(E.groups.updateGroup),a=g(E.groups.deleteGroup),o=Fe(),s=J(),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)($),[m,h]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(``),y=(0,Z.useMemo)(()=>{if(!e)return e;let t=_.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,_]);function b(){d(null),p($),l(!0)}function x(e){d(e),p({name:e.name,description:e.description??``}),l(!0)}async function S(){try{u?await i({groupId:u._id,name:f.name,description:f.description}):await n({name:f.name,description:f.description||void 0}),p($),d(null),l(!1)}catch(e){s.error(pe(),e)}}async function w(e){if(await o({title:Se({name:e.name}),description:P(),confirmWord:e.name,confirmLabel:r(),cancelLabel:xe(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(_e(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}),(0,Q.jsx)(Ye,{q:_,onQChange:v,onReset:()=>v(``),canReset:_!==``,searchPlaceholder:F()}),(0,Q.jsx)(Xe,{title:j(),rows:y,addLabel:Te(),onAdd:t?b:void 0,emptyHint:k(),columns:[{header:ue(),cell:e=>e.name,sort:e=>e.name},{header:L(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(Qe,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Q.jsx)(X,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:me(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(W,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ve(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Q.jsx)(U,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:se(),onSelect:()=>h({groupId:e._id,name:e.name})},...t?[{label:Ce(),onSelect:()=>x(e)},{label:fe(),variant:`destructive`,onSelect:()=>void w(e)}]:[]]}),(0,Q.jsx)(ze,{open:c,onOpenChange:l,title:u?A():ge(),description:R(),canSubmit:!!f.name.trim(),onSubmit:S,submitLabel:M(),children:(0,Q.jsxs)(`div`,{className:`oc-form`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:be()}),(0,Q.jsx)(G,{value:f.name,onChange:e=>p({...f,name:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:he()}),(0,Q.jsx)(G,{value:f.description,onChange:e=>p({...f,description:e.target.value})})]})]})}),(0,Q.jsx)(ct,{groupId:m?.groupId??null,groupName:m?.name??``,open:m!==null,onOpenChange:e=>{e||h(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Q.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Q.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Q.jsx)(Ke,{size:14,"aria-hidden":!0}),te()]}),(0,Q.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":f({page:e,pages:t}),children:[e,` / `,t]}),(0,Q.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[ee(),(0,Q.jsx)(Be,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=C(E.groups.getGroup,n&&e?{groupId:e}:`skip`),a=C(E.groups.listAssignableInstances,n?{}:`skip`),o=C(E.groups.listAssignableUsers,n?{}:`skip`),s=g(E.groups.addMember),l=g(E.groups.removeMember),u=g(E.groups.bulkSetMembers),f=g(E.groups.setGroupManager),_=J(),[v,b]=(0,Z.useState)(``),[T,D]=(0,Z.useState)(``),[ee,O]=(0,Z.useState)(`members`),[te,k]=(0,Z.useState)(1),[A,oe]=(0,Z.useState)(new Set),j=(0,Z.useRef)(null),M=(0,Z.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),N=(0,Z.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),se=i?.viewerIsAdmin===!0,P=(0,Z.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Z.useEffect)(()=>{b(``),D(``),O(`members`),k(1),j.current=null},[n,e]),(0,Z.useEffect)(()=>{k(1)},[v]),(0,Z.useEffect)(()=>{n&&i&&e&&j.current!==e&&(j.current=e,oe(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let F=(0,Z.useMemo)(()=>o?$e(o,v,A):[],[o,v,A]);async function ue(t,n){if(e)try{n?await l({groupId:e,userId:t}):await s({groupId:e,userId:t})}catch(e){_.error(ce(),e)}}async function I(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){_.error(le(),e)}}let L=rt(F,e=>M.has(e.userId)),R=F.filter(e=>M.has(e.userId)).length,z=it(F,te,ot);async function de(){if(!e||F.length===0)return;let t=F.map(e=>e.userId);try{await u({groupId:e,userIds:t,member:L!==`all`})}catch(e){_.error(ce(),e)}}return(0,Q.jsx)(Le,{open:n,onOpenChange:r,children:(0,Q.jsxs)(Ie,{className:`oc-access`,children:[(0,Q.jsxs)(qe,{children:[(0,Q.jsx)(Ue,{children:S({name:t})}),(0,Q.jsx)(Pe,{children:ie()})]}),(0,Q.jsxs)(Ne,{value:ee,onValueChange:O,className:`oc-access__tabs`,children:[(0,Q.jsxs)(Me,{className:`w-full`,children:[(0,Q.jsxs)(B,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Qe,{size:13,"aria-hidden":!0}),ne(),i?(0,Q.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:M.size}):null]}),(0,Q.jsxs)(B,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),m(),i?(0,Q.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:P.size}):null]}),(0,Q.jsxs)(B,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ze,{size:13,"aria-hidden":!0}),c(),i?(0,Q.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Q.jsx)(V,{value:`members`,children:o===void 0||i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()}):o.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:x()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(G,{value:v,onChange:e=>b(e.target.value),placeholder:re(),className:`oc-access__search`}),F.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:h()}):(0,Q.jsxs)(Q.Fragment,{children:[F.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(q,{checked:L===`all`?!0:L===`some`?`indeterminate`:!1,onCheckedChange:()=>void de(),"aria-label":d()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:d()}),(0,Q.jsxs)(K,{variant:`outline`,className:`oc-access__count`,children:[R,` / `,F.length]})]}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:z.pageItems.map(e=>{let t=M.has(e.userId),n=tt(e),r=N.has(e.userId);return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:t,onCheckedChange:()=>void ue(e.userId,t),"aria-label":w({user:n.primary})}),(0,Q.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Q.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Q.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__role`,children:nt(e.role)}),(0,Q.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&se?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?ae():we(),title:r?ae():we(),onClick:()=>void I(e.userId,r),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):t&&r?(0,Q.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":Oe(),title:Oe(),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Q.jsx)(st,{page:z.page,pageCount:z.pageCount,onPage:k})]})]})}),(0,Q.jsx)(V,{value:`agents`,children:a===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()}):a.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:y()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(G,{value:T,onChange:e=>D(e.target.value),placeholder:ye(),className:`oc-access__search`}),(0,Q.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,Q.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:P,query:T},`${e}-${t._id}`))})]})}),(0,Q.jsx)(V,{value:`charts`,children:(0,Q.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:a}){let o=C(E.groups.listAssignableAgents,{instanceName:t}),s=g(E.groups.assignAgentToGroup),c=g(E.groups.removeAgentFromGroup),l=g(E.groups.bulkSetGroupAgents),f=J(),[p,m]=(0,Z.useState)(1);if((0,Z.useEffect)(()=>{m(1)},[a]),!e)return null;let h=et(o?.agents??[],a),y=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&h.length===0)return null;let x=h.filter(e=>e.presentInLastOk!==!1&&e.enabled!==!1),S=rt(x,e=>r.has(`${t}/${e.agentId}`)),w=it(h,p,ot);async function T(n,r){try{r?await c({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){f.error(N(),e)}}async function D(){if(x.length===0)return;let n=x.map(e=>e.agentId);try{await l({groupId:e,instanceName:t,agentIds:n,assigned:S!==`all`})}catch(e){f.error(N(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n}),y?(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__stale`,children:i()}):null]}),o===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:u()}):h.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:y?z():v()}):(0,Q.jsxs)(Q.Fragment,{children:[x.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(q,{checked:S===`all`?!0:S===`some`?`indeterminate`:!1,onCheckedChange:()=>void D(),"aria-label":d()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:d()})]}):null,w.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1,o=!e.enabled;return(0,Q.jsxs)(`div`,{className:`oc-access__row${o?` is-disabled`:``}`,children:[(0,Q.jsx)(q,{checked:i,disabled:(a||o)&&!i,onCheckedChange:()=>void T(e.agentId,i),"aria-label":_({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":b(),title:b(),children:(0,Q.jsx)(U,{size:14,fill:`currentColor`})}):null,a?(0,Q.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:de()}):null]},e.agentId)}),(0,Q.jsx)(st,{page:w.page,pageCount:w.pageCount,onPage:m})]})]})}function ut({groupId:e}){let t=C(E.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=g(E.charts.assignChartToGroup),r=g(E.charts.removeChartFromGroup),i=g(E.charts.setGroupDefaultChart),a=g(E.charts.addChartToGroupPool),s=g(E.charts.removeChartFromGroupPool),c=J();if(!e)return null;if(t===void 0)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()});let{pool:u,addable:d,canManagePool:f}=t;if(u.length===0&&!f)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:l()});async function m(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}async function h(t){try{await i({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}async function _(t){try{await a({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}async function v(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(I(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-access__list`,children:u.map(e=>(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:e.selected,onCheckedChange:()=>void m(e.chartKey,e.selected),"aria-label":T({name:e.name})}),(0,Q.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":De(),title:De(),children:(0,Q.jsx)(U,{size:14,fill:`currentColor`})}):(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void h(e.chartKey),children:oe()}):null,f?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":o({name:e.name}),title:o({name:e.name}),onClick:()=>void v(e.chartKey),children:(0,Q.jsx)(je,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,Q.jsxs)(We,{value:``,onValueChange:e=>void _(e),children:[(0,Q.jsx)(He,{size:`sm`,className:`oc-access__search`,children:(0,Q.jsx)(Je,{placeholder:Ee()})}),(0,Q.jsx)(Ge,{children:d.map(e=>(0,Q.jsx)(Re,{value:e.chartKey,children:e.name},e.chartKey))})]}):u.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:D()}):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{$C as r,$S as i,AC as a,AS as o,BC as s,BS as c,CC as l,CS as u,DC as d,DS as f,Do as p,EC as m,ES as h,Eo as g,FC as ee,FF as _,FS as v,GC as te,GS as y,HC as b,HS as x,IC as ne,IS as S,JC as re,JS as C,KC as ie,KS as ae,LC as oe,LF as w,LS as T,MC as se,MS as ce,NC as le,OC as ue,OS as de,Oo as fe,PC as pe,PS as E,QC as me,QS as he,RC as ge,RF as D,RS as _e,SC as ve,SS as ye,Sk as be,T as O,TC as xe,TS as Se,UC as Ce,US as we,VC as Te,VS as Ee,WC as De,WS as Oe,XC as ke,XS as Ae,YC as je,YS as Me,ZC as Ne,ZS as Pe,_C as Fe,_S as Ie,aC as k,bC as Le,bS as Re,cC as ze,dC as Be,dS as A,eC as Ve,fC as He,fS as Ue,fr as We,gC as j,gS as Ge,hC as M,hS as Ke,iC as qe,jC as Je,jS as Ye,kC as Xe,kS as Ze,ko as Qe,lC as N,mC as $e,mS as et,mr as tt,nC as nt,nv as rt,oC as it,pC as at,pS as ot,pr as st,qC as ct,qS as lt,rC as ut,sC as dt,tC as ft,tv as pt,uC as mt,uS as ht,vC as gt,vS as _t,wC as vt,wS as yt,xC as bt,xS as xt,xk as P,yC as St,yS as Ct,zC as wt,zS as Tt}from"./dist-Bkkp8jtC.js";import{a as Et,c as Dt}from"./FieldLabel-B4QPoUJd.js";import{t as F}from"./button-Ew8nYfum.js";import{$ as Ot,A as kt,Q as I,X as L,Y as R,Z as z,at as At,ct as B,d as jt,it as Mt,lt as V,m as H,nt as U,ot as W,rt as Nt,st as G,tt as K,ut as q,wt as J}from"./index-gP_wjUtq.js";import{t as Pt}from"./DataTableShell-DMFVXfOQ.js";import{InstanceConfigDialog as Ft}from"./BridgeTab-Db3Fo_mk.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],It=new Set(X),Lt=`conversational`;function Rt(e){let t=new Set((e??[]).filter(e=>It.has(e)));return t.size===0?[Lt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:Et},zt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Bt(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 Vt(){let e=D(O.admin.listInstances,{}),t=D(O.agents.listAllInstanceAgents,{}),n=w(O.admin.upsertInstance),i=w(O.admin.deleteInstance),o=J(),[c,u]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(Q),[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null);async function ae(){try{await n({instanceId:S??void 0,name:f.name,gatewayUrl:f.gatewayUrl,bridgeUrl:f.bridgeUrl||void 0,displayName:f.displayName||void 0,kind:f.kind,transport:f.kind===`hermes`?f.transport:void 0,gatewayVersion:f.gatewayVersion||void 0,gatewayHttpUrl:f.gatewayHttpUrl||void 0,streamTransport:f.streamTransport}),p(Q),C(null),u(!1)}catch(e){o.error(Ne(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ke(),(0,Z.jsx)(`strong`,{children:je()}),re()]}),(0,Z.jsx)(Pt,{title:ct(),rows:e,addLabel:ie(),onAdd:()=>{C(null),p(Q),u(!0)},emptyHint:te(),columns:[{header:De(),cell:e=>e.name,sort:e=>e.name},{header:Ce(),cell:e=>(0,Z.jsx)(R,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:b(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Te(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:r(),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)(R,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?A():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:oe(),onSelect:()=>{C(e._id),p(Bt(e)),u(!0)}},{label:me(),onSelect:()=>g(e.name)},{label:ve(),onSelect:()=>x(e)},{label:s(),onSelect:()=>v(e)},{label:wt(),variant:`destructive`,onSelect:()=>void i({instanceId:e._id})}],bulkActions:[{label:wt(),variant:`destructive`,onSelect:e=>e.forEach(e=>void i({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:c,onOpenChange:u,title:S?ne():ge(),description:pe(),canSubmit:!!(f.name&&f.gatewayUrl),onSubmit:ae,submitLabel:le(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:se(),children:[(0,Z.jsx)(L,{value:f.name,disabled:S!==null,onChange:e=>p({...f,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ee()}):null]}),(0,Z.jsx)($,{label:Je(),children:(0,Z.jsxs)(W,{value:f.kind,onValueChange:e=>p({...f,kind:e}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(B,{value:`hermes`,children:`Hermes`})]})]})}),f.kind===`hermes`?(0,Z.jsx)($,{label:tt(),children:(0,Z.jsxs)(W,{value:f.transport,onValueChange:e=>p({...f,transport:e}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{value:`ws`,children:st()}),(0,Z.jsx)(B,{value:`rest`,children:We()})]})]})}):null,(0,Z.jsx)($,{label:a(),children:(0,Z.jsx)(L,{value:f.gatewayUrl,onChange:e=>p({...f,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Xe(),children:(0,Z.jsx)(L,{value:f.bridgeUrl,placeholder:ue(),onChange:e=>p({...f,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:d(),children:(0,Z.jsx)(L,{value:f.displayName,onChange:e=>p({...f,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:rt(),children:[(0,Z.jsxs)(W,{value:f.streamTransport,onValueChange:e=>p({...f,streamTransport:e}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsx)(G,{children:Dt.map(e=>(0,Z.jsx)(B,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:pt()})]}),(0,Z.jsx)($,{label:m(),children:(0,Z.jsx)(L,{value:f.gatewayVersion,placeholder:xe(),onChange:e=>p({...f,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:vt(),children:(0,Z.jsx)(L,{value:f.gatewayHttpUrl,placeholder:l(),onChange:e=>p({...f,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Zt,{instanceName:h,open:h!==null,onOpenChange:e=>{e||g(null)}}),_?(0,Z.jsx)(Ft,{instance:_,onClose:()=>v(null)},_._id):null,y?(0,Z.jsx)(Ht,{instance:y,onClose:()=>x(null)},y._id):null]})}function Ht({instance:e,onClose:t}){let n=D(O.instanceSecrets.listInstanceSecretStatus,{}),r=zt[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)(z,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(I,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(U,{children:bt({instance:e.displayName??e.name})}),(0,Z.jsx)(Ot,{children:Le()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Gt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Wt,{instance:e})}),(0,Z.jsx)(Ut,{instance:e})]})})}function Ut({instance:e}){let t=_(O.instanceSync.forceInstanceSync),n=J(),[r,a]=(0,Y.useState)(!1);async function o(){if(!r){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Ve());break;case`no_agents`:n.success(he());break;case`no_bridge_url`:n.error(Pe());break;case`deploy_misconfigured`:n.error(Ae());break;case`unauthorized`:n.error(C());break;case`not_served`:n.error(lt());break;default:n.error(Me());break}}catch(e){n.error(i(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:r,children:r?ft():nt()})})]})}function Wt({instance:e}){let t=D(O.bridgeAuth.listBridgeAuthStatus,{}),n=_(O.bridgeAuth.mintBridgeSecret),r=w(O.bridgeAuth.revokeBridgeSecret),i=J(),[a,o]=(0,Y.useState)(!1),[s,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),f=(t??[]).find(t=>t.instanceId===e._id),p=f!==void 0;async function m(){if(!a){o(!0);try{l((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){i.error(Tt(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),l(null),i.success(c())}catch(e){i.error(Tt(),e)}finally{o(!1)}}}async function g(){if(s)try{await navigator.clipboard.writeText(s),d(!0)}catch{}}return(0,Z.jsxs)($,{label:y(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(R,{variant:p?`outline`:`secondary`,children:p?`${j()} · ${f.prefix}…${f.lastFour}`:M()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void m(),disabled:a,children:p?x():we()}),p?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:Ee()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:_e()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void g(),children:u?be():P()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{l(null),d(!1)},children:T()})]}):null]})}function Gt({instanceId:e,field:t,updatedAt:n}){let r=_(O.instanceSecrets.setInstanceSecret),i=w(O.instanceSecrets.clearInstanceSecret),a=_(O.deviceIdentity.generateDeviceIdentity),o=J(),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(null),[p,m]=(0,Y.useState)(!1),h=n!==null,g=t===`deviceIdentity`,ee=t===`token`?St():t===`deviceIdentity`?gt():Fe();async function v(){if(!(!s.trim()||l)){u(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),f(null),m(!1),o.success(mt())}catch(e){o.error(N(),e)}finally{u(!1)}}}async function te(){if(!l){u(!0);try{await i({instanceId:e,field:t}),f(null),m(!1),o.success(ze())}catch(e){o.error(N(),e)}finally{u(!1)}}}async function y(){if(!l){u(!0);try{f(await a({instanceId:e})),m(!1),o.success(k())}catch(e){o.error(ut(),e)}finally{u(!1)}}}let b=d?`openclaw devices approve ${d.id}`:``;async function x(){if(b)try{await navigator.clipboard.writeText(b),m(!0)}catch{}}return(0,Z.jsxs)($,{label:ee,children:[g?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(R,{variant:h?`outline`:`secondary`,children:h?j():M()}),(0,Z.jsx)(L,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:h?at():$e(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void v(),disabled:l||s.trim().length===0,children:He()}),g?(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void y(),disabled:l,children:dt()}):null,h?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void te(),disabled:l,children:Be()}):null]})]}),d?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:k()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:b}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:p?be():P()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{f(null),m(!1)},children:T()})]}):null]})}var Kt={conversational:h,documentary:yt,summarizer:Qe,curator:p},qt={conversational:Se,documentary:u,summarizer:fe,curator:g},Jt=e=>(Kt[e]??(()=>e))(),Yt=e=>(qt[e]??(()=>``))();function Xt({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:o()}),t.map(e=>(0,Z.jsx)(R,{variant:`secondary`,className:`oc-agenttype__chip`,title:Yt(e),children:Jt(e)},e)),(0,Z.jsxs)(Nt,{children:[(0,Z.jsx)(At,{asChild:!0,children:(0,Z.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Ze()})}),(0,Z.jsxs)(Mt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:de()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:f()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(H,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:Jt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Yt(r)})]})]},r)})})]})]})]})}function Zt({instanceName:e,open:t,onOpenChange:n}){let r=D(O.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=w(O.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=w(O.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=w(O.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Rt(r);e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=w(O.agents.setAgentDescription).withOptimisticUpdate((e,{instanceName:t,agentId:n,description:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=r.trim();e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,description:a.length===0?null:a}:e)})}),c=w(O.agents.removeInstanceAgent),l=kt(),u=J();async function d(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(E(),e)}}async function f(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(E(),e)}}async function p(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){u.error(E(),e)}}async function m(t,n){if(e&&await l({title:Re({name:n}),description:Ct(),confirmLabel:_t(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(Ie())}catch(e){u.error(E(),e)}}return(0,Z.jsx)(z,{open:t,onOpenChange:n,children:(0,Z.jsxs)(I,{className:`oc-access`,children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(U,{children:S({name:e??``})}),(0,Z.jsx)(Ot,{children:v()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ge()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Ke():r.discovery.lastPollOk?et():ot({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ue()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(t=>{let n=t.presentInLastOk===!1,i=r.defaultAgentId===t.agentId,a=t.displayName??t.agentId,o=t.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(t.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(H,{checked:t.enabled,disabled:n,"aria-label":a,onCheckedChange:e=>void d(t.agentId,e===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:a,children:[t.emoji?`${t.emoji} `:``,a]}),t.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:t.model}):null,n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:ht()}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void m(t.agentId,a),children:xt()})]}):i?(0,Z.jsx)(R,{variant:`default`,children:A()}):(0,Z.jsx)(F,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!t.enabled,onClick:()=>void f(t.agentId),children:ye()})]}),t.enabled?(0,Z.jsx)(Xt,{agentId:t.agentId,types:o,onToggle:e=>void p(t.agentId,e,o)}):null,t.enabled?(0,Z.jsx)(Qt,{value:t.description??``,onSave:async n=>{if(e)try{await s({instanceName:e,agentId:t.agentId,description:n})}catch(e){u.error(E(),e)}}}):null]},t.agentId)})})]})]})})}function Qt({value:e,onSave:t}){let[n,r]=(0,Y.useState)(e);(0,Y.useEffect)(()=>{r(e)},[e]);let i=()=>{n.trim()!==e.trim()&&t(n)};return(0,Z.jsx)(L,{className:`oc-agentcard__desc`,value:n,maxLength:280,placeholder:ce(),"aria-label":Ye(),onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())}})}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{Vt as InstancesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{BT as r,FF as i,FT as a,Gs as o,HT as s,Hs as c,IT as l,Js as u,Ks as d,LF as f,LT as p,MT as m,NT as h,PT as g,RF as _,RT as v,T as y,UT as b,Us as x,VT as S,WT as C,Ws as w,Xs as T,Ys as E,jT as D,qs as O,zT as k}from"./dist-Bkkp8jtC.js";import{t as A}from"./button-Ew8nYfum.js";import{X as j,Y as M,m as N}from"./index-gP_wjUtq.js";var P=t(e(),1),F=n();function I(){let e=_(y.integrations.status.status,{}),t=f(y.admin.setIntegrationConfig),[n,i]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&i(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:C()});let o=n,c=(e,t,n)=>i({...o,[e]:{...o[e],[t]:n}}),d=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[b(),` `,(0,F.jsx)(`strong`,{children:s()}),` `,S()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(M,{variant:`secondary`,children:r()}):(0,F.jsx)(M,{variant:`outline`,children:k()}):(0,F.jsx)(M,{variant:`outline`,children:v()}),note:p(),children:[(0,F.jsx)(R,{label:a(),children:(0,F.jsx)(j,{value:o.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>c(`langfuse`,`host`,e.target.value),onBlur:()=>d(`langfuse`,{host:o.langfuse.host??``})})}),(0,F.jsx)(z,{label:D(),checked:o.langfuse.enabled??!0,onChange:e=>{c(`langfuse`,`enabled`,e),d(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(M,{variant:`secondary`,children:r()}):(0,F.jsx)(M,{variant:`outline`,children:k()}):(0,F.jsx)(M,{variant:`outline`,children:v()}),note:l(),children:[(0,F.jsx)(R,{label:g(),children:(0,F.jsx)(j,{value:o.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>c(`opik`,`baseUrl`,e.target.value),onBlur:()=>d(`opik`,{baseUrl:o.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:h(),children:(0,F.jsx)(j,{value:o.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||m(),onChange:e=>c(`opik`,`workspace`,e.target.value),onBlur:()=>d(`opik`,{workspace:o.opik.workspace??``})})}),(0,F.jsx)(z,{label:D(),checked:o.opik.enabled??!0,onChange:e=>{c(`opik`,`enabled`,e),d(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(M,{variant:`secondary`,children:r()}):(0,F.jsx)(M,{variant:`outline`,children:k()}):(0,F.jsx)(M,{variant:`outline`,children:T()}),note:E(),children:[(0,F.jsx)(R,{label:u(),children:(0,F.jsx)(j,{value:o.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>c(`otlp`,`endpoint`,e.target.value),onBlur:()=>d(`otlp`,{endpoint:o.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:D(),checked:o.otlp.enabled??!0,onChange:e=>{c(`otlp`,`enabled`,e),d(`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=i(y.integrations.otlpSecret.setOtlpHeaders),n=f(y.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,P.useState)(``),[s,l]=(0,P.useState)(null),[u,p]=(0,P.useState)(!1),m=async()=>{p(!0),l(null);try{await t({headersJson:r}),a(``)}catch(e){l(e instanceof Error?e.message:String(e))}finally{p(!1)}};return(0,F.jsxs)(R,{label:O(),children:[(0,F.jsx)(j,{value:r,placeholder:e?d():o(),onChange:e=>a(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(A,{size:`sm`,disabled:u||r.trim().length===0,onClick:()=>void m(),children:w()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:u,onClick:()=>void n({}),children:x()}):null]}),s?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:s}):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{DE as r,EE as i,QE as a,RF as o,T as s,TE as c,_E as l,_g as u,bg as d,cg as f,dg as p,fg as m,gE as h,gg as g,hg as _,lg as v,mg as y,pg as b,sg as x,ug as S,vg as C,wE as w,yg as ee}from"./dist-Bkkp8jtC.js";import{gt as te,i as ne,in as re,o as T,r as E,rn as D}from"./index-gP_wjUtq.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-DsVS4SLV.js";import{n as N,t as P}from"./TimeRangePicker-Bv-U6Bo1.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=o(s.me.getMe,{host:te})?.permissions?.includes(`traces.read`)??!1,t=o(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:a()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:r()}),(0,I.jsx)(j,{children:c()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):(0,I.jsx)(B,{series:n})})]})]})}function B({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),a=Math.max(1,...t,...n),o=t=>6+t*468/(e.length-1),s=e=>74-e*68/a,c=e=>e.map((e,t)=>`${t===0?`M`:`L`}${o(t).toFixed(1)},${s(e).toFixed(1)}`).join(` `),u=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:[h(),` p50 `,R(u.cP50),` `,i()]}),(0,I.jsxs)(`span`,{children:[l(),` p50 `,R(u.aP50),` `,i()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":r(),children:[(0,I.jsx)(`path`,{d:c(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:c(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:d(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:ee(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:C(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:u(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:g(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:_(),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=re({from:`/settings/kpi`}),t=D({from:`/settings/kpi`}),n=ne(e.from,e.to,E,`now`),r=e=>void t({search:t=>({...t,...T(e)})}),{from:i,to:a}=N(n),{rowLimit:c,buckets:l}=K(i,a),u=o(s.kpi.listKpis,{limit:c,filter:{from:i,to:a}}),d=(0,F.useMemo)(()=>{let e=new Map;for(let t of u??[]){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>l&&e.set(t,n.slice(n.length-l));return e},[u,l]),f=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[y(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:b()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return u===void 0?(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:m()})]}):u.length===0?(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:p()})]}):(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(d.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:d.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,r=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&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(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:S({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:v()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:f({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":x({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{$A as r,BA as i,E as a,Et as o,FA as s,GA as c,HA as l,IA as u,JA as d,KA as ee,LA as te,LF as f,Mt as ne,NC as re,PA as ie,QA as ae,RA as oe,RF as p,T as m,UA as h,VA as g,WA as se,XA as ce,YA as le,ZA as ue,_F as de,_j as fe,_t as pe,aF as me,aj as _,bF as v,cF as y,cj as b,dF as x,dj as S,dt as C,ej as w,fF as T,fj as E,ft as D,gF as O,gj as k,gt as A,hF as j,hj as M,ht as N,iF as P,ij as F,jt as I,kF as L,lF as R,lj as z,mF as he,mj as ge,mt as _e,nj as ve,oF as ye,oj as be,pF as xe,pj as Se,pt as Ce,qA as B,rj as we,sF as Te,sj as Ee,tj as De,uF as Oe,uj as ke,vF as Ae,vj as je,vt as Me,wF as Ne,xF as Pe,yF as Fe,yj as Ie,zA as Le}from"./dist-Bkkp8jtC.js";import{t as V}from"./button-Ew8nYfum.js";import{E as Re,X as H,Y as U,ct as W,gt as G,ht as ze,lt as Be,m as K,mt as Ve,ot as He,pt as Ue,st as We,t as Ge,ut as Ke,wt as qe}from"./index-gP_wjUtq.js";import{t as Je}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=n();function Ye({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,J.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:a(`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,J.jsx)(`span`,{className:a(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var Y=[{id:`messages`,label:()=>Ie()},{id:`composer`,label:()=>je()},{id:`sidebar`,label:()=>fe()},{id:`notifications`,label:()=>w()},{id:`other`,label:()=>k()}],X={showSource:{category:`messages`,label:()=>M(),help:()=>ge()},showReport:{category:`messages`,label:()=>Se(),help:()=>E()},copyAssistant:{category:`messages`,label:()=>S()},copyUser:{category:`messages`,label:()=>ke()},showDelete:{category:`messages`,label:()=>z()},showTools:{category:`messages`,label:()=>b(),help:()=>Ee()},voiceInput:{category:`composer`,label:()=>be(),help:()=>_()},showUsage:{category:`composer`,label:()=>F(),help:()=>we()},autoReadAloud:{category:`composer`,label:()=>ne(),help:()=>I()},showChatAge:{category:`sidebar`,label:()=>ve(),help:()=>De()},notifSound:{category:`notifications`,label:()=>r(),help:()=>ae()},notifSystem:{category:`notifications`,label:()=>ue(),help:()=>ce()},replySound:{category:`notifications`,label:()=>le(),help:()=>d()}};function Z(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Q(e,t){let n=Z(t.trim()),r=new Map(Y.map(e=>[e.id,e.label()])),i=new Map(Y.map(e=>[e.id,[]]));for(let t of e){let e=X[t],a=e?.category??`other`;n&&!Z(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return Y.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var Xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],Ze={voiceInput:`voiceInput`};function Qe(e){return Xe.includes(e)}function $(e){return e===`admin`}function $e(e){return e===!0?`on`:e===!1?`off`:`inherit`}function et(e){return e===`on`?!0:e===`off`?!1:null}function tt(e){return Qe(e)?Ze[e]:void 0}var nt={voiceInput:()=>oe()};function rt({prefKey:e,ui:t}){let n=f(m.admin.setUiPrefDefault),r=f(m.admin.setFeatureEnabled),i=tt(e),a=i?nt[e]?.():void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,J.jsx)(`span`,{className:`oc-prefs__gov-label`,children:l()}),(0,J.jsxs)(He,{value:$e(t.defaults[e]),onValueChange:t=>void n({key:e,value:et(t)}),children:[(0,J.jsx)(Be,{size:`sm`,className:`w-36`,children:(0,J.jsx)(Ke,{})}),(0,J.jsxs)(We,{children:[(0,J.jsx)(W,{value:`on`,children:u()}),(0,J.jsx)(W,{value:`off`,children:s()}),(0,J.jsx)(W,{value:`inherit`,children:ie()})]})]}),i?(0,J.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,J.jsx)(K,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":g()}),g()]}):null]}),a?(0,J.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function it({current:e,enabled:t}){let n=f(m.me.setDictationShortcut),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=Ve(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(o(!0),window.setTimeout(()=>o(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,J.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[Me(),e?(0,J.jsx)(U,{variant:`secondary`,children:ze(e,Ue())}):null]}),(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:a?N():r?A():pe()})]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:C()}):null,(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?D():e?Ce():_e()})]})]})}function at(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),a=p(m.me.getMe,{host:G}),s=a?.ui,l=$(a?.role)&&n,u=f(m.me.setUiPref).withOptimisticUpdate(Re),d=(0,q.useMemo)(()=>s?Q(Object.keys(s.effective),e):[],[s,e]);return s?(0,J.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(a?.role)?(0,J.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,J.jsx)(K,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":h()}),h()]}):null,l?(0,J.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,J.jsx)(`p`,{children:i()}),(0,J.jsx)(`p`,{children:Le()}),(0,J.jsx)(`p`,{children:te()})]}):null,(0,J.jsx)(H,{value:e,onChange:e=>t(e.target.value),placeholder:B(),"aria-label":B(),className:`mb-2`}),d.length===0?(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:ee()}):(0,J.jsx)(`div`,{className:`oc-prefs`,children:d.map(e=>(0,J.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,J.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=X[e],n=t?t.label():e,r=t?.help?.(),i=s.locked[e],a=s.effective[e],d=s.userOverrides[e]!==void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,J.jsx)(U,{variant:`outline`,children:c()}):d?(0,J.jsx)(U,{variant:`secondary`,children:o()}):null]}),r?(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&d?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void u({key:e,value:null}),children:se()}):null,(0,J.jsx)(Ye,{checked:a,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),u({key:e,value:t})},"aria-label":n})]}),l?(0,J.jsx)(rt,{prefKey:e,ui:s}):null]},e)})]},e.id))}),(0,J.jsx)(it,{current:a?.dictationShortcut??null,enabled:s.effective.voiceInput===!0})]}):(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:L()})}var ot={sm:()=>R(),md:()=>y(),lg:()=>Te(),xl:()=>ye()};function st(){let e=p(m.me.getMe,{host:G}),t=f(m.me.setLocale),n=f(m.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(m.me.getMe,{host:G});n&&e.setQuery(m.me.getMe,{host:G},{...n,fontScale:t,resolvedFontScale:t??`md`})}),r=f(m.me.setMyName),i=qe(),a=e?.locale??`default`,o=e?.name??``,[s,c]=(0,q.useState)(null),l=s??o,u=l.trim()!==o.trim();async function d(){try{await r({name:l}),c(null),i.success(de())}catch(e){i.error(O(),e)}}return(0,J.jsxs)(`div`,{className:`oc-appearance`,children:[(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:Pe()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(H,{className:`max-w-xs`,value:l,maxLength:120,placeholder:Fe(),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u&&(e.preventDefault(),d())}}),(0,J.jsx)(V,{size:`sm`,disabled:!u,onClick:()=>void d(),children:re()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:j()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[Je().map(e=>(0,J.jsx)(V,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,J.jsx)(V,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:Ne()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:xe()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:T()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:x()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:Ge.map(t=>(0,J.jsx)(V,{variant:(e?.fontScale??`md`)===t?`default`:`outline`,size:`sm`,onClick:()=>void n({scale:t}),children:ot[t]()},t))}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:me()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:P()})]}),(0,J.jsx)(at,{})]})]})}export{st as PreferencesTab};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ao as r,B_ as i,F_ as a,G_ as o,Gi as s,H_ as c,I_ as l,J_ as u,Ji as d,K_ as f,Ki as p,LF as m,L_ as h,Mo as g,N_ as _,No as v,P_ as ee,Po as te,Q_ as ne,RF as y,R_ as b,T as x,U_ as S,V_ as C,W_ as w,X_ as T,Xi as E,Y_ as re,Yi as ie,Z_ as ae,_r as D,av as O,gr as k,hr as A,jo as j,ov as M,q_ as N,qi as P,z_ as F}from"./dist-Bkkp8jtC.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 oe}from"./FieldLabel-B4QPoUJd.js";import{t as U}from"./button-Ew8nYfum.js";import{ct as W,gt as G,lt as K,m as q,ot as J,st as Y,ut as X,wt as se}from"./index-gP_wjUtq.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:N,help:f},documentary_fetch:{label:o,help:w},inbound_files:{label:S,help:c},history_summary:{label:te,help:v},file_curation:{label:E,help:ie}},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:ee,files:_,previous_summary:g,new_messages:j,max_chars:r,file_name:d,budget_chars:P,feedback:p,content:s};function pe(){let e=y(x.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:i()})});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:ne(),help:ae()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:C()}),(0,$.jsxs)(J,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(X,{})}),(0,$.jsx)(Y,{children:e.map(e=>(0,$.jsx)(W,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=m(x.admin.upsertInstanceConfig),n=se(),r=y(x.me.getMe,{host:G}),i=e.config??{},a=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[o,s]=(0,Q.useState)(()=>R(i,a));(0,Q.useEffect)(()=>{s(R(i,a))},[a,e._id]);let[c,l]=(0,Q.useState)(!1),u=o.promptInjections,d=(e,t)=>s({...o,promptInjections:{...u,[e]:{...u[e],...t}}});async function f(){l(!0);try{await t({instanceId:e._id,config:V(o,i,a)})}catch(e){n.error(O(),e)}finally{l(!1)}}async function p(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(O(),e)}}let h=e.config?.contentLocale??`default`,g=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:D()}),(0,$.jsxs)(J,{value:h,onValueChange:e=>void p(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(X,{})}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(W,{value:`default`,children:A({locale:g})}),le().map(e=>(0,$.jsx)(W,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:k()})]}),oe.map(e=>(0,$.jsx)(he,{injKey:e,def:z[e],i18n:ue[e],row:u[e]??{enabled:!0,template:z[e].defaultTemplate[a]},contentLocale:a,onChange:t=>d(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(U,{size:`sm`,onClick:()=>void f(),disabled:c,children:M()})})]})}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],d=t.togglable&&!r.enabled,f=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),p=I(e,r,i),m=p?L(p,f):``;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)(q,{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:re()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:d,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:u()}),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)(U,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?b():F()}),c&&(0,$.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:T()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:m}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:h()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:l()})})]})}export{pe as PromptInjectionsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ax as r,Bx as i,Cx as ee,Dx as a,Ex as o,Fx as s,Gx as c,Hx as l,Ix as u,Jx as d,Kx as f,LF as p,Lx as m,Mx as h,Nx as g,Ox as te,Px as ne,RF as re,Rx as _,Sx as ie,T as v,Tx as y,Ux as b,Vx as x,Wx as S,ax as ae,ba as C,bx as w,cx as T,dx as E,fx as D,jx as O,kx as k,lx as A,ox as j,px as M,qx as N,sx as P,ux as F,wx as I,xx as L,yx as R,zx as z}from"./dist-Bkkp8jtC.js";import{t as B}from"./button-Ew8nYfum.js";import{A as V,Gt as H,X as U,Y as W,d as G,m as K,wt as q}from"./index-gP_wjUtq.js";import{t as J}from"./roleDescriptions-CSbRqH5d.js";var Y=t(e(),1),X=n(),Z=[{group:()=>d(),keys:[{key:`traces.read`,label:()=>b()},{key:`traces.read.content`,label:()=>l(),phi:!0},{key:`traces.write`,label:()=>x()}]},{group:()=>N(),keys:[{key:`kpi.read`,label:()=>b()},{key:`kpi.write`,label:()=>x()}]},{group:()=>f(),keys:[{key:`openclaw.query`,label:()=>i()},{key:`anomalies.read`,label:()=>z()},{key:`anomalies.report`,label:()=>_()}]},{group:()=>c(),keys:[{key:`chats.read`,label:()=>b()},{key:`selfheal`,label:()=>u()},{key:`feedback.respond`,label:()=>C()}]},{group:()=>S(),keys:[{key:`admin.manage`,label:()=>m()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=re(v.apiKeys.listRoles,{}),t=p(v.apiKeys.createRole),n=p(v.apiKeys.ensureRolesSeeded),i=p(v.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(v.apiKeys.listRoles,{});r&&e.setQuery(v.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),c=V(),l=q(),[u,d]=(0,Y.useState)(!1),[f,m]=(0,Y.useState)($),[_,b]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{l.error(ne(),e)})},[n,l]);let x=e??[];async function S(e,t){if(Q(e.permissions))return;if(e.builtin){await c({title:g({name:e.name}),description:h(),confirmLabel:O()});return}if(_.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];b(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){l.error(r(),e)}finally{b(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function C(){try{await t({key:f.key,name:f.name,description:f.description||void 0,permissions:[]}),m($),d(!1)}catch(e){l.error(k(),e)}}let N=e===void 0,z=!N&&x.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[te(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,a(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,o()]}),(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:y()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{m($),d(!0)},children:I()})})]}),N?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}):(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:L()}),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?s({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:x.map(e=>{let t=Q(e.permissions),n=_.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)(W,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,w()]}):(0,X.jsx)(W,{variant:`secondary`,children:R()})]}),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)(K,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?M():n?D():r,onCheckedChange:()=>void S(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(G,{open:u,onOpenChange:d,title:E(),description:F(),canSubmit:!!(f.key&&f.name),onSubmit:C,submitLabel:A(),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:T()}),(0,X.jsx)(U,{value:f.key,placeholder:P(),onChange:e=>m({...f,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:j()}),(0,X.jsx)(U,{value:f.name,onChange:e=>m({...f,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ae()}),(0,X.jsx)(U,{value:f.description,onChange:e=>m({...f,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{$M as r,AN as i,BN as a,D as o,EN as s,FF as c,FN as ee,HN as te,IN as l,KM as ne,MN as re,NN as ie,ON as ae,PN as oe,QM as se,RN as u,T as d,TN as ce,VN as le,_P as ue,aN as de,aP as fe,cN as pe,cP as me,dN as he,dP as ge,eN as _e,fN as ve,fP as ye,gP as be,hN as xe,hP as Se,iN as Ce,jF as we,jN as Te,kF as f,kN as p,lN as Ee,lP as De,mN as m,mP as Oe,nN as ke,oN as Ae,oP as je,pN as h,pP as Me,rN as Ne,sN as Pe,sP as Fe,tN as Ie,uN as Le,uP as Re,vP as ze,yP as Be,zN as g}from"./dist-Bkkp8jtC.js";import{t as _}from"./button-Ew8nYfum.js";import{$ as Ve,F as He,Ft as Ue,Ht as We,I as Ge,Kt as v,L as Ke,M as qe,Mt as Je,N as Ye,O as Xe,P as Ze,Q as y,R as Qe,Ut as $e,Vt as et,X as b,Y as x,Z as S,ct as C,et as tt,k as nt,lt as w,nt as T,ot as E,st as D,tt as O,ut as k,wt as rt,z as it,zt as at}from"./index-gP_wjUtq.js";import{a as ot,i as A,n as st,o as j,r as M,t as ct}from"./table-C4Hh9u_l.js";var lt=o(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),N=t(e(),1),P=n(),F={minutes:6e4,hours:36e5,days:864e5};function I(e){return e?.data?.code??`unknown`}function L(){let e=c(d.scheduled.listMyCrons),t=c(d.scheduled.getCronDetail),n=c(d.scheduled.listCronRuns),o=c(d.scheduled.updateCron),L=c(d.scheduled.removeCron),ut=c(d.scheduled.runCronNow),R=rt(),[z,dt]=(0,N.useState)(null),[B,ft]=(0,N.useState)(!1),[pt,mt]=(0,N.useState)(!1),[V,ht]=(0,N.useState)(null),[H,U]=(0,N.useState)(null),[W,G]=(0,N.useState)(null),[K,q]=(0,N.useState)(null),[gt,_t]=(0,N.useState)(!1),J=(0,N.useCallback)(async()=>{ft(!0),mt(!1);try{dt(await e({}))}catch{mt(!0)}finally{ft(!1)}},[e]);(0,N.useEffect)(()=>{J()},[J]);let vt=(0,N.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),Y=(0,N.useRef)(null);(0,N.useEffect)(()=>{z!==null&&Y.current!==null&&Y.current.scrollIntoView({block:`center`})},[z]);let X=(0,N.useMemo)(()=>new Intl.DateTimeFormat(we(),{dateStyle:`medium`,timeStyle:`short`}),[]),Z=async(e,t,n)=>{ht(e);try{await t(),R.success(n),await J()}catch(e){R.toast({variant:`error`,title:l({code:I(e)})})}finally{ht(null)}},Q=(0,N.useRef)(0),$=(0,N.useRef)(0),yt=async(e,t)=>{if(t.id===null)return;let r=++Q.current;G({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Q.current)return;G({name:t.name??t.id,entries:i})}catch(e){if(r!==Q.current)return;G(null),R.toast({variant:`error`,title:l({code:I(e)})})}},bt=async(e,n)=>{if(n.id===null)return;let r=++$.current;q({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%F.days===0?(s=String(e/F.days),c=`days`):e%F.hours===0?(s=String(e/F.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/F.minutes))),c=`minutes`))}if(r!==$.current)return;q(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==$.current)return;q(null),R.toast({variant:`error`,title:l({code:I(e)})})}},xt=async()=>{if(K===null)return;let e={};if(K.nameDirty&&K.name.trim()===``||K.messageDirty&&K.hasMessage&&K.message.trim()===``){R.toast({variant:`error`,title:se()});return}if(K.nameDirty&&K.name.trim()!==``&&(e.name=K.name.trim()),K.scheduleDirty){if(K.scheduleKind===`cron`&&K.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:K.cronExpr.trim(),...K.tz.trim()===``?{}:{tz:K.tz.trim()}};else if(K.scheduleKind===`every`){let t=Number(K.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*F[K.everyUnit])})}else if(K.scheduleKind===`at`&&K.at!==``){let t=Date.parse(K.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(K.scheduleDirty&&e.schedule===void 0){R.toast({variant:`error`,title:r()});return}if(K.messageDirty&&K.hasMessage&&K.message.trim()!==``&&(e.message=K.message.trim()),Object.keys(e).length===0){q(null);return}let t=$.current;_t(!0);try{await o({instanceName:K.instanceName,jobId:K.jobId,patch:e}),R.success(ve()),t===$.current&&q(null),await J()}catch(e){R.toast({variant:`error`,title:l({code:I(e)})})}finally{_t(!1)}},St=z?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:Be()}),(0,P.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:()=>void J(),disabled:B,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,P.jsx)(at,{size:14,"aria-hidden":!0}),ze()]})]}),z===null?(0,P.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":B,children:pt?ue():f()}):(0,P.jsxs)(P.Fragment,{children:[pt?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}):null,z.length===0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:be()}):null,z.map(e=>(0,P.jsxs)(`section`,{style:{marginBottom:20},children:[z.length>1||e.error||!e.supported?(0,P.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,P.jsx)(x,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Oe({code:e.error})}):e.jobs.length===0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Me()}):(0,P.jsxs)(ct,{children:[(0,P.jsx)(ot,{children:(0,P.jsxs)(j,{children:[(0,P.jsx)(A,{children:ye()}),(0,P.jsx)(A,{children:ge()}),(0,P.jsx)(A,{children:Re()}),(0,P.jsx)(A,{children:De()}),(0,P.jsx)(A,{children:me()}),(0,P.jsx)(A,{children:xe()})]})}),(0,P.jsx)(st,{children:e.jobs.map((t,n)=>{let r=`${e.instanceName}:${t.id??n}`,i=V===r,s=e.manageSupported,c=e.kind===`openclaw`&&s;return(0,P.jsxs)(j,{ref:t.id!==null&&t.id===vt?Y:void 0,"data-state":t.id!==null&&t.id===vt?`selected`:void 0,children:[(0,P.jsx)(M,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Fe()}),(0,P.jsx)(M,{children:(0,P.jsx)(x,{variant:`secondary`,children:t.agentId})}),(0,P.jsxs)(M,{className:`whitespace-nowrap`,children:[(0,P.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=Xe(t.schedule),n=e===null?null:nt(e);return n===null?null:(0,P.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,P.jsx)(M,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:X.format(t.nextRunAtMs)}),(0,P.jsxs)(M,{children:[t.enabled===!0?(0,P.jsx)(x,{variant:`secondary`,children:fe()}):t.enabled===!1?(0,P.jsx)(x,{variant:`outline`,children:je()}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t.lastRunStatus?(0,P.jsx)(`span`,{className:`text-muted-foreground`,style:{marginLeft:8,fontSize:`0.8rem`},children:t.lastRunStatus}):null]}),(0,P.jsx)(M,{className:`whitespace-nowrap`,children:t.id===null?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):i?(0,P.jsx)(v,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,P.jsxs)(`span`,{style:{display:`inline-flex`,gap:2},children:[c?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:le(),"aria-label":le(),disabled:V!==null,onClick:()=>void Z(r,async()=>{let n=await ut({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},ee()),children:(0,P.jsx)(Je,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:t.enabled?a():g(),"aria-label":t.enabled?a():g(),disabled:V!==null,onClick:()=>void Z(r,()=>o({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?oe():ie()),children:t.enabled?(0,P.jsx)($e,{size:14,"aria-hidden":!0}):(0,P.jsx)(et,{size:14,"aria-hidden":!0})}):null,c?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:m(),"aria-label":m(),disabled:V!==null,onClick:()=>void bt(e.instanceName,t),children:(0,P.jsx)(We,{size:14,"aria-hidden":!0})}):null,c?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:h(),"aria-label":h(),disabled:V!==null,onClick:()=>void yt(e.instanceName,t),children:(0,P.jsx)(lt,{size:14,"aria-hidden":!0})}):null,s?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:u(),"aria-label":u(),disabled:V!==null,onClick:()=>U({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,P.jsx)(Ue,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Se()})]},e.instanceName)),St>0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:ne()}):null]}),(0,P.jsx)(qe,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,P.jsxs)(He,{children:[(0,P.jsxs)(Qe,{children:[(0,P.jsx)(it,{children:Te()}),(0,P.jsx)(Ge,{children:i({name:H?.name??``})})]}),(0,P.jsxs)(Ke,{children:[(0,P.jsx)(Ze,{children:p()}),(0,P.jsx)(Ye,{onClick:()=>{let e=H;U(null),e!==null&&Z(`${e.instanceName}:${e.jobId}`,()=>L({instanceName:e.instanceName,jobId:e.jobId}),re())},children:ae()})]})]})}),(0,P.jsx)(S,{open:W!==null,onOpenChange:e=>{e||(Q.current++,G(null))},children:(0,P.jsxs)(y,{style:{maxWidth:640},children:[(0,P.jsx)(O,{children:(0,P.jsx)(T,{children:he({name:W?.name??``})})}),W?.entries===null?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):W!==null&&W.entries.length===0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Le()}):W===null?null:(0,P.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:W.entries.map((e,t)=>(0,P.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,P.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[e.status===`ok`?(0,P.jsx)(x,{variant:`secondary`,children:s()}):e.status===`error`?(0,P.jsx)(x,{variant:`destructive`,children:ce()}):(0,P.jsx)(x,{variant:`outline`,children:e.status??`—`}),(0,P.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?X.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,P.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,P.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,P.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error})]},t))})]})}),(0,P.jsx)(S,{open:K!==null,onOpenChange:e=>{e||($.current++,q(null))},children:(0,P.jsxs)(y,{children:[(0,P.jsxs)(O,{children:[(0,P.jsx)(T,{children:Ee()}),(0,P.jsx)(Ve,{children:pe()})]}),K===null?null:K.loading?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,P.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,P.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,P.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ye()}),(0,P.jsx)(b,{value:K.name,maxLength:200,onChange:e=>q({...K,name:e.target.value,nameDirty:!0})})]}),(0,P.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,P.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Pe()}),(0,P.jsxs)(E,{value:K.scheduleKind,onValueChange:e=>q({...K,scheduleKind:e,scheduleDirty:!0}),children:[(0,P.jsx)(w,{children:(0,P.jsx)(k,{})}),(0,P.jsxs)(D,{children:[(0,P.jsx)(C,{value:`cron`,children:Ae()}),(0,P.jsx)(C,{value:`every`,children:de()}),(0,P.jsx)(C,{value:`at`,children:Ce()})]})]}),K.scheduleKind===`cron`?(0,P.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,P.jsx)(b,{value:K.cronExpr,onChange:e=>q({...K,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,P.jsx)(b,{value:K.tz,onChange:e=>q({...K,tz:e.target.value,scheduleDirty:!0}),placeholder:`America/Toronto`,style:{maxWidth:180}})]}):K.scheduleKind===`every`?(0,P.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,P.jsx)(b,{type:`number`,min:1,value:K.everyValue,onChange:e=>q({...K,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,P.jsxs)(E,{value:K.everyUnit,onValueChange:e=>q({...K,everyUnit:e,scheduleDirty:!0}),children:[(0,P.jsx)(w,{style:{maxWidth:160},children:(0,P.jsx)(k,{})}),(0,P.jsxs)(D,{children:[(0,P.jsx)(C,{value:`minutes`,children:Ne()}),(0,P.jsx)(C,{value:`hours`,children:ke()}),(0,P.jsx)(C,{value:`days`,children:Ie()})]})]})]}):(0,P.jsx)(b,{type:`datetime-local`,value:K.at,onChange:e=>q({...K,at:e.target.value,scheduleDirty:!0})})]}),K.hasMessage?(0,P.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,P.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:te()}),(0,P.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:K.message,onChange:e=>q({...K,message:e.target.value,messageDirty:!0})})]}):null]}),(0,P.jsxs)(tt,{children:[(0,P.jsx)(_,{variant:`ghost`,onClick:()=>q(null),children:p()}),(0,P.jsxs)(_,{onClick:()=>void xt(),disabled:K===null||K.loading||gt,children:[gt?(0,P.jsx)(v,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,_e()]})]})]})})]})}export{L as ScheduledTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as r,AA as i,Ak as a,Bk as ee,CA as te,Ck as o,DA as s,Dk as c,EA as ne,Ek as l,FF as re,Fk as u,Gk as ie,Hk as ae,Ik as d,Jk as oe,Kk as se,LF as f,Lk as ce,MA as le,Mk as p,NA as ue,Nk as m,OA as h,Ok as g,Pk as de,Qk as fe,RF as _,Rk as pe,SA as me,Sk as he,T as v,TA as ge,Tk as _e,Uk as ve,Vk as ye,Wk as be,Xk as xe,Yk as Se,Zk as Ce,_A as we,_k as y,aA as Te,bA as Ee,bk as b,cA as De,dA as Oe,eA as ke,fA as Ae,gA as je,gk as x,hA as Me,hk as S,iA as Ne,jA as Pe,jk as C,kA as Fe,kk as w,lA as Ie,mA as Le,mk as T,nA as Re,oA as ze,pA as Be,pk as E,qk as Ve,rA as He,sA as Ue,tA as We,uA as Ge,vA as Ke,vk as D,wA as qe,wk as O,xA as Je,xk as k,yA as Ye,yk as A,zk as Xe}from"./dist-Bkkp8jtC.js";import{n as j}from"./dist-Bk4bPGS8.js";import{i as Ze}from"./dist-CqLvr3pk.js";import{t as M}from"./button-Ew8nYfum.js";import{$ as N,A as Qe,B as P,Q as F,V as I,X as L,Y as R,Z as z,Zt as B,ct as V,d as $e,en as et,et as tt,in as nt,lt as H,nt as rt,ot as U,rn as it,st as W,tt as G,ut as K,wt as at}from"./index-gP_wjUtq.js";import{t as ot}from"./FilterBar-BaqVZ-JQ.js";import{t as st}from"./DataTableShell-DMFVXfOQ.js";import{t as ct}from"./roleDescriptions-CSbRqH5d.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>A(),days:null},{value:`30`,label:()=>D(),days:30},{value:`90`,label:()=>y(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=nt({from:`/settings/serviceAccounts`}),t=it({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[o,c]=(0,q.useState)(X),l=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),d=_(v.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:a===X?void 0:a===`disabled`}}),p=_(v.apiKeys.listKeys,{}),m=_(v.apiKeys.listRoles,{}),g=f(v.apiKeys.createServiceAccount),de=f(v.apiKeys.updateServiceAccount),he=f(v.apiKeys.deleteServiceAccount),_e=re(v.apiKeys.mintApiKey),y=f(v.apiKeys.revokeApiKey),b=Qe(),x=at(),S=n!==``||o!==X||a!==X;function C(){c(X),t({search:{},replace:!0})}let[w,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(Z),[O,k]=(0,q.useState)(null),[A,j]=(0,q.useState)(new Set),[N,P]=(0,q.useState)(null),F=(0,q.useRef)(!1),[I,z]=(0,q.useState)(new Set),[B,tt]=(0,q.useState)({}),[rt,G]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of p??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[p]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{O?(await de({serviceAccountId:O,name:E.name,roleKey:E.roleKey,description:E.description}),x.success(Ce())):await g({name:E.name,roleKey:E.roleKey,description:E.description||void 0}),D(Z),k(null),T(!1)}catch(e){x.error(O?fe():r(),e)}}function pt(e){D({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),T(!0)}async function mt(e){if(F.current)return;F.current=!0;let t=B[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;P(e._id);try{let t=await _e({serviceAccountId:e._id,expiresAt:r});G({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){x.error(xe(),e)}finally{F.current=!1,P(null)}}async function $(e){if(await b({title:Se(),description:(0,J.jsxs)(J.Fragment,{children:[oe(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ve(),` `,(0,J.jsx)(`strong`,{children:se()}),` `,ie()]}),confirmWord:e.name,confirmLabel:be(),destructive:!0}))try{await he({serviceAccountId:e._id}),x.success(ve(),e.name)}catch(e){x.error(ae(),e)}}async function ht(e){if(await b({title:ye(),description:(0,J.jsxs)(J.Fragment,{children:[ee(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Xe()]}),confirmLabel:pe(),destructive:!0})&&!I.has(e._id)){z(t=>new Set(t).add(e._id));try{await y({keyId:e._id})}catch(e){x.error(ce(),e)}finally{z(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:ue()}),(0,J.jsxs)(ot,{q:n,onQChange:l,searchPlaceholder:le(),onReset:C,canReset:S,children:[(0,J.jsxs)(U,{value:o,onValueChange:c,children:[(0,J.jsx)(H,{size:`sm`,className:`w-40`,children:(0,J.jsx)(K,{placeholder:Pe()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(V,{value:X,children:i()}),(m??[]).map(e=>(0,J.jsx)(V,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(U,{value:a,onValueChange:u,children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(V,{value:X,children:Fe()}),(0,J.jsx)(V,{value:`active`,children:h()}),(0,J.jsx)(V,{value:`disabled`,children:s()})]})]})]}),(0,J.jsx)(st,{title:ne(),rows:d,addLabel:ge(),onAdd:()=>{D(Z),k(null),T(!0)},emptyHint:qe(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:I}),rowActions:e=>[{label:Ee(),onSelect:()=>pt(e)},{label:te(),onSelect:()=>void mt(e)},{label:A.has(e._id)?me():Je(),onSelect:()=>Q(e._id)},{label:Ye(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Ke():we(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,J.jsx)(Ze,{}):(0,J.jsx)(et,{})})},{header:je(),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:Me(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Le(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(R,{variant:`destructive`,children:s()}):(0,J.jsx)(R,{variant:`outline`,children:h()})},{header:Be(),cell:e=>(0,J.jsxs)(U,{value:B[e._id]??`never`,onValueChange:t=>tt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{})}),(0,J.jsx)(W,{children:lt.map(e=>(0,J.jsx)(V,{value:e.value,children:e.label()},e.value))})]})},{header:Ae(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?Oe():Ge({count:t})})}}]}),(0,J.jsx)($e,{open:w,onOpenChange:e=>{T(e),e||k(null)},title:O?Ie():ze(),description:O?De():Te(),canSubmit:!!(E.name&&E.roleKey),onSubmit:ft,submitLabel:O?Ue():Ne(),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:He()}),(0,J.jsx)(L,{value:E.name,onChange:e=>D({...E,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:Re()}),(0,J.jsxs)(U,{value:E.roleKey||void 0,onValueChange:e=>D({...E,roleKey:e}),children:[(0,J.jsx)(H,{className:`w-full`,children:(0,J.jsx)(K,{placeholder:We()})}),(0,J.jsx)(W,{children:(m??[]).map(e=>(0,J.jsxs)(V,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(m??[]).find(e=>e.key===E.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:ke()}),(0,J.jsx)(L,{value:E.description,onChange:e=>D({...E,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:rt,onClose:()=>G(null)})]})}function ut({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:[d(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:de()}),(0,J.jsx)(`th`,{children:m()}),(0,J.jsx)(`th`,{children:p()}),(0,J.jsx)(`th`,{children:C()}),(0,J.jsx)(`th`,{children:a()}),(0,J.jsx)(`th`,{children:w()}),(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:I(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(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)?g():c()})})]},t._id))})]})]})}function dt({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)(z,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(F,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(G,{children:[(0,J.jsx)(rt,{children:l()}),(0,J.jsx)(N,{children:_e({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:O()}),(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":o(),children:[n?(0,J.jsx)(j,{}):(0,J.jsx)(B,{}),n?he():k()]})]}),(0,J.jsx)(tt,{children:(0,J.jsx)(M,{onClick:()=>{r(!1),t()},children:b()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?x():I(e)}function mt(e){return e===null?`—`:P(e)}function $(e){return e.disabled?(0,J.jsx)(R,{variant:`destructive`,children:S()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(R,{variant:`outline`,children:T()}):(0,J.jsx)(R,{variant:`outline`,children:E()})}export{Q as ServiceAccountsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,Bo as i,Cs as a,Go as o,Ho as s,Jo as c,Ko as l,LF as u,Qo as d,RF as f,Ss as p,T as m,Uo as h,Vo as g,Wo as _,Xo as v,Yo as y,Zo as b,_s as x,as as S,bs as C,cs as w,ds as T,es as E,fs as D,gs as O,hs as k,is as A,ls as j,ms as M,ns as N,os as P,ps as F,qo as I,rs as L,ss as R,ts as ee,us as z,vs as B,xs as V,ys as H,zo as U}from"./dist-Bkkp8jtC.js";import{t as W}from"./button-Ew8nYfum.js";import{A as G,V as K}from"./index-gP_wjUtq.js";import{t as q}from"./DataTableShell-DMFVXfOQ.js";var J=t(e(),1),Y=n(),X={hung:()=>P(),wrong_result:()=>S(),error:()=>A(),other:()=>L()},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=u(m.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[f,p]=(0,J.useState)(``),[g,x]=(0,J.useState)(!1);async function S(){let t=f.trim();if(!(!t||g)){x(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),p(``)}finally{x(!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),` · `,N({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:ee()}),(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:E()}),i.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?r():d()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:b()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:v(),value:f,maxLength:2e3,rows:3,onChange:e=>p(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 S(),disabled:!f.trim()||g,children:g?c():y()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[I({count:t.children.length}),t.childrenTruncated?` ${l()}`:``,t.textTruncated?` ${o()}`:``]}),(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?` · ${_()}`:``]}),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:h()}),(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:s()}),(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=f(m.subAgentReports.listForAdmin,{}),t=u(m.subAgentReports.readReport),n=u(m.subAgentReports.deleteReport),r=G(),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function d(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function h(e){await r({title:g(),description:i(),confirmLabel:U(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[V(),` `,(0,Y.jsx)(`strong`,{children:C()}),` `,H()]}),(0,Y.jsx)(q,{title:a(),rows:e,emptyHint:p(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:B(),cell:e=>K(e.at),sort:e=>e.at},{header:x(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:O(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:k(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${D({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:M(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:F(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:T()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:z()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?w():j(),onSelect:()=>void d(e)},{label:R(),onSelect:()=>void h(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
|