mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-24 14:28:13 +02:00
Fix refresh action for egg index select & add refresh action to allocation ip selects (#1736)
This commit is contained in:
parent
bb40a5273f
commit
4792542f20
@ -85,13 +85,22 @@ class AllocationsRelationManager extends RelationManager
|
||||
->label(trans('admin/node.create_allocation'))
|
||||
->schema(fn () => [
|
||||
Select::make('allocation_ip')
|
||||
->options(collect($this->getOwnerRecord()->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))
|
||||
->options(fn () => collect($this->getOwnerRecord()->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))
|
||||
->label(trans('admin/node.ip_address'))
|
||||
->inlineLabel()
|
||||
->ip()
|
||||
->helperText(trans('admin/node.ip_help'))
|
||||
->afterStateUpdated(fn (Set $set) => $set('allocation_ports', []))
|
||||
->live()
|
||||
->hintAction(
|
||||
Action::make('refresh')
|
||||
->iconButton()
|
||||
->icon('tabler-refresh')
|
||||
->tooltip(trans('admin/node.refresh'))
|
||||
->action(function () {
|
||||
cache()->forget("nodes.{$this->getOwnerRecord()->id}.ips");
|
||||
})
|
||||
)
|
||||
->required(),
|
||||
TextInput::make('allocation_alias')
|
||||
->label(trans('admin/node.table.alias'))
|
||||
|
@ -218,12 +218,21 @@ class CreateServer extends CreateRecord
|
||||
|
||||
return [
|
||||
Select::make('allocation_ip')
|
||||
->options(collect(Node::find($get('node_id'))?->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))
|
||||
->options(fn () => collect(Node::find($get('node_id'))?->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))
|
||||
->label(trans('admin/server.ip_address'))->inlineLabel()
|
||||
->helperText(trans('admin/server.ip_address_helper'))
|
||||
->afterStateUpdated(fn (Set $set) => $set('allocation_ports', []))
|
||||
->ip()
|
||||
->live()
|
||||
->hintAction(
|
||||
Action::make('refresh')
|
||||
->iconButton()
|
||||
->icon('tabler-refresh')
|
||||
->tooltip(trans('admin/node.refresh'))
|
||||
->action(function () use ($get) {
|
||||
cache()->forget("nodes.{$get('node_id')}.ips");
|
||||
})
|
||||
)
|
||||
->required(),
|
||||
TextInput::make('allocation_alias')
|
||||
->label(trans('admin/server.alias'))->inlineLabel()
|
||||
|
@ -77,11 +77,20 @@ class AllocationsRelationManager extends RelationManager
|
||||
->createAnother(false)
|
||||
->schema(fn () => [
|
||||
Select::make('allocation_ip')
|
||||
->options(collect($this->getOwnerRecord()->node->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))
|
||||
->options(fn () => collect($this->getOwnerRecord()->node->ipAddresses())->mapWithKeys(fn (string $ip) => [$ip => $ip]))
|
||||
->label(trans('admin/server.ip_address'))
|
||||
->inlineLabel()
|
||||
->ip()
|
||||
->live()
|
||||
->hintAction(
|
||||
Action::make('refresh')
|
||||
->iconButton()
|
||||
->icon('tabler-refresh')
|
||||
->tooltip(trans('admin/node.refresh'))
|
||||
->action(function () {
|
||||
cache()->forget("nodes.{$this->getOwnerRecord()->node->id}.ips");
|
||||
})
|
||||
)
|
||||
->afterStateUpdated(fn (Set $set) => $set('allocation_ports', []))
|
||||
->required(),
|
||||
TextInput::make('allocation_alias')
|
||||
|
@ -125,15 +125,20 @@ class ImportEggAction extends Action
|
||||
->schema([
|
||||
Select::make('github')
|
||||
->label(trans('admin/egg.import.github'))
|
||||
->options(cache('eggs.index'))
|
||||
->options(fn () => cache('eggs.index'))
|
||||
->selectablePlaceholder(false)
|
||||
->searchable()
|
||||
->preload()
|
||||
->live()
|
||||
->hintIcon('tabler-refresh', trans('admin/egg.import.refresh'))
|
||||
->hintAction(function () {
|
||||
Artisan::call(UpdateEggIndexCommand::class);
|
||||
})
|
||||
->hintAction(
|
||||
Action::make('refresh')
|
||||
->iconButton()
|
||||
->icon('tabler-refresh')
|
||||
->tooltip(trans('admin/egg.import.refresh'))
|
||||
->action(function () {
|
||||
Artisan::call(UpdateEggIndexCommand::class);
|
||||
})
|
||||
)
|
||||
->afterStateUpdated(function ($state, Set $set, Get $get) use ($isMultiple) {
|
||||
if ($state) {
|
||||
$urls = $isMultiple ? $get('urls') : [];
|
||||
|
@ -37,6 +37,7 @@ return [
|
||||
'ip_address' => 'IP Address',
|
||||
'ip_help' => 'Usually your machine\'s public IP unless you are port forwarding.',
|
||||
'alias_help' => 'Optional display name to help you remember what these are.',
|
||||
'refresh' => 'Refresh',
|
||||
'domain' => 'Domain Name',
|
||||
'ssl_ip' => 'You cannot connect to an IP Address over SSL',
|
||||
'error' => 'This is the domain name that points to your node\'s IP Address. If you\'ve already set up this, you can verify it by checking the next field!',
|
||||
|
Loading…
x
Reference in New Issue
Block a user