1 |
- var msServiceInstanceContentVm=new Vue({el:"#msServiceInstanceContent",data:{pageLoading:!1,msServiceInstanceList:[],selectedInstanceMetadata:{},editType:GetQueryString("editType")},computed:{inViewMode:function(){return"view"===this.editType},requestPrefix:function(){return this.msConfig.gatewayRoute+this.msConfig.adminPath}},methods:{viewInstanceMetadata:function(e){this.selectedInstanceMetadata=e.metadata,this.$nextTick(function(){layer.open({title:"查看元数据",type:1,content:$("#metadataForm"),area:["500px","400px"]})})},offlineInstance:function(n){var i=this;direwolfCommonConfirm({message:"确定将此实例下线吗?",title:"下线提醒"},function(){var e=i.requestPrefix+"/platman/msServiceInfo/status/"+n.row.app+"/"+n.row.instanceId+"?status=OUT_OF_SERVICE",t="实例下线";axios.get(e).then(function(e){getDataFromAxiosResponse(e,t,!0),layer.closeAll(),direwolfCommonTips("由于服务实例刷新需要时间,请等待30秒再查看新的实例状态")}).catch(function(e){axiosErrorTips(e,t+"异常")})})},onlineInstance:function(n){var i=this;direwolfCommonConfirm({message:"确定将此实例上线吗?",title:"上线提醒"},function(){var e=i.requestPrefix+"/platman/msServiceInfo/status/"+n.row.app+"/"+n.row.instanceId+"?status=UP",t="实例上线";axios.get(e).then(function(e){getDataFromAxiosResponse(e,t,!0)}).catch(function(e){axiosErrorTips(e,t+"异常")})})}},created:function(){var t=this;t.msConfig=(new ProjectConfig).platmanServiceConfig,checkPagePermission(t.requestPrefix+"/platman/msServiceInfo/checkMsServiceInstancePermission"),t.pageLoading=!1;var n="获取微服务实例明细";axios.get(t.requestPrefix+"/platman/msServiceInfo/listServiceInstances?serviceCode="+GetQueryString("serviceCode")+"&status="+GetQueryString("status")).then(function(e){t.msServiceInstanceList=getDataFromAxiosResponse(e,n).data}).catch(function(e){axiosErrorTips(e,n+"异常")})},mounted:function(){}});
|