import{y as v,_ as A}from"./js-yaml-ahJ4l1wK.js";import{e as P,h as O}from"./traffic-3Lpl9nRz.js";import{d as Y,y as L,z as M,a as U,u as H,B as i,D as J,H as j,J as g,w as e,e as n,o as y,b as a,f as l,n as V,aa as z,ab as K,j as s,T as $,m as q,p as F,h as G,_ as Q}from"./index-FX23dEwE.js";import{H as w}from"./request-dCC5BMJA.js";const d=r=>(F("data-v-7010aca2"),r=r(),G(),r),W={class:"editorBox"},X={class:"bottom-action-footer"},Z=d(()=>s("br",null,null,-1)),ee=d(()=>s("br",null,null,-1)),ae=d(()=>s("br",null,null,-1)),te=d(()=>s("br",null,null,-1)),le=d(()=>s("br",null,null,-1)),oe=d(()=>s("br",null,null,-1)),se=Y({__name:"updateByYAMLView",setup(r){const _=L(M.PROVIDE_INJECT_KEY),h=U();H();const k=i(!1),c=i(!1),b=i(!1),T=i(8);J(()=>{if(j.isNil(_.tagRule))u.value="",R();else{const t=_.tagRule;u.value=v.dump(t)}});const E=t=>{_.tagRule=v.load(u.value)},u=i(`configVersion: v3.0
force: true
enabled: true
key: shop-detail
tags:
  - name: gray
    match:
      - key: env
        value:
          exact: gray`);async function R(){var o;let t=await P((o=h.params)==null?void 0:o.ruleName);(t==null?void 0:t.code)===w.SUCCESS&&(u.value=v.dump(t==null?void 0:t.data))}const I=async()=>{var t;b.value=!0;try{const o=v.load(u.value);(await O((t=h.params)==null?void 0:t.ruleName,o)).code===w.SUCCESS&&(q.success("update success"),await new Promise(f=>setTimeout(f,2e3)),_.tagRule=null,await R())}finally{b.value=!1}};return(t,o)=>{const p=n("a-button"),f=n("a-flex"),B=n("a-space"),D=n("a-affix"),x=n("a-col"),m=n("a-descriptions-item"),N=n("a-descriptions"),C=n("a-card");return y(),g(C,null,{default:e(()=>[a(f,{style:{width:"100%"}},{default:e(()=>[a(x,{span:c.value?24-T.value:24,class:"left"},{default:e(()=>[a(f,{vertical:"",align:"end"},{default:e(()=>[a(p,{type:"text",style:{color:"#0a90d5"},onClick:o[0]||(o[0]=S=>c.value=!c.value)},{default:e(()=>[l(" 字段说明 "),c.value?(y(),g(V(K),{key:1})):(y(),g(V(z),{key:0}))]),_:1}),s("div",W,[a(A,{onChange:E,modelValue:u.value,"onUpdate:modelValue":o[1]||(o[1]=S=>u.value=S),theme:"vs-dark",height:500,language:"yaml",readonly:k.value},null,8,["modelValue","readonly"])])]),_:1}),a(D,{"offset-bottom":10},{default:e(()=>[s("div",X,[a(B,{align:"center",size:"large"},{default:e(()=>[a(p,{type:"primary",loading:b.value,onClick:I},{default:e(()=>[l(" 确认 ")]),_:1},8,["loading"]),a(p,null,{default:e(()=>[l(" 取消 ")]),_:1})]),_:1})])]),_:1})]),_:1},8,["span"]),a(x,{span:c.value?T.value:0,class:"right"},{default:e(()=>[c.value?(y(),g(C,{key:0,class:"sliderBox"},{default:e(()=>[s("div",null,[a(N,{title:"字段说明",column:1},{default:e(()=>[a(m,{label:"key"},{default:e(()=>[l(" 作用对象"),Z,l(" 可能的值：Dubbo应用名或者服务名 ")]),_:1}),a(m,{label:"scope"},{default:e(()=>[l(" 规则粒度"),ee,l(" 可能的值：application, service ")]),_:1}),a(m,{label:"force"},{default:e(()=>[l(" 容错保护"),ae,l(" 可能的值：true, false"),te,l(" 描述：如果为true，则路由筛选后若没有可用的地址则会直接报异常；如果为false，则会从可用地址中选择完成RPC调用 ")]),_:1}),a(m,{label:"runtime"},{default:e(()=>[l(" 运行时生效"),le,l(" 可能的值：true, false"),oe,l(" 描述：如果为true，则该rule下的所有路由将会实时生效；若为false，则只有在启动时才会生效 ")]),_:1})]),_:1})])]),_:1})):$("",!0)]),_:1},8,["span"])]),_:1})]),_:1})}}}),ie=Q(se,[["__scopeId","data-v-7010aca2"]]);export{ie as default};
