This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user