Skip to content

Commit

Permalink
feat(frontend): 全局策略、监控告警与轮值设置 #1250 (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia authored and hLinx committed Oct 11, 2023
1 parent 8ac32a3 commit 8274791
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
5 changes: 1 addition & 4 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -2060,9 +2060,6 @@
"所有检测均失败,无法执行": "所有检测均失败,无法执行",
"DB 不存在": "DB 不存在",
"必须小于等于m台": "必须小于等于{m}台",
"监控告警": "监控告警",
"告警组": "告警组",
"轮值设置": "轮值设置",
"告警组名称": "告警组名称",
"通知对象": "通知对象",
"应用策略": "应用策略",
Expand Down Expand Up @@ -2227,4 +2224,4 @@
"失败的实例": "失败的实例",
"返回": "返回",
"这行勿动!新增翻译请在上一行添加!": ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,24 @@
field: 'is_enabled',
showOverflowTooltip: true,
width: 120,
render: ({ row }: {row: RowData}) => (
<bk-pop-confirm
title={t('确认停用该策略?')}
content={t('停用后所有监控动作将会停止,请谨慎操作!')}
width="320"
is-show={row.is_show_tip}
trigger="manual"
placement="bottom"
onConfirm={() => handleClickConfirm(row)}
onCancel={() => handleCancelConfirm(row)}
>
<bk-switcher size="small" v-model={row.is_enabled} theme="primary" onChange={() => handleChangeSwitch(row)}/>
</bk-pop-confirm>
),
render: ({ row }: {row: RowData}) => {
const isInner = row.bk_biz_id === 0;
return (
<bk-pop-confirm
title={t('确认停用该策略?')}
content={t('停用后所有监控动作将会停止,请谨慎操作!')}
disabled={isInner}
width="320"
is-show={row.is_show_tip}
trigger="manual"
placement="bottom"
onConfirm={() => handleClickConfirm(row)}
onCancel={() => handleCancelConfirm(row)}
>
<bk-switcher size="small" disabled={isInner} v-model={row.is_enabled} theme="primary" onChange={() => handleChangeSwitch(row)}/>
</bk-pop-confirm>
);
},
},
{
label: t('更新时间'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
},
],
}).then((data) => {
const formatData = data.map((item: any) => ({ ...item, count: item.instance_count }));
const formatData = data.map((item: any) => ({ ...item, count: item.remote_db.length }));
treeData.value = [
{
name: currentBizInfo?.display_name || '--',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@

import { useGlobalBizs } from '@stores';

import { TicketTypes } from '@common/const';

import DbStatus from '@components/db-status/index.vue';

import getSettings from '../common/tableSettings';
Expand All @@ -71,8 +69,7 @@
interface Props {
lastValues: InstanceSelectorValues,
clusterId?: number,
role?: string
ticketType?: string,
role?: string,
}

interface Emits {
Expand Down Expand Up @@ -252,10 +249,6 @@
getResourceInstances(params)
.then((data) => {
const ret = data;
if (props.ticketType === TicketTypes.TENDBCLUSTER_MASTER_FAIL_OVER) {
// 主库故障切换,限制过滤故障主机
ret.results = data.results.filter(item => item.status !== 'running');
}
tableData.value = ret.results;
pagination.count = ret.count;
isAnomalies.value = false;
Expand Down

0 comments on commit 8274791

Please sign in to comment.