mirror of
https://github.com/pelican-dev/panel.git
synced 2025-09-09 16:58:47 +02:00
Use constants
This commit is contained in:
parent
4c41e659b5
commit
f2eca17480
@ -3,6 +3,7 @@
|
|||||||
namespace App\Filament\Resources\NodeResource\Pages;
|
namespace App\Filament\Resources\NodeResource\Pages;
|
||||||
|
|
||||||
use App\Filament\Resources\NodeResource;
|
use App\Filament\Resources\NodeResource;
|
||||||
|
use App\Models\Objects\Endpoint;
|
||||||
use Filament\Forms\Components\Actions\Action;
|
use Filament\Forms\Components\Actions\Action;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\Grid;
|
use Filament\Forms\Components\Grid;
|
||||||
@ -139,7 +140,7 @@ 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(1)
|
->minValue(1)
|
||||||
->maxValue(65535)
|
->maxValue(Endpoint::PORT_CEIL)
|
||||||
->default(8080)
|
->default(8080)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
@ -249,7 +250,7 @@ class CreateNode extends CreateRecord
|
|||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->label('SFTP Port')
|
->label('SFTP Port')
|
||||||
->minValue(1)
|
->minValue(1)
|
||||||
->maxValue(65535)
|
->maxValue(Endpoint::PORT_CEIL)
|
||||||
->default(2022)
|
->default(2022)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
|
@ -6,6 +6,7 @@ use App\Filament\Resources\NodeResource;
|
|||||||
use App\Filament\Resources\NodeResource\Widgets\NodeMemoryChart;
|
use App\Filament\Resources\NodeResource\Widgets\NodeMemoryChart;
|
||||||
use App\Filament\Resources\NodeResource\Widgets\NodeStorageChart;
|
use App\Filament\Resources\NodeResource\Widgets\NodeStorageChart;
|
||||||
use App\Models\Node;
|
use App\Models\Node;
|
||||||
|
use App\Models\Objects\Endpoint;
|
||||||
use App\Services\Nodes\NodeUpdateService;
|
use App\Services\Nodes\NodeUpdateService;
|
||||||
use Filament\Actions;
|
use Filament\Actions;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
@ -142,7 +143,7 @@ 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(1)
|
->minValue(1)
|
||||||
->maxValue(65535)
|
->maxValue(Endpoint::PORT_CEIL)
|
||||||
->default(8080)
|
->default(8080)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
@ -227,7 +228,7 @@ class EditNode extends EditRecord
|
|||||||
->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(1)
|
->minValue(1)
|
||||||
->maxValue(65535)
|
->maxValue(Endpoint::PORT_CEIL)
|
||||||
->default(2022)
|
->default(2022)
|
||||||
->required()
|
->required()
|
||||||
->integer(),
|
->integer(),
|
||||||
|
@ -748,7 +748,7 @@ class CreateServer extends CreateRecord
|
|||||||
$ports = $uniquePorts;
|
$ports = $uniquePorts;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ports = $ports->filter(fn ($port) => $port > 1024 && $port < 65535)->values();
|
$ports = $ports->filter(fn ($port) => $port > Endpoint::PORT_FLOOR && $port < Endpoint::PORT_CEIL)->values();
|
||||||
|
|
||||||
$set('ports', $ports->all());
|
$set('ports', $ports->all());
|
||||||
$this->ports = $ports->all();
|
$this->ports = $ports->all();
|
||||||
|
@ -905,7 +905,7 @@ class EditServer extends EditRecord
|
|||||||
$ports = $uniquePorts;
|
$ports = $uniquePorts;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ports = $ports->filter(fn ($port) => $port > 1024 && $port < 65535)->values();
|
$ports = $ports->filter(fn ($port) => $port > Endpoint::PORT_FLOOR && $port < Endpoint::PORT_CEIL)->values();
|
||||||
|
|
||||||
$set('ports', $ports->all());
|
$set('ports', $ports->all());
|
||||||
$this->ports = $ports->all();
|
$this->ports = $ports->all();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user