diff options
author | Chocobozzz <me@florianbigard.com> | 2023-02-15 11:39:45 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-02-15 11:54:17 +0100 |
commit | 0e76f30abb22bea8ab123902d6b3bf168f9a65c2 (patch) | |
tree | 2b372b3b76dbac68b9b091f8f293b98b8c2dceea /client/src/app/+admin | |
parent | 6a7cea15271cf30c4b06c7981bff5201978337e8 (diff) | |
download | PeerTube-0e76f30abb22bea8ab123902d6b3bf168f9a65c2.tar.gz PeerTube-0e76f30abb22bea8ab123902d6b3bf168f9a65c2.tar.zst PeerTube-0e76f30abb22bea8ab123902d6b3bf168f9a65c2.zip |
Try to prevent layout shift with redundancy stats
Diffstat (limited to 'client/src/app/+admin')
2 files changed, 9 insertions, 2 deletions
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html index 8d669b62d..2b52d3fd8 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html | |||
@@ -86,7 +86,7 @@ | |||
86 | </p-table> | 86 | </p-table> |
87 | 87 | ||
88 | 88 | ||
89 | <div class="redundancies-charts" *ngIf="isDisplayingRemoteVideos()"> | 89 | <div class="redundancies-charts" *ngIf="isDisplayingRemoteVideos() && dataLoaded"> |
90 | <h6 i18n>Enabled strategies stats</h6> | 90 | <h6 i18n>Enabled strategies stats</h6> |
91 | 91 | ||
92 | <div class="chart-blocks"> | 92 | <div class="chart-blocks"> |
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index b31c5b35e..d7676ab09 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts | |||
@@ -26,6 +26,9 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit | |||
26 | 26 | ||
27 | noRedundancies = false | 27 | noRedundancies = false |
28 | 28 | ||
29 | // Prevent layout shift for redundancy stats | ||
30 | dataLoaded = false | ||
31 | |||
29 | private bytesPipe: BytesPipe | 32 | private bytesPipe: BytesPipe |
30 | 33 | ||
31 | constructor ( | 34 | constructor ( |
@@ -163,6 +166,8 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit | |||
163 | } | 166 | } |
164 | 167 | ||
165 | protected reloadDataInternal () { | 168 | protected reloadDataInternal () { |
169 | this.dataLoaded = false | ||
170 | |||
166 | const options = { | 171 | const options = { |
167 | pagination: this.pagination, | 172 | pagination: this.pagination, |
168 | sort: this.sort, | 173 | sort: this.sort, |
@@ -174,9 +179,11 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit | |||
174 | next: resultList => { | 179 | next: resultList => { |
175 | this.videoRedundancies = resultList.data | 180 | this.videoRedundancies = resultList.data |
176 | this.totalRecords = resultList.total | 181 | this.totalRecords = resultList.total |
182 | |||
183 | this.dataLoaded = true | ||
177 | }, | 184 | }, |
178 | 185 | ||
179 | error: err => this.notifier.error(err.message) | 186 | error: err => this.notifier.error(err.message), |
180 | }) | 187 | }) |
181 | } | 188 | } |
182 | 189 | ||