From 6960025447eb3abaa9c1995ae11b61ba6b955b5f Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Mon, 11 Nov 2024 17:31:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=AD=A3=20#7883?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/services/model/doris/doris-detail.ts | 25 +++++++++++++++++++ .../src/services/model/doris/doris.ts | 6 ++--- dbm-ui/frontend/src/services/model/es/es.ts | 2 +- .../frontend/src/services/model/hdfs/hdfs.ts | 2 +- .../src/services/model/kafka/kafka.ts | 2 +- dbm-ui/frontend/src/services/source/doris.ts | 3 ++- .../components/detail/components/BaseInfo.vue | 4 +-- .../detail/components/node-list/Index.vue | 4 +-- 8 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 dbm-ui/frontend/src/services/model/doris/doris-detail.ts diff --git a/dbm-ui/frontend/src/services/model/doris/doris-detail.ts b/dbm-ui/frontend/src/services/model/doris/doris-detail.ts new file mode 100644 index 0000000000..39d6ea003a --- /dev/null +++ b/dbm-ui/frontend/src/services/model/doris/doris-detail.ts @@ -0,0 +1,25 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + * the specific language governing permissions and limitations under the License. + */ + +import ClusterEntryDetailModel from '@services/model/cluster-entry/cluster-entry-details'; + +import DorisModel from './doris'; + +export default class DorisDetail extends DorisModel { + cluster_entry_details: ClusterEntryDetailModel[]; + + constructor(payload = {} as DorisDetail) { + super(payload); + this.cluster_entry_details = payload.cluster_entry_details.map((item) => new ClusterEntryDetailModel(item)); + } +} diff --git a/dbm-ui/frontend/src/services/model/doris/doris.ts b/dbm-ui/frontend/src/services/model/doris/doris.ts index 9527fb37db..90bc24a545 100644 --- a/dbm-ui/frontend/src/services/model/doris/doris.ts +++ b/dbm-ui/frontend/src/services/model/doris/doris.ts @@ -13,7 +13,7 @@ import { uniq } from 'lodash'; -import type { ClusterEntryDetail, ClusterListNode, ClusterListOperation } from '@services/types'; +import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types'; import { TicketTypes } from '@common/const'; @@ -60,7 +60,7 @@ export default class Doris { bk_cloud_name: string; cluster_access_port: number; cluster_alias: string; - cluster_entry_details: ClusterEntryDetail[]; + cluster_entry: ClusterListEntry[]; cluster_name: string; cluster_stats: Record<'used' | 'total' | 'in_use', number>; cluster_time_zone: string; @@ -101,7 +101,7 @@ export default class Doris { this.bk_cloud_name = payload.bk_cloud_name; this.cluster_access_port = payload.cluster_access_port; this.cluster_alias = payload.cluster_alias; - this.cluster_entry_details = payload.cluster_entry_details; + this.cluster_entry = payload.cluster_entry; this.cluster_name = payload.cluster_name; this.cluster_stats = payload.cluster_stats || {}; this.cluster_type = payload.cluster_type; diff --git a/dbm-ui/frontend/src/services/model/es/es.ts b/dbm-ui/frontend/src/services/model/es/es.ts index 9eec1fd5a2..921baad7ee 100644 --- a/dbm-ui/frontend/src/services/model/es/es.ts +++ b/dbm-ui/frontend/src/services/model/es/es.ts @@ -57,7 +57,7 @@ export default class Es { bk_cloud_name: string; cluster_access_port: number; cluster_alias: string; - cluster_entry: ClusterListEntry; + cluster_entry: ClusterListEntry[]; cluster_name: string; cluster_stats: Record<'used' | 'total' | 'in_use', number>; cluster_time_zone: string; diff --git a/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts b/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts index b80e7cdf02..a6b4761b95 100644 --- a/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts +++ b/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts @@ -57,7 +57,7 @@ export default class Hdfs { bk_cloud_name: string; cluster_access_port: number; cluster_alias: string; - cluster_entry: ClusterListEntry; + cluster_entry: ClusterListEntry[]; cluster_name: string; cluster_stats: Record<'used' | 'total' | 'in_use', number>; cluster_time_zone: string; diff --git a/dbm-ui/frontend/src/services/model/kafka/kafka.ts b/dbm-ui/frontend/src/services/model/kafka/kafka.ts index 9d243639d9..b88e091e3c 100644 --- a/dbm-ui/frontend/src/services/model/kafka/kafka.ts +++ b/dbm-ui/frontend/src/services/model/kafka/kafka.ts @@ -58,7 +58,7 @@ export default class Kafka { broker: Array; cluster_access_port: number; cluster_alias: string; - cluster_entry: ClusterListEntry; + cluster_entry: ClusterListEntry[]; cluster_name: string; cluster_stats: Record<'used' | 'total' | 'in_use', number>; cluster_time_zone: string; diff --git a/dbm-ui/frontend/src/services/source/doris.ts b/dbm-ui/frontend/src/services/source/doris.ts index 6ef89532bb..c64f58536e 100644 --- a/dbm-ui/frontend/src/services/source/doris.ts +++ b/dbm-ui/frontend/src/services/source/doris.ts @@ -12,6 +12,7 @@ */ import DorisModel from '@services/model/doris/doris'; +import DorisDetailModel from '@services/model/doris/doris-detail'; import DorisInstanceModel from '@services/model/doris/doris-instance'; import DorisMachineModel from '@services/model/doris/doris-machine'; import DorisNodeModel from '@services/model/doris/doris-node'; @@ -84,7 +85,7 @@ export function retrieveDorisInstance(params: { bk_biz_id: number }) { * 获取集群详情 */ export function getDorisDetail(params: { id: number }) { - return http.get(`${getRootPath()}/${params.id}/`).then((data) => new DorisModel(data)); + return http.get(`${getRootPath()}/${params.id}/`).then((data) => new DorisDetailModel(data)); } /** diff --git a/dbm-ui/frontend/src/views/db-manage/doris/list/components/detail/components/BaseInfo.vue b/dbm-ui/frontend/src/views/db-manage/doris/list/components/detail/components/BaseInfo.vue index 60c1cef811..afe9419723 100644 --- a/dbm-ui/frontend/src/views/db-manage/doris/list/components/detail/components/BaseInfo.vue +++ b/dbm-ui/frontend/src/views/db-manage/doris/list/components/detail/components/BaseInfo.vue @@ -17,12 +17,12 @@