import{_ as e}from"./public.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{_ as l}from"./index99.js?v=1763625242172";import{gS as r,gT as s}from"./page_layout.js?v=1763625242172";import{k as t,P as i,r as o,e as d,R as u,S as p,X as f,a3 as c,U as m,V as n,a4 as _}from"./vue.js?v=1763625242172";import{dP as v,dV as y,au as w}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const b={class:"p-20px"},h={class:"w-200px"},P={class:"w-200px"},S={class:"w-200px"},I={class:"w-200px"},F=t({__name:"form",props:{row:{},isEdit:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{expose:F,emit:x}){const j=t,U=x,{t:$}=i(),{isEdit:g,row:T}=j,k=o(null),E=d({address:"",types:"accept",chain:"INPUT",brief:""}),C={address:{trigger:["blur","input"],validator:()=>!(""===E.address.trim()||!E.address)||new Error($("Security.Firewall.IP.form_10"))}},N=[{label:$("Security.Firewall.IP.form_11"),value:"accept"},{label:$("Security.Firewall.IP.form_12"),value:"drop"}],R=[{label:$("Security.Firewall.IP.form_13"),value:"INPUT"},{label:$("Security.Firewall.IP.form_14"),value:"OUTPUT"}];return g&&T&&(E.address=T.Address,E.types=T.Strategy,E.chain=T.Chain,E.brief=T.brief),F({onConfirm:async()=>{var e;await(null==(e=k.value)?void 0:e.validate());const a={address:E.address,types:E.types,strategy:E.types,chain:E.chain,brief:E.brief,family:"ipv4"};g&&T?await r({new_data:{...a,id:T.id},old_data:T}):await s(a),U("refresh")}}),(r,s)=>{const t=l,i=v,o=y,d=w,F=a,x=e;return u(),p("div",b,[f(F,{ref_key:"formRef",ref:k,model:n(E),rules:C},{default:c((()=>[f(i,{label:r.$t("Security.Firewall.IP.form_16"),path:"address"},{default:c((()=>[m("div",h,[f(t,{value:n(E).address,"onUpdate:value":s[0]||(s[0]=e=>n(E).address=e),rows:3,disabled:n(g),placeholder:r.$t("Security.Firewall.IP.form_1")},null,8,["value","disabled","placeholder"])])])),_:1},8,["label"]),f(i,{label:r.$t("Security.Firewall.IP.form_2"),path:"types"},{default:c((()=>[m("div",P,[f(o,{value:n(E).types,"onUpdate:value":s[1]||(s[1]=e=>n(E).types=e),options:N},null,8,["value"])])])),_:1},8,["label"]),f(i,{label:r.$t("Security.Firewall.IP.form_3"),path:"chain"},{default:c((()=>[m("div",S,[f(o,{value:n(E).chain,"onUpdate:value":s[2]||(s[2]=e=>n(E).chain=e),options:R},null,8,["value"])])])),_:1},8,["label"]),f(i,{label:r.$t("Security.Firewall.IP.form_4"),path:"brief","show-feedback":!1},{default:c((()=>[m("div",I,[f(d,{value:n(E).brief,"onUpdate:value":s[3]||(s[3]=e=>n(E).brief=e),placeholder:r.$t("Security.Firewall.IP.form_5")},null,8,["value","placeholder"])])])),_:1},8,["label"])])),_:1},8,["model"]),f(x,{class:"mt-20px ml-40px"},{default:c((()=>[m("li",null,_(r.$t("Security.Firewall.IP.form_15")),1),m("li",null,_(r.$t("Security.Firewall.IP.form_8")),1),m("li",null,_(r.$t("Security.Firewall.IP.form_9")),1)])),_:1})])}}});export{F as default};
