Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
kwongtn committed May 16, 2024
2 parents 401950f + fd6066c commit 56202ba
Show file tree
Hide file tree
Showing 39 changed files with 3,408 additions and 2,998 deletions.
2,637 changes: 1,442 additions & 1,195 deletions package-lock.json

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions src/app/@ui/action-list/action-list.component.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<nz-list nzBordered nzSize="small">
<!-- <nz-list-header>Header</nz-list-header> -->
<nz-list-item
*ngFor="
let hist of sessionHistoryService.historyStore | async | keyvalue
"
>
<span
*ngIf="filter.includes(hist.value['historyType'])"
class="flex-container"
>
<span class="left">
<a
href="{{ backendUrl }}admin/spotting/event/{{
hist.value['id']
}}"
>
{{ hist.value["id"] }}
</a>
<span class="require-whitespace"> - </span>
{{ hist.value["vehicle"]["name"] }}
</span>
<span class="right">
<nz-space>
<spotting-type-tag
*nzSpaceItem
[spottingType]="hist.value['type']"
></spotting-type-tag>
<vehicle-status-tag
*nzSpaceItem
[vehicleStatus]="hist.value['status']"
></vehicle-status-tag>
</nz-space>
</span>
</span>
</nz-list-item>
@for (
hist of sessionHistoryService.historyStore | async | keyvalue;
track hist.value
) {
<nz-list-item>
@if (filter.includes(hist.value["historyType"])) {
<span class="flex-container">
<span class="left">
<a
href="{{ backendUrl }}admin/spotting/event/{{
hist.value['id']
}}"
>
{{ hist.value["id"] }}
</a>
<span class="require-whitespace"> - </span>
{{ hist.value["vehicle"]["name"] }}
</span>
<span class="right">
<nz-space>
<spotting-type-tag
*nzSpaceItem
[spottingType]="hist.value['type']"
/>
<vehicle-status-tag
*nzSpaceItem
[vehicleStatus]="hist.value['status']"
/>
</nz-space>
</span>
</span>
}
</nz-list-item>
}
<!-- <nz-list-footer>Footer</nz-list-footer> -->
</nz-list>
60 changes: 32 additions & 28 deletions src/app/@ui/image-grid/image-grid.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,38 @@
#gridContainer
class="main-container {{ fillLastRow ? 'fill-last-row' : '' }}"
>
<nz-image-group
inViewport
[inViewportOptions]="{ rootMargin: '200px 0px' }"
(inViewportAction)="onIntersection($event)"
*ngFor="let img of images; let i = index"
[ngStyle]="{
width: (img.width * ratioBaseline) / img.height + 'px',
'flex-grow': (img.width * ratioBaseline) / img.height
}"
class="child-container"
[id]="i"
>
<nz-spin class="content spinner" nzSimple *ngIf="loading"></nz-spin>
<div
@for (img of images; track img; let i = $index) {
<nz-image-group
inViewport
[inViewportOptions]="{ rootMargin: '200px 0px' }"
(inViewportAction)="onIntersection($event)"
[ngStyle]="{
'padding-bottom':
(img.height / img.width) * (ratioBaseline / 2) + '%'
width: (img.width * ratioBaseline) / img.height + 'px',
'flex-grow': (img.width * ratioBaseline) / img.height
}"
></div>
<img
class="content"
*ngIf="displayImage[i] ?? true"
[src]="getUrl(i)"
onerror="this.onerror=null; this.src='./assets/image-not-found.png'"
alt=""
[attr.data-index]="i"
(click)="onViewImage(i)"
(load)="markLoaded()"
/>
</nz-image-group>
class="child-container"
[id]="i"
>
@if (loading) {
<nz-spin class="content spinner" nzSimple></nz-spin>
}
<div
[ngStyle]="{
'padding-bottom':
(img.height / img.width) * (ratioBaseline / 2) + '%'
}"
></div>
@if (!displayImage[i]) {
<img
class="content"
[src]="getUrl(i)"
onerror="this.onerror=null; this.src='./assets/image-not-found.png'"
alt=""
[attr.data-index]="i"
(click)="onViewImage(i)"
(load)="markLoaded()"
/>
}
</nz-image-group>
}
</div>
45 changes: 23 additions & 22 deletions src/app/@ui/spotting-image-list/spotting-image-list.component.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<nz-spin [nzSpinning]="loading" [nzSize]="'large'">
<nz-empty
*ngIf="imageSrcs.length === 0 && !loading"
nzNotFoundContent="No images. Add some?"
></nz-empty>
<nz-image-group *ngIf="imageSrcs.length > 0" class="flex-container">
<img
height="200px"
width="200px"
*ngFor="let src of imageSrcs; let i = index"
[attr.data-index]="i"
[src]="
'https://media.discordapp.net/attachments/' +
src +
'?format=webp&quality=lossless&width=300&height=300'
"
onerror="this.onerror=null; this.src='./assets/image-not-found.png'"
(click)="onViewImage(i)"
(load)="markLoaded()"
/>
</nz-image-group>
<span *ngIf="isMine">
@if (imageSrcs.length > 0) {
<nz-image-group class="flex-container">
@for (src of imageSrcs; track src; let i = $index) {
<img
height="200px"
width="200px"
[attr.data-index]="i"
[src]="
'https://media.discordapp.net/attachments/' +
src +
'?format=webp&quality=lossless&width=300&height=300'
"
onerror="this.onerror=null; this.src='./assets/image-not-found.png'"
(click)="onViewImage(i)"
(load)="markLoaded()"
/>
}
</nz-image-group>
} @else if (imageSrcs.length === 0 && !loading) {
<nz-empty nzNotFoundContent="No images. Add some?" />
}
@if (isMine) {
<h1>Add Images</h1>
<spotting-form-upload
(newImageEvent)="onImageChange($event)"
></spotting-form-upload>
</span>
}
</nz-spin>
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<nz-spin class="spinner" nzSimple *ngIf="loading"></nz-spin>
@if (loading) {
<nz-spin class="spinner" nzSimple />
}
<div id="container"></div>
Original file line number Diff line number Diff line change
@@ -1,82 +1,93 @@
<div>
<spotting-type-tag [spottingType]="spottingType"></spotting-type-tag>
<br />
<a
*ngIf="rowItem.location"
href="https://www.google.com/maps?q={{ rowItem.location.latitude }},{{
rowItem.location.longitude
}}"
target="_blank"
>
<span
*ngIf="showLocationPopover"
nz-tooltip
[nzTooltipTitle]="locationPopoverTemplate"
[nzTooltipTrigger]="'hover'"
[nzTooltipPlacement]="'right'"
nz-icon
[nzType]="'info-circle'"
></span>
{{ rowItem.location | coordinatesHumanizer : 3 }}
</a>
<span *ngIf="rowItem.type == 'AT_STATION' && rowItem.originStation">
{{ rowItem.originStation.displayName }}
</span>
<span
*ngIf="
rowItem.type == 'BETWEEN_STATIONS' &&
rowItem.originStation &&
rowItem.destinationStation
"
>
{{ rowItem.originStation.displayName }} ->
{{ rowItem.destinationStation.displayName }}
</span>
@if (rowItem.location) {
<a
href="https://www.google.com/maps?q={{
rowItem.location.latitude
}},{{ rowItem.location.longitude }}"
target="_blank"
>
@if (showLocationPopover) {
<span
nz-tooltip
[nzTooltipTitle]="locationPopoverTemplate"
[nzTooltipTrigger]="'hover'"
[nzTooltipPlacement]="'right'"
nz-icon
[nzType]="'info-circle'"
></span>
}
{{ rowItem.location | coordinatesHumanizer: 3 }}
</a>
} @else if (rowItem.originStation) {
@if (rowItem.type == "AT_STATION") {
{{ rowItem.originStation.displayName }}
} @else if (
rowItem.type == "BETWEEN_STATIONS" && rowItem.destinationStation
) {
{{ rowItem.originStation.displayName }} ->
{{ rowItem.destinationStation.displayName }}
}
}
</div>

<ng-template #content> </ng-template>

<ng-template #locationPopoverTemplate>
<table *ngIf="rowItem.location" class="location-popover">
<tr>
<td>Location</td>
<td>:</td>
<td>
{{
rowItem.location
| coordinatesHumanizer : 3 : ["location-only"]
}}
</td>
</tr>
<tr>
<td>Accuracy</td>
<td>:</td>
<td>{{ rowItem.location.accuracy | beautifulDecimal }}m</td>
</tr>
<tr *ngIf="rowItem.location.altitude">
<td>Altitude</td>
<td>:</td>
<td>
{{ rowItem.location.altitude | beautifulDecimal }}m<span
*ngIf="rowItem.location.altitudeAccuracy"
>
±
@if (rowItem.location) {
<table class="location-popover">
<tr>
<td>Location</td>
<td>:</td>
<td>
{{
rowItem.location.altitudeAccuracy | beautifulDecimal
}}m</span
>
</td>
</tr>
<tr *ngIf="rowItem.location.heading">
<td>Heading</td>
<td>:</td>
<td>{{ rowItem.location.heading | beautifulDecimal }}°</td>
</tr>
rowItem.location
| coordinatesHumanizer: 3 : ["location-only"]
}}
</td>
</tr>
<tr>
<td>Accuracy</td>
<td>:</td>
<td>{{ rowItem.location.accuracy | beautifulDecimal }}m</td>
</tr>
@if (rowItem.location.altitude) {
<tr>
<td>Altitude</td>
<td>:</td>
<td>
{{ rowItem.location.altitude | beautifulDecimal }}m
@if (rowItem.location.altitudeAccuracy) {
±
{{
rowItem.location.altitudeAccuracy
| beautifulDecimal
}}m
}
</td>
</tr>
}
@if (rowItem.location.heading) {
<tr>
<td>Heading</td>
<td>:</td>
<td>{{ rowItem.location.heading | beautifulDecimal }}°</td>
</tr>
}

<tr *ngIf="rowItem.location.speed">
<td>Speed</td>
<td>:</td>
<td>{{ rowItem.location.speed * 3.6 | beautifulDecimal }} km/h</td>
</tr>
</table>
@if (rowItem.location.speed) {
<tr>
<td>Speed</td>
<td>:</td>
<td>
{{
rowItem.location.speed * 3.6 | beautifulDecimal
}}
km/h
</td>
</tr>
}
</table>
}
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<nz-spin class="spinner" nzSimple *ngIf="loading"></nz-spin>
@if (loading) {
<nz-spin class="spinner" nzSimple />
}
<div id="spotting-vehicle-calendar-heatmap-container"></div>
Loading

0 comments on commit 56202ba

Please sign in to comment.