text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4cd8d6a0"],{5517:function(t,e,a){},a26d:function(t,e,a){"use strict";var n=a("5517"),r=a.n(n);r.a},ba3d:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("breadcrumb",{attrs:{data:t.breadcrumbInfo}}),t.schema?a("d-form",{staticClass:"mt-30",attrs:{loading:t.loading,schema:t.schema,"form-model":t.formModel},on:{submit:t.onSubmit}}):t._e()],1)},r=[],i=a("a34a"),s=a.n(i),o=a("3617"),c=a("c949"),l=a("08ba"),u=a("fe42");function d(t,e,a,n,r,i,s){try{var o=t[i](s),c=o.value}catch(l){return void a(l)}o.done?e(c):Promise.resolve(c).then(n,r)}function f(t){return function(){var e=this,a=arguments;return new Promise((function(n,r){var i=t.apply(e,a);function s(t){d(i,n,r,s,o,"next",t)}function o(t){d(i,n,r,s,o,"throw",t)}s(void 0)}))}}var g={name:"test",components:{DForm:o["a"]},props:{},data:function(){return{schema:null,formModel:{},breadcrumbInfo:["Clusters",this.$t("home.Create a ClickHouse Cluster")],loading:!1}},created:function(){this.getFormSchema()},mounted:function(){},methods:{getFormSchema:function(){var t=this;return f(s.a.mark((function e(){var a,n,r;return s.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c["a"].getClusterCreateFormSchema();case 2:a=e.sent,n=a.data.entity;try{r=new Function("return "+n)(),t.schema=r}catch(i){}case 5:case"end":return e.stop()}}),e)})))()},onSubmit:function(t){var e=this;return f(s.a.mark((function a(){var n,r;return s.a.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return e.loading=!0,a.next=3,c["a"].createCluster(t)["finally"]((function(){return e.loading=!1}));case 3:return n=a.sent,r=n.data.entity,a.next=7,Object(l["d"])({component:u["a"],props:{title:e.$t("task.View Task"),width:800,cancelText:e.$t("task.Close"),okText:null},data:{taskId:r,refresh:!0}})["finally"]((function(){e.$router.go(-1)}));case 7:case"end":return a.stop()}}),a)})))()}}},p=g,h=a("2877"),m=Object(h["a"])(p,n,r,!1,null,null,null);e["default"]=m.exports},fe42:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"task-detail"},[t.detail?a("div",{staticClass:"mb-20"},[a("label",[t._v(t._s(t.$t("task.Task ID"))+"：")]),a("span",{staticClass:"fc-black"},[t._v(t._s(t.detail.TaskId))]),a("label",{staticClass:"ml-20"},[t._v(t._s(t.$t("task.Cluster Name"))+"：")]),a("span",{staticClass:"fc-black"},[t._v(t._s(t.detail.ClusterName))]),a("label",{staticClass:"ml-20"},[t._v(t._s(t.$t("task.Current Action"))+"：")]),a("span",{staticClass:"fc-black"},[t._v(t._s(t.detail.Option[t.lang]))])]):t._e(),a("vxe-table",t._b({ref:"xTable",staticStyle:{clear:"both"},attrs:{size:"mini",columns:t.columns,data:t.currentPageData}},"vxe-table",t.gridOptions,!1),[a("vxe-column",{attrs:{fixed:"right",align:"center",title:t.$t("task.Node"),field:"Host"}}),a("vxe-column",{attrs:{fixed:"right",align:"center",title:t.$t("task.Status"),field:"Status"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex flex-vcenter flex-center"},[t.loading?a("img",{staticClass:"mr-20",attrs:{src:"/images/5-130H2191322-50.gif"}}):t._e(),a("span",{staticClass:"status",class:e.row.Status.EN},[t._v(t._s(e.row.Status[t.lang]))])])]}}])})],1),a("vxe-pager",{attrs:{align:"center","current-page":t.pagination.currentPage,"page-size":t.pagination.pageSize,"page-sizes":t.pagination.pageSizes,total:t.pagination.total,layouts:["PrevPage","JumpNumber","NextPage","Total"]},on:{"update:pageSize":function(e){return t.$set(t.pagination,"pageSize",e)},"update:page-size":function(e){return t.$set(t.pagination,"pageSize",e)},"page-change":t.handlePageChange}})],1)},r=[],i=a("a34a"),s=a.n(i),o=a("c949");function c(t,e,a,n,r,i,s){try{var o=t[i](s),c=o.value}catch(l){return void a(l)}o.done?e(c):Promise.resolve(c).then(n,r)}function l(t){return function(){var e=this,a=arguments;return new Promise((function(n,r){var i=t.apply(e,a);function s(t){c(i,n,r,s,o,"next",t)}function o(t){c(i,n,r,s,o,"throw",t)}s(void 0)}))}}var u={props:{taskId:String,refresh:Boolean},data:function(){return{timerId:null,detail:null,pagination:{total:0,pageSize:10,pageSizes:[10,15,20,50,100,200,500,1e3],currentPage:1},gridOptions:{border:!0,resizable:!0,showHeaderOverflow:!0,showOverflow:!0,highlightHoverRow:!0,rowId:"Host"},loading:!1}},computed:{columns:function(){return[{prop:"Host"},{prop:"Status"}]},lang:function(){return this.$i18n.locale.toUpperCase()},currentPageData:function(){var t,e,a=this.pagination,n=a.currentPage,r=a.pageSize;return null===(t=this.detail)||void 0===t||null===(e=t.NodeStatus)||void 0===e?void 0:e.slice((n-1)*r,n*r)}},created:function(){this.getTaskDetail(),this.refresh&&(this.loading=!0,this.timerId=setInterval(this.getTaskDetail,3e3))},beforeDestroy:function(){this.timerId&&clearInterval(this.timerId)},methods:{getTaskDetail:function(){var t=this;return l(s.a.mark((function e(){var a,n;return s.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o["h"].getTaskDetail(t.taskId);case 2:a=e.sent,n=a.data.entity,t.detail=n,t.pagination.currentPage=1,t.pagination.total=n.NodeStatus.length,0==n.NodeStatus.filter((function(t){return!["Done","Failed"].includes(t.Status.EN)})).length&&(clearInterval(t.timerId),t.loading=!1);case 8:case"end":return e.stop()}}),e)})))()},handlePageChange:function(t){this.pagination.currentPage=t.currentPage}}},d=u,f=(a("a26d"),a("2877")),g=Object(f["a"])(d,n,r,!1,null,"40081df2",null);e["a"]=g.exports}}]);