Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 0103 #9016

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3907,7 +3907,7 @@
"单据中心": "单据中心",
"待我处理": "待我处理",
"待我协助": "待我协助",
"待我处理:通常是我提交的单据,或者我是业务主DB": "待我处理:通常是我提交的单据,或者我是业务主DB",
"待我处理:通常是我提交的单据,或者我是业务主DBA": "待我处理:通常是我提交的单据,或者我是业务主DBA",
"待我协助:通常是我被设定为单据协助人,或者我是业务的备DBA、二线 DBA": "待我协助:通常是我被设定为单据协助人,或者我是业务的备DBA、二线 DBA",
"Proxy存储资源规格:": "Proxy存储资源规格:",
"集群:": "集群:",
Expand All @@ -3924,7 +3924,7 @@
"单据协作人": "单据协作人",
"集群标识,支持小写字母、数字、连字符 -(连字符不可打头)": "集群标识,支持小写字母、数字、连字符 -(连字符不可打头)",
"当前协助人": "当前协助人",
"c实例预览r_n": "【{0}】实例预览 {1}(共{2}组)",
"c实例预览r_n": "【{0}】实例预览 {1}(共 {2} 组)",
"排除业务": "排除业务",
"1. 群聊添加群机器人: 蓝鲸监控(上云)": "1. 群聊添加群机器人: 蓝鲸监控(上云)",
"2. 手动蓝鲸监控(上云) 并输入关键字n": "2. 手动 {'@'}蓝鲸监控(上云) 并输入关键字 {n}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
class-name="cluster-table-cluster-name-column"
field="cluster_name"
:label="t('集群名称')"
:min-width="200">
:min-width="200"
:show-overflow="false">
<template #header>
<RenderHeadCopy
:config="[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@
<template
v-if="index === 0"
#append>
<DbIcon
<RenderCellCopy
v-if="data.slave_domain"
v-bk-tooltips="t('复制从访问入口')"
type="copy"
@click="() => handleCopySlaveDomain(data.slaveDomainDisplayName)" />
:copy-items="[
{
value: data.slave_domain,
label: t('域名'),
},
{
value: data.slaveDomainDisplayName,
label: t('域名:端口'),
},
]" />
<span v-db-console="accessEntryDbConsole">
<EditEntryConfig
:id="data.id"
Expand Down Expand Up @@ -83,10 +90,9 @@
import TextOverflowLayout from '@components/text-overflow-layout/Index.vue';

import EditEntryConfig from '@views/db-manage/common/cluster-entry-config/Index.vue';
import RenderCellCopy from '@views/db-manage/common/render-cell-copy/Index.vue';
import RenderHeadCopy from '@views/db-manage/common/render-head-copy/Index.vue';

import { execCopy } from '@utils';

import useColumnCopy from './hooks/useColumnCopy';
import type { ClusterModel } from './types';

Expand Down Expand Up @@ -126,10 +132,6 @@

const { handleCopySelected, handleCopyAll } = useColumnCopy(props);

const handleCopySlaveDomain = (clusterName: string) => {
execCopy(clusterName);
};

const fetchTableData = () => {
emits('refresh');
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@
label="Slave"
:search-ip="batchSearchIpInatanceList"
:selected-list="selected" />
<BkTableColumn
field="cluster_type_name"
:label="t('架构版本')"
:min-width="150">
<template #default="{ data }: { data: RedisModel }">
{{ data.cluster_type_name || '--' }}
</template>
</BkTableColumn>
<CommonColumn :cluster-type="ClusterTypes.REDIS" />
<BkTableColumn
:fixed="isStretchLayoutOpen ? false : 'right'"
Expand All @@ -132,37 +140,39 @@
:show-overflow="false">
<template #default="{data}: {data: RedisModel}">
<OperationBtnStatusTips
v-bk-tooltips="{
content: t('暂不支持跨管控区域提取Key'),
disabled: data.bk_cloud_id === undefined,
}"
v-db-console="'redis.clusterManage.extractKey'"
:data="data"
:disabled="!data.isOffline">
<AuthButton
action-id="redis_keys_extract"
class="mr-8"
:disabled="data.isOffline"
:permission="data.permission.redis_keys_extract"
:resource="data.id"
text
theme="primary"
@click="handleShowExtract([data])">
{{ t('提取Key') }}
</AuthButton>
<span
v-bk-tooltips="{
content: t('暂不支持跨管控区域提取Key'),
disabled: data.bk_cloud_id === 0,
}">
<AuthButton
action-id="redis_keys_extract"
class="mr-8"
:disabled="data.isOffline || data.bk_cloud_id !== 0"
:permission="data.permission.redis_keys_extract"
:resource="data.id"
text
theme="primary"
@click="handleShowExtract([data])">
{{ t('提取Key') }}
</AuthButton>
</span>
</OperationBtnStatusTips>
<OperationBtnStatusTips
v-bk-tooltips="{
content: t('暂不支持跨管控区域删除Key'),
disabled: data.bk_cloud_id === undefined,
disabled: data.bk_cloud_id === 0,
}"
v-db-console="'redis.clusterManage.deleteKey'"
:data="data"
:disabled="!data.isOffline">
<AuthButton
action-id="redis_keys_delete"
class="mr-8"
:disabled="data.isOffline"
:disabled="data.isOffline || data.bk_cloud_id !== 0"
:permission="data.permission.redis_keys_delete"
:resource="data.id"
text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<BaseRoleColumn
v-bind="props"
:min-width="280">
<template #default="{ data }"> {{ data.ip }}:{{ data.port }}({{ data.seg_range }}) </template>
<template #default="{ data }">
{{ data.ip }}:{{ data.port }}
<template v-if="data.seg_range">({{ data.seg_range }})</template>
</template>
<template #instanceListTitle="{ data }">
<I18nT keypath="c实例预览r_n">
<span>{{ data.master_domain }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<OperationBtnStatusTips :data="data">
<AuthButton
action-id="tendbcluster_enable_disable"
:disabled="data.operationDisabled"
:disabled="data.operationTicketId"
:permission="data.permission.tendbcluster_enable_disable"
:resource="data.id"
text
Expand Down
25 changes: 19 additions & 6 deletions dbm-ui/frontend/src/views/quick-search/components/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
<BkTable
class="search-result-table mt-14 mb-8"
:data="item.dataList"
:pagination="pagination[index]">
:pagination="pagination[index]"
:row-config="{
useKey: true,
keyField: 'id',
}">
<BkTableColumn
field="entry"
:label="t('访问入口(域名、CLB、北极星)')"
Expand Down Expand Up @@ -85,7 +89,8 @@
</BkTableColumn>
<BkTableColumn
field="cluster_status"
:label="t('状态')">
:label="t('状态')"
:width="100">
<template #default="{data: rowData}: {data: QuickSearchEntryModel}">
<RenderClusterStatus :data="rowData.cluster_status" />
</template>
Expand All @@ -100,28 +105,32 @@
</BkTableColumn>
<BkTableColumn
field="cluster_type"
:label="t('架构类型')">
:label="t('架构类型')"
:width="150">
<template #default="{data: rowData}: {data: QuickSearchEntryModel}">
{{ rowData.cluster_type || '--' }}
</template>
</BkTableColumn>
<BkTableColumn
field="major_version"
:label="t('版本')">
:label="t('版本')"
:width="150">
<template #default="{data: rowData}: {data: QuickSearchEntryModel}">
{{ rowData.major_version || '--' }}
</template>
</BkTableColumn>
<BkTableColumn
field="region"
:label="t('地域')">
:label="t('地域')"
:width="150">
<template #default="{data: rowData}: {data: QuickSearchEntryModel}">
{{ rowData.region || '--' }}
</template>
</BkTableColumn>
<BkTableColumn
field="bk_biz_id"
:label="t('所属业务')">
:label="t('所属业务')"
:width="150">
<template #default="{data: rowData}: {data: QuickSearchEntryModel}">
{{ rowData.bk_biz_id ? bizIdNameMap[rowData.bk_biz_id] : '--' }}
</template>
Expand Down Expand Up @@ -238,8 +247,12 @@
[t('访问入口(域名、CLB、北极星)')]: dataItem.entry,
[t('所属集群')]: dataItem.immute_domain,
[t('架构类型')]: dataItem.cluster_type,
[t('版本')]: dataItem.major_version,
[t('地域')]: dataItem.region,
[t('所属业务')]: String(dataItem.bk_biz_id),
[t('业务名称')]: props.bizIdNameMap[dataItem.bk_biz_id],
[t('容灾要求')]: dataItem.disaster_tolerance_level,
[t('主 DBA')]: dataItem.dba,
}));
const colsWidths = [{ width: 10 }, { width: 16 }, { width: 16 }, { width: 24 }, { width: 24 }, { width: 16 }];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
:max-height="tableMaxHeight"
:pagination="pagination"
:row-class="rowClass"
:row-config="{
useKey: true,
keyField: 'id',
}"
:show-overflow="false"
@filter-change="handleFilterChange"
@page-limit-change="handlePageLimitChange"
Expand Down Expand Up @@ -328,8 +332,8 @@
const isSearching = computed(
() =>
Object.keys(formatSearchValue.value).length > 0 ||
formatDateValue.value.create_at__gte !== '' ||
formatDateValue.value.create_at__lte !== '',
Boolean(formatDateValue.value.create_at__gte) ||
Boolean(formatDateValue.value.create_at__lte),
);

const fetchData = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
const { t } = useI18n();
const { username, isSuperuser } = useUserProfile();

const isCanOperation = computed(() => isSuperuser || props.ticketDetail.todo_operators.includes(username));
const isCanOperation = computed(
() =>
isSuperuser ||
props.ticketDetail.todo_operators.includes(username) ||
props.ticketDetail.todo_helpers.includes(username),
);
const isNeedOperation = computed(() => [0, 2].includes(props.data.err_code));
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@
const { t } = useI18n();
const { username, isSuperuser } = useUserProfile();

const isCanOperation = computed(() => isSuperuser || props.ticketDetail.todo_operators.includes(username));
const isCanOperation = computed(
() =>
isSuperuser ||
props.ticketDetail.todo_operators.includes(username) ||
props.ticketDetail.todo_helpers.includes(username),
);
const isNeedOperation = computed(() => props.data.err_msg || [0, 2].includes(props.data.err_code));
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
</div>
</template>
<script setup lang="ts">
import { getCurrentInstance, onActivated, onDeactivated } from 'vue';
import { onActivated } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import { useRoute } from 'vue-router';

import TicketModel from '@services/model/ticket/ticket';
import { getTickets } from '@services/source/ticket';
Expand All @@ -57,12 +57,10 @@

type IRowData = TicketModel;

const router = useRouter();
const route = useRoute();
const { t } = useI18n();
const currentInstance = getCurrentInstance();

const { getSearchParams, removeSearchParam } = useUrlSearch();
const { removeSearchParam } = useUrlSearch();

const { value: datePickerValue, shortcutsRange } = useDatePicker();

Expand All @@ -81,20 +79,6 @@
selectTicketId.value = Number(route.query.selectId);
removeSearchParam('selectId');
});

onDeactivated(() => {
setTimeout(() => {
if (currentInstance!.isUnmounted) {
return;
}
router.replace({
params: {
ticketId: selectTicketId.value,
},
query: getSearchParams(),
});
});
});
</script>
<style lang="less">
.ticket-list-table-mode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<BkPopover placement="top">
<DbIcon type="attention" />
<template #content>
<div>{{ t('待我处理:通常是我提交的单据,或者我是业务主DB') }}</div>
<div>{{ t('待我处理:通常是我提交的单据,或者我是业务主DBA') }}</div>
<div>{{ t('待我协助:通常是我被设定为单据协助人,或者我是业务的备DBA、二线 DBA') }}</div>
</template>
</BkPopover>
Expand Down
Loading