Files
canal/canal-admin/canal-admin-server/src/main/resources/public/static/js/chunk-e1a839e4.c870a02b.js
rewerma 44722fe01c canal-admin-ui 指定profile编译 (#2019)
* canal-admin-ui 指定profile编译

* 启动实例时选择指定节点

* modify

* modify

* 静态页面修改
2019-07-22 09:15:14 +08:00

1 line
8.3 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e1a839e4"],{"9f66":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("el-button",{staticClass:"filter-item",attrs:{type:"primary"},on:{click:function(e){return t.handleCreate()}}},[t._v("新建节点")]),t._v(" "),n("el-button",{staticClass:"filter-item",attrs:{type:"info"},on:{click:function(e){return t.fetchData()}}},[t._v("刷新节点")])],1),t._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{label:"节点名称","min-width":"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.name)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"IP","min-width":"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.ip))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"端口","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.port)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"监控端口","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.port2)+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{"class-name":"status-col",label:"状态","min-width":"150",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-tag",{attrs:{type:t._f("statusFilter")(e.row.status)}},[t._v(t._s(t._f("statusLabel")(e.row.status)))])]}}])}),t._v(" "),n("el-table-column",{attrs:{align:"center",prop:"created_at",label:"操作","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-dropdown",{attrs:{trigger:"click"}},[n("el-button",{attrs:{type:"primary",size:"mini"}},[t._v("\n 操作"),n("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{nativeOn:{click:function(n){return t.handleUpdate(e.row)}}},[t._v("修改节点")]),t._v(" "),n("el-dropdown-item",{nativeOn:{click:function(n){return t.handleDelete(e.row)}}},[t._v("删除节点")]),t._v(" "),n("el-dropdown-item",{nativeOn:{click:function(n){return t.handleStart(e.row)}}},[t._v("启动服务")]),t._v(" "),n("el-dropdown-item",{nativeOn:{click:function(n){return t.handleStop(e.row)}}},[t._v("停止服务")]),t._v(" "),n("el-dropdown-item",{nativeOn:{click:function(n){return t.handleLog(e.row)}}},[t._v("日志详情")])],1)],1)]}}])})],1),t._v(" "),n("el-dialog",{attrs:{visible:t.dialogFormVisible,title:t.textMap[t.dialogStatus],width:"600px"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("el-form",{ref:"dataForm",staticStyle:{width:"350px","margin-left":"80px"},attrs:{rules:t.rules,model:t.nodeModel,"label-position":"left","label-width":"80px"}},[n("el-form-item",{attrs:{label:"节点名称",prop:"name"}},[n("el-input",{model:{value:t.nodeModel.name,callback:function(e){t.$set(t.nodeModel,"name",e)},expression:"nodeModel.name"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"节点IP",prop:"ip"}},[n("el-input",{model:{value:t.nodeModel.ip,callback:function(e){t.$set(t.nodeModel,"ip",e)},expression:"nodeModel.ip"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"节点端口",prop:"port"}},[n("el-input",{attrs:{placeholder:"11113",type:"number"},model:{value:t.nodeModel.port,callback:function(e){t.$set(t.nodeModel,"port",e)},expression:"nodeModel.port"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"监控端口",prop:"port2"}},[n("el-input",{attrs:{type:"number"},model:{value:t.nodeModel.port2,callback:function(e){t.$set(t.nodeModel,"port2",e)},expression:"nodeModel.port2"}})],1)],1),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.dataOperation()}}},[t._v("确定")])],1)],1)],1)},o=[],r=n("c6ed"),i={filters:{statusFilter:function(t){var e={1:"success",0:"gray","-1":"danger"};return e[t]},statusLabel:function(t){var e={1:"启动",0:"停止","-1":"断开"};return e[t]}},data:function(){return{list:null,listLoading:!0,listQuery:{name:"",ip:""},dialogFormVisible:!1,textMap:{create:"新建节点信息",update:"修改节点信息"},nodeModel:{id:void 0,name:null,ip:null,port:11113,port2:null},rules:{name:[{required:!0,message:"节点名称不能为空",trigger:"change"}],ip:[{required:!0,message:"节点IP不能为空",trigger:"change"}],port:[{required:!0,message:"节点端口不能为空",trigger:"change"}]},dialogStatus:"create"}},created:function(){this.fetchData()},methods:{fetchData:function(){var t=this;this.listLoading=!0,Object(r["c"])(this.listQuery).then(function(e){t.list=e.data,t.listLoading=!1})},resetModel:function(){this.nodeModel={id:void 0,name:null,ip:null,port:null,port2:null}},handleCreate:function(){var t=this;this.resetModel(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick(function(){t.$refs["dataForm"].clearValidate()})},dataOperation:function(){var t=this;this.$refs["dataForm"].validate(function(e){e&&("create"===t.dialogStatus&&Object(r["a"])(t.nodeModel).then(function(e){t.operationRes(e)}),"update"===t.dialogStatus&&Object(r["g"])(t.nodeModel).then(function(e){t.operationRes(e)}))})},operationRes:function(t){"success"===t.data?(this.fetchData(),this.dialogFormVisible=!1,this.$message({message:this.textMap[this.dialogStatus]+"成功",type:"success"})):this.$message({message:this.textMap[this.dialogStatus]+"失败",type:"error"})},handleUpdate:function(t){var e=this;this.resetModel(),this.nodeModel=Object.assign({},t),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick(function(){e.$refs["dataForm"].clearValidate()})},handleDelete:function(t){var e=this;this.$confirm("删除节点信息并不会导致节点服务停止","确定删除节点信息",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(r["b"])(t.id).then(function(t){"success"===t.data?(e.fetchData(),e.$message({message:"删除节点信息成功",type:"success"})):e.$message({message:"删除节点信息失败",type:"error"})})})},handleStart:function(t){var e=this;0===t.status?this.$confirm("启动节点 Canal Server 服务","确定启动节点服务",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(r["e"])(t.id).then(function(t){t.data?(e.fetchData(),e.$message({message:"启动成功",type:"success"})):e.$message({message:"启动节点服务出现异常",type:"error"})})}):this.$message({message:"当前节点不是停止状态,无法启动",type:"error"})},handleStop:function(t){var e=this;1===t.status?this.$confirm("停止节点 Canal Server 服务","确定停止节点服务",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(r["f"])(t.id).then(function(t){t.data?(e.fetchData(),e.$message({message:"停止成功",type:"success"})):e.$message({message:"停止节点服务出现异常",type:"error"})})}):this.$message({message:"当前节点不是启动状态,无法停止",type:"error"})},handleLog:function(t){this.$router.push("nodeServer/log?id="+t.id)}}},l=i,s=n("2877"),u=Object(s["a"])(l,a,o,!1,null,null,null);e["default"]=u.exports},c6ed:function(t,e,n){"use strict";n.d(e,"c",function(){return o}),n.d(e,"a",function(){return r}),n.d(e,"g",function(){return i}),n.d(e,"b",function(){return l}),n.d(e,"e",function(){return s}),n.d(e,"f",function(){return u}),n.d(e,"d",function(){return c});var a=n("b775");function o(t){return Object(a["a"])({url:"/nodeServers",method:"get",params:t})}function r(t){return Object(a["a"])({url:"/nodeServer",method:"post",data:t})}function i(t){return Object(a["a"])({url:"/nodeServer",method:"put",data:t})}function l(t){return Object(a["a"])({url:"/nodeServer/"+t,method:"delete"})}function s(t){return Object(a["a"])({url:"/nodeServer/start/"+t,method:"put"})}function u(t){return Object(a["a"])({url:"/nodeServer/stop/"+t,method:"put"})}function c(t){return Object(a["a"])({url:"/nodeServer/log/"+t,method:"get"})}}}]);