From f0f9a128076f2f0deae8f597dd780527b54819dd Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Sun, 17 Apr 2022 17:25:22 +0200 Subject: Izmenjen izgled item-predictor i my-predictors, dodata funkcija za brisanje prediktora u predictors.component.ts. --- .../item-predictor/item-predictor.component.html | 35 ++++++++++++-------- .../my-predictors/my-predictors.component.html | 27 +++++++++------ .../my-predictors/my-predictors.component.ts | 38 ++++++++++++---------- 3 files changed, 59 insertions(+), 41 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/app/_elements/item-predictor/item-predictor.component.html b/frontend/src/app/_elements/item-predictor/item-predictor.component.html index 7ae26fd3..3199dcc8 100644 --- a/frontend/src/app/_elements/item-predictor/item-predictor.component.html +++ b/frontend/src/app/_elements/item-predictor/item-predictor.component.html @@ -1,26 +1,35 @@
-
- {{predictor.name}} +
+ +
Prediktor
+
-
+
+ Opis

- {{predictor.description}} + {{predictor.description}}

-
- + + Ulazne kolone +
+ +
- +
{{column}}{{column}}
- arrow_downward -

- {{predictor.output}} -

+
+ Izlazna kolona: {{predictor.output}} +
+
+ + +
calendar_today Kreirano{{predictor.dateCreated |date}}
\ No newline at end of file diff --git a/frontend/src/app/_pages/my-predictors/my-predictors.component.html b/frontend/src/app/_pages/my-predictors/my-predictors.component.html index d38f93e4..31fa786c 100644 --- a/frontend/src/app/_pages/my-predictors/my-predictors.component.html +++ b/frontend/src/app/_pages/my-predictors/my-predictors.component.html @@ -1,16 +1,23 @@ -
-
-
- -
-
- -
- +
+
+
+ +
+
+
+
+ +
+ +
+
+
+
-
+ + diff --git a/frontend/src/app/_pages/my-predictors/my-predictors.component.ts b/frontend/src/app/_pages/my-predictors/my-predictors.component.ts index 17c496fd..4dc5300d 100644 --- a/frontend/src/app/_pages/my-predictors/my-predictors.component.ts +++ b/frontend/src/app/_pages/my-predictors/my-predictors.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import Predictor from 'src/app/_data/Predictor'; import { PredictorsService } from 'src/app/_services/predictors.service'; - +import shared from 'src/app/Shared'; @Component({ selector: 'app-my-predictors', templateUrl: './my-predictors.component.html', @@ -12,28 +12,30 @@ export class MyPredictorsComponent implements OnInit { constructor(private predictorsS : PredictorsService) { } ngOnInit(): void { - this.getAllMyPredictors(); - + this.predictorsS.getMyPredictors().subscribe((response) => { + this.predictors = response; + }, (error) => { + if (error.error == "Predictor with...") { + shared.openDialog("Greska", "Greska"); + } + }); } - delete(predictor: Predictor){ - if(window.confirm("IZABRANI MODEL ĆE BITI IZBRISAN")) - { - this.predictorsS.deletePredictor(predictor).subscribe((response) => { - this.getAllMyPredictors(); - }, (error) =>{ - if (error.error == "Predictor with name = {name} deleted") { - alert("Greška pri brisanju modela!"); - } - }); - } - - + deleteThisPredictor(predictor: Predictor): void{ + shared.openYesNoDialog('Brisanje prediktora','Da li ste sigurni da želite da obrišete prediktor?',() => { + this.predictorsS.deletePredictor(predictor).subscribe((response) => { + this.getAllMyPredictors(); + }, (error) =>{ + if (error.error == "Predictor with name = {name} deleted") { + shared.openDialog("Obaveštenje", "Greška prilikom brisanja prediktora."); + } + }); + }); } getAllMyPredictors(): void{ - this.predictorsS.getMyPredictors().subscribe(m => { - this.predictors = m; + this.predictorsS.getMyPredictors().subscribe(p => { + this.predictors = p; }); } -- cgit v1.2.3 From 57f235fc814473f5be947e2b31e7d57f83fcbdd8 Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Sun, 17 Apr 2022 21:52:27 +0200 Subject: Sredio komponentu za notifikacije, tako da moze da se skroluje ako ima puno notifikacija i da mogu da se obrisu notifikacije. Ako stigne notifikacija treniranja za isti model iz prethodne notifikacije, prethodna se prepisuje. --- frontend/src/app/_data/Notification.ts | 1 - .../notifications/notifications.component.html | 16 ++++++++----- .../notifications/notifications.component.ts | 26 +++++++++++++++++++--- 3 files changed, 33 insertions(+), 10 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/app/_data/Notification.ts b/frontend/src/app/_data/Notification.ts index c505d399..94a3be1d 100644 --- a/frontend/src/app/_data/Notification.ts +++ b/frontend/src/app/_data/Notification.ts @@ -1,5 +1,4 @@ export default class Notification { - _id: string = ''; constructor( public title: string = 'Treniranje u toku...', public id: string = '042', diff --git a/frontend/src/app/_elements/notifications/notifications.component.html b/frontend/src/app/_elements/notifications/notifications.component.html index ef897cfc..3b2f4eaa 100644 --- a/frontend/src/app/_elements/notifications/notifications.component.html +++ b/frontend/src/app/_elements/notifications/notifications.component.html @@ -11,14 +11,18 @@ -
+
-
-

{{notification.title}}

-
-
-
+
+
+

{{notification.title}}

+
+
+
+
+
+
\ No newline at end of file diff --git a/frontend/src/app/_elements/notifications/notifications.component.ts b/frontend/src/app/_elements/notifications/notifications.component.ts index e199f70a..9b460240 100644 --- a/frontend/src/app/_elements/notifications/notifications.component.ts +++ b/frontend/src/app/_elements/notifications/notifications.component.ts @@ -21,13 +21,33 @@ export class NotificationsComponent implements OnInit { this.notifications.push(new Notification(`Obrađen izvor podataka: ${dName}`, dId, 1.0, false)); }); - this.signalRService.hubConnection.on("NotifyEpoch", (epoch: string, mName: string, mId: string, numEpochs) => { - //todo epoch - this.notifications.push(new Notification(`Treniranje modela: ${mName}`, mId, 0.5)); + 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); + if (!existingNotification) + this.notifications.push(new Notification(`Treniranje modela: ${mName}`, mId, progress, true)); + else { + existingNotification.progress = progress; + } + }); + + this.signalRService.hubConnection.on("NotifyModel", (mName: string, mId: string, stat: string, totalEpochs: number, currentEpoch: number) => { + const existingNotification = this.notifications.find(x => x.id === mId) + const progress = ((currentEpoch + 1) / totalEpochs); + if (!existingNotification) + this.notifications.push(new Notification(`Treniranje modela: ${mName}`, mId, progress, true)); + else { + existingNotification.progress = progress; + } }); } else { console.warn("Notifications: No connection!"); } } + removeNotification(notification: Notification) { + this.notifications.splice(this.notifications.indexOf(notification), 1); + } + } -- cgit v1.2.3 From 4df9512443b2a12c955379860bf759d7d7c9d388 Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Sun, 17 Apr 2022 23:41:44 +0200 Subject: Uklonjen datum iz treniraj model, broj uzoraka po iteraciji je predstavljen stepenom dvojke, dodat je broj epoha, promenjen naziv funkcije gubitka, dodata ruta. --- .../_elements/model-load/model-load.component.html | 48 ++++++++++++++++------ .../_elements/model-load/model-load.component.ts | 5 +++ frontend/src/app/app-routing.module.ts | 2 + 3 files changed, 42 insertions(+), 13 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/app/_elements/model-load/model-load.component.html b/frontend/src/app/_elements/model-load/model-load.component.html index f40ea476..85caca0d 100644 --- a/frontend/src/app/_elements/model-load/model-load.component.html +++ b/frontend/src/app/_elements/model-load/model-load.component.html @@ -43,11 +43,7 @@
-
-    - -
+

Parametri treniranja modela:

@@ -58,7 +54,7 @@
- +
- + + + {{newModel.batchSize}} + +
+ +
+
+
+ +
+
+ +
@@ -147,8 +169,8 @@
#{{i+1}}
-
-   -