mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
Fix run_action helper (#540)
* Fix run_action helper * upgrade actions * upgrade actions
This commit is contained in:
@ -67,17 +67,19 @@ function run_action(object $static, Closure $callback): void
|
||||
try {
|
||||
$callback();
|
||||
} catch (SSHError $e) {
|
||||
$actions = [];
|
||||
if ($e->getLog()) {
|
||||
$actions[] = Action::make('View Logs')
|
||||
->url(App\Web\Pages\Servers\Logs\Index::getUrl([
|
||||
'server' => $e->getLog()->server_id,
|
||||
]))
|
||||
->openUrlInNewTab();
|
||||
}
|
||||
Notification::make()
|
||||
->danger()
|
||||
->title($e->getMessage())
|
||||
->body($e->getLog()?->getContent(30))
|
||||
->actions([
|
||||
Action::make('View Logs')
|
||||
->url(App\Web\Pages\Servers\Logs\Index::getUrl([
|
||||
'server' => $e->getLog()?->server_id,
|
||||
]))
|
||||
->openUrlInNewTab(),
|
||||
])
|
||||
->actions($actions)
|
||||
->send();
|
||||
|
||||
if (method_exists($static, 'halt')) {
|
||||
|
Reference in New Issue
Block a user