aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/training
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/training')
-rw-r--r--frontend/src/app/training/training.component.html2
-rw-r--r--frontend/src/app/training/training.component.ts7
2 files changed, 7 insertions, 2 deletions
diff --git a/frontend/src/app/training/training.component.html b/frontend/src/app/training/training.component.html
index 66f77c37..25a29828 100644
--- a/frontend/src/app/training/training.component.html
+++ b/frontend/src/app/training/training.component.html
@@ -26,7 +26,7 @@
<h2 class="my-5">3. Treniranje modela</h2>
<div class="d-flex flex-row justify-content-center align-items-center my-3">
- <button class="btn btn-lg col-4" style="background-color:#003459; color:white;" (click)="trainModel();">Treniraj
+ <button id="trainButton" #trainButton class="btn btn-lg col-4" style="background-color:#003459; color:white;" (click)="trainModel();">Treniraj
model</button>
</div>
diff --git a/frontend/src/app/training/training.component.ts b/frontend/src/app/training/training.component.ts
index 6b5405cb..a0bec8e2 100644
--- a/frontend/src/app/training/training.component.ts
+++ b/frontend/src/app/training/training.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import Shared from '../Shared';
import Experiment from '../_data/Experiment';
@@ -18,6 +18,8 @@ import { SignalRService } from '../_services/signal-r.service';
export class TrainingComponent implements OnInit {
@ViewChild(ModelLoadComponent) modelLoadComponent?: ModelLoadComponent;
+ @ViewChild("trainButton") trainButtonRef!: ElementRef;
+
@ViewChild(MetricViewComponent) metricViewComponent!: MetricViewComponent;
myExperiments?: Experiment[];
@@ -92,9 +94,12 @@ export class TrainingComponent implements OnInit {
Shared.openDialog("Greška", "Molimo Vas da izaberete model.");
return;
}
+ this.trainButtonRef.nativeElement.disabled = true;
this.modelsService.trainModel(this.selectedModel._id, this.selectedExperiment._id).subscribe((response: any) => {
//console.log('Train model complete!', response);
+ this.trainButtonRef.nativeElement.disabled = false;
Shared.openDialog("Obaveštenje", "Treniranje modela je počelo!");
+ this.trainingResult = response;
});
}
}