UNPKG

mao-service-discovery

Version:

Discover your services by using gRPC stream, ICMP or etcd. Come with WebGUI, Restful API and Config Persistence ability.

1 lines 22.4 kB
(function(){"use strict";var e={959:function(e,t,o){var a=o(9242),n=o(3765),l=(o(4415),o(4161)),r=o(3396);const i={id:"app"};function m(e,t,o,a,n,l){const m=(0,r.up)("el-header"),s=(0,r.up)("Menu"),u=(0,r.up)("el-icon"),d=(0,r.up)("el-menu-item"),p=(0,r.up)("el-menu"),c=(0,r.up)("el-aside"),f=(0,r.up)("router-view"),h=(0,r.up)("el-main"),v=(0,r.up)("el-container");return(0,r.wg)(),(0,r.iD)("div",i,[(0,r.Wm)(v,{class:"class-container"},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{style:{"font-size":"xx-large"}},{default:(0,r.w5)((()=>[(0,r.Uk)("Bigmao Radio Station")])),_:1}),(0,r.Wm)(v,null,{default:(0,r.w5)((()=>[(0,r.Wm)(c,{style:{width:"210px"}},{default:(0,r.w5)((()=>[(0,r.Wm)(p,{"default-active":"/deviceStatus",style:{height:"100%"},router:""},{default:(0,r.w5)((()=>[(0,r.Wm)(d,{index:"/deviceStatus"},{default:(0,r.w5)((()=>[(0,r.Wm)(u,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s)])),_:1}),(0,r.Uk)(" 设备状态 ")])),_:1}),(0,r.Wm)(d,{index:"/config"},{default:(0,r.w5)((()=>[(0,r.Wm)(u,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s)])),_:1}),(0,r.Uk)(" 服务配置 ")])),_:1}),(0,r.Wm)(d,{index:"/topo"},{default:(0,r.w5)((()=>[(0,r.Wm)(u,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s)])),_:1}),(0,r.Uk)(" 数字地图 ")])),_:1}),(0,r.Wm)(d,{index:"/apiListOldApi"},{default:(0,r.w5)((()=>[(0,r.Wm)(u,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s)])),_:1}),(0,r.Uk)(" API列表、老版WebUI ")])),_:1})])),_:1})])),_:1}),(0,r.Wm)(h,null,{default:(0,r.w5)((()=>[(0,r.Wm)(f,{name:"maoMain"})])),_:1})])),_:1})])),_:1})])}var s={name:"App",components:{},methods:{}},u=o(89);const d=(0,u.Z)(s,[["render",m]]);var p=d,c=o(2748),f=o(2483);function h(e,t,o,a,n,l){const i=(0,r.up)("el-menu-item"),m=(0,r.up)("el-menu"),s=(0,r.up)("router-view");return(0,r.wg)(),(0,r.iD)("div",null,[(0,r.Wm)(m,{"default-active":"/config/email",mode:"horizontal",router:""},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{index:"/config/email"},{default:(0,r.w5)((()=>[(0,r.Uk)("邮件通知配置")])),_:1}),(0,r.Wm)(i,{index:"/config/icmp"},{default:(0,r.w5)((()=>[(0,r.Uk)("ICMP检测配置")])),_:1}),(0,r.Wm)(i,{index:"/config/grpc"},{default:(0,r.w5)((()=>[(0,r.Uk)("gRPC服务管理")])),_:1}),(0,r.Wm)(i,{index:"/config/topo"},{default:(0,r.w5)((()=>[(0,r.Uk)("拓扑接口配置")])),_:1}),(0,r.Wm)(i,{index:"/config/mysql"},{default:(0,r.w5)((()=>[(0,r.Uk)("MySQL接口配置")])),_:1}),(0,r.Wm)(i,{index:"/config/allText"},{default:(0,r.w5)((()=>[(0,r.Uk)("配置文件导出")])),_:1})])),_:1}),(0,r.Wm)(s,{name:"maoConfig"})])}var v={name:"ConfigPages",data(){return{}},mounted(){},methods:{}};const w=(0,u.Z)(v,[["render",h]]);var b=w;const g=(0,r._)("div",{style:{margin:"20px"}},null,-1);function _(e,t,o,a,n,l){const i=(0,r.up)("el-input"),m=(0,r.up)("el-form-item"),s=(0,r.up)("el-button"),u=(0,r.up)("el-form");return(0,r.wg)(),(0,r.iD)(r.HY,null,[g,(0,r.Wm)(u,{model:n.form,"label-width":"120px","label-position":"top",style:{"max-width":"600px"}},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{label:"Username"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.username,"onUpdate:modelValue":t[0]||(t[0]=e=>n.form.username=e)},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"Password"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.password,"onUpdate:modelValue":t[1]||(t[1]=e=>n.form.password=e),placeholder:"*** ***"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"SMTP Server address and port"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.smtpServerAddrPort,"onUpdate:modelValue":t[2]||(t[2]=e=>n.form.smtpServerAddrPort=e),placeholder:"e.g. smtp.mao.com:25"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"Sender Email"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.sender,"onUpdate:modelValue":t[3]||(t[3]=e=>n.form.sender=e)},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"Receiver Emails"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.receiver,"onUpdate:modelValue":t[4]||(t[4]=e=>n.form.receiver=e),placeholder:"one line, one receiver",type:"textarea",rows:"10"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s,{type:"primary",onClick:l.onSubmit},{default:(0,r.w5)((()=>[(0,r.Uk)("Create")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])],64)}var W=o(4870),y={name:"ConfigEmail",data(){return{form:(0,W.qj)({username:"",password:"",smtpServerAddrPort:"",sender:"",receiver:""})}},mounted(){this.onLoad()},methods:{onLoad(){var e=this;this.$http.get("/api/getEmailInfo").then((function(t){var o=t.data;e.form.username=o["username"],e.form.smtpServerAddrPort=o["smtpServerAddrPort"],e.form.sender=o["sender"],e.form.receiver=o["receiver"].join("\n"),e.form.password=""})).catch((function(e){console.log("errMao: "+e)}))},onSubmit(){var e=this;this.$http.post("/api/addEmailInfo",this.form,{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}).then((function(){e.onLoad()})).catch((function(e){console.log("errMao: "+e)}))}}};const C=(0,u.Z)(y,[["render",_]]);var T=C;const x=(0,r._)("div",{style:{margin:"20px"}},null,-1);function D(e,t,o,a,n,l){const i=(0,r.up)("el-input"),m=(0,r.up)("el-form-item"),s=(0,r.up)("el-button"),u=(0,r.up)("el-form");return(0,r.wg)(),(0,r.iD)(r.HY,null,[x,(0,r.Wm)(u,{model:n.form,"label-width":"120px","label-position":"top",style:{"max-width":"600px"}},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{label:"MySQL Server address"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.mysqlServerAddr,"onUpdate:modelValue":t[0]||(t[0]=e=>n.form.mysqlServerAddr=e),placeholder:"e.g. mysql.mao.com"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"MySQL Server port"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.mysqlServerPort,"onUpdate:modelValue":t[1]||(t[1]=e=>n.form.mysqlServerPort=e),placeholder:"e.g. 3306"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"MySQL database name"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.databaseName,"onUpdate:modelValue":t[2]||(t[2]=e=>n.form.databaseName=e),placeholder:"e.g. MaoDB"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"Username"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.username,"onUpdate:modelValue":t[3]||(t[3]=e=>n.form.username=e)},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,{label:"Password"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.password,"onUpdate:modelValue":t[4]||(t[4]=e=>n.form.password=e),placeholder:"*** ***"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s,{type:"primary",onClick:l.onSubmit},{default:(0,r.w5)((()=>[(0,r.Uk)("Submit")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])],64)}var S={name:"ConfigMysql",data(){return{form:(0,W.qj)({mysqlServerAddr:"",mysqlServerPort:"",databaseName:"",username:"",password:""})}},mounted(){this.onLoad()},methods:{onLoad(){var e=this;this.$http.get("/api/getMysqlInfo").then((function(t){var o=t.data;e.form.mysqlServerAddr=o["mysqlServerAddr"],e.form.mysqlServerPort=0!==o["mysqlServerPort"]?o["mysqlServerPort"]:"",e.form.databaseName=o["databaseName"],e.form.username=o["username"],e.form.password=""})).catch((function(e){console.log("errMao: "+e)}))},onSubmit(){var e=this;this.$http.post("/api/addMysqlInfo",this.form,{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}).then((function(){e.onLoad()})).catch((function(e){console.log("errMao: "+e)}))}}};const I=(0,u.Z)(S,[["render",D]]);var R=I;const O=(0,r._)("div",{style:{margin:"20px"}},null,-1);function L(e,t,o,a,n,l){const i=(0,r.up)("el-input"),m=(0,r.up)("el-form-item"),s=(0,r.up)("el-button"),u=(0,r.up)("el-form"),d=(0,r.up)("el-table-column"),p=(0,r.up)("el-table");return(0,r.wg)(),(0,r.iD)(r.HY,null,[O,(0,r.Wm)(u,{model:n.form,"label-width":"120px","label-position":"top",style:{"max-width":"600px"}},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{label:"New Services"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.ipv4v6,"onUpdate:modelValue":t[0]||(t[0]=e=>n.form.ipv4v6=e),placeholder:"one line, one receiver",type:"textarea",rows:"3"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s,{type:"primary",onClick:l.onSubmit},{default:(0,r.w5)((()=>[(0,r.Uk)("Add")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"]),(0,r.Wm)(p,{data:n.maoIcmpTableData,ref:"maoTable","cell-class-name":l.tableCellClassName,"empty-text":"暂无数据","max-height":"610px"},{default:(0,r.w5)((()=>[(0,r.Wm)(d,{label:"Control"},{default:(0,r.w5)((e=>[(0,r.Wm)(s,{size:"small",type:"danger",onClick:t=>l.handleDelete(e.$index,e.row)},{default:(0,r.w5)((()=>[(0,r.Uk)("Delete")])),_:2},1032,["onClick"])])),_:1}),(0,r.Wm)(d,{label:"Device IP",prop:"deviceIp"}),(0,r.Wm)(d,{label:"Alive",prop:"alive"}),(0,r.Wm)(d,{label:"Detect Count",prop:"Detect_Count"}),(0,r.Wm)(d,{label:"Report Count",prop:"Report_Count"}),(0,r.Wm)(d,{label:"RTT Duration",prop:"RTT_Duration"}),(0,r.Wm)(d,{label:"Last Seen",prop:"Last_Seen"}),(0,r.Wm)(d,{label:"Timestamp",prop:"RttOutbound_or_Remote_Timestamp"})])),_:1},8,["data","cell-class-name"])],64)}o(7658);var P={name:"ConfigIcmp",data(){return{maoIcmpTableData:[],refreshTimer:"",form:{ipv4v6:""}}},mounted(){this.onLoad(),this.refreshTimer=setInterval(this.onLoad,1e3)},beforeUnmount(){clearInterval(this.refreshTimer)},methods:{tableCellClassName({row:e,column:t,rowIndex:o,columnIndex:a}){e.index=o,t.index=a},handleDelete(e,t){var o=this;this.$http.post("/api/delServiceIp",{ipv4v6:t.deviceIp},{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}).then((function(){o.onLoad()})).catch((function(e){console.log("errMao: "+e)}))},onLoad(){var e=this;this.$http.get("/api/showServiceIP").then((function(t){e.maoIcmpTableData=[];for(var o=t.data,a=0;a<o.length;a++)e.maoIcmpTableData.push({deviceIp:null!=o[a]["Address"]?o[a]["Address"]:o[a]["Hostname"],alive:o[a]["Alive"],Detect_Count:null!=o[a]["DetectCount"]?o[a]["DetectCount"]:"/",Report_Count:null!=o[a]["ReportCount"]?o[a]["ReportCount"]:o[a]["ReportTimes"],RTT_Duration:null!=o[a]["RttDuration"]?(o[a]["RttDuration"]/1e3/1e3).toFixed(3)+"ms":"/",Last_Seen:null!=o[a]["LastSeen"]?o[a]["LastSeen"]:o[a]["LocalLastSeen"],RttOutbound_or_Remote_Timestamp:null!=o[a]["RttOutboundTimestamp"]?o[a]["RttOutboundTimestamp"]:o[a]["ServerDateTime"]})})).catch((function(e){console.log("errMao: "+e)}))},onSubmit(){var e=this;this.$http.post("/api/addServiceIp",this.form,{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}).then((function(){e.onLoad()})).catch((function(e){console.log("errMao: "+e)}))}}};const V=(0,u.Z)(P,[["render",L]]);var U=V;const k=(0,r._)("div",{style:{margin:"20px"}},null,-1);function A(e,t,o,a,n,l){const i=(0,r.up)("el-input"),m=(0,r.up)("el-form-item"),s=(0,r.up)("el-button"),u=(0,r.up)("el-form"),d=(0,r.up)("el-table-column"),p=(0,r.up)("el-table");return(0,r.wg)(),(0,r.iD)(r.HY,null,[k,(0,r.Wm)(u,{model:n.form,"label-width":"120px","label-position":"top",style:{"max-width":"600px"},action:"/addServiceIp",method:"post"},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{label:"ONOS Endpoint address and port"},{default:(0,r.w5)((()=>[(0,r.Wm)(i,{modelValue:n.form.addrPort,"onUpdate:modelValue":t[0]||(t[0]=e=>n.form.addrPort=e),placeholder:"e.g. 127.0.0.1:8181"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(m,null,{default:(0,r.w5)((()=>[(0,r.Wm)(s,{type:"primary",onClick:l.onSubmit},{default:(0,r.w5)((()=>[(0,r.Uk)("Create")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"]),(0,r.Wm)(p,{data:n.maoOnosTableData,ref:"maoTable","row-class-name":l.tableRowClassName,"empty-text":"暂无数据","max-height":"610px"},{default:(0,r.w5)((()=>[(0,r.Wm)(d,{label:"API Name",prop:"API_NAME"}),(0,r.Wm)(d,{label:"API URL",prop:"API_URL"})])),_:1},8,["data","row-class-name"])],64)}var M={name:"ConfigTopo",data(){return{form:(0,W.qj)({addrPort:""}),maoOnosTableData:[]}},mounted(){this.onLoad()},methods:{tableRowClassName(e){return-1!==e.row.API_URL.indexOf("%")?"warning-row":""},onSubmit(){var e=this;this.$http.post("/api/addOnosInfo",this.form,{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}).then((function(){e.onLoad()})).catch((function(e){console.log("errMao: "+e)}))},onLoad(){var e=this;this.$http.get("/api/getOnosInfo").then((function(t){for(var o in e.maoOnosTableData=[],t.data)"addrPort"===o?e.form.addrPort=t.data[o]:e.maoOnosTableData.push({API_NAME:o,API_URL:t.data[o]})})).catch((function(e){console.log("errMao: "+e)}))}}};const N=(0,u.Z)(M,[["render",A]]);var $=N;const q=(0,r._)("div",{style:{margin:"20px"}},null,-1);function j(e,t,o,a,n,l){const i=(0,r.up)("el-input");return(0,r.wg)(),(0,r.iD)(r.HY,null,[q,(0,r.Wm)(i,{modelValue:n.maoConfigData,"onUpdate:modelValue":t[0]||(t[0]=e=>n.maoConfigData=e),type:"textarea",placeholder:"Loading config data ...",autosize:""},null,8,["modelValue"])],64)}var E={name:"ConfigAllText",data(){return{maoConfigData:""}},mounted(){this.onLoad()},methods:{onLoad(){var e=this;this.$http.get("/api/getAllConfigText").then((function(t){e.maoConfigData=t.data})).catch((function(e){console.log("errMao: "+e)}))}}};const Z=(0,u.Z)(E,[["render",j]]);var H=Z;const z={name:"DeviceInfo",data(){return{refreshSwitch:!0,refreshTimer:"",maoTableData:[]}},mounted(){this.refreshData(),this.refreshTimer=setInterval(this.refreshData,1e3)},beforeUnmount(){clearInterval(this.refreshTimer)},methods:{tableRowClassName(e){return!1===e.row.alive?"warning-row":""},tableCellClassName({row:e,column:t,rowIndex:o,columnIndex:a}){e.index=o,t.index=a},maoTableClick(e,t){1===t.index&&this.$refs.maoTable.toggleRowExpansion(e)},refreshData(){if(this.refreshSwitch){var e=this;this.$http.get("/api/showMergeServiceIP").then((function(t){e.maoTableData=[];for(var o=t.data,a=0;a<o.length;a++){var n=[];for(let e in o[a])n.push({attrName:e,attrValue:o[a][e]});n=n.sort(((e,t)=>e["attrName"]<t["attrName"]?-1:1)),e.maoTableData.push({attr:n,deviceIp:null!=o[a]["Address"]?o[a]["Address"]:o[a]["Hostname"],Report_IP:null!=o[a]["Ips"]?o[a]["Ips"].join("\n"):"/",alive:o[a]["Alive"],Detect_Count:null!=o[a]["DetectCount"]?o[a]["DetectCount"]:"/",Report_Count:null!=o[a]["ReportCount"]?o[a]["ReportCount"]:o[a]["ReportTimes"],RTT_Duration:null!=o[a]["RttDuration"]?(o[a]["RttDuration"]/1e3/1e3).toFixed(3)+"ms":"/",Last_Seen:null!=o[a]["LastSeen"]?o[a]["LastSeen"]:o[a]["LocalLastSeen"],RttOutbound_or_Remote_Timestamp:null!=o[a]["RttOutboundTimestamp"]?o[a]["RttOutboundTimestamp"]:o[a]["ServerDateTime"],Other_Data:null!=o[a]["OtherData"]?o[a]["OtherData"]:"/"})}})).catch((function(e){console.log("errMao"+e)}))}},maoDoClick(){console.log("DeviceControl clicked")},maoDeviceOnline(e){var t=this;console.log(e),this.$http.post("/api/devices/setDeviceOnline",{deviceid:e}).then((function(e){console.log(e),e["data"]?t.$notify({title:"成功",message:"这是一条成功的提示消息, maoDeviceOnline",type:"success"}):t.$notify.error({title:"错误",message:"这是一条错误的提示消息, maoDeviceOnline"})})).catch((function(e){console.log(e)}))},maoDeviceOffline(e){var t=this;this.$http.post("/api/devices/setDeviceOffline",{deviceid:e}).then((function(e){console.log(e),e["data"]?t.$notify({title:"成功",message:"这是一条成功的提示消息, maoDeviceOffline",type:"success"}):t.$notify.error({title:"错误",message:"这是一条错误的提示消息, maoDeviceOffline"})})).catch((function(e){console.log(e)}))}}};var G=Object.assign(z,{setup(e){return(e,t)=>{const o=(0,r.up)("el-switch"),a=(0,r.up)("el-row"),n=(0,r.up)("el-table-column"),l=(0,r.up)("el-table");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(a,{class:"row-bg",justify:"center"},{default:(0,r.w5)((()=>[(0,r.Wm)(o,{modelValue:e.refreshSwitch,"onUpdate:modelValue":t[0]||(t[0]=t=>e.refreshSwitch=t),size:"default","active-text":"启用刷新"},null,8,["modelValue"])])),_:1}),(0,r.Wm)(l,{data:e.maoTableData,ref:"maoTable",onCellClick:e.maoTableClick,"cell-class-name":e.tableCellClassName,"row-class-name":e.tableRowClassName,"empty-text":"暂无数据","max-height":"845px"},{default:(0,r.w5)((()=>[(0,r.Wm)(n,{label:"",type:"expand"},{default:(0,r.w5)((e=>[(0,r.Wm)(l,{data:e.row.attr,border:!0},{default:(0,r.w5)((()=>[(0,r.Wm)(n,{label:"属性",prop:"attrName",width:"200px"}),(0,r.Wm)(n,{label:"值",prop:"attrValue"})])),_:2},1032,["data"])])),_:1}),(0,r.Wm)(n,{label:"Device IP",prop:"deviceIp"}),(0,r.Wm)(n,{label:"Report IP",prop:"Report_IP"}),(0,r.Wm)(n,{label:"Alive",prop:"alive"}),(0,r.Wm)(n,{label:"Detect Count",prop:"Detect_Count"}),(0,r.Wm)(n,{label:"Report Count",prop:"Report_Count"}),(0,r.Wm)(n,{label:"RTT Duration",prop:"RTT_Duration"}),(0,r.Wm)(n,{label:"Last Seen",prop:"Last_Seen"}),(0,r.Wm)(n,{label:"Timestamp",prop:"RttOutbound_or_Remote_Timestamp"})])),_:1},8,["data","onCellClick","cell-class-name","row-class-name"])],64)}}});const Y=G;var B=Y;function F(e,t,o,a,n,l){const i=(0,r.up)("el-text");return(0,r.wg)(),(0,r.j4)(i,{id:"onosTips",type:n.tipsType,size:"large"},null,8,["type"])}var Q={name:"ONOS",data(){return{tipsType:"danger"}},mounted(){this.queryOnosPage()},methods:{queryOnosPage(){var e=this;this.$http.get("/api/getOnosInfo").then((function(t){var o=t.data["addrPort"];null!=o&&""!==o?(e.tipsType="success",document.getElementById("onosTips").innerText="在新窗口中查看拓扑",window.open("http://"+o+"/onos/ui","_blank")):(e.tipsType="warning",document.getElementById("onosTips").innerText="拓扑接口暂未配置")})).catch((function(t){console.log("errMao: "+t),e.tipsType="danger",document.getElementById("onosTips").innerText="拓扑接口获取异常:"+t}))}}};const J=(0,u.Z)(Q,[["render",F]]);var K=J;const X={src:"/api",width:"100%",height:"100%"};function ee(e,t,o,a,n,l){return(0,r.wg)(),(0,r.iD)("iframe",X)}var te={name:"ApiListOldApi",data(){return{}},mounted(){},methods:{}};const oe=(0,u.Z)(te,[["render",ee]]);var ae=oe;const ne=(0,r._)("div",{style:{margin:"20px"}},null,-1);function le(e,t,o,a,n,l){const i=(0,r.up)("el-button"),m=(0,r.up)("el-table-column"),s=(0,r.up)("el-table");return(0,r.wg)(),(0,r.iD)(r.HY,null,[ne,(0,r.Wm)(s,{data:n.maoGrpcTableData,ref:"maoTable","cell-class-name":l.tableCellClassName,"empty-text":"暂无数据","max-height":"610px"},{default:(0,r.w5)((()=>[(0,r.Wm)(m,{label:"Control"},{default:(0,r.w5)((e=>[(0,r.Wm)(i,{size:"small",type:"danger",onClick:t=>l.handleDelete(e.$index,e.row)},{default:(0,r.w5)((()=>[(0,r.Uk)("Delete")])),_:2},1032,["onClick"])])),_:1}),(0,r.Wm)(m,{label:"Service Name",prop:"serviceName"}),(0,r.Wm)(m,{label:"Report IP",prop:"deviceIps"}),(0,r.Wm)(m,{label:"Alive",prop:"alive"}),(0,r.Wm)(m,{label:"Report Count",prop:"reportCount"}),(0,r.Wm)(m,{label:"RTT Duration",prop:"rttDuration"}),(0,r.Wm)(m,{label:"Last Seen",prop:"lastSeen"}),(0,r.Wm)(m,{label:"Timestamp",prop:"remoteTimestamp"})])),_:1},8,["data","cell-class-name"])],64)}var re={name:"ConfigGrpc",data(){return{maoGrpcTableData:[],refreshTimer:"",form:{serviceNames:""}}},mounted(){this.onLoad(),this.refreshTimer=setInterval(this.onLoad,1e3)},beforeUnmount(){clearInterval(this.refreshTimer)},methods:{tableCellClassName({row:e,column:t,rowIndex:o,columnIndex:a}){e.index=o,t.index=a},handleDelete(e,t){var o=this;this.$http.post("/api/delGrpcService",{serviceNames:t.serviceName},{headers:{"Content-Type":"application/x-www-form-urlencoded;"}}).then((function(){o.onLoad()})).catch((function(e){console.log("errMao: "+e)}))},onLoad(){var e=this;this.$http.get("/api/showAllGrpcService").then((function(t){e.maoGrpcTableData=[];for(var o=t.data,a=0;a<o.length;a++)e.maoGrpcTableData.push({serviceName:o[a]["Hostname"],deviceIps:o[a]["Ips"].join("\n"),alive:o[a]["Alive"],reportCount:o[a]["ReportTimes"],rttDuration:(o[a]["RttDuration"]/1e3/1e3).toFixed(3)+"ms",lastSeen:o[a]["LocalLastSeen"],remoteTimestamp:o[a]["ServerDateTime"]})})).catch((function(e){console.log("errMao: "+e)}))}}};const ie=(0,u.Z)(re,[["render",le]]);var me=ie,se=(0,f.p7)({history:(0,f.r5)(),routes:[{path:"/",components:{maoMain:B}},{path:"/config",components:{maoMain:b},children:[{path:"",components:{maoConfig:T}},{path:"email",components:{maoConfig:T}},{path:"icmp",components:{maoConfig:U}},{path:"grpc",components:{maoConfig:me}},{path:"topo",components:{maoConfig:$}},{path:"mysql",components:{maoConfig:R}},{path:"allText",components:{maoConfig:H}}]},{path:"/deviceStatus",components:{maoMain:B}},{path:"/topo",components:{maoMain:K}},{path:"/apiListOldApi",components:{maoMain:ae}}]});console.log("1 ===");const ue=(0,a.ri)(p);console.log("2 ===");for(const[de,pe]of Object.entries(c))ue.component(de,pe);console.log("3 ==="),ue.config.globalProperties.$http=l.Z.create({baseUrl:"https://www.maojianwei.com/resources/",timeout:3e3}),console.log("4 ==="),ue.use(n.Z,{size:"large"}),console.log("5 ==="),ue.use(se),console.log("6 ==="),ue.mount("#app"),console.log("7 ===")}},t={};function o(a){var n=t[a];if(void 0!==n)return n.exports;var l=t[a]={exports:{}};return e[a].call(l.exports,l,l.exports,o),l.exports}o.m=e,function(){var e=[];o.O=function(t,a,n,l){if(!a){var r=1/0;for(u=0;u<e.length;u++){a=e[u][0],n=e[u][1],l=e[u][2];for(var i=!0,m=0;m<a.length;m++)(!1&l||r>=l)&&Object.keys(o.O).every((function(e){return o.O[e](a[m])}))?a.splice(m--,1):(i=!1,l<r&&(r=l));if(i){e.splice(u--,1);var s=n();void 0!==s&&(t=s)}}return t}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[a,n,l]}}(),function(){o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,{a:t}),t}}(),function(){o.d=function(e,t){for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}}(),function(){o.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){var e={143:0};o.O.j=function(t){return 0===e[t]};var t=function(t,a){var n,l,r=a[0],i=a[1],m=a[2],s=0;if(r.some((function(t){return 0!==e[t]}))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(m)var u=m(o)}for(t&&t(a);s<r.length;s++)l=r[s],o.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return o.O(u)},a=self["webpackChunkMao_Service_Discovery"]=self["webpackChunkMao_Service_Discovery"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var a=o.O(void 0,[998],(function(){return o(959)}));a=o.O(a)})();