Implement fetching of sizes via different api
Signed-off-by: Trivernis <trivernis@protonmail.com>pull/4/head
parent
3a1079b38f
commit
985c36c803
@ -1,21 +1,44 @@
|
||||
<mat-toolbar>
|
||||
<span class="repository-name">{{repository.name}}</span>
|
||||
<button class="button-close-repository" mat-flat-button color="primary" (click)="this.closeRepository()">Close</button>
|
||||
<button class="button-close-repository" mat-flat-button color="primary" (click)="this.closeRepository()">Close
|
||||
</button>
|
||||
</mat-toolbar>
|
||||
<div class="details-content" fxLayout="row">
|
||||
<div class="repository-metadata" fxFlex="50%">
|
||||
<h1>Stats</h1>
|
||||
<app-metadata-entry *ngIf="repository.path" attributeName="Path" [value]="repository.path"></app-metadata-entry>
|
||||
<app-metadata-entry *ngIf="repository.address" attributeName="Address" [value]="repository.address"></app-metadata-entry>
|
||||
<ng-container *ngIf="metadata">
|
||||
<app-metadata-entry attributeName="File Count" [value]="metadata.file_count.toString()"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Tag Count" [value]="metadata.tag_count.toString()"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Namespace Count" [value]="metadata.namespace_count.toString()"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Mapping Count" [value]="metadata.mapping_count.toString()"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Total Size" [value]="formatByteSize(metadata.total_size)"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="File Folder Size" [value]="formatByteSize(metadata.file_size)"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Thumbnail Folder Size" [value]="formatByteSize(metadata.thumbnail_size)"></app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Database File Size" [value]="formatByteSize(metadata.database_size)"></app-metadata-entry>
|
||||
</ng-container>
|
||||
<app-metadata-entry *ngIf="repository.path" attributeName="Path">{{repository.path}}</app-metadata-entry>
|
||||
<app-metadata-entry *ngIf="repository.address" attributeName="Address">{{repository.address}}</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="File Count">
|
||||
<mat-progress-bar *ngIf="!metadata"></mat-progress-bar>
|
||||
{{metadata? metadata!.file_count.toString() : ''}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Tag Count">
|
||||
<mat-progress-bar *ngIf="!metadata"></mat-progress-bar>
|
||||
{{metadata? metadata!.tag_count.toString() : ''}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Namespace Count">
|
||||
<mat-progress-bar *ngIf="!metadata"></mat-progress-bar>
|
||||
{{metadata? metadata!.namespace_count.toString() : ''}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Mapping Count">
|
||||
<mat-progress-bar *ngIf="!metadata"></mat-progress-bar>
|
||||
{{metadata? metadata!.mapping_count.toString() : ''}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Total Size">
|
||||
<mat-progress-bar *ngIf="(this.totalSize | async) === undefined" mode="indeterminate"></mat-progress-bar>
|
||||
{{this.totalSize | async}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="File Folder Size">
|
||||
<mat-progress-bar *ngIf="(this.fileFolderSize | async) === undefined" mode="indeterminate"></mat-progress-bar>
|
||||
{{this.fileFolderSize | async}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Thumbnail Folder Size">
|
||||
<mat-progress-bar *ngIf="(this.thumbFolderSize | async) === undefined" mode="indeterminate"></mat-progress-bar>
|
||||
{{this.thumbFolderSize | async}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Database File Size">
|
||||
<mat-progress-bar *ngIf="(this.databaseFileSize | async) === undefined" mode="indeterminate"></mat-progress-bar>
|
||||
{{this.databaseFileSize | async}}
|
||||
</app-metadata-entry>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,6 @@
|
||||
<div class="metadata-entry-inner">
|
||||
<span class="metadata-attribute">{{attributeName}}:</span>
|
||||
<span class="metadata-value">{{value}}</span>
|
||||
<span class="metadata-value">
|
||||
<ng-content></ng-content>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -0,0 +1,11 @@
|
||||
export enum SizeType {
|
||||
Total = "Total",
|
||||
FileFolder = "FileFolder",
|
||||
ThumbFolder = "ThumbFolder",
|
||||
DatabaseFile = "DatabaseFile",
|
||||
}
|
||||
|
||||
export type SizeMetadata = {
|
||||
size_type: SizeType,
|
||||
size: number,
|
||||
}
|
Loading…
Reference in New Issue