Skip to content

Commit

Permalink
fix(frontend): 监控告警自测bug修复 #1531 (#1701)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia authored and hLinx committed Nov 10, 2023
1 parent 0f86bf9 commit 81a0e91
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
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 @@ -2282,7 +2282,7 @@
"目标从库实例不存在": "目标从库实例不存在",
"待重建从库主机": "待重建从库主机",
"新从库主机不能为空": "新从库主机不能为空",
"不能超过 128 个字符": "不能超过 128 个字符",
"不能超过n个字符": "不能超过 {n} 个字符",
"已值班人": "已值班人",
"时间段重叠了": "时间段重叠了",
"告警组名称重复": "告警组名称重复",
Expand All @@ -2294,4 +2294,4 @@
"集": "",
"长度不能大于n": "长度不能大于{0}",
"这行勿动!新增翻译请在上一行添加!": ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@
{
label: t('策略名称'),
field: 'name',
fixed: 'left',
minWidth: 150,
width: 280,
showOverflowTooltip: false,
render: ({ row }: {row: RowData}) => {
const isInner = row.bk_biz_id === 0;
const isDanger = row.event_count > 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,16 @@
message: t('策略名称不能为空'),
trigger: 'blur',
},
{
validator: (value: string) => {
if (value.length > 128) {
return false;
}
return true;
},
message: t('不能超过n个字符', { n: 128 }),
trigger: 'blur',
},
{
validator: (value: string) => {
if (!isEditPage.value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
{
label: t('策略名称'),
field: 'name',
fixed: 'left',
minWidth: 150,
render: ({ row }: { row: RowData }) => {
const isNew = dayjs().isBefore(dayjs(row.create_at).add(24, 'hour'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,12 @@
ruleName: [
{
validator: (value: string) => {
if (value.length > 128) {
// 克隆才需要校验
if (value.length > 80) {
return false;
}
return true;
},
message: t('不能超过 128 个字符'),
message: t('不能超过n个字符', { n: 80 }),
trigger: 'blur',
},
{
Expand Down

0 comments on commit 81a0e91

Please sign in to comment.