Skip to content

Commit

Permalink
[fix] remove unused detect
Browse files Browse the repository at this point in the history
Signed-off-by: tomsun28 <[email protected]>
  • Loading branch information
tomsun28 committed Nov 29, 2024
1 parent 93c7230 commit 2c0641b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export class MonitorEditComponent implements OnInit {
grafanaDashboard!: GrafanaDashboard;
collectors!: Collector[];
collector: string = '';
detected: boolean = false;
isSpinning: boolean = false;
spinningTip: string = 'Loading...';

Expand Down Expand Up @@ -93,7 +92,6 @@ export class MonitorEditComponent implements OnInit {
});
this.paramValueMap = paramValueMap;
}
this.detected = false;
if (this.monitor.tags == undefined) {
this.monitor.tags = [];
}
Expand Down Expand Up @@ -192,17 +190,12 @@ export class MonitorEditComponent implements OnInit {

onSubmit(info: any) {
let addMonitor = {
detected: this.detected,
monitor: info.monitor,
collector: info.collector,
params: info.params.concat(info.advancedParams),
grafanaDashboard: info.grafanaDashboard
};
if (this.detected) {
this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting');
} else {
this.spinningTip = 'Loading...';
}
this.spinningTip = 'Loading...';
this.isSpinning = true;
this.monitorSvc.editMonitor(addMonitor).subscribe(
message => {
Expand All @@ -223,7 +216,6 @@ export class MonitorEditComponent implements OnInit {

onDetect(info: any) {
let detectMonitor = {
detected: this.detected,
monitor: info.monitor,
collector: info.collector,
params: info.params.concat(info.advancedParams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export class MonitorNewComponent implements OnInit {
monitor!: Monitor;
collectors!: Collector[];
collector: string = '';
detected: boolean = false;
grafanaDashboard!: GrafanaDashboard;
// whether it is loading
isSpinning: boolean = false;
Expand Down Expand Up @@ -78,7 +77,6 @@ export class MonitorNewComponent implements OnInit {
this.router.navigateByUrl('/monitors/new?app=website');
}
this.titleSvc.setTitleByI18n(`monitor.app.${this.monitor.app}`);
this.detected = false;
this.isSpinning = true;
return this.appDefineSvc.getAppParamsDefine(this.monitor.app);
})
Expand Down Expand Up @@ -163,17 +161,12 @@ export class MonitorNewComponent implements OnInit {

onSubmit(info: any) {
let addMonitor = {
detected: this.detected,
monitor: info.monitor,
collector: info.collector,
params: info.params.concat(info.advancedParams),
grafanaDashboard: info.grafanaDashboard
};
if (this.detected) {
this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting');
} else {
this.spinningTip = 'Loading...';
}
this.spinningTip = 'Loading...';
this.isSpinning = true;
this.monitorSvc.newMonitor(addMonitor).subscribe(
message => {
Expand All @@ -194,7 +187,6 @@ export class MonitorNewComponent implements OnInit {

onDetect(info: any) {
let detectMonitor = {
detected: true,
monitor: info.monitor,
collector: info.collector,
params: info.params.concat(info.advancedParams)
Expand Down

0 comments on commit 2c0641b

Please sign in to comment.