aboutsummaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/app/_elements/model-load/model-load.component.ts2
-rw-r--r--frontend/src/app/_elements/notifications/notifications.component.ts2
-rw-r--r--frontend/src/app/_services/signal-r.service.ts6
-rw-r--r--frontend/src/app/app.component.ts1
-rw-r--r--frontend/src/app/experiment/experiment.component.css5
-rw-r--r--frontend/src/app/experiment/experiment.component.html14
-rw-r--r--frontend/src/app/experiment/experiment.component.ts12
-rw-r--r--frontend/src/app/training/training.component.html2
-rw-r--r--frontend/src/app/training/training.component.ts7
9 files changed, 35 insertions, 16 deletions
diff --git a/frontend/src/app/_elements/model-load/model-load.component.ts b/frontend/src/app/_elements/model-load/model-load.component.ts
index 0799b4d4..fb4b3fd0 100644
--- a/frontend/src/app/_elements/model-load/model-load.component.ts
+++ b/frontend/src/app/_elements/model-load/model-load.component.ts
@@ -59,7 +59,7 @@ export class ModelLoadComponent implements OnInit {
else {
this.modelsService.getMyModelsByType(ProblemType.Regression).subscribe((models) => {
this.myModels = models;
- console.log("modeli po tipu: ", this.myModels);
+ //console.log("modeli po tipu: ", this.myModels);
});
}*/
}
diff --git a/frontend/src/app/_elements/notifications/notifications.component.ts b/frontend/src/app/_elements/notifications/notifications.component.ts
index 9b460240..f324662a 100644
--- a/frontend/src/app/_elements/notifications/notifications.component.ts
+++ b/frontend/src/app/_elements/notifications/notifications.component.ts
@@ -24,7 +24,7 @@ export class NotificationsComponent implements OnInit {
this.signalRService.hubConnection.on("NotifyEpoch", (mName: string, mId: string, stat: string, totalEpochs: number, currentEpoch: number) => {
const existingNotification = this.notifications.find(x => x.id === mId)
const progress = ((currentEpoch + 1) / totalEpochs);
- console.log("Ukupno epoha", totalEpochs, "Trenutna epoha:", currentEpoch);
+ //console.log("Ukupno epoha", totalEpochs, "Trenutna epoha:", currentEpoch);
if (!existingNotification)
this.notifications.push(new Notification(`Treniranje modela: ${mName}`, mId, progress, true));
else {
diff --git a/frontend/src/app/_services/signal-r.service.ts b/frontend/src/app/_services/signal-r.service.ts
index b279b5ca..109fc9e5 100644
--- a/frontend/src/app/_services/signal-r.service.ts
+++ b/frontend/src/app/_services/signal-r.service.ts
@@ -16,13 +16,13 @@ export class SignalRService {
}).build();
this.hubConnection.on("Notify", (message: string) => {
- console.log(" " + message);
+ //console.log(" " + message);
});
this.hubConnection
.start()
- .then(() => console.log("con Started"))
- .catch(err => console.log("Error" + err))
+ .then(() => {})
+ .catch(err => {})
}
constructor(private cookie: CookieService) { }
}
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts
index 59f247ed..54c18bec 100644
--- a/frontend/src/app/app.component.ts
+++ b/frontend/src/app/app.component.ts
@@ -50,7 +50,6 @@ export class AppComponent implements OnInit {
private startHttpRequest = () => {
this.http.get('http://localhost:5283/chatHub')
.subscribe(res => {
- console.log(res);
})
}
diff --git a/frontend/src/app/experiment/experiment.component.css b/frontend/src/app/experiment/experiment.component.css
index 4a3d7741..d84a897e 100644
--- a/frontend/src/app/experiment/experiment.component.css
+++ b/frontend/src/app/experiment/experiment.component.css
@@ -40,4 +40,9 @@ ul li:hover {
h2 {
color: #003459;
+}
+
+.boldClass {
+ font-weight: bold;
+ font-size: 125%;
} \ No newline at end of file
diff --git a/frontend/src/app/experiment/experiment.component.html b/frontend/src/app/experiment/experiment.component.html
index ffc1db9d..4675236c 100644
--- a/frontend/src/app/experiment/experiment.component.html
+++ b/frontend/src/app/experiment/experiment.component.html
@@ -4,12 +4,12 @@
<div id="wrapper">
<div id="container" class="container p-5" style="background-color: white; min-height: 100%;">
- <div class="d-flex flex-row justify-content-center align-items-center my-3">
- <a href="#" data-bs-target="#carouselExampleControls" data-bs-slide-to="0">Izvor podataka</a>
+ <div class="d-flex flex-row justify-content-center align-items-center my-3 links">
+ <a href="#" data-bs-target="#carouselExampleControls" data-bs-slide-to="0" (click)="updateCarouselIndex(0)" [ngClass]="{'boldClass' : carouselIndex == 0}" style="text-decoration: none">Izvor podataka</a>
<mat-icon>arrow_forward</mat-icon>
- <a href="#" data-bs-target="#carouselExampleControls" data-bs-slide-to="1">Preprocesiranje</a>
+ <a href="#" data-bs-target="#carouselExampleControls" data-bs-slide-to="1" (click)="updateCarouselIndex(1)" [ngClass]="{'boldClass' : carouselIndex == 1}" style="text-decoration: none">Preprocesiranje</a>
<mat-icon>arrow_forward</mat-icon>
- <a href="#" data-bs-target="#carouselExampleControls" data-bs-slide-to="2">Dodaj eksperiment</a>
+ <a href="#" data-bs-target="#carouselExampleControls" data-bs-slide-to="2" (click)="updateCarouselIndex(2)" [ngClass]="{'boldClass' : carouselIndex == 2}" style="text-decoration: none">Dodaj eksperiment</a>
</div>
<div id="carouselExampleControls" class="carousel slide px-5 mt-5" data-bs-wrap="false" data-bs-ride="carousel" data-bs-interval="false">
@@ -244,11 +244,11 @@
</div>
- <div class="m-3 d-flex flex-row justify-content-between align-items-center" style=" margin-left: auto;">
- <button mat-fab color="primary" data-bs-target="#carouselExampleControls" data-bs-slide="prev">
+ <div class="m-3 d-flex flex-row align-items-center" style=" margin-left: auto;">
+ <button class="me-auto" *ngIf="carouselIndex != 0" mat-fab color="primary" data-bs-target="#carouselExampleControls" data-bs-slide="prev" (click)="updateCarouselIndex(carouselIndex - 1)">
<mat-icon>arrow_backward</mat-icon>
</button>
- <button mat-fab color="primary" data-bs-target="#carouselExampleControls" data-bs-slide="next">
+ <button class="ms-auto" *ngIf="carouselIndex != 2" mat-fab color="primary" data-bs-target="#carouselExampleControls" data-bs-slide="next" (click)="updateCarouselIndex(carouselIndex + 1)">
<mat-icon>arrow_forward</mat-icon>
</button>
</div>
diff --git a/frontend/src/app/experiment/experiment.component.ts b/frontend/src/app/experiment/experiment.component.ts
index 75c8e0d8..1533ceb3 100644
--- a/frontend/src/app/experiment/experiment.component.ts
+++ b/frontend/src/app/experiment/experiment.component.ts
@@ -8,7 +8,7 @@ import { ExperimentsService } from '../_services/experiments.service';
import { ColumnEncoding } from '../_data/Experiment';
import { Router } from '@angular/router';
import { TrainingComponent } from '../training/training.component';
-import { retryWhen } from 'rxjs';
+import { NEVER, retryWhen } from 'rxjs';
@Component({
selector: 'app-experiment',
@@ -32,6 +32,7 @@ export class ExperimentComponent implements OnInit {
selectedNotNullColumnsArray: string[] = [];
tempTestSetDistribution = 90;
+ carouselIndex: number = 0;
constructor(private experimentsService: ExperimentsService, private router: Router) {
}
@@ -219,4 +220,13 @@ export class ExperimentComponent implements OnInit {
}
return counter;
}
+
+ updateCarouselIndex(newIndex: number) {
+ if (newIndex > 2)
+ newIndex = 2;
+ else if (newIndex < 0)
+ newIndex = 0;
+
+ this.carouselIndex = newIndex;
+ }
}
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;
});
}
}