Show error
All checks were successful
Deploy App / deploy (push) Successful in 11s

This commit is contained in:
2025-08-31 22:41:48 +02:00
parent 7764af432a
commit 6a72b7150b
7 changed files with 49 additions and 39 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Livewire;
use App\Models\BotLog;
use Illuminate\Support\Facades\Auth;
use Jantinnerezo\LivewireAlert\Facades\LivewireAlert;
use Livewire\Component;
use Livewire\WithoutUrlPagination;
use Livewire\WithPagination;
@@ -13,15 +14,18 @@ class BotLogs extends Component
use WithPagination;
use WithoutUrlPagination;
// public function mount()
// {
// $this->getLogs();
// }
// public function getLogs(): void
// {
// $this->logs = Auth::user()->bots->pluck('logs')->flatten()->sortByDesc('created_at');
// }
public function showError(int $logId): void
{
$log = BotLog::find($logId);
if ($log) {
LivewireAlert::title('Error Details')
->html("<pre class='whitespace-pre-wrap break-words'>{$log->error}</pre>")
->warning()
->timer(null)
->withCancelButton('Close')
->show();
}
}
public function render()
{

View File

@@ -78,7 +78,7 @@ class BotsList extends Component
]);
// Dispatch the job to run the bot
dispatch(new RunBot($bot, $log));
dispatch(new RunBot($bot->id, $log->id));
flash()->success("Bot '{$bot->name}' is being executed.");
}

View File

@@ -26,7 +26,7 @@ class ViewBot extends Component
]);
// Dispatch the job to run the bot
dispatch(new RunBot($this->bot, $log));
dispatch(new RunBot($this->bot->id, $log->id));
flash()->success("Bot '{$this->bot->name}' is being executed.");
}