Try to prevent layout shift with redundancy stats

pull/5615/head
Chocobozzz 2023-02-15 11:39:45 +01:00
parent 6a7cea1527
commit 0e76f30abb
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 9 additions and 2 deletions

View File

@ -86,7 +86,7 @@
</p-table> </p-table>
<div class="redundancies-charts" *ngIf="isDisplayingRemoteVideos()"> <div class="redundancies-charts" *ngIf="isDisplayingRemoteVideos() && dataLoaded">
<h6 i18n>Enabled strategies stats</h6> <h6 i18n>Enabled strategies stats</h6>
<div class="chart-blocks"> <div class="chart-blocks">

View File

@ -26,6 +26,9 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
noRedundancies = false noRedundancies = false
// Prevent layout shift for redundancy stats
dataLoaded = false
private bytesPipe: BytesPipe private bytesPipe: BytesPipe
constructor ( constructor (
@ -163,6 +166,8 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
} }
protected reloadDataInternal () { protected reloadDataInternal () {
this.dataLoaded = false
const options = { const options = {
pagination: this.pagination, pagination: this.pagination,
sort: this.sort, sort: this.sort,
@ -174,9 +179,11 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
next: resultList => { next: resultList => {
this.videoRedundancies = resultList.data this.videoRedundancies = resultList.data
this.totalRecords = resultList.total this.totalRecords = resultList.total
this.dataLoaded = true
}, },
error: err => this.notifier.error(err.message) error: err => this.notifier.error(err.message),
}) })
} }