From 90f35577f20a71e60634cd5e1cda7a402fb8f109 Mon Sep 17 00:00:00 2001 From: ielgnaw Date: Fri, 21 May 2021 15:34:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20mesos=20cluster=20metrics/overview?= =?UTF-8?q?=20=E8=AF=B7=E6=B1=82=20(#939)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bcs-app/frontend/src/views/cluster/index.vue | 76 +++------ .../src/views/cluster/status-progress.vue | 156 +++++++++++------- 2 files changed, 126 insertions(+), 106 deletions(-) diff --git a/bcs-app/frontend/src/views/cluster/index.vue b/bcs-app/frontend/src/views/cluster/index.vue index 5fdf7a915..8f5b6a1ea 100644 --- a/bcs-app/frontend/src/views/cluster/index.vue +++ b/bcs-app/frontend/src/views/cluster/index.vue @@ -209,53 +209,6 @@ :cur-project="curProject" :cur-cluster="cluster"> -
-
-
- {{$t('集群IP')}} - - {{curCluster.ip_resource_total === 0 ? 0 : `${curCluster.ip_resource_used} / ${curCluster.ip_resource_total}`}} - -
-
-
-
-
-
{{$t('集群IP')}} From f775d6f02e8da950b1d38008d9b4a73358480f69 Mon Sep 17 00:00:00 2001 From: hito <1214105385@qq.com> Date: Wed, 26 May 2021 11:18:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E8=8A=82=E7=82=B9=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=85=BC=E5=AE=B9=E5=A4=84=E7=90=86=20(#945)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/cluster/searcher/index.vue | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/bcs-app/frontend/src/views/cluster/searcher/index.vue b/bcs-app/frontend/src/views/cluster/searcher/index.vue index 1d7c8b880..8ac04226d 100644 --- a/bcs-app/frontend/src/views/cluster/searcher/index.vue +++ b/bcs-app/frontend/src/views/cluster/searcher/index.vue @@ -217,7 +217,16 @@ statusList: [ { text: this.$t('正常'), value: ['normal'] }, { text: this.$t('不可调度'), value: ['to_removed', 'removable'] } - ] + ], + mesosLabelMap: {} + } + }, + computed: { + curProject () { + return this.$store.state.curProject + }, + isMesosProject () { + return this.curProject.kind === window.PROJECT_MESOS } }, watch: { @@ -302,12 +311,15 @@ this.showKey = true this.tagLoading = true try { - const res = await this.$store.dispatch('cluster/getNodeKeyList', { + const api = this.isMesosProject ? 'cluster/getMesosNodeLabels' : 'cluster/getNodeKeyList' + const res = await this.$store.dispatch(api, { projectId: this.projectId, clusterId: this.clusterId }) - this.keyList.splice(0, this.keyList.length, ...(res.data || [])) - this.keyListTmp.splice(0, this.keyList.length, ...(res.data || [])) + const keyList = this.isMesosProject ? Object.keys(res.data || {}) : res.data || [] + this.isMesosProject && (this.mesosLabelMap = res.data || {}) + this.keyList.splice(0, this.keyList.length, ...keyList) + this.keyListTmp.splice(0, this.keyList.length, ...keyList) this.$nextTick(() => { this.$refs.searchInput.focus() this.isListeningInputKeyup = true @@ -366,13 +378,19 @@ this.tagLoading = true this.curInputValue = '' this.inputPlaceholder = this.$t('请输入要搜索的value') - const res = await this.$store.dispatch('cluster/getNodeValueListByKey', { - projectId: this.projectId, - clusterId: this.clusterId, - keyName: k - }) - this.valueList.splice(0, this.valueList.length, ...(res.data || [])) - this.valueListTmp.splice(0, this.valueList.length, ...(res.data || [])) + let valueList = [] + if (this.isMesosProject) { + valueList = this.mesosLabelMap[k] || [] + } else { + const res = await this.$store.dispatch('cluster/getNodeValueListByKey', { + projectId: this.projectId, + clusterId: this.clusterId, + keyName: k + }) + valueList = res.data || [] + } + this.valueList.splice(0, this.valueList.length, ...valueList) + this.valueListTmp.splice(0, this.valueList.length, ...valueList) this.$refs.searchInput.focus() } catch (e) { catchErrorHandler(e, this)