mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-08 08:08:54 +02:00
Add refresh hint action
This commit is contained in:
parent
90f588ae7b
commit
c4d1a56deb
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Filament\Components\Actions;
|
namespace App\Filament\Components\Actions;
|
||||||
|
|
||||||
|
use App\Console\Commands\Egg\UpdateEggIndexCommand;
|
||||||
use App\Models\Egg;
|
use App\Models\Egg;
|
||||||
use App\Services\Eggs\Sharing\EggImporterService;
|
use App\Services\Eggs\Sharing\EggImporterService;
|
||||||
use Closure;
|
use Closure;
|
||||||
@ -17,6 +18,7 @@ use Filament\Forms\Get;
|
|||||||
use Filament\Forms\Set;
|
use Filament\Forms\Set;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
use Livewire\Features\SupportFileUploads\TemporaryUploadedFile;
|
||||||
|
|
||||||
@ -108,6 +110,11 @@ class ImportEggAction extends Action
|
|||||||
->searchable()
|
->searchable()
|
||||||
->preload()
|
->preload()
|
||||||
->live()
|
->live()
|
||||||
|
->hintIcon('tabler-refresh')
|
||||||
|
->hintIconTooltip(trans('admin/egg.import.refresh'))
|
||||||
|
->hintAction(function () {
|
||||||
|
Artisan::call(UpdateEggIndexCommand::class);
|
||||||
|
})
|
||||||
->afterStateUpdated(function ($state, Set $set, Get $get) use ($isMultiple) {
|
->afterStateUpdated(function ($state, Set $set, Get $get) use ($isMultiple) {
|
||||||
if ($state) {
|
if ($state) {
|
||||||
$urls = $isMultiple ? $get('urls') : [];
|
$urls = $isMultiple ? $get('urls') : [];
|
||||||
@ -117,6 +124,7 @@ class ImportEggAction extends Action
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
Repeater::make('urls')
|
Repeater::make('urls')
|
||||||
|
->label('')
|
||||||
->itemLabel(fn (array $state) => str($state['url'])->afterLast('/egg-')->before('.json')->headline())
|
->itemLabel(fn (array $state) => str($state['url'])->afterLast('/egg-')->before('.json')->headline())
|
||||||
->hint(trans('admin/egg.import.url_help'))
|
->hint(trans('admin/egg.import.url_help'))
|
||||||
->addActionLabel(trans('admin/egg.import.add_url'))
|
->addActionLabel(trans('admin/egg.import.add_url'))
|
||||||
|
@ -19,6 +19,7 @@ return [
|
|||||||
'import_failed' => 'Import Failed',
|
'import_failed' => 'Import Failed',
|
||||||
'import_success' => 'Import Success',
|
'import_success' => 'Import Success',
|
||||||
'github' => 'Add from Github',
|
'github' => 'Add from Github',
|
||||||
|
'refresh' => 'Refresh',
|
||||||
],
|
],
|
||||||
'in_use' => 'In Use',
|
'in_use' => 'In Use',
|
||||||
'servers' => 'Servers',
|
'servers' => 'Servers',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user