@lacneu/atrium 0.19.1 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccessTab-SACgMGAi.js → AccessTab-IcphauIj.js} +1 -1
- package/dist/assets/{AdvancedFilter-D7QXVQ5_.js → AdvancedFilter-DJjN0ZKH.js} +1 -1
- package/dist/assets/{AgentFilesTab-DcWaUTsA.js → AgentFilesTab-BI5XcES3.js} +1 -1
- package/dist/assets/{AnomaliesTab-B856xOQY.js → AnomaliesTab-Q2U1eiwk.js} +1 -1
- package/dist/assets/{AuditTab-B0xwh9EC.js → AuditTab-CoWGV21G.js} +1 -1
- package/dist/assets/{BridgeTab-KP5PlAMx.js → BridgeTab-B5Mc-mW3.js} +1 -1
- package/dist/assets/{ChatDefaultsTab-1p-luBRT.js → ChatDefaultsTab-Dk0xhrjV.js} +1 -1
- package/dist/assets/{DataTableShell-C1ZKbpq3.js → DataTableShell-CyKGlXVg.js} +1 -1
- package/dist/assets/{DetailChips-Dg4YEpwe.js → DetailChips-Ct8LcwC-.js} +1 -1
- package/dist/assets/{FeedbacksTab-Bg62mK4W.js → FeedbacksTab-DBmQnYcU.js} +1 -1
- package/dist/assets/{FieldLabel-X2EAqICh.js → FieldLabel-CgUTCK6q.js} +1 -1
- package/dist/assets/{FilesTab-BiW2j80D.js → FilesTab-Cce1_C32.js} +1 -1
- package/dist/assets/{FilterBar-CSA8xMkl.js → FilterBar-Dc-vzhP8.js} +1 -1
- package/dist/assets/{GroupsTab-CevcyqNU.js → GroupsTab-BZKmekSM.js} +1 -1
- package/dist/assets/{InstancesTab-CK-3Nvfy.js → InstancesTab-BhMe2xiQ.js} +1 -1
- package/dist/assets/{IntegrationsTab-Cf2NA4f0.js → IntegrationsTab-BMkQEaMo.js} +1 -1
- package/dist/assets/{KpiTab-BHkpsXb_.js → KpiTab-nVTkmGQL.js} +1 -1
- package/dist/assets/{PreferencesTab-DBxEQcoG.js → PreferencesTab-D3bpsq0u.js} +1 -1
- package/dist/assets/{PromptInjectionsTab-ILsAUU_D.js → PromptInjectionsTab-Di6T_ef2.js} +1 -1
- package/dist/assets/{RolesTab-cg8r2k6J.js → RolesTab-B9-Z0CrC.js} +1 -1
- package/dist/assets/{ServiceAccountsTab-DV9xE6V0.js → ServiceAccountsTab-B1jaHHEp.js} +1 -1
- package/dist/assets/{SubAgentReportsTab-Cre8FArV.js → SubAgentReportsTab-BuVbJkcE.js} +1 -1
- package/dist/assets/{ThemeShowroom-DxfyV3nj.js → ThemeShowroom-DvjqYChJ.js} +1 -1
- package/dist/assets/{TimeRangePicker-CY6cFX3v.js → TimeRangePicker-BAldDUhc.js} +1 -1
- package/dist/assets/{TracesTab-C5hnZP3-.js → TracesTab-tLa9PtsX.js} +1 -1
- package/dist/assets/{UsersTab-DDINHhFG.js → UsersTab-BtWlWFwx.js} +1 -1
- package/dist/assets/{button-DXGXeanX.js → button-C3LWIgGJ.js} +1 -1
- package/dist/assets/{card-B60DsQBe.js → card-DXTJ7L6C.js} +1 -1
- package/dist/assets/chevrons-up-down-B6ce3M7f.js +1 -0
- package/dist/assets/{compatView-BKe3swOt.js → compatView-MdW0ASNn.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-DekuLV6o.js → dispatchErrorInfo-COvKpdTE.js} +1 -1
- package/dist/assets/{dist-By-c_NRB.js → dist-B8y7NGFk.js} +1 -1
- package/dist/assets/dist-BPcfIXgJ.js +44 -0
- package/dist/assets/{dist-CWfWFr7t.js → dist-BtzdT2wL.js} +1 -1
- package/dist/assets/{dist-AH7-HhdT.js → dist-D9C9G3zQ.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CVA3g0hA.js → highlighted-body-OFNGDK62-BrgfLBa3.js} +1 -1
- package/dist/assets/{index-CKlFEsq3.js → index-B--TQi5b.js} +6 -6
- package/dist/assets/mermaid-GHXKKRXX-DIkajMJk.js +1 -0
- package/dist/assets/roleDescriptions-DmHFjDvY.js +1 -0
- package/dist/assets/{table-AFxsandT.js → table-CjpKnop2.js} +1 -1
- package/dist/assets/{tabs-9X-5Pgx3.js → tabs-C1F_imzX.js} +1 -1
- package/dist/assets/x-BY_tjn83.js +1 -0
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/dist/assets/chevrons-up-down-CeISPPN2.js +0 -1
- package/dist/assets/dist-BzNYkP4V.js +0 -44
- package/dist/assets/mermaid-GHXKKRXX-BKbfiXDa.js +0 -1
- package/dist/assets/roleDescriptions-BN-dndvd.js +0 -1
- package/dist/assets/x-DQ_CLIEK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,CD as i,Ja as a,Ka as o,Qa as s,UE as c,Xa as l,Ya as u,Za as d,ao as f,eo as p,gD as m,io as h,no as g,oo as _,qa as v,ro as y,to as b}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,CD as i,Ja as a,Ka as o,Qa as s,UE as c,Xa as l,Ya as u,Za as d,ao as f,eo as p,gD as m,io as h,no as g,oo as _,qa as v,ro as y,to as b}from"./dist-BPcfIXgJ.js";import{C as x,S,X as C,b as w,x as T,y as E}from"./index-B--TQi5b.js";var D=t(e(),1);function O(e){return e===`user`?l():e===`all`?u():a({group:e.group})}function k(e){return e===`common`?v():e===`owner`?o():a({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=i(m.admin.listUsers,{}),[t,n]=(0,D.useState)(``),a=i(m.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(S,{size:`sm`,"aria-label":f(),children:(0,A.jsx)(x,{placeholder:f()})}),(0,A.jsx)(w,{children:(e??[]).map(e=>(0,A.jsx)(T,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):a===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:y()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:a.user.label}),(0,A.jsx)(C,{variant:`secondary`,children:a.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:g()}),a.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:a.groups.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:b()}),a.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:a.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(C,{variant:`default`,children:d()}):null,(0,A.jsx)(C,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(C,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:p()}),a.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:a.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(C,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:r()}),a.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:a.permissions.map(e=>(0,A.jsx)(C,{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{_c as r,dc as i,fc as a,gc as o,hc as s,mc as c,pc as l}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{_c as r,dc as i,fc as a,gc as o,hc as s,mc as c,pc as l}from"./dist-BPcfIXgJ.js";import{i as u}from"./dist-D9C9G3zQ.js";import{t as d}from"./x-BY_tjn83.js";import{t as f}from"./button-C3LWIgGJ.js";import{C as p,S as m,Z as h,b as g,bt as _,x as v,y}from"./index-B--TQi5b.js";import{r as b}from"./TimeRangePicker-BAldDUhc.js";var x=t(e(),1),S=n(),C=[{value:`eq`,label:`=`},{value:`neq`,label:`≠`},{value:`contains`,label:r()},{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 r=(0,x.useRef)(t),w=!!(r.current&&r.current.length>0),[D,O]=(0,x.useState)(w),[k,A]=(0,x.useState)(()=>w?E(r.current):[]);function j(e){n(e.filter(e=>e.field!==``&&e.value!==``).map(e=>({field:e.field,op:e.op,value:b(e.value)})))}function M(e,t){let n=k.map(n=>n.id===e?{...n,...t}:n);A(n),j(n)}function N(){A(e=>[...e,T()])}function P(e){let t=k.filter(t=>t.id!==e);A(t),j(t)}let F=k.filter(e=>e.field!==``&&e.value!==``).length;return(0,S.jsxs)(`div`,{className:`oc-advfilter`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`oc-advfilter__toggle`,"aria-expanded":D,onClick:()=>O(e=>!e),children:[(0,S.jsx)(u,{className:`oc-advfilter__chevron`+(D?` is-open`:``),"aria-hidden":!0}),o(),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:s()}):(0,S.jsx)(`ul`,{className:`oc-advfilter__rows`,children:k.map(t=>(0,S.jsxs)(`li`,{className:`oc-advfilter__row`,children:[(0,S.jsxs)(y,{value:t.field||void 0,onValueChange:e=>M(t.id,{field:e}),children:[(0,S.jsx)(m,{size:`sm`,className:`w-40`,children:(0,S.jsx)(p,{placeholder:c()})}),(0,S.jsx)(g,{children:e.map(e=>(0,S.jsx)(v,{value:e.value,children:e.label},e.value))})]}),(0,S.jsxs)(y,{value:t.op,onValueChange:e=>M(t.id,{op:e}),children:[(0,S.jsx)(m,{size:`sm`,className:`w-28`,children:(0,S.jsx)(p,{})}),(0,S.jsx)(g,{children:C.map(e=>(0,S.jsx)(v,{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:l()}),(0,S.jsx)(f,{variant:`ghost`,size:`icon-sm`,"aria-label":a(),onClick:()=>P(t.id),children:(0,S.jsx)(d,{})})]},t.id))}),(0,S.jsxs)(f,{variant:`outline`,size:`sm`,className:`oc-advfilter__add`,onClick:N,children:[(0,S.jsx)(_,{}),i()]})]}):null]})}export{D as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ar as r,Br as i,CD as a,Cr as o,Dr as s,Er as c,Fr as l,GE as ee,Ir as te,Lr as ne,Mr as u,Nr as re,Or as d,Pr as ie,Px as f,Rr as p,Si as ae,Sr as m,Tr as h,UE as g,Vr as _,_r as v,bD as y,br as b,fr as x,gD as S,gr as C,hr as w,jr as T,kr as oe,mr as E,pr as D,vr as se,wi as O,wr as k,xr as A,yr as j,zr as M}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ar as r,Br as i,CD as a,Cr as o,Dr as s,Er as c,Fr as l,GE as ee,Ir as te,Lr as ne,Mr as u,Nr as re,Or as d,Pr as ie,Px as f,Rr as p,Si as ae,Sr as m,Tr as h,UE as g,Vr as _,_r as v,bD as y,br as b,fr as x,gD as S,gr as C,hr as w,jr as T,kr as oe,mr as E,pr as D,vr as se,wi as O,wr as k,xr as A,yr as j,zr as M}from"./dist-BPcfIXgJ.js";import{t as N}from"./button-C3LWIgGJ.js";import{$ as P,A as F,B as I,C as L,F as ce,I as le,L as ue,N as de,P as fe,Q as pe,R as me,S as R,X as he,b as z,et as ge,mt as B,nt as _e,ot as V,rt as ve,v as H,x as U,y as W,z as ye}from"./index-B--TQi5b.js";import{i as G}from"./compatView-MdW0ASNn.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
2
|
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
3
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=a(S.me.getMe,{host:V}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),o=a(S.admin.listInstances,e!==void 0&&t?{}:`skip`),[s,c]=(0,K.useState)(null);(0,K.useEffect)(()=>{!t||!o||o.length===0||(!s||!o.some(e=>e.name===s))&&c(o[0].name)},[t,o,s]);let d=a(S.agents.listAgentsForInstance,t&&s?{instanceName:s}:`skip`),f=a(S.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),m=(0,K.useMemo)(()=>{if(e!==void 0){if(t)return s===null||d===void 0?o!==void 0&&o.length===0?[]:void 0:d.agents.map(e=>({instanceName:s,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(f!==void 0)return f.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,s,d,o,f]),[h,v]=(0,K.useState)(null);(0,K.useEffect)(()=>{!m||m.length===0||(!h||!m.some(e=>$(e)===h))&&v($(m[0]))},[m,h]);let b=m?.find(e=>$(e)===h)??null,x=y(S.agentFiles.listAgentFiles),[C,w]=(0,K.useState)({status:`idle`}),E=b?.instanceName??null,D=b?.agentId??null,se=a(S.compat.forInstance,n&&E!==null?{instanceName:E}:`skip`),O=n&&E!==null?H(se,`agentFiles`):null,k=O===null?!1:O===`loading`?null:O.blocked,A=(0,K.useCallback)(async()=>{if(!(E===null||D===null)){w({status:`loading`});try{w({status:`done`,files:(await x({instanceName:E,agentId:D})).files})}catch{w({status:`error`})}}},[x,E,D]);(0,K.useEffect)(()=>{k===!1&&A()},[A,k]);let[j,P]=(0,K.useState)(null),F=ee(),I=(0,K.useMemo)(()=>new Intl.NumberFormat(F,{maximumFractionDigits:0}),[F]);return e===void 0||m===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(o?.length??0)>1?(0,Q.jsxs)(W,{value:s??``,onValueChange:e=>c(e),children:[(0,Q.jsx)(R,{size:`sm`,"aria-label":i(),children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(z,{children:(o??[]).map(e=>(0,Q.jsx)(U,{value:e.name,children:e.name},e.name))})]}):null,m.length>0?(0,Q.jsxs)(W,{value:h??``,onValueChange:e=>v(e),children:[(0,Q.jsx)(R,{size:`sm`,"aria-label":M(),children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(z,{children:m.map(e=>(0,Q.jsx)(U,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:p()})]}),b===null?null:O===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):O!==null&&O.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(B,{size:14,"aria-hidden":!0}),` `,G(O.gatewayVersion)]}):C.status===`loading`||C.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):C.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[te(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void A(),children:ae()})]}):C.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ne()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:C.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)(he,{variant:`outline`,children:l()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:ie({size:Z(e.size,F)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${i?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:re({pct:I.format(n)})}),i?(0,Q.jsx)(B,{size:14,className:`oc-afiles__warn`,"aria-label":u()}):(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():oe()})]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:T({used:Z(be(C.files),F),total:Z(J,F),pct:I.format(X(be(C.files)))})})]}),j&&b?(0,Q.jsx)(Te,{instanceName:b.instanceName,agentId:b.agentId,name:j.name,isAdmin:t,onClose:()=>P(null),onSaved:()=>void A()}):null]})}function Te({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let l=y(S.agentFiles.getAgentFile),te=y(S.agentFiles.setAgentFile),ne=F(),[u,re]=(0,K.useState)(null),[ie,p]=(0,K.useState)(!1),[_,T]=(0,K.useState)(``),[oe,M]=(0,K.useState)(!1),[L,R]=(0,K.useState)(!1),[he,z]=(0,K.useState)(!1),[B,V]=(0,K.useState)(!1),H=(0,K.useCallback)(async r=>{p(!1);try{let i=await l({instanceName:e,agentId:t,name:n});re({content:i.content,updatedAtMs:i.updatedAtMs}),r||T(i.content),z(!1)}catch{p(!0)}},[l,e,t,n]);(0,K.useEffect)(()=>{H(!1)},[H]);async function U(){if(u!==null){R(!0),V(!1);try{await te({instanceName:e,agentId:t,name:n,content:_,baseUpdatedAtMs:u.updatedAtMs??void 0}),ne.success(m({name:n})),a(),await H(!1)}catch(e){Ce(e)?z(!0):V(!0)}finally{R(!1)}}}let W=u!==null&&_!==u.content,G=(0,K.useMemo)(()=>u===null?null:Se(u.content,_),[u,_]),J=_.length>q,Y=ee(),X=(0,K.useMemo)(()=>new Intl.NumberFormat(Y),[Y]);return(0,Q.jsx)(pe,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(P,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ve,{children:d({name:n})}),(0,Q.jsxs)(ge,{children:[s({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,c()]})]})]}),ie?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[b(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void H(!1),children:ae()})]}):u===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:_,readOnly:!r,spellCheck:!1,onChange:e=>T(e.target.value),"aria-label":d({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:h()}),he?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[j(),` `,(0,Q.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>void H(!0),children:se()})]}):null,B?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:A()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${J?` is-over`:``}`,children:k({count:X.format(_.length),max:X.format(q)})}),r?(0,Q.jsx)(N,{size:`sm`,disabled:!W||L||he,onClick:()=>M(!0),children:L?O():o()}):null]})]}),(0,Q.jsx)(de,{open:oe,onOpenChange:M,children:(0,Q.jsxs)(le,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(I,{children:v({name:n})}),(0,Q.jsx)(ue,{children:C({agent:t})})]}),G?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:w({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:E()}),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:D()}),G.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(ce,{children:f()}),(0,Q.jsx)(fe,{onClick:()=>void U(),children:x()})]})]})})]})})}export{we as AgentFilesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ap as r,Bp as i,CD as a,Cp as ee,Dp as o,Ep as s,Fp as te,Gp as ne,Hp as re,Ip as c,Jp as l,Kp as u,Lp as d,Mp as f,Np as p,Op as m,Pp as h,Rp as ie,SD as ae,Sp as g,Tp as oe,Up as se,Vp as ce,Wp as le,Yp as _,_p as ue,bp as de,cp as v,dp as fe,fp as pe,gD as y,gp as me,hp as he,jp as ge,kp as b,lp as x,mp as S,pp as C,qp as w,sp as T,up as E,vp as D,wp as O,xp as k,yp as A,zp as j}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ap as r,Bp as i,CD as a,Cp as ee,Dp as o,Ep as s,Fp as te,Gp as ne,Hp as re,Ip as c,Jp as l,Kp as u,Lp as d,Mp as f,Np as p,Op as m,Pp as h,Rp as ie,SD as ae,Sp as g,Tp as oe,Up as se,Vp as ce,Wp as le,Yp as _,_p as ue,bp as de,cp as v,dp as fe,fp as pe,gD as y,gp as me,hp as he,jp as ge,kp as b,lp as x,mp as S,pp as C,qp as w,sp as T,up as E,vp as D,wp as O,xp as k,yp as A,zp as j}from"./dist-BPcfIXgJ.js";import{A as M,C as N,Mt as P,S as F,X as I,a as L,b as R,j as _e,jt as z,ot as ve,r as ye,x as B,y as V}from"./index-B--TQi5b.js";import{n as be}from"./TimeRangePicker-BAldDUhc.js";import{t as xe}from"./FilterBar-Dc-vzhP8.js";import{t as Se}from"./DataTableShell-CyKGlXVg.js";import{t as H}from"./dispatchErrorInfo-COvKpdTE.js";var U=t(e(),1),W=n(),G=`__all__`,Ce=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function we(e){return e===`open`?_():e===`acknowledged`?l():w()}var Te=[`info`,`warn`,`critical`],Ee=[`detector`,`agent`,`user`],De={kind:`relative`,from:`now-30d`,to:`now`},Oe=200,K=`all`;function q(){let e=P({from:`/settings/anomalies`}),t=z({from:`/settings/anomalies`}),n=e.q??``,l=e.status===K?G:e.status,_=e.severity??G,v=e.kind??G,[x,w]=(0,U.useState)(G),T=ye(e.from,e.to),{from:E,to:H}=be(T),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,status:e===G?K:e})}),Y=e=>void t({search:t=>({...t,severity:e===G?void 0:e})}),Ne=e=>void t({search:t=>({...t,kind:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,...L(e)})}),Pe=_e(),Z=M(),Q=ae(y.anomalies.resolveAnomaly),Fe=(a(y.me.getMe,{host:ve})?.permissions??[]).includes(`admin.manage`),$=a(y.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:E,to:H,anomalyStatus:l===G?void 0:l,severity:_===G?void 0:_,source:x===G?void 0:x,kind:v===G?void 0:v}}),Ie=(0,U.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Le=n!==``||l!==`open`||_!==G||x!==G||v!==G||T.kind!==`relative`||T.from!==De.from;function Re(){w(G),t({search:{status:`open`},replace:!0})}async function ze(e){if(await Pe({title:u(),description:(0,W.jsxs)(W.Fragment,{children:[ne(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,le(),` `,(0,W.jsx)(`strong`,{children:se()}),`.`,` `,re()]}),confirmLabel:ce()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(i(),e.kind)}catch(e){Z.error(j(),e)}}async function Be(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(ie(),e.kind)}catch(e){Z.error(d(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[c(),` `,(0,W.jsx)(`strong`,{children:te()}),` `,h(),` `,(0,W.jsx)(`strong`,{children:p()}),` `,f(),` `,(0,W.jsx)(`strong`,{children:ge()}),` `,r(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:b()})]}),(0,W.jsxs)(xe,{q:n,onQChange:q,searchPlaceholder:m(),timeRange:T,onTimeRangeChange:X,onReset:Re,canReset:Le,children:[(0,W.jsxs)(V,{value:l,onValueChange:J,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:o()}),Ce.map(e=>(0,W.jsx)(B,{value:e.value,children:we(e.value)},e.value))]})]}),(0,W.jsxs)(V,{value:_,onValueChange:Y,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:s()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:oe()}),Te.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:x,onValueChange:w,children:[(0,W.jsx)(F,{size:`sm`,className:`w-32`,children:(0,W.jsx)(N,{placeholder:O()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:ee()}),Ee.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:v,onValueChange:Ne,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:g()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:k()}),Ie.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Se,{title:de(),rows:$,emptyHint:l===`open`?A():D(),rowActions:e=>Fe&&e.status===`open`?[{label:ue(),onSelect:()=>void ze(e)},{label:me(),onSelect:()=>void Be(e)}]:[],columns:[{header:he(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:g(),cell:e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:s(),cell:e=>(0,W.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:S(),cell:e=>(0,W.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:O(),cell:e=>(0,W.jsx)(I,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:C(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:pe(),cell:e=>(0,W.jsx)(ke,{row:e}),sort:e=>e.evidence??null},{header:fe(),cell:e=>e.correlationId?(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:Me(e.correlationId)}):(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function J(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Y(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function ke({row:e}){let t=z();if(e.kind===`subagent.failure`){let n=Y(e);return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,E()]}):null]})}let n=J(e);if(!n.dominantCode)return(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=H(n.dominantCode),i=n.sampleCorrelationId;return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,W.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,W.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,E()]}):null]})}function Ae({severity:e}){return(0,W.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function je({status:e}){return e===`open`?(0,W.jsx)(I,{variant:`destructive`,children:x()}):e===`acknowledged`?(0,W.jsx)(I,{variant:`secondary`,children:v()}):(0,W.jsx)(I,{variant:`outline`,children:T()})}function Me(e){return e.length>8?e.slice(0,8):e}export{q as AnomaliesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Bm as i,CD as a,Gm as o,Hm as s,Jm as c,Km as l,Qm as u,Um as ee,Vm as d,Wm as f,Xm as p,Ym as m,Zm as h,eh as g,gD as _,qm as v}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$m as r,Bm as i,CD as a,Gm as o,Hm as s,Jm as c,Km as l,Qm as u,Um as ee,Vm as d,Wm as f,Xm as p,Ym as m,Zm as h,eh as g,gD as _,qm as v}from"./dist-BPcfIXgJ.js";import{C as y,Mt as b,S as x,a as S,b as C,i as w,jt as T,o as E,r as D,t as O,x as k,y as A}from"./index-B--TQi5b.js";import{n as j}from"./TimeRangePicker-BAldDUhc.js";import{t as M}from"./FilterBar-Dc-vzhP8.js";import{t as N}from"./AdvancedFilter-DJjN0ZKH.js";import{t as P}from"./DataTableShell-CyKGlXVg.js";var F=t(e(),1),I=n(),L={kind:`relative`,from:O,to:`now`},R=`__all__`,z=[{value:`action`,label:`action`},{value:`realLabel`,label:`acteur réel`},{value:`targetLabel`,label:`au nom de`},{value:`impersonated`,label:`usurpation`},{value:`resource`,label:`ressource`},{value:`resourceId`,label:`id ressource`}];function B(){let e=b({from:`/settings/audit`}),t=T({from:`/settings/audit`}),n=e.q??``,O=e.action??R,B=e.impersonated??R,V=e.resource??R,H=D(e.from,e.to),U=(0,F.useMemo)(()=>E(e.adv),[e.adv]),{from:W,to:G}=j(H),K=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),q=e=>void t({search:t=>({...t,action:e===R?void 0:e})}),J=e=>void t({search:t=>({...t,impersonated:e===R?void 0:e})}),Y=e=>void t({search:t=>({...t,resource:e===R?void 0:e})}),X=e=>void t({search:t=>({...t,...S(e)})}),Z=e=>void t({search:t=>({...t,adv:w(e)}),replace:!0}),Q=a(_.admin.listAudit,{filter:{q:n||void 0,from:W,to:G,action:O===R?void 0:O,resource:V===R?void 0:V,impersonated:B===R?void 0:B===`yes`,advanced:U.length>0?U:void 0}}),$=(0,F.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.action);return[...e].sort()},[Q]),te=(0,F.useMemo)(()=>{let e=new Set;for(let t of Q??[])t.resource&&e.add(t.resource);return[...e].sort()},[Q]),ne=n!==``||O!==R||B!==R||V!==R||U.length>0||H.kind!==`relative`||H.from!==L.from;function re(){t({search:{},replace:!0})}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:r()})]}),(0,I.jsxs)(M,{q:n,onQChange:K,searchPlaceholder:u(),timeRange:H,onTimeRangeChange:X,onReset:re,canReset:ne,children:[(0,I.jsxs)(A,{value:O,onValueChange:q,children:[(0,I.jsx)(x,{size:`sm`,className:`w-40`,children:(0,I.jsx)(y,{placeholder:h()})}),(0,I.jsxs)(C,{children:[(0,I.jsx)(k,{value:R,children:p()}),$.map(e=>(0,I.jsx)(k,{value:e,children:e},e))]})]}),(0,I.jsxs)(A,{value:B,onValueChange:J,children:[(0,I.jsx)(x,{size:`sm`,className:`w-40`,children:(0,I.jsx)(y,{})}),(0,I.jsxs)(C,{children:[(0,I.jsx)(k,{value:R,children:m()}),(0,I.jsx)(k,{value:`yes`,children:c()}),(0,I.jsx)(k,{value:`no`,children:v()})]})]}),(0,I.jsxs)(A,{value:V,onValueChange:Y,children:[(0,I.jsx)(x,{size:`sm`,className:`w-40`,children:(0,I.jsx)(y,{placeholder:l()})}),(0,I.jsxs)(C,{children:[(0,I.jsx)(k,{value:R,children:o()}),te.map(e=>(0,I.jsx)(k,{value:e,children:e},e))]})]})]}),(0,I.jsx)(N,{fields:z,seed:U,onChange:Z}),(0,I.jsx)(P,{title:f(),rows:Q,emptyHint:ee(),columns:[{header:s(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:h(),cell:e=>e.action,sort:e=>e.action},{header:d(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:i(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:l(),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{$l as r,$u as i,Bl as a,Bn as o,CD as s,Cu as c,Eu as l,Gl as u,Gn as d,Hl as f,Hn as p,In as m,Jl as h,Jn as g,Ju as ee,Kl as _,Kn as v,Ql as y,Qu as te,Rl as b,SD as ne,Su as re,Tu as ie,Ul as ae,Un as oe,Vl as se,Vn as ce,Wl as le,Wn as ue,Xl as de,Xn as fe,Yl as pe,Yn as me,Yu as he,Zl as ge,Zn as _e,_D as x,_u as ve,ad as ye,au as be,bD as xe,bu as Se,cd as Ce,cu as we,du as S,ed as Te,eu as Ee,fu as De,gD as C,gu as Oe,hu as ke,id as Ae,iu as je,lu as Me,mu as Ne,nd as Pe,nu as Fe,ou as Ie,pu as Le,ql as Re,qn as ze,rd as Be,ru as Ve,sd as He,su as Ue,td as We,tu as Ge,uu as Ke,vu as qe,wu as Je,xu as Ye,yu as Xe,zl as w}from"./dist-BzNYkP4V.js";import{i as T,r as Ze}from"./dist-AH7-HhdT.js";import{t as Qe}from"./chevrons-up-down-CeISPPN2.js";import{i as $e,n as E,o as et,r as tt,s as nt}from"./FieldLabel-X2EAqICh.js";import{t as D}from"./button-DXGXeanX.js";import{$ as rt,A as it,At as at,C as O,H as ot,Q as st,S as k,St as ct,U as lt,V as ut,X as A,Z as j,_ as dt,_t as ft,b as M,et as pt,jt as mt,kt as N,mt as P,nt as ht,ot as gt,rt as _t,x as F,y as I}from"./index-CKlFEsq3.js";import{a as vt,i as L,n as yt,o as R,r as z,t as bt}from"./table-AFxsandT.js";import{t as xt}from"./FilterBar-CSA8xMkl.js";import{a as B,n as St,o as V,r as H,s as Ct,t as wt}from"./compatView-BKe3swOt.js";import{t as U}from"./dispatchErrorInfo-DekuLV6o.js";var Tt=x(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Et=x(`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`}]]),W=t(e(),1);function G(e){return e.filter(e=>e.state===`error`)}function Dt(e){return e.reachable&&G(e.targets).length===0}function Ot(e){return e.state===`error`&&e.lastErrorCode!==null}function kt(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function At(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function jt(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return At(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function Mt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var q=`__all__`,J={q:``,state:q,instance:q,version:q},Y={connected:0,error:1,idle:2};function Nt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Pt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function X(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Ft(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function It(e,t,n){switch(e){case`state`:return(Y[t.state]??99)-(Y[n.state]??99);case`instance`:return X(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return X(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return V(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function Lt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Ft(t.key,e),a=Ft(t.key,r);return i&&a?0:i?1:a?-1:n*It(t.key,e,r)})}function Rt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(Y[e]??99)-(Y[t]??99))}function zt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>X(e.label,t.label))}function Bt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>V(e,t)??X(e,t))}var Z=n();function Vt({connections:e,displayByInstance:t}){let[n,i]=(0,W.useState)(J),[a,o]=(0,W.useState)(null),s=(0,W.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),c=(0,W.useMemo)(()=>Rt(s),[s]),l=(0,W.useMemo)(()=>zt(s),[s]),d=(0,W.useMemo)(()=>Bt(s),[s]),p=(0,W.useMemo)(()=>Lt(Pt(s,n),a),[s,n,a]);function m(e){o(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(xt,{q:n.q,onQChange:e=>i(t=>({...t,q:e})),searchPlaceholder:r(),onReset:()=>i(J),canReset:Nt(n),children:[(0,Z.jsxs)(I,{value:n.state,onValueChange:e=>i(t=>({...t,state:e})),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(O,{placeholder:ge()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(F,{value:q,children:y()}),c.map(e=>(0,Z.jsx)(F,{value:e,children:Ut(e)},e))]})]}),(0,Z.jsxs)(I,{value:n.instance,onValueChange:e=>i(t=>({...t,instance:e})),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(O,{placeholder:de()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(F,{value:q,children:y()}),l.map(e=>(0,Z.jsx)(F,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(I,{value:n.version,onValueChange:e=>i(t=>({...t,version:e})),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(O,{placeholder:pe()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(F,{value:q,children:y()}),d.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))]})]})]}),p.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,Z.jsxs)(bt,{className:`oc-conn__table`,children:[(0,Z.jsx)(vt,{children:(0,Z.jsxs)(R,{children:[(0,Z.jsx)(Q,{label:Re(),sortKey:`target`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:_(),sortKey:`state`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:u(),sortKey:`instance`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:le(),sortKey:`host`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:ae(),sortKey:`version`,sort:a,onSort:m}),(0,Z.jsx)(L,{children:f()}),(0,Z.jsx)(Q,{label:se(),sortKey:`lastOk`,sort:a,onSort:m})]})}),(0,Z.jsx)(yt,{children:p.map(e=>(0,Z.jsx)(Ht,{r:e},e._id))})]})]})}function Q({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Z.jsx)(L,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Z.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Z.jsx)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(Qe,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Ht({r:e}){let t=Ot(e)?U(e.lastErrorCode):null,n=kt(e)?U(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(W.Fragment,{children:[(0,Z.jsxs)(R,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(z,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(z,{children:(0,Z.jsx)(Wt,{state:e.state})}),(0,Z.jsx)(z,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(z,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(z,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(z,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:Ge({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(z,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(R,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(z,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Ee({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Ut(e){return e===`connected`?a():e===`error`?w():b()}function Wt({state:e}){return e===`connected`?(0,Z.jsx)(A,{variant:`secondary`,children:a()}):e===`error`?(0,Z.jsx)(A,{variant:`destructive`,children:w()}):(0,Z.jsx)(A,{variant:`outline`,children:b()})}function Gt(){return s(C.bridgeHealth.getBridgeHealth,{})}function Kt(){let e=Gt(),t=s(C.compat.getBridgeCompat,{}),n=s(C.me.getMe,{host:gt})?.role===`admin`,r=s(C.admin.listInstances,n?{}:`skip`),i=mt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=jt(e?e.targets:[],t?t.targets:[],r??[]),c=t?.compat??null,l=t===void 0?`loading`:t===null?`nodata`:`ready`,u=c!==null&&St(c,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(qt,{health:e,compat:t,onSeeAnomalies:a}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:De()}),o.map(e=>(0,Z.jsx)(Jt,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:c,compatStatus:l,compatReachable:t?.reachable??!0},e.key)),u?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):null]})}function qt({health:e,compat:t,onSeeAnomalies:n}){let r=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:B(t.bridgeVersion)}),` · `,me(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?g():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Ke()});let i=G(e.targets),a=!e.reachable,o=Dt(e),s=o?`ok`:`error`,c=new Date(e.checkedAt).toLocaleString(`fr-FR`),l=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${s}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:o?(0,Z.jsx)(N,{size:22}):a?(0,Z.jsx)(Et,{size:22}):(0,Z.jsx)(P,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:o?Me():a?we():Ue({count:i.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(Tt,{size:12,"aria-hidden":!0}),` `,Ie({time:c})]}),l?(0,Z.jsx)(`span`,{children:be({time:l})}):null,r]}),a?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:U(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:je()})]})}function Jt({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?Ct(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:wt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,W.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(ft,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Mt(e)}),d?(0,Z.jsx)(A,{variant:d===`beyond`?`destructive`:`secondary`,children:H(d)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:_e()}),(0,Z.jsx)(Yt,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c}),(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Z.jsx)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(at,{size:13,"aria-hidden":!0}),Ve({count:t.length})]}),f?(0,Z.jsx)(Vt,{connections:t,displayByInstance:s}):null]})}function Yt({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ze()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:d()}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:ue({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:g()}),e?(0,Z.jsx)(Qt,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(0,Z.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:B(e.version)}),(0,Z.jsx)(A,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:H(e.state)})]},e.instanceName))})]})}function Xt({instance:e,onClose:t}){return(0,Z.jsx)(st,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(rt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(_t,{children:Ce({instance:e.displayName??e.name})}),(0,Z.jsx)(pt,{children:He()})]}),(0,Z.jsx)(Zt,{instance:e,onClose:t})]})})}function $({label:e,result:t}){return t?t.checked?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Z.jsx)(N,{"aria-hidden":!0}):(0,Z.jsx)(P,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?Oe():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ke()]}):null}function Zt({instance:e,onClose:t}){let n=ne(C.admin.upsertInstanceConfig),r=xe(C.bridge.validateMediaPaths),a=it(),[o,s]=(0,W.useState)(()=>$e(e.config??{})),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),g=o.inboundMediaMode===`shared-fs`,_=o.mediaMode===`shared-fs`,v=g||_;async function y(){p(!0),h(null);try{h(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){a.error(Se(),e)}finally{p(!1)}}async function b(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:tt(o,r)}),t()}catch(e){a.error(Te(),e)}finally{d(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:ye(),help:i()}),(0,Z.jsxs)(I,{value:o.mediaMode,onValueChange:e=>s({...o,mediaMode:e}),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(O,{})}),(0,Z.jsx)(M,{children:nt.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:Ae(),help:te()}),(0,Z.jsxs)(I,{value:o.inboundMediaMode,onValueChange:e=>s({...o,inboundMediaMode:e}),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(O,{})}),(0,Z.jsx)(M,{children:et.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:Be(),help:he()}),(0,Z.jsx)(j,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>s({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),v&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[g&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:l(),help:ie()}),(0,Z.jsx)(j,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>s({...o,inboundAgentMount:e.target.value})})]}),_&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:Je(),help:c()}),(0,Z.jsx)(j,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>s({...o,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(dt,{checked:o.rehydration,onCheckedChange:e=>s({...o,rehydration:e===!0})}),(0,Z.jsx)(E,{label:Pe(),help:ee()})]}),v&&m!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:m.reachable?!m.inbound&&!m.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(P,{"aria-hidden":!0}),Le({reason:m.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:qe(),result:m.inbound}),(0,Z.jsx)($,{label:ve(),result:m.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Xe()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(P,{"aria-hidden":!0}),Ne()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[v&&(0,Z.jsxs)(D,{variant:`outline`,size:`sm`,onClick:()=>void y(),disabled:f,children:[f?(0,Z.jsx)(ct,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?Ye():re()]}),(0,Z.jsx)(D,{size:`sm`,onClick:()=>void b(),disabled:u,children:We()})]})]})})}function Qt({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(ut,{children:[(0,Z.jsx)(lt,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?oe():p({count:e.length}),(0,Z.jsx)(T,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(ot,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:ce()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(A,{variant:`secondary`,children:e},e))})]})]})}export{Kt as BridgeTab,Xt as InstanceConfigDialog};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,$u as i,Bl as a,Bn as o,CD as s,Cu as c,Eu as l,Gl as u,Gn as d,Hl as f,Hn as p,In as m,Jl as h,Jn as g,Ju as ee,Kl as _,Kn as v,Ql as y,Qu as te,Rl as b,SD as ne,Su as re,Tu as ie,Ul as ae,Un as oe,Vl as se,Vn as ce,Wl as le,Wn as ue,Xl as de,Xn as fe,Yl as pe,Yn as me,Yu as he,Zl as ge,Zn as _e,_D as x,_u as ve,ad as ye,au as be,bD as xe,bu as Se,cd as Ce,cu as we,du as S,ed as Te,eu as Ee,fu as De,gD as C,gu as Oe,hu as ke,id as Ae,iu as je,lu as Me,mu as Ne,nd as Pe,nu as Fe,ou as Ie,pu as Le,ql as Re,qn as ze,rd as Be,ru as Ve,sd as He,su as Ue,td as We,tu as Ge,uu as Ke,vu as qe,wu as Je,xu as Ye,yu as Xe,zl as w}from"./dist-BPcfIXgJ.js";import{i as T,r as Ze}from"./dist-D9C9G3zQ.js";import{t as Qe}from"./chevrons-up-down-B6ce3M7f.js";import{i as $e,n as E,o as et,r as tt,s as nt}from"./FieldLabel-CgUTCK6q.js";import{t as D}from"./button-C3LWIgGJ.js";import{$ as rt,A as it,At as at,C as O,H as ot,Q as st,S as k,St as ct,U as lt,V as ut,X as A,Z as j,_ as dt,_t as ft,b as M,et as pt,jt as mt,kt as N,mt as P,nt as ht,ot as gt,rt as _t,x as F,y as I}from"./index-B--TQi5b.js";import{a as vt,i as L,n as yt,o as R,r as z,t as bt}from"./table-CjpKnop2.js";import{t as xt}from"./FilterBar-Dc-vzhP8.js";import{a as B,n as St,o as V,r as H,s as Ct,t as wt}from"./compatView-MdW0ASNn.js";import{t as U}from"./dispatchErrorInfo-COvKpdTE.js";var Tt=x(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Et=x(`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`}]]),W=t(e(),1);function G(e){return e.filter(e=>e.state===`error`)}function Dt(e){return e.reachable&&G(e.targets).length===0}function Ot(e){return e.state===`error`&&e.lastErrorCode!==null}function kt(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function At(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function jt(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return At(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function Mt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var q=`__all__`,J={q:``,state:q,instance:q,version:q},Y={connected:0,error:1,idle:2};function Nt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Pt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function X(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Ft(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function It(e,t,n){switch(e){case`state`:return(Y[t.state]??99)-(Y[n.state]??99);case`instance`:return X(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return X(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return V(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function Lt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Ft(t.key,e),a=Ft(t.key,r);return i&&a?0:i?1:a?-1:n*It(t.key,e,r)})}function Rt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(Y[e]??99)-(Y[t]??99))}function zt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>X(e.label,t.label))}function Bt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>V(e,t)??X(e,t))}var Z=n();function Vt({connections:e,displayByInstance:t}){let[n,i]=(0,W.useState)(J),[a,o]=(0,W.useState)(null),s=(0,W.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),c=(0,W.useMemo)(()=>Rt(s),[s]),l=(0,W.useMemo)(()=>zt(s),[s]),d=(0,W.useMemo)(()=>Bt(s),[s]),p=(0,W.useMemo)(()=>Lt(Pt(s,n),a),[s,n,a]);function m(e){o(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(xt,{q:n.q,onQChange:e=>i(t=>({...t,q:e})),searchPlaceholder:r(),onReset:()=>i(J),canReset:Nt(n),children:[(0,Z.jsxs)(I,{value:n.state,onValueChange:e=>i(t=>({...t,state:e})),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(O,{placeholder:ge()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(F,{value:q,children:y()}),c.map(e=>(0,Z.jsx)(F,{value:e,children:Ut(e)},e))]})]}),(0,Z.jsxs)(I,{value:n.instance,onValueChange:e=>i(t=>({...t,instance:e})),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(O,{placeholder:de()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(F,{value:q,children:y()}),l.map(e=>(0,Z.jsx)(F,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(I,{value:n.version,onValueChange:e=>i(t=>({...t,version:e})),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(O,{placeholder:pe()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(F,{value:q,children:y()}),d.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))]})]})]}),p.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,Z.jsxs)(bt,{className:`oc-conn__table`,children:[(0,Z.jsx)(vt,{children:(0,Z.jsxs)(R,{children:[(0,Z.jsx)(Q,{label:Re(),sortKey:`target`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:_(),sortKey:`state`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:u(),sortKey:`instance`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:le(),sortKey:`host`,sort:a,onSort:m}),(0,Z.jsx)(Q,{label:ae(),sortKey:`version`,sort:a,onSort:m}),(0,Z.jsx)(L,{children:f()}),(0,Z.jsx)(Q,{label:se(),sortKey:`lastOk`,sort:a,onSort:m})]})}),(0,Z.jsx)(yt,{children:p.map(e=>(0,Z.jsx)(Ht,{r:e},e._id))})]})]})}function Q({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Z.jsx)(L,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Z.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Z.jsx)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(Qe,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Ht({r:e}){let t=Ot(e)?U(e.lastErrorCode):null,n=kt(e)?U(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(W.Fragment,{children:[(0,Z.jsxs)(R,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(z,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(z,{children:(0,Z.jsx)(Wt,{state:e.state})}),(0,Z.jsx)(z,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(z,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(z,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(z,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:Ge({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(z,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(R,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(z,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Ee({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Ut(e){return e===`connected`?a():e===`error`?w():b()}function Wt({state:e}){return e===`connected`?(0,Z.jsx)(A,{variant:`secondary`,children:a()}):e===`error`?(0,Z.jsx)(A,{variant:`destructive`,children:w()}):(0,Z.jsx)(A,{variant:`outline`,children:b()})}function Gt(){return s(C.bridgeHealth.getBridgeHealth,{})}function Kt(){let e=Gt(),t=s(C.compat.getBridgeCompat,{}),n=s(C.me.getMe,{host:gt})?.role===`admin`,r=s(C.admin.listInstances,n?{}:`skip`),i=mt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=jt(e?e.targets:[],t?t.targets:[],r??[]),c=t?.compat??null,l=t===void 0?`loading`:t===null?`nodata`:`ready`,u=c!==null&&St(c,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(qt,{health:e,compat:t,onSeeAnomalies:a}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:De()}),o.map(e=>(0,Z.jsx)(Jt,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:c,compatStatus:l,compatReachable:t?.reachable??!0},e.key)),u?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):null]})}function qt({health:e,compat:t,onSeeAnomalies:n}){let r=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:B(t.bridgeVersion)}),` · `,me(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?g():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Ke()});let i=G(e.targets),a=!e.reachable,o=Dt(e),s=o?`ok`:`error`,c=new Date(e.checkedAt).toLocaleString(`fr-FR`),l=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${s}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:o?(0,Z.jsx)(N,{size:22}):a?(0,Z.jsx)(Et,{size:22}):(0,Z.jsx)(P,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:o?Me():a?we():Ue({count:i.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(Tt,{size:12,"aria-hidden":!0}),` `,Ie({time:c})]}),l?(0,Z.jsx)(`span`,{children:be({time:l})}):null,r]}),a?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:U(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:je()})]})}function Jt({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a}){let o=r?Ct(r,e):null,s=new Map;for(let e of n)s.set(e.name,e.displayName??e.name);let c=[],l=new Set;for(let n of t){if(!n.instanceName||l.has(n.instanceName))continue;l.add(n.instanceName);let t=n.gatewayVersion??null;c.push({instanceName:n.instanceName,displayName:s.get(n.instanceName)??n.instanceName,version:t,state:wt(t,e,r)})}let u=c.map(e=>e.state),d=u.includes(`beyond`)?`beyond`:u.length>0&&u.every(e=>e===`supported`)?`supported`:null,[f,p]=(0,W.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(ft,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Mt(e)}),d?(0,Z.jsx)(A,{variant:d===`beyond`?`destructive`:`secondary`,children:H(d)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:_e()}),(0,Z.jsx)(Yt,{support:o,compatStatus:i,compatReachable:a,manifest:r,instanceRows:c}),(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Z.jsx)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(at,{size:13,"aria-hidden":!0}),Ve({count:t.length})]}),f?(0,Z.jsx)(Vt,{connections:t,displayByInstance:s}):null]})}function Yt({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ze()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:d()}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:ue({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:g()}),e?(0,Z.jsx)(Qt,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(0,Z.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:B(e.version)}),(0,Z.jsx)(A,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:H(e.state)})]},e.instanceName))})]})}function Xt({instance:e,onClose:t}){return(0,Z.jsx)(st,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(rt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(_t,{children:Ce({instance:e.displayName??e.name})}),(0,Z.jsx)(pt,{children:He()})]}),(0,Z.jsx)(Zt,{instance:e,onClose:t})]})})}function $({label:e,result:t}){return t?t.checked?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Z.jsx)(N,{"aria-hidden":!0}):(0,Z.jsx)(P,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?Oe():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ke()]}):null}function Zt({instance:e,onClose:t}){let n=ne(C.admin.upsertInstanceConfig),r=xe(C.bridge.validateMediaPaths),a=it(),[o,s]=(0,W.useState)(()=>$e(e.config??{})),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),g=o.inboundMediaMode===`shared-fs`,_=o.mediaMode===`shared-fs`,v=g||_;async function y(){p(!0),h(null);try{h(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){a.error(Se(),e)}finally{p(!1)}}async function b(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:tt(o,r)}),t()}catch(e){a.error(Te(),e)}finally{d(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:ye(),help:i()}),(0,Z.jsxs)(I,{value:o.mediaMode,onValueChange:e=>s({...o,mediaMode:e}),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(O,{})}),(0,Z.jsx)(M,{children:nt.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:Ae(),help:te()}),(0,Z.jsxs)(I,{value:o.inboundMediaMode,onValueChange:e=>s({...o,inboundMediaMode:e}),children:[(0,Z.jsx)(k,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(O,{})}),(0,Z.jsx)(M,{children:et.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:Be(),help:he()}),(0,Z.jsx)(j,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>s({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),v&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[g&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:l(),help:ie()}),(0,Z.jsx)(j,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>s({...o,inboundAgentMount:e.target.value})})]}),_&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:Je(),help:c()}),(0,Z.jsx)(j,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>s({...o,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(dt,{checked:o.rehydration,onCheckedChange:e=>s({...o,rehydration:e===!0})}),(0,Z.jsx)(E,{label:Pe(),help:ee()})]}),v&&m!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:m.reachable?!m.inbound&&!m.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(P,{"aria-hidden":!0}),Le({reason:m.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:qe(),result:m.inbound}),(0,Z.jsx)($,{label:ve(),result:m.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Xe()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(P,{"aria-hidden":!0}),Ne()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[v&&(0,Z.jsxs)(D,{variant:`outline`,size:`sm`,onClick:()=>void y(),disabled:f,children:[f?(0,Z.jsx)(ct,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?Ye():re()]}),(0,Z.jsx)(D,{size:`sm`,onClick:()=>void b(),disabled:u,children:We()})]})]})})}function Qt({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(ut,{children:[(0,Z.jsx)(lt,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?oe():p({count:e.length}),(0,Z.jsx)(T,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(ot,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:ce()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(A,{variant:`secondary`,children:e},e))})]})]})}export{Kt as BridgeTab,Xt as InstanceConfigDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,Br as i,CD as a,Px as o,Qn as s,Si as ee,UE as c,_i as te,ar as ne,bD as l,cr as re,er as ie,gD as u,ir as ae,lr as d,nr as f,od as oe,or as p,rr as m,sr as h,tr as g,ur as se,vi as ce,wi as le}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,Br as i,CD as a,Px as o,Qn as s,Si as ee,UE as c,_i as te,ar as ne,bD as l,cr as re,er as ie,gD as u,ir as ae,lr as d,nr as f,od as oe,or as p,rr as m,sr as h,tr as g,ur as se,vi as ce,wi as le}from"./dist-BPcfIXgJ.js";import{t as _}from"./button-C3LWIgGJ.js";import{A as ue,B as de,C as fe,F as pe,I as me,L as he,N as v,P as y,R as b,S as x,b as S,g as C,h as w,mt as T,v as E,x as D,y as O,z as k}from"./index-B--TQi5b.js";import{i as A}from"./compatView-MdW0ASNn.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=l(u.agentFiles.getChatDefaults),t=l(u.agentFiles.setChatDefaults),n=ue(),[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=a(u.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=a(u.compat.forInstance,U?{instanceName:U}:`skip`),K=U?E(ve,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,j.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,j.useRef)(0),X=(0,j.useCallback)(async()=>{let t=++Y.current;I({status:`loading`});try{let n=N(await e(J));if(Y.current!==t)return;I({status:`done`,current:n}),R(n)}catch{if(Y.current!==t)return;I({status:`error`})}},[e,J]);(0,j.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=F.status===`done`?F.current:null,Q=Z!==null&&L.thinkingDefault!==null&&L.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&L.fastModeDefault!==null&&L.fastModeDefault!==Z.fastModeDefault,ye=Q||$;async function be(){V(!0);try{await t({...J,...Q?{thinkingDefault:L.thinkingDefault}:{},...$?{fastModeDefault:L.fastModeDefault}:{}}),n.success(m()),await X()}catch(e){n.error(f(),e)}finally{V(!1)}}let xe=(0,j.useMemo)(()=>M.map(e=>({id:e,label:C(e)})),[]),Se=(0,j.useMemo)(()=>[{id:`fast`,label:ce()},{id:`standard`,label:te()}],[]);return(0,P.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:se()}),G&&U?(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()}),(0,P.jsxs)(O,{value:U,onValueChange:e=>W(e),disabled:B,children:[(0,P.jsx)(x,{size:`sm`,"aria-label":i(),children:(0,P.jsx)(fe,{})}),(0,P.jsx)(S,{children:(H??[]).map(e=>(0,P.jsx)(D,{value:e.name,children:e.name},e.name))})]})]}):null,_e?(0,P.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:oe()}):K===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):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:c()}):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:ee()})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:d()}),(0,P.jsx)(w,{options:xe,value:L.thinkingDefault,onChange:e=>R({...L,thinkingDefault:e}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()})]}),(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:h()}),(0,P.jsx)(w,{options:Se,value:L.fastModeDefault===null?null:L.fastModeDefault?`fast`:`standard`,onChange:e=>R({...L,fastModeDefault:e===`fast`}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:p()})]}),(0,P.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,P.jsx)(_,{size:`sm`,disabled:!ye||B,onClick:()=>z(!0),children:B?le():ae()})}),(0,P.jsx)(`p`,{className:`oc-cdefaults__note`,children:g()})]}),(0,P.jsx)(v,{open:ge,onOpenChange:z,children:(0,P.jsxs)(me,{children:[(0,P.jsxs)(k,{children:[(0,P.jsx)(de,{children:ie()}),(0,P.jsx)(he,{children:r()})]}),(0,P.jsxs)(b,{children:[(0,P.jsx)(pe,{children:o()}),(0,P.jsx)(y,{onClick:()=>void be(),children:s()})]})]})})]})}export{F as ChatDefaultsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cs as r,Ds as i,Es as a,Os as o,Ts as s,ks as c,ws as l}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cs as r,Ds as i,Es as a,Os as o,Ts as s,ks as c,ws as l}from"./dist-BPcfIXgJ.js";import{i as u,r as d}from"./dist-D9C9G3zQ.js";import{t as f}from"./chevrons-up-down-B6ce3M7f.js";import{t as p}from"./button-C3LWIgGJ.js";import{G as m,J as h,K as g,Tt as _,W as v,Y as y,_ as b,bt as x,ht as S}from"./index-B--TQi5b.js";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./table-CjpKnop2.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=c(),bulkActions:F,emptyHint:I=o(),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)(S,{}):null,e.label,` (`,z.size,`)`]},e.label)):null,N?(0,M.jsxs)(p,{size:`sm`,onClick:N,children:[(0,M.jsx)(x,{}),` `,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)(b,{"aria-label":a(),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":r({column:e.header}),children:[e.header,n?V.dir===`asc`?(0,M.jsx)(d,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(u,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(f,{className:`oc-dt__sort-icon oc-dt__sort-icon--idle`,"aria-hidden":!0})]})},e.header):(0,M.jsx)(w,{className:e.className,children:e.header},e.header)}),A?(0,M.jsx)(w,{className:`w-8`}):null]})}),(0,M.jsx)(T,{children:G.map(e=>{let t=A?.(e)??[],r=L?.(e)??!1;return(0,M.jsxs)(k.Fragment,{children:[(0,M.jsxs)(E,{className:`group/row`,children:[F?(0,M.jsx)(D,{children:(0,M.jsx)(b,{"aria-label":s(),checked:z.has(e._id),onCheckedChange:()=>Z(e._id)})}):null,n.map(t=>(0,M.jsx)(D,{className:t.className,children:t.cell(e)},t.header)),A?(0,M.jsx)(D,{children:t.length>0?(0,M.jsxs)(v,{children:[(0,M.jsx)(y,{asChild:!0,children:(0,M.jsx)(p,{variant:`ghost`,size:`icon-sm`,"aria-label":l(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,M.jsx)(_,{})})}),(0,M.jsx)(m,{align:`end`,children:t.map((t,n)=>(0,M.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,M.jsx)(h,{}):null,(0,M.jsx)(g,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),r&&R?(0,M.jsx)(E,{className:`oc-dt__expansion`,children:(0,M.jsx)(D,{colSpan:q,className:`oc-dt__expansion-cell`,children:R(e)})}):null]},e._id)})})]})]})}export{N as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{X as t}from"./index-
|
|
1
|
+
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{X as t}from"./index-B--TQi5b.js";var n=e();function r({icon:e,total:r,items:i}){if(r===0)return(0,n.jsxs)(t,{variant:`outline`,className:`oc-group-chip oc-group-chip--empty gap-1`,children:[e,`0`]});let a=r-i.length;return(0,n.jsxs)(`div`,{className:`oc-group-detail`,children:[i.map((e,r)=>(0,n.jsxs)(t,{variant:e.highlight?`secondary`:`outline`,className:`oc-group-chip gap-1`,title:e.label,children:[e.marker,(0,n.jsx)(`span`,{className:`oc-group-chip__txt`,children:e.label})]},r)),a>0?(0,n.jsxs)(t,{variant:`outline`,className:`oc-group-chip`,children:[`+`,a]}):null]})}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,A_ as i,B_ as a,CD as o,C_ as s,D_ as c,E_ as l,F_ as u,G_ as d,H_ as f,I_ as p,J_ as m,K_ as h,L_ as g,M_ as _,N_ as v,O_ as ee,P_ as y,Q_ as b,R_ as te,SD as x,S_ as ne,T_ as re,U_ as ie,V_ as S,W_ as C,X_ as w,Y_ as T,Z_ as E,__ as D,av as O,b_ as k,cv as A,dv as j,ev as M,fv as N,gD as P,g_ as F,gv as I,h_ as L,hv as R,iv as z,j_ as B,k_ as V,lv as ae,mv as H,nv as U,ov as W,pv as G,q_ as K,rv as q,sv as J,tv as oe,uv as se,v_ as ce,w_ as le,x_ as ue,y_ as de,z_ as fe}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,A_ as i,B_ as a,CD as o,C_ as s,D_ as c,E_ as l,F_ as u,G_ as d,H_ as f,I_ as p,J_ as m,K_ as h,L_ as g,M_ as _,N_ as v,O_ as ee,P_ as y,Q_ as b,R_ as te,SD as x,S_ as ne,T_ as re,U_ as ie,V_ as S,W_ as C,X_ as w,Y_ as T,Z_ as E,__ as D,av as O,b_ as k,cv as A,dv as j,ev as M,fv as N,gD as P,g_ as F,gv as I,h_ as L,hv as R,iv as z,j_ as B,k_ as V,lv as ae,mv as H,nv as U,ov as W,pv as G,q_ as K,rv as q,sv as J,tv as oe,uv as se,v_ as ce,w_ as le,x_ as ue,y_ as de,z_ as fe}from"./dist-BPcfIXgJ.js";import{t as pe}from"./button-C3LWIgGJ.js";import{j as me}from"./index-B--TQi5b.js";import{t as he}from"./DataTableShell-CyKGlXVg.js";var Y=t(e(),1),X=n(),Z={altered_words:()=>I(),incorrect:()=>R(),incoherence:()=>H(),formatting:()=>G(),latency:()=>N(),api_error:()=>j(),other:()=>se()},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:A()}):e===!1?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:J()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ae()})}function ge({data:e,closeReason:t}){let n=e.snapshot,i=x(P.feedback.respondToFeedback),[o,s]=(0,Y.useState)(e.thread),[c,l]=(0,Y.useState)(``),[u,p]=(0,Y.useState)(!1);async function g(){let t=c.trim();if(!(!t||u)){p(!0);try{await i({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),l(``)}finally{p(!1)}}}let _=[];try{_=n.contextJson?JSON.parse(n.contextJson):[]}catch{_=[]}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?` · ${W()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:O()}),(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:ue()}),(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:z()}),o.length>0?(0,X.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,X.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?q():U()}),(0,X.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,X.jsx)(`p`,{className:`oc-fbadmin__meta`,children:oe()}),(0,X.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:M(),value:c,maxLength:2e3,rows:3,onChange:e=>l(e.target.value.slice(0,2e3))}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,X.jsx)(pe,{size:`sm`,onClick:()=>void g(),disabled:!c.trim()||u,children:u?r():b()})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:E()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||w()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:T()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||w()})]}):null,n.promptText?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:m()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,_.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:K({count:n.contextCount??_.length,truncated:n.contextTruncated?h():``})}),(0,X.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:_.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:d()}),(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:C()}),(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:ie()}),(0,X.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?f({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:[S(),` `,n.clientInfo.plugins.join(`, `),(0,X.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,a()]})]}):null,n.clientInfo?.userAgent?(0,X.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function _e(){let e=o(P.feedback.listForAdmin,{}),t=x(P.feedback.readSnapshot),n=x(P.feedback.deleteFeedback),r=me(),[a,d]=(0,Y.useState)(null),[f,m]=(0,Y.useState)({});async function h(e){if(a===e._id){d(null);return}if(!f[e._id]){let n=await t({feedbackId:e._id});m(t=>({...t,[e._id]:n}))}d(e._id)}async function b(e){await r({title:D(),description:F(),confirmLabel:L(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&d(null))}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[fe(),` `,(0,X.jsx)(`strong`,{children:te()}),` `,g()]}),(0,X.jsx)(he,{title:p(),rows:e,emptyHint:u(),isExpanded:e=>a===e._id&&!!f[e._id],renderExpanded:e=>f[e._id]?(0,X.jsx)(ge,{data:f[e._id],closeReason:e.userCloseReason}):null,columns:[{header:y(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:v(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:_(),cell:e=>e.messageRole===`user`?B():i(),sort:e=>e.messageRole},{header:V(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${ee({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:l(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:re(),cell:e=>e.userClosedAt==null?e.answered?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:le()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:s()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:ne()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:a===e._id?k():de(),onSelect:()=>void h(e)},{label:ce(),onSelect:()=>void b(e),variant:`destructive`}]})]})}export{_e as FeedbacksTab};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{AD as t,_D as n}from"./dist-
|
|
1
|
+
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{AD as t,_D as n}from"./dist-BPcfIXgJ.js";import{c as r,l as i,s as a,u as o}from"./index-B--TQi5b.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`],m=[`reactive`,`sse`],h=`reactive`;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 g={mediaMode:`gateway-http`,inboundMediaMode:`inline`,rehydration:!0,mediaMaxMb:1024,inboundAgentMount:`/home/node/.openclaw/media/inbound`,outboundAgentMount:`/home/node/.openclaw/media/outbound`};function _(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 v(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 y(e){return{mediaMode:e.mediaMode??g.mediaMode,inboundMediaMode:e.inboundMediaMode??g.inboundMediaMode,rehydration:e.rehydration??g.rehydration,mediaMaxMb:e.mediaMaxMb??g.mediaMaxMb,inboundAgentMount:e.inboundAgentMount??g.inboundAgentMount,outboundAgentMount:e.outboundAgentMount??g.outboundAgentMount,promptInjections:_(e.promptInjections)}}function b(e,t){let n={},r=r=>{(e[r]!==g[r]||t[r]!==void 0)&&(n[r]=e[r])};r(`mediaMode`),r(`inboundMediaMode`),r(`rehydration`),r(`mediaMaxMb`),r(`inboundAgentMount`),r(`outboundAgentMount`);let i=v(e.promptInjections);return Object.keys(i).length>0&&(n.promptInjections=i),n}var x=e();function S({text:e}){return(0,x.jsx)(i,{delayDuration:150,children:(0,x.jsxs)(a,{children:[(0,x.jsx)(o,{asChild:!0,children:(0,x.jsx)(`button`,{type:`button`,className:`oc-field__help`,"aria-label":e,onClick:e=>e.preventDefault(),children:(0,x.jsx)(s,{"aria-hidden":!0})})}),(0,x.jsx)(r,{className:`max-w-xs text-pretty`,children:e})]})})}function C({label:e,help:t}){return(0,x.jsxs)(`span`,{className:`oc-field__label`,children:[e,(0,x.jsx)(S,{text:t})]})}export{h as a,m as c,u as d,d as f,y as i,c as l,C as n,p as o,b as r,f as s,S as t,l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as ee,BT as te,CD as ne,GE as re,GT as ie,HT as ae,JT as r,KT as oe,Px as i,QT as a,SD as o,UE as s,UT as c,VT as l,WT as u,XT as d,YT as se,ZT as ce,_E as f,aE as p,bE as le,cE as m,dE as ue,eE as de,fE as fe,gD as h,gE as pe,hE as me,iE as g,lE as _,mE as he,nE as ge,oE as v,pE as _e,qT as y,rE as b,sE as x,tE as S,uE as C,vE as w,xE as T,yE as E}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as ee,BT as te,CD as ne,GE as re,GT as ie,HT as ae,JT as r,KT as oe,Px as i,QT as a,SD as o,UE as s,UT as c,VT as l,WT as u,XT as d,YT as se,ZT as ce,_E as f,aE as p,bE as le,cE as m,dE as ue,eE as de,fE as fe,gD as h,gE as pe,hE as me,iE as g,lE as _,mE as he,nE as ge,oE as v,pE as _e,qT as y,rE as b,sE as x,tE as S,uE as C,vE as w,xE as T,yE as E}from"./dist-BPcfIXgJ.js";import{t as D}from"./button-C3LWIgGJ.js";import{A as O,B as k,C as A,Et as j,F as M,G as N,I as P,K as F,L as I,N as ve,P as ye,R as be,S as L,Tt as xe,W as Se,X as Ce,Y as we,b as R,ht as Te,x as z,y as B,yt as Ee,z as De}from"./index-B--TQi5b.js";import{a as Oe,i as V,n as ke,o as H,r as U,t as Ae}from"./table-CjpKnop2.js";var W=t(e(),1),G=n(),K=`all`;function q(e){switch(e){case`image`:return C();case`audio`:return _();case`video`:return m();case`pdf`:return x();case`document`:return v();case`archive`:return p();default:return g()}}function J(){let[e,t]=(0,W.useState)(K),[n,p]=(0,W.useState)(K),[m,g]=(0,W.useState)(K),[_,v]=(0,W.useState)(K),[x,C]=(0,W.useState)(null),J=o(h.files.softDelete),Y=O();function je(){t(K),p(K),g(K),v(K)}async function Me(){let e=x;if(C(null),e)try{await J({fileId:e.id}),Y.success(y())}catch(e){Y.error(oe(),e)}}let X=ne(h.files.listMine,{direction:e===K?void 0:e,chatId:n===K?void 0:n,instanceName:m===K?void 0:m,category:_===K?void 0:_}),Ne=(0,W.useMemo)(()=>new Intl.DateTimeFormat(re(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:s()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=X,$=e!==K||n!==K||m!==K||_!==K;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:T()}),(0,G.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,G.jsxs)(B,{value:e,onValueChange:t,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":le(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:E()}),(0,G.jsx)(z,{value:`inbound`,children:w()}),(0,G.jsx)(z,{value:`outbound`,children:f()})]})]}),(0,G.jsxs)(B,{value:n,onValueChange:p,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":pe(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:me()}),Q.chats.map(e=>(0,G.jsx)(z,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,G.jsxs)(B,{value:m,onValueChange:g,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":he(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:_e()}),Q.instances.map(e=>(0,G.jsx)(z,{value:e,children:e},e))]})]}):null,(0,G.jsxs)(B,{value:_,onValueChange:v,children:[(0,G.jsx)(L,{size:`sm`,"aria-label":fe(),children:(0,G.jsx)(A,{})}),(0,G.jsxs)(R,{children:[(0,G.jsx)(z,{value:K,children:ue()}),Q.categories.map(e=>(0,G.jsx)(z,{value:e,children:q(e)},e))]})]}),$?(0,G.jsxs)(D,{variant:`ghost`,size:`sm`,onClick:je,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,G.jsx)(Ee,{size:14,"aria-hidden":!0}),d()]}):null]}),Z.length===0?(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:$?l():ae()}):(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:b()}),(0,G.jsx)(V,{children:ge()}),(0,G.jsx)(V,{children:S()}),(0,G.jsx)(V,{children:de()}),(0,G.jsx)(V,{children:ee()}),(0,G.jsx)(V,{className:`text-right`,children:a()})]})}),(0,G.jsx)(ke,{children:Z.map(e=>(0,G.jsxs)(H,{children:[(0,G.jsx)(U,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,G.jsx)(U,{title:e.mimeType,children:q(e.category)}),(0,G.jsx)(U,{children:(0,G.jsx)(Ce,{variant:`secondary`,children:e.direction===`inbound`?w():f()})}),(0,G.jsx)(U,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,G.jsx)(U,{className:`whitespace-nowrap text-muted-foreground`,children:Ne.format(e.createdAt)}),(0,G.jsx)(U,{className:`text-right`,children:(0,G.jsxs)(Se,{children:[(0,G.jsx)(we,{asChild:!0,children:(0,G.jsx)(D,{variant:`ghost`,size:`icon`,"aria-label":se(),children:(0,G.jsx)(xe,{size:16})})}),(0,G.jsxs)(N,{align:`end`,children:[e.url?(0,G.jsx)(F,{asChild:!0,children:(0,G.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,G.jsx)(j,{size:14}),ce()]})}):(0,G.jsxs)(F,{disabled:!0,children:[(0,G.jsx)(j,{size:14}),c()]}),(0,G.jsxs)(F,{variant:`destructive`,onSelect:()=>C({id:e._id,filename:e.filename}),children:[(0,G.jsx)(Te,{size:14}),r()]})]})]})})]},e._id))})]}),Pe?(0,G.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:te({cap:Fe})}):null]}),(0,G.jsx)(ve,{open:x!==null,onOpenChange:e=>!e&&C(null),children:(0,G.jsxs)(P,{children:[(0,G.jsxs)(De,{children:[(0,G.jsx)(k,{children:ie()}),(0,G.jsx)(I,{children:u()})]}),(0,G.jsxs)(be,{children:[(0,G.jsx)(M,{children:i()}),(0,G.jsx)(ye,{onClick:()=>void Me(),children:r()})]})]})})]})}export{J as FilesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{As as r,js as i}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{As as r,js as i}from"./dist-BPcfIXgJ.js";import{t as a}from"./button-C3LWIgGJ.js";import{Z as o,vt as s,yt as c}from"./index-B--TQi5b.js";import{t as l}from"./TimeRangePicker-BAldDUhc.js";var u=t(e(),1),d=n(),f=250;function p({q:e,onQChange:t,searchPlaceholder:n=i(),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)(s,{className:`oc-filterbar__search-icon`,"aria-hidden":!0}),(0,d.jsx)(o,{value:v,onChange:e=>x(e.target.value),placeholder:n,"aria-label":n})]}),p?(0,d.jsx)(`div`,{className:`oc-filterbar__quick`,children:p}):null,m&&h?(0,d.jsx)(l,{value:m,onChange:h}):null,(0,d.jsxs)(a,{variant:`ghost`,size:`sm`,className:`oc-filterbar__reset`,onClick:S,disabled:!_,children:[(0,d.jsx)(c,{}),r()]})]})}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Aa as i,Ba as a,Bi as o,CD as s,Ca as c,Da as l,Ea as u,Fa as d,Ga as f,Gi as p,Ha as m,Hi as h,Ia as g,Ii as _,Ji as v,Ki as y,La as b,Li as x,Ma as ee,Na as S,Oa as C,Pa as te,Qi as w,Ra as T,Ri as E,SD as D,Sa as O,Ta as ne,Ua as re,Ui as k,Va as ie,Vi as A,Wa as j,Wi as M,Xi as N,Yi as P,Zi as F,_D as I,_a as ae,aa as oe,ba as se,ca as L,da as ce,ea as le,fa as ue,gD as R,ga as z,ha as de,ia as fe,ja as pe,ka as me,la as he,ma as ge,na as _e,oa as ve,pa as ye,qi as be,ra as xe,sa as B,ta as Se,ua as Ce,va as we,wa as Te,xa as Ee,ya as De,za as Oe,zi as ke}from"./dist-BzNYkP4V.js";import{t as Ae}from"./x-DQ_CLIEK.js";import{i as V,n as H,r as je,t as Me}from"./tabs-9X-5Pgx3.js";import{t as U}from"./button-DXGXeanX.js";import{$ as Ne,A as W,At as Pe,C as Fe,Q as Ie,S as Le,X as G,Z as K,_ as q,_t as J,b as Re,et as ze,gt as Y,j as Be,m as Ve,nt as He,ot as Ue,rt as We,x as Ge,y as Ke}from"./index-CKlFEsq3.js";import{t as qe}from"./FilterBar-CSA8xMkl.js";import{t as Je}from"./DataTableShell-C1ZKbpq3.js";import{t as X}from"./DetailChips-Dg4YEpwe.js";var Ye=I(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Xe=I(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Z=I(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ze=I(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Q=t(e(),1);function Qe(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function $e(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function et(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function tt(e){switch(e){case`admin`:return ue();case`user`:return ce();case`pending`:return Ce();default:return e}}function nt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function rt(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var $=n(),it={name:``,description:``};function at(){let e=s(R.groups.listGroups,{}),t=s(R.me.getMe,{host:Ue})?.role===`admin`,n=D(R.groups.createGroup),r=D(R.groups.updateGroup),o=D(R.groups.deleteGroup),c=Be(),p=W(),[h,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),[x,w]=(0,Q.useState)(it),[O,k]=(0,Q.useState)(null),[A,M]=(0,Q.useState)(``),N=(0,Q.useMemo)(()=>{if(!e)return e;let t=A.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,A]);function P(){y(null),w(it),_(!0)}function F(e){y(e),w({name:e.name,description:e.description??``}),_(!0)}async function I(){try{v?await r({groupId:v._id,name:x.name,description:x.description}):await n({name:x.name,description:x.description||void 0}),w(it),y(null),_(!1)}catch(e){p.error(ke(),e)}}async function ae(e){if(await c({title:u({name:e.name}),description:ne(),confirmWord:e.name,confirmLabel:Te(),cancelLabel:ee(),destructive:!0}))try{await o({groupId:e._id})}catch(e){p.error(E(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,$.jsx)(qe,{q:A,onQChange:M,onReset:()=>M(``),canReset:A!==``,searchPlaceholder:b()}),(0,$.jsx)(Je,{title:f(),rows:N,addLabel:re(),onAdd:t?P:void 0,emptyHint:m(),columns:[{header:ie(),cell:e=>e.name,sort:e=>e.name},{header:a(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(Z,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:Oe(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(J,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:T(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Xe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(Y,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:g(),onSelect:()=>k({groupId:e._id,name:e.name})},...t?[{label:d(),onSelect:()=>F(e)},{label:te(),variant:`destructive`,onSelect:()=>void ae(e)}]:[]]}),(0,$.jsx)(Ve,{open:h,onOpenChange:_,title:v?i():pe(),description:me(),canSubmit:!!x.name.trim(),onSubmit:I,submitLabel:S(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:C()}),(0,$.jsx)(K,{value:x.name,onChange:e=>w({...x,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:l()}),(0,$.jsx)(K,{value:x.description,onChange:e=>w({...x,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:O?.groupId??null,groupName:O?.name??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(Ye,{size:14,"aria-hidden":!0}),de()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":ye({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[ge(),(0,$.jsx)(Pe,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=s(R.groups.getGroup,n&&e?{groupId:e}:`skip`),a=s(R.groups.listAssignableInstances,n?{}:`skip`),o=s(R.groups.listAssignableUsers,n?{}:`skip`),l=D(R.groups.addMember),u=D(R.groups.removeMember),d=D(R.groups.bulkSetMembers),f=D(R.groups.setGroupManager),p=W(),[m,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(`members`),[ee,S]=(0,Q.useState)(1),[C,te]=(0,Q.useState)(new Set),T=(0,Q.useRef)(null),E=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),ne=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),re=i?.viewerIsAdmin===!0,ie=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{g(``),v(``),b(`members`),S(1),T.current=null},[n,e]),(0,Q.useEffect)(()=>{S(1)},[m]),(0,Q.useEffect)(()=>{n&&i&&e&&T.current!==e&&(T.current=e,te(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let j=(0,Q.useMemo)(()=>o?Qe(o,m,C):[],[o,m,C]);async function N(t,n){if(e)try{n?await u({groupId:e,userId:t}):await l({groupId:e,userId:t})}catch(e){p.error(x(),e)}}async function P(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){p.error(A(),e)}}let F=nt(j,e=>E.has(e.userId)),I=j.filter(e=>E.has(e.userId)).length,L=rt(j,ee,ot);async function ce(){if(!e||j.length===0)return;let t=j.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:F!==`all`})}catch(e){p.error(x(),e)}}return(0,$.jsx)(Ie,{open:n,onOpenChange:r,children:(0,$.jsxs)(Ne,{className:`oc-access`,children:[(0,$.jsxs)(He,{children:[(0,$.jsx)(We,{children:c({name:t})}),(0,$.jsx)(ze,{children:O()})]}),(0,$.jsxs)(Me,{value:y,onValueChange:b,className:`oc-access__tabs`,children:[(0,$.jsxs)(je,{className:`w-full`,children:[(0,$.jsxs)(V,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ze,{size:13,"aria-hidden":!0}),Ee(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,$.jsxs)(V,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(J,{size:13,"aria-hidden":!0}),De(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:ie.size}):null]}),(0,$.jsxs)(V,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Xe,{size:13,"aria-hidden":!0}),w(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(H,{value:`members`,children:o===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):o.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:oe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:m,onChange:e=>g(e.target.value),placeholder:se(),className:`oc-access__search`}),j.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ae()}):(0,$.jsxs)($.Fragment,{children:[j.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:F===`all`?!0:F===`some`?`indeterminate`:!1,onCheckedChange:()=>void ce(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(G,{variant:`outline`,className:`oc-access__count`,children:[I,` / `,j.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:L.pageItems.map(e=>{let t=E.has(e.userId),n=et(e),r=ne.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:t,onCheckedChange:()=>void N(e.userId,t),"aria-label":he({user:n.primary})}),(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,$.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,$.jsx)(G,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&re?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?h():k(),title:r?h():k(),onClick:()=>void P(e.userId,r),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):t&&r?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":M(),title:M(),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(st,{page:L.page,pageCount:L.pageCount,onPage:S})]})]})}),(0,$.jsx)(H,{value:`agents`,children:a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):a.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:_,onChange:e=>v(e.target.value),placeholder:we(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,$.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:ie,query:_},`${e}-${t._id}`))})]})}),(0,$.jsx)(H,{value:`charts`,children:(0,$.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:i,query:a}){let o=s(R.groups.listAssignableAgents,{instanceName:t}),c=D(R.groups.assignAgentToGroup),l=D(R.groups.removeAgentFromGroup),u=D(R.groups.bulkSetGroupAgents),d=W(),[f,p]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{p(1)},[a]),!e)return null;let m=$e(o?.agents??[],a),h=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&m.length===0)return null;let g=m.filter(e=>e.presentInLastOk!==!1),v=nt(g,e=>i.has(`${t}/${e.agentId}`)),y=rt(m,f,ot);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(_(),e)}}async function x(){if(g.length===0)return;let n=g.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){d.error(_(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(J,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n}),h?(0,$.jsx)(G,{variant:`outline`,className:`oc-access__stale`,children:Se()}):null]}),o===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ve()}):m.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:h?_e():xe()}):(0,$.jsxs)($.Fragment,{children:[g.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,a=i.has(n),o=e.presentInLastOk===!1;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:a,disabled:o&&!a,onCheckedChange:()=>void b(e.agentId,a),"aria-label":L({name:e.displayName??e.agentId})}),(0,$.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":r(),title:r(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):null,o?(0,$.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:le()}):null]},e.agentId)}),(0,$.jsx)(st,{page:y.page,pageCount:y.pageCount,onPage:p})]})]})}function ut({groupId:e}){let t=s(R.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=D(R.charts.assignChartToGroup),r=D(R.charts.removeChartFromGroup),i=D(R.charts.setGroupDefaultChart),a=D(R.charts.addChartToGroupPool),c=D(R.charts.removeChartFromGroupPool),l=W();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()});let{pool:u,addable:d,canManagePool:f}=t;if(u.length===0&&!f)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:F()});async function m(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}async function h(t){try{await i({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}async function g(t){try{await a({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}async function _(t){try{await c({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:u.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:e.selected,onCheckedChange:()=>void m(e.chartKey,e.selected),"aria-label":be({name:e.name})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":y(),title:y(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void h(e.chartKey),children:p()}):null,f?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":v({name:e.name}),title:v({name:e.name}),onClick:()=>void _(e.chartKey),children:(0,$.jsx)(Ae,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,$.jsxs)(Ke,{value:``,onValueChange:e=>void g(e),children:[(0,$.jsx)(Le,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Fe,{placeholder:P()})}),(0,$.jsx)(Re,{children:d.map(e=>(0,$.jsx)(Ge,{value:e.chartKey,children:e.name},e.chartKey))})]}):u.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:N()}):null:null]})}export{at as GroupsTab};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Aa as i,Ba as a,Bi as o,CD as s,Ca as c,Da as l,Ea as u,Fa as d,Ga as f,Gi as p,Ha as m,Hi as h,Ia as g,Ii as _,Ji as v,Ki as y,La as b,Li as x,Ma as ee,Na as S,Oa as C,Pa as te,Qi as w,Ra as T,Ri as E,SD as D,Sa as O,Ta as ne,Ua as re,Ui as k,Va as ie,Vi as A,Wa as j,Wi as M,Xi as N,Yi as P,Zi as F,_D as I,_a as ae,aa as oe,ba as se,ca as L,da as ce,ea as le,fa as ue,gD as R,ga as z,ha as de,ia as fe,ja as pe,ka as me,la as he,ma as ge,na as _e,oa as ve,pa as ye,qi as be,ra as xe,sa as B,ta as Se,ua as Ce,va as we,wa as Te,xa as Ee,ya as De,za as Oe,zi as ke}from"./dist-BPcfIXgJ.js";import{t as Ae}from"./x-BY_tjn83.js";import{i as V,n as H,r as je,t as Me}from"./tabs-C1F_imzX.js";import{t as U}from"./button-C3LWIgGJ.js";import{$ as Ne,A as W,At as Pe,C as Fe,Q as Ie,S as Le,X as G,Z as K,_ as q,_t as J,b as Re,et as ze,gt as Y,j as Be,m as Ve,nt as He,ot as Ue,rt as We,x as Ge,y as Ke}from"./index-B--TQi5b.js";import{t as qe}from"./FilterBar-Dc-vzhP8.js";import{t as Je}from"./DataTableShell-CyKGlXVg.js";import{t as X}from"./DetailChips-Ct8LcwC-.js";var Ye=I(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Xe=I(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Z=I(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ze=I(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Q=t(e(),1);function Qe(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function $e(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function et(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function tt(e){switch(e){case`admin`:return ue();case`user`:return ce();case`pending`:return Ce();default:return e}}function nt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function rt(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var $=n(),it={name:``,description:``};function at(){let e=s(R.groups.listGroups,{}),t=s(R.me.getMe,{host:Ue})?.role===`admin`,n=D(R.groups.createGroup),r=D(R.groups.updateGroup),o=D(R.groups.deleteGroup),c=Be(),p=W(),[h,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),[x,w]=(0,Q.useState)(it),[O,k]=(0,Q.useState)(null),[A,M]=(0,Q.useState)(``),N=(0,Q.useMemo)(()=>{if(!e)return e;let t=A.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,A]);function P(){y(null),w(it),_(!0)}function F(e){y(e),w({name:e.name,description:e.description??``}),_(!0)}async function I(){try{v?await r({groupId:v._id,name:x.name,description:x.description}):await n({name:x.name,description:x.description||void 0}),w(it),y(null),_(!1)}catch(e){p.error(ke(),e)}}async function ae(e){if(await c({title:u({name:e.name}),description:ne(),confirmWord:e.name,confirmLabel:Te(),cancelLabel:ee(),destructive:!0}))try{await o({groupId:e._id})}catch(e){p.error(E(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,$.jsx)(qe,{q:A,onQChange:M,onReset:()=>M(``),canReset:A!==``,searchPlaceholder:b()}),(0,$.jsx)(Je,{title:f(),rows:N,addLabel:re(),onAdd:t?P:void 0,emptyHint:m(),columns:[{header:ie(),cell:e=>e.name,sort:e=>e.name},{header:a(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(Z,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:Oe(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(J,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:T(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Xe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(Y,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:g(),onSelect:()=>k({groupId:e._id,name:e.name})},...t?[{label:d(),onSelect:()=>F(e)},{label:te(),variant:`destructive`,onSelect:()=>void ae(e)}]:[]]}),(0,$.jsx)(Ve,{open:h,onOpenChange:_,title:v?i():pe(),description:me(),canSubmit:!!x.name.trim(),onSubmit:I,submitLabel:S(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:C()}),(0,$.jsx)(K,{value:x.name,onChange:e=>w({...x,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:l()}),(0,$.jsx)(K,{value:x.description,onChange:e=>w({...x,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:O?.groupId??null,groupName:O?.name??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(Ye,{size:14,"aria-hidden":!0}),de()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":ye({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[ge(),(0,$.jsx)(Pe,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=s(R.groups.getGroup,n&&e?{groupId:e}:`skip`),a=s(R.groups.listAssignableInstances,n?{}:`skip`),o=s(R.groups.listAssignableUsers,n?{}:`skip`),l=D(R.groups.addMember),u=D(R.groups.removeMember),d=D(R.groups.bulkSetMembers),f=D(R.groups.setGroupManager),p=W(),[m,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(`members`),[ee,S]=(0,Q.useState)(1),[C,te]=(0,Q.useState)(new Set),T=(0,Q.useRef)(null),E=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),ne=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),re=i?.viewerIsAdmin===!0,ie=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{g(``),v(``),b(`members`),S(1),T.current=null},[n,e]),(0,Q.useEffect)(()=>{S(1)},[m]),(0,Q.useEffect)(()=>{n&&i&&e&&T.current!==e&&(T.current=e,te(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let j=(0,Q.useMemo)(()=>o?Qe(o,m,C):[],[o,m,C]);async function N(t,n){if(e)try{n?await u({groupId:e,userId:t}):await l({groupId:e,userId:t})}catch(e){p.error(x(),e)}}async function P(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){p.error(A(),e)}}let F=nt(j,e=>E.has(e.userId)),I=j.filter(e=>E.has(e.userId)).length,L=rt(j,ee,ot);async function ce(){if(!e||j.length===0)return;let t=j.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:F!==`all`})}catch(e){p.error(x(),e)}}return(0,$.jsx)(Ie,{open:n,onOpenChange:r,children:(0,$.jsxs)(Ne,{className:`oc-access`,children:[(0,$.jsxs)(He,{children:[(0,$.jsx)(We,{children:c({name:t})}),(0,$.jsx)(ze,{children:O()})]}),(0,$.jsxs)(Me,{value:y,onValueChange:b,className:`oc-access__tabs`,children:[(0,$.jsxs)(je,{className:`w-full`,children:[(0,$.jsxs)(V,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ze,{size:13,"aria-hidden":!0}),Ee(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:E.size}):null]}),(0,$.jsxs)(V,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(J,{size:13,"aria-hidden":!0}),De(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:ie.size}):null]}),(0,$.jsxs)(V,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Xe,{size:13,"aria-hidden":!0}),w(),i?(0,$.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(H,{value:`members`,children:o===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):o.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:oe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:m,onChange:e=>g(e.target.value),placeholder:se(),className:`oc-access__search`}),j.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ae()}):(0,$.jsxs)($.Fragment,{children:[j.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:F===`all`?!0:F===`some`?`indeterminate`:!1,onCheckedChange:()=>void ce(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(G,{variant:`outline`,className:`oc-access__count`,children:[I,` / `,j.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:L.pageItems.map(e=>{let t=E.has(e.userId),n=et(e),r=ne.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:t,onCheckedChange:()=>void N(e.userId,t),"aria-label":he({user:n.primary})}),(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,$.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,$.jsx)(G,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&re?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?h():k(),title:r?h():k(),onClick:()=>void P(e.userId,r),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):t&&r?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":M(),title:M(),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(st,{page:L.page,pageCount:L.pageCount,onPage:S})]})]})}),(0,$.jsx)(H,{value:`agents`,children:a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):a.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:_,onChange:e=>v(e.target.value),placeholder:we(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,$.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:ie,query:_},`${e}-${t._id}`))})]})}),(0,$.jsx)(H,{value:`charts`,children:(0,$.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:i,query:a}){let o=s(R.groups.listAssignableAgents,{instanceName:t}),c=D(R.groups.assignAgentToGroup),l=D(R.groups.removeAgentFromGroup),u=D(R.groups.bulkSetGroupAgents),d=W(),[f,p]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{p(1)},[a]),!e)return null;let m=$e(o?.agents??[],a),h=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&m.length===0)return null;let g=m.filter(e=>e.presentInLastOk!==!1),v=nt(g,e=>i.has(`${t}/${e.agentId}`)),y=rt(m,f,ot);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(_(),e)}}async function x(){if(g.length===0)return;let n=g.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:v!==`all`})}catch(e){d.error(_(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(J,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n}),h?(0,$.jsx)(G,{variant:`outline`,className:`oc-access__stale`,children:Se()}):null]}),o===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ve()}):m.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:h?_e():xe()}):(0,$.jsxs)($.Fragment,{children:[g.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(q,{checked:v===`all`?!0:v===`some`?`indeterminate`:!1,onCheckedChange:()=>void x(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,y.pageItems.map(e=>{let n=`${t}/${e.agentId}`,a=i.has(n),o=e.presentInLastOk===!1;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:a,disabled:o&&!a,onCheckedChange:()=>void b(e.agentId,a),"aria-label":L({name:e.displayName??e.agentId})}),(0,$.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":r(),title:r(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):null,o?(0,$.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:le()}):null]},e.agentId)}),(0,$.jsx)(st,{page:y.page,pageCount:y.pageCount,onPage:p})]})]})}function ut({groupId:e}){let t=s(R.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=D(R.charts.assignChartToGroup),r=D(R.charts.removeChartFromGroup),i=D(R.charts.setGroupDefaultChart),a=D(R.charts.addChartToGroupPool),c=D(R.charts.removeChartFromGroupPool),l=W();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()});let{pool:u,addable:d,canManagePool:f}=t;if(u.length===0&&!f)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:F()});async function m(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}async function h(t){try{await i({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}async function g(t){try{await a({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}async function _(t){try{await c({groupId:e,chartKey:t})}catch(e){l.error(o(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:u.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(q,{checked:e.selected,onCheckedChange:()=>void m(e.chartKey,e.selected),"aria-label":be({name:e.name})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":y(),title:y(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void h(e.chartKey),children:p()}):null,f?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":v({name:e.name}),title:v({name:e.name}),onClick:()=>void _(e.chartKey),children:(0,$.jsx)(Ae,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,$.jsxs)(Ke,{value:``,onValueChange:e=>void g(e),children:[(0,$.jsx)(Le,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Fe,{placeholder:P()})}),(0,$.jsx)(Re,{children:d.map(e=>(0,$.jsx)(Ge,{value:e.chartKey,children:e.name},e.chartKey))})]}):u.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:N()}):null:null]})}export{at as GroupsTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Ag as i,Ah as a,Bg as o,Bh as s,CD as c,CS as l,Cg as u,Ch as d,Dg as f,Dh as p,Eg as m,Eh as h,Fg as g,Fh as _,Gh as v,Hh as y,Ig as b,Ih as x,Jh as S,Kh as C,Lg as w,Lh as T,Mg as E,Mh as D,Ng as ee,Nh as te,Og as ne,Oh as re,Pg as ie,Ph as ae,Qh as oe,Rg as se,Rh as ce,SD as O,Sg as le,Sh as k,Tg as ue,Th as de,Uh as fe,Vg as pe,Vh as me,Wh as he,Xh as ge,Xu as _e,Yh as ve,Zh as ye,Zu as be,_g as xe,_h as Se,ag as Ce,ah as we,bD as A,bg as Te,bh as Ee,cg as De,ch as Oe,dg as ke,dh as Ae,eg as je,fg as Me,fh as Ne,gD as j,gg as Pe,gh as Fe,hg as Ie,hh as Le,ig as M,ih as Re,jg as ze,jh as Be,kg as Ve,kh as He,lg as Ue,lh as We,mg as Ge,mh as Ke,ng as qe,nh as N,og as Je,oh as Ye,pg as Xe,ph as Ze,qh as P,rg as F,rh as Qe,sg as $e,sh as et,tg as tt,th as nt,ug as rt,uh as it,vg as at,vh as ot,wS as I,wg as st,wh as ct,xg as lt,xh as ut,yg as dt,yh as ft,zg as pt,zh as mt}from"./dist-BzNYkP4V.js";import{a as ht,c as gt}from"./FieldLabel-X2EAqICh.js";import{t as L}from"./button-DXGXeanX.js";import{$ as R,A as z,C as B,H as _t,Q as V,S as H,U as vt,V as yt,X as U,Z as W,_ as G,b as K,et as q,j as bt,m as xt,nt as St,rt as Ct,x as J,y as wt}from"./index-CKlFEsq3.js";import{t as Tt}from"./DataTableShell-C1ZKbpq3.js";import{InstanceConfigDialog as Et}from"./BridgeTab-KP5PlAMx.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Dt=new Set(X),Ot=`conversational`;function kt(e){let t=new Set((e??[]).filter(e=>Dt.has(e)));return t.size===0?[Ot]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:ht},At={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function jt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function Mt(){let e=c(j.admin.listInstances,{}),t=c(j.agents.listAllInstanceAgents,{}),n=O(j.admin.upsertInstance),r=O(j.admin.deleteInstance),a=z(),[s,l]=(0,Y.useState)(!1),[d,p]=(0,Y.useState)(Q),[h,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(null),[C,T]=(0,Y.useState)(null);async function D(){try{await n({instanceId:C??void 0,name:d.name,gatewayUrl:d.gatewayUrl,bridgeUrl:d.bridgeUrl||void 0,displayName:d.displayName||void 0,kind:d.kind,gatewayVersion:d.gatewayVersion||void 0,gatewayHttpUrl:d.gatewayHttpUrl||void 0,streamTransport:d.streamTransport}),p(Q),T(null),l(!1)}catch(e){a.error(pt(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[se(),(0,Z.jsx)(`strong`,{children:w()}),b()]}),(0,Z.jsx)(Tt,{title:g(),rows:e,addLabel:ie(),onAdd:()=>{T(null),p(Q),l(!0)},emptyHint:ee(),columns:[{header:E(),cell:e=>e.name,sort:e=>e.name},{header:ze(),cell:e=>(0,Z.jsx)(U,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:i(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Ve(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:pe(),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)(U,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?N():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:ue(),onSelect:()=>{T(e._id),p(jt(e)),l(!0)}},{label:o(),onSelect:()=>_(e.name)},{label:rt(),onSelect:()=>S(e)},{label:ne(),onSelect:()=>y(e)},{label:f(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:f(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(xt,{open:s,onOpenChange:l,title:C?st():m(),description:le(),canSubmit:!!(d.name&&d.gatewayUrl),onSubmit:D,submitLabel:lt(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Te(),children:[(0,Z.jsx)(W,{value:d.name,disabled:C!==null,onChange:e=>p({...d,name:e.target.value})}),C?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u()}):null]}),(0,Z.jsx)($,{label:dt(),children:(0,Z.jsxs)(wt,{value:d.kind,onValueChange:e=>p({...d,kind:e}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(B,{})}),(0,Z.jsxs)(K,{children:[(0,Z.jsx)(J,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(J,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:at(),children:(0,Z.jsx)(W,{value:d.gatewayUrl,onChange:e=>p({...d,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:xe(),children:(0,Z.jsx)(W,{value:d.bridgeUrl,placeholder:Pe(),onChange:e=>p({...d,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Ie(),children:(0,Z.jsx)(W,{value:d.displayName,onChange:e=>p({...d,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:be(),children:[(0,Z.jsxs)(wt,{value:d.streamTransport,onValueChange:e=>p({...d,streamTransport:e}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(B,{})}),(0,Z.jsx)(K,{children:gt.map(e=>(0,Z.jsx)(J,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_e()})]}),(0,Z.jsx)($,{label:Ge(),children:(0,Z.jsx)(W,{value:d.gatewayVersion,placeholder:Xe(),onChange:e=>p({...d,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:Me(),children:(0,Z.jsx)(W,{value:d.gatewayHttpUrl,placeholder:ke(),onChange:e=>p({...d,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Ht,{instanceName:h,open:h!==null,onOpenChange:e=>{e||_(null)}}),v?(0,Z.jsx)(Et,{instance:v,onClose:()=>y(null)},v._id):null,x?(0,Z.jsx)(Nt,{instance:x,onClose:()=>S(null)},x._id):null]})}function Nt({instance:e,onClose:t}){let n=c(j.instanceSecrets.listInstanceSecretStatus,{}),r=At[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(V,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(R,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(St,{children:[(0,Z.jsx)(Ct,{children:Ue({instance:e.displayName??e.name})}),(0,Z.jsx)(q,{children:De()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(It,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ft,{instance:e})}),(0,Z.jsx)(Pt,{instance:e})]})})}function Pt({instance:e}){let t=A(j.instanceSync.forceInstanceSync),n=z(),[r,i]=(0,Y.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(y());break;case`no_agents`:n.success(s());break;case`no_bridge_url`:n.error(mt());break;case`deploy_misconfigured`:n.error(ce());break;case`unauthorized`:n.error(x());break;case`not_served`:n.error(_());break;default:n.error(T());break}}catch(e){n.error(me(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?fe():he()})})]})}function Ft({instance:e}){let t=c(j.bridgeAuth.listBridgeAuthStatus,{}),n=A(j.bridgeAuth.mintBridgeSecret),r=O(j.bridgeAuth.revokeBridgeSecret),i=z(),[o,s]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(null),[f,m]=(0,Y.useState)(!1),g=(t??[]).find(t=>t.instanceId===e._id),_=g!==void 0;async function v(){if(!o){s(!0);try{d((await n({instanceId:e._id})).plaintext),m(!1)}catch(e){i.error(p(),e)}finally{s(!1)}}}async function y(){if(!o){s(!0);try{await r({instanceId:e._id}),d(null),i.success(re())}catch(e){i.error(p(),e)}finally{s(!1)}}}async function b(){if(u)try{await navigator.clipboard.writeText(u),m(!0)}catch{}}return(0,Z.jsxs)($,{label:te(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:D()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(U,{variant:_?`outline`:`secondary`,children:_?`${M()} · ${g.prefix}…${g.lastFour}`:F()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void v(),disabled:o,children:_?a():Be()}),_?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void y(),disabled:o,children:He()}):null]})]}),u?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:h()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:u}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:f?I():l()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{d(null),m(!1)},children:de()})]}):null]})}function It({instanceId:e,field:t,updatedAt:n}){let i=A(j.instanceSecrets.setInstanceSecret),a=O(j.instanceSecrets.clearInstanceSecret),o=A(j.deviceIdentity.generateDeviceIdentity),s=z(),[c,u]=(0,Y.useState)(``),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),_=n!==null,y=t===`deviceIdentity`,b=t===`token`?$e():t===`deviceIdentity`?Je():Ce();async function x(){if(!(!c.trim()||d)){f(!0);try{await i({instanceId:e,field:t,plaintext:c}),u(``),m(null),g(!1),s.success(oe())}catch(e){s.error(ye(),e)}finally{f(!1)}}}async function w(){if(!d){f(!0);try{await a({instanceId:e,field:t}),m(null),g(!1),s.success(ge())}catch(e){s.error(ye(),e)}finally{f(!1)}}}async function T(){if(!d){f(!0);try{m(await o({instanceId:e})),g(!1),s.success(P())}catch(e){s.error(v(),e)}finally{f(!1)}}}let E=p?`openclaw devices approve ${p.id}`:``;async function D(){if(E)try{await navigator.clipboard.writeText(E),g(!0)}catch{}}return(0,Z.jsxs)($,{label:b,children:[y?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(U,{variant:_?`outline`:`secondary`,children:_?M():F()}),(0,Z.jsx)(W,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:_?tt():qe(),onChange:e=>u(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void x(),disabled:d||c.trim().length===0,children:je()}),y?(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void T(),disabled:d,children:ve()}):null,_?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void w(),disabled:d,children:r()}):null]})]}),p?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:P()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:C()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:E}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void D(),children:h?I():l()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{m(null),g(!1)},children:de()})]}):null]})}var Lt={conversational:Se,documentary:Le},Rt={conversational:Fe,documentary:Ke},zt=e=>(Lt[e]??(()=>e))(),Bt=e=>(Rt[e]??(()=>``))();function Vt({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:ut()}),t.map(e=>(0,Z.jsx)(U,{variant:`secondary`,className:`oc-agenttype__chip`,title:Bt(e),children:zt(e)},e)),(0,Z.jsxs)(yt,{children:[(0,Z.jsx)(vt,{asChild:!0,children:(0,Z.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Ee()})}),(0,Z.jsxs)(_t,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:ft()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:ot()}),(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)(G,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:zt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Bt(r)})]})]},r)})})]})]})]})}function Ht({instanceName:e,open:t,onOpenChange:n}){let r=c(j.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=O(j.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(j.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(j.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=O(j.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(j.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(j.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=O(j.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(j.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=kt(r);e.setQuery(j.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=O(j.agents.removeInstanceAgent),l=bt(),u=z();async function f(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(k(),e)}}async function p(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(k(),e)}}async function m(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){u.error(k(),e)}}async function h(t,n){if(e&&await l({title:Ae({name:n}),description:it(),confirmLabel:We(),destructive:!0}))try{await s({instanceName:e,agentId:t}),u.success(Oe())}catch(e){u.error(k(),e)}}return(0,Z.jsx)(V,{open:t,onOpenChange:n,children:(0,Z.jsxs)(R,{className:`oc-access`,children:[(0,Z.jsxs)(St,{children:[(0,Z.jsx)(Ct,{children:ct({name:e??``})}),(0,Z.jsx)(q,{children:d()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:et()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Ye():r.discovery.lastPollOk?we():Re({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Qe()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(G,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void f(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)(U,{variant:`outline`,className:`oc-access__gone`,children:nt()}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(e.agentId,i),children:Ne()})]}):n?(0,Z.jsx)(U,{variant:`default`,children:N()}):(0,Z.jsx)(L,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void p(e.agentId),children:Ze()})]}),e.enabled?(0,Z.jsx)(Vt,{agentId:e.agentId,types:a,onToggle:t=>void m(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Mt as InstancesTab};
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,Ag as i,Ah as a,Bg as o,Bh as s,CD as c,CS as l,Cg as u,Ch as d,Dg as f,Dh as p,Eg as m,Eh as h,Fg as g,Fh as _,Gh as v,Hh as y,Ig as b,Ih as x,Jh as S,Kh as C,Lg as w,Lh as T,Mg as E,Mh as D,Ng as ee,Nh as te,Og as ne,Oh as re,Pg as ie,Ph as ae,Qh as oe,Rg as se,Rh as ce,SD as O,Sg as le,Sh as k,Tg as ue,Th as de,Uh as fe,Vg as pe,Vh as me,Wh as he,Xh as ge,Xu as _e,Yh as ve,Zh as ye,Zu as be,_g as xe,_h as Se,ag as Ce,ah as we,bD as A,bg as Te,bh as Ee,cg as De,ch as Oe,dg as ke,dh as Ae,eg as je,fg as Me,fh as Ne,gD as j,gg as Pe,gh as Fe,hg as Ie,hh as Le,ig as M,ih as Re,jg as ze,jh as Be,kg as Ve,kh as He,lg as Ue,lh as We,mg as Ge,mh as Ke,ng as qe,nh as N,og as Je,oh as Ye,pg as Xe,ph as Ze,qh as P,rg as F,rh as Qe,sg as $e,sh as et,tg as tt,th as nt,ug as rt,uh as it,vg as at,vh as ot,wS as I,wg as st,wh as ct,xg as lt,xh as ut,yg as dt,yh as ft,zg as pt,zh as mt}from"./dist-BPcfIXgJ.js";import{a as ht,c as gt}from"./FieldLabel-CgUTCK6q.js";import{t as L}from"./button-C3LWIgGJ.js";import{$ as R,A as z,C as B,H as _t,Q as V,S as H,U as vt,V as yt,X as U,Z as W,_ as G,b as K,et as q,j as bt,m as xt,nt as St,rt as Ct,x as J,y as wt}from"./index-B--TQi5b.js";import{t as Tt}from"./DataTableShell-CyKGlXVg.js";import{InstanceConfigDialog as Et}from"./BridgeTab-B5Mc-mW3.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Dt=new Set(X),Ot=`conversational`;function kt(e){let t=new Set((e??[]).filter(e=>Dt.has(e)));return t.size===0?[Ot]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:ht},At={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function jt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function Mt(){let e=c(j.admin.listInstances,{}),t=c(j.agents.listAllInstanceAgents,{}),n=O(j.admin.upsertInstance),r=O(j.admin.deleteInstance),a=z(),[s,l]=(0,Y.useState)(!1),[d,p]=(0,Y.useState)(Q),[h,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(null),[C,T]=(0,Y.useState)(null);async function D(){try{await n({instanceId:C??void 0,name:d.name,gatewayUrl:d.gatewayUrl,bridgeUrl:d.bridgeUrl||void 0,displayName:d.displayName||void 0,kind:d.kind,gatewayVersion:d.gatewayVersion||void 0,gatewayHttpUrl:d.gatewayHttpUrl||void 0,streamTransport:d.streamTransport}),p(Q),T(null),l(!1)}catch(e){a.error(pt(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[se(),(0,Z.jsx)(`strong`,{children:w()}),b()]}),(0,Z.jsx)(Tt,{title:g(),rows:e,addLabel:ie(),onAdd:()=>{T(null),p(Q),l(!0)},emptyHint:ee(),columns:[{header:E(),cell:e=>e.name,sort:e=>e.name},{header:ze(),cell:e=>(0,Z.jsx)(U,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:i(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Ve(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:pe(),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)(U,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?N():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:ue(),onSelect:()=>{T(e._id),p(jt(e)),l(!0)}},{label:o(),onSelect:()=>_(e.name)},{label:rt(),onSelect:()=>S(e)},{label:ne(),onSelect:()=>y(e)},{label:f(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:f(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(xt,{open:s,onOpenChange:l,title:C?st():m(),description:le(),canSubmit:!!(d.name&&d.gatewayUrl),onSubmit:D,submitLabel:lt(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Te(),children:[(0,Z.jsx)(W,{value:d.name,disabled:C!==null,onChange:e=>p({...d,name:e.target.value})}),C?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:u()}):null]}),(0,Z.jsx)($,{label:dt(),children:(0,Z.jsxs)(wt,{value:d.kind,onValueChange:e=>p({...d,kind:e}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(B,{})}),(0,Z.jsxs)(K,{children:[(0,Z.jsx)(J,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(J,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:at(),children:(0,Z.jsx)(W,{value:d.gatewayUrl,onChange:e=>p({...d,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:xe(),children:(0,Z.jsx)(W,{value:d.bridgeUrl,placeholder:Pe(),onChange:e=>p({...d,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Ie(),children:(0,Z.jsx)(W,{value:d.displayName,onChange:e=>p({...d,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:be(),children:[(0,Z.jsxs)(wt,{value:d.streamTransport,onValueChange:e=>p({...d,streamTransport:e}),children:[(0,Z.jsx)(H,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(B,{})}),(0,Z.jsx)(K,{children:gt.map(e=>(0,Z.jsx)(J,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_e()})]}),(0,Z.jsx)($,{label:Ge(),children:(0,Z.jsx)(W,{value:d.gatewayVersion,placeholder:Xe(),onChange:e=>p({...d,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:Me(),children:(0,Z.jsx)(W,{value:d.gatewayHttpUrl,placeholder:ke(),onChange:e=>p({...d,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Ht,{instanceName:h,open:h!==null,onOpenChange:e=>{e||_(null)}}),v?(0,Z.jsx)(Et,{instance:v,onClose:()=>y(null)},v._id):null,x?(0,Z.jsx)(Nt,{instance:x,onClose:()=>S(null)},x._id):null]})}function Nt({instance:e,onClose:t}){let n=c(j.instanceSecrets.listInstanceSecretStatus,{}),r=At[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(V,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(R,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(St,{children:[(0,Z.jsx)(Ct,{children:Ue({instance:e.displayName??e.name})}),(0,Z.jsx)(q,{children:De()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(It,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ft,{instance:e})}),(0,Z.jsx)(Pt,{instance:e})]})})}function Pt({instance:e}){let t=A(j.instanceSync.forceInstanceSync),n=z(),[r,i]=(0,Y.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(y());break;case`no_agents`:n.success(s());break;case`no_bridge_url`:n.error(mt());break;case`deploy_misconfigured`:n.error(ce());break;case`unauthorized`:n.error(x());break;case`not_served`:n.error(_());break;default:n.error(T());break}}catch(e){n.error(me(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?fe():he()})})]})}function Ft({instance:e}){let t=c(j.bridgeAuth.listBridgeAuthStatus,{}),n=A(j.bridgeAuth.mintBridgeSecret),r=O(j.bridgeAuth.revokeBridgeSecret),i=z(),[o,s]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(null),[f,m]=(0,Y.useState)(!1),g=(t??[]).find(t=>t.instanceId===e._id),_=g!==void 0;async function v(){if(!o){s(!0);try{d((await n({instanceId:e._id})).plaintext),m(!1)}catch(e){i.error(p(),e)}finally{s(!1)}}}async function y(){if(!o){s(!0);try{await r({instanceId:e._id}),d(null),i.success(re())}catch(e){i.error(p(),e)}finally{s(!1)}}}async function b(){if(u)try{await navigator.clipboard.writeText(u),m(!0)}catch{}}return(0,Z.jsxs)($,{label:te(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:D()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(U,{variant:_?`outline`:`secondary`,children:_?`${M()} · ${g.prefix}…${g.lastFour}`:F()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void v(),disabled:o,children:_?a():Be()}),_?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void y(),disabled:o,children:He()}):null]})]}),u?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:h()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:u}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:f?I():l()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{d(null),m(!1)},children:de()})]}):null]})}function It({instanceId:e,field:t,updatedAt:n}){let i=A(j.instanceSecrets.setInstanceSecret),a=O(j.instanceSecrets.clearInstanceSecret),o=A(j.deviceIdentity.generateDeviceIdentity),s=z(),[c,u]=(0,Y.useState)(``),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),_=n!==null,y=t===`deviceIdentity`,b=t===`token`?$e():t===`deviceIdentity`?Je():Ce();async function x(){if(!(!c.trim()||d)){f(!0);try{await i({instanceId:e,field:t,plaintext:c}),u(``),m(null),g(!1),s.success(oe())}catch(e){s.error(ye(),e)}finally{f(!1)}}}async function w(){if(!d){f(!0);try{await a({instanceId:e,field:t}),m(null),g(!1),s.success(ge())}catch(e){s.error(ye(),e)}finally{f(!1)}}}async function T(){if(!d){f(!0);try{m(await o({instanceId:e})),g(!1),s.success(P())}catch(e){s.error(v(),e)}finally{f(!1)}}}let E=p?`openclaw devices approve ${p.id}`:``;async function D(){if(E)try{await navigator.clipboard.writeText(E),g(!0)}catch{}}return(0,Z.jsxs)($,{label:b,children:[y?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(U,{variant:_?`outline`:`secondary`,children:_?M():F()}),(0,Z.jsx)(W,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:_?tt():qe(),onChange:e=>u(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void x(),disabled:d||c.trim().length===0,children:je()}),y?(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void T(),disabled:d,children:ve()}):null,_?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void w(),disabled:d,children:r()}):null]})]}),p?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:P()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:C()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:E}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void D(),children:h?I():l()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{m(null),g(!1)},children:de()})]}):null]})}var Lt={conversational:Se,documentary:Le},Rt={conversational:Fe,documentary:Ke},zt=e=>(Lt[e]??(()=>e))(),Bt=e=>(Rt[e]??(()=>``))();function Vt({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:ut()}),t.map(e=>(0,Z.jsx)(U,{variant:`secondary`,className:`oc-agenttype__chip`,title:Bt(e),children:zt(e)},e)),(0,Z.jsxs)(yt,{children:[(0,Z.jsx)(vt,{asChild:!0,children:(0,Z.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Ee()})}),(0,Z.jsxs)(_t,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:ft()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:ot()}),(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)(G,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:zt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Bt(r)})]})]},r)})})]})]})]})}function Ht({instanceName:e,open:t,onOpenChange:n}){let r=c(j.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=O(j.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(j.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(j.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=O(j.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(j.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(j.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=O(j.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(j.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=kt(r);e.setQuery(j.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=O(j.agents.removeInstanceAgent),l=bt(),u=z();async function f(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(k(),e)}}async function p(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(k(),e)}}async function m(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){u.error(k(),e)}}async function h(t,n){if(e&&await l({title:Ae({name:n}),description:it(),confirmLabel:We(),destructive:!0}))try{await s({instanceName:e,agentId:t}),u.success(Oe())}catch(e){u.error(k(),e)}}return(0,Z.jsx)(V,{open:t,onOpenChange:n,children:(0,Z.jsxs)(R,{className:`oc-access`,children:[(0,Z.jsxs)(St,{children:[(0,Z.jsx)(Ct,{children:ct({name:e??``})}),(0,Z.jsx)(q,{children:d()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:et()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Ye():r.discovery.lastPollOk?we():Re({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Qe()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(G,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void f(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)(U,{variant:`outline`,className:`oc-access__gone`,children:nt()}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(e.agentId,i),children:Ne()})]}):n?(0,Z.jsx)(U,{variant:`default`,children:N()}):(0,Z.jsx)(L,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void p(e.agentId),children:Ze()})]}),e.enabled?(0,Z.jsx)(Vt,{agentId:e.agentId,types:a,onToggle:t=>void m(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Mt as InstancesTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Av as i,Bv as a,CD as o,Cv as s,Dv as c,Ev as l,Fv as ee,Gv as te,Hv as ne,Iv as re,Jv as u,Kv as ie,Lv as ae,Mv as oe,Nv as se,Ov as d,Pv as f,Qv as p,Rv as m,SD as h,Sv as g,Tv as _,Uv as v,Vv as y,Wv as b,Xv as x,Yv as S,Zv as ce,_t as le,_v as C,ay as w,bD as T,bv as E,cy as D,dt as O,ey as k,ft as A,gD as j,gt as M,ht as N,iy as P,jv as F,kv as I,ly as L,mt as R,ny as z,oy as B,pt as V,qv as H,ry as U,sy as W,ty as ue,ut as de,vt as fe,vv as pe,wv as me,xv as he,yv as ge,zv as _e}from"./dist-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Av as i,Bv as a,CD as o,Cv as s,Dv as c,Ev as l,Fv as ee,Gv as te,Hv as ne,Iv as re,Jv as u,Kv as ie,Lv as ae,Mv as oe,Nv as se,Ov as d,Pv as f,Qv as p,Rv as m,SD as h,Sv as g,Tv as _,Uv as v,Vv as y,Wv as b,Xv as x,Yv as S,Zv as ce,_t as le,_v as C,ay as w,bD as T,bv as E,cy as D,dt as O,ey as k,ft as A,gD as j,gt as M,ht as N,iy as P,jv as F,kv as I,ly as L,mt as R,ny as z,oy as B,pt as V,qv as H,ry as U,sy as W,ty as ue,ut as de,vt as fe,vv as pe,wv as me,xv as he,yv as ge,zv as _e}from"./dist-BPcfIXgJ.js";import{t as G}from"./button-C3LWIgGJ.js";import{C as ve,S as ye,X as K,Z as q,_ as be,b as xe,x as Se,y as Ce}from"./index-B--TQi5b.js";import{t as we}from"./DataTableShell-CyKGlXVg.js";var J=t(e(),1),Y=n();function Te(){let e=o(j.integrations.status.status,{}),t=h(j.admin.setIntegrationConfig),[n,T]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&T(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:L()});let O=n,A=(e,t,n)=>T({...O,[e]:{...O[e],[t]:n}}),N=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[D(),` `,(0,Y.jsx)(`strong`,{children:W()}),` `,B()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:w()}):(0,Y.jsx)(K,{variant:`outline`,children:P()}):(0,Y.jsx)(K,{variant:`outline`,children:U()}),note:ue(),children:[(0,Y.jsx)(Z,{label:r(),children:(0,Y.jsx)(q,{value:O.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>A(`langfuse`,`host`,e.target.value),onBlur:()=>N(`langfuse`,{host:O.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:S(),checked:O.langfuse.enabled??!0,onChange:e=>{A(`langfuse`,`enabled`,e),N(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:w()}):(0,Y.jsx)(K,{variant:`outline`,children:P()}):(0,Y.jsx)(K,{variant:`outline`,children:U()}),note:k(),children:[(0,Y.jsx)(Z,{label:p(),children:(0,Y.jsx)(q,{value:O.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>A(`opik`,`baseUrl`,e.target.value),onBlur:()=>N(`opik`,{baseUrl:O.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:ce(),children:(0,Y.jsx)(q,{value:O.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||x(),onChange:e=>A(`opik`,`workspace`,e.target.value),onBlur:()=>N(`opik`,{workspace:O.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:S(),checked:O.opik.enabled??!0,onChange:e=>{A(`opik`,`enabled`,e),N(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:w()}):(0,Y.jsx)(K,{variant:`outline`,children:P()}):(0,Y.jsx)(K,{variant:`outline`,children:fe()}),note:le(),children:[(0,Y.jsx)(Z,{label:M(),children:(0,Y.jsx)(q,{value:O.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>A(`otlp`,`endpoint`,e.target.value),onBlur:()=>N(`otlp`,{endpoint:O.otlp.endpoint??``})})}),(0,Y.jsx)(Ee,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:S(),checked:O.otlp.enabled??!0,onChange:e=>{A(`otlp`,`enabled`,e),N(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:u(),status:(0,Y.jsx)(K,{variant:`outline`,children:z()}),note:H(),children:[(0,Y.jsx)(Z,{label:ie(),children:(0,Y.jsx)($,{value:O.tts.auto??`off`,options:[[`off`,te()],[`always`,b()],[`inbound`,v()],[`tagged`,ne()]],onChange:e=>{A(`tts`,`auto`,e),N(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:y(),children:(0,Y.jsx)($,{value:O.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,a()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{A(`tts`,`provider`,e),N(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:_e(),children:(0,Y.jsx)(q,{value:O.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>A(`tts`,`model`,e.target.value),onBlur:()=>N(`tts`,{model:O.tts.model??``})})}),(0,Y.jsx)(Z,{label:m(),children:(0,Y.jsx)(q,{value:O.tts.voice??``,placeholder:ae(),onChange:e=>A(`tts`,`voice`,e.target.value),onBlur:()=>N(`tts`,{voice:O.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:re(),status:(0,Y.jsx)(K,{variant:`outline`,children:z()}),note:e.secrets.openai?ee():f(),children:[(0,Y.jsx)(Q,{label:se(),checked:O.talk.enabled??!1,onChange:e=>{A(`talk`,`enabled`,e),N(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:oe(),children:(0,Y.jsx)($,{value:O.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{A(`talk`,`realtimeProvider`,e),N(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:F(),children:(0,Y.jsx)(q,{value:O.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>A(`talk`,`realtimeModel`,e.target.value),onBlur:()=>N(`talk`,{realtimeModel:O.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:m(),children:(0,Y.jsx)(q,{value:O.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>A(`talk`,`voice`,e.target.value),onBlur:()=>N(`talk`,{voice:O.talk.voice??``})})}),(0,Y.jsx)(Z,{label:i(),children:(0,Y.jsx)($,{value:O.talk.transport??`webrtc`,options:[[`webrtc`,I()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{A(`talk`,`transport`,e),N(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:d(),children:(0,Y.jsx)(q,{value:O.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>A(`talk`,`speechLocale`,e.target.value),onBlur:()=>N(`talk`,{speechLocale:O.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:c(),checked:O.talk.interruptOnSpeech??!0,onChange:e=>{A(`talk`,`interruptOnSpeech`,e),N(`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:l()}),(0,Y.jsx)(K,{variant:`outline`,children:_()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[me(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(we,{title:s(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:g(),columns:[{header:he(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:E(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:ge(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:pe(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:C(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(be,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(Ce,{value:e,onValueChange:n,children:[(0,Y.jsx)(ye,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(ve,{})}),(0,Y.jsx)(xe,{children:t.map(([e,t])=>(0,Y.jsx)(Se,{value:e,children:t},e))})]})}function Ee({headersSet:e}){let t=T(j.integrations.otlpSecret.setOtlpHeaders),n=h(j.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),l=async()=>{c(!0),o(null);try{await t({headersJson:r}),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}};return(0,Y.jsxs)(Z,{label:N(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?R():V(),onChange:e=>i(e.target.value)}),(0,Y.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,Y.jsx)(G,{size:`sm`,disabled:s||r.trim().length===0,onClick:()=>void l(),children:A()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:s,onClick:()=>void n({}),children:O()}):null]}),a?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:a}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:de()})]})}export{Te as IntegrationsTab};
|