From f3788549f749f4470cf0b36b9e5984241f55da3a Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Fri, 3 Dec 2021 13:53:36 +0800 Subject: [PATCH] =?UTF-8?q?[web-app]=20bugfix-=E6=96=B0=E5=A2=9E=E6=8E=A2?= =?UTF-8?q?=E6=B5=8B=E5=BC=82=E5=B8=B8=E6=97=B6=E9=A1=B5=E9=9D=A2=E4=B8=8D?= =?UTF-8?q?=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitor-edit/monitor-edit.component.ts | 18 ++++++++++++------ .../monitor-new/monitor-new.component.ts | 9 +++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts index 869063e..3044010 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts @@ -53,7 +53,7 @@ export class MonitorEditComponent implements OnInit { this.params = message.data.params; } else { console.warn(message.msg); - this.notifySvc.error("查询此监控异常", message.msg); + this.notifySvc.error("查询异常,此监控不存在", message.msg); return throwError("查询此监控异常"); } return this.appDefineSvc.getAppParamsDefine(this.monitor.app); @@ -98,13 +98,14 @@ export class MonitorEditComponent implements OnInit { .subscribe(message => { this.isSpinning = false; if (message.code === 0) { - this.notifySvc.success("新增监控成功", ""); + this.notifySvc.success("修改监控成功", ""); this.router.navigateByUrl("/monitors") } else { - this.notifySvc.error("新增监控失败", message.msg); + this.notifySvc.error("修改监控失败", message.msg); }}, error => { - this.isSpinning = false + this.isSpinning = false; + this.notifySvc.error("修改监控失败", error.error.msg); } ) } @@ -122,7 +123,7 @@ export class MonitorEditComponent implements OnInit { "params": this.params }; this.isSpinning = true; - this.monitorSvc.newMonitor(detectMonitor) + this.monitorSvc.editMonitor(detectMonitor) .subscribe(message => { this.isSpinning = false; if (message.code === 0) { @@ -130,7 +131,12 @@ export class MonitorEditComponent implements OnInit { } else { this.notifySvc.error("探测失败", message.msg); } - }) + }, + error => { + this.isSpinning = false; + this.notifySvc.error("探测异常", error.error.msg); + } + ) } onCancel() { diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts index 766eb04..2cdf668 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts @@ -84,7 +84,8 @@ export class MonitorNewComponent implements OnInit { this.notifySvc.error("新增监控失败", message.msg); }}, error => { - this.isSpinning = false + this.isSpinning = false; + this.notifySvc.error("新增监控失败", error.error.msg); } ) } @@ -110,7 +111,11 @@ export class MonitorNewComponent implements OnInit { } else { this.notifySvc.error("探测失败", message.msg); } - }) + }, error => { + this.isSpinning = false; + this.notifySvc.error("探测异常", error.error.msg); + } + ) } onCancel() {