mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 23:20:24 +00:00
update
This commit is contained in:
parent
479fcfc236
commit
19044ca3f5
2 changed files with 16 additions and 1 deletions
|
@ -41,7 +41,7 @@ enum BackupStatus: string implements HasColor, HasIcon, HasLabel
|
|||
return match ($this) {
|
||||
self::Pending => 'heroicon-m-sparkles',
|
||||
self::Processing => 'heroicon-m-arrow-path',
|
||||
self::Cancelled => 'heroicon-m-truck',
|
||||
self::Cancelled => 'heroicon-o-x-mark',
|
||||
self::Completed => 'heroicon-m-check-badge',
|
||||
self::Failed => 'heroicon-m-x-circle',
|
||||
};
|
||||
|
|
|
@ -103,6 +103,21 @@ class BackupResource extends Resource
|
|||
//
|
||||
])
|
||||
->actions([
|
||||
|
||||
Tables\Actions\Action::make('cancel')
|
||||
->icon('heroicon-o-x-mark')
|
||||
->hidden(function (Backup $backup) {
|
||||
return $backup->status !== BackupStatus::Processing;
|
||||
})
|
||||
->action(function (Backup $backup) {
|
||||
|
||||
shell_exec('kill -9 ' . $backup->process_id);
|
||||
|
||||
$backup->update([
|
||||
'status' => BackupStatus::Cancelled,
|
||||
]);
|
||||
}),
|
||||
|
||||
Tables\Actions\Action::make('download')
|
||||
->icon('heroicon-o-arrow-down-tray')
|
||||
->hidden(function (Backup $backup) {
|
||||
|
|
Loading…
Reference in a new issue