修复BUG
This commit is contained in:
@@ -1 +0,0 @@
|
||||
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,t as n}from"./jsx-runtime-CRBytmvs.js";import{o as r}from"./chunk-KS7C4IRE-Zm15rq6F.js";import{t as i}from"./typography-DRFhazK9.js";import{t as a}from"./tooltip-SaeG1Uv7.js";import{t as o}from"./space-Cu4QVMgQ.js";import{t as s}from"./button-BILozH6U.js";import{t as c}from"./app-Bntg8WFU.js";import{t as l}from"./empty-_1ZFK8yy.js";import{t as u}from"./avatar-DPxbCsa4.js";import{t as d}from"./card-DU2T2-YW.js";import{t as f}from"./spin-CfJYIffX.js";import{t as p}from"./switch--LhkZymx.js";import{t as m}from"./tag-DBV1bHre.js";import{t as h}from"./theme-D5FZSALB.js";import{t as g}from"./useTranslation-DBl6NYjI.js";import{n as _,r as v}from"./agent-CCozney_.js";var y=e(t(),1),b=n(),{Title:x,Text:S,Paragraph:C}=i;function w(){let{t:e}=g(),{token:t}=h.useToken(),{message:n}=c.useApp(),i=r(),[w,T]=(0,y.useState)([]),[E,D]=(0,y.useState)(!1),O=(0,y.useCallback)(async()=>{D(!0);try{let e=await _();T(e.data.data??[])}finally{D(!1)}},[]);(0,y.useEffect)(()=>{O()},[O]);let k=async(t,r)=>{try{await v(t,{enabled:r}),T(e=>e.map(e=>e.id===t?{...e,enabled:r}:e)),n.success(e(`ai.agent.update.success`))}catch{n.error(e(`ai.agent.update.failed`))}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,marginBottom:t.marginLG},children:(0,b.jsxs)(`div`,{children:[(0,b.jsx)(x,{level:3,style:{marginBottom:t.marginXS},children:e(`ai.agent.page.title`)}),(0,b.jsx)(S,{type:`secondary`,children:e(`ai.agent.page.description`)})]})}),(0,b.jsx)(f,{spinning:E,children:w.length>0?(0,b.jsx)(`div`,{className:`flex flex-wrap gap-6`,children:w.map(n=>(0,b.jsx)(a,{title:n.description,children:(0,b.jsxs)(d,{hoverable:!0,variant:`borderless`,styles:{body:{width:300,padding:20,overflow:`hidden`}},children:[(0,b.jsxs)(`div`,{className:`flex justify-between items-center mb-2.5`,children:[(0,b.jsxs)(o,{align:`center`,children:[(0,b.jsx)(u,{src:n.icon,size:32}),(0,b.jsx)(`span`,{style:{fontWeight:700,fontSize:18},children:n.name})]}),(0,b.jsx)(p,{checked:n.enabled,size:`small`,onChange:e=>k(n.id,e)})]}),(0,b.jsx)(C,{type:`secondary`,ellipsis:{rows:2},style:{marginBottom:t.marginSM},children:n.description}),(0,b.jsx)(o,{size:[4,4],wrap:!0,children:n.tags?.map(e=>(0,b.jsx)(m,{color:`blue`,children:e},e))}),(0,b.jsx)(`div`,{style:{marginTop:t.marginSM},children:(0,b.jsx)(s,{type:`primary`,size:`small`,block:!0,onClick:()=>i(`/ai/chat?agent_id=${n.id}`),children:e(`ai.agent.goChat`)})})]})}))}):(0,b.jsx)(l,{description:e(`ai.agent.empty`)})})]})}export{w as default};
|
||||
Reference in New Issue
Block a user