(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2a5c05c1"],{"01a1":function(t,e,s){"use strict";s("b8c0")},"2d84":function(t,e,s){t.exports=s.p+"static/img/cluster.8a3428c3.svg"},4089:function(t,e,s){"use strict";s("bb87")},"43f3":function(t,e,s){},b8c0:function(t,e,s){},bb87:function(t,e,s){},d5d0:function(t,e,s){"use strict";s("43f3")},e464:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"cluster-list"},[e("section",{staticClass:"header-option"},[e("el-button",{staticClass:"big-btn",attrs:{plain:"",icon:"el-icon-refresh",disabled:t.requestIng},on:{click:t.refresh}},[t._v(t._s(t.$t("refresh")))]),t.orgActive?e("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"instance:add",expression:"'instance:add'"}],staticClass:"big-btn",attrs:{plain:"",size:"small",icon:"el-icon-plus"},on:{click:t.addCluster}},[t._v(t._s(t.$t("cluster.createCluster")))]):t._e()],1),e("section",{staticClass:"cluster-content"},[t.clusterList.length?t._e():e("el-empty",{attrs:{"image-size":200}}),t._l(t.clusterList,(function(s){return e("cluster-card",{key:s.id,attrs:{cluster:s,tokenShow:s.id==t.tokenId},on:{edit:t.edit}})}))],2),e("el-dialog",{attrs:{"close-on-click-modal":!1,align:"center",title:t.title,visible:t.editDialog,width:"500px"},on:{"update:visible":function(e){t.editDialog=e}}},[e("EditCluster",{attrs:{info:t.clusterInfo,editType:t.editType},on:{close:function(e){t.editDialog=!1}}})],1)],1)},a=[],r=(s("14d9"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"ClusterCard"},[e("el-card",{staticClass:"box-card",attrs:{shadow:"always"}},[e("div",{staticClass:"cluster-wrapper",class:[t.cluster.private_gateway_url?"fiveColumn":"fourColumn"]},[e("div",{staticClass:"region"},[e("div",{staticClass:"label",attrs:{title:t.appName}},[t._v(" "+t._s(t.$t("cluster.alias"))+": ")]),e("div",{staticClass:"region-content"},[e("span",{staticClass:"label app-name"},[t._v(t._s(t.appName))]),e("el-tooltip",{attrs:{effect:"light",content:t.$t("cluster.editCluster")}},[t.hasPermission("instance:alter")?e("i",{staticClass:"el-icon-edit ClusterCard_NameEditIcon",on:{click:function(e){return e.stopPropagation(),t.handleEditcluster(t.cluster)}}}):t._e()])],1)]),e("div",{staticClass:"region"},[e("p",{staticClass:"label nowrap"},[t._v(t._s(t.$t("version"))+":")]),e("el-tooltip",{attrs:{effect:"light",content:t.cluster.image_version}},[e("p",{staticClass:"region-content"},[t._v(" "+t._s(t.cluster.image_version)+" ")])])],1),e("div",{staticClass:"flexStart"},[e("div",{staticClass:"right-switch"},[e("div",{staticClass:"ClusterCard_switch"},[e("span",{class:[t.handleStatuValue(t.cluster.cluster_status)?"active_text":"inactive_text"]},[t._v(t._s(this.$t("cluster."+t.cluster.cluster_status)))]),e("el-switch",{staticClass:"ClusterCard_switch_btn",attrs:{"active-color":"#4259CE","data-check":"instance opearte",disabled:t.disable(t.cluster)||!t.hasPermission(["instance:disable","instance:enable"]),value:t.handleStatuValue(t.cluster.cluster_status)},on:{change:function(e){return t.handleChangeclusterState(e,t.cluster)}}})],1),t.cluster.ha?e("el-tooltip",{attrs:{effect:"light",content:t.$t("highAvailability")}},[e("img",{staticClass:"basic-icon",attrs:{src:s("2d84"),alt:""}})]):t._e(),e("el-tooltip",{attrs:{effect:"light",content:t.delBtnTip}},[e("span",{directives:[{name:"permission",rawName:"v-permission",value:"instance:delete",expression:"'instance:delete'"}],staticClass:"el-icon-delete",class:{"btn-disabled":!t.isDel||t.requestIng},staticStyle:{"font-size":"20px"},on:{click:function(e){return e.stopPropagation(),t.handleDeletecluster(t.cluster)}}})])],1)]),e("div",{staticClass:"region"},[e("p",{staticClass:"label nowrap"},[t._v(t._s(t.planTitle)+":")]),e("div",{staticClass:"region-content"},[e("a",{on:{click:function(e){return e.preventDefault(),t.priceView.apply(null,arguments)}}},[t._v(" "+t._s(t.currentPlanName)+" ")]),e("a",{directives:[{name:"permission",rawName:"v-permission",value:"billing:instance:upgrade",expression:"'billing:instance:upgrade'"}],staticStyle:{"margin-left":"10px"},on:{click:function(e){return e.preventDefault(),t.priceSet.apply(null,arguments)}}},[t._v(" "+t._s(t.$t("upgrade"))+" ")])])]),e("div",{staticClass:"region"},[e("span",{staticClass:"label nowrap"},[t._v(t._s(t.$t("token"))+": ")]),e("div",{staticClass:"region-content"},[t._v(" "+t._s(t.token)+" "),e("div",{staticClass:"cp-btn"},[e("el-tooltip",{attrs:{effect:"light",content:t.$t("copyToken")}},[e("el-button",{staticClass:"mini-btn",attrs:{type:"text",size:"mini",icon:"el-icon-copy-document"},on:{click:function(e){return e.stopPropagation(),t.copy(t.token)}}},[t._v(t._s(t.$t("copy")))])],1),e("el-tooltip",{attrs:{effect:"light",content:t.$t("resetToken")}},[e("el-button",{staticClass:"mini-btn",staticStyle:{"margin-left":"0"},attrs:{type:"text",size:"mini",disabled:t.requestIng,icon:"el-icon-brush"},on:{click:function(e){return e.stopPropagation(),t.reset(t.cluster)}}},[t._v(t._s(t.$t("reset")))])],1)],1)])]),e("div",{staticClass:"region"},[e("p",{staticClass:"label nowrap"},[t._v(t._s(t.$t("dashboard.region"))+":")]),e("el-tooltip",{attrs:{effect:"light",content:t.cluster.cloud_name+"/"+t.cluster.region_name}},[e("p",{staticClass:"region-content"},[t._v(" "+t._s(t.cluster.cloud_name)+"/"+t._s(t.cluster.region_name)+" ")])])],1),t.cluster.private_gateway_url?e("div",{staticClass:"region"},[e("el-tooltip",{attrs:{effect:"light",content:"AWS Private Link"}},[e("Icon",{staticClass:"basic-icon primary",attrs:{name:"awsPrivateLink"}})],1)],1):t._e(),e("RoleDisplay",{staticStyle:{height:"30px",display:"flex","align-items":"end"},attrs:{roles:t.cluster.roles}}),e("div",{staticClass:"region"},[e("span",{staticClass:"label nowrap"},[t._v("URL: ")]),e("div",{staticClass:"region-content"},[e("span",{attrs:{target:"_blank"},on:{click:function(t){t.stopPropagation()}}},[t._v(t._s(t.cluster.gateway_url))]),e("el-tooltip",{attrs:{effect:"light",content:t.$t("copyUrl")}},[e("el-button",{staticClass:"cp-btn mini-btn",attrs:{type:"text",size:"mini",icon:"el-icon-copy-document"},on:{click:function(e){return e.stopPropagation(),t.copy(t.cluster.gateway_url)}}},[t._v(t._s(t.$t("copy")))])],1)],1)]),t.cluster.private_gateway_url?e("div",{staticClass:"region"},[e("span",{staticClass:"label nowrap"},[t._v("Private URL: ")]),e("div",{staticClass:"region-content"},[e("span",{attrs:{target:"_blank"},on:{click:function(t){t.stopPropagation()}}},[t._v(t._s(t.cluster.private_gateway_url))]),e("el-tooltip",{attrs:{effect:"light",content:t.$t("copyUrl")}},[e("el-button",{staticClass:"cp-btn mini-btn",attrs:{type:"text",size:"mini",icon:"el-icon-copy-document"},on:{click:function(e){return e.stopPropagation(),t.copy(t.cluster.private_gateway_url)}}},[t._v(t._s(t.$t("copy")))])],1)],1)]):t._e(),e("div",{staticClass:"region"},[e("p",{staticClass:"label nowrap"},[t._v(t._s(t.$t("data.createAt"))+":")]),e("el-tooltip",{attrs:{effect:"light",content:t._f("handleDateTime")(t.cluster.create_time)}},[e("p",{staticClass:"region-content"},[t._v(" "+t._s(t._f("handleDateTime")(t.cluster.create_time))+" ")])])],1)],1)])],1)}),n=[],l=s("eee5"),c=s("ed08"),o=s("2ef0"),u=s("b562"),d=s("b441"),p=s("61f7"),h={props:{cluster:{type:Object,default:()=>({})},tokenShow:{type:Boolean,default:!1}},components:{RoleDisplay:l["a"]},data(){return{requestIng:!1,dialog:!1,IsAliyun:d["z"]}},computed:{appName(){return this.cluster.alias||this.cluster.name},role(){return this.$store.getters.role},token(){var t;return(null===(t=this.cluster)||void 0===t?void 0:t.token)||""},privileges(){return this.cluster.privileges||[]},currentPirceLevel(){var t;return null!==(t=d["X"][this.cluster.app_price_plan_level])&&void 0!==t?t:3},marketpalce(){return this.$store.getters.marketplace},currentPlanName(){return this.cluster.app_price_plan_name||this.cluster.app_price_plan_level},planTitle(){return this.marketpalce?this.$t("dashboard.plan"):this.$t("plan.pricePlan")},isDel(){return d["t"].includes(this.cluster.cluster_status)},delBtnTip(){return this.$t("cluster."+(this.isDel?"delBtnTip":"delInstanceStatusTip"))}},created(){},methods:{async handleEditcluster(t){this.$emit("edit",Object(o["cloneDeep"])(t))},async handleDeletecluster(){this.isDel?this.$confirm(this.$t("cluster.opearationIns",[this.$t("del").toLowerCase(),this.cluster.alias]),this.$t("warning"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),type:"warning"}).then(()=>{Object(u["g"])(this.cluster).then(()=>{this.$message.success(this.$t("delSucc")),this.$store.dispatch("app/getClusterList").then(()=>{this.$store.dispatch("auth/resetRoute",{allLevel:!1,changeRoute:!0})})})}):this.$message.warning(this.$t("cluster.delInstanceStatusTip"))},priceView(){this.$store.commit("SET_PLAN_VIEW",this.cluster)},priceSet(){Object(c["G"])(this.cluster)},async handleChangeclusterState(t){if(this.requestIng)return;const e=t?this.$t("cluster.opearationIns",[(t?this.$t("cluster.start"):this.$t("cluster.suspend")).toLowerCase(),this.cluster.alias]):this.$t("cluster.suspendTip",[this.cluster.alias]);this.$confirm(e,this.$t("warning"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),type:"warning"}).then(()=>{this.requestIng=!0;const e={id:this.cluster.id,price_level:this.cluster.app_price_plan_level,cloudId:this.cluster.cloud_id,regionId:this.cluster.region_id};let i=t?u["u"]:u["v"];i(e).then(async()=>{this.$message.success(this.$t("operateSucc")),await this.$store.dispatch("app/getClusterList"),this.$store.getters.appId==this.cluster.id&&t&&this.$router.push("/instanceStatus")}).catch(e=>{t&&21441===(null===e||void 0===e?void 0:e.code)&&(this.$hasOrganizationPrivilege("billing:credit:query")?this.$store.commit("SET_DIALOG",{component:()=>s.e("chunk-7347795d").then(s.bind(null,"8e37")),config:{title:this.$t("warning"),width:"400px"}}):this.$alert(this.$t("cluster.noBiliingQueryTip"),this.$t("warning"),{confirmButtonText:this.$t("confirm")}))}).finally(()=>{this.requestIng=!1})}).catch(()=>{this.requestIng=!1})},copy(t){Object(c["i"])(t)},async reset(){this.requestIng||this.$confirm(this.$t("cluster.resetTokenTip").replace(/{ins_name}/,this.cluster.alias)+" ?",this.$t("warning"),{confirmButtonText:this.$t("confirm"),cancelButtonText:this.$t("cancel"),dangerouslyUseHTMLString:!0,type:"warning"}).then(()=>{this.requestIng=!0,Object(u["t"])(this.cluster.token_id||this.cluster.tokenId,this.cluster.region_id).then(()=>{this.$message.success(this.$t("resetSucc"))}).finally(()=>{this.requestIng=!1,this.$store.dispatch("app/getClusterList")})})},changeId(){this.$parent.tokenId=this.$parent.tokenId==this.cluster.id?"":this.cluster.id},disable(t){return d["G"].includes(t.cluster_status)||(this.handleStatuValue(t.cluster_status)?!this.hasPermission("instance:disable"):!this.hasPermission("instance:enable"))||this.requestIng},handleStatuValue(t){return!d["x"].includes(t)},hasPermission(t,e=!0){return Object(p["e"])(t)?e?t.some(t=>this.privileges.includes(t)):t.every(t=>this.privileges.includes(t)):this.privileges.includes(t)}}},g=h,m=(s("d5d0"),s("2877")),_=Object(m["a"])(g,r,n,!1,null,"6d2d4364",null),f=_.exports,v=function(){var t=this,e=t._self._c;return e("el-form",{ref:"form",staticStyle:{"text-align":"left","margin-bottom":"10px"},attrs:{size:"small","hide-required-asterisk":!0,model:t.info,rules:t.rules,"label-position":"left","label-width":"120px"}},[0==t.editType?e("el-form-item",{attrs:{label:t.$t("clusterName"),prop:"alias"}},[e("el-input",{attrs:{maxlength:32},model:{value:t.info.alias,callback:function(e){t.$set(t.info,"alias",e)},expression:"info.alias"}})],1):t._e(),1==t.editType?[e("el-form-item",{attrs:{label:t.$t("dashboard.cloud")}},[e("el-select",{staticClass:"w100",attrs:{placeholder:t.$t("dashboard.cloud")},model:{value:t.cloud,callback:function(e){t.cloud=e},expression:"cloud"}},t._l(t.cloudList,(function(s){return e("el-option",t._b({key:s.value},"el-option",s,!1))})),1)],1),e("el-form-item",{attrs:{label:t.$t("dashboard.region")}},[e("el-select",{staticClass:"w100",attrs:{placeholder:t.$t("dashboard.region")},model:{value:t.region,callback:function(e){t.region=e},expression:"region"}},t._l(t.regionList,(function(s){return e("el-option",t._b({key:s.value},"el-option",s,!1))})),1)],1)]:t._e(),e("el-row",[e("el-col",{attrs:{span:11}},[e("el-button",{staticClass:"w100",attrs:{size:"small",disabled:t.requestIng},on:{click:function(e){return t.$emit("close")}}},[t._v(t._s(t.$t("cancel")))])],1),e("el-col",{attrs:{span:11,offset:2}},[e("el-button",{staticClass:"w100",attrs:{size:"small",disabled:t.btnDisabled,loading:t.requestIng,type:"primary"},on:{click:t.handle}},[t._v(t._s(t.$t("confirm")))])],1)],1),e("p",{directives:[{name:"show",rawName:"v-show",value:t.errorText,expression:"errorText"}],staticClass:"errorText"},[t._v(t._s(t.errorText))])],2)},b=[],$=(s("d9e2"),{props:{info:{type:Object,default(){return{}}},editType:{type:Number,default:0}},data(){return{errorText:"",requestIng:!1,cloud:this.$store.getters["app/currentCloudAndRegion"].cloudId,region:this.$store.getters["app/currentCloudAndRegion"].regionId}},computed:{regionList(){var t;return(null===(t=this.cloudList.find(t=>t.value==this.cloud))||void 0===t?void 0:t.regions)||[]},cloudList(){return this.$store.state.app.cloudList},btnDisabled(){return!!this.requestIng||1==this.editType&&(!this.cloud||!this.region)},rules(){return{alias:[{required:!0,message:this.$t("required",[this.$t("clusterName")])},{validator:(t,e,s)=>{Object(p["r"])(e)?s():s(new Error(this.$t("register.nameError")))},trigger:"blur"}]}}},watch:{cloud(){var t;this.region=(null===(t=this.regionList[0])||void 0===t?void 0:t.value)||""}},methods:{handle(){if(1==this.editType)return this.next();this.requestIng||(this.errorText="",this.$refs.form.validate(async t=>{if(t){if(this.requestIng=!0,0==this.editType){const t={alias:this.info.alias.trim(),app_id:this.info.id,cloudId:this.info.cloud_id,regionId:this.info.region_id};await Object(u["a"])(t).then(()=>{this.$emit("close",2),this.$message.success(this.$t("changeSucc"))}).catch(()=>{}),this.$store.dispatch("app/getClusterList")}this.requestIng=!1}}))},next(){}}}),C=$,y=Object(m["a"])(C,v,b,!1,null,null,null),w=y.exports,I={components:{ClusterCard:f,EditCluster:w},inject:["tabs"],data(){return{dialog:!1,tokenId:"",requestIng:!1,editType:0,editDialog:!1,dialogWidth:1200,clusterInfo:{},currentPlan:null,cloudAndRegion:{cloudId:"",regionId:""}}},computed:{clusterList(){return this.$store.state.app.clusters},btnDisabled(){return this.requestIng||0==this.editType&&!this.clusterInfo.alias},title(){return{0:this.$t("cluster.editCluster"),1:this.$t("register.CR")}[this.editType]},canCreate(){const{clusterNum:t=1}=this.$store.getters.currentAppPricePlan;return t>this.$store.state.app.clusters.length||-1==t},orgActive(){return this.$store.getters.orgActive}},created(){},methods:{addCluster(){this.tabs.some(t=>"/instances/create"==t.name)||this.tabs.push({label:this.$t("cluster.createCluster"),name:"/instances/create"}),this.$router.push("instances/create")},edit(t){this.editType=0,t.alias=t.alias||t.name,this.clusterInfo=t,this.editDialog=!0},async close(t){1==t&&(await this.$store.dispatch("app/getClusterList"),this.$router.push("/instanceStatus")),this.dialog=!1},async refresh(){this.requestIng||(this.requestIng=!0,await this.$store.dispatch("app/getClusterList").catch(()=>!1),this.requestIng=!1)}}},k=I,x=(s("4089"),Object(m["a"])(k,i,a,!1,null,"7507c72e",null));e["default"]=x.exports},eee5:function(t,e,s){"use strict";var i=function(){var t=this,e=t._self._c;return t.roles.length?e("div",{staticClass:"role-display"},[t.roles.length>1?[e("el-popover",{attrs:{placement:"bottom-start",trigger:"hover"}},[e("ul",{staticClass:"tag-list"},t._l(t.roles.slice(1),(function(s){return e("li",{key:s},[e("el-tag",{attrs:{size:"mini"}},[t._v(t._s(s))])],1)})),0),e("el-badge",{attrs:{slot:"reference",value:t.getRoleNum(),type:"primary"},slot:"reference"},[e("el-tag",{attrs:{size:"mini"}},[t._v(t._s(t.roles[0]||""))])],1)],1)]:e("el-tag",{attrs:{size:"mini"}},[t._v(t._s(t.roles[0]||""))])],2):t._e()},a=[],r={props:{roles:{type:Array,default:()=>[]}},components:{},data(){return{}},computed:{},watch:{},created(){},mounted(){},methods:{getRoleNum(){const t=this.roles.length-1;return t||""}}},n=r,l=(s("01a1"),s("2877")),c=Object(l["a"])(n,i,a,!1,null,"7d8afd7f",null);e["a"]=c.exports}}]);