const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BoB2h2qv.js","./entry.rCaRqoTl.css"])))=>i.map(i=>d[i]);
import{e as I,h as T,i as $,j as M,k as P,r as h,l as A,m as E,o as N,w as l,a as t,b as a,t as i,n as e,p as j,d as c,_ as m,q as v,s as g,v as D}from"./BoB2h2qv.js";import{_ as H,a as U}from"./DkAW0SkI.js";import{_ as B}from"./D1taf96l.js";import{_ as z,a as O}from"./CmTcxINs.js";import{_ as q}from"./BuyjqtaR.js";import{_ as F}from"./DzwEWf_k.js";import{_ as G,a as J,b as K}from"./flZqRd3D.js";import{_ as x}from"./BipjDKWG.js";import{_ as Q}from"./Bj6F-phl.js";import"./C5t96Cvs.js";import"./CJyYPLmM.js";import"./jCfaR1gE.js";import"./C6Y-ieo6.js";import"./BYgYe8Kx.js";import"./iebCrZCv.js";import"./DlAUqK2U.js";const W={class:"lg:p-20 flex flex-col items-center justify-center min-h-screen bg-gray-100 dark:bg-neutral-800"},X={class:"flex-1 flex w-full z-10 max-w-7xl lg:max-h-[85vh] shadow-lg rounded-lg overflow-hidden mx-auto dark:bg-neutral-800 dark:border-neutral-700"},Y={class:"hidden lg:block w-1/2"},Z={class:"w-full lg:w-1/2 flex flex-col justify-center items-center bg-white dark:bg-neutral-900 dark:border-neutral-700 relative"},ee={class:"max-w-sm w-full p-4 sm:p-7"},te={class:"py-6"},se={class:"block text-2xl font-bold text-gray-800 dark:text-white"},oe={class:"mt-2 text-sm text-gray-600 dark:text-neutral-400"},ae={class:"mt-5 space-y-4"},re={class:"grid gap-y-6"},ne={class:"flex gap-3"},le={class:"my-8"},ie={class:"text-sm text-gray-600 dark:text-neutral-400"},ce={class:"flex items-center justify-around gap-4 w-1/2 mx-auto"},_e={class:"inline-flex"},ue={class:"inline-flex"},Ie=I({__name:"config",async setup(de){let f,p;[f,p]=T(()=>D("plain")),await f,p();const{t:o}=$(),w=M(),u=P(),r=h(""),y=h(!1),k=async()=>{try{if(r.value){let s=r.value.trim();s.match(/^https?:\/\//)||(s="https://"+s);const _=new URL(s);console.log("Valid URL:",_.href);const d=r.value.match(/^https?:\/\//)?r.value:s;localStorage.setItem("rustfs-server-host",d),r.value.match(/^https?:\/\//)||(r.value=s)}else localStorage.removeItem("rustfs-server-host");const{configManager:n}=await v(async()=>{const{configManager:s}=await import("./BoB2h2qv.js").then(_=>_.ek);return{configManager:s}},__vite__mapDeps([0,1]),import.meta.url);n.clearCache(),u.success(o("Server configuration saved successfully")),setTimeout(()=>{window.location.href=g()},200)}catch(n){console.error("URL validation error:",n),u.error(o("Invalid server address format")+": "+n.message)}},b=async()=>{localStorage.removeItem("rustfs-server-host");const{configManager:n}=await v(async()=>{const{configManager:s}=await import("./BoB2h2qv.js").then(_=>_.ek);return{configManager:s}},__vite__mapDeps([0,1]),import.meta.url);n.clearCache(),r.value="",u.success(o("Reset to default successfully")),setTimeout(()=>{window.location.href=g()},200)},S=()=>{w.push("/auth/login")};return A(()=>{const n=localStorage.getItem("rustfs-server-host");n&&(r.value=n,y.value=!0)}),(n,s)=>{const _=U,d=B,V=z,C=O,R=q;return N(),E(R,null,{default:l(()=>[t("div",W,[s[2]||(s[2]=t("img",{src:H,class:"absolute inset-0 z-0 opacity-45",alt:""},null,-1)),t("div",X,[t("div",Y,[a(_)]),t("div",Z,[t("div",ee,[s[1]||(s[1]=t("img",{src:F,class:"max-w-28",alt:""},null,-1)),t("div",te,[t("h1",se,i(e(o)("Server Configuration")),1),t("p",oe,i(e(o)("Please configure your RustFS server address")),1)]),t("div",ae,[t("form",{onSubmit:j(k,["prevent"]),autocomplete:"off"},[t("div",re,[a(e(G),null,{default:l(()=>[a(e(J),{for:"serverHost"},{default:l(()=>[c(i(e(o)("Server Address")),1)]),_:1}),a(e(x),null,{default:l(()=>[c(i(e(o)("Leave empty to use current host as default")),1)]),_:1}),a(e(K),null,{default:l(()=>[a(e(Q),{id:"serverHost",modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=L=>r.value=L),type:"text",placeholder:e(o)("Please enter server address (e.g., http://localhost:9000)")},null,8,["modelValue","placeholder"])]),_:1}),a(e(x),null,{default:l(()=>[c(i(e(o)("Example: http://localhost:9000 or https://your-domain.com")),1)]),_:1})]),_:1}),t("div",ne,[a(e(m),{type:"submit",class:"flex-1"},{default:l(()=>[c(i(e(o)("Save Configuration")),1)]),_:1}),a(e(m),{type:"button",variant:"outline",onClick:b},{default:l(()=>[c(i(e(o)("Reset")),1)]),_:1}),a(e(m),{type:"button",variant:"outline",onClick:S},{default:l(()=>[c(i(e(o)("Skip")),1)]),_:1})])])],32)]),t("div",le,[t("p",ie,[c(i(e(o)("Need help?"))+" ",1),a(d,{to:"https://docs.rustfs.com",class:"text-blue-600 hover:underline"},{default:l(()=>[c(i(e(o)("View Documentation")),1)]),_:1})])]),t("div",ce,[t("div",_e,[a(V)]),t("div",ue,[a(C)])])])])])])]),_:1})}}});export{Ie as default};
