file size added

This commit is contained in:
Lucio Lelii 2023-03-13 19:11:01 +01:00
parent c1f6010aa5
commit 2dbe90945c
2 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,7 @@
<p *ngIf="i.item.shared; else notShared">{{ i.item.owner }}</p>
<ng-template #notShared>
<p>{{i.item.lastModificationTime | date: 'dd MMM yyyy'}} </p>
<p *ngIf="i.isFile() && i.item?.content">{{ getFileSize(i) }}</p>
</ng-template>
</ion-label>

View File

@ -3,6 +3,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { IonicModule } from '@ionic/angular';
import { WSItem } from '../model/ws-item';
import { humanFileSize } from '../_helper/utils';
@Component({
standalone: true,
@ -31,4 +32,9 @@ export class ItemsListComponent implements OnInit {
this.actionSheetClickedEvent.emit(item);
}
getFileSize(item: WSItem){
if (item.isFile() && item.item?.content)
return humanFileSize(item.item.content.size);
return undefined;
}
}