webpackJsonp([82],{Ll7Y:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("mtWM"),s=a.n(n),i={data:function(){return{url:"",percentage:0,state:0,output:""}},methods:{deploy:function(){var t=this;this.$confirm("确定重新部署?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return s.a.post("http://49.4.67.181:8000/job/信牧基础平台/build",{auth:{username:"admin",password:"3edc#EDC"}})}).then(function(t){if(201===t.status)return s.a.get(t.headers.location+"api/json");throw""}).then(function(e){t.url=e.data.executable.url,t.percentage=0,t.output="",t.state=1,t.pollingStatus()}).catch(function(t){})},pollingStatus:function(){var t=this;s.a.get(this.url+"api/json").then(function(e){if(200===e.status)if(e.data.building){var a=100*((new Date).getTime()-e.data.timestamp)/e.data.estimatedDuration;a=a<0?0:a>=100?99:parseInt(a),t.percentage=a,setTimeout(function(){t.pollingStatus()},1e3)}else t.state=2,s.a.get("http://49.4.67.181:8083/admin#/myTasks",{timeout:6e5}).then(function(e){t.state=3,t.percentage=100,t.$message.success("部署成功")}).catch(function(t){})}),s.a.get(this.url+"/logText/progressiveText?start=0").then(function(e){200===e.status&&(t.output=e.data,setTimeout(function(){t.$refs.output.scrollTop=t.$refs.output.scrollHeight},100))})}}},o={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container"},[0===t.state?a("el-alert",{attrs:{title:"请谨慎操作",type:"warning",description:"重新部署会导致网站暂时无法访问",closable:!1,"show-icon":""}}):t._e(),t._v(" "),0===t.state?a("div",{staticStyle:{"margin-top":"20px"}},[a("el-button",{attrs:{size:"small",type:"danger",plain:""},on:{click:t.deploy}},[t._v("重新部署")])],1):t._e(),t._v(" "),1===t.state?a("el-alert",{attrs:{closable:!1,title:"部署中-编译代码",description:"部署过程中请不要进行其他操作",type:"info","show-icon":""}}):t._e(),t._v(" "),2===t.state?a("el-alert",{attrs:{closable:!1,title:"部署中-重启tomcat",description:"部署过程中请不要进行其他操作",type:"info","show-icon":""}}):t._e(),t._v(" "),3===t.state?a("el-alert",{attrs:{closable:!1,title:"部署成功",type:"success","show-icon":""}}):t._e(),t._v(" "),0!==t.state?a("el-progress",{attrs:{percentage:t.percentage}}):t._e(),t._v(" "),0!==t.state?a("pre",{ref:"output",staticClass:"output"},[t._v(t._s(t.output))]):t._e()],1)},staticRenderFns:[]};var r=a("VU/8")(i,o,!1,function(t){a("Qv4U")},"data-v-305a377a",null);e.default=r.exports},Qv4U:function(t,e){}});