import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{a as t}from"./element-plus-vendor-BF9PNysW.js";import{A as n,D as r,E as i,I as a,O as o,P as s,Pt as c,Tt as l,Xt as u,Z as d,et as f,gt as p,ht as m,nt as h,ot as g,x as _}from"./vue-vendor-DMUmTARL.js";import{Bt as v,ri as y,zt as b}from"./icons-vendor-Buq6V-Ga.js";import{Ct as x,Tt as S}from"./index-y6crcKNt.js";import{t as C}from"./admin-monitor-Bvq7GwsD.js";import{t as w}from"./AdminSettingCard-BHC1YPYF.js";var T={key:0,id:`build-info`,class:`rounded-zf-lg border border-border-light bg-surface p-5 sm:p-6`},E={class:`grid grid-cols-1 gap-4 sm:grid-cols-2`},D={class:`rounded-zf-md border border-border-light p-4`},O={class:`space-y-2.5`},k={class:`text-secondary`},A=[`title`],j={class:`rounded-zf-md border border-border-light p-4`},M={class:`space-y-2.5`},N={class:`text-secondary`},P=[`title`],F={key:1,id:`build-info`,class:`mt-8`},I={class:`grid grid-cols-1 gap-4 sm:grid-cols-2`},L={class:`build-info-panel`},R={class:`space-y-2.5`},z={class:`shrink-0 text-xs font-medium text-secondary`},B={class:`break-all text-right font-mono text-xs text-primary`},V={class:`build-info-panel`},H={class:`space-y-2.5`},U={class:`shrink-0 text-xs font-medium text-secondary`},W={class:`break-all text-right font-mono text-xs text-primary`},G=`—`,K=a({__name:`BuildInfoSection`,props:{flat:{type:Boolean,default:!1}},setup(e,{expose:a}){let S=e=>e&&e!==`unknown`?e:G,K=l(!1),q=l(!1),J=l(null),Y=i(()=>[{label:`版本号`,value:S(x.version),icon:v},{label:`git 短提交号`,value:S(x.frontGitSha),icon:b},{label:`提交时间`,value:S(x.frontCommitTime),icon:y},{label:`构建时间`,value:S(x.frontBuildTime),icon:y}]),X=i(()=>[{label:`版本号`,value:S(J.value?.version),icon:v},{label:`git 短提交号`,value:S(J.value?.gitCommitId),icon:b},{label:`提交时间`,value:S(J.value?.gitCommitTime),icon:y},{label:`构建时间`,value:S(J.value?.buildTime),icon:y}]),Z=async()=>{K.value=!0;try{J.value=(await C())?.data??null}catch(e){console.error(`获取后端构建信息失败:`,e)}finally{q.value=!0,K.value=!1}};return a({refresh:Z}),d(Z),(i,a)=>{let l=w,d=t;return e.flat?(f(),n(`section`,T,[a[2]||=r(`div`,{class:`mb-4`},[r(`h2`,{class:`text-sm font-semibold text-primary`},`构建信息`),r(`p`,{class:`mt-0.5 text-xs text-placeholder`},`前后端版本与构建时间`)],-1),r(`div`,E,[r(`div`,D,[a[0]||=r(`div`,{class:`mb-3 flex items-center gap-2`},[r(`span`,{class:`h-2 w-2 rounded-full bg-zp`}),r(`span`,{class:`text-sm font-semibold text-primary`},`前端`),r(`span`,{class:`ml-auto rounded-zf-sm bg-zp/10 px-1.5 py-0.5 text-xs font-medium text-zp`},` Web `)],-1),r(`div`,O,[(f(!0),n(_,null,h(Y.value,e=>(f(),n(`div`,{key:e.label,class:`flex items-center gap-2 text-xs`},[(f(),o(g(e.icon),{class:`h-3.5 w-3.5 shrink-0 text-placeholder`})),r(`span`,k,u(e.label),1),r(`span`,{class:`ml-auto truncate font-mono font-semibold text-regular`,title:e.value},u(e.value),9,A)]))),128))])]),p((f(),n(`div`,j,[a[1]||=r(`div`,{class:`mb-3 flex items-center gap-2`},[r(`span`,{class:`h-2 w-2 rounded-full bg-success`}),r(`span`,{class:`text-sm font-semibold text-primary`},`后端`),r(`span`,{class:`ml-auto rounded-zf-sm bg-success-soft px-1.5 py-0.5 text-xs font-medium text-success`},` Server `)],-1),r(`div`,M,[(f(!0),n(_,null,h(X.value,e=>(f(),n(`div`,{key:e.label,class:`flex items-center gap-2 text-xs`},[(f(),o(g(e.icon),{class:`h-3.5 w-3.5 shrink-0 text-placeholder`})),r(`span`,N,u(e.label),1),r(`span`,{class:`ml-auto truncate font-mono font-semibold text-regular`,title:e.value},u(e.value),9,P)]))),128))])])),[[d,K.value&&!q.value]])])])):(f(),n(`div`,F,[s(l,{title:`构建信息`,icon:c(v),"icon-class":`bg-purple-50 text-purple-600 dark:bg-purple-500/20 dark:text-purple-300`,description:`前后端版本号、git 短提交号、提交时间与构建时间（构建期注入，未注入时显示 —）`},{default:m(()=>[r(`div`,I,[r(`div`,L,[a[3]||=r(`p`,{class:`mb-3 text-sm font-semibold text-primary`},`前端`,-1),r(`dl`,R,[(f(!0),n(_,null,h(Y.value,e=>(f(),n(`div`,{key:e.label,class:`flex items-center justify-between gap-3`},[r(`dt`,z,u(e.label),1),r(`dd`,B,u(e.value),1)]))),128))])]),p((f(),n(`div`,V,[a[4]||=r(`p`,{class:`mb-3 text-sm font-semibold text-primary`},`后端`,-1),r(`dl`,H,[(f(!0),n(_,null,h(X.value,e=>(f(),n(`div`,{key:e.label,class:`flex items-center justify-between gap-3`},[r(`dt`,U,u(e.label),1),r(`dd`,W,u(e.value),1)]))),128))])])),[[d,K.value&&!q.value]])])]),_:1},8,[`icon`])]))}}}),q=e({default:()=>J}),J=S(K,[[`__scopeId`,`data-v-396e9242`]]);export{q as n,J as t};