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