Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Apr 25, 2024
1 parent ce8e44d commit a2d9d8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/app/Filament/Resources/BackupResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -79,6 +80,11 @@ public static function table(Table $table): Table
->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([
//
Expand Down
1 change: 1 addition & 0 deletions web/app/Models/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function checkBackup()
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();
Expand Down

0 comments on commit a2d9d8d

Please sign in to comment.