This is an automated email from the ASF dual-hosted git repository. gongchao pushed a commit to branch alarm-1-3 in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
commit 889e823608e1352da76b121d58c3e7e2a5fd72e9 Author: tomsun28 <[email protected]> AuthorDate: Fri Jan 3 13:18:25 2025 +0800 [webapp] update alert inhibit Signed-off-by: tomsun28 <[email protected]> --- web-app/src/app/pojo/Alert.ts | 38 ---------------------- web-app/src/app/pojo/AlertDefine.ts | 4 +-- .../alert-setting/alert-setting.component.html | 14 ++------ .../alert/alert-setting/alert-setting.component.ts | 5 --- .../app/routes/dashboard/dashboard.component.ts | 1 - .../monitor-form/monitor-form.component.html | 2 +- .../tags-select/tags-select.component.html | 2 +- web-app/src/assets/i18n/en-US.json | 4 +-- web-app/src/assets/i18n/zh-CN.json | 4 +-- web-app/src/assets/i18n/zh-TW.json | 4 +-- 10 files changed, 12 insertions(+), 66 deletions(-) diff --git a/web-app/src/app/pojo/Alert.ts b/web-app/src/app/pojo/Alert.ts deleted file mode 100644 index b342ce8e7..000000000 --- a/web-app/src/app/pojo/Alert.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export class Alert { - id!: number; - target!: string; - monitorId!: number; - monitorName!: string; - // alert level -- 0:high-emergency-red 1:medium-critical-orange 2:low-warning-yellow - priority: number = 2; - // alert status-- 0-to be processed 1-not reached the threshold 2-recover 3-processed - status!: number; - content!: string; - // alarm times - times!: number; - firstAlarmTime!: number; - lastAlarmTime!: number; - tags!: Record<string, string>; - gmtCreate!: number; - gmtUpdate!: number; - tmp!: any; -} diff --git a/web-app/src/app/pojo/AlertDefine.ts b/web-app/src/app/pojo/AlertDefine.ts index 93b0021b8..3953b0429 100644 --- a/web-app/src/app/pojo/AlertDefine.ts +++ b/web-app/src/app/pojo/AlertDefine.ts @@ -17,8 +17,6 @@ * under the License. */ -import { TagItem } from './NoticeRule'; - export class AlertDefine { id!: number; name!: string; @@ -30,7 +28,7 @@ export class AlertDefine { // unit second period: number = 300; times: number = 3; - tags!: TagItem[]; + labels!: Record<string, string>; enable: boolean = true; template!: string; creator!: string; diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html index 8b51f5bca..1e060dd42 100644 --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html @@ -542,17 +542,9 @@ </nz-form-control> </nz-form-item> <nz-form-item> - <nz-form-label nzSpan="7" [nzFor]="'tags'" [nzTooltipTitle]="'tag.bind.tip' | i18n">{{ 'tag.bind' | i18n }} </nz-form-label> - <nz-form-control nzSpan="8" [nzErrorTip]="'validation.required' | i18n"> - <app-form-field - [item]="{ - field: 'tags', - type: 'tags-selection' - }" - [extra]="{ tag_mode: 'closeable' }" - [name]="'tags'" - [(ngModel)]="define.tags" - /> + <nz-form-label nzSpan="7" [nzFor]="'labels'" [nzTooltipTitle]="'label.bind.tip' | i18n">{{ 'label.bind' | i18n }} </nz-form-label> + <nz-form-control nzSpan="12" [nzErrorTip]="'validation.required' | i18n"> + <app-labels-input [(ngModel)]="define.labels" name="labels"></app-labels-input> </nz-form-control> </nz-form-item> <nz-form-item> diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts index 41f69ea16..1ff946e0a 100644 --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts @@ -247,7 +247,6 @@ export class AlertSettingComponent implements OnInit { this.isSelectTypeModalVisible = false; this.define = new AlertDefine(); this.define.type = type; - this.define.tags = []; this.userExpr = ''; this.selectedMonitorIds = new Set<number>(); // Set default period for periodic alert @@ -512,10 +511,6 @@ export class AlertSettingComponent implements OnInit { } }); } - // Initialize tags array if undefined - if (this.define.tags == undefined) { - this.define.tags = []; - } } else { this.notifySvc.error(this.i18nSvc.fanyi('common.notify.monitor-fail'), message.msg); } diff --git a/web-app/src/app/routes/dashboard/dashboard.component.ts b/web-app/src/app/routes/dashboard/dashboard.component.ts index 575fc6503..cb677d0dd 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.ts +++ b/web-app/src/app/routes/dashboard/dashboard.component.ts @@ -27,7 +27,6 @@ import { NzMessageService } from 'ng-zorro-antd/message'; import { fromEvent } from 'rxjs'; import { finalize } from 'rxjs/operators'; -import { Alert } from '../../pojo/Alert'; import { AppCount } from '../../pojo/AppCount'; import { CollectorSummary } from '../../pojo/CollectorSummary'; import { SingleAlert } from '../../pojo/SingleAlert'; diff --git a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html index d721ff16d..293b026d3 100644 --- a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html +++ b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html @@ -129,7 +129,7 @@ </nz-form-item> <nz-form-item> - <nz-form-label nzSpan="7" [nzFor]="'tags'" [nzTooltipTitle]="'tag.bind.tip' | i18n">{{ 'tag.bind' | i18n }} </nz-form-label> + <nz-form-label nzSpan="7" [nzFor]="'tags'" [nzTooltipTitle]="'label.bind.tip' | i18n">{{ 'label.bind' | i18n }} </nz-form-label> <nz-form-control nzSpan="8" [nzErrorTip]="'validation.required' | i18n"> <app-form-field [item]="{ diff --git a/web-app/src/app/shared/components/tags-select/tags-select.component.html b/web-app/src/app/shared/components/tags-select/tags-select.component.html index ff8b3f7c5..c888672d3 100644 --- a/web-app/src/app/shared/components/tags-select/tags-select.component.html +++ b/web-app/src/app/shared/components/tags-select/tags-select.component.html @@ -36,7 +36,7 @@ <nz-modal [(nzVisible)]="isManageModalVisible" - [nzTitle]="'tag.bind' | i18n" + [nzTitle]="'label.bind' | i18n" (nzOnCancel)="onManageModalCancel()" (nzOnOk)="onManageModalOk()" nzMaskClosable="false" diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index 64a7f0ed5..4da42df07 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -572,8 +572,8 @@ "tag.description": "Description", "tag.update-time": "Update Time", "tag.display": "Display", - "tag.bind": "Bind Tags", - "tag.bind.tip": "You can use tags for classification management.eg: assign tags to resources in production environment and test environment.", + "label.bind": "Bind Tags", + "label.bind.tip": "You can use tags for classification management.eg: assign tags to resources in production environment and test environment.", "tag.help": "Tags are everywhere in HertzBeat. We can apply tags in resource grouping, tag matching under rules and others. [Tag Manage] is used for unified management of tags, including adding, deleting, editing, etc. <br>You can use tags to classify and manage monitoring resources, such as binding labels for production and testing environments separately.", "tag.help.link": "https://hertzbeat.apache.org/zh-cn/docs/", "plugin.help": "In HertzBeat, we can use the plugin mechanism to perform some other operations after the alarm except notification. Plugin management is used for unified management of plugins, including upload and enable/disable operations.<br>For example, you can use the plugin mechanism to execute specific scripts or SQL after the alarm occurs.", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index f4fc65bd0..184db1eeb 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -571,8 +571,8 @@ "tag.description": "标签描述", "tag.update-time": "更新时间", "tag.display": "效果", - "tag.bind": "绑定标签", - "tag.bind.tip": "您可以使用标签进行监控资源的分类管理, 例如给资源分别绑定生产环境、测试环境的标签。", + "label.bind": "绑定标签", + "label.bind.tip": "您可以使用标签进行监控资源的分类管理, 例如给资源分别绑定生产环境、测试环境的标签。", "tag.help": "标签在 HertzBeat 中无处不在,我们可以应用标签在资源分组,规则下的标签匹配等场景。标签管理用于对标签的统一管理维护,包含新增,删除,编辑等操作。<br>例如:您可以使用标签对监控资源进行分类管理,给资源分别绑定生产环境、测试环境的标签,在告警通知时通过标签匹配不同的通知人。", "tag.help.link": "https://hertzbeat.apache.org/zh-cn/docs/", "plugin.help": "在HertzBeat中,我们可以通过插件机制在告警后执行一些除通知以外的其他操作。插件管理用于对插件的统一管理,包括上传和,启用禁用等操作。<br>例如:您可以通过插件机制实现在告警出现后,执行特定的脚本或SQL等操作。", diff --git a/web-app/src/assets/i18n/zh-TW.json b/web-app/src/assets/i18n/zh-TW.json index fcf5851de..aa9f01c22 100644 --- a/web-app/src/assets/i18n/zh-TW.json +++ b/web-app/src/assets/i18n/zh-TW.json @@ -582,8 +582,8 @@ "tag.description": "標簽描述", "tag.update-time": "更新時間", "tag.display": "效果", - "tag.bind": "綁定標簽", - "tag.bind.tip": "您可以使用標簽進行監控資源的分類管理, 例如給資源分別綁定生産環境、測試環境的標簽。", + "label.bind": "綁定標簽", + "label.bind.tip": "您可以使用標簽進行監控資源的分類管理, 例如給資源分別綁定生産環境、測試環境的標簽。", "tag.help": "標簽在 HertzBeat 中無處不在,我們可以應用標簽在資源分組,規則下的標簽匹配等場景。標簽管理用于對標簽的統壹管理維護,包含新增,刪除,編輯等操作。<br>例如:您可以使用標簽對監控資源進行分類管理,給資源分別綁定生産環境、測試環境的標簽,在告警通知時通過標簽匹配不同的通知人。", "tag.help.link": "https://hertzbeat.apache.org/zh-cn/docs/", "plugin.help": "在HertzBeat中,我們可以透過外掛機制在警告後執行一些除通知以外的其他操作。外掛程式管理用於對外掛程式的統一管理,包括上傳和,啟用停用等操作。<br>例如:您可以透過外掛機制實現在警告出現後,執行特定的腳本或SQL等操作。", --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
