diff --git a/dbm-ui/frontend/src/common/const/clusterTypeInfos.ts b/dbm-ui/frontend/src/common/const/clusterTypeInfos.ts index ef05a51738..2e34f23728 100644 --- a/dbm-ui/frontend/src/common/const/clusterTypeInfos.ts +++ b/dbm-ui/frontend/src/common/const/clusterTypeInfos.ts @@ -314,7 +314,7 @@ const mongodb: InfoType = { }, [ClusterTypes.MONGO_SHARED_CLUSTER]: { id: ClusterTypes.MONGO_SHARED_CLUSTER, - name: t('Mongo分片集'), + name: t('Mongo 分片集群'), specClusterName: 'MongoDB', dbType: DBTypes.MONGODB, moduleId: 'mongodb', diff --git a/dbm-ui/frontend/src/components/cluster-selector/Index.vue b/dbm-ui/frontend/src/components/cluster-selector/Index.vue index 501c141a95..f6dbe5ca12 100644 --- a/dbm-ui/frontend/src/components/cluster-selector/Index.vue +++ b/dbm-ui/frontend/src/components/cluster-selector/Index.vue @@ -322,7 +322,7 @@ }, [ClusterTypes.MONGO_REPLICA_SET]: { id: ClusterTypes.MONGO_REPLICA_SET, - name: t('集群选择'), + name: t('副本集'), disabledRowConfig: [ { handler: (data: T) => data.isOffline, @@ -336,7 +336,7 @@ }, [ClusterTypes.MONGO_SHARED_CLUSTER]: { id: ClusterTypes.MONGO_SHARED_CLUSTER, - name: t('集群选择'), + name: t('分片集群'), disabledRowConfig: [ { handler: (data: T) => data.isOffline, diff --git a/dbm-ui/frontend/src/components/instance-selector/Index.vue b/dbm-ui/frontend/src/components/instance-selector/Index.vue index b796d43911..2025de3ed5 100644 --- a/dbm-ui/frontend/src/components/instance-selector/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/Index.vue @@ -50,6 +50,7 @@ :is-remote-pagination="activePanelObj?.tableConfig?.isRemotePagination" :last-values="lastValues" :manual-config="activePanelObj?.manualConfig" + :multiple="activePanelObj?.tableConfig?.multiple" :role-filter-list="activePanelObj?.tableConfig?.roleFilterList" :status-filter="activePanelObj?.tableConfig?.statusFilter" :table-setting="tableSettings" @@ -146,6 +147,7 @@ spec_config?: TendbclusterMachineModel['spec_config']; spec_id?: number; role: string; + shard?: string; } export type InstanceSelectorValues = Record; diff --git a/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/Index.vue b/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/Index.vue index 9abccb6219..ab5ac70c01 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/Index.vue @@ -39,6 +39,8 @@ import type { Ref } from 'vue'; import { useI18n } from 'vue-i18n'; + import { ClusterTypes } from '@common/const'; + import DbStatus from '@components/db-status/index.vue'; import type { InstanceSelectorValues, @@ -63,7 +65,7 @@ manualTableData?: DataRow[]; isRemotePagination?: TableConfigType['isRemotePagination'], firsrColumn?: TableConfigType['firsrColumn'], - roleFilterList?: TableConfigType['roleFilterList'], + // roleFilterList?: TableConfigType['roleFilterList'], disabledRowConfig?: TableConfigType['disabledRowConfig'], multiple: boolean, getTableList: NonNullable, @@ -94,6 +96,7 @@ const checkedMap = shallowRef({} as DataRow); + const initRole = computed(() => props.firsrColumn?.role); const selectClusterId = computed(() => props.clusterId); const firstColumnFieldId = computed(() => (props.firsrColumn?.field || 'instance_address') as keyof IValue); const mainSelectDisable = computed(() => (props.disabledRowConfig @@ -109,7 +112,7 @@ fetchResources, handleChangePage, handeChangeLimit, - } = useTableData(selectClusterId); + } = useTableData(selectClusterId, initRole); const renderManualData = computed(() => { if (searchValue.value === '') { @@ -192,11 +195,31 @@ label: props.firsrColumn?.label ? props.firsrColumn.label : t('实例'), field: props.firsrColumn?.field ? props.firsrColumn.field : 'instance_address', }, + // { + // label: t('角色'), + // field: 'role', + // showOverflowTooltip: true, + // filter: props.roleFilterList, + // }, { label: t('角色'), field: 'role', + minWidth: 160, showOverflowTooltip: true, - filter: props.roleFilterList, + rowspan: ({ row }: { row: DataRow }) => { + if (row.machine_type === 'mongodb') { + const rowSpan = tableData.value.filter((item) => item.master_domain === row.master_domain && item.machine_type === row.machine_type && item.shard === row.shard).length; + return rowSpan > 1 ? rowSpan : 1; + } + const rowSpan = tableData.value.filter((item) => item.master_domain === row.master_domain && item.machine_type === row.machine_type).length; + return rowSpan > 1 ? rowSpan : 1; + }, + render: ({ row }: { row: DataRow }) => { + if (row.cluster_type === ClusterTypes.MONGO_SHARED_CLUSTER && row.machine_type === 'mongodb') { + return row.shard + } + return row.machine_type + } }, { label: t('实例状态'), diff --git a/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/useTableData.ts b/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/useTableData.ts index 623c341ddf..0f6c343eae 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/useTableData.ts +++ b/dbm-ui/frontend/src/components/instance-selector/components/mongo/table/useTableData.ts @@ -19,7 +19,7 @@ import { useGlobalBizs } from '@stores'; /** * 处理集群列表数据 */ -export function useTableData(clusterId?: Ref) { +export function useTableData(clusterId?: Ref, role?: Ref) { const { currentBizId } = useGlobalBizs(); const currentInstance = getCurrentInstance() as ComponentInternalInstance & { proxy: { @@ -72,6 +72,11 @@ export function useTableData(clusterId?: Ref) { cluster_id: clusterId.value, }); } + if (role?.value) { + Object.assign(params, { + role: role.value, + }); + } return params; }; diff --git a/dbm-ui/frontend/src/components/render-table/columns/role-host-select/Index.vue b/dbm-ui/frontend/src/components/render-table/columns/role-host-select/Index.vue index 7a31dd1f2b..8f8391663c 100644 --- a/dbm-ui/frontend/src/components/render-table/columns/role-host-select/Index.vue +++ b/dbm-ui/frontend/src/components/render-table/columns/role-host-select/Index.vue @@ -79,7 +79,7 @@ clusterId: number; hostSelectType?: string; }; - clusterType: ClusterTypes | 'TendbClusterHost'; + clusterType: ClusterTypes | 'TendbClusterHost' | 'mongoCluster'; tabListConfig: ComponentProps['tabListConfig']; selectedNodeList?: IValue[]; count?: number; diff --git a/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue b/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue index 365c32d91a..cd754dca9c 100644 --- a/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue +++ b/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue @@ -30,6 +30,7 @@ :max-data="single ? 1 : -1" :paste-fn="tagInputPasteFn" :placeholder="placeholder" + @blur="handleBlur" @change="handleChange" @focus="handleFocus" />
{ isFocus.value = true; + emits('focus'); + }; + + const handleBlur = () => { + emits('blur'); }; onMounted(() => { diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 06a40ca3c8..7334a15782 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3607,5 +3607,31 @@ "批量录入:按行录入,快速批量输入多个单元格的值": "批量录入:按行录入,快速批量输入多个单元格的值", "高可用": "高可用", "关联实例": "关联实例", + "Mongo 分片集群": "Mongo 分片集群", + "不允许输入系统库和特殊库,如admin、config、local": "不允许输入系统库和特殊库,如admin、config、local", + "DB名、表名不允许为空,忽略DB名、忽略表名要么同时为空, 要么同时不为空": "DB名、表名不允许为空,忽略DB名、忽略表名要么同时为空, 要么同时不为空", + "支持通配符 *(指代任意长度字符串)": "支持通配符 *(指代任意长度字符串)", + "库表名支持数字、字母、中划线、下划线,最大64字符": "库表名支持数字、字母、中划线、下划线,最大64字符", + "请输入表名称,支持通配符“*”": "请输入表名称,支持通配符“*”", + "请输入DB 名称,支持通配符“*”": "请输入DB 名称,支持通配符“*”", + "连接字符串": "连接字符串", + "连接字符串(CLB)": "连接字符串(CLB)", + "复制xxx": "复制{0}", + "是否备份 Oplog": "是否备份 Oplog", + "缩容接入层:减加集群的Proxy数量,但集群Proxy数量不能少于2": "缩容接入层:减加集群的Proxy数量,但集群Proxy数量不能少于2", + "Mongo 主机": "Mongo 主机", + "机器类型": "机器类型", + "Proxy数量不足,至少 2 台": "Proxy数量不足,至少 2 台", + "忽略DB名、忽略表名要么同时为空, 要么同时不为空": "忽略DB名、忽略表名要么同时为空, 要么同时不为空", + "至多n台": "至多n台", + "同一个副本集,一次只能替换一个节点": "同一个副本集,一次只能替换一个节点", + "同一个分片集群,config一次只能替换一个节点": "同一个分片集群,config一次只能替换一个节点", + "config一次只能替换一个节点": "config一次只能替换一个节点", + "同一个shard,同时只能替换一个节点": "同一个shard,同时只能替换一个节点", + "扩容数量(台)": "扩容数量(台)", + "缩容数量(台)": "缩容数量(台)", + "ShardSvr 名称": "ShardSvr 名称", + "回档至指定时间": "回档至指定时间", + "待替换的主机 ": "待替换的主机", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/services/model/mongodb/mongodb-detail.ts b/dbm-ui/frontend/src/services/model/mongodb/mongodb-detail.ts index fcad59c3ff..ab55dde04b 100644 --- a/dbm-ui/frontend/src/services/model/mongodb/mongodb-detail.ts +++ b/dbm-ui/frontend/src/services/model/mongodb/mongodb-detail.ts @@ -324,4 +324,38 @@ export default class MongodbDetail { get createAtDisplay() { return utcDisplayTime(this.create_at); } + + get isMongoReplicaSet() { + return this.cluster_type === 'MongoReplicaSet'; + } + + get entryDomain() { + if (this.isMongoReplicaSet) { + const domainList = this.cluster_entry.reduce((prevDomainList, entryItem) => { + if (!entryItem.entry.includes('backup')) { + return prevDomainList.concat(`${entryItem.entry}:${this.cluster_access_port}`); + } + return prevDomainList; + }, []); + return domainList.join(','); + } + return `${this.master_domain}:${this.cluster_access_port}`; + } + + get entryAccess() { + if (this.isMongoReplicaSet) { + return `mongodb://{username}:{password}@${this.entryDomain}/?replicaSet=${this.cluster_name}&authSource=admin`; + } + return `mongodb://{username}:{password}@${this.entryDomain}/?authSource=admin`; + } + + get entryAccessClb() { + if (!this.isMongoReplicaSet) { + const clbItem = this.cluster_entry.find((entryItem) => entryItem.cluster_entry_type === 'clbDns'); + if (clbItem) { + return `mongodb://{username}:{password}@${clbItem.entry}:${this.cluster_access_port}/?authSource=admin`; + } + } + return ''; + } } diff --git a/dbm-ui/frontend/src/services/model/mongodb/mongodb.ts b/dbm-ui/frontend/src/services/model/mongodb/mongodb.ts index b716513cf5..4bf73751c2 100644 --- a/dbm-ui/frontend/src/services/model/mongodb/mongodb.ts +++ b/dbm-ui/frontend/src/services/model/mongodb/mongodb.ts @@ -14,6 +14,8 @@ import dayjs from 'dayjs'; import { uniq } from 'lodash'; +import type { ClusterListEntry } from '@services/types'; + import { PipelineStatus, TicketTypes } from '@common/const'; import { utcDisplayTime } from '@utils'; @@ -81,6 +83,7 @@ export default class Mongodb { bk_cloud_name: string; cluster_access_port: number; cluster_alias: string; + cluster_entry: ClusterListEntry[]; cluster_name: string; cluster_stats: Record<'used' | 'total' | 'in_use', number>; cluster_time_zone: string; @@ -114,6 +117,7 @@ export default class Mongodb { phase_name: string; region: string; replicaset_machine_num: number; + seg_range: Record; slave_domain: string; shard_node_count: number; // 分片节点数 shard_num: number; // 分片数 @@ -135,6 +139,7 @@ export default class Mongodb { this.db_module_name = payload.db_module_name; this.cluster_access_port = payload.cluster_access_port; this.cluster_alias = payload.cluster_alias; + this.cluster_entry = payload.cluster_entry || []; this.disaster_tolerance_level = payload.disaster_tolerance_level; this.cluster_name = payload.cluster_name; this.cluster_stats = payload.cluster_stats || {}; @@ -158,6 +163,7 @@ export default class Mongodb { this.phase_name = payload.phase_name; this.region = payload.region; this.replicaset_machine_num = payload.replicaset_machine_num; + this.seg_range = payload.seg_range; this.slave_domain = payload.slave_domain; this.shard_node_count = payload.shard_node_count; this.shard_num = payload.shard_num; @@ -313,4 +319,51 @@ export default class Mongodb { get updateAtDisplay() { return utcDisplayTime(this.update_at); } + + get entryDomain() { + if (this.isMongoReplicaSet) { + const domainList = this.cluster_entry.reduce((prevDomainList, entryItem) => { + if (!entryItem.entry.includes('backup')) { + return prevDomainList.concat(`${entryItem.entry}:${this.cluster_access_port}`); + } + return prevDomainList; + }, []); + return domainList.join(','); + } + return `${this.master_domain}:${this.cluster_access_port}`; + } + + get entryAccess() { + if (this.isMongoReplicaSet) { + return `mongodb://{username}:{password}@${this.entryDomain}/?replicaSet=${this.cluster_name}&authSource=admin`; + } + return `mongodb://{username}:{password}@${this.entryDomain}/?authSource=admin`; + } + + get entryAccessClb() { + if (!this.isMongoReplicaSet) { + const clbItem = this.cluster_entry.find((entryItem) => entryItem.cluster_entry_type === 'clbDns'); + if (clbItem) { + return `mongodb://{username}:{password}@${clbItem.entry}:${this.cluster_access_port}/?authSource=admin`; + } + } + return ''; + } + + get shardList() { + return Object.entries(this.seg_range).reduce< + { + shardName: string; + instanceList: string[]; + }[] + >((prevList, [shardName, instanceList]) => { + if (!shardName.endsWith('conf')) { + return prevList.concat({ + shardName, + instanceList, + }); + } + return prevList; + }, []); + } } diff --git a/dbm-ui/frontend/src/services/source/mongodb.ts b/dbm-ui/frontend/src/services/source/mongodb.ts index 21757cc471..2d74e075c1 100644 --- a/dbm-ui/frontend/src/services/source/mongodb.ts +++ b/dbm-ui/frontend/src/services/source/mongodb.ts @@ -24,7 +24,7 @@ import http from '../http'; const { currentBizId } = useGlobalBizs(); -const path = `/apis/mongodb/bizs/${currentBizId}/mongodb_resources`; +const getRootPath = () => `/apis/mongodb/bizs/${window.PROJECT_CONFIG.BIZ_ID}/mongodb_resources`; interface RelatedCluster { cluster_id: number; @@ -72,7 +72,7 @@ export function getMongoList(params: { limit?: number; offset?: number; }) { - return http.get>(`${path}/`, params).then((data) => ({ + return http.get>(`${getRootPath()}/`, params).then((data) => ({ ...data, results: data.results.map((item) => new MongodbModel(item)), })); @@ -97,7 +97,7 @@ export function getMongoTopoList(params: { offset?: number; }) { return http - .get>(`${path}/`, params) + .get>(`${getRootPath()}/`, params) .then((data) => data.results.map((item) => new MongodbModel(item))); } @@ -105,21 +105,23 @@ export function getMongoTopoList(params: { * 查询Mongo集群详情 */ export function getMongoClusterDetails(params: { cluster_id: number }) { - return http.get(`${path}/${params.cluster_id}/`).then((data) => new MongodbDetailModel(data)); + return http + .get(`${getRootPath()}/${params.cluster_id}/`) + .then((data) => new MongodbDetailModel(data)); } /** * 查询Mongo拓扑图 */ export function getMongoClustersTopoGraph(params: { cluster_id: number }) { - return http.get(`${path}/${params.cluster_id}/get_topo_graph/`); + return http.get(`${getRootPath()}/${params.cluster_id}/get_topo_graph/`); } /** * 获取Mongo集群 table 信息 */ export function getMongoTableFields(params: { limit?: number; offset?: number }) { - return http.get(`${path}/get_table_fields/`, params); + return http.get(`${getRootPath()}/get_table_fields/`, params); } /** @@ -138,7 +140,7 @@ export function getMongoInstancesList(params: { offset?: number; extra?: number; }) { - return http.get>(`${path}/list_instances/`, params).then((data) => ({ + return http.get>(`${getRootPath()}/list_instances/`, params).then((data) => ({ ...data, results: data.results.map((item) => new MongodbInstanceModel(item)), })); @@ -147,7 +149,7 @@ export function getMongoInstancesList(params: { /** * 查询Mongo集群实例详情 */ -export function getMongoInstanceDetail(params: { +export function retrieveMongoInstanceDetail(params: { instance_address: string; cluster_id?: number; ip?: string; @@ -156,7 +158,7 @@ export function getMongoInstanceDetail(params: { offset?: number; }) { return http - .get(`${path}/retrieve_instance/`, params) + .get(`${getRootPath()}/retrieve_instance/`, params) .then((data) => new MongodbInstanceDetailModel(data)); } @@ -164,7 +166,7 @@ export function getMongoInstanceDetail(params: { * 获取Mongo角色列表 */ export function getMongoRoleList(params: { limit?: number; offset?: number }) { - return http.get(`${path}/get_instance_role/`, params); + return http.get(`${getRootPath()}/get_instance_role/`, params); } /** @@ -174,6 +176,7 @@ export function getMongodbMachineList(params: { bk_host_id?: number; ip?: string; machine_type?: string; + cluster_type?: string; bk_os_name?: string; bk_cloud_id?: number; bk_agent_id?: string; @@ -182,21 +185,21 @@ export function getMongodbMachineList(params: { limit?: number; offset?: number; }) { - return http.get(`${path}/list_machines/`, params); + return http.get(`${getRootPath()}/list_machines/`, params); } /** * 导出Mongo集群数据为 excel 文件 */ export function exportMongodbClusterToExcel(params: { cluster_ids?: number[] }) { - return http.post(`${path}/export_cluster/`, params, { responseType: 'blob' }); + return http.post(`${getRootPath()}/export_cluster/`, params, { responseType: 'blob' }); } /** * 导出Mongo实例数据为 excel 文件 */ export function exportMongodbInstanceToExcel(params: { bk_host_ids?: number[] }) { - return http.post(`${path}/export_instance/`, params, { responseType: 'blob' }); + return http.post(`${getRootPath()}/export_instance/`, params, { responseType: 'blob' }); } /** diff --git a/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/graphData.ts b/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/graphData.ts index e8ccc8ae0e..2536643139 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/graphData.ts +++ b/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/graphData.ts @@ -91,6 +91,11 @@ export const nodeTypes = { TENDBCLUSTER_SLAVE: 'spider_slave', TENDBCLUSTER_CONTROLLER: 'controller_group', TENDBCLUSTER_MNT: 'spider_mnt', + MONGODB_M1: 'mongodb::m1', + MONGODB_M2: 'mongodb::m2', + MONGODB_BACKUP: 'mongodb::backup', + MONGODB_MONGOS: 'mongos', + MONGODB_CONFIG: 'mongo_config::m1', }; // 特殊逻辑:控制节点水平对齐 @@ -102,6 +107,8 @@ const sameSources = [ nodeTypes.PULSAR_BROKER, nodeTypes.TENDBCLUSTER_REMOTE_MASTER, nodeTypes.TENDBCLUSTER_MASTER, + nodeTypes.MONGODB_M1, + nodeTypes.MONGODB_MONGOS, ]; const sameTargets = [ nodeTypes.SLAVE, @@ -111,6 +118,8 @@ const sameTargets = [ nodeTypes.PULSAR_ZOOKEEPER, nodeTypes.TENDBCLUSTER_REMOTE_SLAVE, nodeTypes.TENDBCLUSTER_SLAVE, + nodeTypes.MONGODB_M2, + nodeTypes.MONGODB_CONFIG, ]; export class GraphData { @@ -157,8 +166,8 @@ export class GraphData { const [firstRoot] = rootGroups; this.calcNodeLocations(firstRoot, groups, groupLines); - // es hdfs 集群特殊逻辑 - if (([ClusterTypes.ES, ClusterTypes.HDFS] as string[]).includes(this.clusterType)) { + // es hdfs mongo 集群特殊逻辑 + if (([ClusterTypes.ES, ClusterTypes.HDFS, ClusterTypes.MONGODB] as string[]).includes(this.clusterType)) { this.calcHorizontalAlignLocations(groups); } else if (this.clusterType === ClusterTypes.TENDBCLUSTER) { this.calcSpiderNodeLocations(rootGroups, groups); @@ -171,7 +180,6 @@ export class GraphData { ); this.calcLines(lines, locations); } - this.graphData = { locations, lines, @@ -491,7 +499,7 @@ export class GraphData { } /** - * 单独处理 es master、cold、hot || hdfs hournal、zookeeper、datanode 节点水平排列 + * 单独处理 es master、cold、hot || hdfs hournal、zookeeper、datanode || mongo分片 节点水平排列 * @param nodes 节点列表 */ calcHorizontalAlignLocations(nodes: GraphNode[] = []) { @@ -503,7 +511,7 @@ export class GraphData { nodeTypes.HDFS_MASTER_HOURNALNODE, nodeTypes.HDFS_MASTER_ZOOKEEPER, ]; - const targetNodes = nodes.filter((node) => targetNodeIds.includes(node.id)); + const targetNodes = nodes.filter((node) => targetNodeIds.includes(node.id) || node.id.includes('分片')); const [referenceNode] = targetNodes; const moveNodes = targetNodes.slice(1); diff --git a/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/useRenderGraph.tsx b/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/useRenderGraph.tsx index 00a20cce18..0fba24465c 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/useRenderGraph.tsx +++ b/dbm-ui/frontend/src/views/db-manage/common/cluster-details/common/useRenderGraph.tsx @@ -20,6 +20,7 @@ import { retrieveDorisInstance } from '@services/source/doris'; import { retrieveEsInstance } from '@services/source/es'; import { retrieveHdfsInstance } from '@services/source/hdfs'; import { retrieveKafkaInstance } from '@services/source/kafka'; +import { retrieveMongoInstanceDetail } from '@services/source/mongodb'; import { retrievePulsarInstance } from '@services/source/pulsar'; import { retrieveRedisInstance } from '@services/source/redis'; import { retrieveRiakInstance } from '@services/source/riak'; @@ -170,6 +171,7 @@ const apiMap: Record Promise> = { tendbcluster: getTendbclusterInstanceDetail, riak: retrieveRiakInstance, doris: retrieveDorisInstance, + mongodb: retrieveMongoInstanceDetail, }; const entryTagMap: Record = { diff --git a/dbm-ui/frontend/src/views/db-manage/common/permission/components/mongo/CreateRule.vue b/dbm-ui/frontend/src/views/db-manage/common/permission/components/mongo/CreateRule.vue index c9908f6e4a..5fcaafc303 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/permission/components/mongo/CreateRule.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/permission/components/mongo/CreateRule.vue @@ -335,8 +335,8 @@ .check-all { position: relative; - width: 48px; - margin-right: 48px; + width: 50px; + margin-right: 50px; :deep(.bk-checkbox-label) { font-weight: bold; diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/capacity-change/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/capacity-change/pages/page1/Index.vue index 5ce8304869..38f9c3a94d 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/capacity-change/pages/page1/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/capacity-change/pages/page1/Index.vue @@ -54,14 +54,15 @@ + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/components/CapacityChange.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/components/CapacityChange.vue similarity index 90% rename from dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/components/CapacityChange.vue rename to dbm-ui/frontend/src/views/db-manage/mongodb/components/CapacityChange.vue index 9c994285bb..c84ace185b 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/components/CapacityChange.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/components/CapacityChange.vue @@ -30,6 +30,7 @@ v-model="specInfo" :biz-id="data.bizId" :cloud-id="data.cloudId" + :cluster-type="clusterType" :is-apply="false" :origin-spec-id="originSpecId" :properties="{ @@ -45,16 +46,16 @@ + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/TableName.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/TableName.vue index c1ddd91ebc..23d56bf87f 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/TableName.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/TableName.vue @@ -15,18 +15,44 @@ + @blur="handleBlur" + @change="handleChange" + @focus="handleFocus"> + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Index.vue index a4305552c9..5745b56210 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Index.vue @@ -146,14 +146,14 @@ .render-host-box { position: relative; - :deep(.is-error) { - .error-icon { - top: auto; - top: 50%; - right: auto; - left: 50%; - transform: translate(-50%, -50%); - } - } + // :deep(.is-error) { + // .error-icon { + // top: auto; + // top: 50%; + // right: auto; + // left: 50%; + // transform: translate(-50%, -50%); + // } + // } } diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Input.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Input.vue index 5b1f33b84d..235fe1549c 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Input.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/components/edit-field/clusters-with-selector/Input.vue @@ -376,7 +376,7 @@ .input-error { position: absolute; top: 50%; - left: 50%; + right: 28px; z-index: 99; padding-bottom: 3px; font-size: 14px; diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/db-backup/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/db-backup/pages/page1/Index.vue index 09950c6523..9cee7869b5 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/db-backup/pages/page1/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/db-backup/pages/page1/Index.vue @@ -37,21 +37,27 @@ :model="formData" style="margin-top: 16px"> - {{ t('常规备份(25天)') }} + {{ t('25天') }} + + + {{ t('6个月') }} + + + {{ t('1年') }} - {{ t('长期备份(3年)') }} + {{ t('3年') }} @@ -95,7 +102,6 @@ + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/db-replace/pages/page1/components/Row.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/db-replace/pages/page1/components/Row.vue index a0746e23a5..c4c4a31135 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/db-replace/pages/page1/components/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/db-replace/pages/page1/components/Row.vue @@ -16,12 +16,14 @@ @@ -61,10 +63,11 @@ import { useGlobalBizs } from '@stores'; + import { ClusterTypes } from '@common/const'; + import OperateColumn from '@components/render-table/columns/operate-column/index.vue'; import RenderText from '@components/render-table/columns/text-plain/index.vue'; - import RenderHost from '@views/db-manage/mongodb/components/edit-field/HostName.vue'; import type { SpecInfo } from '@views/db-manage/mongodb/components/edit-field/spec-select/components/Panel.vue'; import type { IListItem } from '@views/db-manage/mongodb/components/edit-field/spec-select/components/Select.vue'; import RenderTargetSpec from '@views/db-manage/mongodb/components/edit-field/spec-select/Index.vue'; @@ -72,6 +75,8 @@ import { random } from '@utils'; + import RenderHost from './HostName.vue'; + export interface IDataRow { rowKey: string; isLoading: boolean; @@ -80,6 +85,7 @@ clusterType: string; role: string; machineType: string; + shard: string; cluster: { domain: string; isStart: boolean; @@ -99,6 +105,7 @@ clusterId: 0, clusterType: '', machineType: '', + shard: '', role: '', relatedClusters: [], cluster: { @@ -108,11 +115,11 @@ rowSpan: 1, }, }); - - + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/db-table-backup/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/db-table-backup/pages/page1/Index.vue index bf7ce8d82e..fc2bf02b40 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/db-table-backup/pages/page1/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/db-table-backup/pages/page1/Index.vue @@ -66,16 +66,22 @@ :model="formData" style="margin-top: 16px"> - {{ t('常规备份(25天)') }} + {{ t('25天') }} + + + {{ t('6个月') }} + + + {{ t('1年') }} - {{ t('长期备份(3年)') }} + {{ t('3年') }} @@ -108,7 +114,6 @@ - + + + diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/components/render-shard/components/RenderRow.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/components/render-shard/components/RenderRow.vue new file mode 100644 index 0000000000..16e4ff29db --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/components/render-shard/components/RenderRow.vue @@ -0,0 +1,139 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbBackup.vue b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbBackup.vue index b166179605..491d9c356d 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbBackup.vue +++ b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbBackup.vue @@ -18,11 +18,11 @@ :data="dataList" />
- {{ t('备份文件保存时间') }}: - {{ fileTag }} + {{ t('备份保存时间') }}: + {{ fileTagText }}
- {{ t('是否开启 Oplog') }}: + {{ t('是否备份 Oplog') }}: {{ oplogType }}
@@ -75,10 +75,17 @@ const { t } = useI18n(); - const { clusters, file_tag, oplog, infos } = props.ticketDetails.details; + const { clusters, file_tag: fileTag, oplog, infos } = props.ticketDetails.details; + + const fileTagMap: Record = { + normal_backup: t('25天'), + half_year_backup: t('6 个月'), + a_year_backup: t('1 年'), + forever_backup: t('3 年'), + }; // eslint-disable-next-line camelcase - const fileTag = file_tag === 'normal_backup' ? t('常规备份(25天)') : t('长期备份(3年)'); + const fileTagText = fileTagMap[fileTag]; const oplogType = oplog ? t('是') : t('否'); const columns = [ diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbStruct.vue b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbStruct.vue index 941b7e4d7a..52c8f0c339 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbStruct.vue +++ b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbStruct.vue @@ -48,6 +48,8 @@ import type { TicketDetails } from '@services/types/ticket'; + import { ClusterTypes } from '@common/const'; + import { utcDisplayTime } from '@utils'; interface DbStructDeatils { @@ -293,8 +295,8 @@ const tableData = computed(() => clusterIds.map(id => ({ immute_domain: clusters[id].immute_domain, - struct_type: backupinfo ? t('备份记录') : t('回档至指定时间 '), - backup_file: backupinfo ? `${backupinfo[id].role_type}${utcDisplayTime(backupinfo[id].end_time)}` : '', + struct_type: backupinfo ? t('备份记录') : t('回档至指定时间'), + backup_file: backupinfo ? `${clusters[id].cluster_type === ClusterTypes.MONGO_SHARED_CLUSTER ? backupinfo[id].set_name : ''}-${backupinfo[id].role_type}-${utcDisplayTime(backupinfo[id].end_time)}` : '', target_time: rollbackTime ? utcDisplayTime(rollbackTime) : '', })) ) diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbTableBackup.vue b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbTableBackup.vue index 37a956f3c4..bc7ad4f7b0 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbTableBackup.vue +++ b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mongodb/DbTableBackup.vue @@ -18,10 +18,8 @@ :data="dataList" />
- {{ t('备份文件保存时间') }}: - {{ - fileTag === 'normal_backup' ? t('常规备份(25天)') : t('长期备份(3年)') - }} + {{ t('备份保存时间') }}: + {{ fileTagText }}
= { + normal_backup: t('25天'), + half_year_backup: t('6 个月'), + a_year_backup: t('1 年'), + forever_backup: t('3 年'), + }; + + const fileTagText = fileTagMap[fileTag];