diff --git a/dbm-ui/frontend/src/services/model/es/es.ts b/dbm-ui/frontend/src/services/model/es/es.ts index 79268db5d8..9eec1fd5a2 100644 --- a/dbm-ui/frontend/src/services/model/es/es.ts +++ b/dbm-ui/frontend/src/services/model/es/es.ts @@ -14,7 +14,7 @@ import { uniq } from 'lodash'; import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types'; -import { utcDisplayTime } from '@utils'; +import { isRecentDays, utcDisplayTime } from '@utils'; import { t } from '@locales/index'; @@ -233,6 +233,10 @@ export default class Es { })); } + get isNew() { + return isRecentDays(this.create_at, 24); + } + initOperations(payload = [] as Es['operations']) { if (!Array.isArray(payload)) { return []; diff --git a/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts b/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts index 1352a61a0c..b80e7cdf02 100644 --- a/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts +++ b/dbm-ui/frontend/src/services/model/hdfs/hdfs.ts @@ -14,7 +14,7 @@ import { uniq } from 'lodash'; import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types'; -import { utcDisplayTime } from '@utils'; +import { isRecentDays, utcDisplayTime } from '@utils'; import { t } from '@locales/index'; @@ -238,4 +238,8 @@ export default class Hdfs { get isStarting() { return Boolean(this.operations.find((item) => item.ticket_type === Hdfs.HDFS_ENABLE)); } + + get isNew() { + return isRecentDays(this.create_at, 24); + } } diff --git a/dbm-ui/frontend/src/services/model/mysql/tendbha.ts b/dbm-ui/frontend/src/services/model/mysql/tendbha.ts index 410c2f7b41..bf4ba233cf 100644 --- a/dbm-ui/frontend/src/services/model/mysql/tendbha.ts +++ b/dbm-ui/frontend/src/services/model/mysql/tendbha.ts @@ -14,7 +14,7 @@ import { uniq } from 'lodash'; import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types'; -import { utcDisplayTime } from '@utils'; +import { isRecentDays, utcDisplayTime } from '@utils'; import { t } from '@locales/index'; @@ -228,4 +228,8 @@ export default class Tendbha { ticketId: item.ticket_id, })); } + + get isNew() { + return isRecentDays(this.create_at, 24); + } } diff --git a/dbm-ui/frontend/src/services/model/mysql/tendbsingle.ts b/dbm-ui/frontend/src/services/model/mysql/tendbsingle.ts index 2063d12292..787b08e7f0 100644 --- a/dbm-ui/frontend/src/services/model/mysql/tendbsingle.ts +++ b/dbm-ui/frontend/src/services/model/mysql/tendbsingle.ts @@ -14,7 +14,7 @@ import { uniq } from 'lodash'; import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types'; -import { utcDisplayTime } from '@utils'; +import { isRecentDays, utcDisplayTime } from '@utils'; import { t } from '@locales/index'; @@ -210,4 +210,8 @@ export default class Tendbsingle { ticketId: item.ticket_id, })); } + + get isNew() { + return isRecentDays(this.create_at, 24); + } } diff --git a/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue b/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue index 92b565672e..b4682fdb1f 100644 --- a/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue @@ -300,8 +300,7 @@ { label: t('访问入口'), field: 'domain', - width: 300, - minWidth: 300, + minWidth: 320, fixed: 'left', renderHead: () => ( ( <> + { + data.operationTagTips.map(item => ) + } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } { data.domain && ( ( <> - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - data.isNew && ( - - NEW - - ) - } ( ( <> + { + data.operationTagTips.map(item => ) + } + { + !data.isOnline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.domain && (
{data.cluster_alias || '--'}
- { - data.operationTagTips.map(item => ) - } - { - !data.isOnline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - isRecentDays(data.create_at, 24 * 3) - && - } ( ( <> + { + data.operationTagTips.map(item => ) + } + { + data.isOffline && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.domain && ( - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && ( - - {t('已禁用')} - - ) - } - { - isRecentDays(data.create_at, 24 * 3) - && - } + + NEW + ) } ( ( <> + { + data.operationTagTips.map(item => ) + } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.domain && ( ( <> - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - data.isNew && ( - - NEW - - ) - } - - {{ t('批量授权') }} - - - ) - } { data.isStructCluster && ( ) } - { - data.operationTagTips.map(item => ( - - )) - } - { - data.isOffline && ( - - {t('已禁用')} - - ) - } ); @@ -448,6 +422,32 @@ ), append: () => ( <> + { + data.isNew && ( + + NEW + + ) + } + { + data.operationTagTips.map(item => ( + + )) + } + { + data.isOffline && ( + + {t('已禁用')} + + ) + } - - {{ t('批量授权') }} - - )) - } - { - data.isOffline && ( - - {t('已禁用')} - - ) - } - - ); - - return ( -
- handleToDetails(data.id)}> - {content} - - { data.cluster_alias } -
- ); - }, + render: ({ data }: { data: MongodbModel }) => ( +
+ handleToDetails(data.id)}> + + { data.cluster_alias } +
+ ), }, { label: t('主域名'), field: 'master_domain', - width: 280, - minWidth: 280, + minWidth: 320, renderHead: () => ( ( <> + { + data.isNew && ( + + NEW + + ) + } + { + data.operationTagTips.map(item => ( + + )) + } + { + data.isOffline && ( + + {t('已禁用')} + + ) + } - - - {{ t('批量订阅') }} - - - - - {{ t('批量授权') }} - - selected.value.map(item => item.id)); const clusterBatchOperationList = computed(() => [ + { + dbConsole: 'mysql.haClusterList.batchSubscription', + click: () => handleShowCreateSubscribeRuleSlider(), + disabled: false, + tooltips: '', + text: t('批量订阅') + }, + { + dbConsole: 'mysql.haClusterList.batchAuthorize', + click: () => handleShowAuthorize(selected.value), + disabled: false, + tooltips: '', + text: t('批量授权') + }, { dbConsole: 'mysql.haClusterList.disable', click: () => handleSwitchCluster(TicketTypes.MYSQL_HA_DISABLE, selected.value), @@ -376,8 +362,7 @@ label: t('主访问入口'), field: 'master_domain', fixed: 'left', - width: 280, - minWidth: 280, + minWidth: 320, showOverflowTooltip: false, renderHead: () => ( ( <> + { + data.operationTagTips.map(item => ) + } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } data.cluster_name, append: () => ( <> - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - isRecentDays(data.create_at, 24 * 3) && ( - - ) - } {data.id} { data.isNew && ( - + + NEW + ) } { diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/single-cluster-list/components/List.vue b/dbm-ui/frontend/src/views/db-manage/mysql/single-cluster-list/components/List.vue index 0419810a17..c4dcadce7a 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/single-cluster-list/components/List.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/single-cluster-list/components/List.vue @@ -26,20 +26,6 @@ class="ml-8" :disabled="!hasSelected" :list="clusterBatchOperationList" /> - - - {{ t('批量授权') }} - - selected.value.map(item => item.id)); const clusterBatchOperationList = computed(() => [ + { + dbConsole: 'mysql.singleClusterList.batchAuthorize', + click: () => handleShowAuthorize(selected.value), + disabled: false, + tooltips: '', + text: t('批量授权') + }, { dbConsole: 'mysql.singleClusterList.disable', click: () => handleSwitchCluster(TicketTypes.MYSQL_SINGLE_DISABLE, selected.value), @@ -334,8 +327,7 @@ label: t('访问入口'), field: 'master_domain', fixed: 'left', - width: 280, - minWidth: 280, + minWidth: 320, renderHead: () => ( ( <> + { + data.operationTagTips.map(item => ) + } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } data.cluster_name, append: () => ( <> - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - isRecentDays(data.create_at, 24 * 3) && ( - - ) - } ( <> {data.ip} - { data.isNew && } + { + data.isNew && ( + + NEW + + ) + } ), }, diff --git a/dbm-ui/frontend/src/views/db-manage/pulsar/list/components/list/Index.vue b/dbm-ui/frontend/src/views/db-manage/pulsar/list/components/list/Index.vue index d851d870d0..3684c962fc 100644 --- a/dbm-ui/frontend/src/views/db-manage/pulsar/list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/pulsar/list/components/list/Index.vue @@ -243,8 +243,7 @@ { label: t('访问入口'), field: 'domain', - width: 280, - minWidth: 280, + minWidth: 320, fixed: 'left', showOverflowTooltip: false, renderHead: () => ( @@ -284,6 +283,28 @@ ), append: () => ( <> + { + data.operationTagTips.map(item => ) + } + { + data.isOffline && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.domain && ( {data.cluster_name} - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && ( - - {t('已禁用')} - - ) - } - { data.isNew && } ( ( <> + { + data.operationTagTips.map(item => ) + } + { + !data.isOnline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.master_domain && ( -
- { - data.operationTagTips.map(item => ) - } - { - !data.isOnline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - data.isNew && ( - - NEW - - ) - } -
( )} + { + data.operationTagTips.map(item => ) + } + { + !data.isOnline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.master_domain && ( -
- { - data.operationTagTips.map(item => ) - } - { - !data.isOnline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - data.isNew && ( - - NEW - - ) - } -
- - - {{ t('批量授权') }} - - @@ -141,7 +128,7 @@ import { getMenuListSearch, getSearchSelectorParams, - isRecentDays + // isRecentDays } from '@utils'; const haClusterData = defineModel<{ @@ -213,6 +200,13 @@ const isCN = computed(() => locale.value === 'zh-cn'); const clusterBatchOperationList = computed(() => [ + { + dbConsole: 'sqlserver.haClusterList.batchAuthorize', + click: () => handleShowAuthorize(selected.value), + disabled: false, + tooltips: '', + text: t('批量授权') + }, { dbConsole: 'sqlserver.haClusterList.disable', click: () => handleSwitchCluster(TicketTypes.SQLSERVER_DISABLE, selected.value), @@ -335,8 +329,7 @@ label: t('主访问入口'), field: 'master_domain', fixed: 'left', - width: 280, - minWidth: 280, + minWidth: 320, showOverflowTooltip: false, renderHead: () => ( )) } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } { data.isNew && ( - + + NEW + ) } @@ -450,25 +455,6 @@ default: () => data.cluster_name, append: () => ( <> - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - isRecentDays(data.create_at, 24 * 3) && ( - - ) - } - - - {{ t('批量授权') }} - - @@ -140,7 +127,7 @@ import { getMenuListSearch, getSearchSelectorParams, - isRecentDays, + // isRecentDays, } from '@utils'; const singleClusterData = defineModel<{ clusterId: number }>('singleClusterData'); @@ -210,6 +197,13 @@ const isCN = computed(() => locale.value === 'zh-cn'); const clusterBatchOperationList = computed(() => [ + { + dbConsole: 'sqlserver.singleClusterList.batchAuthorize', + click: () => handleShowAuthorize(selected.value), + disabled: false, + tooltips: '', + text: t('批量授权') + }, { dbConsole: 'sqlserver.singleClusterList.disable', click: () => handleSwitchCluster(TicketTypes.SQLSERVER_DISABLE, selected.value), @@ -322,8 +316,7 @@ label: t('访问入口'), field: 'master_domain', fixed: 'left', - width: 280, - minWidth: 280, + minWidth: 320, renderHead: () => ( )) } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } { data.isNew && ( - + + NEW + ) } @@ -429,25 +434,6 @@ default: () => data.cluster_name, append: () => ( <> - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - isRecentDays(data.create_at, 24 * 3) && ( - - ) - } - - - {{ t('批量授权') }} - - ) + } + { + data.isOffline && !data.isStarting && ( + + {t('已禁用')} + + ) + } + { + data.isNew && ( + + NEW + + ) + } {data.master_domain && ( ) } - { - data.operationTagTips.map(item => ) - } - { - data.isOffline && !data.isStarting && ( - - {t('已禁用')} - - ) - } - { - data.isNew && ( - - ) - } {data.id} { data.isNew && ( - + + NEW + ) } {