diff options
author | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-20 01:13:38 +0200 |
---|---|---|
committer | Sonja Galovic <galovicsonja@gmail.com> | 2022-04-20 01:13:38 +0200 |
commit | 314e7ff51cdbb49e5d30c6a67bcfa80a42736948 (patch) | |
tree | 54b70ca34406806ea0499a01fe95d16a43059651 /frontend/src/app | |
parent | 092ea8c9a0a80857e2da47abc789d48d79af405a (diff) |
Dugme za treniranje se disable-uje dok traje treniranje. Podesene strelice za navigaciju i linkovi kod pravljenja eksperimenta. Obrisani/zakomentarisani console.logovi na frontu.
Diffstat (limited to 'frontend/src/app')
10 files changed, 37 insertions, 20 deletions
diff --git a/frontend/src/app/_elements/metric-view/metric-view.component.ts b/frontend/src/app/_elements/metric-view/metric-view.component.ts index 76dd7d20..18b0d1ad 100644 --- a/frontend/src/app/_elements/metric-view/metric-view.component.ts +++ b/frontend/src/app/_elements/metric-view/metric-view.component.ts @@ -16,13 +16,13 @@ export class MetricViewComponent implements OnInit { if(this.signalRService.hubConnection) { this.signalRService.hubConnection.on("NotifyEpoch", (mName: string, mId: string, stat: string, totalEpochs: number, currentEpoch: number) => { - console.log(stat) - console.log(totalEpochs) + //console.log(stat) + //console.log(totalEpochs) const data=JSON.parse(stat) for (let key in data) { let value = data[key]; - console.log(value) + //console.log(value) } }); 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 8bf8fd93..8fe864b7 100644 --- a/frontend/src/app/_elements/model-load/model-load.component.ts +++ b/frontend/src/app/_elements/model-load/model-load.component.ts @@ -57,7 +57,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 2bee3b12..0849d0c3 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 4c38f166..bff3304f 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'; @@ -17,6 +17,8 @@ import { SignalRService } from '../_services/signal-r.service'; export class TrainingComponent implements OnInit { @ViewChild(ModelLoadComponent) modelLoadComponent?: ModelLoadComponent; + @ViewChild("trainButton") trainButtonRef!: ElementRef; + myExperiments?: Experiment[]; selectedExperiment?: Experiment; @@ -55,7 +57,6 @@ export class TrainingComponent implements OnInit { this.myExperiments = experiments; this.selectedExperiment = this.myExperiments.filter(x => x._id == andSelectWithId)[0]; - console.log("selektovan exp u training comp: ", this.selectedExperiment); }); } @@ -80,8 +81,10 @@ 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 uspešno završeno!"); this.trainingResult = response; }); |