@lacneu/atrium 0.10.16 → 0.10.18
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-C2TDcMit.js → AccessTab-wgwrrOkq.js} +1 -1
- package/dist/assets/{AdvancedFilter-DrUoj1oY.js → AdvancedFilter-CQA9SSeX.js} +1 -1
- package/dist/assets/AgentFilesTab-DpvNcKxY.js +3 -0
- package/dist/assets/{AnomaliesTab-_Jt6y2Sy.js → AnomaliesTab-CsVaUK9r.js} +1 -1
- package/dist/assets/AuditTab-BCGc5fh-.js +1 -0
- package/dist/assets/{BridgeTab-BhxIgO6W.js → BridgeTab-CI5Pr3zt.js} +1 -1
- package/dist/assets/ChatDefaultsTab-C4KGYhV-.js +1 -0
- package/dist/assets/{DataTableShell-BY48g0WO.js → DataTableShell-B62Qv-tB.js} +1 -1
- package/dist/assets/{DetailChips-B_6c_-iY.js → DetailChips-fND9q0WY.js} +1 -1
- package/dist/assets/FeedbacksTab-xd7LisqB.js +1 -0
- package/dist/assets/{FieldLabel-BrnlMFJq.js → FieldLabel-DkIcKewT.js} +1 -1
- package/dist/assets/FilesTab-BzZTNirP.js +1 -0
- package/dist/assets/{FilterBar-Cn4lFaY4.js → FilterBar-CWlA8nZ0.js} +1 -1
- package/dist/assets/GroupsTab-DDGHlCam.js +1 -0
- package/dist/assets/InstancesTab-CENcOK8c.js +1 -0
- package/dist/assets/{IntegrationsTab-CwPWnqkr.js → IntegrationsTab-DSfAaftT.js} +1 -1
- package/dist/assets/{KpiTab-ChPoG2S2.js → KpiTab-Cn6U4E5D.js} +1 -1
- package/dist/assets/PreferencesTab-SI6PHYsQ.js +1 -0
- package/dist/assets/{PromptInjectionsTab-XzEme_aG.js → PromptInjectionsTab-ZwimzgiF.js} +2 -2
- package/dist/assets/RolesTab-Dm9rHjli.js +1 -0
- package/dist/assets/ServiceAccountsTab-Oxuo-aSo.js +1 -0
- package/dist/assets/ThemeShowroom-O_cVLe2-.js +1 -0
- package/dist/assets/{TimeRangePicker-BCumk2bf.js → TimeRangePicker-CXb27Tev.js} +1 -1
- package/dist/assets/TracesTab-CWvJFPjX.js +1 -0
- package/dist/assets/{UsersTab-1qfp9sce.js → UsersTab-Co8sYpJL.js} +1 -1
- package/dist/assets/button-G-_IqZDp.js +1 -0
- package/dist/assets/{card-B4hdn0Qh.js → card-B3VbgixI.js} +1 -1
- package/dist/assets/chevrons-up-down-BlHpdE9v.js +1 -0
- package/dist/assets/{compatView-BLkCb0a4.js → compatView-hfeNAe7g.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-eTOwTxQJ.js → dispatchErrorInfo-DpmUia7q.js} +1 -1
- package/dist/assets/{dist-D2UVxg3M.js → dist--S7AYRAA.js} +1 -1
- package/dist/assets/dist-0Nx0BXy1.js +5 -0
- package/dist/assets/{dist-CEGGJ9VY.js → dist-BDPwn3r0.js} +1 -1
- package/dist/assets/{dist-CfgJ5RDI.js → dist-CgXYe09h.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CwnBPq8J.js → highlighted-body-OFNGDK62-5MhDiezJ.js} +1 -1
- package/dist/assets/{index-BsbX_-dh.js → index-BmXiVWTf.js} +16 -16
- package/dist/assets/mermaid-GHXKKRXX-CNK1PBuN.js +1 -0
- package/dist/assets/roleDescriptions-I2Mil-DA.js +1 -0
- package/dist/assets/{table-BYj7Kdzy.js → table-xKqB5hyP.js} +1 -1
- package/dist/assets/x-CpLBfKr9.js +1 -0
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/dist/assets/AgentFilesTab-BrBVC0WC.js +0 -3
- package/dist/assets/AuditTab-C-6Oxrdo.js +0 -1
- package/dist/assets/ChatDefaultsTab-C9JLQe-F.js +0 -1
- package/dist/assets/FeedbacksTab-28fA354v.js +0 -1
- package/dist/assets/FilesTab-Bt_1sxvl.js +0 -1
- package/dist/assets/GroupsTab-DNcRR1QL.js +0 -1
- package/dist/assets/InstancesTab-CJtDMRcA.js +0 -1
- package/dist/assets/PreferencesTab-DD8qntSU.js +0 -1
- package/dist/assets/RolesTab-D1aBj2un.js +0 -1
- package/dist/assets/ServiceAccountsTab-D30Lhilu.js +0 -1
- package/dist/assets/ThemeShowroom-BrXPZ7CL.js +0 -1
- package/dist/assets/TracesTab-DW9c-271.js +0 -1
- package/dist/assets/button-ClzO6iiY.js +0 -1
- package/dist/assets/chevrons-up-down-B3gRA_gV.js +0 -1
- package/dist/assets/dist-Ygn7c4YX.js +0 -5
- package/dist/assets/mermaid-GHXKKRXX-BtlnP6HU.js +0 -1
- package/dist/assets/roleDescriptions-Bjw3U0di.js +0 -1
- package/dist/assets/x-TUhW74Oi.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cr as r,Dr as i,Er as a,
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cr as r,Dr as i,Er as a,IC as o,Sr as s,Tr as c,_r as l,br as u,gr as d,gw as f,hr as p,lw as m,mr as h,pr as g,vr as _,wr as v,xr as y,yr as b}from"./dist-CgXYe09h.js";import{C as x,S,b as C,m as w,x as T,y as E}from"./index-BmXiVWTf.js";var D=t(e(),1);function O(e){return e===`user`?l():e===`all`?d():p({group:e.group})}function k(e){return e===`common`?h():e===`owner`?g():p({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)(``),l=f(m.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:i()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(S,{size:`sm`,"aria-label":a(),children:(0,A.jsx)(x,{placeholder:a()})}),(0,A.jsx)(C,{children:(e??[]).map(e=>(0,A.jsx)(T,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):l===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(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:v()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:l.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:l.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:r()}),l.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:l.groups.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:s()}),l.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:l.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(w,{variant:`default`,children:_()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:y()}),l.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:l.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(w,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:u()}),l.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:l.permissions.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Fa as r,Ia as i,La as a,Ma as o,Na as s,Pa as c,Ra as l}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Fa as r,Ia as i,La as a,Ma as o,Na as s,Pa as c,Ra as l}from"./dist-CgXYe09h.js";import{i as u}from"./dist-BDPwn3r0.js";import{r as d}from"./TimeRangePicker-CXb27Tev.js";import{t as f}from"./x-CpLBfKr9.js";import{t as p}from"./button-G-_IqZDp.js";import{C as m,J as h,S as g,b as _,bt as v,x as y,y as b}from"./index-BmXiVWTf.js";var x=t(e(),1),S=n(),C=[{value:`eq`,label:`=`},{value:`neq`,label:`≠`},{value:`contains`,label:l()},{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 l=(0,x.useRef)(t),w=!!(l.current&&l.current.length>0),[D,O]=(0,x.useState)(w),[k,A]=(0,x.useState)(()=>w?E(l.current):[]);function j(e){n(e.filter(e=>e.field!==``&&e.value!==``).map(e=>({field:e.field,op:e.op,value:d(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}),a(),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:i()}):(0,S.jsx)(`ul`,{className:`oc-advfilter__rows`,children:k.map(t=>(0,S.jsxs)(`li`,{className:`oc-advfilter__row`,children:[(0,S.jsxs)(b,{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)(m,{placeholder:r()})}),(0,S.jsx)(_,{children:e.map(e=>(0,S.jsx)(y,{value:e.value,children:e.label},e.value))})]}),(0,S.jsxs)(b,{value:t.op,onValueChange:e=>M(t.id,{op:e}),children:[(0,S.jsx)(g,{size:`sm`,className:`w-28`,children:(0,S.jsx)(m,{})}),(0,S.jsx)(_,{children:C.map(e=>(0,S.jsx)(y,{value:e.value,children:e.label},e.value))})]}),(0,S.jsx)(h,{className:`oc-advfilter__value`,value:t.value,onChange:e=>M(t.id,{value:e.target.value}),placeholder:c()}),(0,S.jsx)(p,{variant:`ghost`,size:`icon-sm`,"aria-label":s(),onClick:()=>P(t.id),children:(0,S.jsx)(f,{})})]},t.id))}),(0,S.jsxs)(p,{variant:`outline`,size:`sm`,className:`oc-advfilter__add`,onClick:N,children:[(0,S.jsx)(v,{}),o()]})]}):null]})}export{D as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,B as i,F as a,G as o,Gt as s,H as c,I as l,IC as u,J as d,K as f,L as p,Q as ee,R as m,RC as te,U as h,Ut as ne,V as g,W as _,X as v,Y as re,Z as y,at as ie,ct as b,et as ae,gw as x,it as S,kv as C,lt as oe,lw as w,nt as T,ot as E,pw as D,q as O,rt as k,st as A,tt as se,ut as j,z as M}from"./dist-CgXYe09h.js";import{t as N}from"./button-G-_IqZDp.js";import{B as P,C as F,F as I,G as L,H as ce,I as le,K as ue,P as de,R as fe,S as R,U as pe,V as me,W as he,_ as z,b as B,j as ge,m as _e,mt as V,ot as H,q as ve,x as U,y as W,z as ye}from"./index-BmXiVWTf.js";import{i as G}from"./compatView-hfeNAe7g.js";/* empty css */var K=t(e(),1),q=2e4,J=6e4;function Y(e){return typeof e!=`number`||e<=0?0:Math.round(e/q*100)}function X(e){return e<=0?0:Math.round(e/J*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function be(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var xe=3;function Se(e,t){let n=new Map;for(let t of e.split(`
|
|
2
|
+
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
3
|
+
`))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<xe&&a.push(e)):t>0&&(i+=t,o.length<xe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function Ce(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function we(){let e=x(w.me.getMe,{host:H}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=x(w.admin.listInstances,e!==void 0&&t?{}:`skip`),[a,o]=(0,K.useState)(null);(0,K.useEffect)(()=>{!t||!i||i.length===0||(!a||!i.some(e=>e.name===a))&&o(i[0].name)},[t,i,a]);let s=x(w.agents.listAgentsForInstance,t&&a?{instanceName:a}:`skip`),c=x(w.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),l=(0,K.useMemo)(()=>{if(e!==void 0){if(t)return a===null||s===void 0?i!==void 0&&i.length===0?[]:void 0:s.agents.map(e=>({instanceName:a,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(c!==void 0)return c.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,a,s,i,c]),[d,f]=(0,K.useState)(null);(0,K.useEffect)(()=>{!l||l.length===0||(!d||!l.some(e=>$(e)===d))&&f($(l[0]))},[l,d]);let p=l?.find(e=>$(e)===d)??null,m=D(w.agentFiles.listAgentFiles),[h,g]=(0,K.useState)({status:`idle`}),_=p?.instanceName??null,v=p?.agentId??null,re=x(w.compat.forInstance,n&&_!==null?{instanceName:_}:`skip`),y=n&&_!==null?z(re,`agentFiles`):null,C=y===null?!1:y===`loading`?null:y.blocked,O=(0,K.useCallback)(async()=>{if(!(_===null||v===null)){g({status:`loading`});try{g({status:`done`,files:(await m({instanceName:_,agentId:v})).files})}catch{g({status:`error`})}}},[m,_,v]);(0,K.useEffect)(()=>{C===!1&&O()},[O,C]);let[M,P]=(0,K.useState)(null),I=te(),L=(0,K.useMemo)(()=>new Intl.NumberFormat(I,{maximumFractionDigits:0}),[I]);return e===void 0||l===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(W,{value:a??``,onValueChange:e=>o(e),children:[(0,Q.jsx)(R,{size:`sm`,"aria-label":oe(),children:(0,Q.jsx)(F,{})}),(0,Q.jsx)(B,{children:(i??[]).map(e=>(0,Q.jsx)(U,{value:e.name,children:e.name},e.name))})]}):null,l.length>0?(0,Q.jsxs)(W,{value:d??``,onValueChange:e=>f(e),children:[(0,Q.jsx)(R,{size:`sm`,"aria-label":b(),children:(0,Q.jsx)(F,{})}),(0,Q.jsx)(B,{children:l.map(e=>(0,Q.jsx)(U,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:A()})]}),p===null?null:y===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):y!==null&&y.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(V,{size:14,"aria-hidden":!0}),` `,G(y.gatewayVersion)]}):h.status===`loading`||h.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):h.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ie(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void O(),children:ne()})]}):h.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:h.files.map(e=>{let n=Y(e.size),i=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(_e,{variant:`outline`,children:S()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:k({size:Z(e.size,I)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${i?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:T({pct:L.format(n)})}),i?(0,Q.jsx)(V,{size:14,className:`oc-afiles__warn`,"aria-label":se()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(N,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>P(e),children:t?r():ee()})]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:ae({used:Z(be(h.files),I),total:Z(J,I),pct:L.format(X(be(h.files)))})})]}),M&&p?(0,Q.jsx)(Te,{instanceName:p.instanceName,agentId:p.agentId,name:M.name,isAdmin:t,onClose:()=>P(null),onSaved:()=>void O()}):null]})}function Te({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:ee,onSaved:ie}){let b=D(w.agentFiles.getAgentFile),ae=D(w.agentFiles.setAgentFile),x=ge(),[S,oe]=(0,K.useState)(null),[T,E]=(0,K.useState)(!1),[k,A]=(0,K.useState)(``),[se,j]=(0,K.useState)(!1),[F,R]=(0,K.useState)(!1),[z,B]=(0,K.useState)(!1),[_e,V]=(0,K.useState)(!1),H=(0,K.useCallback)(async r=>{E(!1);try{let i=await b({instanceName:e,agentId:t,name:n});oe({content:i.content,updatedAtMs:i.updatedAtMs}),r||A(i.content),B(!1)}catch{E(!0)}},[b,e,t,n]);(0,K.useEffect)(()=>{H(!1)},[H]);async function U(){if(S!==null){R(!0),V(!1);try{await ae({instanceName:e,agentId:t,name:n,content:k,baseUpdatedAtMs:S.updatedAtMs??void 0}),x.success(o({name:n})),ie(),await H(!1)}catch(e){Ce(e)?B(!0):V(!0)}finally{R(!1)}}}let W=S!==null&&k!==S.content,G=(0,K.useMemo)(()=>S===null?null:Se(S.content,k),[S,k]),J=k.length>q,Y=te(),X=(0,K.useMemo)(()=>new Intl.NumberFormat(Y),[Y]);return(0,Q.jsx)(de,{open:!0,onOpenChange:e=>!e&&ee(),children:(0,Q.jsxs)(I,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(ye,{children:y({name:n})}),(0,Q.jsxs)(le,{children:[v({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,re()]})]})]}),T?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[h(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void H(!1),children:ne()})]}):S===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:k,readOnly:!r,spellCheck:!1,onChange:e=>A(e.target.value),"aria-label":y({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:d()}),z?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[c(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void H(!0),children:g()})]}):null,_e?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:_()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${J?` is-over`:``}`,children:O({count:X.format(k.length),max:X.format(q)})}),r?(0,Q.jsx)(N,{size:`sm`,disabled:!W||F||z,onClick:()=>j(!0),children:F?s():f()}):null]})]}),(0,Q.jsx)(P,{open:se,onOpenChange:j,children:(0,Q.jsxs)(pe,{children:[(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(ve,{children:i({name:n})}),(0,Q.jsx)(he,{children:M({agent:t})})]}),G?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:m({added:G.added,removed:G.removed})}),G.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:p()}),G.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,G.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:l()}),G.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(L,{children:[(0,Q.jsx)(ce,{children:C()}),(0,Q.jsx)(me,{onClick:()=>void U(),children:a()})]})]})})]})})}export{we as AgentFilesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,Au as i,Bu as ee,Du as a,Eu as o,Fu as te,Gu as ne,Hu as re,Iu as ie,Ju as ae,Ku as
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,Au as i,Bu as ee,Du as a,Eu as o,Fu as te,Gu as ne,Hu as re,Iu as ie,Ju as ae,Ku as s,Lu as c,Mu as l,Nu as u,Ou as d,Pu as f,Qu as p,Ru as oe,Tu as m,Uu as h,Vu as g,Wu as se,Xu as ce,Yu as le,Zu as ue,ad as de,cd as fe,dd as _,ed as pe,fd as v,gw as y,hw as me,id as he,ju as b,ku as x,ld as S,lw as C,nd as w,od as T,qu as E,rd as D,sd as O,td as k,ud as A,wu as j,zu as M}from"./dist-CgXYe09h.js";import{n as N}from"./TimeRangePicker-CXb27Tev.js";import{C as P,M as F,Ot as I,S as L,a as R,b as z,j as ge,kt as _e,m as B,ot as ve,r as ye,x as V,y as H}from"./index-BmXiVWTf.js";import{t as be}from"./FilterBar-CWlA8nZ0.js";import{t as xe}from"./DataTableShell-B62Qv-tB.js";import{t as U}from"./dispatchErrorInfo-DpmUia7q.js";var W=t(e(),1),G=n(),K=`__all__`,Se=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Ce(e){return e===`open`?v():e===`acknowledged`?_():A()}var we=[`info`,`warn`,`critical`],Te=[`detector`,`agent`],Ee={kind:`relative`,from:`now-30d`,to:`now`},De=200,q=`all`;function J(){let e=_e({from:`/settings/anomalies`}),t=I({from:`/settings/anomalies`}),n=e.q??``,a=e.status===q?K:e.status,o=e.severity??K,m=e.kind??K,[_,v]=(0,W.useState)(K),A=ye(e.from,e.to),{from:j,to:U}=N(A),J=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Y=e=>void t({search:t=>({...t,status:e===K?q:e})}),Me=e=>void t({search:t=>({...t,severity:e===K?void 0:e})}),Ne=e=>void t({search:t=>({...t,kind:e===K?void 0:e})}),X=e=>void t({search:t=>({...t,...R(e)})}),Pe=F(),Z=ge(),Q=me(C.anomalies.resolveAnomaly),Fe=(y(C.me.getMe,{host:ve})?.permissions??[]).includes(`admin.manage`),$=y(C.anomalies.listAnomalies,{limit:De,filter:{q:n||void 0,from:j,to:U,anomalyStatus:a===K?void 0:a,severity:o===K?void 0:o,source:_===K?void 0:_,kind:m===K?void 0:m}}),Ie=(0,W.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Le=n!==``||a!==`open`||o!==K||_!==K||m!==K||A.kind!==`relative`||A.from!==Ee.from;function Re(){v(K),t({search:{status:`open`},replace:!0})}async function ze(e){if(await Pe({title:S(),description:(0,G.jsxs)(G.Fragment,{children:[fe(),` `,(0,G.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,O(),` `,(0,G.jsx)(`strong`,{children:T()}),`.`,` `,de()]}),confirmLabel:he()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(D(),e.kind)}catch(e){Z.error(w(),e)}}async function Be(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(k(),e.kind)}catch(e){Z.error(pe(),e)}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:`oc-admin__hint`,children:[r(),` `,(0,G.jsx)(`strong`,{children:p()}),` `,ue(),` `,(0,G.jsx)(`strong`,{children:ce()}),` `,le(),` `,(0,G.jsx)(`strong`,{children:ae()}),` `,E(),` `,(0,G.jsx)(`span`,{className:`oc-filter__window`,children:s()})]}),(0,G.jsxs)(be,{q:n,onQChange:J,searchPlaceholder:ne(),timeRange:A,onTimeRangeChange:X,onReset:Re,canReset:Le,children:[(0,G.jsxs)(H,{value:a,onValueChange:Y,children:[(0,G.jsx)(L,{size:`sm`,className:`w-36`,children:(0,G.jsx)(P,{})}),(0,G.jsxs)(z,{children:[(0,G.jsx)(V,{value:K,children:se()}),Se.map(e=>(0,G.jsx)(V,{value:e.value,children:Ce(e.value)},e.value))]})]}),(0,G.jsxs)(H,{value:o,onValueChange:Me,children:[(0,G.jsx)(L,{size:`sm`,className:`w-36`,children:(0,G.jsx)(P,{placeholder:h()})}),(0,G.jsxs)(z,{children:[(0,G.jsx)(V,{value:K,children:re()}),we.map(e=>(0,G.jsx)(V,{value:e,children:e},e))]})]}),(0,G.jsxs)(H,{value:_,onValueChange:v,children:[(0,G.jsx)(L,{size:`sm`,className:`w-32`,children:(0,G.jsx)(P,{placeholder:g()})}),(0,G.jsxs)(z,{children:[(0,G.jsx)(V,{value:K,children:ee()}),Te.map(e=>(0,G.jsx)(V,{value:e,children:e},e))]})]}),(0,G.jsxs)(H,{value:m,onValueChange:Ne,children:[(0,G.jsx)(L,{size:`sm`,className:`w-36`,children:(0,G.jsx)(P,{placeholder:M()})}),(0,G.jsxs)(z,{children:[(0,G.jsx)(V,{value:K,children:oe()}),Ie.map(e=>(0,G.jsx)(V,{value:e,children:e},e))]})]})]}),(0,G.jsx)(xe,{title:c(),rows:$,emptyHint:a===`open`?ie():te(),rowActions:e=>Fe&&e.status===`open`?[{label:f(),onSelect:()=>void ze(e)},{label:u(),onSelect:()=>void Be(e)}]:[],columns:[{header:l(),cell:e=>(0,G.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:M(),cell:e=>(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:h(),cell:e=>(0,G.jsx)(ke,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:b(),cell:e=>(0,G.jsx)(Ae,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:g(),cell:e=>(0,G.jsx)(B,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:i(),cell:e=>(0,G.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:x(),cell:e=>(0,G.jsx)(Oe,{row:e}),sort:e=>e.evidence??null},{header:d(),cell:e=>e.correlationId?(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:je(e.correlationId)}):(0,G.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Y(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 Oe({row:e}){let t=I(),n=Y(e);if(!n.dominantCode)return(0,G.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=U(n.dominantCode),i=n.sampleCorrelationId;return(0,G.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,G.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,G.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,G.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,G.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,a()]}):null]})}function ke({severity:e}){return(0,G.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Ae({status:e}){return e===`open`?(0,G.jsx)(B,{variant:`destructive`,children:o()}):e===`acknowledged`?(0,G.jsx)(B,{variant:`secondary`,children:m()}):(0,G.jsx)(B,{variant:`outline`,children:j()})}function je(e){return e.length>8?e.slice(0,8):e}export{J as AnomaliesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{_f as r,af as i,cf as a,df as o,ff as s,gf as c,gw as l,hf as u,if as ee,lf as d,lw as f,mf as p,of as m,pf as h,rf as g,sf as _,uf as v}from"./dist-CgXYe09h.js";import{n as y}from"./TimeRangePicker-CXb27Tev.js";import{C as b,Ot as x,S,a as C,b as w,i as T,kt as E,o as D,r as O,t as k,x as A,y as j}from"./index-BmXiVWTf.js";import{t as M}from"./FilterBar-CWlA8nZ0.js";import{t as N}from"./AdvancedFilter-CQA9SSeX.js";import{t as P}from"./DataTableShell-B62Qv-tB.js";var F=t(e(),1),I=n(),L={kind:`relative`,from:k,to:`now`},R=`__all__`,z=[{value:`action`,label:`action`},{value:`realLabel`,label:`acteur réel`},{value:`targetLabel`,label:`au nom de`},{value:`impersonated`,label:`usurpation`},{value:`resource`,label:`ressource`},{value:`resourceId`,label:`id ressource`}];function B(){let e=E({from:`/settings/audit`}),t=x({from:`/settings/audit`}),n=e.q??``,k=e.action??R,B=e.impersonated??R,V=e.resource??R,H=O(e.from,e.to),U=(0,F.useMemo)(()=>D(e.adv),[e.adv]),{from:W,to:G}=y(H),K=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),q=e=>void t({search:t=>({...t,action:e===R?void 0:e})}),J=e=>void t({search:t=>({...t,impersonated:e===R?void 0:e})}),Y=e=>void t({search:t=>({...t,resource:e===R?void 0:e})}),X=e=>void t({search:t=>({...t,...C(e)})}),Z=e=>void t({search:t=>({...t,adv:T(e)}),replace:!0}),Q=l(f.admin.listAudit,{filter:{q:n||void 0,from:W,to:G,action:k===R?void 0:k,resource:V===R?void 0:V,impersonated:B===R?void 0:B===`yes`,advanced:U.length>0?U:void 0}}),$=(0,F.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.action);return[...e].sort()},[Q]),te=(0,F.useMemo)(()=>{let e=new Set;for(let t of Q??[])t.resource&&e.add(t.resource);return[...e].sort()},[Q]),ne=n!==``||k!==R||B!==R||V!==R||U.length>0||H.kind!==`relative`||H.from!==L.from;function re(){t({search:{},replace:!0})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[r(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:c()})]}),(0,I.jsxs)(M,{q:n,onQChange:K,searchPlaceholder:u(),timeRange:H,onTimeRangeChange:X,onReset:re,canReset:ne,children:[(0,I.jsxs)(j,{value:k,onValueChange:q,children:[(0,I.jsx)(S,{size:`sm`,className:`w-40`,children:(0,I.jsx)(b,{placeholder:p()})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(A,{value:R,children:h()}),$.map(e=>(0,I.jsx)(A,{value:e,children:e},e))]})]}),(0,I.jsxs)(j,{value:B,onValueChange:J,children:[(0,I.jsx)(S,{size:`sm`,className:`w-40`,children:(0,I.jsx)(b,{})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(A,{value:R,children:s()}),(0,I.jsx)(A,{value:`yes`,children:o()}),(0,I.jsx)(A,{value:`no`,children:v()})]})]}),(0,I.jsxs)(j,{value:V,onValueChange:Y,children:[(0,I.jsx)(S,{size:`sm`,className:`w-40`,children:(0,I.jsx)(b,{placeholder:d()})}),(0,I.jsxs)(w,{children:[(0,I.jsx)(A,{value:R,children:a()}),te.map(e=>(0,I.jsx)(A,{value:e,children:e},e))]})]})]}),(0,I.jsx)(N,{fields:z,seed:U,onChange:Z}),(0,I.jsx)(P,{title:_(),rows:Q,emptyHint:m(),columns:[{header:i(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:p(),cell:e=>e.action,sort:e=>e.action},{header:ee(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:g(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:d(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{B as AuditTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{As as r,Bs as i,Cs as a,Ds as o,Ec as s,Es as c,Fs as l,Gs as u,Hs as d,Is as f,Ls as p,Ms as m,Ns as h,Os as g,Ps as _,Rs as ee,Sc as te,Ss as v,Tc as y,Ts as b,Us as ne,Vs as re,Ws as ie,_ as x,_c as ae,_s as S,a as C,as as w,b as oe,bc as se,bs as ce,cs as le,cw as T,d as ue,ds as de,f as fe,fs as pe,fw as me,g as he,gc as ge,gs as _e,h as ve,hc as ye,hs as be,hw as E,is as D,js as xe,ks as Se,l as Ce,ls as we,lw as Te,m as Ee,mc as De,ms as Oe,mw as ke,os as Ae,p as je,pc as Me,ps as Ne,rs as Pe,ss as Fe,u as Ie,us as Le,v as Re,vc as ze,vs as Be,wc as Ve,ws as He,xc as Ue,xs as We,y as Ge,yc as Ke,ys as qe,zs as Je}from"./dist-CfgJ5RDI.js";import{i as O,r as Ye}from"./dist-CEGGJ9VY.js";import{t as Xe}from"./chevrons-up-down-B3gRA_gV.js";import{a as Ze,i as Qe,n as k,o as $e,r as et}from"./FieldLabel-BrnlMFJq.js";import{t as A}from"./button-ClzO6iiY.js";import{$ as tt,C as j,Ct as nt,Dt as rt,Et as M,F as it,I as at,J as N,O as ot,Ot as st,P as ct,Q as lt,R as ut,S as P,St as dt,X as ft,Y as pt,Z as mt,_t as ht,b as F,et as gt,j as _t,m as I,mt as L,ot as vt,rt as yt,x as R,y as z,z as bt}from"./index-BsbX_-dh.js";import{a as xt,i as B,n as St,o as V,r as H,t as Ct}from"./table-BYj7Kdzy.js";import{t as wt}from"./FilterBar-Cn4lFaY4.js";import{a as U,n as Tt,o as W,r as G,s as Et,t as Dt}from"./compatView-BLkCb0a4.js";import{t as K}from"./dispatchErrorInfo-eTOwTxQJ.js";var Ot=Te(`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`}]]),kt=Te(`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`}]]),q=t(e(),1);function At(e){return e.filter(e=>e.state===`error`)}function jt(e){return e.reachable&&At(e.targets).length===0}function Mt(e){return e.state===`error`&&e.lastErrorCode!==null}function Nt(e){return!!e.lastDownstreamRejectCode}function J(e){return e.kind??`openclaw`}function Pt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Ft(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,J(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(J(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Pt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>J(e)===r)}))}function It(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,Lt={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function Rt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function zt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Bt(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Vt(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return W(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function Ht(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Bt(t.key,e),a=Bt(t.key,r);return i&&a?0:i?1:a?-1:n*Vt(t.key,e,r)})}function Ut(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function Wt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function Gt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>W(e,t)??Z(e,t))}var Q=n();function Kt({connections:e,displayByInstance:t}){let[n,r]=(0,q.useState)(Lt),[i,a]=(0,q.useState)(null),o=(0,q.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),s=(0,q.useMemo)(()=>Ut(o),[o]),c=(0,q.useMemo)(()=>Wt(o),[o]),l=(0,q.useMemo)(()=>Gt(o),[o]),u=(0,q.useMemo)(()=>Ht(zt(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(wt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Be(),onReset:()=>r(Lt),canReset:Rt(n),children:[(0,Q.jsxs)(z,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(j,{placeholder:_e()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(R,{value:Y,children:S()}),s.map(e=>(0,Q.jsx)(R,{value:e,children:Jt(e)},e))]})]}),(0,Q.jsxs)(z,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(j,{placeholder:be()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(R,{value:Y,children:S()}),c.map(e=>(0,Q.jsx)(R,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(z,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(j,{placeholder:Oe()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(R,{value:Y,children:S()}),l.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))]})]})]}),u.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}):(0,Q.jsxs)(Ct,{className:`oc-conn__table`,children:[(0,Q.jsx)(xt,{children:(0,Q.jsxs)(V,{children:[(0,Q.jsx)($,{label:pe(),sortKey:`target`,sort:i,onSort:d}),(0,Q.jsx)($,{label:de(),sortKey:`state`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Le(),sortKey:`instance`,sort:i,onSort:d}),(0,Q.jsx)($,{label:we(),sortKey:`host`,sort:i,onSort:d}),(0,Q.jsx)($,{label:le(),sortKey:`version`,sort:i,onSort:d}),(0,Q.jsx)(B,{children:Fe()}),(0,Q.jsx)($,{label:Ae(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Q.jsx)(St,{children:u.map(e=>(0,Q.jsx)(qt,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(B,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(Ye,{size:13,"aria-hidden":!0}):(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Xe,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function qt({r:e}){let t=Mt(e)?K(e.lastErrorCode):null,n=Nt(e)?K(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(q.Fragment,{children:[(0,Q.jsxs)(V,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(H,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(Yt,{state:e.state})}),(0,Q.jsx)(H,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(H,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:ce({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(H,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(V,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(H,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[qe({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Jt(e){return e===`connected`?w():e===`error`?D():Pe()}function Yt({state:e}){return e===`connected`?(0,Q.jsx)(I,{variant:`secondary`,children:w()}):e===`error`?(0,Q.jsx)(I,{variant:`destructive`,children:D()}):(0,Q.jsx)(I,{variant:`outline`,children:Pe()})}function Xt(){return E(T.bridgeHealth.getBridgeHealth,{})}function Zt(){let e=Xt(),t=E(T.compat.getBridgeCompat,{}),n=E(T.me.getMe,{host:vt})?.role===`admin`,r=E(T.admin.listInstances,n?{}:`skip`),i=st(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=Ft(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&Tt(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(Qt,{health:e,compat:t,onSeeAnomalies:a}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:xe()}),o.map(e=>(0,Q.jsx)($t,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):null]})}function Qt({health:e,compat:t,onSeeAnomalies:n}){let i=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:U(t.bridgeVersion)}),` · `,Re(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?x():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Se()});let s=At(e.targets),l=!e.reachable,u=jt(e),d=u?`ok`:`error`,f=new Date(e.checkedAt).toLocaleString(`fr-FR`),p=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${d}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u?(0,Q.jsx)(M,{size:22}):l?(0,Q.jsx)(kt,{size:22}):(0,Q.jsx)(L,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:u?g():l?o():c({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Ot,{size:12,"aria-hidden":!0}),` `,b({time:f})]}),p?(0,Q.jsx)(`span`,{children:He({time:p})}):null,i]}),l?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:K(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:a()})]})}function $t({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?Et(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:Dt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),g=m===null?null:n.find(e=>e.name===m)??null,_=new Set(n.map(e=>e.name));return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(ht,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:It(e)}),d?(0,Q.jsx)(I,{variant:d===`beyond`?`destructive`:`secondary`,children:G(d)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:oe()}),(0,Q.jsx)(en,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c,canConfigure:e=>_.has(e),onConfigure:h}),(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(rt,{size:13,"aria-hidden":!0}),v({count:t.length})]}),f?(0,Q.jsx)(Kt,{connections:t,displayByInstance:s}):null,g?(0,Q.jsx)(tn,{instance:g,onClose:()=>h(null)},g._id):null]})}function en({support:e,compatStatus:t,compatReachable:n,manifest:i,instanceRows:a,canConfigure:o,onConfigure:s}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:he()}),i===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Ee()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:je({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:x()}),e?(0,Q.jsx)(an,{versions:e.validatedVersions}):null]}),a.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:a.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:U(e.version)}),(0,Q.jsx)(I,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:G(e.state)}),o(e.instanceName)?(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(yt,{asChild:!0,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon`,className:`oc-compat__target-menu`,"aria-label":y(),children:(0,Q.jsx)(nt,{size:16,"aria-hidden":!0})})}),(0,Q.jsx)(tt,{align:`end`,children:(0,Q.jsx)(gt,{onSelect:()=>s(e.instanceName),children:y()})})]}):null]},e.instanceName))})]})}function tn({instance:e,onClose:t}){return(0,Q.jsx)(ct,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(it,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsx)(bt,{children:s({instance:e.displayName??e.name})}),(0,Q.jsx)(at,{children:Ve()})]}),(0,Q.jsx)(rn,{instance:e,onClose:t})]})})}function nn({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(M,{"aria-hidden":!0}):(0,Q.jsx)(L,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?l():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,_()]}):null}function rn({instance:e,onClose:t}){let n=ke(T.admin.upsertInstanceConfig),r=me(T.bridge.validateMediaPaths),a=_t(),[o,s]=(0,q.useState)(()=>Qe(e.config??{})),[c,l]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(null),b=o.inboundMediaMode===`shared-fs`,x=o.mediaMode===`shared-fs`,S=b||x;async function C(){_(!0),y(null);try{y(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){a.error(Je(),e)}finally{_(!1)}}async function w(){l(!0);try{let r=e.config??{};await n({instanceId:e._id,config:et(o,r)}),t()}catch(e){a.error(ae(),e)}finally{l(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:te(),help:ge()}),(0,Q.jsxs)(z,{value:o.mediaMode,onValueChange:e=>s({...o,mediaMode:e}),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(j,{})}),(0,Q.jsx)(F,{children:$e.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Ue(),help:ye()}),(0,Q.jsxs)(z,{value:o.inboundMediaMode,onValueChange:e=>s({...o,inboundMediaMode:e}),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(j,{})}),(0,Q.jsx)(F,{children:Ze.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:se(),help:De()}),(0,Q.jsx)(N,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>s({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),S&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:u(),help:ie()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>s({...o,inboundAgentMount:e.target.value})})]}),x&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:ne(),help:d()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>s({...o,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(ot,{checked:o.rehydration,onCheckedChange:e=>s({...o,rehydration:e===!0})}),(0,Q.jsx)(k,{label:Ke(),help:Me()})]}),S&&v!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:v.reachable?!v.inbound&&!v.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),m({reason:v.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(nn,{label:p(),result:v.inbound}),(0,Q.jsx)(nn,{label:f(),result:v.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ee()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),h()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[S&&(0,Q.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void C(),disabled:g,children:[g?(0,Q.jsx)(dt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,g?i():re()]}),(0,Q.jsx)(A,{size:`sm`,onClick:()=>void w(),disabled:c,children:ze()})]})]})})}function an({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(pt,{children:[(0,Q.jsx)(mt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?fe():ue({count:e.length}),(0,Q.jsx)(O,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(ft,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:Ie()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(I,{variant:`secondary`,children:e},e))})]})]})}export{Zt as BridgeTab,tn as InstanceConfigDialog};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{As as r,Bs as i,Cs as a,Ds as o,Ec as s,Es as c,Fs as l,Gs as u,Hs as d,Is as f,Ls as p,Ms as m,Ns as h,Os as g,Ps as _,Rs as ee,Sc as te,Ss as v,Tc as y,Ts as b,Us as ne,Vs as re,Ws as ie,_ as x,_c as ae,_s as S,a as C,as as w,b as oe,bc as se,bs as ce,cs as le,d as ue,ds as de,f as fe,fs as pe,g as me,gc as he,gs as ge,gw as T,h as _e,hc as ve,hs as ye,hw as be,is as E,js as xe,ks as Se,l as Ce,ls as we,lw as D,m as Te,mc as Ee,ms as De,os as Oe,p as ke,pc as Ae,ps as je,pw as Me,rs as Ne,ss as Pe,u as Fe,us as Ie,uw as Le,v as Re,vc as ze,vs as Be,wc as Ve,ws as He,xc as Ue,xs as We,y as Ge,yc as Ke,ys as qe,zs as Je}from"./dist-CgXYe09h.js";import{i as O,r as Ye}from"./dist-BDPwn3r0.js";import{t as Xe}from"./chevrons-up-down-BlHpdE9v.js";import{a as Ze,i as Qe,n as k,o as $e,r as et}from"./FieldLabel-DkIcKewT.js";import{t as A}from"./button-G-_IqZDp.js";import{$ as tt,C as j,Ct as nt,Dt as rt,Et as M,F as it,I as at,J as N,O as ot,Ot as st,P as ct,Q as lt,R as ut,S as P,St as dt,X as ft,Y as pt,Z as mt,_t as ht,b as F,et as gt,j as _t,m as I,mt as L,ot as vt,rt as yt,x as R,y as z,z as bt}from"./index-BmXiVWTf.js";import{a as xt,i as B,n as St,o as V,r as H,t as Ct}from"./table-xKqB5hyP.js";import{t as wt}from"./FilterBar-CWlA8nZ0.js";import{a as U,n as Tt,o as W,r as G,s as Et,t as Dt}from"./compatView-hfeNAe7g.js";import{t as K}from"./dispatchErrorInfo-DpmUia7q.js";var Ot=Le(`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`}]]),kt=Le(`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`}]]),q=t(e(),1);function At(e){return e.filter(e=>e.state===`error`)}function jt(e){return e.reachable&&At(e.targets).length===0}function Mt(e){return e.state===`error`&&e.lastErrorCode!==null}function Nt(e){return!!e.lastDownstreamRejectCode}function J(e){return e.kind??`openclaw`}function Pt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Ft(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,J(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(J(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Pt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>J(e)===r)}))}function It(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,Lt={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function Rt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function zt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Bt(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Vt(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return W(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function Ht(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Bt(t.key,e),a=Bt(t.key,r);return i&&a?0:i?1:a?-1:n*Vt(t.key,e,r)})}function Ut(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function Wt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function Gt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>W(e,t)??Z(e,t))}var Q=n();function Kt({connections:e,displayByInstance:t}){let[n,r]=(0,q.useState)(Lt),[i,a]=(0,q.useState)(null),o=(0,q.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),s=(0,q.useMemo)(()=>Ut(o),[o]),c=(0,q.useMemo)(()=>Wt(o),[o]),l=(0,q.useMemo)(()=>Gt(o),[o]),u=(0,q.useMemo)(()=>Ht(zt(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:We()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(wt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Be(),onReset:()=>r(Lt),canReset:Rt(n),children:[(0,Q.jsxs)(z,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(j,{placeholder:ge()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(R,{value:Y,children:S()}),s.map(e=>(0,Q.jsx)(R,{value:e,children:Jt(e)},e))]})]}),(0,Q.jsxs)(z,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(j,{placeholder:ye()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(R,{value:Y,children:S()}),c.map(e=>(0,Q.jsx)(R,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(z,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(j,{placeholder:De()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(R,{value:Y,children:S()}),l.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))]})]})]}),u.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:je()}):(0,Q.jsxs)(Ct,{className:`oc-conn__table`,children:[(0,Q.jsx)(xt,{children:(0,Q.jsxs)(V,{children:[(0,Q.jsx)($,{label:pe(),sortKey:`target`,sort:i,onSort:d}),(0,Q.jsx)($,{label:de(),sortKey:`state`,sort:i,onSort:d}),(0,Q.jsx)($,{label:Ie(),sortKey:`instance`,sort:i,onSort:d}),(0,Q.jsx)($,{label:we(),sortKey:`host`,sort:i,onSort:d}),(0,Q.jsx)($,{label:le(),sortKey:`version`,sort:i,onSort:d}),(0,Q.jsx)(B,{children:Pe()}),(0,Q.jsx)($,{label:Oe(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Q.jsx)(St,{children:u.map(e=>(0,Q.jsx)(qt,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(B,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(Ye,{size:13,"aria-hidden":!0}):(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Xe,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function qt({r:e}){let t=Mt(e)?K(e.lastErrorCode):null,n=Nt(e)?K(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(q.Fragment,{children:[(0,Q.jsxs)(V,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(H,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(Yt,{state:e.state})}),(0,Q.jsx)(H,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(H,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(H,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:ce({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(H,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(V,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(H,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[qe({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Jt(e){return e===`connected`?w():e===`error`?E():Ne()}function Yt({state:e}){return e===`connected`?(0,Q.jsx)(I,{variant:`secondary`,children:w()}):e===`error`?(0,Q.jsx)(I,{variant:`destructive`,children:E()}):(0,Q.jsx)(I,{variant:`outline`,children:Ne()})}function Xt(){return T(D.bridgeHealth.getBridgeHealth,{})}function Zt(){let e=Xt(),t=T(D.compat.getBridgeCompat,{}),n=T(D.me.getMe,{host:vt})?.role===`admin`,r=T(D.admin.listInstances,n?{}:`skip`),i=st(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=Ft(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&Tt(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(Qt,{health:e,compat:t,onSeeAnomalies:a}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:xe()}),o.map(e=>(0,Q.jsx)($t,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):null]})}function Qt({health:e,compat:t,onSeeAnomalies:n}){let i=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:U(t.bridgeVersion)}),` · `,Re(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?x():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Se()});let s=At(e.targets),l=!e.reachable,u=jt(e),d=u?`ok`:`error`,f=new Date(e.checkedAt).toLocaleString(`fr-FR`),p=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${d}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u?(0,Q.jsx)(M,{size:22}):l?(0,Q.jsx)(kt,{size:22}):(0,Q.jsx)(L,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:u?g():l?o():c({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Ot,{size:12,"aria-hidden":!0}),` `,b({time:f})]}),p?(0,Q.jsx)(`span`,{children:He({time:p})}):null,i]}),l?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:K(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:a()})]})}function $t({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?Et(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:Dt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),g=m===null?null:n.find(e=>e.name===m)??null,_=new Set(n.map(e=>e.name));return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(ht,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:It(e)}),d?(0,Q.jsx)(I,{variant:d===`beyond`?`destructive`:`secondary`,children:G(d)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:oe()}),(0,Q.jsx)(en,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c,canConfigure:e=>_.has(e),onConfigure:h}),(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(rt,{size:13,"aria-hidden":!0}),v({count:t.length})]}),f?(0,Q.jsx)(Kt,{connections:t,displayByInstance:s}):null,g?(0,Q.jsx)(tn,{instance:g,onClose:()=>h(null)},g._id):null]})}function en({support:e,compatStatus:t,compatReachable:n,manifest:i,instanceRows:a,canConfigure:o,onConfigure:s}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:me()}),i===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_e()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Te()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:ke({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:x()}),e?(0,Q.jsx)(an,{versions:e.validatedVersions}):null]}),a.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ce()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:a.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:U(e.version)}),(0,Q.jsx)(I,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:G(e.state)}),o(e.instanceName)?(0,Q.jsxs)(lt,{children:[(0,Q.jsx)(yt,{asChild:!0,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon`,className:`oc-compat__target-menu`,"aria-label":y(),children:(0,Q.jsx)(nt,{size:16,"aria-hidden":!0})})}),(0,Q.jsx)(tt,{align:`end`,children:(0,Q.jsx)(gt,{onSelect:()=>s(e.instanceName),children:y()})})]}):null]},e.instanceName))})]})}function tn({instance:e,onClose:t}){return(0,Q.jsx)(ct,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(it,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(ut,{children:[(0,Q.jsx)(bt,{children:s({instance:e.displayName??e.name})}),(0,Q.jsx)(at,{children:Ve()})]}),(0,Q.jsx)(rn,{instance:e,onClose:t})]})})}function nn({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(M,{"aria-hidden":!0}):(0,Q.jsx)(L,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?l():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,_()]}):null}function rn({instance:e,onClose:t}){let n=be(D.admin.upsertInstanceConfig),r=Me(D.bridge.validateMediaPaths),a=_t(),[o,s]=(0,q.useState)(()=>Qe(e.config??{})),[c,l]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(null),b=o.inboundMediaMode===`shared-fs`,x=o.mediaMode===`shared-fs`,S=b||x;async function C(){_(!0),y(null);try{y(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){a.error(Je(),e)}finally{_(!1)}}async function w(){l(!0);try{let r=e.config??{};await n({instanceId:e._id,config:et(o,r)}),t()}catch(e){a.error(ae(),e)}finally{l(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:te(),help:he()}),(0,Q.jsxs)(z,{value:o.mediaMode,onValueChange:e=>s({...o,mediaMode:e}),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(j,{})}),(0,Q.jsx)(F,{children:$e.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Ue(),help:ve()}),(0,Q.jsxs)(z,{value:o.inboundMediaMode,onValueChange:e=>s({...o,inboundMediaMode:e}),children:[(0,Q.jsx)(P,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(j,{})}),(0,Q.jsx)(F,{children:Ze.map(e=>(0,Q.jsx)(R,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:se(),help:Ee()}),(0,Q.jsx)(N,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>s({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),S&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:u(),help:ie()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>s({...o,inboundAgentMount:e.target.value})})]}),x&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:ne(),help:d()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>s({...o,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(ot,{checked:o.rehydration,onCheckedChange:e=>s({...o,rehydration:e===!0})}),(0,Q.jsx)(k,{label:Ke(),help:Ae()})]}),S&&v!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:v.reachable?!v.inbound&&!v.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),m({reason:v.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(nn,{label:p(),result:v.inbound}),(0,Q.jsx)(nn,{label:f(),result:v.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ee()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),h()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[S&&(0,Q.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void C(),disabled:g,children:[g?(0,Q.jsx)(dt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,g?i():re()]}),(0,Q.jsx)(A,{size:`sm`,onClick:()=>void w(),disabled:c,children:ze()})]})]})})}function an({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(pt,{children:[(0,Q.jsx)(mt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?fe():ue({count:e.length}),(0,Q.jsx)(O,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(ft,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:Fe()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(I,{variant:`secondary`,children:e},e))})]})]})}export{Zt as BridgeTab,tn as InstanceConfigDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{A as r,C as i,Cc as a,D as o,E as s,Gt as c,IC as l,M as ee,N as te,O as ne,Rt as re,S as ie,T as ae,Ut as u,gw as d,j as oe,k as f,kv as p,lt as m,lw as h,pw as g,w as se,x as ce,zt as le}from"./dist-CgXYe09h.js";import{t as _}from"./button-G-_IqZDp.js";import{B as ue,C as de,G as fe,H as pe,K as me,S as he,U as v,V as y,W as b,_ as x,b as S,g as C,j as w,mt as T,q as E,v as D,x as O,y as k}from"./index-BmXiVWTf.js";import{i as A}from"./compatView-hfeNAe7g.js";/* empty css */var j=t(e(),1),M=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function N(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}var P=n();function F(){let e=g(h.agentFiles.getChatDefaults),t=g(h.agentFiles.setChatDefaults),n=w(),[F,I]=(0,j.useState)({status:`loading`}),[L,R]=(0,j.useState)({thinkingDefault:null,fastModeDefault:null}),[ge,z]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1),H=d(h.admin.listInstances,{}),[U,W]=(0,j.useState)(null);(0,j.useEffect)(()=>{!H||H.length===0||(!U||!H.some(e=>e.name===U))&&W(H[0].name)},[H,U]);let G=(H?.length??0)>1,_e=H!==void 0&&H.length===0,ve=d(h.compat.forInstance,U?{instanceName:U}:`skip`),K=U?x(ve,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,j.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,j.useRef)(0),X=(0,j.useCallback)(async()=>{let t=++Y.current;I({status:`loading`});try{let n=N(await e(J));if(Y.current!==t)return;I({status:`done`,current:n}),R(n)}catch{if(Y.current!==t)return;I({status:`error`})}},[e,J]);(0,j.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=F.status===`done`?F.current:null,Q=Z!==null&&L.thinkingDefault!==null&&L.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&L.fastModeDefault!==null&&L.fastModeDefault!==Z.fastModeDefault,ye=Q||$;async function be(){V(!0);try{await t({...J,...Q?{thinkingDefault:L.thinkingDefault}:{},...$?{fastModeDefault:L.fastModeDefault}:{}}),n.success(s()),await X()}catch(e){n.error(ae(),e)}finally{V(!1)}}let xe=(0,j.useMemo)(()=>M.map(e=>({id:e,label:D(e)})),[]),Se=(0,j.useMemo)(()=>[{id:`fast`,label:le()},{id:`standard`,label:re()}],[]);return(0,P.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:te()}),G&&U?(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:m()}),(0,P.jsxs)(k,{value:U,onValueChange:e=>W(e),disabled:B,children:[(0,P.jsx)(he,{size:`sm`,"aria-label":m(),children:(0,P.jsx)(de,{})}),(0,P.jsx)(S,{children:(H??[]).map(e=>(0,P.jsx)(O,{value:e.name,children:e.name},e.name))})]})]}):null,_e?(0,P.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:a()}):K===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):K.blocked?(0,P.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,P.jsx)(T,{size:14,"aria-hidden":!0}),` `,A(K.gatewayVersion)]}):F.status===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):F.status===`error`?(0,P.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[ne(),` `,(0,P.jsx)(_,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:u()})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:ee()}),(0,P.jsx)(C,{options:xe,value:L.thinkingDefault,onChange:e=>R({...L,thinkingDefault:e}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:oe()})]}),(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()}),(0,P.jsx)(C,{options:Se,value:L.fastModeDefault===null?null:L.fastModeDefault?`fast`:`standard`,onChange:e=>R({...L,fastModeDefault:e===`fast`}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:f()})]}),(0,P.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,P.jsx)(_,{size:`sm`,disabled:!ye||B,onClick:()=>z(!0),children:B?c():o()})}),(0,P.jsx)(`p`,{className:`oc-cdefaults__note`,children:se()})]}),(0,P.jsx)(ue,{open:ge,onOpenChange:z,children:(0,P.jsxs)(v,{children:[(0,P.jsxs)(me,{children:[(0,P.jsx)(E,{children:i()}),(0,P.jsx)(b,{children:ie()})]}),(0,P.jsxs)(fe,{children:[(0,P.jsx)(pe,{children:p()}),(0,P.jsx)(y,{onClick:()=>void be(),children:ce()})]})]})})]})}export{F as ChatDefaultsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Gi as r,Ji as i,Ki as a,Wi as o,Xi as s,Yi as c,qi as l}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Gi as r,Ji as i,Ki as a,Wi as o,Xi as s,Yi as c,qi as l}from"./dist-CgXYe09h.js";import{i as u,r as d}from"./dist-BDPwn3r0.js";import{t as f}from"./chevrons-up-down-BlHpdE9v.js";import{t as p}from"./button-G-_IqZDp.js";import{$ as m,Ct as h,O as g,Q as _,bt as v,et as y,ht as b,nt as x,rt as S}from"./index-BmXiVWTf.js";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./table-xKqB5hyP.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=c(),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)(b,{}):null,e.label,` (`,z.size,`)`]},e.label)):null,N?(0,M.jsxs)(p,{size:`sm`,onClick:N,children:[(0,M.jsx)(v,{}),` `,P]}):null]})]}),t===void 0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):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)(g,{"aria-label":l(),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":o({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)??[],i=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)(g,{"aria-label":a(),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)(_,{children:[(0,M.jsx)(S,{asChild:!0,children:(0,M.jsx)(p,{variant:`ghost`,size:`icon-sm`,"aria-label":r(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,M.jsx)(h,{})})}),(0,M.jsx)(m,{align:`end`,children:t.map((t,n)=>(0,M.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,M.jsx)(x,{}):null,(0,M.jsx)(y,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),i&&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 +1 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{m as t}from"./index-
|
|
1
|
+
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{m as t}from"./index-BmXiVWTf.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Ah as i,Bm as a,Ch as o,Dh as s,Eh as c,Fm as l,Gm as u,Hm as d,Im as f,Jm as p,Km as m,Lm as ee,Mh as h,Mm as g,Nh as _,Nm as te,Oh as v,Pm as ne,Qm as re,Rm as ie,Sh as y,Th as b,Um as x,Vm as S,Wm as C,Xm as w,Ym as T,Zm as E,_h as D,ah as O,bh as k,ch as A,dh as j,eh as M,fh as N,gh as P,gw as F,hh as I,hw as L,ih as R,jh as z,kh as B,lh as V,lw as H,mh as ae,nh as U,oh as W,ph as G,qm as K,rh as q,sh as J,th as oe,uh as se,vh as ce,wh as le,xh as ue,yh as de,zm as fe}from"./dist-CgXYe09h.js";import{t as pe}from"./button-G-_IqZDp.js";import{M as me}from"./index-BmXiVWTf.js";import{t as he}from"./DataTableShell-B62Qv-tB.js";var Y=t(e(),1),X=n(),Z={altered_words:()=>_(),incorrect:()=>h(),incoherence:()=>z(),formatting:()=>i(),latency:()=>B(),api_error:()=>v(),other:()=>s()},Q=e=>Z[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:b()}):e===!1?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:le()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:c()})}function ge({data:e,closeReason:t}){let n=e.snapshot,r=L(H.feedback.respondToFeedback),[i,a]=(0,Y.useState)(e.thread),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(!1);async function d(){let t=s.trim();if(!(!t||l)){u(!0);try{await r({feedbackId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),c(``)}finally{u(!1)}}}let f=[];try{f=n.contextJson?JSON.parse(n.contextJson):[]}catch{f=[]}return(0,X.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,X.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,X.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,X.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${o()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:y()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ie()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ue()}),i.length>0?(0,X.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,X.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?k():de()}),(0,X.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,X.jsx)(`p`,{className:`oc-fbadmin__meta`,children:ce()}),(0,X.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:D(),value:s,maxLength:2e3,rows:3,onChange:e=>c(e.target.value.slice(0,2e3))}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,X.jsx)(pe,{size:`sm`,onClick:()=>void d(),disabled:!s.trim()||l,children:l?P():I()})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ae()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||G()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:N()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||G()})]}):null,n.promptText?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:j()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,f.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:se({count:n.contextCount??f.length,truncated:n.contextTruncated?V():``})}),(0,X.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:f.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:A()}),(0,X.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:J()}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:W()}),(0,X.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?O({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,X.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[R(),` `,n.clientInfo.plugins.join(`, `),(0,X.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,q()]})]}):null,n.clientInfo?.userAgent?(0,X.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function _e(){let e=F(H.feedback.listForAdmin,{}),t=L(H.feedback.readSnapshot),n=L(H.feedback.deleteFeedback),i=me(),[o,s]=(0,Y.useState)(null),[c,h]=(0,Y.useState)({});async function _(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({feedbackId:e._id});h(t=>({...t,[e._id]:n}))}s(e._id)}async function v(e){await i({title:ne(),description:te(),confirmLabel:g(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&s(null))}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[U(),` `,(0,X.jsx)(`strong`,{children:oe()}),` `,M()]}),(0,X.jsx)(he,{title:r(),rows:e,emptyHint:re(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,X.jsx)(ge,{data:c[e._id],closeReason:e.userCloseReason}):null,columns:[{header:E(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:w(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:T(),cell:e=>e.messageRole===`user`?p():K(),sort:e=>e.messageRole},{header:m(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${u({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:C(),cell:e=>(0,X.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:x(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:d(),cell:e=>e.userClosedAt==null?e.answered?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:S()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:a()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:fe()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:o===e._id?ee():f(),onSelect:()=>void _(e)},{label:l(),onSelect:()=>void v(e),variant:`destructive`}]})]})}export{_e as FeedbacksTab};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{
|
|
1
|
+
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{Cw as t,uw as n}from"./dist-CgXYe09h.js";import{c as r,l as i,s as a,u as o}from"./index-BmXiVWTf.js";var s=n(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c={media_delivery:{key:`media_delivery`,appliedIn:`bridge`,togglable:!0,placeholders:[`outboundDir`],defaultTemplate:`[LIVRAISON]
|
|
2
2
|
Pour qu'un fichier que tu génères soit téléchargeable par l'utilisateur dans ce webchat : écris-le sous {outboundDir}/ puis ajoute, dans ta réponse finale, une ligne dédiée EXACTEMENT au format MEDIA:<chemin absolu du fichier>. N'utilise PAS de lien markdown vers un chemin local — il ne serait pas cliquable.`},documentary_fetch:{key:`documentary_fetch`,appliedIn:`convex`,togglable:!0,placeholders:[`references`],defaultTemplate:`Fournis les fichiers source téléchargeables correspondant EXACTEMENT à ces références de documents (un fichier par référence, nommé d'après la référence). Réponds uniquement avec les fichiers, sans commentaire :
|
|
3
3
|
{references}`,disabledTemplate:`{references}`},inbound_files:{key:`inbound_files`,appliedIn:`bridge`,togglable:!0,placeholders:[`files`],defaultTemplate:`[FICHIERS REÇUS]
|
|
4
4
|
{files}`}},l=Object.keys(c);function u(e,t){return t.enabled?t.template:c[e].disabledTemplate??``}function d(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:r})}var f=[`gateway-http`,`shared-fs`,`off`],p=[`inline`,`shared-fs`];t.object({mediaMode:t.optional(t.union(t.literal(`gateway-http`),t.literal(`shared-fs`),t.literal(`off`))),inboundMediaMode:t.optional(t.union(t.literal(`inline`),t.literal(`shared-fs`))),rehydration:t.optional(t.boolean()),mediaMaxMb:t.optional(t.number()),inboundAgentMount:t.optional(t.string()),outboundAgentMount:t.optional(t.string()),promptInjections:t.optional(t.record(t.string(),t.object({enabled:t.optional(t.boolean()),template:t.optional(t.string())})))});var m={mediaMode:`gateway-http`,inboundMediaMode:`inline`,rehydration:!0,mediaMaxMb:1024,inboundAgentMount:`/home/node/.openclaw/media/inbound`,outboundAgentMount:`/home/node/.openclaw/media/outbound`};function h(e){let t={};for(let n of l){let r=e?.[n];t[n]={enabled:r?.enabled??!0,template:typeof r?.template==`string`&&r.template.length>0?r.template:c[n].defaultTemplate}}return t}function g(e){let t={};for(let n of l){let r=c[n],i=e[n];if(!i)continue;let a={};r.togglable&&i.enabled===!1&&(a.enabled=!1);let o=i.template.trim();o.length>0&&o!==r.defaultTemplate&&(a.template=o),(a.enabled!==void 0||a.template!==void 0)&&(t[n]=a)}return t}function _(e){return{mediaMode:e.mediaMode??m.mediaMode,inboundMediaMode:e.inboundMediaMode??m.inboundMediaMode,rehydration:e.rehydration??m.rehydration,mediaMaxMb:e.mediaMaxMb??m.mediaMaxMb,inboundAgentMount:e.inboundAgentMount??m.inboundAgentMount,outboundAgentMount:e.outboundAgentMount??m.outboundAgentMount,promptInjections:h(e.promptInjections)}}function v(e,t){let n={},r=r=>{(e[r]!==m[r]||t[r]!==void 0)&&(n[r]=e[r])};r(`mediaMode`),r(`inboundMediaMode`),r(`rehydration`),r(`mediaMaxMb`),r(`inboundAgentMount`),r(`outboundAgentMount`);let i=g(e.promptInjections);return Object.keys(i).length>0&&(n.promptInjections=i),n}var y=e();function b({text:e}){return(0,y.jsx)(i,{delayDuration:150,children:(0,y.jsxs)(a,{children:[(0,y.jsx)(o,{asChild:!0,children:(0,y.jsx)(`button`,{type:`button`,className:`oc-field__help`,"aria-label":e,onClick:e=>e.preventDefault(),children:(0,y.jsx)(s,{"aria-hidden":!0})})}),(0,y.jsx)(r,{className:`max-w-xs text-pretty`,children:e})]})})}function x({label:e,help:t}){return(0,y.jsxs)(`span`,{className:`oc-field__label`,children:[e,(0,y.jsx)(b,{text:t})]})}export{p as a,l as c,_ as i,u as l,x as n,f as o,v as r,c as s,b as t,d as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,BS as i,FS as ee,GS as te,HS as ne,IC as re,IS as ie,JS as ae,KS as a,LS as o,NS as s,PS as c,QS as l,RC as u,RS as d,US as oe,VS as f,WS as se,XS as ce,YS as le,ZS as p,aC as ue,cC as de,dC as m,eC as h,fC as fe,gw as pe,hw as me,iC as he,kv as ge,lC as _e,lw as g,mC as ve,nC as _,oC as v,pC as y,qS as b,rC as x,sC as S,tC as C,uC as w,zS as T}from"./dist-CgXYe09h.js";import{t as E}from"./button-G-_IqZDp.js";import{$ as D,B as O,C as k,Ct as A,G as j,H as M,K as N,Q as P,S as F,U as ye,V as be,W as xe,b as I,et as L,ht as Se,j as Ce,m as we,q as Te,rt as Ee,wt as R,x as z,y as B,yt as De}from"./index-BmXiVWTf.js";import{a as Oe,i as V,n as ke,o as H,r as U,t as Ae}from"./table-xKqB5hyP.js";var W=t(e(),1),G=n(),K=`all`;function q(e){switch(e){case`image`:return x();case`audio`:return _();case`video`:return C();case`pdf`:return h();case`document`:return r();case`archive`:return l();default:return p()}}function J(){let[e,t]=(0,W.useState)(K),[n,r]=(0,W.useState)(K),[l,p]=(0,W.useState)(K),[h,_]=(0,W.useState)(K),[x,C]=(0,W.useState)(null),J=me(g.files.softDelete),Y=Ce();function je(){t(K),r(K),p(K),_(K)}async function Me(){let e=x;if(C(null),e)try{await J({fileId:e.id}),Y.success(i())}catch(e){Y.error(T(),e)}}let X=pe(g.files.listMine,{direction:e===K?void 0:e,chatId:n===K?void 0:n,instanceName:l===K?void 0:l,category:h===K?void 0:h}),Ne=(0,W.useMemo)(()=>new Intl.DateTimeFormat(u(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:re()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=X,$=e!==K||n!==K||l!==K||h!==K;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}),(0,G.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,G.jsxs)(B,{value:e,onValueChange:t,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":y(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:fe()}),(0,G.jsx)(z,{value:`inbound`,children:m()}),(0,G.jsx)(z,{value:`outbound`,children:w()})]})]}),(0,G.jsxs)(B,{value:n,onValueChange:r,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":_e(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:de()}),Q.chats.map(e=>(0,G.jsx)(z,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,G.jsxs)(B,{value:l,onValueChange:p,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":S(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:v()}),Q.instances.map(e=>(0,G.jsx)(z,{value:e,children:e},e))]})]}):null,(0,G.jsxs)(B,{value:h,onValueChange:_,children:[(0,G.jsx)(F,{size:`sm`,"aria-label":ue(),children:(0,G.jsx)(k,{})}),(0,G.jsxs)(I,{children:[(0,G.jsx)(z,{value:K,children:he()}),Q.categories.map(e=>(0,G.jsx)(z,{value:e,children:q(e)},e))]})]}),$?(0,G.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:je,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,G.jsx)(De,{size:14,"aria-hidden":!0}),oe()]}):null]}),Z.length===0?(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:$?c():ee()}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Ae,{children:[(0,G.jsx)(Oe,{children:(0,G.jsxs)(H,{children:[(0,G.jsx)(V,{children:ce()}),(0,G.jsx)(V,{children:le()}),(0,G.jsx)(V,{children:ae()}),(0,G.jsx)(V,{children:b()}),(0,G.jsx)(V,{children:a()}),(0,G.jsx)(V,{className:`text-right`,children:te()})]})}),(0,G.jsx)(ke,{children:Z.map(e=>(0,G.jsxs)(H,{children:[(0,G.jsx)(U,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,G.jsx)(U,{title:e.mimeType,children:q(e.category)}),(0,G.jsx)(U,{children:(0,G.jsx)(we,{variant:`secondary`,children:e.direction===`inbound`?m():w()})}),(0,G.jsx)(U,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,G.jsx)(U,{className:`whitespace-nowrap text-muted-foreground`,children:Ne.format(e.createdAt)}),(0,G.jsx)(U,{className:`text-right`,children:(0,G.jsxs)(P,{children:[(0,G.jsx)(Ee,{asChild:!0,children:(0,G.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":ne(),children:(0,G.jsx)(A,{size:16})})}),(0,G.jsxs)(D,{align:`end`,children:[e.url?(0,G.jsx)(L,{asChild:!0,children:(0,G.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,G.jsx)(R,{size:14}),se()]})}):(0,G.jsxs)(L,{disabled:!0,children:[(0,G.jsx)(R,{size:14}),ie()]}),(0,G.jsxs)(L,{variant:`destructive`,onSelect:()=>C({id:e._id,filename:e.filename}),children:[(0,G.jsx)(Se,{size:14}),f()]})]})]})})]},e._id))})]}),Pe?(0,G.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:s({cap:Fe})}):null]}),(0,G.jsx)(O,{open:x!==null,onOpenChange:e=>!e&&C(null),children:(0,G.jsxs)(ye,{children:[(0,G.jsxs)(N,{children:[(0,G.jsx)(Te,{children:d()}),(0,G.jsx)(xe,{children:o()})]}),(0,G.jsxs)(j,{children:[(0,G.jsx)(M,{children:ge()}),(0,G.jsx)(be,{onClick:()=>void Me(),children:f()})]})]})})]})}export{J as FilesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Qi as r,Zi as i}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Qi as r,Zi as i}from"./dist-CgXYe09h.js";import{t as a}from"./TimeRangePicker-CXb27Tev.js";import{t as o}from"./button-G-_IqZDp.js";import{J as s,vt as c,yt as l}from"./index-BmXiVWTf.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)(c,{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)(a,{value:m,onChange:h}):null,(0,d.jsxs)(o,{variant:`ghost`,size:`sm`,className:`oc-filterbar__reset`,onClick:S,disabled:!_,children:[(0,d.jsx)(l,{}),i()]})]})}export{p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,An as i,Bn as a,Cn as o,Dn as s,En as c,Fn as l,Gn as u,Hn as d,In as f,JC as p,Jn as m,Kn as h,Ln as g,Mn as _,Nn as v,On as y,Pn as b,QC as x,Qn as ee,Rn as te,Sn as S,Tn as ne,Un as re,Vn as ie,Wn as ae,Xn as oe,YC as C,Yn as w,Zn as se,_n as T,an as E,ar as ce,bn as D,cn as le,cr as O,dn as ue,dr as k,er as de,fn as fe,fr as A,gn as pe,gw as j,hn as M,hw as N,in as me,ir as he,jn as ge,kn as _e,ln as ve,lr as ye,lw as P,mn as be,n as F,nr as xe,nw as I,on as Se,or as Ce,pn as we,qC as Te,qn as Ee,rn as De,rr as Oe,sn as L,sr as ke,t as Ae,tr as je,tw as R,un as Me,ur as Ne,uw as z,vn as Pe,wn as Fe,xn as Ie,yn as Le,zn as Re}from"./dist-CgXYe09h.js";import{t as ze}from"./dist-BDPwn3r0.js";import{t as Be}from"./x-CpLBfKr9.js";import{t as B}from"./button-G-_IqZDp.js";import{C as Ve,Dt as He,F as Ue,I as We,J as V,M as Ge,O as H,P as Ke,R as qe,S as Je,_t as U,b as Ye,dt as Xe,ft as Ze,gt as W,h as Qe,j as G,m as K,ot as $e,pt as et,x as tt,y as nt,z as rt}from"./index-BmXiVWTf.js";import{t as it}from"./FilterBar-CWlA8nZ0.js";import{t as at}from"./DataTableShell-B62Qv-tB.js";import{t as q}from"./DetailChips-fND9q0WY.js";var ot=z(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),st=z(`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`}]]),J=z(`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`}]]),ct=z(`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`}]]),Y=t(e(),1),X=n(),Z=`Tabs`,[lt,ut]=x(Z,[et]),dt=et(),[ft,Q]=lt(Z),pt=Y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ze(s),[d,f]=C({prop:r,onChange:i,defaultProp:a??``,caller:Z});return(0,X.jsx)(ft,{scope:n,baseId:Te(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,X.jsx)(I.div,{dir:u,"data-orientation":o,...l,ref:t})})});pt.displayName=Z;var mt=`TabsList`,ht=Y.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Q(mt,n),o=dt(n);return(0,X.jsx)(Ze,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,X.jsx)(I.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});ht.displayName=mt;var gt=`TabsTrigger`,_t=Y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Q(gt,n),s=dt(n),c=bt(o.baseId,r),l=xt(o.baseId,r),u=r===o.value;return(0,X.jsx)(Xe,{asChild:!0,...s,focusable:!i,active:u,children:(0,X.jsx)(I.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:R(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:R(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:R(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});_t.displayName=gt;var vt=`TabsContent`,yt=Y.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Q(vt,n),c=bt(s.baseId,r),l=xt(s.baseId,r),u=r===s.value,d=Y.useRef(u);return Y.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,X.jsx)(p,{present:i||u,children:({present:n})=>(0,X.jsx)(I.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});yt.displayName=vt;function bt(e,t){return`${e}-trigger-${t}`}function xt(e,t){return`${e}-content-${t}`}var St=pt,Ct=ht,wt=_t,Tt=yt;function Et(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function Dt(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 Ot(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 kt(e){switch(e){case`admin`:return v();case`user`:return _();case`pending`:return ge();default:return e}}function At(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 jt(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}}function Mt({className:e,orientation:t=`horizontal`,...n}){return(0,X.jsx)(St,{"data-slot":`tabs`,"data-orientation":t,className:F(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Nt=Ae(`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 Pt({className:e,variant:t=`default`,...n}){return(0,X.jsx)(Ct,{"data-slot":`tabs-list`,"data-variant":t,className:F(Nt({variant:t}),e),...n})}function $({className:e,...t}){return(0,X.jsx)(wt,{"data-slot":`tabs-trigger`,className:F(`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 Ft({className:e,...t}){return(0,X.jsx)(Tt,{"data-slot":`tabs-content`,className:F(`flex-1 text-sm outline-none`,e),...t})}var It={name:``,description:``};function Lt(){let e=j(P.groups.listGroups,{}),t=j(P.me.getMe,{host:$e})?.role===`admin`,n=N(P.groups.createGroup),i=N(P.groups.updateGroup),a=N(P.groups.deleteGroup),o=Ge(),s=G(),[c,l]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(null),[p,g]=(0,Y.useState)(It),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(``),x=(0,Y.useMemo)(()=>{if(!e)return e;let t=y.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,y]);function te(){f(null),g(It),l(!0)}function S(e){f(e),g({name:e.name,description:e.description??``}),l(!0)}async function ne(){try{d?await i({groupId:d._id,name:p.name,description:p.description}):await n({name:p.name,description:p.description||void 0}),g(It),f(null),l(!1)}catch(e){s.error(Se(),e)}}async function re(e){if(await o({title:Ee({name:e.name}),description:h(),confirmWord:e.name,confirmLabel:u(),cancelLabel:r(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(E(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:k()}),(0,X.jsx)(it,{q:y,onQChange:b,onReset:()=>b(``),canReset:y!==``,searchPlaceholder:he()}),(0,X.jsx)(at,{title:A(),rows:x,addLabel:Ne(),onAdd:t?te:void 0,emptyHint:ye(),columns:[{header:O(),cell:e=>e.name,sort:e=>e.name},{header:ke(),cell:e=>(0,X.jsx)(q,{icon:(0,X.jsx)(ct,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,X.jsx)(J,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:Ce(),cell:e=>(0,X.jsx)(q,{icon:(0,X.jsx)(U,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ce(),cell:e=>(0,X.jsx)(q,{icon:(0,X.jsx)(st,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,X.jsx)(W,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:Oe(),onSelect:()=>v({groupId:e._id,name:e.name})},...t?[{label:xe(),onSelect:()=>S(e)},{label:je(),variant:`destructive`,onSelect:()=>void re(e)}]:[]]}),(0,X.jsx)(Qe,{open:c,onOpenChange:l,title:d?se():ee(),description:oe(),canSubmit:!!p.name.trim(),onSubmit:ne,submitLabel:de(),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:w()}),(0,X.jsx)(V,{value:p.name,onChange:e=>g({...p,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:m()}),(0,X.jsx)(V,{value:p.description,onChange:e=>g({...p,description:e.target.value})})]})]})}),(0,X.jsx)(Bt,{groupId:_?.groupId??null,groupName:_?.name??``,open:_!==null,onOpenChange:e=>{e||v(null)}})]})}var Rt=8;function zt({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,X.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,X.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,X.jsx)(ot,{size:14,"aria-hidden":!0}),f()]}),(0,X.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":b({page:e,pages:t}),children:[e,` / `,t]}),(0,X.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[l(),(0,X.jsx)(He,{size:14,"aria-hidden":!0})]})]})}function Bt({groupId:e,groupName:t,open:n,onOpenChange:r}){let o=j(P.groups.getGroup,n&&e?{groupId:e}:`skip`),s=j(P.groups.listAssignableInstances,n?{}:`skip`),l=j(P.groups.listAssignableUsers,n?{}:`skip`),u=N(P.groups.addMember),f=N(P.groups.removeMember),p=N(P.groups.bulkSetMembers),m=N(P.groups.setGroupManager),h=G(),[_,v]=(0,Y.useState)(``),[b,x]=(0,Y.useState)(``),[ee,S]=(0,Y.useState)(`members`),[oe,C]=(0,Y.useState)(1),[w,se]=(0,Y.useState)(new Set),T=(0,Y.useRef)(null),E=(0,Y.useMemo)(()=>new Set((o?.members??[]).map(e=>e.userId)),[o]),ce=(0,Y.useMemo)(()=>new Set((o?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[o]),D=o?.viewerIsAdmin===!0,O=(0,Y.useMemo)(()=>new Set((o?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[o]);(0,Y.useEffect)(()=>{v(``),x(``),S(`members`),C(1),T.current=null},[n,e]),(0,Y.useEffect)(()=>{C(1)},[_]),(0,Y.useEffect)(()=>{n&&o&&e&&T.current!==e&&(T.current=e,se(new Set((o.members??[]).map(e=>e.userId))))},[n,o,e]);let k=(0,Y.useMemo)(()=>l?Et(l,_,w):[],[l,_,w]);async function de(t,n){if(e)try{n?await f({groupId:e,userId:t}):await u({groupId:e,userId:t})}catch(e){h.error(me(),e)}}async function fe(t,n){if(e)try{await m({groupId:e,userId:t,manager:!n})}catch(e){h.error(le(),e)}}let A=At(k,e=>E.has(e.userId)),pe=k.filter(e=>E.has(e.userId)).length,M=jt(k,oe,Rt);async function he(){if(!e||k.length===0)return;let t=k.map(e=>e.userId);try{await p({groupId:e,userIds:t,member:A!==`all`})}catch(e){h.error(me(),e)}}return(0,X.jsx)(Ke,{open:n,onOpenChange:r,children:(0,X.jsxs)(Ue,{className:`oc-access`,children:[(0,X.jsxs)(qe,{children:[(0,X.jsx)(rt,{children:ae({name:t})}),(0,X.jsx)(We,{children:re()})]}),(0,X.jsxs)(Mt,{value:ee,onValueChange:S,className:`oc-access__tabs`,children:[(0,X.jsxs)(Pt,{className:`w-full`,children:[(0,X.jsxs)($,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,X.jsx)(ct,{size:13,"aria-hidden":!0}),d(),o?(0,X.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,X.jsxs)($,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,X.jsx)(U,{size:13,"aria-hidden":!0}),a(),o?(0,X.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:O.size}):null]}),(0,X.jsxs)($,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,X.jsx)(st,{size:13,"aria-hidden":!0}),Le(),o?(0,X.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:o.chartCount}):null]})]}),(0,X.jsx)(Ft,{value:`members`,children:l===void 0||o===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:y()}):l.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:c()}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(V,{value:_,onChange:e=>v(e.target.value),placeholder:ie(),className:`oc-access__search`}),k.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:te()}):(0,X.jsxs)(X.Fragment,{children:[k.length>1?(0,X.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,X.jsx)(H,{checked:A===`all`?!0:A===`some`?`indeterminate`:!1,onCheckedChange:()=>void he(),"aria-label":g()}),(0,X.jsx)(`span`,{className:`oc-access__label`,children:g()}),(0,X.jsxs)(K,{variant:`outline`,className:`oc-access__count`,children:[pe,` / `,k.length]})]}):null,(0,X.jsx)(`div`,{className:`oc-access__list`,children:M.pageItems.map(e=>{let t=E.has(e.userId),n=Ot(e),r=ce.has(e.userId);return(0,X.jsxs)(`div`,{className:`oc-access__row`,children:[(0,X.jsx)(H,{checked:t,onCheckedChange:()=>void de(e.userId,t),"aria-label":i({user:n.primary})}),(0,X.jsxs)(`span`,{className:`oc-access__who`,children:[(0,X.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,X.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,X.jsx)(K,{variant:`outline`,className:`oc-access__role`,children:kt(e.role)}),(0,X.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&D?(0,X.jsx)(B,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?ve():Me(),title:r?ve():Me(),onClick:()=>void fe(e.userId,r),children:(0,X.jsx)(J,{size:15,"aria-hidden":!0})}):t&&r?(0,X.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":ue(),title:ue(),children:(0,X.jsx)(J,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,X.jsx)(zt,{page:M.page,pageCount:M.pageCount,onPage:C})]})]})}),(0,X.jsx)(Ft,{value:`agents`,children:s===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:y()}):s.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:ne()}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(V,{value:b,onChange:e=>x(e.target.value),placeholder:Re(),className:`oc-access__search`}),(0,X.jsx)(`div`,{className:`oc-access__list`,children:s.map(t=>(0,X.jsx)(Vt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:O,query:b},`${e}-${t._id}`))})]})}),(0,X.jsx)(Ft,{value:`charts`,children:(0,X.jsx)(Ht,{groupId:e})})]})]})})}function Vt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=j(P.groups.listAssignableAgents,{instanceName:t}),c=N(P.groups.assignAgentToGroup),l=N(P.groups.removeAgentFromGroup),u=N(P.groups.bulkSetGroupAgents),d=G(),[f,p]=(0,Y.useState)(1);if((0,Y.useEffect)(()=>{p(1)},[i]),!e)return null;let m=Dt(a?.agents??[],i),h=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&m.length===0)return null;let _=m.filter(e=>e.presentInLastOk!==!1),v=At(_,e=>r.has(`${t}/${e.agentId}`)),y=jt(m,f,Rt);async function b(n,r){try{r?await l({groupId:e,instanceName:t,agentId:n}):await c({groupId:e,instanceName:t,agentId:n})}catch(e){d.error(De(),e)}}async function x(){if(_.length===0)return;let n=_.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){d.error(De(),e)}}return(0,X.jsxs)(`div`,{className:`oc-access__group`,children:[(0,X.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,X.jsx)(U,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:t}),(0,X.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n}),h?(0,X.jsx)(K,{variant:`outline`,className:`oc-access__stale`,children:S()}):null]}),a===void 0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:s()}):m.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:h?o():Fe()}):(0,X.jsxs)(X.Fragment,{children:[_.length>1?(0,X.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,X.jsx)(H,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":g()}),(0,X.jsx)(`span`,{className:`oc-access__label`,children:g()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,X.jsxs)(`div`,{className:`oc-access__row`,children:[(0,X.jsx)(H,{checked:i,disabled:a&&!i,onCheckedChange:()=>void b(e.agentId,i),"aria-label":_e({name:e.displayName??e.agentId})}),(0,X.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,X.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":D(),title:D(),children:(0,X.jsx)(W,{size:14,fill:`currentColor`})}):null,a?(0,X.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:Ie()}):null]},e.agentId)}),(0,X.jsx)(zt,{page:y.page,pageCount:y.pageCount,onPage:p})]})]})}function Ht({groupId:e}){let t=j(P.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=N(P.charts.assignChartToGroup),r=N(P.charts.removeChartFromGroup),i=N(P.charts.setGroupDefaultChart),a=N(P.charts.addChartToGroupPool),o=N(P.charts.removeChartFromGroupPool),s=G();if(!e)return null;if(t===void 0)return(0,X.jsx)(`p`,{className:`oc-access__hint`,children:y()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,X.jsx)(`p`,{className:`oc-access__hint`,children:Pe()});async function d(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function f(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function p(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}async function m(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(L(),e)}}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,X.jsxs)(`div`,{className:`oc-access__row`,children:[(0,X.jsx)(H,{checked:e.selected,onCheckedChange:()=>void d(e.chartKey,e.selected),"aria-label":be({name:e.name})}),(0,X.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,X.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":we(),title:we(),children:(0,X.jsx)(W,{size:14,fill:`currentColor`})}):(0,X.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void f(e.chartKey),children:fe()}):null,u?(0,X.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":M({name:e.name}),title:M({name:e.name}),onClick:()=>void m(e.chartKey),children:(0,X.jsx)(Be,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,X.jsxs)(nt,{value:``,onValueChange:e=>void p(e),children:[(0,X.jsx)(Je,{size:`sm`,className:`oc-access__search`,children:(0,X.jsx)(Ve,{placeholder:pe()})}),(0,X.jsx)(Ye,{children:l.map(e=>(0,X.jsx)(tt,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,X.jsx)(`p`,{className:`oc-access__hint`,children:T()}):null:null]})}export{Lt as GroupsTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$f as r,$p as i,Af as a,Ap as o,Bf as s,Bp as c,Cf as l,Cp as u,Df as d,Dp as f,Ef as p,Ep as m,Ff as h,Fp as g,Gf as _,Gp as v,Hf as y,Hp as b,If as x,Ip as S,Jf as C,Jp as w,Kf as T,Kp as ee,Lf as te,Lp as ne,Mf as re,Mp as ie,Nf as ae,Np as oe,Of as se,Op as ce,Pf as le,Pp as ue,Qf as de,Qp as fe,Rf as pe,Rp as me,Sf as he,Sp as ge,Tf as _e,Tp as ve,Uf as ye,Up as be,Vf as xe,Vp as Se,Wf as E,Wp as D,Xf as Ce,Xp as we,Yf as Te,Yp as Ee,Zf as De,Zp as Oe,_p as ke,_y as O,ap as Ae,bf as je,bp as k,cp as Me,dp as Ne,em as Pe,ep as Fe,fp as Ie,gp as Le,gw as A,gy as j,hp as Re,hw as M,im as ze,ip as Be,jf as Ve,jp as He,kf as Ue,kp as We,lp as Ge,lw as N,mp as P,nm as Ke,np as qe,op as Je,pp as Ye,pw as F,qf as Xe,qp as Ze,rm as Qe,rp as $e,sp as et,tm as tt,tp as nt,up as rt,vf as it,vp as at,wf as ot,wp as st,xf as ct,xp as lt,yf as I,yp as ut,zf as L,zp as dt}from"./dist-CgXYe09h.js";import{t as R}from"./button-G-_IqZDp.js";import{C as ft,F as z,I as B,J as V,M as pt,O as H,P as U,R as W,S as mt,X as ht,Y as gt,Z as _t,b as vt,h as yt,j as G,m as K,x as q,y as bt,z as J}from"./index-BmXiVWTf.js";import{t as xt}from"./DataTableShell-B62Qv-tB.js";import{InstanceConfigDialog as St}from"./BridgeTab-CI5Pr3zt.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Ct=new Set(X),wt=`conversational`;function Tt(e){let t=new Set((e??[]).filter(e=>Ct.has(e)));return t.size===0?[wt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``},Et={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Dt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``}}function Ot(){let e=A(N.admin.listInstances,{}),t=A(N.agents.listAllInstanceAgents,{}),n=M(N.admin.upsertInstance),r=M(N.admin.deleteInstance),a=G(),[s,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(Q),[p,m]=(0,Y.useState)(null),[h,_]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(null),[C,T]=(0,Y.useState)(null);async function te(){try{await n({instanceId:C??void 0,name:u.name,gatewayUrl:u.gatewayUrl,bridgeUrl:u.bridgeUrl||void 0,displayName:u.displayName||void 0,kind:u.kind,gatewayVersion:u.gatewayVersion||void 0,gatewayHttpUrl:u.gatewayHttpUrl||void 0}),d(Q),T(null),l(!1)}catch(e){a.error(Ke(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[tt(),(0,Z.jsx)(`strong`,{children:Pe()}),i()]}),(0,Z.jsx)(xt,{title:fe(),rows:e,addLabel:Oe(),onAdd:()=>{T(null),d(Q),l(!0)},emptyHint:we(),columns:[{header:Ee(),cell:e=>e.name,sort:e=>e.name},{header:w(),cell:e=>(0,Z.jsx)(K,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:Ze(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:ee(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:ze(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(K,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?I():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:b(),onSelect:()=>{T(e._id),d(Dt(e)),l(!0)}},{label:Qe(),onSelect:()=>m(e.name)},{label:f(),onSelect:()=>x(e)},{label:v(),onSelect:()=>_(e)},{label:D(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:D(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(yt,{open:s,onOpenChange:l,title:C?Se():be(),description:dt(),canSubmit:!!(u.name&&u.gatewayUrl),onSubmit:te,submitLabel:me(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:ne(),children:[(0,Z.jsx)(V,{value:u.name,disabled:C!==null,onChange:e=>d({...u,name:e.target.value})}),C?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c()}):null]}),(0,Z.jsx)($,{label:S(),children:(0,Z.jsxs)(bt,{value:u.kind,onValueChange:e=>d({...u,kind:e}),children:[(0,Z.jsx)(mt,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(ft,{})}),(0,Z.jsxs)(vt,{children:[(0,Z.jsx)(q,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(q,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:g(),children:(0,Z.jsx)(V,{value:u.gatewayUrl,onChange:e=>d({...u,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:ue(),children:(0,Z.jsx)(V,{value:u.bridgeUrl,placeholder:oe(),onChange:e=>d({...u,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:ie(),children:(0,Z.jsx)(V,{value:u.displayName,onChange:e=>d({...u,displayName:e.target.value})})}),(0,Z.jsx)($,{label:He(),children:(0,Z.jsx)(V,{value:u.gatewayVersion,placeholder:o(),onChange:e=>d({...u,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:We(),children:(0,Z.jsx)(V,{value:u.gatewayHttpUrl,placeholder:ce(),onChange:e=>d({...u,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Rt,{instanceName:p,open:p!==null,onOpenChange:e=>{e||m(null)}}),h?(0,Z.jsx)(St,{instance:h,onClose:()=>_(null)},h._id):null,y?(0,Z.jsx)(kt,{instance:y,onClose:()=>x(null)},y._id):null]})}function kt({instance:e,onClose:t}){let n=A(N.instanceSecrets.listInstanceSecretStatus,{}),r=Et[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)(U,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(z,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(W,{children:[(0,Z.jsx)(J,{children:m({instance:e.displayName??e.name})}),(0,Z.jsx)(B,{children:ve()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Mt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(jt,{instance:e})}),(0,Z.jsx)(At,{instance:e})]})})}function At({instance:e}){let t=F(N.instanceSync.forceInstanceSync),n=G(),[i,a]=(0,Y.useState)(!1);async function o(){if(!i){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Ae());break;case`no_agents`:n.success($e());break;case`no_bridge_url`:n.error(qe());break;case`deploy_misconfigured`:n.error(nt());break;case`unauthorized`:n.error(r());break;case`not_served`:n.error(de());break;default:n.error(Fe());break}}catch(e){n.error(Be(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:i,children:i?Je():et()})})]})}function jt({instance:e}){let t=A(N.bridgeAuth.listBridgeAuthStatus,{}),n=F(N.bridgeAuth.mintBridgeSecret),r=M(N.bridgeAuth.revokeBridgeSecret),i=G(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function p(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(E(),e)}finally{o(!1)}}}async function m(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(_())}catch(e){i.error(E(),e)}finally{o(!1)}}}async function h(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:Ce(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(K,{variant:f?`outline`:`secondary`,children:f?`${lt()} · ${d.prefix}…${d.lastFour}`:k()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void p(),disabled:a,children:f?Xe():C()}),f?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void m(),disabled:a,children:T()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:ye()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void h(),children:l?O():j()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:y()})]}):null]})}function Mt({instanceId:e,field:t,updatedAt:n}){let r=F(N.instanceSecrets.setInstanceSecret),i=M(N.instanceSecrets.clearInstanceSecret),a=F(N.deviceIdentity.generateDeviceIdentity),o=G(),[s,c]=(0,Y.useState)(``),[l,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=n!==null,_=t===`deviceIdentity`,v=t===`token`?st():t===`deviceIdentity`?u():ge();async function b(){if(!(!s.trim()||l)){d(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),p(null),h(!1),o.success(Re())}catch(e){o.error(P(),e)}finally{d(!1)}}}async function x(){if(!l){d(!0);try{await i({instanceId:e,field:t}),p(null),h(!1),o.success(Ye())}catch(e){o.error(P(),e)}finally{d(!1)}}}async function S(){if(!l){d(!0);try{p(await a({instanceId:e})),h(!1),o.success(rt())}catch(e){o.error(Me(),e)}finally{d(!1)}}}let C=f?`openclaw devices approve ${f.id}`:``;async function w(){if(C)try{await navigator.clipboard.writeText(C),h(!0)}catch{}}return(0,Z.jsxs)($,{label:v,children:[_?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(K,{variant:g?`outline`:`secondary`,children:g?lt():k()}),(0,Z.jsx)(V,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:g?at():ut(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(R,{size:`sm`,onClick:()=>void b(),disabled:l||s.trim().length===0,children:ke()}),_?(0,Z.jsx)(R,{size:`sm`,variant:`outline`,onClick:()=>void S(),disabled:l,children:Ie()}):null,g?(0,Z.jsx)(R,{size:`sm`,variant:`destructive`,onClick:()=>void x(),disabled:l,children:Le()}):null]})]}),f?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:rt()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:C}),(0,Z.jsx)(R,{variant:`outline`,size:`sm`,onClick:()=>void w(),children:m?O():j()})]}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,onClick:()=>{p(null),h(!1)},children:y()})]}):null]})}var Nt={conversational:le,documentary:re},Pt={conversational:ae,documentary:Ve},Ft=e=>(Nt[e]??(()=>e))(),It=e=>(Pt[e]??(()=>``))();function Lt({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:pe()}),t.map(e=>(0,Z.jsx)(K,{variant:`secondary`,className:`oc-agenttype__chip`,title:It(e),children:Ft(e)},e)),(0,Z.jsxs)(gt,{children:[(0,Z.jsx)(_t,{asChild:!0,children:(0,Z.jsx)(R,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:te()})}),(0,Z.jsxs)(ht,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:x()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:h()}),(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:Ft(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:It(r)})]})]},r)})})]})]})]})}function Rt({instanceName:e,open:t,onOpenChange:n}){let r=A(N.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=M(N.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=M(N.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),c=M(N.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(N.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Tt(r);e.setQuery(N.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),u=M(N.agents.removeInstanceAgent),f=pt(),m=G();async function h(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){m.error(L(),e)}}async function g(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){m.error(L(),e)}}async function _(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await c({instanceName:e,agentId:t,types:i})}catch(e){m.error(L(),e)}}async function v(t,n){if(e&&await f({title:se({name:n}),description:d(),confirmLabel:p(),destructive:!0}))try{await u({instanceName:e,agentId:t}),m.success(_e())}catch(e){m.error(L(),e)}}return(0,Z.jsx)(U,{open:t,onOpenChange:n,children:(0,Z.jsxs)(z,{className:`oc-access`,children:[(0,Z.jsxs)(W,{children:[(0,Z.jsx)(J,{children:xe({name:e??``})}),(0,Z.jsx)(B,{children:s()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ot()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?l():r.discovery.lastPollOk?he():ct({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:je()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,o=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(H,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void h(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:it()}),(0,Z.jsx)(R,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void v(e.agentId,i),children:Ue()})]}):n?(0,Z.jsx)(K,{variant:`default`,children:I()}):(0,Z.jsx)(R,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void g(e.agentId),children:a()})]}),e.enabled?(0,Z.jsx)(Lt,{agentId:e.agentId,types:o,onToggle:t=>void _(e.agentId,t,o)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Ot as InstancesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Bh as ee,Cg as i,Eg as a,Fh as o,Gh as s,Hh as c,Ih as l,Jh as u,Kh as d,Lh as f,Ph as te,Qh as ne,Rh as re,Sg as p,Tg as ie,Uh as ae,Vh as oe,Wh as se,Xh as ce,Yh as le,Zh as m,_g as h,ag as g,bg as _,cg as v,
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Bh as ee,Cg as i,Eg as a,Fh as o,Gh as s,Hh as c,Ih as l,Jh as u,Kh as d,Lh as f,Ph as te,Qh as ne,Rh as re,Sg as p,Tg as ie,Uh as ae,Vh as oe,Wh as se,Xh as ce,Yh as le,Zh as m,_g as h,ag as g,bg as _,cg as v,dg as y,eg as b,fg as x,gg as S,gw as C,hg as w,hw as T,ig as E,lg as D,lw as O,mg as k,ng as A,og as j,pg as M,qh as N,rg as ue,sg as P,tg as F,ug as I,vg as L,wg as R,xg as z,yg as B,zh as V}from"./dist-CgXYe09h.js";import{C as H,J as U,O as W,S as G,b as K,m as q,x as de,y as fe}from"./index-BmXiVWTf.js";import{t as pe}from"./DataTableShell-B62Qv-tB.js";var J=t(e(),1),Y=n();function me(){let e=C(O.integrations.status.status,{}),t=T(O.admin.setIntegrationConfig),[n,H]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&H(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:a()});let W=n,G=(e,t,n)=>H({...W,[e]:{...W[e],[t]:n}}),K=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ie(),` `,(0,Y.jsx)(`strong`,{children:R()}),` `,i()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(q,{variant:`secondary`,children:p()}):(0,Y.jsx)(q,{variant:`outline`,children:z()}):(0,Y.jsx)(q,{variant:`outline`,children:_()}),note:L(),children:[(0,Y.jsx)(Z,{label:S(),children:(0,Y.jsx)(U,{value:W.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>G(`langfuse`,`host`,e.target.value),onBlur:()=>K(`langfuse`,{host:W.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:x(),checked:W.langfuse.enabled??!0,onChange:e=>{G(`langfuse`,`enabled`,e),K(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(q,{variant:`secondary`,children:p()}):(0,Y.jsx)(q,{variant:`outline`,children:z()}):(0,Y.jsx)(q,{variant:`outline`,children:_()}),note:h(),children:[(0,Y.jsx)(Z,{label:w(),children:(0,Y.jsx)(U,{value:W.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>G(`opik`,`baseUrl`,e.target.value),onBlur:()=>K(`opik`,{baseUrl:W.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:k(),children:(0,Y.jsx)(U,{value:W.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||M(),onChange:e=>G(`opik`,`workspace`,e.target.value),onBlur:()=>K(`opik`,{workspace:W.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:x(),checked:W.opik.enabled??!0,onChange:e=>{G(`opik`,`enabled`,e),K(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:y(),status:(0,Y.jsx)(q,{variant:`outline`,children:B()}),note:I(),children:[(0,Y.jsx)(Z,{label:D(),children:(0,Y.jsx)($,{value:W.tts.auto??`off`,options:[[`off`,v()],[`always`,P()],[`inbound`,j()],[`tagged`,g()]],onChange:e=>{G(`tts`,`auto`,e),K(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:E(),children:(0,Y.jsx)($,{value:W.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,ue()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{G(`tts`,`provider`,e),K(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:A(),children:(0,Y.jsx)(U,{value:W.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>G(`tts`,`model`,e.target.value),onBlur:()=>K(`tts`,{model:W.tts.model??``})})}),(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(U,{value:W.tts.voice??``,placeholder:b(),onChange:e=>G(`tts`,`voice`,e.target.value),onBlur:()=>K(`tts`,{voice:W.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:r(),status:(0,Y.jsx)(q,{variant:`outline`,children:B()}),note:e.secrets.openai?ne():m(),children:[(0,Y.jsx)(Q,{label:ce(),checked:W.talk.enabled??!1,onChange:e=>{G(`talk`,`enabled`,e),K(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:le(),children:(0,Y.jsx)($,{value:W.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{G(`talk`,`realtimeProvider`,e),K(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:u(),children:(0,Y.jsx)(U,{value:W.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>G(`talk`,`realtimeModel`,e.target.value),onBlur:()=>K(`talk`,{realtimeModel:W.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(U,{value:W.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>G(`talk`,`voice`,e.target.value),onBlur:()=>K(`talk`,{voice:W.talk.voice??``})})}),(0,Y.jsx)(Z,{label:N(),children:(0,Y.jsx)($,{value:W.talk.transport??`webrtc`,options:[[`webrtc`,d()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{G(`talk`,`transport`,e),K(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:s(),children:(0,Y.jsx)(U,{value:W.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>G(`talk`,`speechLocale`,e.target.value),onBlur:()=>K(`talk`,{speechLocale:W.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:se(),checked:W.talk.interruptOnSpeech??!0,onChange:e=>{G(`talk`,`interruptOnSpeech`,e),K(`talk`,{interruptOnSpeech:e})}})]}),(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:ae()}),(0,Y.jsx)(q,{variant:`outline`,children:c()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[oe(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(pe,{title:ee(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:V(),columns:[{header:re(),cell:e=>(0,Y.jsx)(q,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:f(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:l(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:o(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:te(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(W,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(fe,{value:e,onValueChange:n,children:[(0,Y.jsx)(G,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(H,{})}),(0,Y.jsx)(K,{children:t.map(([e,t])=>(0,Y.jsx)(de,{value:e,children:t},e))})]})}export{me as IntegrationsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Bo as r,Fo as i,Ho as a,Io as o,Lo as s,Mo as c,No as l,Po as u,Ro as d,Uo as f,Vo as p,Wo as m,
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Bo as r,Fo as i,Ho as a,Io as o,Lo as s,Mo as c,No as l,Po as u,Ro as d,Uo as f,Vo as p,Wo as m,gw as h,jo as g,lw as _,zo as v}from"./dist-CgXYe09h.js";import{n as y,t as b}from"./TimeRangePicker-CXb27Tev.js";import{Ot as x,a as S,kt as C,n as w,r as T}from"./index-BmXiVWTf.js";import{a as E,n as D,o as O,r as k,t as A}from"./card-B3VbgixI.js";var j=t(e(),1),M=n(),N=[{metric:`api.calls`,label:m(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:f(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:a(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:p(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:r(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:v(),unit:`/h`,group:`Assistant`,isError:!0}],P=N.length,F=[`API`,`OpenClaw`,`Chat`,`Assistant`],I=1e3,L=36e5;function R(e,t){let n=Math.max(1,Math.ceil((t-e)/L)),r=Math.min(n*P,I);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/P))}}function z(){let e=C({from:`/settings/kpi`}),t=x({from:`/settings/kpi`}),n=T(e.from,e.to,w,`now`),r=e=>void t({search:t=>({...t,...S(e)})}),{from:a,to:c}=y(n),{rowLimit:l,buckets:u}=R(a,c),f=h(_.kpi.listKpis,{limit:l,filter:{from:a,to:c}}),p=(0,j.useMemo)(()=>{let e=new Map;for(let t of f??[]){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>u&&e.set(t,n.slice(n.length-u));return e},[f,u]),m=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`p`,{className:`oc-admin__hint`,children:[d(),` `,(0,M.jsx)(`span`,{className:`oc-filter__window`,children:s()})]}),(0,M.jsx)(B,{value:n,onChange:r})]});return f===void 0?(0,M.jsxs)(M.Fragment,{children:[m,(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:o()})]}):f.length===0?(0,M.jsxs)(M.Fragment,{children:[m,(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:i()})]}):(0,M.jsxs)(M.Fragment,{children:[m,F.map(e=>{let t=N.filter(t=>t.group===e);return t.some(e=>(p.get(e.metric)??[]).length>0)?(0,M.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,M.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,M.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,M.jsx)(V,{config:e,series:p.get(e.metric)??[]},e.metric))})]},e):null})]})}function B({value:e,onChange:t}){return(0,M.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,M.jsx)(b,{value:e,onChange:t})})}function V({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,M.jsxs)(A,{size:`sm`,className:`oc-kpi__card`,children:[(0,M.jsxs)(E,{children:[(0,M.jsx)(O,{className:`oc-kpi__card-title`,children:e.label}),(0,M.jsx)(k,{className:`oc-kpi__card-metric`,children:(0,M.jsx)(`code`,{children:e.metric})})]}),(0,M.jsxs)(D,{className:`oc-kpi__card-body`,children:[(0,M.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,M.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:K(r)}),(0,M.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,M.jsx)(G,{series:t,isError:e.isError,unit:e.unit}),(0,M.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,M.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:u({value:q(n.bucket)})}):(0,M.jsx)(`span`,{className:`oc-kpi__muted`,children:l()}),(0,M.jsx)(`span`,{className:`oc-kpi__muted`,children:c({count:t.length})})]})]})]})}var H=240,U=48,W=1;function G({series:e,isError:t,unit:n}){if(e.length===0)return(0,M.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=H/e.length,a=Math.max(i-W,1);return(0,M.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${H} ${U}`,preserveAspectRatio:`none`,role:`img`,"aria-label":g({max:K(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(U-1):0,c=o*i,l=U-s;return(0,M.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,M.jsxs)(`title`,{children:[q(e.bucket),` · `,K(e.value),` `,n]})},e.bucket)})})}function K(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function q(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{z as KpiTab};
|
|
@@ -0,0 +1 @@
|
|
|
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 a,CC as o,DC as s,EC as c,Fb as l,Gb as u,Hb as d,IC as f,Ib as p,Jb as ee,Kb as te,Lb as m,Mb as h,Nb as g,OC as ne,Pb as re,Qb as ie,Rb as _,Rp as ae,SC as oe,TC as se,Ub as v,Vb as ce,Wb as le,Xb as ue,Yb as de,Zb as fe,_C as y,ax as b,bC as x,cx as S,ex as C,gC as w,gw as T,hw as E,ix as D,jC as O,jb as k,kb as A,lw as j,nx as M,ox as N,qb as P,rx as F,sx as I,tx as L,vC as R,wC as z,xC as B,yC as V,zb as pe}from"./dist-CgXYe09h.js";import{t as H}from"./button-G-_IqZDp.js";import{C as me,J as U,O as W,S as he,b as ge,j as _e,k as ve,ot as G,x as K,y as ye}from"./index-BmXiVWTf.js";var q=t(e(),1),J=[{id:`messages`,label:()=>S()},{id:`composer`,label:()=>I()},{id:`sidebar`,label:()=>N()},{id:`other`,label:()=>b()}],Y={showSource:{category:`messages`,label:()=>D(),help:()=>F()},showReport:{category:`messages`,label:()=>M(),help:()=>L()},copyAssistant:{category:`messages`,label:()=>C()},copyUser:{category:`messages`,label:()=>r()},showDelete:{category:`messages`,label:()=>ie()},showTools:{category:`messages`,label:()=>fe(),help:()=>ue()},voiceInput:{category:`composer`,label:()=>de(),help:()=>ee()},showChatAge:{category:`sidebar`,label:()=>P(),help:()=>te()},showChatProvider:{category:`sidebar`,label:()=>u(),help:()=>le()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function be(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],Se={voiceInput:`voiceInput`};function Ce(e){return xe.includes(e)}function Z(e){return e===`admin`}function we(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Q(e){return e===`on`?!0:e===`off`?!1:null}function Te(e){return Ce(e)?Se[e]:void 0}var $=n(),Ee={voiceInput:()=>g()};function De({prefKey:e,ui:t}){let n=E(j.admin.setUiPrefDefault),r=E(j.admin.setFeatureEnabled),a=Te(e),o=a?Ee[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:m()}),(0,$.jsxs)(ye,{value:we(t.defaults[e]),onValueChange:t=>void n({key:e,value:Q(t)}),children:[(0,$.jsx)(he,{size:`sm`,className:`w-36`,children:(0,$.jsx)(me,{})}),(0,$.jsxs)(ge,{children:[(0,$.jsx)(K,{value:`on`,children:k()}),(0,$.jsx)(K,{value:`off`,children:i()}),(0,$.jsx)(K,{value:`inherit`,children:A()})]})]}),a?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[a]===!0,onCheckedChange:e=>void r({key:a,enabled:e===!0}),"aria-label":p()}),p()]}):null]}),o?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:o}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=T(j.me.getMe,{host:G}),o=i?.ui,s=Z(i?.role)&&n,c=E(j.me.setUiPref).withOptimisticUpdate(ve),u=(0,q.useMemo)(()=>o?be(Object.keys(o.effective),e):[],[o,e]);return o?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":_()}),_()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:l()}),(0,$.jsx)(`p`,{children:re()}),(0,$.jsx)(`p`,{children:h()})]}):null,(0,$.jsx)(U,{value:e,onChange:e=>t(e.target.value),placeholder:v(),"aria-label":v(),className:`mb-2`}),u.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:d()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:u.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=o.locked[e],l=o.effective[e],u=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${u&&!i?` is-overridden`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(`span`,{className:`oc-prefs__lock`,children:ce()}):u?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:a()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&u?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void c({key:e,value:null}),children:pe()}):null,(0,$.jsx)(W,{checked:l,disabled:i,onCheckedChange:t=>void c({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(De,{prefKey:e,ui:o}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:f()})}function ke(){let e=T(j.me.getMe,{host:G}),t=E(j.me.setLocale),n=E(j.me.setMyName),r=_e(),i=e?.locale??`default`,a=e?.name??``,[l,u]=(0,q.useState)(null),d=l??a,f=d.trim()!==a.trim();async function p(){try{await n({name:d}),u(null),r.success(z())}catch(e){r.error(o(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:ne()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(U,{className:`max-w-xs`,value:d,maxLength:120,placeholder:c(),onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),p())}}),(0,$.jsx)(H,{size:`sm`,disabled:!f,onClick:()=>void p(),children:ae()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:oe()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:B()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:i===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?y():e===`en`?w():O()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:x()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:V()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:R()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Js as i,Qs as a,Xs as o,Ys as s,Zs as c,_c as l,ac as u,cc as d,
|
|
2
|
-
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`},J={outboundDir:s,references:i,files:S};function Y(){let e=
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$s as r,Js as i,Qs as a,Xs as o,Ys as s,Zs as c,_c as l,ac as u,cc as d,dc as f,ec as p,fc as m,gw as h,hw as g,ic as _,lc as v,lw as y,nc as b,oc as x,qs as S,rc as C,sc as w,tc as T,uc as E,vc as D}from"./dist-CgXYe09h.js";import{c as O,i as k,l as A,n as j,r as M,s as N,t as P,u as F}from"./FieldLabel-DkIcKewT.js";import{t as I}from"./button-G-_IqZDp.js";import{C as L,O as R,S as z,b as B,j as V,x as H,y as U}from"./index-BmXiVWTf.js";/* empty css */var W=t(e(),1),G=n(),K={media_delivery:{label:w,help:x},documentary_fetch:{label:u,help:_},inbound_files:{label:C,help:b}},q={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
+
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`},J={outboundDir:s,references:i,files:S};function Y(){let e=h(y.admin.listInstances,{}),[t,n]=(0,W.useState)(null);if(e===void 0)return(0,G.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,G.jsx)(`div`,{className:`oc-injtab`,children:(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:p()})});let r=e.find(e=>e._id===t)??e[0];return(0,G.jsxs)(`div`,{className:`oc-injtab`,children:[(0,G.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,G.jsx)(j,{label:m(),help:f()}),(0,G.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,G.jsx)(`span`,{children:T()}),(0,G.jsxs)(U,{value:r._id,onValueChange:e=>n(e),children:[(0,G.jsx)(z,{size:`sm`,className:`min-w-44`,children:(0,G.jsx)(L,{})}),(0,G.jsx)(B,{children:e.map(e=>(0,G.jsx)(H,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,G.jsx)(X,{instance:r},r._id)]})}function X({instance:e}){let t=g(y.admin.upsertInstanceConfig),n=V(),r=e.config??{},[i,a]=(0,W.useState)(()=>k(r)),[o,s]=(0,W.useState)(!1),c=i.promptInjections,u=(e,t)=>a({...i,promptInjections:{...c,[e]:{...c[e],...t}}});async function d(){s(!0);try{await t({instanceId:e._id,config:M(i,r)})}catch(e){n.error(l(),e)}finally{s(!1)}}return(0,G.jsxs)(`div`,{className:`oc-injtab__body`,children:[O.map(e=>(0,G.jsx)(Z,{injKey:e,def:N[e],i18n:K[e],row:c[e]??{enabled:!0,template:N[e].defaultTemplate},onChange:t=>u(e,t)},e)),(0,G.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,G.jsx)(I,{size:`sm`,onClick:()=>void d(),disabled:o,children:D()})})]})}function Z({injKey:e,def:t,i18n:n,row:i,onChange:s}){let[l,u]=(0,W.useState)(!1),f=i.template.trim()!==t.defaultTemplate,p=t.togglable&&!i.enabled,m=Object.fromEntries(t.placeholders.map(e=>[e,q[e]??`{${e}}`])),h=A(e,i),g=h?F(h,m):``;return(0,G.jsxs)(`section`,{className:`oc-injcard`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,G.jsxs)(`label`,{className:`oc-field--row`,children:[(0,G.jsx)(R,{checked:i.enabled,onCheckedChange:e=>s({enabled:e===!0})}),(0,G.jsx)(j,{label:n.label(),help:n.help()})]}):(0,G.jsx)(j,{label:n.label(),help:n.help()}),f&&(0,G.jsx)(`span`,{className:`oc-injection__badge`,children:v()})]}),(0,G.jsx)(`textarea`,{className:`oc-injcard__text`,value:i.template,disabled:p,rows:8,spellCheck:!1,onChange:e=>s({template:e.target.value})}),(0,G.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:d()}),t.placeholders.map(e=>(0,G.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,G.jsx)(`code`,{children:`{${e}}`}),(0,G.jsx)(P,{text:(J[e]??(()=>e))()})]},e))]}),(0,G.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>u(e=>!e),children:l?a():r()}),f&&(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>s({template:t.defaultTemplate}),children:E()})]})]}),l&&(0,G.jsx)(`div`,{className:`oc-injcard__preview`,children:g?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:g}),(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:c()})]}):(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:o()})})]})}export{Y as PromptInjectionsTab};
|
|
@@ -0,0 +1 @@
|
|
|
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,Dd as o,Fd as s,Gd as c,Hd as ee,Id as te,Jd as l,Kd as u,Ld as ne,Md as d,Nd as f,Od as p,Pd as m,Qd as h,Rd as g,Ud as _,Vd as v,Wd as y,Xd as b,Yd as x,Zd as S,_d as re,bd as ie,ef as C,gd as w,gw as T,hd as E,hw as D,jd as O,kd as k,lw as A,md as j,nf as M,pd as N,qd as P,tf as F,vd as I,xd as L,yd as R,zd as ae}from"./dist-CgXYe09h.js";import{t as z}from"./button-G-_IqZDp.js";import{J as B,M as V,O as H,h as U,j as W,m as G,xt as K}from"./index-BmXiVWTf.js";import{t as q}from"./roleDescriptions-I2Mil-DA.js";var J=t(e(),1),Y=n(),X=[{group:()=>M(),keys:[{key:`traces.read`,label:()=>S()},{key:`traces.read.content`,label:()=>b(),phi:!0},{key:`traces.write`,label:()=>x()}]},{group:()=>F(),keys:[{key:`kpi.read`,label:()=>S()},{key:`kpi.write`,label:()=>x()}]},{group:()=>C(),keys:[{key:`openclaw.query`,label:()=>l()},{key:`anomalies.read`,label:()=>P()},{key:`anomalies.report`,label:()=>u()}]},{group:()=>r(),keys:[{key:`chats.read`,label:()=>S()},{key:`selfheal`,label:()=>y()}]},{group:()=>h(),keys:[{key:`admin.manage`,label:()=>c()}]}],oe=X.flatMap(e=>e.keys.map(e=>e.key));function Z(e){return e.includes(`*`)}var Q={key:``,name:``,description:``};function $(){let e=T(A.apiKeys.listRoles,{}),t=D(A.apiKeys.createRole),n=D(A.apiKeys.ensureRolesSeeded),r=D(A.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(A.apiKeys.listRoles,{});r&&e.setQuery(A.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),c=V(),l=W(),[u,h]=(0,J.useState)(!1),[y,b]=(0,J.useState)(Q),[x,S]=(0,J.useState)(new Set);(0,J.useEffect)(()=>{n({}).catch(e=>{l.error(ee(),e)})},[n,l]);let C=e??[];async function M(e,t){if(Z(e.permissions)||x.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await c({title:v({name:e.name}),description:a(),confirmLabel:ae()}))){S(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){l.error(g(),e)}finally{S(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function P(){try{await t({key:y.key,name:y.name,description:y.description||void 0,permissions:[]}),b(Q),h(!1)}catch(e){l.error(ne(),e)}}let F=e===void 0,$=!F&&C.length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[te(),` `,(0,Y.jsx)(`code`,{children:`admin`}),` `,s(),` `,(0,Y.jsx)(`code`,{children:`traces.read.content`}),` `,m()]}),(0,Y.jsxs)(`div`,{className:`oc-dt`,children:[(0,Y.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,Y.jsx)(`h2`,{className:`oc-dt__title`,children:f()}),(0,Y.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,Y.jsx)(z,{size:`sm`,onClick:()=>{b(Q),h(!0)},children:d()})})]}),F?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:O()}):$?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(0,Y.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,Y.jsxs)(`table`,{className:`oc-matrix`,children:[(0,Y.jsxs)(`thead`,{children:[(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:k()}),X.map(e=>(0,Y.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,Y.jsx)(`tr`,{children:X.flatMap(e=>e.keys.map(e=>(0,Y.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?_({key:e.key}):e.key,children:[e.label(),e.phi?(0,Y.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,Y.jsx)(`tbody`,{children:C.map(e=>{let t=Z(e.permissions),n=x.has(e._id);return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,Y.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,Y.jsxs)(G,{variant:`outline`,className:`gap-1`,children:[(0,Y.jsx)(K,{}),` `,p()]}):(0,Y.jsx)(G,{variant:`secondary`,children:o()})]}),q(e)?(0,Y.jsx)(`p`,{className:`oc-matrix__roledesc`,children:q(e)}):null]}),oe.map(r=>(0,Y.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,Y.jsx)(H,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?L():n?ie():r,onCheckedChange:()=>void M(e,r)})},r))]},e.key)})})]})})]}),(0,Y.jsx)(U,{open:u,onOpenChange:h,title:R(),description:I(),canSubmit:!!(y.key&&y.name),onSubmit:P,submitLabel:re(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:w()}),(0,Y.jsx)(B,{value:y.key,placeholder:E(),onChange:e=>b({...y,key:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:j()}),(0,Y.jsx)(B,{value:y.name,onChange:e=>b({...y,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:N()}),(0,Y.jsx)(B,{value:y.description,onChange:e=>b({...y,description:e.target.value})})]})]})})]})}export{$ as RolesTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$y as r,Ay as i,By as ee,Cb as a,Cy as o,Db as te,Dy as s,Eb as ne,Ey as c,Fy as re,Gy as ie,Hy as ae,Iy as oe,Jy as se,Ky as ce,Ly as le,My as ue,Ny as de,Ob as fe,Oy as l,Py as pe,Qy as me,Ry as he,Sb as u,Sy as ge,Tb as _e,Ty as d,Uy as ve,Vy as ye,Wy as be,Xy as xe,Yy as Se,Zy as Ce,_b as we,_y as f,ab as Te,bb as Ee,by as De,cb as Oe,cy as p,db as ke,dy as m,eb as Ae,fb as je,fy as h,gb as Me,gw as g,gy as Ne,hb as Pe,hw as _,hy as v,ib as Fe,jy as y,ky as b,lb as Ie,lw as x,ly as S,mb as Le,my as C,nb as Re,ob as ze,pb as Be,pw as Ve,py as w,qy as He,rb as Ue,sb as We,tb as Ge,ub as Ke,uy as T,vb as qe,vy as E,wb as Je,wy as D,xb as Ye,xy as O,yb as Xe,yy as k,zy as Ze}from"./dist-CgXYe09h.js";import{n as Qe}from"./dist--S7AYRAA.js";import{i as $e}from"./dist-BDPwn3r0.js";import{t as A}from"./button-G-_IqZDp.js";import{C as j,Dt as et,F as M,I as N,J as P,L as F,M as tt,Ot as nt,P as I,R as L,S as R,Tt as z,b as B,h as rt,j as it,kt as at,m as V,x as H,y as U,z as W}from"./index-BmXiVWTf.js";import{t as ot}from"./FilterBar-CWlA8nZ0.js";import{t as st}from"./DataTableShell-B62Qv-tB.js";import{t as ct}from"./roleDescriptions-I2Mil-DA.js";var G=t(e(),1),K=n(),q=[{value:`never`,label:()=>C(),days:null},{value:`30`,label:()=>w(),days:30},{value:`90`,label:()=>h(),days:90}],lt=720*60*60*1e3,J=`__all__`,Y={name:``,roleKey:``,description:``};function X(){let e=at({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??J,[o,s]=(0,G.useState)(J),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===J?void 0:e})}),ge=g(x.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===J?void 0:o,disabled:i===J?void 0:i===`disabled`}}),d=g(x.apiKeys.listKeys,{}),f=g(x.apiKeys.listRoles,{}),De=_(x.apiKeys.createServiceAccount),p=_(x.apiKeys.updateServiceAccount),m=_(x.apiKeys.deleteServiceAccount),h=Ve(x.apiKeys.mintApiKey),Ne=_(x.apiKeys.revokeApiKey),v=tt(),y=it(),b=n!==``||o!==J||i!==J;function S(){s(J),t({search:{},replace:!0})}let[C,w]=(0,G.useState)(!1),[T,E]=(0,G.useState)(Y),[D,O]=(0,G.useState)(null),[k,Qe]=(0,G.useState)(new Set),[M,N]=(0,G.useState)(null),F=(0,G.useRef)(!1),[I,L]=(0,G.useState)(new Set),[z,W]=(0,G.useState)({}),[lt,X]=(0,G.useState)(null),Z=(0,G.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function Q(e){Qe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await p({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(ce())):await De({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Y),O(null),w(!1)}catch(e){y.error(D?He():se(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function $(e){if(F.current)return;F.current=!0;let t=z[e._id]??`never`,n=q.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;N(e._id);try{let t=await h({serviceAccountId:e._id,expiresAt:r});X({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(ie(),e)}finally{F.current=!1,N(null)}}async function mt(e){if(await v({title:be(),description:(0,K.jsxs)(K.Fragment,{children:[ve(),` `,(0,K.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,ae(),` `,(0,K.jsx)(`strong`,{children:ye()}),` `,ee()]}),confirmWord:e.name,confirmLabel:Ze(),destructive:!0}))try{await m({serviceAccountId:e._id}),y.success(he(),e.name)}catch(e){y.error(le(),e)}}async function ht(e){if(await v({title:oe(),description:(0,K.jsxs)(K.Fragment,{children:[re(),` `,(0,K.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,pe()]}),confirmLabel:de(),destructive:!0})&&!I.has(e._id)){L(t=>new Set(t).add(e._id));try{await Ne({keyId:e._id})}catch(e){y.error(ue(),e)}finally{L(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}),(0,K.jsxs)(ot,{q:n,onQChange:c,searchPlaceholder:te(),onReset:S,canReset:b,children:[(0,K.jsxs)(U,{value:o,onValueChange:s,children:[(0,K.jsx)(R,{size:`sm`,className:`w-40`,children:(0,K.jsx)(j,{placeholder:ne()})}),(0,K.jsxs)(B,{children:[(0,K.jsx)(H,{value:J,children:_e()}),(f??[]).map(e=>(0,K.jsx)(H,{value:e.key,children:e.key},e._id))]})]}),(0,K.jsxs)(U,{value:i,onValueChange:l,children:[(0,K.jsx)(R,{size:`sm`,className:`w-36`,children:(0,K.jsx)(j,{})}),(0,K.jsxs)(B,{children:[(0,K.jsx)(H,{value:J,children:Je()}),(0,K.jsx)(H,{value:`active`,children:a()}),(0,K.jsx)(H,{value:`disabled`,children:u()})]})]})]}),(0,K.jsx)(st,{title:Ye(),rows:ge,addLabel:Ee(),onAdd:()=>{E(Y),O(null),w(!0)},emptyHint:Xe(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,K.jsx)(ut,{account:e,keys:Z.get(e._id)??[],onRevoke:ht,revoking:I}),rowActions:e=>[{label:Pe(),onSelect:()=>pt(e)},{label:qe(),onSelect:()=>void $(e)},{label:k.has(e._id)?we():Me(),onSelect:()=>Q(e._id)},{label:Le(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,K.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?Be():je(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,K.jsx)($e,{}):(0,K.jsx)(et,{})})},{header:ke(),sort:e=>e.name,cell:e=>(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(`span`,{children:e.name}),e.description?(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ke(),sort:e=>e.roleKey,cell:e=>(0,K.jsx)(V,{variant:`secondary`,children:e.roleKey})},{header:Ie(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,K.jsx)(V,{variant:`destructive`,children:u()}):(0,K.jsx)(V,{variant:`outline`,children:a()})},{header:Oe(),cell:e=>(0,K.jsxs)(U,{value:z[e._id]??`never`,onValueChange:t=>W(n=>({...n,[e._id]:t})),children:[(0,K.jsx)(R,{size:`sm`,className:`w-32`,children:(0,K.jsx)(j,{})}),(0,K.jsx)(B,{children:q.map(e=>(0,K.jsx)(H,{value:e.value,children:e.label()},e.value))})]})},{header:We(),sort:e=>(Z.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Z.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,K.jsx)(`span`,{className:`oc-sa__keycount`,children:M===e._id?ze():Te({count:t})})}}]}),(0,K.jsx)(rt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?Fe():Ge(),description:D?Ue():Ae(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?Re():r(),children:(0,K.jsxs)(`div`,{className:`oc-form`,children:[(0,K.jsxs)(`label`,{className:`oc-field`,children:[(0,K.jsx)(`span`,{className:`oc-field__label`,children:me()}),(0,K.jsx)(P,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,K.jsxs)(`label`,{className:`oc-field`,children:[(0,K.jsx)(`span`,{className:`oc-field__label`,children:Ce()}),(0,K.jsxs)(U,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,K.jsx)(R,{className:`w-full`,children:(0,K.jsx)(j,{placeholder:xe()})}),(0,K.jsx)(B,{children:(f??[]).map(e=>(0,K.jsxs)(H,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===T.roleKey),t=e?ct(e):null;return t?(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,K.jsxs)(`label`,{className:`oc-field`,children:[(0,K.jsx)(`span`,{className:`oc-field__label`,children:Se()}),(0,K.jsx)(P,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,K.jsx)(dt,{minted:lt,onClose:()=>X(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,K.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,K.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[y(),` `,(0,K.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,K.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(0,K.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:b()}),(0,K.jsx)(`th`,{children:l()}),(0,K.jsx)(`th`,{children:s()}),(0,K.jsx)(`th`,{children:c()}),(0,K.jsx)(`th`,{children:d()}),(0,K.jsx)(`th`,{children:D()}),(0,K.jsx)(`th`,{})]})}),(0,K.jsx)(`tbody`,{children:t.map(t=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{children:(0,K.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,K.jsx)(`td`,{children:(0,K.jsx)(V,{variant:`secondary`,children:e.roleKey})}),(0,K.jsx)(`td`,{children:Z(t.createdAt)}),(0,K.jsx)(`td`,{className:Q(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,K.jsx)(`td`,{children:pt(t.expiresAt)}),(0,K.jsx)(`td`,{children:$(t)}),(0,K.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,K.jsx)(A,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?o():ge()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,G.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,K.jsx)(I,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,K.jsxs)(M,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,K.jsxs)(L,{children:[(0,K.jsx)(W,{children:O()}),(0,K.jsx)(N,{children:De({name:e.accountName})})]}),(0,K.jsx)(`div`,{className:`oc-sa__minted-warning`,children:k()}),(0,K.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,K.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,K.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":E(),children:[n?(0,K.jsx)(Qe,{}):(0,K.jsx)(z,{}),n?f():Ne()]})]}),(0,K.jsx)(F,{children:(0,K.jsx)(A,{onClick:()=>{r(!1),t()},children:v()})})]}):null})}function Z(e){return new Date(e).toLocaleString(`fr-FR`)}function Q(e){return e===null?!1:Date.now()-e>lt}function ft(e){return e===null?m():new Date(e).toLocaleString(`fr-FR`)}function pt(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function $(e){return e.disabled?(0,K.jsx)(V,{variant:`destructive`,children:T()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,K.jsx)(V,{variant:`outline`,children:S()}):(0,K.jsx)(V,{variant:`outline`,children:p()})}export{X as ServiceAccountsTab};
|