Skip to content

Commit

Permalink
misc: small fix or general refactoring i did not bother commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Mar 30, 2019
1 parent d311ac6 commit bc5c830
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<ui-main-header *ngIf="api.Ready()"></ui-main-header>

<div class="container-fluid page-content">
<router-outlet></router-outlet>
</div>

</div>
5 changes: 5 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ div#container{
}
}

.page-content {
padding-top:10px;
padding-left:5px;
padding-right: 5px;
}
7 changes: 7 additions & 0 deletions src/app/components/main-header/main-header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
</a>
</li>

<li *ngIf="rest.state.recording" class="nav-item right replayDate">
<span class="badge badge-pill badge-danger">
<i class="fas fa-video" style="margin-right:3px"></i>
recording
</span>
</li>

<li *ngIf="rest.state.replaying" class="nav-item right replayDate">
<span class="badge badge-pill badge-danger">
<i class="fas fa-video" style="margin-right:3px"></i>
Expand Down
21 changes: 12 additions & 9 deletions src/app/components/position/position.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
<table class="table table-sm table-dark">
<tbody>
<tr>
<td with="1%" *ngIf="!api.module('gps').running">
<td with="1%" *ngIf="!running">
<span class="badge badge-danger">
Not running
</span>
</td>
<ng-container *ngIf="api.module('gps').running">

<ng-container *ngIf="running">
<td with="1%" *ngIf="api.session.gps.NumSatellites == 0">
<span class="badge badge-danger">
No satellites
Expand All @@ -19,16 +20,18 @@
<td *ngIf="api.session.gps.NumSatellites > 0">
{{ api.session.gps.Updated | date:'HH:mm:ss' }}
</td>

<ng-container *ngFor="let gps of api.session.gps | keyvalue">
<ng-container *ngIf="gps.key != 'NumSatellites' && gps.key != 'Updated'">
<th with="1%">{{ gps.key }}</th>
<td>{{ gps.value }}</td>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngFor="let gps of api.session.gps | keyvalue">
<ng-container *ngIf="gps.key != 'NumSatellites' && gps.key != 'Updated'">
<th with="1%">{{ gps.key }}</th>
<td>{{ gps.value }}</td>
</ng-container>
</ng-container>

</tr>
</tbody>
</table>

<div id="map" class="map"></div>
<div id="map" class="map" [hidden]="!running"></div>
</div>
7 changes: 6 additions & 1 deletion src/app/components/position/position.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare var ol: any;
styleUrls: ['./position.component.scss']
})
export class PositionComponent implements OnInit, OnDestroy {
running: boolean = false;
map: any;
prevMarker: any;
subscriptions: any = [];
Expand All @@ -34,10 +35,12 @@ export class PositionComponent implements OnInit, OnDestroy {
})
],
view: new ol.View({
center: ol.proj.fromLonLat([0, 0]),
center: ol.proj.fromLonLat([this.api.session.gps.Longitude, this.api.session.gps.Latitude]),
zoom: 18
})
});

this.addMarker(this.api.session.gps.Latitude, this.api.session.gps.Longitude)
}

ngOnDestroy() {
Expand Down Expand Up @@ -83,6 +86,8 @@ export class PositionComponent implements OnInit, OnDestroy {
*/

private update() {
this.running = this.api.module('gps').running;

if( this.map ) {
/*
let step = this.steps[this.idx++ % this.steps.length];
Expand Down

0 comments on commit bc5c830

Please sign in to comment.