do not use Rule (deprecated), changed to Validate

This commit is contained in:
Andras Bacsai
2024-11-05 09:36:40 +01:00
parent d24d1394f7
commit 9b578b2003
26 changed files with 201 additions and 198 deletions

View File

@@ -6,7 +6,7 @@ use App\Models\Server;
use App\Models\StandaloneDocker; use App\Models\StandaloneDocker;
use App\Models\SwarmDocker; use App\Models\SwarmDocker;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
use Visus\Cuid2\Cuid2; use Visus\Cuid2\Cuid2;
@@ -18,16 +18,16 @@ class Docker extends Component
#[Locked] #[Locked]
public Server $selectedServer; public Server $selectedServer;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $name; public string $name;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $network; public string $network;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $serverId; public string $serverId;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $isSwarm = false; public bool $isSwarm = false;
public function mount(?string $server_id = null) public function mount(?string $server_id = null)

View File

@@ -6,7 +6,7 @@ use App\Models\Server;
use App\Models\StandaloneDocker; use App\Models\StandaloneDocker;
use App\Models\SwarmDocker; use App\Models\SwarmDocker;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Show extends Component class Show extends Component
@@ -14,13 +14,13 @@ class Show extends Component
#[Locked] #[Locked]
public $destination; public $destination;
#[Rule(['string', 'required'])] #[Validate(['string', 'required'])]
public string $name; public string $name;
#[Rule(['string', 'required'])] #[Validate(['string', 'required'])]
public string $network; public string $network;
#[Rule(['string', 'required'])] #[Validate(['string', 'required'])]
public string $serverIp; public string $serverIp;
public function mount(string $destination_uuid) public function mount(string $destination_uuid)

View File

@@ -5,17 +5,17 @@ namespace App\Livewire;
use DanHarrin\LivewireRateLimiting\WithRateLimiting; use DanHarrin\LivewireRateLimiting\WithRateLimiting;
use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Help extends Component class Help extends Component
{ {
use WithRateLimiting; use WithRateLimiting;
#[Rule(['required', 'min:10', 'max:1000'])] #[Validate(['required', 'min:10', 'max:1000'])]
public string $description; public string $description;
#[Rule(['required', 'min:3'])] #[Validate(['required', 'min:3'])]
public string $subject; public string $subject;
public function submit() public function submit()

View File

@@ -4,35 +4,35 @@ namespace App\Livewire\Notifications;
use App\Models\Team; use App\Models\Team;
use App\Notifications\Test; use App\Notifications\Test;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Discord extends Component class Discord extends Component
{ {
public Team $team; public Team $team;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordEnabled = false; public bool $discordEnabled = false;
#[Rule(['url', 'nullable'])] #[Validate(['url', 'nullable'])]
public ?string $discordWebhookUrl = null; public ?string $discordWebhookUrl = null;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordNotificationsTest = false; public bool $discordNotificationsTest = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordNotificationsDeployments = false; public bool $discordNotificationsDeployments = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordNotificationsStatusChanges = false; public bool $discordNotificationsStatusChanges = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordNotificationsDatabaseBackups = false; public bool $discordNotificationsDatabaseBackups = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordNotificationsScheduledTasks = false; public bool $discordNotificationsScheduledTasks = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $discordNotificationsServerDiskUsage = false; public bool $discordNotificationsServerDiskUsage = false;
public function mount() public function mount()

View File

@@ -5,6 +5,7 @@ namespace App\Livewire\Notifications;
use App\Models\Team; use App\Models\Team;
use App\Notifications\Test; use App\Notifications\Test;
use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\RateLimiter;
use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Email extends Component class Email extends Component
@@ -15,6 +16,9 @@ class Email extends Component
public bool $sharedEmailEnabled = false; public bool $sharedEmailEnabled = false;
#[Validate(['boolean'])]
public bool $smtpEnabled = false;
protected $rules = [ protected $rules = [
'team.smtp_enabled' => 'nullable|boolean', 'team.smtp_enabled' => 'nullable|boolean',
'team.smtp_from_address' => 'required|email', 'team.smtp_from_address' => 'required|email',

View File

@@ -4,53 +4,53 @@ namespace App\Livewire\Notifications;
use App\Models\Team; use App\Models\Team;
use App\Notifications\Test; use App\Notifications\Test;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Telegram extends Component class Telegram extends Component
{ {
public Team $team; public Team $team;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramEnabled = false; public bool $telegramEnabled = false;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramToken = null; public ?string $telegramToken = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramChatId = null; public ?string $telegramChatId = null;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramNotificationsTest = false; public bool $telegramNotificationsTest = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramNotificationsDeployments = false; public bool $telegramNotificationsDeployments = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramNotificationsStatusChanges = false; public bool $telegramNotificationsStatusChanges = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramNotificationsDatabaseBackups = false; public bool $telegramNotificationsDatabaseBackups = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramNotificationsScheduledTasks = false; public bool $telegramNotificationsScheduledTasks = false;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramNotificationsTestMessageThreadId = null; public ?string $telegramNotificationsTestMessageThreadId = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramNotificationsDeploymentsMessageThreadId = null; public ?string $telegramNotificationsDeploymentsMessageThreadId = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramNotificationsStatusChangesMessageThreadId = null; public ?string $telegramNotificationsStatusChangesMessageThreadId = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramNotificationsDatabaseBackupsMessageThreadId = null; public ?string $telegramNotificationsDatabaseBackupsMessageThreadId = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $telegramNotificationsScheduledTasksThreadId = null; public ?string $telegramNotificationsScheduledTasksThreadId = null;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $telegramNotificationsServerDiskUsage = false; public bool $telegramNotificationsServerDiskUsage = false;
public function mount() public function mount()

View File

@@ -3,15 +3,15 @@
namespace App\Livewire\Project; namespace App\Livewire\Project;
use App\Models\Project; use App\Models\Project;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class AddEmpty extends Component class AddEmpty extends Component
{ {
#[Rule(['required', 'string', 'min:3'])] #[Validate(['required', 'string', 'min:3'])]
public string $name; public string $name;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public string $description = ''; public string $description = '';
public function submit() public function submit()

View File

@@ -3,7 +3,6 @@
namespace App\Livewire\Project\Application\Preview; namespace App\Livewire\Project\Application\Preview;
use App\Models\Application; use App\Models\Application;
use Livewire\Attributes\Rule;
use Livewire\Component; use Livewire\Component;
use Spatie\Url\Url; use Spatie\Url\Url;
@@ -11,7 +10,7 @@ class Form extends Component
{ {
public Application $application; public Application $application;
#[Rule('required')] #[Validate('required')]
public string $previewUrlTemplate; public string $previewUrlTemplate;
public function mount() public function mount()

View File

@@ -5,7 +5,7 @@ namespace App\Livewire\Project\Application;
use App\Models\Application; use App\Models\Application;
use App\Models\PrivateKey; use App\Models\PrivateKey;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Source extends Component class Source extends Component
@@ -15,19 +15,19 @@ class Source extends Component
#[Locked] #[Locked]
public $privateKeys; public $privateKeys;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $privateKeyName = null; public ?string $privateKeyName = null;
#[Rule(['nullable', 'integer'])] #[Validate(['nullable', 'integer'])]
public ?int $privateKeyId = null; public ?int $privateKeyId = null;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $gitRepository; public string $gitRepository;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $gitBranch; public string $gitBranch;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $gitCommitSha = null; public ?string $gitCommitSha = null;
public function mount() public function mount()

View File

@@ -3,20 +3,20 @@
namespace App\Livewire\Project\Application; namespace App\Livewire\Project\Application;
use App\Models\Application; use App\Models\Application;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Swarm extends Component class Swarm extends Component
{ {
public Application $application; public Application $application;
#[Rule('required')] #[Validate('required')]
public int $swarmReplicas; public int $swarmReplicas;
#[Rule(['nullable'])] #[Validate(['nullable'])]
public ?string $swarmPlacementConstraints = null; public ?string $swarmPlacementConstraints = null;
#[Rule('required')] #[Validate('required')]
public bool $isSwarmOnlyWorkerNodes; public bool $isSwarmOnlyWorkerNodes;
public function mount() public function mount()

View File

@@ -8,7 +8,7 @@ use Exception;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
use Spatie\Url\Url; use Spatie\Url\Url;
@@ -22,37 +22,37 @@ class BackupEdit extends Component
#[Locked] #[Locked]
public $parameters; public $parameters;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $delete_associated_backups_locally = false; public bool $delete_associated_backups_locally = false;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $delete_associated_backups_s3 = false; public bool $delete_associated_backups_s3 = false;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $delete_associated_backups_sftp = false; public bool $delete_associated_backups_sftp = false;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $status = null; public ?string $status = null;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $backupEnabled = false; public bool $backupEnabled = false;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $frequency = ''; public string $frequency = '';
#[Rule(['required', 'integer', 'min:1'])] #[Validate(['required', 'integer', 'min:1'])]
public int $numberOfBackupsLocally = 1; public int $numberOfBackupsLocally = 1;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $saveS3 = false; public bool $saveS3 = false;
#[Rule(['required', 'integer'])] #[Validate(['required', 'integer'])]
public int $s3StorageId = 1; public int $s3StorageId = 1;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $databasesToBackup = null; public ?string $databasesToBackup = null;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $dumpAll = false; public bool $dumpAll = false;
public function mount() public function mount()

View File

@@ -8,7 +8,7 @@ use App\Models\Server;
use App\Models\StandaloneClickhouse; use App\Models\StandaloneClickhouse;
use Exception; use Exception;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class General extends Component class General extends Component
@@ -17,40 +17,40 @@ class General extends Component
public StandaloneClickhouse $database; public StandaloneClickhouse $database;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $name; public string $name;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $description = null; public ?string $description = null;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $clickhouseAdminUser; public string $clickhouseAdminUser;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $clickhouseAdminPassword; public string $clickhouseAdminPassword;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $image; public string $image;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $portsMappings = null; public ?string $portsMappings = null;
#[Rule(['nullable', 'boolean'])] #[Validate(['nullable', 'boolean'])]
public ?bool $isPublic = null; public ?bool $isPublic = null;
#[Rule(['nullable', 'integer'])] #[Validate(['nullable', 'integer'])]
public ?int $publicPort = null; public ?int $publicPort = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $customDockerRunOptions = null; public ?string $customDockerRunOptions = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $dbUrl = null; public ?string $dbUrl = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $dbUrlPublic = null; public ?string $dbUrlPublic = null;
#[Rule(['nullable', 'boolean'])] #[Validate(['nullable', 'boolean'])]
public bool $isLogDrainEnabled = false; public bool $isLogDrainEnabled = false;
public function getListeners() public function getListeners()

View File

@@ -5,15 +5,15 @@ namespace App\Livewire\Project\Database;
use App\Models\ScheduledDatabaseBackup; use App\Models\ScheduledDatabaseBackup;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class CreateScheduledBackup extends Component class CreateScheduledBackup extends Component
{ {
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public $frequency; public $frequency;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $saveToS3 = false; public bool $saveToS3 = false;
#[Locked] #[Locked]
@@ -21,7 +21,7 @@ class CreateScheduledBackup extends Component
public bool $enabled = true; public bool $enabled = true;
#[Rule(['required', 'integer'])] #[Validate(['required', 'integer'])]
public int $s3StorageId; public int $s3StorageId;
public Collection $definedS3s; public Collection $definedS3s;

View File

@@ -8,7 +8,7 @@ use App\Models\Server;
use App\Models\StandaloneDragonfly; use App\Models\StandaloneDragonfly;
use Exception; use Exception;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class General extends Component class General extends Component
@@ -17,37 +17,37 @@ class General extends Component
public StandaloneDragonfly $database; public StandaloneDragonfly $database;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $name; public string $name;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $description = null; public ?string $description = null;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $dragonflyPassword; public string $dragonflyPassword;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $image; public string $image;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $portsMappings = null; public ?string $portsMappings = null;
#[Rule(['nullable', 'boolean'])] #[Validate(['nullable', 'boolean'])]
public ?bool $isPublic = null; public ?bool $isPublic = null;
#[Rule(['nullable', 'integer'])] #[Validate(['nullable', 'integer'])]
public ?int $publicPort = null; public ?int $publicPort = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $customDockerRunOptions = null; public ?string $customDockerRunOptions = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $dbUrl = null; public ?string $dbUrl = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $dbUrlPublic = null; public ?string $dbUrlPublic = null;
#[Rule(['nullable', 'boolean'])] #[Validate(['nullable', 'boolean'])]
public bool $isLogDrainEnabled = false; public bool $isLogDrainEnabled = false;
public function getListeners() public function getListeners()

View File

@@ -4,7 +4,7 @@ namespace App\Livewire\Project\Database;
use Exception; use Exception;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class InitScript extends Component class InitScript extends Component
@@ -15,10 +15,10 @@ class InitScript extends Component
#[Locked] #[Locked]
public int $index; public int $index;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $filename = null; public ?string $filename = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $content = null; public ?string $content = null;
public function mount() public function mount()

View File

@@ -8,7 +8,7 @@ use App\Models\Server;
use App\Models\StandaloneKeydb; use App\Models\StandaloneKeydb;
use Exception; use Exception;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class General extends Component class General extends Component
@@ -17,40 +17,40 @@ class General extends Component
public StandaloneKeydb $database; public StandaloneKeydb $database;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $name; public string $name;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $description = null; public ?string $description = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $keydbConf = null; public ?string $keydbConf = null;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $keydbPassword; public string $keydbPassword;
#[Rule(['required', 'string'])] #[Validate(['required', 'string'])]
public string $image; public string $image;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $portsMappings = null; public ?string $portsMappings = null;
#[Rule(['nullable', 'boolean'])] #[Validate(['nullable', 'boolean'])]
public ?bool $isPublic = null; public ?bool $isPublic = null;
#[Rule(['nullable', 'integer'])] #[Validate(['nullable', 'integer'])]
public ?int $publicPort = null; public ?int $publicPort = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $customDockerRunOptions = null; public ?string $customDockerRunOptions = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $dbUrl = null; public ?string $dbUrl = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $dbUrlPublic = null; public ?string $dbUrlPublic = null;
#[Rule(['nullable', 'boolean'])] #[Validate(['nullable', 'boolean'])]
public bool $isLogDrainEnabled = false; public bool $isLogDrainEnabled = false;
public function getListeners() public function getListeners()

View File

@@ -3,17 +3,17 @@
namespace App\Livewire\Project; namespace App\Livewire\Project;
use App\Models\Project; use App\Models\Project;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Edit extends Component class Edit extends Component
{ {
public Project $project; public Project $project;
#[Rule(['required', 'string', 'min:3', 'max:255'])] #[Validate(['required', 'string', 'min:3', 'max:255'])]
public string $name; public string $name;
#[Rule(['nullable', 'string', 'max:255'])] #[Validate(['nullable', 'string', 'max:255'])]
public ?string $description = null; public ?string $description = null;
public function mount(string $project_uuid) public function mount(string $project_uuid)

View File

@@ -5,7 +5,7 @@ namespace App\Livewire\Project;
use App\Models\Application; use App\Models\Application;
use App\Models\Project; use App\Models\Project;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class EnvironmentEdit extends Component class EnvironmentEdit extends Component
@@ -17,10 +17,10 @@ class EnvironmentEdit extends Component
#[Locked] #[Locked]
public $environment; public $environment;
#[Rule(['required', 'string', 'min:3', 'max:255'])] #[Validate(['required', 'string', 'min:3', 'max:255'])]
public string $name; public string $name;
#[Rule(['nullable', 'string', 'max:255'])] #[Validate(['nullable', 'string', 'max:255'])]
public ?string $description = null; public ?string $description = null;
public function mount(string $project_uuid, string $environment_name) public function mount(string $project_uuid, string $environment_name)

View File

@@ -4,17 +4,17 @@ namespace App\Livewire\Project;
use App\Models\Environment; use App\Models\Environment;
use App\Models\Project; use App\Models\Project;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Show extends Component class Show extends Component
{ {
public Project $project; public Project $project;
#[Rule(['required', 'string', 'min:3'])] #[Validate(['required', 'string', 'min:3'])]
public string $name; public string $name;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $description = null; public ?string $description = null;
public function mount(string $project_uuid) public function mount(string $project_uuid)

View File

@@ -4,7 +4,7 @@ namespace App\Livewire\Server;
use App\Jobs\DockerCleanupJob; use App\Jobs\DockerCleanupJob;
use App\Models\Server; use App\Models\Server;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Advanced extends Component class Advanced extends Component
@@ -13,28 +13,28 @@ class Advanced extends Component
public array $parameters = []; public array $parameters = [];
#[Rule(['integer', 'min:1'])] #[Validate(['integer', 'min:1'])]
public int $concurrentBuilds = 1; public int $concurrentBuilds = 1;
#[Rule(['integer', 'min:1'])] #[Validate(['integer', 'min:1'])]
public int $dynamicTimeout = 1; public int $dynamicTimeout = 1;
#[Rule('boolean')] #[Validate('boolean')]
public bool $forceDockerCleanup = false; public bool $forceDockerCleanup = false;
#[Rule('string')] #[Validate('string')]
public string $dockerCleanupFrequency = '*/10 * * * *'; public string $dockerCleanupFrequency = '*/10 * * * *';
#[Rule(['integer', 'min:1', 'max:99'])] #[Validate(['integer', 'min:1', 'max:99'])]
public int $dockerCleanupThreshold = 10; public int $dockerCleanupThreshold = 10;
#[Rule(['integer', 'min:1', 'max:99'])] #[Validate(['integer', 'min:1', 'max:99'])]
public int $serverDiskUsageNotificationThreshold = 50; public int $serverDiskUsageNotificationThreshold = 50;
#[Rule('boolean')] #[Validate('boolean')]
public bool $deleteUnusedVolumes = false; public bool $deleteUnusedVolumes = false;
#[Rule('boolean')] #[Validate('boolean')]
public bool $deleteUnusedNetworks = false; public bool $deleteUnusedNetworks = false;
public function mount(string $server_uuid) public function mount(string $server_uuid)

View File

@@ -3,14 +3,14 @@
namespace App\Livewire\Server; namespace App\Livewire\Server;
use App\Models\Server; use App\Models\Server;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class CloudflareTunnels extends Component class CloudflareTunnels extends Component
{ {
public Server $server; public Server $server;
#[Rule(['required', 'boolean'])] #[Validate(['required', 'boolean'])]
public bool $isCloudflareTunnelsEnabled; public bool $isCloudflareTunnelsEnabled;
public function mount(string $server_uuid) public function mount(string $server_uuid)

View File

@@ -5,38 +5,38 @@ namespace App\Livewire\Server;
use App\Actions\Server\StartLogDrain; use App\Actions\Server\StartLogDrain;
use App\Actions\Server\StopLogDrain; use App\Actions\Server\StopLogDrain;
use App\Models\Server; use App\Models\Server;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class LogDrains extends Component class LogDrains extends Component
{ {
public Server $server; public Server $server;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $isLogDrainNewRelicEnabled = false; public bool $isLogDrainNewRelicEnabled = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $isLogDrainCustomEnabled = false; public bool $isLogDrainCustomEnabled = false;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $isLogDrainAxiomEnabled = false; public bool $isLogDrainAxiomEnabled = false;
#[Rule(['string', 'nullable'])] #[Validate(['string', 'nullable'])]
public ?string $logDrainNewRelicLicenseKey = null; public ?string $logDrainNewRelicLicenseKey = null;
#[Rule(['url', 'nullable'])] #[Validate(['url', 'nullable'])]
public ?string $logDrainNewRelicBaseUri = null; public ?string $logDrainNewRelicBaseUri = null;
#[Rule(['string', 'nullable'])] #[Validate(['string', 'nullable'])]
public ?string $logDrainAxiomDatasetName = null; public ?string $logDrainAxiomDatasetName = null;
#[Rule(['string', 'nullable'])] #[Validate(['string', 'nullable'])]
public ?string $logDrainAxiomApiKey = null; public ?string $logDrainAxiomApiKey = null;
#[Rule(['string', 'nullable'])] #[Validate(['string', 'nullable'])]
public ?string $logDrainCustomConfig = null; public ?string $logDrainCustomConfig = null;
#[Rule(['string', 'nullable'])] #[Validate(['string', 'nullable'])]
public ?string $logDrainCustomConfigParser = null; public ?string $logDrainCustomConfigParser = null;
public function mount(string $server_uuid) public function mount(string $server_uuid)

View File

@@ -5,77 +5,77 @@ namespace App\Livewire\Server;
use App\Actions\Server\StartSentinel; use App\Actions\Server\StartSentinel;
use App\Actions\Server\StopSentinel; use App\Actions\Server\StopSentinel;
use App\Models\Server; use App\Models\Server;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Show extends Component class Show extends Component
{ {
public Server $server; public Server $server;
#[Rule(['required'])] #[Validate(['required'])]
public string $name; public string $name;
#[Rule(['nullable'])] #[Validate(['nullable'])]
public ?string $description; public ?string $description;
#[Rule(['required'])] #[Validate(['required'])]
public string $ip; public string $ip;
#[Rule(['required'])] #[Validate(['required'])]
public string $user; public string $user;
#[Rule(['required'])] #[Validate(['required'])]
public string $port; public string $port;
#[Rule(['nullable'])] #[Validate(['nullable'])]
public ?string $validationLogs = null; public ?string $validationLogs = null;
#[Rule(['nullable', 'url'])] #[Validate(['nullable', 'url'])]
public ?string $wildcardDomain; public ?string $wildcardDomain;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isReachable; public bool $isReachable;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isUsable; public bool $isUsable;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isSwarmManager; public bool $isSwarmManager;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isSwarmWorker; public bool $isSwarmWorker;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isBuildServer; public bool $isBuildServer;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isMetricsEnabled; public bool $isMetricsEnabled;
#[Rule(['required'])] #[Validate(['required'])]
public string $sentinelToken; public string $sentinelToken;
#[Rule(['nullable'])] #[Validate(['nullable'])]
public ?string $sentinelUpdatedAt; public ?string $sentinelUpdatedAt;
#[Rule(['required', 'integer', 'min:1'])] #[Validate(['required', 'integer', 'min:1'])]
public int $sentinelMetricsRefreshRateSeconds; public int $sentinelMetricsRefreshRateSeconds;
#[Rule(['required', 'integer', 'min:1'])] #[Validate(['required', 'integer', 'min:1'])]
public int $sentinelMetricsHistoryDays; public int $sentinelMetricsHistoryDays;
#[Rule(['required', 'integer', 'min:10'])] #[Validate(['required', 'integer', 'min:10'])]
public int $sentinelPushIntervalSeconds; public int $sentinelPushIntervalSeconds;
#[Rule(['nullable', 'url'])] #[Validate(['nullable', 'url'])]
public ?string $sentinelCustomUrl; public ?string $sentinelCustomUrl;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isSentinelEnabled; public bool $isSentinelEnabled;
#[Rule(['required'])] #[Validate(['required'])]
public bool $isSentinelDebugEnabled; public bool $isSentinelDebugEnabled;
#[Rule(['required'])] #[Validate(['required'])]
public string $serverTimezone; public string $serverTimezone;
public array $timezones; public array $timezones;

View File

@@ -8,7 +8,7 @@ use App\Models\Server;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class Index extends Component class Index extends Component
@@ -20,58 +20,58 @@ class Index extends Component
#[Locked] #[Locked]
public $timezones; public $timezones;
#[Rule('boolean')] #[Validate('boolean')]
public bool $is_auto_update_enabled; public bool $is_auto_update_enabled;
#[Rule('nullable|string|max:255')] #[Validate('nullable|string|max:255')]
public ?string $fqdn = null; public ?string $fqdn = null;
#[Rule('nullable|string|max:255')] #[Validate('nullable|string|max:255')]
public ?string $resale_license = null; public ?string $resale_license = null;
#[Rule('required|integer|min:1025|max:65535')] #[Validate('required|integer|min:1025|max:65535')]
public int $public_port_min; public int $public_port_min;
#[Rule('required|integer|min:1025|max:65535')] #[Validate('required|integer|min:1025|max:65535')]
public int $public_port_max; public int $public_port_max;
#[Rule('nullable|string')] #[Validate('nullable|string')]
public ?string $custom_dns_servers = null; public ?string $custom_dns_servers = null;
#[Rule('nullable|string|max:255')] #[Validate('nullable|string|max:255')]
public ?string $instance_name = null; public ?string $instance_name = null;
#[Rule('nullable|string')] #[Validate('nullable|string')]
public ?string $allowed_ips = null; public ?string $allowed_ips = null;
#[Rule('nullable|string')] #[Validate('nullable|string')]
public ?string $public_ipv4 = null; public ?string $public_ipv4 = null;
#[Rule('nullable|string')] #[Validate('nullable|string')]
public ?string $public_ipv6 = null; public ?string $public_ipv6 = null;
#[Rule('string')] #[Validate('string')]
public string $auto_update_frequency; public string $auto_update_frequency;
#[Rule('string')] #[Validate('string')]
public string $update_check_frequency; public string $update_check_frequency;
#[Rule('required|string|timezone')] #[Validate('required|string|timezone')]
public string $instance_timezone; public string $instance_timezone;
#[Rule('boolean')] #[Validate('boolean')]
public bool $do_not_track; public bool $do_not_track;
#[Rule('boolean')] #[Validate('boolean')]
public bool $is_registration_enabled; public bool $is_registration_enabled;
#[Rule('boolean')] #[Validate('boolean')]
public bool $is_dns_validation_enabled; public bool $is_dns_validation_enabled;
#[Rule('boolean')] #[Validate('boolean')]
public bool $is_api_enabled; public bool $is_api_enabled;
#[Rule('boolean')] #[Validate('boolean')]
public bool $disable_two_step_confirmation; public bool $disable_two_step_confirmation;
public function render() public function render()

View File

@@ -8,7 +8,7 @@ use App\Models\ScheduledDatabaseBackup;
use App\Models\Server; use App\Models\Server;
use App\Models\StandalonePostgresql; use App\Models\StandalonePostgresql;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class SettingsBackup extends Component class SettingsBackup extends Component
@@ -25,19 +25,19 @@ class SettingsBackup extends Component
#[Locked] #[Locked]
public $executions = []; public $executions = [];
#[Rule(['required'])] #[Validate(['required'])]
public string $uuid; public string $uuid;
#[Rule(['required'])] #[Validate(['required'])]
public string $name; public string $name;
#[Rule(['nullable'])] #[Validate(['nullable'])]
public ?string $description = null; public ?string $description = null;
#[Rule(['required'])] #[Validate(['required'])]
public string $postgres_user; public string $postgres_user;
#[Rule(['required'])] #[Validate(['required'])]
public string $postgres_password; public string $postgres_password;
public function mount() public function mount()

View File

@@ -3,44 +3,44 @@
namespace App\Livewire; namespace App\Livewire;
use App\Models\InstanceSettings; use App\Models\InstanceSettings;
use Livewire\Attributes\Rule; use Livewire\Attributes\Validate;
use Livewire\Component; use Livewire\Component;
class SettingsEmail extends Component class SettingsEmail extends Component
{ {
public InstanceSettings $settings; public InstanceSettings $settings;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $smtpEnabled = false; public bool $smtpEnabled = false;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $smtpHost = null; public ?string $smtpHost = null;
#[Rule(['nullable', 'numeric', 'min:1', 'max:65535'])] #[Validate(['nullable', 'numeric', 'min:1', 'max:65535'])]
public ?int $smtpPort = null; public ?int $smtpPort = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $smtpEncryption = null; public ?string $smtpEncryption = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $smtpUsername = null; public ?string $smtpUsername = null;
#[Rule(['nullable'])] #[Validate(['nullable'])]
public ?string $smtpPassword = null; public ?string $smtpPassword = null;
#[Rule(['nullable', 'numeric'])] #[Validate(['nullable', 'numeric'])]
public ?int $smtpTimeout = null; public ?int $smtpTimeout = null;
#[Rule(['nullable', 'email'])] #[Validate(['nullable', 'email'])]
public ?string $smtpFromAddress = null; public ?string $smtpFromAddress = null;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $smtpFromName = null; public ?string $smtpFromName = null;
#[Rule(['boolean'])] #[Validate(['boolean'])]
public bool $resendEnabled = false; public bool $resendEnabled = false;
#[Rule(['nullable', 'string'])] #[Validate(['nullable', 'string'])]
public ?string $resendApiKey = null; public ?string $resendApiKey = null;
public function mount() public function mount()