import{u as V,M as E,r as u,K as I,o as B,c as M,a as r,h as t,w as a,f as e,j as d,A as N,b as k,p as q,q as R}from"./index-25eb6331.js";/* empty css                  */import{E as S}from"./button-c2afb424.js";/* empty css              *//* empty css               *//* empty css                */import{_ as U}from"./zfile-basic-4e755bd5.js";import{i as z,r as C,a as F}from"./install-041791c8.js";import{M as $,E as j,a as D}from"./request-14d7fed5.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import{r as P}from"./DocumentTextIcon-ab2a0bfc.js";import{r as _}from"./QuestionMarkCircleIcon-3c5ca90a.js";import{r as T}from"./KeyIcon-1d77717a.js";import{r as A}from"./CheckBadgeIcon-5f5193f0.js";import{E as K}from"./index-d3a3425f.js";import{E as G,a as H}from"./index-0746525e.js";import"./index-3bef6acb.js";import"./index-51e1cffc.js";import"./dropdown-8894c5a8.js";import"./_initCloneObject-55db8b76.js";const v=i=>(q("data-v-3b6aa4c3"),i=i(),R(),i),J={class:"h-full min-h-screen bg-gray-100 text-gray-900 flex justify-center items-center"},L={class:"h-full lg:h-auto max-w-screen-lg bg-white shadow-xl sm:rounded-xl flex flex-1"},Q=v(()=>r("div",{class:"flex-1 bg-gray-50 text-center hidden lg:flex rounded-l-xl"},[r("div",{class:"m-12 xl:m-16 w-full bg-contain bg-center bg-no-repeat zfile-install-logo"})],-1)),W={class:"w-full lg:w-1/2 xl:w-1/2 mt-10 p-6 sm:p-12"},X={class:"mt-0 flex flex-col items-center"},Y=v(()=>r("a",{href:"https://github.com/zfile-dev/zfile",target:"_blank",class:"text-2xl mt-0 xl:text-3xl font-extrabold box animate__animated animate__fadeInDown"},[r("img",{class:"w-16 cursor-pointer",src:U})],-1)),Z={class:"w-full flex-1"},ee=k('<div class="my-12 relative" data-v-3b6aa4c3><div class="absolute inset-0 flex items-center" aria-hidden="true" data-v-3b6aa4c3><div class="w-full border-t text-gray-600" data-v-3b6aa4c3></div></div><div class="relative flex justify-center text-sm" data-v-3b6aa4c3><span class="px-2 bg-white text-sm leading-none text-gray-600 tracking-wide font-medium" data-v-3b6aa4c3> 系统初始化 </span></div></div>',1),te={__name:"index",setup(i){let x=V(),s=E({siteName:"",username:"",password:""}),h=u({siteName:[{required:!0,message:"请输入站点名称",trigger:["change","blur"]}],username:[{required:!0,message:"请输入管理员账号",trigger:["change","blur"]}],password:[{required:!0,message:"请输入管理员密码",trigger:["change","blur"]}]}),c=u(!1),g=u();const b=async()=>{await g.value.validate(n=>{n?(c.value=!0,F(s).then(()=>{$.confirm("系统初始化成功, 点击确定跳转到登录页面。","提示",{confirmButtonText:"确定",showCancelButton:!1,showCloseButton:!1,closeOnClickModal:!1,closeOnPressEscape:!1,type:"success"}).then(()=>{x.push("/login")})}).finally(()=>{c.value=!1})):j.warning("请正确输入初始化值!")})};return I(()=>{z().then(n=>{n.data&&x.push("/")})}),(n,o)=>{const f=K,p=D,m=G,w=S,y=H;return B(),M("div",J,[r("div",L,[Q,r("div",W,[r("div",X,[Y,r("div",Z,[ee,t(y,{rules:e(h),model:e(s),ref_key:"installFormRef",ref:g,class:"zfile-install-form",size:"large",onSubmit:o[3]||(o[3]=N(()=>{},["prevent"]))},{default:a(()=>[t(m,{class:"box animate__animated animate__fadeInUp",prop:"siteName"},{default:a(()=>[t(p,{tabindex:"1",modelValue:e(s).siteName,"onUpdate:modelValue":o[0]||(o[0]=l=>e(s).siteName=l),placeholder:"站点名称","prefix-icon":e(P)},{suffix:a(()=>[t(f,{placement:"left",width:"300",trigger:"hover"},{default:a(()=>[d(" 这里填写站点名称，会显示在网站标题上 ")]),reference:a(()=>[t(e(_),{class:"inline w-4 ml-1 -mt-0.5"})]),_:1})]),_:1},8,["modelValue","prefix-icon"])]),_:1}),t(m,{class:"box animate__animated animate__fadeInUp",prop:"username"},{default:a(()=>[t(p,{tabindex:"2",placeholder:"管理员账号","prefix-icon":e(C),modelValue:e(s).username,"onUpdate:modelValue":o[1]||(o[1]=l=>e(s).username=l),modelModifiers:{trim:!0}},{suffix:a(()=>[t(f,{placement:"left",width:"300",trigger:"hover"},{default:a(()=>[d(" 这里填写初始化管理员账号, 一会用来登录后台 ")]),reference:a(()=>[t(e(_),{class:"inline w-4 ml-1 -mt-0.5"})]),_:1})]),_:1},8,["prefix-icon","modelValue"])]),_:1}),t(m,{class:"box animate__animated animate__fadeInUp",prop:"password"},{default:a(()=>[t(p,{tabindex:"3",placeholder:"管理员密码",type:"password","show-password":"","prefix-icon":e(T),modelValue:e(s).password,"onUpdate:modelValue":o[2]||(o[2]=l=>e(s).password=l),modelModifiers:{trim:!0}},{suffix:a(()=>[t(f,{placement:"left",width:"300",trigger:"hover"},{default:a(()=>[d(" 这里填写初始化管理员密码, 一会用来登录后台 ")]),reference:a(()=>[t(e(_),{class:"inline w-4 ml-1 -mt-0.5"})]),_:1})]),_:1},8,["prefix-icon","modelValue"])]),_:1}),t(m,null,{default:a(()=>[t(w,{tabindex:"4","native-type":"submit",loading:e(c),class:"w-full",type:"primary",icon:e(A),onClick:b},{default:a(()=>[d(" 系统初始化 ")]),_:1},8,["loading","icon"])]),_:1})]),_:1},8,["rules","model"])])])])])])}}},ye=O(te,[["__scopeId","data-v-3b6aa4c3"]]);export{ye as default};
