Skip to content

Commit

Permalink
feat: fix images
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed May 14, 2024
1 parent e4bb891 commit 1f396f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@
<input matInput placeholder="query" [formControl]="queryControl">
</mat-form-field>
<button mat-flat-button color="primary" (click)="query()" [disabled]="queryControl.invalid || this.queryControl.untouched" i18n="@@query">Upload</button>
<div class="images">
@for(myresult of results; track myresult.answer) {
<div class="horizontal-container">
<div><img [src]="myresult.b64Image"></div>
<div>{{myresult.answer}}</div>
</div>
}
</div>
</div>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@
.horizontal-container {
display: flex;
}

.images {
margin-top: 20px;
overflow-y: scroll;
height: calc(100vh - (36px + 21px + 64px));
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class ImageQueryComponent {
const formData = new FormData();
formData.append('query', this.queryControl.value as unknown as string);
formData.append('type', '');
this.imageService.postQueryForm(formData).subscribe(result => this.results = result);
this.imageService.postQueryForm(formData).subscribe(myResults => this.results = myResults.map(myResult => myResult = this.createImageUrl(myResult)));
}

protected upload(): void {
Expand Down

0 comments on commit 1f396f2

Please sign in to comment.