diff --git a/app/Http/Livewire/Destination/Form.php b/app/Http/Livewire/Destination/Form.php index 19ba37cfe..4f400a670 100644 --- a/app/Http/Livewire/Destination/Form.php +++ b/app/Http/Livewire/Destination/Form.php @@ -13,6 +13,11 @@ class Form extends Component 'destination.network' => 'required', 'destination.server.ip' => 'required', ]; + protected $validationAttributes = [ + 'destination.name' => 'name', + 'destination.network' => 'network', + 'destination.server.ip' => 'IP Address', + ]; public function submit() { $this->validate(); diff --git a/app/Http/Livewire/Destination/New/StandaloneDocker.php b/app/Http/Livewire/Destination/New/StandaloneDocker.php index 498caa8c0..8e189c912 100644 --- a/app/Http/Livewire/Destination/New/StandaloneDocker.php +++ b/app/Http/Livewire/Destination/New/StandaloneDocker.php @@ -22,6 +22,11 @@ class StandaloneDocker extends Component 'network' => 'required|string', 'server_id' => 'required|integer' ]; + protected $validationAttributes = [ + 'name' => 'name', + 'network' => 'network', + 'server_id' => 'server' + ]; public function mount() { if (request()->query('server_id')) { diff --git a/app/Http/Livewire/PrivateKey/Change.php b/app/Http/Livewire/PrivateKey/Change.php index 4a7070c7f..d66ffc715 100644 --- a/app/Http/Livewire/PrivateKey/Change.php +++ b/app/Http/Livewire/PrivateKey/Change.php @@ -15,6 +15,11 @@ class Change extends Component 'private_key.description' => 'nullable|string', 'private_key.private_key' => 'required|string' ]; + protected $validationAttributes = [ + 'private_key.name' => 'name', + 'private_key.description' => 'description', + 'private_key.private_key' => 'private key' + ]; public function mount() { $this->private_key = PrivateKey::where('uuid', $this->private_key_uuid)->first(); diff --git a/app/Http/Livewire/PrivateKey/Create.php b/app/Http/Livewire/PrivateKey/Create.php index fda4ca722..af147a9e3 100644 --- a/app/Http/Livewire/PrivateKey/Create.php +++ b/app/Http/Livewire/PrivateKey/Create.php @@ -16,8 +16,8 @@ class Create extends Component 'value' => 'required|string', ]; protected $validationAttributes = [ - 'name' => 'Name', - 'value' => 'Private Key', + 'name' => 'name', + 'value' => 'private Key', ]; public function createPrivateKey() { diff --git a/app/Http/Livewire/Profile/Form.php b/app/Http/Livewire/Profile/Form.php index d09f540da..9075c4da2 100644 --- a/app/Http/Livewire/Profile/Form.php +++ b/app/Http/Livewire/Profile/Form.php @@ -14,6 +14,9 @@ class Form extends Component protected $rules = [ 'name' => 'required', ]; + protected $validationAttributes = [ + 'name' => 'name', + ]; public function mount() { $this->userId = auth()->user()->id; diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php index 811ae29b6..9b1b78a00 100644 --- a/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php +++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php @@ -18,6 +18,11 @@ class Add extends Component 'value' => 'required|string', 'is_build_time' => 'required|boolean', ]; + protected $validationAttributes = [ + 'key' => 'key', + 'value' => 'value', + 'is_build_time' => 'build', + ]; public function mount() { $this->parameters = getRouteParameters(); diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php index c08ed37a2..7dd73e487 100644 --- a/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php +++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php @@ -15,6 +15,11 @@ class Show extends Component 'env.value' => 'required|string', 'env.is_build_time' => 'required|boolean', ]; + protected $validationAttributes = [ + 'key' => 'key', + 'value' => 'value', + 'is_build_time' => 'build', + ]; public function mount() { $this->parameters = getRouteParameters(); diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php index abefe136b..f4d435ce9 100644 --- a/app/Http/Livewire/Project/Application/General.php +++ b/app/Http/Livewire/Project/Application/General.php @@ -47,6 +47,22 @@ class General extends Component 'application.ports_exposes' => 'required', 'application.ports_mappings' => 'nullable', ]; + protected $validationAttributes = [ + 'application.name' => 'name', + 'application.fqdn' => 'FQDN', + 'application.git_repository' => 'Git repository', + 'application.git_branch' => 'Git branch', + 'application.git_commit_sha' => 'Git commit SHA', + 'application.install_command' => 'Install command', + 'application.build_command' => 'Build command', + 'application.start_command' => 'Start command', + 'application.build_pack' => 'Build pack', + 'application.static_image' => 'Static image', + 'application.base_directory' => 'Base directory', + 'application.publish_directory' => 'Publish directory', + 'application.ports_exposes' => 'Ports exposes', + 'application.ports_mappings' => 'Ports mappings', + ]; public function instantSave() { // @TODO: find another way - if possible diff --git a/app/Http/Livewire/Project/Application/Preview/Form.php b/app/Http/Livewire/Project/Application/Preview/Form.php index 9cdac681b..2cb1aaa0a 100644 --- a/app/Http/Livewire/Project/Application/Preview/Form.php +++ b/app/Http/Livewire/Project/Application/Preview/Form.php @@ -14,6 +14,9 @@ class Form extends Component protected $rules = [ 'application.preview_url_template' => 'required', ]; + protected $validationAttributes = [ + 'application.preview_url_template' => 'preview url template', + ]; public function resetToDefault() { $this->application->preview_url_template = '{{pr_id}}.{{domain}}'; diff --git a/app/Http/Livewire/Project/Application/ResourceLimits.php b/app/Http/Livewire/Project/Application/ResourceLimits.php index 2b67f004e..6da94054f 100644 --- a/app/Http/Livewire/Project/Application/ResourceLimits.php +++ b/app/Http/Livewire/Project/Application/ResourceLimits.php @@ -17,6 +17,15 @@ class ResourceLimits extends Component 'application.limits_cpuset' => 'nullable', 'application.limits_cpu_shares' => 'nullable', ]; + protected $validationAttributes = [ + 'application.limits_memory' => 'memory', + 'application.limits_memory_swap' => 'swap', + 'application.limits_memory_swappiness' => 'swappiness', + 'application.limits_memory_reservation' => 'reservation', + 'application.limits_cpus' => 'cpus', + 'application.limits_cpuset' => 'cpuset', + 'application.limits_cpu_shares' => 'cpu shares', + ]; public function submit() { try { diff --git a/app/Http/Livewire/Project/Application/Source.php b/app/Http/Livewire/Project/Application/Source.php index 0a39b03f6..83b457ae5 100644 --- a/app/Http/Livewire/Project/Application/Source.php +++ b/app/Http/Livewire/Project/Application/Source.php @@ -16,6 +16,11 @@ class Source extends Component 'application.git_branch' => 'required', 'application.git_commit_sha' => 'nullable', ]; + protected $validationAttributes = [ + 'application.git_repository' => 'repository', + 'application.git_branch' => 'branch', + 'application.git_commit_sha' => 'commit sha', + ]; private function get_private_keys() { $this->private_keys = PrivateKey::whereTeamId(session('currentTeam')->id)->get()->reject(function ($key) { diff --git a/app/Http/Livewire/Project/Application/Storages/Add.php b/app/Http/Livewire/Project/Application/Storages/Add.php index 5c9c2a044..818657a02 100644 --- a/app/Http/Livewire/Project/Application/Storages/Add.php +++ b/app/Http/Livewire/Project/Application/Storages/Add.php @@ -17,6 +17,11 @@ class Add extends Component 'mount_path' => 'required|string', 'host_path' => 'string|nullable', ]; + protected $validationAttributes = [ + 'name' => 'name', + 'mount_path' => 'mount', + 'host_path' => 'host', + ]; public function mount() { $this->parameters = getRouteParameters(); diff --git a/app/Http/Livewire/Project/Application/Storages/Show.php b/app/Http/Livewire/Project/Application/Storages/Show.php index d9255f284..da017d6fb 100644 --- a/app/Http/Livewire/Project/Application/Storages/Show.php +++ b/app/Http/Livewire/Project/Application/Storages/Show.php @@ -12,6 +12,11 @@ class Show extends Component 'storage.mount_path' => 'required|string', 'storage.host_path' => 'string|nullable', ]; + protected $validationAttributes = [ + 'name' => 'name', + 'mount_path' => 'mount', + 'host_path' => 'host', + ]; public function submit() { $this->validate(); diff --git a/app/Http/Livewire/Project/DeleteEnvironment.php b/app/Http/Livewire/Project/DeleteEnvironment.php index a322a2826..9e712d859 100644 --- a/app/Http/Livewire/Project/DeleteEnvironment.php +++ b/app/Http/Livewire/Project/DeleteEnvironment.php @@ -3,14 +3,12 @@ namespace App\Http\Livewire\Project; use App\Models\Environment; -use App\Models\Project; use Livewire\Component; class DeleteEnvironment extends Component { public array $parameters; public int $environment_id; - public int $resource_count = 0; public function mount() { diff --git a/app/Http/Livewire/Project/DeleteProject.php b/app/Http/Livewire/Project/DeleteProject.php index d60710f2d..1a22e6257 100644 --- a/app/Http/Livewire/Project/DeleteProject.php +++ b/app/Http/Livewire/Project/DeleteProject.php @@ -9,7 +9,6 @@ class DeleteProject extends Component { public array $parameters; public int $project_id; - public int $resource_count = 0; public function mount() { diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php index 07c739201..05793695e 100644 --- a/app/Http/Livewire/Project/New/PublicGitRepository.php +++ b/app/Http/Livewire/Project/New/PublicGitRepository.php @@ -37,6 +37,12 @@ class PublicGitRepository extends Component 'is_static' => 'required|boolean', 'publish_directory' => 'nullable|string', ]; + protected $validationAttributes = [ + 'repository_url' => 'repository', + 'port' => 'port', + 'is_static' => 'static', + 'publish_directory' => 'publish directory', + ]; public function mount() { if (isDev()) { diff --git a/app/Http/Livewire/RunCommand.php b/app/Http/Livewire/RunCommand.php index 187ea3a35..e5404a485 100755 --- a/app/Http/Livewire/RunCommand.php +++ b/app/Http/Livewire/RunCommand.php @@ -16,6 +16,10 @@ class RunCommand extends Component 'server' => 'required', 'command' => 'required', ]; + protected $validationAttributes = [ + 'server' => 'server', + 'command' => 'command', + ]; public function mount($servers) { $this->servers = $servers; diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.php index 65882abce..39aff9b95 100644 --- a/app/Http/Livewire/Server/Form.php +++ b/app/Http/Livewire/Server/Form.php @@ -21,6 +21,15 @@ class Form extends Component 'server.settings.is_reachable' => 'required', 'server.settings.is_part_of_swarm' => 'required' ]; + protected $validationAttributes = [ + 'server.name' => 'name', + 'server.description' => 'description', + 'server.ip' => 'ip', + 'server.user' => 'user', + 'server.port' => 'port', + 'server.settings.is_reachable' => 'is reachable', + 'server.settings.is_part_of_swarm' => 'is part of swarm' + ]; public function installDocker() { $activity = resolve(InstallDocker::class)($this->server); diff --git a/app/Http/Livewire/Server/New/ByIp.php b/app/Http/Livewire/Server/New/ByIp.php index c2cc1cd06..424f31e1b 100644 --- a/app/Http/Livewire/Server/New/ByIp.php +++ b/app/Http/Livewire/Server/New/ByIp.php @@ -22,11 +22,18 @@ class ByIp extends Component public bool $is_part_of_swarm = false; protected $rules = [ - 'name' => 'required', - 'ip' => 'required', - 'user' => 'required', + 'name' => 'required|string', + 'description' => 'nullable|string', + 'ip' => 'required|ip', + 'user' => 'required|string', 'port' => 'required|integer', - 'is_part_of_swarm' => 'required|boolean', + ]; + protected $validationAttributes = [ + 'name' => 'name', + 'description' => 'description', + 'ip' => 'ip', + 'user' => 'user', + 'port' => 'port', ]; public function mount() { @@ -43,11 +50,11 @@ class ByIp extends Component } public function submit() { + $this->validate(); try { if (!$this->private_key_id) { return $this->emit('error', 'You must select a private key'); } - $this->validate(); $server = Server::create([ 'name' => $this->name, 'description' => $this->description, diff --git a/app/Http/Livewire/Settings/Configuration.php b/app/Http/Livewire/Settings/Configuration.php index 57de5e165..e52b1b97f 100644 --- a/app/Http/Livewire/Settings/Configuration.php +++ b/app/Http/Livewire/Settings/Configuration.php @@ -25,6 +25,13 @@ class Configuration extends Component 'settings.public_port_max' => 'required', 'settings.default_redirect_404' => 'nullable', ]; + protected $validationAttributes = [ + 'settings.fqdn' => 'FQDN', + 'settings.wildcard_domain' => 'Wildcard domain', + 'settings.public_port_min' => 'Public port min', + 'settings.public_port_max' => 'Public port max', + 'settings.default_redirect_404' => 'Default redirect 404', + ]; public function mount() { $this->do_not_track = $this->settings->do_not_track; diff --git a/app/Http/Livewire/Upgrade.php b/app/Http/Livewire/Upgrade.php index bd9cf43d1..9cb3bdb5e 100644 --- a/app/Http/Livewire/Upgrade.php +++ b/app/Http/Livewire/Upgrade.php @@ -10,12 +10,13 @@ class Upgrade extends Component { public bool $showProgress = false; public bool $isUpgradeAvailable = false; + public string $latestVersion = ''; public function checkUpdate() { - $latestVersion = get_latest_version_of_coolify(); + $this->latestVersion = get_latest_version_of_coolify(); $currentVersion = config('version'); - version_compare($currentVersion, $latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false; + version_compare($currentVersion, $this->latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false; if (isDev()) { $this->isUpgradeAvailable = true; } @@ -25,7 +26,7 @@ class Upgrade extends Component try { $this->showProgress = true; resolve(UpdateCoolify::class)(true); - Toaster::success('Upgrading Coolify to latest version...'); + Toaster::success("Upgrading Coolify to {$this->latestVersion} version..."); } catch (\Exception $e) { return general_error_handler(err: $e, that: $this); } diff --git a/config/version.php b/config/version.php index 1e9458f22..6d915d39f 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ {{ possibleSequences[sequenceState.sequence[sequenceState.currentActionIndex]].newTitle }} -