| @@ -32,7 +32,8 @@ | |||
| "styles": [ | |||
| "@angular/material/prebuilt-themes/indigo-pink.css", | |||
| "src/styles.scss", | |||
| "node_modules/leaflet/dist/leaflet.css" | |||
| "node_modules/leaflet/dist/leaflet.css", | |||
| "node_modules/ngx-toastr/toastr.css" | |||
| ], | |||
| "scripts": [], | |||
| "allowedCommonJsDependencies": [ | |||
| @@ -24,6 +24,7 @@ | |||
| "@asymmetrik/ngx-leaflet": "^16.0.1", | |||
| "@asymmetrik/ngx-leaflet-markercluster": "^16.0.0", | |||
| "leaflet": "^1.9.4", | |||
| "ngx-toastr": "^17.0.2", | |||
| "rtsp-relay": "^1.8.0", | |||
| "rxjs": "~7.8.0", | |||
| "rxjs-websockets": "^9.0.0", | |||
| @@ -7,6 +7,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |||
| import {SharedModule} from "./shared/shared.module"; | |||
| import {HttpClientModule} from "@angular/common/http"; | |||
| import {AppInitService} from "./shared/services/app-init.service"; | |||
| import { ToastrModule } from 'ngx-toastr'; | |||
| export function appInitializerFactory(appInitializerService: AppInitService): () => Promise<any> { | |||
| return () => appInitializerService.initializeApp(); | |||
| @@ -22,7 +23,8 @@ export function appInitializerFactory(appInitializerService: AppInitService): () | |||
| AppRoutingModule, | |||
| BrowserAnimationsModule, | |||
| SharedModule, | |||
| HttpClientModule | |||
| HttpClientModule, | |||
| ToastrModule.forRoot(), // ToastrModule added | |||
| ], | |||
| providers: [ | |||
| @@ -1,6 +1,7 @@ | |||
| import { Component, OnDestroy, OnInit } from '@angular/core'; | |||
| import {SocketService} from "../../../shared/services/socket.service"; | |||
| import {Subscription} from "rxjs"; | |||
| import {ToastrService} from "ngx-toastr"; | |||
| @Component({ | |||
| selector: 'app-overall-ground', | |||
| @@ -24,7 +25,10 @@ export class OverallGroundComponent implements OnInit, OnDestroy { | |||
| private intervalId: any; | |||
| constructor(private socketService$: SocketService) { | |||
| constructor( | |||
| private socketService$: SocketService, | |||
| private toastr: ToastrService | |||
| ) { | |||
| } | |||
| ngOnInit() { | |||
| @@ -88,6 +92,9 @@ export class OverallGroundComponent implements OnInit, OnDestroy { | |||
| this.Sstate1 = this.state1 === 'ON';// alarm 12h | |||
| this.Sstate2 = this.state2 === 'ON';// alarm 1h | |||
| if (message.ready === '0'){ | |||
| this.toastr.warning('System not ready', 'Warning', {timeOut: 5000}); | |||
| } | |||
| } | |||
| } | |||