mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Remove locationId in MakeNodeCommand (#405)
* Concat + Default * Concat + Default + Enforce scheme * fix typo --------- Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
parent
d4eecdd53d
commit
276b51f477
@ -57,19 +57,19 @@ class MakeNodeCommand extends Command
|
|||||||
$data['public'] = $this->option('public') ?? $this->confirm(__('commands.make_node.public'), true);
|
$data['public'] = $this->option('public') ?? $this->confirm(__('commands.make_node.public'), true);
|
||||||
$data['behind_proxy'] = $this->option('proxy') ?? $this->confirm(__('commands.make_node.behind_proxy'));
|
$data['behind_proxy'] = $this->option('proxy') ?? $this->confirm(__('commands.make_node.behind_proxy'));
|
||||||
$data['maintenance_mode'] = $this->option('maintenance') ?? $this->confirm(__('commands.make_node.maintenance_mode'));
|
$data['maintenance_mode'] = $this->option('maintenance') ?? $this->confirm(__('commands.make_node.maintenance_mode'));
|
||||||
$data['memory'] = $this->option('maxMemory') ?? $this->ask(__('commands.make_node.memory'));
|
$data['memory'] = $this->option('maxMemory') ?? $this->ask(__('commands.make_node.memory'), '0');
|
||||||
$data['memory_overallocate'] = $this->option('overallocateMemory') ?? $this->ask(__('commands.make_node.memory_overallocate'));
|
$data['memory_overallocate'] = $this->option('overallocateMemory') ?? $this->ask(__('commands.make_node.memory_overallocate'), '-1');
|
||||||
$data['disk'] = $this->option('maxDisk') ?? $this->ask(__('commands.make_node.disk'));
|
$data['disk'] = $this->option('maxDisk') ?? $this->ask(__('commands.make_node.disk'), '0');
|
||||||
$data['disk_overallocate'] = $this->option('overallocateDisk') ?? $this->ask(__('commands.make_node.disk_overallocate'));
|
$data['disk_overallocate'] = $this->option('overallocateDisk') ?? $this->ask(__('commands.make_node.disk_overallocate'), '-1');
|
||||||
$data['cpu'] = $this->option('maxCpu') ?? $this->ask(__('commands.make_node.cpu'));
|
$data['cpu'] = $this->option('maxCpu') ?? $this->ask(__('commands.make_node.cpu'), '0');
|
||||||
$data['cpu_overallocate'] = $this->option('overallocateCpu') ?? $this->ask(__('commands.make_node.cpu_overallocate'));
|
$data['cpu_overallocate'] = $this->option('overallocateCpu') ?? $this->ask(__('commands.make_node.cpu_overallocate'), '-1');
|
||||||
$data['upload_size'] = $this->option('uploadSize') ?? $this->ask(__('commands.make_node.upload_size'), '100');
|
$data['upload_size'] = $this->option('uploadSize') ?? $this->ask(__('commands.make_node.upload_size'), '256');
|
||||||
$data['daemon_listen'] = $this->option('daemonListeningPort') ?? $this->ask(__('commands.make_node.daemonListen'), '8080');
|
$data['daemon_listen'] = $this->option('daemonListeningPort') ?? $this->ask(__('commands.make_node.daemonListen'), '8080');
|
||||||
$data['daemon_sftp'] = $this->option('daemonSFTPPort') ?? $this->ask(__('commands.make_node.daemonSFTP'), '2022');
|
$data['daemon_sftp'] = $this->option('daemonSFTPPort') ?? $this->ask(__('commands.make_node.daemonSFTP'), '2022');
|
||||||
$data['daemon_sftp_alias'] = $this->option('daemonSFTPAlias') ?? $this->ask(__('commands.make_node.daemonSFTPAlias'), '');
|
$data['daemon_sftp_alias'] = $this->option('daemonSFTPAlias') ?? $this->ask(__('commands.make_node.daemonSFTPAlias'), '');
|
||||||
$data['daemon_base'] = $this->option('daemonBase') ?? $this->ask(__('commands.make_node.daemonBase'), '/var/lib/pelican/volumes');
|
$data['daemon_base'] = $this->option('daemonBase') ?? $this->ask(__('commands.make_node.daemonBase'), '/var/lib/pelican/volumes');
|
||||||
|
|
||||||
$node = $this->creationService->handle($data);
|
$node = $this->creationService->handle($data);
|
||||||
$this->line(__('commands.make_node.succes1') . $data['name'] . __('commands.make_node.succes2') . $node->id . '.');
|
$this->line(__('commands.make_node.success', ['name' => $data['name'], 'id' => $node->id]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,8 +131,8 @@ class CreateNode extends CreateRecord
|
|||||||
])
|
])
|
||||||
->label(trans('strings.port'))
|
->label(trans('strings.port'))
|
||||||
->helperText('If you are running the daemon behind Cloudflare you should set the daemon port to 8443 to allow websocket proxying over SSL.')
|
->helperText('If you are running the daemon behind Cloudflare you should set the daemon port to 8443 to allow websocket proxying over SSL.')
|
||||||
->minValue(0)
|
->minValue(1)
|
||||||
->maxValue(65536)
|
->maxValue(65535)
|
||||||
->default(8080)
|
->default(8080)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
@ -242,8 +242,8 @@ class CreateNode extends CreateRecord
|
|||||||
Forms\Components\TextInput::make('daemon_sftp')
|
Forms\Components\TextInput::make('daemon_sftp')
|
||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->label('SFTP Port')
|
->label('SFTP Port')
|
||||||
->minValue(0)
|
->minValue(1)
|
||||||
->maxValue(65536)
|
->maxValue(65535)
|
||||||
->default(2022)
|
->default(2022)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
|
@ -132,8 +132,8 @@ class EditNode extends EditRecord
|
|||||||
])
|
])
|
||||||
->label(trans('strings.port'))
|
->label(trans('strings.port'))
|
||||||
->helperText('If you are running the daemon behind Cloudflare you should set the daemon port to 8443 to allow websocket proxying over SSL.')
|
->helperText('If you are running the daemon behind Cloudflare you should set the daemon port to 8443 to allow websocket proxying over SSL.')
|
||||||
->minValue(0)
|
->minValue(1)
|
||||||
->maxValue(65536)
|
->maxValue(65535)
|
||||||
->default(8080)
|
->default(8080)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
@ -217,8 +217,8 @@ class EditNode extends EditRecord
|
|||||||
Forms\Components\TextInput::make('daemon_sftp')
|
Forms\Components\TextInput::make('daemon_sftp')
|
||||||
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 3])
|
->columnSpan(['default' => 1, 'sm' => 1, 'md' => 1, 'lg' => 3])
|
||||||
->label('SFTP Port')
|
->label('SFTP Port')
|
||||||
->minValue(0)
|
->minValue(1)
|
||||||
->maxValue(65536)
|
->maxValue(65535)
|
||||||
->default(2022)
|
->default(2022)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
|
@ -83,7 +83,7 @@ class Node extends Model
|
|||||||
'description' => 'string|nullable',
|
'description' => 'string|nullable',
|
||||||
'public' => 'boolean',
|
'public' => 'boolean',
|
||||||
'fqdn' => 'required|string',
|
'fqdn' => 'required|string',
|
||||||
'scheme' => 'required',
|
'scheme' => 'required|string|in:http,https',
|
||||||
'behind_proxy' => 'boolean',
|
'behind_proxy' => 'boolean',
|
||||||
'memory' => 'required|numeric|min:0',
|
'memory' => 'required|numeric|min:0',
|
||||||
'memory_overallocate' => 'required|numeric|min:-1',
|
'memory_overallocate' => 'required|numeric|min:-1',
|
||||||
|
@ -39,8 +39,7 @@ return [
|
|||||||
'daemonSFTP' => 'Enter the daemon SFTP listening port',
|
'daemonSFTP' => 'Enter the daemon SFTP listening port',
|
||||||
'daemonSFTPAlias' => 'Enter the daemon SFTP alias (can be empty)',
|
'daemonSFTPAlias' => 'Enter the daemon SFTP alias (can be empty)',
|
||||||
'daemonBase' => 'Enter the base folder',
|
'daemonBase' => 'Enter the base folder',
|
||||||
'succes1' => 'Successfully created a new node with the name: ',
|
'success' => 'Successfully created a new node with the name :name and has an id of :id',
|
||||||
'succes2' => 'and has an id of: ',
|
|
||||||
],
|
],
|
||||||
'node_config' => [
|
'node_config' => [
|
||||||
'error_not_exist' => 'The selected node does not exist.',
|
'error_not_exist' => 'The selected node does not exist.',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user