Skip to content

Commit

Permalink
feature: add new field description in hertzbeat tag detail (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
GEM0816g authored Jan 15, 2024
1 parent f4a57f2 commit 0370cac
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class Tag {
@Schema(title = "Tag Color | 标签颜色", example = "#ffff", accessMode = READ_WRITE)
private String color;

@Schema(title = "Tag Color | 标签描述", example = "用于监控mysql", accessMode = READ_WRITE)
private String description;

@Schema(title = "标记类型 0:监控自动生成(monitorId,monitorName) 1: 用户生成 2: 系统预置", accessMode = READ_WRITE)
@Min(0)
@Max(3)
Expand Down
1 change: 1 addition & 0 deletions script/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ CREATE TABLE hzb_tag
`value` varchar(100) comment 'TAG标签值(可为空)',
type tinyint not null default 0 comment '标记类型 0:监控自动生成(monitorId,monitorName) 1: 用户生成 2: 系统预制',
color varchar(100) default '#ffffff' comment '标签颜色' ,
description varchar(255) comment '标签描述(可为空)',
creator varchar(100) comment '创建者',
modifier varchar(100) comment '最新修改者',
gmt_create timestamp default current_timestamp comment 'create time',
Expand Down
1 change: 1 addition & 0 deletions web-app/src/app/pojo/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export class Tag {
name!: string;
value!: string;
color: string = this.getRandomColor();
description!: string;
// 标记类型 0:监控自动生成(monitorId,monitorName) 1: 用户生成 2: 系统预置
type!: number;
creator!: string;
Expand Down
8 changes: 8 additions & 0 deletions web-app/src/app/routes/setting/tags/tags.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<th nzAlign="center" nzWidth="15%">{{ 'tag.name' | i18n }}</th>
<th nzAlign="center" nzWidth="15%">{{ 'tag.value' | i18n }}</th>
<th nzAlign="center" nzWidth="15%">{{ 'tag.color' | i18n }}</th>
<th nzAlign="center" nzWidth="15%">{{ 'tag.description' | i18n }}</th>
<th nzAlign="center" nzWidth="20%">{{ 'tag.update-time' | i18n }}</th>
<th nzAlign="center" nzWidth="17%">{{ 'common.edit' | i18n }}</th>
</tr>
Expand All @@ -76,6 +77,7 @@
<td nzAlign="center">
<nz-tag [nzColor]="data.color" style="font-weight: bold; font-size: larger">{{ data.color }}</nz-tag>
</td>
<td nzAlign="center">{{ data.description }}</td>
<td nzAlign="center">{{ data.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss' }}</td>
<td nzAlign="center">
<button nz-button nzType="primary" (click)="onEditOneTag(data)" nz-tooltip [nzTooltipTitle]="'tag.edit' | i18n">
Expand Down Expand Up @@ -130,6 +132,12 @@
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzFor="description">{{ 'tag.description' | i18n }}</nz-form-label>
<nz-form-control [nzSpan]="12" [nzErrorTip]="'validation.required' | i18n">
<input [(ngModel)]="tag.description" nz-input name="description" type="text" id="description" />
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="tag.name != undefined">
<nz-form-label [nzSpan]="7" nzFor="color">{{ 'tag.display' | i18n }}</nz-form-label>
<nz-form-control [nzSpan]="12" [nzErrorTip]="'validation.required' | i18n">
Expand Down
3 changes: 3 additions & 0 deletions web-app/src/app/routes/setting/tags/tags.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ export class SettingTagsComponent implements OnInit {
if (this.tag.value != undefined) {
this.tag.value = this.tag.value.trim();
}
if (this.tag.description != undefined) {
this.tag.description = this.tag.description.trim();
}
if (this.isManageModalAdd) {
const modalOk$ = this.tagService
.newTag(this.tag)
Expand Down
1 change: 1 addition & 0 deletions web-app/src/assets/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@
"tag.name": "Tag Name",
"tag.value": "Tag Value",
"tag.color": "Color",
"tag.description": "Description",
"tag.update-time": "Update Time",
"tag.display": "Display",
"tag.bind": "Bind Tags",
Expand Down
1 change: 1 addition & 0 deletions web-app/src/assets/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@
"tag.name": "标签名",
"tag.value": "标签值",
"tag.color": "颜色",
"tag.description": "标签描述",
"tag.update-time": "更新时间",
"tag.display": "效果",
"tag.bind": "绑定标签",
Expand Down
1 change: 1 addition & 0 deletions web-app/src/assets/i18n/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
"tag.name": "標簽名",
"tag.value": "標簽值",
"tag.color": "顔色",
"tag.description": "標簽描述",
"tag.update-time": "更新時間",
"tag.display": "效果",
"tag.bind": "綁定標簽",
Expand Down

0 comments on commit 0370cac

Please sign in to comment.