This commit is contained in:
Bozhidar 2024-04-25 11:37:47 +03:00
parent ce8e44d396
commit a2d9d8d149
2 changed files with 7 additions and 0 deletions

View file

@ -12,6 +12,7 @@ use Filament\Forms\Get;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Support\Number;
use JaOcero\RadioDeck\Forms\Components\RadioDeck;
use Illuminate\Database\Migrations\Migration;
@ -79,6 +80,11 @@ class BackupResource extends Resource
->state(function (Backup $backup) {
return $backup->completed_at ? $backup->completed_at : 'N/A';
}),
Tables\Columns\TextColumn::make('size')
->state(function (Backup $backup) {
return $backup->size ? Number::fileSize($backup->size) : 'N/A';
}),
])
->filters([
//

View file

@ -64,6 +64,7 @@ class Backup extends Model
if ($this->status == 'running') {
$backupDoneFile = $this->path.'/backup.done';
if (file_exists($backupDoneFile)) {
$this->size = filesize($this->filepath);
$this->status = 'completed';
$this->completed = true;
$this->completed_at = now();