mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +01:00
more changes, add 404 catch
This commit is contained in:
parent
be82bc847b
commit
de8f2cc0bb
@ -637,12 +637,11 @@ class EditNode extends EditRecord
|
||||
->heading(trans('admin/node.tabs.diagnostics'))
|
||||
->columnSpanFull()
|
||||
->columns(3)
|
||||
->collapsible()->collapsed()
|
||||
->headerActions([
|
||||
Action::make('pull')
|
||||
->label(trans('admin/node.diagnostics.pull'))
|
||||
->icon('tabler-cloud-download')->iconButton()->iconSize(IconSize::ExtraLarge)
|
||||
->visible(fn (Get $get) => !($get('pulled') ?? false))
|
||||
->hidden(fn (Get $get) => ($get('pulled')))
|
||||
->action(function (Get $get, Set $set, Node $node) {
|
||||
$includeEndpoints = $get('include_endpoints') ?? true;
|
||||
$includeLogs = $get('include_logs') ?? true;
|
||||
@ -651,12 +650,21 @@ class EditNode extends EditRecord
|
||||
try {
|
||||
$response = $this->daemonSystemRepository->setNode($node)->getDiagnostics($logLines, $includeEndpoints, $includeLogs);
|
||||
|
||||
if (str_contains($response->body(), '404')) {
|
||||
Notification::make()
|
||||
->title(trans('admin/node.diagnostics.404'))
|
||||
->warning()
|
||||
->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$set('pulled', true);
|
||||
$set('uploaded', false);
|
||||
$set('log', $response->body());
|
||||
|
||||
Notification::make()
|
||||
->title('Logs Pulled')
|
||||
->title(trans('admin/node.diagnostics.logs_pulled'))
|
||||
->success()
|
||||
->send();
|
||||
} catch (ConnectionException $e) {
|
||||
|
||||
@ -126,11 +126,13 @@ return [
|
||||
'include_logs_hint' => 'Including logs will show recent wing logs and help track down possible issues.',
|
||||
'run_diagnostics' => 'Run Diagnostics',
|
||||
'upload_to_pelican' => 'Upload Logs',
|
||||
'logs_pulled' => 'Logs Pulled!',
|
||||
'logs_uploaded' => 'Logs Uploaded',
|
||||
'upload_failed' => 'Log Upload Failed',
|
||||
'view_logs' => 'View Logs',
|
||||
'pull' => 'Pull',
|
||||
'upload' => 'Upload',
|
||||
'404' => 'The requested diagnostic report could not be found. Make sure wings is up to date and try again.',
|
||||
],
|
||||
|
||||
'cloudflare_issue' => [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user