import{C as _}from"./ConfigPage-lEGVz145.js";import{d as h,a as u,r as S,D as b,c as D,b as c,w as l,n as I,e as g,o as k,_ as F}from"./index-FX23dEwE.js";import{u as C,c as U,d as y,e as P}from"./instance-WW5TU1a7.js";import{H as i}from"./request-dCC5BMJA.js";const T={class:"__container_ins_config"},E=h({__name:"configuration",setup(L){const s=u();let r=S({list:[{title:"instanceDomain.operatorLog",key:"log",form:{logFlag:!1},submit:a=>new Promise(e=>{e(m(a==null?void 0:a.logFlag))}),reset(a){a.logFlag=!1}},{title:"instanceDomain.flowDisabled",form:{flowDisabledFlag:!1},key:"flowDisabled",submit:a=>new Promise(e=>{e(w(a==null?void 0:a.flowDisabledFlag))}),reset(a){a.logFlag=!1}}],current:[0]});const d=async()=>{var e,o;const a=await y((e=s.params)==null?void 0:e.pathId,(o=s.params)==null?void 0:o.appName);(a==null?void 0:a.code)===i.SUCCESS&&r.list.forEach(t=>{if(t.key==="log"){t.form.logFlag=a.data.operatorLog;return}})},m=async a=>{var o,t;const e=await C((o=s.params)==null?void 0:o.pathId,(t=s.params)==null?void 0:t.appName,a);(e==null?void 0:e.code)===i.SUCCESS&&await d()},p=async()=>{var e,o;const a=await P((e=s.params)==null?void 0:e.pathId,(o=s.params)==null?void 0:o.appName);(a==null?void 0:a.code)===i.SUCCESS&&r.list.forEach(t=>{t.key==="flowDisabled"&&(t.form.flowDisabledFlag=a.data.trafficDisable)})},w=async a=>{var o,t;const e=await U((o=s.params)==null?void 0:o.pathId,(t=s.params)==null?void 0:t.appName,a);(e==null?void 0:e.code)===i.SUCCESS&&await p()};return b(()=>{console.log(333),d(),p()}),(a,e)=>{const o=g("a-switch"),t=g("a-form-item");return k(),D("div",T,[c(_,{options:I(r)},{form_log:l(({current:n})=>[c(t,{label:a.$t("instanceDomain.operatorLog"),name:"logFlag"},{default:l(()=>[c(o,{checked:n.form.logFlag,"onUpdate:checked":f=>n.form.logFlag=f},null,8,["checked","onUpdate:checked"])]),_:2},1032,["label"])]),form_flowDisabled:l(({current:n})=>[c(t,{label:a.$t("instanceDomain.flowDisabled"),name:"flowDisabledFlag"},{default:l(()=>[c(o,{checked:n.form.flowDisabledFlag,"onUpdate:checked":f=>n.form.flowDisabledFlag=f},null,8,["checked","onUpdate:checked"])]),_:2},1032,["label"])]),_:1},8,["options"])])}}}),B=F(E,[["__scopeId","data-v-28b52f55"]]);export{B as default};
