Commit 5d83af1a authored by Tom Gordon's avatar Tom Gordon
Browse files

prenos obrazu inkriminovanych tvorov fauny

parent 4b7e3040
......@@ -53,7 +53,7 @@ export class ApiService {
*
* @param id Birdhouse ID
*/
getTemperature<T = TemperaturePayload>(id: string): Observable<T> {
getTemperature<T = TemperaturePayload>(id: string): Observable<T> {
console.log("API: GET BIRDHOUSE TEMPERATURE", id);
const URL = `${environment.backendUrl}/temperatures/getlast?houseId=${id}`;
const headers = new HttpHeaders({});
......@@ -67,7 +67,7 @@ export class ApiService {
getImage<T = ImagePayload>(id: string): Observable<T> {
console.log("API: GET BIRDHOUSE IMG", id);
const URL = `${environment.backendUrl}/photos/getlast?houseId=608b0b0e157b545d98de4b89`;
const URL = `${environment.backendUrl}/photos/getlast?houseId=${id}`;
const headers = new HttpHeaders({});
return this.httpClient
.get<T>(URL, { headers })
......
......@@ -3,12 +3,12 @@
<span class="text-xl text-accent text-medium"
><span class="text-xl text-primary">House</span> {{ birdhouse._id }}</span
>
<img *ngIf="image; else noPhoto" [src]="transform(image)" width="320" />
<ng-template #noPhoto>
<div fxLayout="column" fxLayoutGap=".8rem" fxLayoutAlign="center center">
<div fxLayout="column" fxLayoutGap=".8rem" fxLayoutAlign="center center">
<img *ngIf="image; else noPhoto" [src]="transform(image)" width="320" />
<ng-template #noPhoto>
<img width="320" src="../../../../assets/image/no-camera.jpg" />
<mat-progress-bar mode="buffer" color="accent"></mat-progress-bar>
</div>
</ng-template>
</ng-template>
<mat-progress-bar mode="buffer" color="accent"></mat-progress-bar>
</div>
</div>
</ng-container>
......@@ -23,10 +23,12 @@ export class PinTooltipComponent implements OnInit {
this.image = response.base64Data;
});
}
}, 10000);
}, 2500);
}
transform(image: string) {
return this.sanitizer.bypassSecurityTrustResourceUrl(image);
return this.sanitizer.bypassSecurityTrustResourceUrl(
`data:image/jpg;base64,${image}`
);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment