Skip to content

Commit

Permalink
fix(frontend): 大数据类型修正 TencentBlueKing#7883
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Nov 11, 2024
1 parent e5403f7 commit 32cd767
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 11 deletions.
25 changes: 25 additions & 0 deletions dbm-ui/frontend/src/services/model/doris/doris-detail.ts
Original file line number Diff line number Diff line change
@@ -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));
}
}
6 changes: 3 additions & 3 deletions dbm-ui/frontend/src/services/model/doris/doris.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/services/model/es/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/services/model/hdfs/hdfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/services/model/kafka/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Kafka {
broker: Array<ClusterListNode>;
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;
Expand Down
3 changes: 2 additions & 1 deletion dbm-ui/frontend/src/services/source/doris.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -84,7 +85,7 @@ export function retrieveDorisInstance(params: { bk_biz_id: number }) {
* 获取集群详情
*/
export function getDorisDetail(params: { id: number }) {
return http.get<DorisModel>(`${getRootPath()}/${params.id}/`).then((data) => new DorisModel(data));
return http.get<DorisDetailModel>(`${getRootPath()}/${params.id}/`).then((data) => new DorisDetailModel(data));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
</div>
</template>
<script setup lang="ts">
import DorisModel from '@services/model/doris/doris';
import DorisDetailModel from '@services/model/doris/doris-detail';
import RenderBaseInfo from '@views/db-manage/common/RenderBaseInfo.vue';
interface Props {
data: DorisModel;
data: DorisDetailModel;
}
defineProps<Props>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<script setup lang="tsx">
import { useI18n } from 'vue-i18n';
import DorisModel from '@services/model/doris/doris';
import DorisDetailModel from '@services/model/doris/doris-detail';
import DorisNodeModel from '@services/model/doris/doris-node';
import {
getDorisDetail,
Expand Down Expand Up @@ -280,7 +280,7 @@
const isShowDetail = ref(false);
const isLoading = ref(true);
const isCopyDropdown = ref(false);
const operationData = shallowRef<DorisModel>();
const operationData = shallowRef<DorisDetailModel>();
const operationNodeData = shallowRef<DorisNodeModel>();
const operationNodeList = shallowRef<Array<DorisNodeModel>>([]);
const tableData = shallowRef<DorisNodeModel[]>([]);
Expand Down

0 comments on commit 32cd767

Please sign in to comment.