Skip to content

Commit

Permalink
fix(frontend): tendbCluster、doris的tab缺失 TencentBlueKing#8175
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 26209
  • Loading branch information
royalpioneer committed Dec 9, 2024
1 parent a5e8e6b commit 1959524
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 118 deletions.
33 changes: 13 additions & 20 deletions dbm-ui/frontend/src/common/const/clusterTypeInfos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,19 @@ const bigdata: InfoType = {
name: t('冷_热节点规格'),
},
],
[ClusterTypes.DORIS]: {
id: ClusterTypes.DORIS,
name: 'Doris',
dbType: DBTypes.DORIS,
moduleId: 'bigdata',
machineList: [
{
id: MachineTypes.DORIS_FOLLOWER,
name: t('Follower节点规格'),
},
{
id: MachineTypes.DORIS_OBSERVER,
name: t('Observer节点规格'),
},
{
id: MachineTypes.DORIS_BACKEND,
name: t('冷_热节点规格'),
},
],
},
},
[ClusterTypes.RIAK]: {
id: ClusterTypes.RIAK,
name: 'riak',
specClusterName: 'riak',
dbType: DBTypes.RIAK,
moduleId: 'bigdata',
machineList: [
{
id: MachineTypes.RIAK,
name: t('后端存储'),
},
],
},
};

Expand Down
12 changes: 4 additions & 8 deletions dbm-ui/frontend/src/common/const/clusterTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,21 @@ export enum ClusterTypes {
TENDIS_PLUS_CLUSTER = 'TendisplusCluster', // TendisplusCluster集群
DBMON = 'dbmon', // redis监控
}
// bigdata

export enum ClusterTypes {
// bigdata
ES = 'es',
KAFKA = 'kafka',
HDFS = 'hdfs',
INFLUXDB = 'influxdb',
PULSAR = 'pulsar',
RIAK = 'riak',
DORIS = 'doris',
}
// mongo
export enum ClusterTypes {
// mongo
MONGO_REPLICA_SET = 'MongoReplicaSet', // Mongo副本集群
MONGO_SHARED_CLUSTER = 'MongoShardedCluster', // Mongo分片集群
MONGODB = 'mongodb',
}
// sqlserver
export enum ClusterTypes {
SQLSERVER = 'sqlserver',
// sqlserver
SQLSERVER_SINGLE = 'sqlserver_single', // SQLServer单节点版
SQLSERVER_HA = 'sqlserver_ha', // SQLServer主从版
}
Expand Down
121 changes: 53 additions & 68 deletions dbm-ui/frontend/src/common/const/machineTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,58 @@
* 机器类型
*/

// mysql
export enum MachineTypes {
MYSQL_PROXY = 'proxy', // Proxy
MYSQL_BACKEND = 'backend', // 后端存储
// SINGLE = 'single',
}
// spider
export enum MachineTypes {
// SPIDER = 'spider',
// REMOTE = 'remote',
TENDBCLUSTER_PROXY = 'proxy', // 接入层Master
TENDBCLUSTER_BACKEND = 'backend', // 后端存储
}
// redis
export enum MachineTypes {
REDIS_PROXY = 'proxy',
REDIS_TENDIS_CACHE = 'TwemproxyRedisInstance', // TendisCache后端存储
REDIS_TENDIS_SSD = 'TwemproxyTendisSSDInstance', // TendisSSD后端存储
REDIS_TENDIS_PLUS = 'PredixyTendisplusCluster', // TendisPlus后端存储
REDIS_CLUSTER = 'PredixyRedisCluster', // RedisCluster
REDIS_INSTANCE = 'RedisInstance', // Redis主从
}
// mongodb
export enum MachineTypes {
MONGOS = 'mongos', // Mongos
MONGODB = 'mongodb', // 副本集/ShardSvr
MONGO_CONFIG = 'mongo_config', // ConfigSvr
}
// sqlserver
export enum MachineTypes {
// SQLSERVER_HA = 'sqlserver_ha',
// SQLSERVER_SINGLE = 'sqlserver_single',
SQLSERVER = 'sqlserver', // 后端存储
}
// kafka
export enum MachineTypes {
KAFKA_BROKER = 'broker', // Broker节点
KAFKA_ZOOKEEPER = 'zookeeper', // Zookeeper节点
}
// es
export enum MachineTypes {
ES_DATANODE = 'es_datanode', // 冷/热节点
ES_MASTER = 'es_master', // Master节点
ES_CLIENT = 'es_client', // Client节点
}
// hdfs
export enum MachineTypes {
HDFS_MASTER = 'hdfs_master', // NameNode/Zookeeper/JournalNode节点
HDFS_DATANODE = 'hdfs_datanode', // DataNode节点
}
// pulsar
export enum MachineTypes {
PULSAR_BROKER = 'pulsar_broker', // Broker节点
PULSAR_BOOKKEEPER = 'pulsar_bookkeeper', // Bookkeeper节点
PULSAR_ZOOKEEPER = 'pulsar_zookeeper', // Zookeeper节点
}
// influxdb
export enum MachineTypes {
INFLUXDB = 'influxdb', // 后端存储
}
// riak
export enum MachineTypes {
RIAK = 'riak', // 后端存储
}
// doris
export enum MachineTypes {
DORIS_FOLLOWER = 'doris_follower', // Follower节点
DORIS_OBSERVER = 'doris_observer', // Observer节点
DORIS_BACKEND = 'doris_backend', // 冷/热节点
// mysql
BACKEND = 'backend',
PROXY = 'proxy',
SINGLE = 'single',

// spider
SPIDER = 'spider',
REMOTE = 'remote',

// redis
TENDISCACHE = 'tendiscache',
TENDISSSD = 'tendisssd',
TENDISPLUS = 'tendisplus',
TWEMPROXY = 'twemproxy',
PREDIXY = 'predixy',

// mongodb
MONGOS = 'mongos',
MONGODB = 'mongodb',
MONGO_CONFIG = 'mongo_config',

// sqlserver
SQLSERVER_HA = 'sqlserver_ha',
SQLSERVER_SINGLE = 'sqlserver_single',

// kafka
BROKER = 'broker',
ZOOKEEPER = 'zookeeper',

// es
ES_DATANODE = 'es_datanode',
ES_MASTER = 'es_master',
ES_CLIENT = 'es_client',

// hdfs
HDFS_MASTER = 'hdfs_master',
HDFS_DATANODE = 'hdfs_datanode',

// pulsar
PULSAR_BROKER = 'pulsar_broker',
PULSAR_BOOKKEEPER = 'pulsar_bookkeeper',
PULSAR_ZOOKEEPER = 'pulsar_zookeeper',

// doris
DORIS_FOLLOWER = 'doris_follower',
DORIS_OBSERVER = 'doris_observer',
DORIS_BACKEND = 'doris_backend',

// influxdb
INFLUXDB = 'influxdb',

// riak
RIAK = 'riak',
}
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/components/editable-info/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
v-overflow-tips
class="base-info__value text-overflow">
<Component
:is="config.render"
:is="config.render(data)"
v-if="config.render" />
<template v-else>{{ data[config.key] || '--' }}</template>
</span>
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3677,7 +3677,6 @@
"不允许使用特殊账号名称n": "不允许使用特殊账号名称 {n}",
"密码不符合要求": "密码不符合要求",
"错误日志": "错误日志",
"实际内存分配比率": "实际内存分配比率",
"迁移提交成功": "迁移提交成功",
"集群架构:将集群的部分实例迁移到新机器,迁移保持规格、版本不变;主从架构:主从实例成对迁移到新机器上,可选择部分实例迁移,也可整机所有实例一起迁移。": "集群架构:将集群的部分实例迁移到新机器,迁移保持规格、版本不变;主从架构:主从实例成对迁移到新机器上,可选择部分实例迁移,也可整机所有实例一起迁移。",
"迁移": "迁移",
Expand Down Expand Up @@ -3706,6 +3705,7 @@
"请输入访问DB名_以字母开头_支持字母_数字_下划线_多个使用英文逗号_分号或换行分隔": "请输入访问DB名,以字母开头,支持字母,数字,下划线。多个使用英文逗号、分号或换行分隔",
"单据协助设置": "单据协助设置",
"主域名,从域名,单节点必须分开查询": "主域名,从域名,单节点必须分开查询",
"实际内存分配比率": "实际内存分配比率",
"这行勿动!新增翻译请在上一行添加!": ""

}
3 changes: 3 additions & 0 deletions dbm-ui/frontend/src/views/db-configure/business/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
if (!route.query.form) {
router.push({
name: 'DbConfigureList',
params: {
clusterType: props.clusterType,
},
});
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@
type: ticketTypeMap[clusterType.value],
bk_biz_id: window.PROJECT_CONFIG.BIZ_ID,
},
query: {
from: String(route.name),
clusterType: clusterType.value,
},
});
} else if ([ClusterTypes.SQLSERVER_SINGLE, ClusterTypes.SQLSERVER_HA].includes(clusterType.value)) {
router.push({
Expand All @@ -205,13 +209,21 @@
ticketType: ticketTypeMap[clusterType.value],
bizId: window.PROJECT_CONFIG.BIZ_ID,
},
query: {
from: String(route.name),
clusterType: clusterType.value,
},
});
} else {
router.push({
name: 'createSpiderModule',
params: {
bizId: window.PROJECT_CONFIG.BIZ_ID,
},
query: {
from: String(route.name),
clusterType: clusterType.value,
},
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ import { notModuleClusters } from '@views/db-configure/common/const';

import type { TreeData } from '../types';

type LevelConfigDetail = ServiceReturnType<typeof getLevelConfig> & { charset?: string };

interface State {
loading: boolean;
loadingDetails: boolean;
isEmpty: boolean;
version: string;
data: ServiceReturnType<typeof getLevelConfig> & { charset?: string };
data: LevelConfigDetail;
deployInfo: LevelConfigDetail;
}
/**
* 获取参数管理基本信息
*/
export const useBaseDetails = (immediateFetch = true) => {
export const useBaseDetails = (immediateFetch = true, confName = 'db_version') => {
const getFetchParams = (versionKey: 'version' | 'proxy_version', confType = 'dbconf') => {
if (treeNode === undefined) {
return {} as ServiceParameters<typeof getLevelConfig>;
Expand Down Expand Up @@ -77,6 +80,13 @@ export const useBaseDetails = (immediateFetch = true) => {
description: '',
charset: '',
},
deployInfo: {
conf_items: [],
version: '',
name: '',
description: '',
charset: '',
},
});

const fetchParams = computed(() => getFetchParams('version'));
Expand Down Expand Up @@ -113,9 +123,10 @@ export const useBaseDetails = (immediateFetch = true) => {

state.loading = true;
getLevelConfig(params)
.then((res) => {
res.conf_items.forEach((item) => {
if (item.conf_name === 'db_version') {
.then((result) => {
state.deployInfo = result;
result.conf_items.forEach((item) => {
if (item.conf_name === confName) {
state.version = item.conf_value ?? '';
} else if (item.conf_name === 'charset') {
state.data.charset = item.conf_value ?? '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<DetailsBase
class="config-details-content"
:data="data"
:deploy-info="deployInfo"
:fetch-params="fetchParams"
:level="ConfLevels.MODULE"
:loading="false"
Expand All @@ -38,20 +39,24 @@
import DetailsBase from '@views/db-configure/components/DetailsBase.vue';

type PlatConfDetailsParams = ServiceParameters<typeof getConfigBaseDetails>;
type DetailData = ServiceReturnType<typeof getLevelConfig>;

interface Props {
data?: ServiceReturnType<typeof getLevelConfig>;
data?: Partial<DetailData>;
deployInfo?: Partial<DetailData>;
loading?: boolean;
fetchParams?: PlatConfDetailsParams | ServiceParameters<typeof getLevelConfig>;
}

const props = withDefaults(defineProps<Props>(), {
data: () =>
({
conf_items: [] as NonNullable<Props['data']>['conf_items'],
}) as NonNullable<Props['data']>,
data: () => ({
conf_items: [] as DetailData['conf_items'],
}),
loading: false,
fetchParams: () => ({}) as PlatConfDetailsParams,
deployInfo: () => ({
conf_items: [] as DetailData['conf_items'],
}),
});

const route = useRoute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<template v-if="tab.name !== 'publish' && configParams !== null">
<ConfigDetails
:data="state.data"
:deploy-info="state.deployInfo"
:fetch-params="configParams"
:loading="state.loadingDetails" />
</template>
Expand Down
Loading

0 comments on commit 1959524

Please sign in to comment.