aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/notifications/notifications.component.ts
diff options
context:
space:
mode:
authorDanijel Anđelković <adanijel99@gmail.com>2022-04-13 22:14:47 +0200
committerDanijel Anđelković <adanijel99@gmail.com>2022-04-13 22:14:47 +0200
commita8c050790da92cb0b0bf4a0ca4e4fbea17eacc2e (patch)
tree2ee15de1055c4860b0c8ab4e666218f90fb31804 /frontend/src/app/_elements/notifications/notifications.component.ts
parent27f41c923c8142a2e71d390fc73e8c6baa52a734 (diff)
Dodao hvatanje notifikacija o treniranoj epohi / procesovanom datasetu na frontendu.
Diffstat (limited to 'frontend/src/app/_elements/notifications/notifications.component.ts')
-rw-r--r--frontend/src/app/_elements/notifications/notifications.component.ts22
1 files changed, 14 insertions, 8 deletions
diff --git a/frontend/src/app/_elements/notifications/notifications.component.ts b/frontend/src/app/_elements/notifications/notifications.component.ts
index 5863f669..cad8a95f 100644
--- a/frontend/src/app/_elements/notifications/notifications.component.ts
+++ b/frontend/src/app/_elements/notifications/notifications.component.ts
@@ -9,19 +9,25 @@ import Notification from 'src/app/_data/Notification';
})
export class NotificationsComponent implements OnInit {
- notifications?: Notification[];
+ notifications: Notification[] = [];
closed: boolean = false;
- constructor(private signalRService:SignalRService) {
- this.notifications = [
- new Notification("Titanik (Preziveli)", "79768456867", 0.2),
- new Notification("Test Prediktor 1", "56758768678", 0.4),
- new Notification("Test Prediktor 2", "11344556425", 0.7)
- ]
+ constructor(private signalRService: SignalRService) {
+
}
ngOnInit(): void {
- // this.wsService.send('test');
+ if (this.signalRService.hubConnection) {
+ this.signalRService.hubConnection.on("NotifyDataset", (message: string) => {
+ this.notifications.push(new Notification(message, "datasetIDOvde!!!", 1.0));
+ });
+
+ this.signalRService.hubConnection.on("NotifyEpoch", (message: string) => {
+ this.notifications.push(new Notification(message, "predictorIDOvde!!!", 0.5 /*(epoch / model.epochs)*/));
+ });
+ } else {
+ console.warn("Notifications: No connection!");
+ }
}
}