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