Fix storage display and add build timestamp (#14592)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Will Sun 2021-04-08 18:42:29 +08:00 committed by GitHub
parent 8d6f4ddc38
commit 778ce4d336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View File

@ -37,8 +37,8 @@
</div>
<div class="statistic-item-divider" [hidden]="!isValidSession || !isValidStorage"></div>
<div class="statistic-block" [hidden]="!isValidSession || !isValidStorage">
<esxc-gauge [free]="freeStorage" [threasHold]="totalStorage" [size]="small" [title]='"STATISTICS.STORAGE"' [animate]="true">
<esxc-gauge [free]="freeStorage" [threasHold]="totalStorage" [title]='"STATISTICS.STORAGE"' [animate]="true">
</esxc-gauge>
</div>
</div>
</div>
</div>

View File

@ -37,8 +37,6 @@ export class StatisticsPanelComponent implements OnInit, OnDestroy {
originalCopy: Statistics = new Statistics();
volumesInfo: Volumes = new Volumes();
refreshSub: Subscription;
small: number;
constructor(
private statistics: StatisticsService,
private msgHandler: MessageHandlerService,
@ -72,7 +70,7 @@ export class StatisticsPanelComponent implements OnInit, OnDestroy {
let count: number = 0;
if (this.volumesInfo && this.volumesInfo.storage && this.volumesInfo.storage.length) {
this.volumesInfo.storage.forEach(item => {
count += item.total;
count += item.total ? item.total : 0;
});
}
return this.getGBFromBytes(count);
@ -82,7 +80,7 @@ export class StatisticsPanelComponent implements OnInit, OnDestroy {
let count: number = 0;
if (this.volumesInfo && this.volumesInfo.storage && this.volumesInfo.storage.length) {
this.volumesInfo.storage.forEach(item => {
count += item.free;
count += item.free ? item.free : 0;
});
}
return this.getGBFromBytes(count);
@ -113,7 +111,7 @@ export class StatisticsPanelComponent implements OnInit, OnDestroy {
let count: number = 0;
if (this.volumesInfo && this.volumesInfo.storage && this.volumesInfo.storage.length) {
this.volumesInfo.storage.forEach(item => {
count += item.total;
count += item.total ? item.total : 0;
});
}
return count !== 0 &&

View File

@ -176,10 +176,10 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
params.q = encodeURIComponent(`name=~${this.lastFilteredRepoName}`);
}
this.loading = true;
return this.newRepoService.listRepositoriesResponse(params);
return this.newRepoService.listRepositoriesResponse(params)
.pipe(finalize(() => this.loading = false));
})
).pipe(finalize(() => this.loading = false))
.subscribe((repo: __StrictHttpResponse<Array<NewRepository>>) => {
).subscribe((repo: __StrictHttpResponse<Array<NewRepository>>) => {
this.totalCount = +repo.headers.get('x-total-count');
this.repositories = repo.body;
}, error => {

View File

@ -19,7 +19,7 @@ loadStyle(styleName: string) {
'client-theme'
) as HTMLLinkElement;
if (themeLink) {
themeLink.href = styleName;
themeLink.href = `${styleName}?buildTimeStamp=${environment.buildTimestamp}`;
} else {
const style = this.document.createElement('link');
style.id = 'client-theme';