aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_elements/notifications')
-rw-r--r--frontend/src/app/_elements/notifications/notifications.component.html9
-rw-r--r--frontend/src/app/_elements/notifications/notifications.component.ts10
2 files changed, 12 insertions, 7 deletions
diff --git a/frontend/src/app/_elements/notifications/notifications.component.html b/frontend/src/app/_elements/notifications/notifications.component.html
index 4e33f77c..ef897cfc 100644
--- a/frontend/src/app/_elements/notifications/notifications.component.html
+++ b/frontend/src/app/_elements/notifications/notifications.component.html
@@ -1,5 +1,10 @@
<div *ngIf="notifications && notifications.length > 0" class="position-fixed card card-body p-1 m-3" style="bottom: 0; right: 0; width: 18rem;">
- <h2 class="m-auto" (click)="closed = !closed;" data-bs-toggle="collapse" href="#collapseNotifs" role="button" aria-expanded="true" aria-controls="collapseNotifs">Notifikacije
+ <h2 class="m-auto" (click)="closed = !closed;" data-bs-toggle="collapse" href="#collapseNotifs" role="button" aria-expanded="true" aria-controls="collapseNotifs">
+ Notifikacije
+ <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
+ {{notifications.length}}
+ <span class="visually-hidden">unread notifications</span>
+ </span>
<button class="border-0 bg-white">
<mat-icon class="position-absolute" style="top: 8px; right: 12px;">{{closed ? 'keyboard_arrow_up' :
'keyboard_arrow_down'}}</mat-icon>
@@ -11,7 +16,7 @@
<div class="d-flex flex-row">
<p>{{notification.title}}</p>
</div>
- <div class="border-3 border-primary bg-dark m-1" style="height: 5px; margin-top: -10px !important;">
+ <div *ngIf="notification.hasProgress" class="border-3 border-primary bg-dark m-1" style="height: 5px; margin-top: -10px !important;">
<div class="bg-primary" style="height: 5px;" [style]="'width: '+(notification.progress*100)+'%;'">
</div>
</div>
diff --git a/frontend/src/app/_elements/notifications/notifications.component.ts b/frontend/src/app/_elements/notifications/notifications.component.ts
index cad8a95f..e199f70a 100644
--- a/frontend/src/app/_elements/notifications/notifications.component.ts
+++ b/frontend/src/app/_elements/notifications/notifications.component.ts
@@ -13,17 +13,17 @@ export class NotificationsComponent implements OnInit {
closed: boolean = false;
constructor(private signalRService: SignalRService) {
-
}
ngOnInit(): void {
if (this.signalRService.hubConnection) {
- this.signalRService.hubConnection.on("NotifyDataset", (message: string) => {
- this.notifications.push(new Notification(message, "datasetIDOvde!!!", 1.0));
+ this.signalRService.hubConnection.on("NotifyDataset", (dName: string, dId: string) => {
+ this.notifications.push(new Notification(`Obrađen izvor podataka: ${dName}`, dId, 1.0, false));
});
- this.signalRService.hubConnection.on("NotifyEpoch", (message: string) => {
- this.notifications.push(new Notification(message, "predictorIDOvde!!!", 0.5 /*(epoch / model.epochs)*/));
+ 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));
});
} else {
console.warn("Notifications: No connection!");