mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 16:19:35 +01:00
add clear button
This commit is contained in:
parent
c4398eb26f
commit
48962b6875
@ -680,7 +680,7 @@ class EditNode extends EditRecord
|
|||||||
Action::make('upload')
|
Action::make('upload')
|
||||||
->label(trans('admin/node.diagnostics.upload'))
|
->label(trans('admin/node.diagnostics.upload'))
|
||||||
->visible(fn (Get $get) => $get('pulled') ?? false)
|
->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) {
|
->action(function (Get $get, Set $set) {
|
||||||
try {
|
try {
|
||||||
$response = Http::asMultipart()->post('https://logs.pelican.dev', [
|
$response = Http::asMultipart()->post('https://logs.pelican.dev', [
|
||||||
@ -731,6 +731,17 @@ class EditNode extends EditRecord
|
|||||||
->send();
|
->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([
|
->schema([
|
||||||
Toggle::make('include_endpoints')
|
Toggle::make('include_endpoints')
|
||||||
|
|||||||
@ -132,6 +132,7 @@ return [
|
|||||||
'view_logs' => 'View Logs',
|
'view_logs' => 'View Logs',
|
||||||
'pull' => 'Pull',
|
'pull' => 'Pull',
|
||||||
'upload' => 'Upload',
|
'upload' => 'Upload',
|
||||||
|
'clear' => 'Clear',
|
||||||
'404' => 'The requested diagnostic report could not be found. Make sure wings is up to date and try again.',
|
'404' => 'The requested diagnostic report could not be found. Make sure wings is up to date and try again.',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user