This is an automated email from the ASF dual-hosted git repository.

kerwin612 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new f4685aa75 [bugfix] Unable to specify collector when creating a monitor 
(#2311)
f4685aa75 is described below

commit f4685aa75a7de6297986ba31d336012d073d2075
Author: Calvin <[email protected]>
AuthorDate: Wed Jul 24 11:25:25 2024 +0800

    [bugfix] Unable to specify collector when creating a monitor (#2311)
    
    Co-authored-by: tomsun28 <[email protected]>
    Co-authored-by: Logic <[email protected]>
    Co-authored-by: Kerwin Bryant <[email protected]>
---
 .../src/app/routes/monitor/monitor-edit/monitor-edit.component.ts    | 4 ++--
 .../src/app/routes/monitor/monitor-form/monitor-form.component.ts    | 5 +++--
 web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts  | 4 ++--
 3 files changed, 7 insertions(+), 6 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 91e295933..867339855 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
@@ -190,7 +190,7 @@ export class MonitorEditComponent implements OnInit {
     let addMonitor = {
       detected: this.detected,
       monitor: info.monitor,
-      collector: this.collector,
+      collector: info.collector,
       params: info.params.concat(info.advancedParams)
     };
     if (this.detected) {
@@ -220,7 +220,7 @@ export class MonitorEditComponent implements OnInit {
     let detectMonitor = {
       detected: this.detected,
       monitor: info.monitor,
-      collector: this.collector,
+      collector: info.collector,
       params: info.params.concat(info.advancedParams)
     };
     this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting');
diff --git 
a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts 
b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts
index 43fea4505..7c90e02df 100644
--- a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts
+++ b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts
@@ -46,6 +46,7 @@ export class MonitorFormComponent implements OnChanges {
   @Output() readonly formCancel = new EventEmitter<any>();
   @Output() readonly formDetect = new EventEmitter<any>();
   @Output() readonly hostChange = new EventEmitter<string>();
+  @Output() readonly collectorChange = new EventEmitter<string>();
 
   hasAdvancedParams: boolean = false;
 
@@ -97,7 +98,7 @@ export class MonitorFormComponent implements OnChanges {
         param.paramValue = (param.paramValue as string).trim();
       }
     });
-    this.formDetect.emit({ monitor: this.monitor, params: this.params, 
advancedParams: this.advancedParams });
+    this.formDetect.emit({ monitor: this.monitor, params: this.params, 
advancedParams: this.advancedParams, collector: this.collector });
   }
 
   onSubmit(formGroup: FormGroup) {
@@ -126,7 +127,7 @@ export class MonitorFormComponent implements OnChanges {
         param.paramValue = (param.paramValue as string).trim();
       }
     });
-    this.formSubmit.emit({ monitor: this.monitor, params: this.params, 
advancedParams: this.advancedParams });
+    this.formSubmit.emit({ monitor: this.monitor, params: this.params, 
advancedParams: this.advancedParams, collector: this.collector });
   }
 
   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 6a39e154e..6534f5adf 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
@@ -165,7 +165,7 @@ export class MonitorNewComponent implements OnInit {
     let addMonitor = {
       detected: this.detected,
       monitor: info.monitor,
-      collector: this.collector,
+      collector: info.collector,
       params: info.params.concat(info.advancedParams)
     };
     if (this.detected) {
@@ -195,7 +195,7 @@ export class MonitorNewComponent implements OnInit {
     let detectMonitor = {
       detected: true,
       monitor: info.monitor,
-      collector: this.collector,
+      collector: info.collector,
       params: info.params.concat(info.advancedParams)
     };
     this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting');


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to