Browse Source

Merge branch 'master' into features/camera

features/camera
PhamY0601 1 year ago
parent
commit
8aa0d5b551
3 changed files with 29 additions and 22 deletions
  1. +2
    -1
      angular.json
  2. +9
    -1
      src/app/app.module.ts
  3. +18
    -20
      src/app/modules/overview/overall-ground/overall-ground.component.html

+ 2
- 1
angular.json View File

"styles": [ "styles": [
"@angular/material/prebuilt-themes/indigo-pink.css", "@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss", "src/styles.scss",
"node_modules/leaflet/dist/leaflet.css"
"node_modules/leaflet/dist/leaflet.css",
"node_modules/ngx-toastr/toastr.css"
], ],
"scripts": [], "scripts": [],
"allowedCommonJsDependencies": [ "allowedCommonJsDependencies": [

+ 9
- 1
src/app/app.module.ts View File

import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {SharedModule} from "./shared/shared.module"; import {SharedModule} from "./shared/shared.module";
import {HttpClientModule} from "@angular/common/http"; import {HttpClientModule} from "@angular/common/http";
import { ToastrModule } from 'ngx-toastr';






@NgModule({ @NgModule({
AppRoutingModule, AppRoutingModule,
BrowserAnimationsModule, BrowserAnimationsModule,
SharedModule, SharedModule,
HttpClientModule
HttpClientModule,
ToastrModule.forRoot({
maxOpened: 1,
preventDuplicates: true,
autoDismiss: true
}), // ToastrModule added
], ],
providers: [], providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]

+ 18
- 20
src/app/modules/overview/overall-ground/overall-ground.component.html View File



<div class="state t2" id="State2"> <div class="state t2" id="State2">
<div> <div>
<div [ngClass]="{'sensor-on': Sstate3,
'sensor-off': !(Sstate3)}">
<img [src]="Sstate3 ? 'assets/images/sensor-on.png' : 'assets/images/sensor-off.png'" style="width: 30px; height: 30px">
<div class="sensor-off" [class.sensor-on]="(state1 && state5 && isReady)">
<img [src]="state5 ? 'assets/images/sensor-on.png' : 'assets/images/sensor-off.png'" style="width: 30px; height: 30px">
</div> </div>
<a href="/overview/camera-stream" target="_blank"> <a href="/overview/camera-stream" target="_blank">
<img style="width: 30px; height: 30px;" src="assets/images/camera.png"> <img style="width: 30px; height: 30px;" src="assets/images/camera.png">
</a> </a>
</div> </div>
<div *ngIf="Sstate3" class="alarm-text"
[ngClass]="{'alarm-text-on': Sstate3 }">ALARM: <br>VIBRATION ALERT</div>
<div *ngIf="(state1 && state5 && isReady)" class="alarm-text"
[ngClass]="{'alarm-text-on': (state1 && state5 && isReady) }">ALARM: <br>VIBRATION ALERT</div>
</div> </div>


<div class="state t3" id="State3"> <div class="state t3" id="State3">
<div> <div>
<div [ngClass]="{'sensor-on': Sstate4,
'sensor-off': !(Sstate4)}">
<img [src]="Sstate4 ? 'assets/images/sensor-on.png' : 'assets/images/sensor-off.png'" style="width: 30px; height: 30px">
<div class="sensor-off" [class.sensor-on]="(state2 && state5 && isReady)">
<img [src]="state5 ? 'assets/images/sensor-on.png' : 'assets/images/sensor-off.png'" style="width: 30px; height: 30px">
</div> </div>
<a href="/overview/camera-stream" target="_blank"> <a href="/overview/camera-stream" target="_blank">
<img style="width: 30px; height: 30px;" src="assets/images/camera.png"> <img style="width: 30px; height: 30px;" src="assets/images/camera.png">
</a> </a>
</div> </div>
<div *ngIf="Sstate4" class="alarm-text"
[ngClass]="{'alarm-text-on': Sstate4 }">ALARM: <br>DOOR OPENING</div>
<div *ngIf="(state2 && state5 && isReady)" class="alarm-text"
[ngClass]="{'alarm-text-on': (state2 && state5 && isReady) }">ALARM: <br>DOOR OPENING</div>
</div> </div>
<div class="state t4" id="State4"> <div class="state t4" id="State4">
<div> <div>
</div> </div>
<div class="state t5 tooltip" id="State5" > <div class="state t5 tooltip" id="State5" >
<div> <div>
<div [ngClass]="{'sensor-on': Sstate1 && Sstate2,
'sensor-off': !(Sstate1 && Sstate2)}">
<div [ngClass]="{'sensor-on': state5 && state6,
'sensor-off': !(state5 && state6)}">
<img [src]="getImageSource()" style="width: 30px; height: 30px"> <img [src]="getImageSource()" style="width: 30px; height: 30px">
</div> </div>
<a href="/overview/camera-stream" target="_blank"> <a href="/overview/camera-stream" target="_blank">
</a> </a>
</div> </div>


<div *ngIf="Sstate1 && Sstate2" class="alarm-text"
[ngClass]="{'alarm-text-on': Sstate1 && Sstate2 }">ALARM: <br>VIBRATION ALERT</div>
<div *ngIf="state5 && state6" class="alarm-text"
[ngClass]="{'alarm-text-on': state5 && state6 }">ALARM: <br>VIBRATION ALERT</div>


</div> </div>
<div class="state t6 tooltip" id="State6"> <div class="state t6 tooltip" id="State6">
<div> <div>
<div [ngClass]="{'sensor-on': Sstate1 && Sstate2,
'sensor-off': !(Sstate1 && Sstate2)}">
<div [ngClass]="{'sensor-on': state5 && state6,
'sensor-off': !(state5 && state6)}">
<img [src]="getImageSource()" style="width: 30px; height: 30px"> <img [src]="getImageSource()" style="width: 30px; height: 30px">
</div> </div>
<a href="/overview/camera-stream" target="_blank"> <a href="/overview/camera-stream" target="_blank">
<img style="width: 30px; height: 30px;" src="assets/images/camera.png"> <img style="width: 30px; height: 30px;" src="assets/images/camera.png">
</a> </a>
</div> </div>
<div *ngIf="Sstate1 && Sstate2" class="alarm-text"
[ngClass]="{'alarm-text-on': Sstate1 && Sstate2 }">ALARM: <br>SMOKE ALERT</div>
<div *ngIf="state5 && state6" class="alarm-text"
[ngClass]="{'alarm-text-on': state5 && state6 }">ALARM: <br>SMOKE ALERT</div>
</div> </div>
</div> </div>
</div> </div>
<div fxFlex="30" fxLayout="column" fxLayoutGap="50px"> <div fxFlex="30" fxLayout="column" fxLayoutGap="50px">
<button [disabled]="!isConnected" mat-flat-button color="{{Sstate1 ? 'accent' : 'primary'}}" (click)="toggleState1()">{{ Sstate1 ? 'DISARM' : 'ARM'}}</button>
<button [disabled]="!isConnected" mat-flat-button color="{{Sstate2 ? 'accent' : 'primary'}}" (click)="toggleState2()">{{ Sstate2 ? 'TURN OFF WARNING' : 'TURN ON WARNING'}}</button>
<button [disabled]="!isConnected" mat-flat-button color="{{switchArm ? 'accent' : 'primary'}}" (click)="toggleState1()">{{ switchArm ? 'DISARM' : 'ARM'}}</button>
<button [disabled]="!isConnected" mat-flat-button color="{{switchWarning ? 'accent' : 'primary'}}" (click)="toggleState2()">{{ switchWarning ? 'TURN OFF WARNING' : 'TURN ON WARNING'}}</button>
<a style = "padding: 30px 50px;" mat-stroked-button color="primary" href="/overview/camera-stream" target="_blank"> LIVE CAMERA </a> <a style = "padding: 30px 50px;" mat-stroked-button color="primary" href="/overview/camera-stream" target="_blank"> LIVE CAMERA </a>


</div> </div>

Loading…
Cancel
Save