Files
Nexus/web/app/assets/BtPanelSiteCreatePage-DLG_BM-C.js
T
2026-07-08 22:31:31 +08:00

1 line
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{t as e}from"./VSelect-3h-EI23Y.js";import{Ar as t,Er as n,L as r,Nr as i,br as a,jr as o,li as s,qr as c,ri as l,ui as u}from"./index-a0fi5f-0.js";import{n as d,t as f}from"./VCard-BwwttBcf.js";import{t as p}from"./VTextField-GUQr1tUN.js";import{t as m}from"./VForm-CAvEgM-c.js";import{m as h,o as g}from"./btpanel-BsL25ffd.js";import{n as _,t as v}from"./useBtPanelPageLoad-CV_unS2-.js";var y=i({name:`BtPanelSiteCreatePage`,__name:`BtPanelSiteCreatePage`,setup(i){let y=u(!1),b=u([`74`,`80`,`82`]),x=s({webname:``,path:``,version:`74`,port:`80`,ps:``,type_id:0,type:`PHP`,ftp:!1,sql:!1}),{serverId:S}=v(async e=>{try{let t=await h(e);Array.isArray(t)&&(b.value=t.map(e=>e?.version).filter(e=>!!e&&e!==`00`))}catch{}});async function C(){let e=S.value;if(!(!e||!x.webname||!x.path)){y.value=!0;try{await g(e,{...x}),window.$snackbar?.(`创建请求已提交`,`success`)}catch(e){window.$snackbar?.(e instanceof Error?e.message:`创建失败`,`error`)}finally{y.value=!1}}}return(i,s)=>(c(),n(_,{title:`宝塔 · 创建网站`,subtitle:`AddSiteC4`},{default:l(()=>[o(f,{"max-width":`640`,variant:`outlined`,rounded:`lg`},{default:l(()=>[o(d,null,{default:l(()=>[o(m,{onSubmit:a(C,[`prevent`])},{default:l(()=>[o(p,{modelValue:x.webname,"onUpdate:modelValue":s[0]||=e=>x.webname=e,label:`主域名`,required:``},null,8,[`modelValue`]),o(p,{modelValue:x.path,"onUpdate:modelValue":s[1]||=e=>x.path=e,label:`根目录`,hint:`如 /www/wwwroot/example.com`,"persistent-hint":``},null,8,[`modelValue`]),o(e,{modelValue:x.version,"onUpdate:modelValue":s[2]||=e=>x.version=e,items:b.value,label:`PHP 版本`},null,8,[`modelValue`,`items`]),o(p,{modelValue:x.port,"onUpdate:modelValue":s[3]||=e=>x.port=e,label:`端口`},null,8,[`modelValue`]),o(p,{modelValue:x.ps,"onUpdate:modelValue":s[4]||=e=>x.ps=e,label:`备注`},null,8,[`modelValue`]),o(r,{type:`submit`,color:`primary`,loading:y.value},{default:l(()=>[...s[5]||=[t(`创建`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1})]),_:1}))}});export{y as default};