import{d as I,o as L,c as _,a as o,t as m,e,w as t,g as p,q as h,h as u,i as g,j as r,C as M,k as l,D as T,G as j,H as A,I as D,J as E,u as H,y as R,_ as z}from"./index-CBf4dz4k.js";import{a as G}from"./index-DXp3oW3R.js";const J={class:"admin-layout"},W={class:"admin-sidebar"},F={class:"sidebar-brand"},K={class:"sidebar-logo"},O=["src","alt"],P={key:1,class:"sidebar-logo-fallback"},Q={class:"sidebar-brand-text"},U={class:"sidebar-version"},X={class:"admin-content"},Y={class:"content-header"},Z={class:"content-breadcrumb"},$={class:"breadcrumb-current"},ss={class:"content-actions"},es={class:"content-body"},ts=I({__name:"AdminLayout",setup(os){const d=H(),v=R(),f=p(""),c=p(""),y=p(""),w={dashboard:"仪表盘","cloud-configs-toggle":"网盘设置及授权","cloud-configs-cleanup":"存储清理","sys-site":"网站设置","sys-services":"外部服务 & 缓存","sys-strategy":"性能配置","sys-password":"修改管理员密码","sys-notify":"消息推送","sys-daily-report":"每日汇报","save-records":"转存日志"},b=h(()=>{const n=v.name;return n==="admin-cloud-configs"?"cloud-configs-toggle":n==="admin-cleanup"?"cloud-configs-cleanup":n==="admin-system"?v.query.section||"sys-site":n==="admin-save-records"?"save-records":"dashboard"}),k=h(()=>w[b.value]||"仪表盘");function C(n){n==="dashboard"?d.push("/admin/dashboard"):n==="cloud-configs-toggle"?d.push("/admin/cloud-configs"):n==="cloud-configs-cleanup"?d.push("/admin/cleanup"):n.startsWith("sys-")?d.push({path:"/admin/system",query:{section:n}}):n==="save-records"?d.push("/admin/save-records"):n==="logout"&&(localStorage.removeItem("admin_token"),d.push("/admin/login"))}function S(){d.push("/")}return L(async()=>{try{const n=await G();f.value=n.site_name||"",c.value=n.site_logo||""}catch{}try{const s=await(await fetch("/health")).json();y.value=s.version}catch{}}),(n,s)=>{const i=u("el-icon"),a=u("el-menu-item"),x=u("el-sub-menu"),B=u("el-menu"),N=u("el-button"),V=u("router-view");return g(),_("div",J,[o("aside",W,[o("div",F,[o("div",K,[c.value?(g(),_("img",{key:0,src:c.value,alt:f.value||"CloudSearch",class:"sidebar-logo-img",onError:s[0]||(s[0]=q=>{q.target.style.display="none",c.value=""})},null,40,O)):(g(),_("span",P,"☁️"))]),o("div",Q,[o("h2",null,m(f.value||"CloudSearch"),1),s[1]||(s[1]=o("p",null,"管理控制台",-1))])]),e(B,{"default-active":b.value,class:"sidebar-menu",onSelect:C},{default:t(()=>[e(a,{index:"dashboard"},{default:t(()=>[e(i,null,{default:t(()=>[e(r(M))]),_:1}),s[2]||(s[2]=o("span",null,"仪表盘",-1))]),_:1}),e(x,{index:"cloud-configs"},{title:t(()=>[e(i,null,{default:t(()=>[e(r(T))]),_:1}),s[3]||(s[3]=o("span",null,"网盘管理",-1))]),default:t(()=>[e(a,{index:"cloud-configs-toggle"},{default:t(()=>[...s[4]||(s[4]=[l("📋 设置及授权",-1)])]),_:1}),e(a,{index:"cloud-configs-cleanup"},{default:t(()=>[...s[5]||(s[5]=[l("🧹 存储清理",-1)])]),_:1})]),_:1}),e(x,{index:"system"},{title:t(()=>[e(i,null,{default:t(()=>[e(r(j))]),_:1}),s[6]||(s[6]=o("span",null,"系统设置",-1))]),default:t(()=>[e(a,{index:"sys-site"},{default:t(()=>[...s[7]||(s[7]=[l("🌐 网站设置",-1)])]),_:1}),e(a,{index:"sys-services"},{default:t(()=>[...s[8]||(s[8]=[l("🔗 外部服务 & 缓存",-1)])]),_:1}),e(a,{index:"sys-strategy"},{default:t(()=>[...s[9]||(s[9]=[l("⚡ 性能配置",-1)])]),_:1}),e(a,{index:"sys-password"},{default:t(()=>[...s[10]||(s[10]=[l("🔑 修改密码",-1)])]),_:1}),e(a,{index:"sys-notify"},{default:t(()=>[...s[11]||(s[11]=[l("📬 消息推送",-1)])]),_:1}),e(a,{index:"sys-daily-report"},{default:t(()=>[...s[12]||(s[12]=[l("📊 每日汇报",-1)])]),_:1})]),_:1}),e(a,{index:"save-records"},{default:t(()=>[e(i,null,{default:t(()=>[e(r(A))]),_:1}),s[13]||(s[13]=o("span",null,"转存日志",-1))]),_:1}),s[15]||(s[15]=o("div",{class:"sidebar-spacer"},null,-1)),o("div",U,"v"+m(y.value),1),e(a,{index:"logout"},{default:t(()=>[e(i,null,{default:t(()=>[e(r(D))]),_:1}),s[14]||(s[14]=o("span",null,"退出登录",-1))]),_:1})]),_:1},8,["default-active"])]),o("div",X,[o("header",Y,[o("div",Z,[o("span",$,m(k.value),1)]),o("div",ss,[e(N,{text:"",size:"small",onClick:S},{default:t(()=>[e(i,null,{default:t(()=>[e(r(E))]),_:1}),s[16]||(s[16]=l(" 返回前台 ",-1))]),_:1})])]),o("main",es,[e(V)])])])}}}),ls=z(ts,[["__scopeId","data-v-66b4feae"]]);export{ls as default};
