import{_ as R}from"./index.476a61b6.js";import{l as N,p as $}from"./index.382339dd.js";import{x as m,a3 as T,y as A,r as _,a4 as D,o as r,a as c,Q as S,e as a,b as t,d as s,C as b,t as g,B as f,z as U,g as j}from"./vendor.475775fc.js";/* empty css                                              */import"./index.e07f9e9c.js";const z={class:"padding-sm"},F={key:0,class:"text-green"},P={key:1,class:"text-red"},W={key:0,class:"text-green"},E={key:1,class:"text-red"},L={__name:"networkDiagnostics",setup(Q){const{proxy:u}=j(),n=m({}),i=m(!1),d=m(""),v=m({}),k=T({ipAddress:{oneInp:"",twoInp:"",thrInp:"",fouInp:"",type:"ip"}}),{ipAddress:o}=A(k),w=function(){if(o.value.oneInp!=""&&o.value.twoInp!=""&&o.value.thrInp!=""&&o.value.fouInp!=""){i.value=!0;let e=V(o.value);N(e).then(l=>{l.code==200&&(n.value=l.data[1],n.value.desc.replace(/\*/g,"<br/>"),i.value=!1,u.$modal.msgSuccess("\u64CD\u4F5C\u6210\u529F\uFF01"))})}else u.$modal.alert("\u8BF7\u5148\u586B\u5199\u6B63\u786E\u7684ip\u5730\u5740",{confirmButtonText:"\u786E\u5B9A",callback:e=>{}})},V=function(e){return e.oneInp+"."+e.twoInp+"."+e.thrInp+"."+e.fouInp},C=function(){d.value.oneInp!=""?(i.value=!0,$(d.value).then(e=>{e.code==200&&(v.value=e.data[1],i.value=!1,u.$modal.msgSuccess("\u64CD\u4F5C\u6210\u529F\uFF01"))})):u.$modal.alert("\u8BF7\u5148\u586B\u5199\u6B63\u786E\u7684\u89C6\u9891rtsp\u5730\u5740",{confirmButtonText:"\u786E\u5B9A",callback:e=>{}})};return(e,l)=>{const y=_("el-button"),p=_("el-form-item"),h=_("el-input"),I=_("el-form"),B=D("loading");return r(),c("div",z,[S((r(),c("div",null,[t(I,{"label-position":"right","label-width":"120px"},{default:s(()=>[t(p,{label:"IP\u5730\u5740(I)\uFF1A"},{default:s(()=>[t(a(R),{data:a(o)},null,8,["data"]),t(y,{class:"margin-left",type:"primary",onClick:w},{default:s(()=>[b("\u786E\u5B9A")]),_:1})]),_:1}),t(p,{label:"\u8BCA\u65AD\u7ED3\u679C\uFF1A"},{default:s(()=>[g("div",null,[a(n).success=="true"?(r(),c("span",F,"\u6210\u529F")):f("",!0),a(n).success=="false"?(r(),c("span",P,"\u5931\u8D25")):f("",!0)]),g("div",null,[t(h,{type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",modelValue:a(n).desc,"onUpdate:modelValue":l[0]||(l[0]=x=>a(n).desc=x),style:{width:"400px"},autosize:""},null,8,["modelValue"])])]),_:1})]),_:1}),t(I,{"label-position":"right","label-width":"120px",style:{"margin-top":"50px"}},{default:s(()=>[t(p,{label:"Rtsp\u5730\u5740\uFF1A"},{default:s(()=>[t(h,{type:"text",placeholder:"\u8BF7\u8F93\u5165\u89C6\u9891rtsp",modelValue:a(d),"onUpdate:modelValue":l[1]||(l[1]=x=>U(d)?d.value=x:null),style:{width:"400px"}},null,8,["modelValue"]),t(y,{class:"margin-left",type:"primary",onClick:C},{default:s(()=>[b("\u786E\u5B9A")]),_:1})]),_:1}),t(p,{label:"\u8BCA\u65AD\u7ED3\u679C\uFF1A"},{default:s(()=>[g("div",null,[a(v).success=="true"?(r(),c("span",W,"\u8FDE\u63A5\u6210\u529F")):f("",!0),a(v).success=="false"?(r(),c("span",E,"\u8FDE\u63A5\u5931\u8D25")):f("",!0)])]),_:1})]),_:1})])),[[B,a(i)]])])}}};export{L as default};
