import{n as i,p as B,q as z,D as M,bb as V,aG as O,d as A,r as o,aH as oe,s as Z,bj as ae,v as ee,cD as le,m as ce,A as de,G as q,bf as pe,aB as W,aa as D,aj as K,i as ue,aA as fe,H as L,a as j,L as y,M as me,af as Y,cE as ve,cF as he,y as k,W as ge,a5 as E,K as be,o as xe,b as ze,f as d,w as v,e as I,h as r,a6 as ye,a7 as Se,a3 as F,t as N,g as J,cn as Ce,a8 as we}from"./index-BJD7BFLS.js";import{M as T,B as Q,D as X}from"./index-DR269vK4.js";import{P as ke,T as G,G as Pe}from"./index-tLM7xysn.js";import{G as _e,S as Re}from"./index-BekCP-pf.js";import{g as $e}from"./get-slot-Bk_rJcZu.js";import"./vue.runtime.esm-bundler-Bq_JOG-p.js";import"./index-BVSAzRjT.js";import"./index-UU4FlV3Q.js";const Ie=i("steps",`
 width: 100%;
 display: flex;
`,[i("step",`
 position: relative;
 display: flex;
 flex: 1;
 `,[B("disabled","cursor: not-allowed"),B("clickable",`
 cursor: pointer;
 `),z("&:last-child",[i("step-splitor","display: none;")])]),i("step-splitor",`
 background-color: var(--n-splitor-color);
 margin-top: calc(var(--n-step-header-font-size) / 2);
 height: 1px;
 flex: 1;
 align-self: flex-start;
 margin-left: 12px;
 margin-right: 12px;
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `),i("step-content","flex: 1;",[i("step-content-header",`
 color: var(--n-header-text-color);
 margin-top: calc(var(--n-indicator-size) / 2 - var(--n-step-header-font-size) / 2);
 line-height: var(--n-step-header-font-size);
 font-size: var(--n-step-header-font-size);
 position: relative;
 display: flex;
 font-weight: var(--n-step-header-font-weight);
 margin-left: 9px;
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `,[M("title",`
 white-space: nowrap;
 flex: 0;
 `)]),M("description",`
 color: var(--n-description-text-color);
 margin-top: 12px;
 margin-left: 9px;
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `)]),i("step-indicator",`
 background-color: var(--n-indicator-color);
 box-shadow: 0 0 0 1px var(--n-indicator-border-color);
 height: var(--n-indicator-size);
 width: var(--n-indicator-size);
 border-radius: 50%;
 display: flex;
 align-items: center;
 justify-content: center;
 transition:
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
 `,[i("step-indicator-slot",`
 position: relative;
 width: var(--n-indicator-icon-size);
 height: var(--n-indicator-icon-size);
 font-size: var(--n-indicator-icon-size);
 line-height: var(--n-indicator-icon-size);
 `,[M("index",`
 display: inline-block;
 text-align: center;
 position: absolute;
 left: 0;
 top: 0;
 white-space: nowrap;
 font-size: var(--n-indicator-index-font-size);
 width: var(--n-indicator-icon-size);
 height: var(--n-indicator-icon-size);
 line-height: var(--n-indicator-icon-size);
 color: var(--n-indicator-text-color);
 transition: color .3s var(--n-bezier);
 `,[V()]),i("icon",`
 color: var(--n-indicator-text-color);
 transition: color .3s var(--n-bezier);
 `,[V()]),i("base-icon",`
 color: var(--n-indicator-text-color);
 transition: color .3s var(--n-bezier);
 `,[V()])])]),B("vertical","flex-direction: column;",[O("show-description",[z(">",[i("step","padding-bottom: 8px;")])]),z(">",[i("step","margin-bottom: 16px;",[z("&:last-child","margin-bottom: 0;"),z(">",[i("step-indicator",[z(">",[i("step-splitor",`
 position: absolute;
 bottom: -8px;
 width: 1px;
 margin: 0 !important;
 left: calc(var(--n-indicator-size) / 2);
 height: calc(100% - var(--n-indicator-size));
 `)])]),i("step-content",[M("description","margin-top: 8px;")])])])])]),B("content-bottom",[O("vertical",[z(">",[i("step","flex-direction: column",[z(">",[i("step-line","display: flex;",[z(">",[i("step-splitor",`
 margin-top: 0;
 align-self: center;
 `)])])]),z(">",[i("step-content","margin-top: calc(var(--n-indicator-size) / 2 - var(--n-step-header-font-size) / 2);",[i("step-content-header",`
 margin-left: 0;
 `),i("step-content__description",`
 margin-left: 0;
 `)])])])])])])]);function Ne(e,n){return typeof e!="object"||e===null||Array.isArray(e)?null:(e.props||(e.props={}),e.props.internalIndex=n+1,e)}function Te(e){return e.map((n,c)=>Ne(n,c))}const Be=Object.assign(Object.assign({},ee.props),{current:Number,status:{type:String,default:"process"},size:{type:String,default:"medium"},vertical:Boolean,contentPlacement:{type:String,default:"right"},"onUpdate:current":[Function,Array],onUpdateCurrent:[Function,Array]}),te=ce("n-steps"),Me=A({name:"Steps",props:Be,slots:Object,setup(e,{slots:n}){const{mergedClsPrefixRef:c,mergedRtlRef:a}=Z(e),h=ae("Steps",a,c),f=ee("Steps","-steps",Ie,le,e,c);return de(te,{props:e,mergedThemeRef:f,mergedClsPrefixRef:c,stepsSlots:n}),{mergedClsPrefix:c,rtlEnabled:h}},render(){const{mergedClsPrefix:e}=this;return o("div",{class:[`${e}-steps`,this.rtlEnabled&&`${e}-steps--rtl`,this.vertical&&`${e}-steps--vertical`,this.contentPlacement==="bottom"&&`${e}-steps--content-bottom`]},Te(oe($e(this))))}}),je={status:String,title:String,description:String,disabled:Boolean,internalIndex:{type:Number,default:0}},U=A({name:"Step",props:je,slots:Object,setup(e){const n=ue(te,null);n||fe("step","`n-step` must be placed inside `n-steps`.");const{inlineThemeDisabled:c}=Z(),{props:a,mergedThemeRef:h,mergedClsPrefixRef:f,stepsSlots:P}=n,g=L(a,"vertical"),_=L(a,"contentPlacement"),C=j(()=>{const{status:s}=e;if(s)return s;{const{internalIndex:u}=e,{current:x}=a;if(x===void 0)return"process";if(u<x)return"finish";if(u===x)return a.status||"process";if(u>x)return"wait"}return"process"}),b=j(()=>{const{value:s}=C,{size:u}=a,{common:{cubicBezierEaseInOut:x},self:{stepHeaderFontWeight:R,[y("stepHeaderFontSize",u)]:t,[y("indicatorIndexFontSize",u)]:l,[y("indicatorSize",u)]:$,[y("indicatorIconSize",u)]:S,[y("indicatorTextColor",s)]:w,[y("indicatorBorderColor",s)]:H,[y("headerTextColor",s)]:se,[y("splitorColor",s)]:re,[y("indicatorColor",s)]:ie,[y("descriptionTextColor",s)]:ne}}=h.value;return{"--n-bezier":x,"--n-description-text-color":ne,"--n-header-text-color":se,"--n-indicator-border-color":H,"--n-indicator-color":ie,"--n-indicator-icon-size":S,"--n-indicator-index-font-size":l,"--n-indicator-size":$,"--n-indicator-text-color":w,"--n-splitor-color":re,"--n-step-header-font-size":t,"--n-step-header-font-weight":R}}),m=c?me("step",j(()=>{const{value:s}=C,{size:u}=a;return`${s[0]}${u[0]}`}),b,a):void 0,p=j(()=>{if(e.disabled)return;const{onUpdateCurrent:s,"onUpdate:current":u}=a;return s||u?()=>{s&&Y(s,e.internalIndex),u&&Y(u,e.internalIndex)}:void 0});return{stepsSlots:P,mergedClsPrefix:f,vertical:g,mergedStatus:C,handleStepClick:p,cssVars:c?void 0:b,themeClass:m?.themeClass,onRender:m?.onRender,contentPlacement:_}},render(){const{mergedClsPrefix:e,onRender:n,handleStepClick:c,disabled:a,contentPlacement:h,vertical:f}=this,P=q(this.$slots.default,m=>{const p=m||this.description;return p?o("div",{class:`${e}-step-content__description`},p):null}),g=o("div",{class:`${e}-step-splitor`}),_=o("div",{class:`${e}-step-indicator`,key:h},o("div",{class:`${e}-step-indicator-slot`},o(pe,null,{default:()=>q(this.$slots.icon,m=>{const{mergedStatus:p,stepsSlots:s}=this;return p==="finish"||p==="error"?p==="finish"?o(W,{clsPrefix:e,key:"finish"},{default:()=>D(s["finish-icon"],()=>[o(ve,null)])}):p==="error"?o(W,{clsPrefix:e,key:"error"},{default:()=>D(s["error-icon"],()=>[o(he,null)])}):null:m||o("div",{key:this.internalIndex,class:`${e}-step-indicator-slot__index`},this.internalIndex)})})),f?g:null),C=o("div",{class:`${e}-step-content`},o("div",{class:`${e}-step-content-header`},o("div",{class:`${e}-step-content-header__title`},D(this.$slots.title,()=>[this.title])),!f&&h==="right"?g:null),P);let b;return!f&&h==="bottom"?b=o(K,null,o("div",{class:`${e}-step-line`},_,g),C):b=o(K,null,_,C),n?.(),o("div",{class:[`${e}-step`,a&&`${e}-step--disabled`,!a&&c&&`${e}-step--clickable`,this.themeClass,P&&`${e}-step--show-description`,`${e}-step--${this.mergedStatus}-status`],style:this.cssVars,onClick:c},b)}}),Ee={style:{width:"20%"}},Fe={style:{"margin-top":"5px"}},Ue={style:{"margin-top":"5px"}},Ve={style:{"margin-top":"10px"}},De=A({name:"mcp",__name:"index",setup(e){const n=k(!1),{protocol:c,hostname:a,port:h}=ge(),f=`${c}://${a}:${h}`,P=k({seqSerial:!0,editConfig:{trigger:"click",mode:"cell",showStatus:!0},validConfig:{message:"tooltip"},fetchData:{api:_},toolbar:{size:"small",resizable:!0,component:_e,buttons:[{code:"reload",name:"刷新",type:"info"},{code:"delete",name:"删除"},{code:"cancel",name:"取消选择"},{code:"server",name:"MCP服务",type:"success"},{code:"sys-server",name:"系统MCP服务",type:"success"}]},events:{toolbarButtonClick:C},pager:{component:ke,attrs:{currentPage:1,pageSize:10,pageSizes:[10,20,50],total:0,layout:"total, sizes, prev, pager, next, jumper"}},columns:[{type:"selection",width:"50"},{type:"index",width:"60"},{field:"name",title:"名称",showOverflow:!0,width:"220"},{field:"paramsSchema",title:"参数",width:"300"},{field:"description",title:"描述",width:"450"}]}),g=k();function _({page:R}){const{currentPage:t,pageSize:l}=R,$=(t-1)*l;return new Promise(async S=>{const w=await E({url:`${f}/api/mcpmanager/queryPage`,method:"get",params:{limit:l,offset:$,name:b.value}});g.value.clearScroll(),S({result:w.data,page:{total:w.total}})})}async function C({code:R,$grid:t}){t.getData();const l=t.getSelectRecords(),$=t.getUpdateRecords().concat(t.getInsertRecords());switch(R){case"reload":{t.handleFetch("reload"),T.success("刷新成功");break}case"cancel":{t.clearSelection();break}case"delete":{if(l.length===0){G.alert("请至少选中一条记录");break}n.value=!0;try{l.forEach(async S=>{const w=await E({url:`${f}/api/mcpmanager/delete`,method:"post",data:{id:S.id}})}),n.value=!1}catch{n.value=!1}T.success("删除成功"),t.removeSelecteds();break}case"save":{if($.length===0){G.alert("没有修改记录");break}g.value.validate(S=>{if(S){n.value=!0;try{$.forEach(async w=>{const H=await E({url:`${f}/api/mcpmanager/save`,method:"post",data:w})}),n.value=!1}catch{n.value=!1}T.success("保存成功")}else G.alert("校验不通过")});break}case"loadServer":{try{await E({url:`${f}/api/mcpmanager/loadServer`,method:"get",params:{}}),T.success("刷新成功")}catch{T.success("刷新失败")}break}case"server":{p.value=!0;break}case"sys-server":{s.value=!0;break}}}const b=k("");function m(){g.value.handleFetch("reload")}be(()=>{g.value.clearScroll()});const p=k(!1),s=k(!1),x=k(1);return(R,t)=>(xe(),ze("div",null,[d(r(F),null,{default:v(()=>[I("div",Ee,[d(r(Re),{modelValue:b.value,"onUpdate:modelValue":t[0]||(t[0]=l=>b.value=l),placeholder:"请输入名称进行搜索",onSearch:m,clearable:""},null,8,["modelValue"])]),d(r(ye),null,{default:v(()=>[d(r(Pe),Se({resizable:"",ref_key:"basicGridRef",ref:g},P.value,{loading:n.value,"column-width":200,height:"auto",size:"small","auto-resize":!0}),null,16,["loading"])]),_:1})]),_:1}),d(r(X),{visible:p.value,"onUpdate:visible":t[2]||(t[2]=l=>p.value=l),title:"详情",width:"68vw",top:"50","max-height":"92vh"},{footer:v(()=>[d(r(Q),{type:"primary",onClick:t[1]||(t[1]=l=>p.value=!p.value)},{default:v(()=>t[6]||(t[6]=[J("关 闭")])),_:1,__:[6]})]),default:v(()=>[I("div",null,[d(r(F),{title:"MCP地址"},{default:v(()=>[I("div",Fe,N(r(c))+"://"+N(r(a))+":"+N(r(h))+"/mcp ",1)]),_:1})])]),_:1},8,["visible"]),d(r(X),{visible:s.value,"onUpdate:visible":t[5]||(t[5]=l=>s.value=l),title:"详情",width:"68vw",top:"50","max-height":"92vh"},{footer:v(()=>[d(r(Q),{type:"primary",onClick:t[4]||(t[4]=l=>s.value=!s.value)},{default:v(()=>t[7]||(t[7]=[J("关 闭")])),_:1,__:[7]})]),default:v(()=>[I("div",null,[d(r(F),{title:"系统MCP地址"},{default:v(()=>[I("div",Ue,N(r(c))+"://"+N(r(a))+":"+N(r(h))+"/sys-mcp ",1)]),_:1})]),I("div",Ve,[d(r(F),{title:"使用流程"},{default:v(()=>[d(r(Me),{current:r(x),"onUpdate:current":t[3]||(t[3]=l=>Ce(x)?x.value=l:null),vertical:""},{default:v(()=>[d(r(U),{title:"添加系统MCP地址",description:"复制系统MCP地址，添加到智能助手的MCP服务中"}),d(r(U),{title:"查询数据库配置",description:"提示词：帮我查询数据库配置，例如查询到配置：#本地mariadb#"}),d(r(U),{title:"确定业务字段并建表",description:"提示词：使用本地mariadb这个配置，通过mysql语法写一个建表语句，表名称是todo_list，字段包含id、标题、内容、创建时间、截至时间"}),d(r(U),{title:"完成CRUD接口开发",description:"提示词：使用本地mariadb这个配置，帮我完成表为todo_list的crud接口开发"})]),_:1},8,["current"])]),_:1})])]),_:1},8,["visible"])]))}}),Ye=we(De,[["__scopeId","data-v-a30c31a9"]]);export{Ye as default};
