import{n as e,Q as t,M as a,fM as s,u as o,b2 as r,an as n,q as i,ap as l}from"./utils-lib.js?v=1761009159";import{_ as c}from"./index105.js?v=1761009159";import{r as p,g as _,c as u,s as m,e as d,C as f,w as v,q as j,n as b,v as w,N as y,B as g,y as h,z as x}from"./base-lib.js?v=1761009159";import{a as C,d as k,g as B,u as O}from"./column.js?v=1761009159";import{b as S,g as L,d as T,f as E,h as I,s as N,i as P,u as R,a as D,l as A,j as M}from"./useController6.js?v=1761009159";import{u as V,S as q}from"./useStore4.js?v=1761009159";import{u as z}from"./index143.js?v=1761009159";import{f as G,l as F}from"./validator.js?v=1761009159";import"./index.vue_vue_type_style_index_0_scoped_cdc7f4d3_lang.js?v=1761009159";import{getNetVersion as H,getPluginInfo as J}from"./site.js?v=1761009159";const{isRefreshList:Q,siteInfo:U}=V(),{editGeneralProject:$,addGeneralProject:K,setSiteInfo:W}=q(),X=()=>{U.value=null,e({title:"添加.Net项目",area:72,component:()=>t(()=>import("./index374.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),showFooter:!0})},Y=(a,s="")=>{W(a,s),e({title:".Net项目管理["+a.name+"] -- 添加时间["+a.addtime+"]",area:[84,72],component:()=>t(()=>import("./index375.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})},Z=e=>{},ee=p([]),te=_(()=>!!U.value),ae=p({project_path:"",project_name:"",port:"",project_cmd:"",run_user:"www",project_ps:"",release_firewall:!1,dotnet_version:"",is_power_on:!1,bind_extranet:!1}),se=async(e,t,s)=>{try{await s.value.validate();const t={data:JSON.stringify({...e.value,is_power_on:e.value.is_power_on?1:0})},o=U.value?$:K,r=await o(t);return a.msg({dangerouslyUseHTMLString:!0,message:r.msg,type:r.status?"success":"error",duration:r.status?2e3:0,showClose:!r.status,customClass:"!max-w-[66rem]"}),Q.value=!0,r.status}catch(o){return!1}},oe=()=>{G({type:"all",path:ae.value.project_path,change:e=>{ae.value.project_path=e}})},re=async(e=!1)=>{try{const t=await H();if(ee.value=t.data.map(e=>({label:e,value:e})),e)return a.success("Net版本，刷新成功");ae.value.dotnet_version=t.data[0]}catch(t){}},ne=async()=>{if(await re(),te.value){const{project_config:e,ps:t}=U.value;Object.assign(ae.value,{...e,project_ps:s(t),bind_extranet:1===e.bind_extranet,is_power_on:1===e.is_power_on,port:e.port})}},ie=()=>{Object.assign(ae.value,{project_path:"",project_name:"",port:"",project_cmd:"",run_user:"www",project_ps:"",release_firewall:!1,dotnet_version:"",is_power_on:!1,bind_extranet:!1})},le=async()=>{try{const{data:e}=await J({sName:"dotnet"});await F({name:"dotnet",softData:e})}catch(e){}},ce=u({__name:"index",setup(e){o();const{getSiteList:a,setSiteInfo:s}=q(),{activeType:p,isRefreshList:_,siteInfo:u}=m(q()),{BtOperation:V}=r({options:[{type:"button",label:"添加项目",active:!0,onClick:X},{type:"button",label:".Net环境管理",onClick:le}]}),G=z({key:"type_id",name:"Net分类",options:()=>[{label:"全部分类",value:"all"}],event:I,ignore:["0"],field:"type_name"}),F=l([R(),D({classList:M}),{label:"删除项目",value:"delete",event:A}]),{BtTable:H,BtPage:J,BtRefresh:Q,BtSearch:U,BtColumn:$,BtBatch:K,BtTableCategory:W,refresh:Z,config:ee}=n({request:e=>{const{type_id:t,...s}=e;return a({...s,type_id:i(t)||"all"===t?"":t,table:"sites"})},columns:[C(),S({onClick:e=>{Y(e)}}),L({onClick:(e,t)=>{if("setting"===t)return void Y(e,"state");const a=e.run?"stop":"start";N(e,"restart"===t?t:a)}}),k(),B({table:"sites",width:200}),T({onClick:e=>{Y(e,"ssl")}}),O([{title:"设置",onClick:e=>{Y(e)}},{title:"删除",onClick:e=>{P(e)}}])],extension:[G,F],empty:()=>d("span",null,[f("您的列表为空，您可以"),d("span",{class:"bt-link",onClick:X},[f("添加一个项目")])])});return v(_,async e=>{var t;if(e){if(await Z(),null==(t=u.value)?void 0:t.name){const e=ee.data.find(e=>e.name===u.value.name);e&&s(e)}_.value=!1}}),j(()=>{b(()=>{t(()=>import("./index374.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),t(()=>import("./index375.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})}),(e,t)=>{const a=c;return w(),y(a,null,{"header-left":g(()=>[d(h(V)),x("div",{class:"flex items-center ml-1rem",onClick:t[0]||(t[0]=(...e)=>h(E)&&h(E)(...e))},t[1]||(t[1]=[x("i",{class:"svgtofont-desired text-medium"},null,-1),x("span",{class:"bt-link"},"需求反馈",-1)]))]),"header-right":g(()=>[d(h(W),{class:"!w-[200px] mr-[10px]"}),d(h(U),{class:"mr-[10px]",placeholder:"请输入项目名称或备注"}),d(h(Q),{class:"mr-[10px]"}),d(h($))]),content:g(()=>[d(h(H))]),"footer-left":g(()=>[d(h(K))]),"footer-right":g(()=>[d(h(J))]),_:1})}}}),pe=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"}));export{ie as $,se as a,ne as b,te as c,le as d,pe as e,re as g,Z as i,ae as n,oe as o,ee as v};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
