mirror of https://github.com/goharbor/harbor.git
Fix storage display and add build timestamp (#14592)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
8d6f4ddc38
commit
778ce4d336
|
@ -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>
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue