import{u as P}from"./useAdminFeatures-De7MCLZf.js";import{_ as S}from"./Icon.vue_vue_type_script_setup_true_lang-C11sQmoM.js";import{d as w,N as B,o as u,c as a,a as t,k as i,F as k,t as o,f as l,u as r,b as g,l as y,i as d}from"./index-CXwCk-SR.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";const R={key:0,class:"warn",role:"alert"},I={class:"icon"},W={class:"body"},D={key:0,class:"err"},M={class:"hints"},T={class:"env"},U={class:"hint"},h=w({__name:"AdminFeatureWarning",props:{module:{},featureLabel:{}},setup(s){const A=s,{result:C,adminReachable:m,adminError:f,adminUrl:p,moduleByName:E,refetch:F}=P(),v=E(A.module),N=d(()=>{var n;return((n=v.value)==null?void 0:n.enabled)??!1}),V=d(()=>C.value?m.value?!N.value:!0:!1),x=d(()=>m.value?"module":"host"),L=d(()=>{var n;return(n=v.value)==null?void 0:n.envVar});return(n,e)=>{const b=B("RouterLink");return V.value?(u(),a("div",R,[t("span",I,[i(S,{name:"alert",size:14})]),t("div",W,[x.value==="host"?(u(),a(k,{key:0},[e[9]||(e[9]=t("h3",null,"Admin host unreachable",-1)),t("p",null,[t("strong",null,o(s.featureLabel),1),e[1]||(e[1]=l(" talks to OAP on the admin port (",-1)),t("code",null,o(r(p)??":17128"),1),e[2]||(e[2]=l("). The page below is rendered read-only and will fail any save / debug action. ",-1))]),r(f)?(u(),a("p",D,[e[3]||(e[3]=l(" Last error: ",-1)),t("code",null,o(r(f)),1)])):g("",!0),t("ul",M,[e[7]||(e[7]=t("li",null,[l(" Confirm OAP's "),t("code",null,"admin-server"),l(" module is on ("),t("code",null,"SW_ADMIN_SERVER=default"),l(") and the OAP pod has been restarted. ")],-1)),e[8]||(e[8]=t("li",null,[l(" Confirm the admin port (default "),t("code",null,"17128"),l(") is exposed on the network / k8s Service / ingress and reachable from this BFF. ")],-1)),t("li",null,[e[5]||(e[5]=l(" See ",-1)),i(b,{to:"/operate/cluster"},{default:y(()=>[...e[4]||(e[4]=[l("Cluster status",-1)])]),_:1}),e[6]||(e[6]=l(" for the full module preflight. ",-1))])])],64)):(u(),a(k,{key:1},[t("h3",null,[e[10]||(e[10]=l("Module ",-1)),t("code",null,o(s.module),1),e[11]||(e[11]=l(" is off on OAP",-1))]),t("p",null,[t("strong",null,o(s.featureLabel),1),e[12]||(e[12]=l(" requires the ",-1)),t("code",null,o(s.module),1),e[13]||(e[13]=l(" module. Enable it on OAP and restart: ",-1))]),t("pre",T,o(L.value)+"=default",1),t("p",U,[e[15]||(e[15]=l(" Until then this page renders read-only — every API call to ",-1)),t("code",null,o(r(p)),1),e[16]||(e[16]=l(" for this feature returns 404. See ",-1)),i(b,{to:"/operate/cluster"},{default:y(()=>[...e[14]||(e[14]=[l("Cluster status",-1)])]),_:1}),e[17]||(e[17]=l(" for the full module preflight. ",-1))])],64))]),t("button",{type:"button",class:"recheck",onClick:e[0]||(e[0]=()=>r(F)())},"re-check")])):g("",!0)}}}),G=O(h,[["__scopeId","data-v-83c4d036"]]);export{G as A};
