add clear button

This commit is contained in:
notCharles 2025-11-05 17:40:15 -05:00
parent c4398eb26f
commit 48962b6875
2 changed files with 13 additions and 1 deletions

View File

@ -680,7 +680,7 @@ class EditNode extends EditRecord
Action::make('upload')
->label(trans('admin/node.diagnostics.upload'))
->visible(fn (Get $get) => $get('pulled') ?? false)
->icon('tabler-cloud-upload')->iconSize(IconSize::ExtraLarge)
->icon('tabler-cloud-upload')->iconButton()->iconSize(IconSize::ExtraLarge)
->action(function (Get $get, Set $set) {
try {
$response = Http::asMultipart()->post('https://logs.pelican.dev', [
@ -731,6 +731,17 @@ class EditNode extends EditRecord
->send();
}
}),
Action::make('clear')
->label(trans('admin/node.diagnostics.clear'))
->visible(fn (Get $get) => $get('pulled') ?? false)
->icon('tabler-trash')->iconButton()->iconSize(IconSize::ExtraLarge)->color('danger')
->action(function (Get $get, Set $set) {
$set('pulled', false);
$set('uploaded', false);
$set('log', null);
$this->refresh();
}
),
])
->schema([
Toggle::make('include_endpoints')

View File

@ -132,6 +132,7 @@ return [
'view_logs' => 'View Logs',
'pull' => 'Pull',
'upload' => 'Upload',
'clear' => 'Clear',
'404' => 'The requested diagnostic report could not be found. Make sure wings is up to date and try again.',
],