import{u as $,c as A,y as n,M as B,o as r,b as d,e as o,h as g,d as t,f as l,t as a,g as x,U as m,i as f,l as D,T as _,W as E,Z as p}from"./index-9538feb4.js";import{_ as R}from"./LayoutHeader-d0c4e6dc.js";import{g as T}from"./statusStyles-743ec7f5.js";const j={class:"flex flex-col h-full"},F={class:"flex items-center gap-3"},L={class:"text-xl font-semibold text-ink-gray-9"},M={class:"flex items-center gap-2"},U={class:"flex-1 overflow-auto p-5"},q={key:0,class:"flex items-center justify-center h-64"},z={key:1,class:"grid gap-6 lg:grid-cols-3"},O={class:"lg:col-span-2 space-y-6"},P={class:"rounded-lg border p-5"},W={class:"grid gap-4 sm:grid-cols-2"},Z={class:"text-sm font-medium text-ink-gray-9 font-mono"},G={class:"text-sm font-medium text-ink-gray-9"},H={class:"text-sm font-medium text-ink-gray-9 font-mono"},J={class:"text-sm font-medium text-ink-gray-9"},K={class:"text-sm font-medium text-ink-gray-9"},Q={key:0,class:"rounded-lg border border-red-200 bg-red-50 p-5"},X={class:"text-sm text-red-600"},Y={class:"rounded-lg border p-5"},tt={class:"flex items-center gap-4"},et={class:"text-sm text-ink-gray-5"},st={class:"space-y-6"},at={key:0,class:"rounded-lg border border-blue-200 bg-blue-50 p-5"},nt={class:"flex items-center gap-3"},dt={__name:"SiteDetail",props:{siteId:{type:String,required:!0}},setup(v){const y=v,b=$(),s=f({}),c=f(!0),h=A({url:"frappe.client.get",onSuccess(u){s.value=u,c.value=!1},onError(u){console.error("Failed to fetch container:",u),c.value=!1}});function k(){h.fetch({doctype:"Cloud Container",name:y.siteId})}const i=n(()=>T(s.value.status)),C=n(()=>i.value.badgeVariant),w=n(()=>i.value.icon),S=n(()=>i.value.bgClass),I=n(()=>i.value.iconClass),N=n(()=>i.value.textClass),V=n(()=>s.value.creation?new Date(s.value.creation).toLocaleString():"N/A");return B(()=>{k()}),(u,e)=>(r(),d("div",j,[o(R,null,{left:g(()=>[t("div",F,[o(l(D),{variant:"ghost",onClick:e[0]||(e[0]=ot=>l(b).back())},{default:g(()=>[o(l(_),{name:"arrow-left",class:"h-4 w-4"})]),_:1}),t("div",null,[t("h1",L,a(s.value.container_name||v.siteId),1),t("div",M,[o(l(E),{variant:C.value,label:s.value.status||"Loading"},null,8,["variant","label"])])])])]),_:1}),t("div",U,[c.value?(r(),d("div",q,[o(l(p),{class:"h-8 w-8"})])):(r(),d("div",z,[t("div",O,[t("div",P,[e[6]||(e[6]=t("h2",{class:"text-lg font-semibold text-ink-gray-9 mb-4"},"Overview",-1)),t("div",W,[t("div",null,[e[1]||(e[1]=t("p",{class:"text-sm text-ink-gray-5"},"Container Name",-1)),t("p",Z,a(s.value.container_name),1)]),t("div",null,[e[2]||(e[2]=t("p",{class:"text-sm text-ink-gray-5"},"Image",-1)),t("p",G,a(s.value.image),1)]),t("div",null,[e[3]||(e[3]=t("p",{class:"text-sm text-ink-gray-5"},"IP Address",-1)),t("p",H,a(s.value.ip_address||"Not assigned"),1)]),t("div",null,[e[4]||(e[4]=t("p",{class:"text-sm text-ink-gray-5"},"Architecture",-1)),t("p",J,a(s.value.architecture||"N/A"),1)]),t("div",null,[e[5]||(e[5]=t("p",{class:"text-sm text-ink-gray-5"},"Created",-1)),t("p",K,a(V.value),1)])])]),s.value.error_message?(r(),d("div",Q,[e[7]||(e[7]=t("h2",{class:"text-lg font-semibold text-red-700 mb-2"},"Error",-1)),t("p",X,a(s.value.error_message),1)])):x("",!0),t("div",Y,[e[8]||(e[8]=t("h2",{class:"text-lg font-semibold text-ink-gray-9 mb-4"},"Container Status",-1)),t("div",tt,[t("div",{class:m(["flex h-16 w-16 items-center justify-center rounded-full",S.value])},[o(l(_),{name:w.value,class:m(["h-8 w-8",I.value])},null,8,["name","class"])],2),t("div",null,[t("p",{class:m(["text-2xl font-semibold",N.value])},a(s.value.status),3),t("p",et,"Incus Status: "+a(s.value.incus_status||"Unknown"),1)])])])]),t("div",st,[s.value.status==="Creating"?(r(),d("div",at,[t("div",nt,[o(l(p),{class:"h-5 w-5 text-blue-600"}),e[9]||(e[9]=t("div",null,[t("p",{class:"font-medium text-blue-700"},"Creating Container"),t("p",{class:"text-sm text-blue-600"},"This may take a moment...")],-1))])])):x("",!0)])]))])]))}};export{dt as default};
//# sourceMappingURL=SiteDetail-29b29f5b.js.map
