Browse Source

refactor

pull/6/head
Trung Nguyen 1 year ago
parent
commit
a2b36e7c38
9 changed files with 20 additions and 17 deletions
  1. +1
    -1
      .gitignore
  2. +5
    -5
      angular.json
  3. BIN
      dist.zip
  4. +2
    -3
      dist/lot-web-ui/index.html
  5. +1
    -0
      package.json
  6. +2
    -2
      src/app/modules/overview/camera-stream/camera-stream.component.ts
  7. +3
    -1
      src/app/modules/overview/map/map.component.ts
  8. +2
    -2
      src/app/modules/overview/overall-ground/overall-ground.component.html
  9. +4
    -3
      src/app/modules/overview/overall-ground/overall-ground.component.ts

+ 1
- 1
.gitignore View File

!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
.history/* .history/*
dist/*
# Miscellaneous # Miscellaneous
/.angular/cache /.angular/cache
.sass-cache/ .sass-cache/

+ 5
- 5
angular.json View File

"budgets": [ "budgets": [
{ {
"type": "initial", "type": "initial",
"maximumWarning": "500kb",
"maximumWarning": "1mb",
"maximumError": "1mb" "maximumError": "1mb"
}, },
{ {
"type": "anyComponentStyle", "type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
"maximumWarning": "1mb",
"maximumError": "1mb"
} }
], ],
"outputHashing": "all" "outputHashing": "all"
}, },
"development": { "development": {
"buildOptimizer": false,
"optimization": false,
"buildOptimizer": true,
"optimization": true,
"vendorChunk": true, "vendorChunk": true,
"extractLicenses": false, "extractLicenses": false,
"sourceMap": true, "sourceMap": true,

BIN
dist.zip View File


+ 2
- 3
dist/lot-web-ui/index.html
File diff suppressed because it is too large
View File


+ 1
- 0
package.json View File

"@asymmetrik/ngx-leaflet": "^16.0.1", "@asymmetrik/ngx-leaflet": "^16.0.1",
"@asymmetrik/ngx-leaflet-markercluster": "^16.0.0", "@asymmetrik/ngx-leaflet-markercluster": "^16.0.0",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"rtsp-relay": "^1.8.0",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"rxjs-websockets": "^9.0.0", "rxjs-websockets": "^9.0.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",

+ 2
- 2
src/app/modules/overview/camera-stream/camera-stream.component.ts View File

export class CameraStreamComponent implements OnInit, AfterViewInit{ export class CameraStreamComponent implements OnInit, AfterViewInit{
player?: Player; player?: Player;


@ViewChild('videoPlayer')
videoPlayer?: ElementRef<HTMLCanvasElement>;
// @ViewChild('videoPlayer')
// videoPlayer?: ElementRef<HTMLCanvasElement>;


ngOnInit() { ngOnInit() {
} }

+ 3
- 1
src/app/modules/overview/map/map.component.ts View File

ngOnInit() { ngOnInit() {
this.statusSubscription = this.socketService$.status$.subscribe(isConnected => { this.statusSubscription = this.socketService$.status$.subscribe(isConnected => {
if (isConnected) { if (isConnected) {
let str = {id: '0', type: 'get'};
this.socketService$.sendMessage(str);
this.messageSubscription = this.socketService$.messages$.subscribe(message => { this.messageSubscription = this.socketService$.messages$.subscribe(message => {
this.onMessage(message); this.onMessage(message);
}); });


updateIcons(): void { updateIcons(): void {
this.map.eachLayer((layer:any) => { this.map.eachLayer((layer:any) => {
if (layer instanceof L.Marker) {
if (layer instanceof L.Marker as any) {
this.map.removeLayer(layer); this.map.removeLayer(layer);
} }
}); });

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

<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>
<ng-template [ngIf]="Sstate1 && Sstate2">
<ng-template *ngIf="Sstate1 && Sstate2">
<div class="alarm-text" <div class="alarm-text"
[ngClass]="{'alarm-text-on': Sstate1 && Sstate2 }">ALARM: <br>VIBRATION ALERT</div> [ngClass]="{'alarm-text-on': Sstate1 && Sstate2 }">ALARM: <br>VIBRATION ALERT</div>
</ng-template> </ng-template>
<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>
<ng-template [ngIf]="Sstate1 && Sstate2">
<ng-template *ngIf="Sstate1 && Sstate2">
<div class="alarm-text" <div class="alarm-text"
[ngClass]="{'alarm-text-on': Sstate1 && Sstate2 }">ALARM: <br>SMOKE ALERT</div> [ngClass]="{'alarm-text-on': Sstate1 && Sstate2 }">ALARM: <br>SMOKE ALERT</div>
</ng-template> </ng-template>

+ 4
- 3
src/app/modules/overview/overall-ground/overall-ground.component.ts View File

// this.socketService$.connect(); // this.socketService$.connect();
this.statusSubscription = this.socketService$.status$.subscribe(isConnected => { this.statusSubscription = this.socketService$.status$.subscribe(isConnected => {
this.isConnected = isConnected; this.isConnected = isConnected;
this.getReadings();
if (this.isConnected) { if (this.isConnected) {
this.intervalId = setInterval(() => this.getReadings(), 2000);
this.intervalId = setInterval(() => this.getReadings(), 5000);
this.messageSubscription = this.socketService$.messages$.subscribe(message => { this.messageSubscription = this.socketService$.messages$.subscribe(message => {
this.onMessage(message); this.onMessage(message);
}); });
this.state4 = message.state4 === '1' ? 'ON' : 'OFF'; this.state4 = message.state4 === '1' ? 'ON' : 'OFF';
this.state5 = message.state5 === '1' ? 'ON' : 'OFF'; this.state5 = message.state5 === '1' ? 'ON' : 'OFF';
this.state6 = message.state6 === '1' ? 'ON' : 'OFF'; this.state6 = message.state6 === '1' ? 'ON' : 'OFF';
this.Sstate1 = this.state5 === 'ON';
this.Sstate2 = this.state6 === 'ON';
} }
this.Sstate1 = this.state5 === 'ON';
this.Sstate2 = this.state6 === 'ON';
if(this.Sstate1 && this.Sstate2) if(this.Sstate1 && this.Sstate2)
this.title = 'ALARM: VIBRATION ALERT' this.title = 'ALARM: VIBRATION ALERT'



Loading…
Cancel
Save