Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fixes

Andras Bacsaif79b3841c7d9
diff --git a/app/Http/Controllers/ApplicationController.php b/app/Http/Controllers/ApplicationController.php
index 29d9cc1526..3dbd6115d3 100644
--- a/app/Http/Controllers/ApplicationController.php
+++ b/app/Http/Controllers/ApplicationController.php
@@ -46,7 +46,7 @@ class ApplicationController extends Controller
public function deployment()
{
- $deployment_uuid = request()->route('deployment_uuid');
+ $deploymentUuid = request()->route('deployment_uuid');
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
@@ -60,7 +60,7 @@ class ApplicationController extends Controller
if (!$application) {
return redirect()->route('dashboard');
}
- $activity = Activity::where('properties->type_uuid', '=', $deployment_uuid)->first();
+ $activity = Activity::where('properties->type_uuid', '=', $deploymentUuid)->first();
if (!$activity) {
return redirect()->route('project.application.deployments', [
'project_uuid' => $project->uuid,
@@ -68,7 +68,7 @@ class ApplicationController extends Controller
'application_uuid' => $application->uuid,
]);
}
- $deployment = ApplicationDeploymentQueue::where('deployment_uuid', $deployment_uuid)->first();
+ $deployment = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
if (!$deployment) {
return redirect()->route('project.application.deployments', [
'project_uuid' => $project->uuid,
@@ -80,7 +80,7 @@ class ApplicationController extends Controller
'application' => $application,
'activity' => $activity,
'deployment' => $deployment,
- 'deployment_uuid' => $deployment_uuid,
+ 'deployment_uuid' => $deploymentUuid,
]);
}
}
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 5b0dd973c4..5c14a7b9a9 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -64,7 +64,7 @@ class Controller extends BaseController
'invitations' => $invitations,
]);
}
- public function accept_invitation()
+ public function acceptInvitation()
{
try {
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
@@ -76,8 +76,8 @@ class Controller extends BaseController
abort(401);
}
- $created_at = $invitation->created_at;
- $diff = $created_at->diffInMinutes(now());
+ $createdAt = $invitation->created_at;
+ $diff = $createdAt->diffInMinutes(now());
if ($diff <= config('constants.invitation.link.expiration')) {
$user->teams()->attach($invitation->team->id, ['role' => $invitation->role]);
$invitation->delete();
@@ -90,7 +90,7 @@ class Controller extends BaseController
throw $th;
}
}
- public function revoke_invitation()
+ public function revokeInvitation()
{
try {
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
diff --git a/app/Http/Controllers/MagicController.php b/app/Http/Controllers/MagicController.php
index 9a23b2fe13..f8cf94ee1a 100644
--- a/app/Http/Controllers/MagicController.php
+++ b/app/Http/Controllers/MagicController.php
@@ -33,7 +33,7 @@ class MagicController extends Controller
'environments' => Project::ownedByCurrentTeam()->whereUuid(request()->query('project_uuid'))->first()->environments
]);
}
- public function new_project()
+ public function newProject()
{
$project = Project::firstOrCreate(
['name' => request()->query('name') ?? generate_random_name()],
@@ -43,7 +43,7 @@ class MagicController extends Controller
'project_uuid' => $project->uuid
]);
}
- public function new_environment()
+ public function newEnvironment()
{
$environment = Environment::firstOrCreate(
['name' => request()->query('name') ?? generate_random_name()],
diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php
index 7fc5680ff9..79202a65ae 100644
--- a/app/Http/Controllers/ProjectController.php
+++ b/app/Http/Controllers/ProjectController.php
@@ -8,18 +8,18 @@ class ProjectController extends Controller
{
public function all()
{
- $team_id = session('currentTeam')->id;
+ $teamId = session('currentTeam')->id;
- $projects = Project::where('team_id', $team_id)->get();
+ $projects = Project::where('team_id', $teamId)->get();
return view('projects', ['projects' => $projects]);
}
public function show()
{
- $project_uuid = request()->route('project_uuid');
- $team_id = session('currentTeam')->id;
+ $projectUuid = request()->route('project_uuid');
+ $teamId = session('currentTeam')->id;
- $project = Project::where('team_id', $team_id)->where('uuid', $project_uuid)->first();
+ $project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
if (!$project) {
return redirect()->route('dashboard');
}
diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php
deleted file mode 100644
index d21ad89bec..0000000000
--- a/app/Http/Controllers/ServerController.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use App\Models\PrivateKey;
-use App\Models\Server;
-
-class ServerController extends Controller
-{
- public function all()
- {
- return view('server.all', [
- 'servers' => Server::ownedByCurrentTeam()->get()
- ]);
- }
- public function create()
- {
- return view('server.create', [
- 'private_keys' => PrivateKey::ownedByCurrentTeam()->get(),
- ]);
- }
- public function show()
- {
- return view('server.show', [
- 'server' => Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(),
- ]);
- }
- public function proxy()
- {
- return view('server.proxy', [
- 'server' => Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(),
- ]);
- }
-}
diff --git a/app/Http/Livewire/Project/Application/Danger.php b/app/Http/Livewire/Project/Application/Danger.php
index 52c947c581..72873665e0 100644
--- a/app/Http/Livewire/Project/Application/Danger.php
+++ b/app/Http/Livewire/Project/Application/Danger.php
@@ -12,7 +12,7 @@ class Danger extends Component
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function delete()
{
diff --git a/app/Http/Livewire/Project/Application/Deploy.php b/app/Http/Livewire/Project/Application/Deploy.php
index 460a0ba113..fabb70d9d0 100644
--- a/app/Http/Livewire/Project/Application/Deploy.php
+++ b/app/Http/Livewire/Project/Application/Deploy.php
@@ -3,7 +3,6 @@
namespace App\Http\Livewire\Project\Application;
use App\Jobs\ApplicationContainerStatusJob;
-use App\Jobs\ContainerStopJob;
use App\Models\Application;
use Livewire\Component;
use Visus\Cuid2\Cuid2;
@@ -17,7 +16,7 @@ class Deploy extends Component
public $destination;
public array $parameters;
- protected string $deployment_uuid;
+ protected string $deploymentUuid;
protected array $command = [];
protected $source;
@@ -27,7 +26,7 @@ class Deploy extends Component
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
$this->application = Application::where('id', $this->applicationId)->first();
$this->destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();
}
@@ -35,10 +34,9 @@ class Deploy extends Component
{
$this->application->refresh();
}
- protected function set_deployment_uuid()
+ protected function setDeploymentUuid()
{
- // Create Deployment ID
- $this->deployment_uuid = new Cuid2(7);
+ $this->deploymentUuid = new Cuid2(7);
$this->parameters['deployment_uuid'] = $this->deployment_uuid;
}
public function deploy(bool $force = false, bool|null $debug = null)
@@ -47,7 +45,7 @@ class Deploy extends Component
$this->application->settings->is_debug_enabled = true;
$this->application->settings->save();
}
- $this->set_deployment_uuid();
+ $this->setDeploymentUuid();
queue_application_deployment(
application_id: $this->application->id,
@@ -65,7 +63,7 @@ class Deploy extends Component
public function stop()
{
instant_remote_process(["docker rm -f {$this->application->uuid}"], $this->application->destination->server);
- $this->application->status = get_container_status(server: $this->application->destination->server, container_id: $this->application->uuid);
+ $this->application->status = 'stopped';
$this->application->save();
$this->emit('applicationStatusChanged');
}
diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php
index 8d68308347..811ae29b66 100644
--- a/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php
+++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php
@@ -20,7 +20,7 @@ class Add extends Component
];
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function submit()
{
diff --git a/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php b/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php
index 9d58776f05..c08ed37a2a 100644
--- a/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php
+++ b/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php
@@ -17,7 +17,7 @@ class Show extends Component
];
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function submit()
{
diff --git a/app/Http/Livewire/Project/Application/Previews.php b/app/Http/Livewire/Project/Application/Previews.php
index 197fb74ed8..da1f0da751 100644
--- a/app/Http/Livewire/Project/Application/Previews.php
+++ b/app/Http/Livewire/Project/Application/Previews.php
@@ -20,7 +20,7 @@ class Previews extends Component
public function mount()
{
$this->pull_requests = collect();
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function loadStatus($pull_request_id)
{
@@ -30,7 +30,7 @@ class Previews extends Component
pull_request_id: $pull_request_id
));
}
- protected function set_deployment_uuid()
+ protected function setDeploymentUuid()
{
$this->deployment_uuid = new Cuid2(7);
$this->parameters['deployment_uuid'] = $this->deployment_uuid;
@@ -49,7 +49,7 @@ class Previews extends Component
public function deploy(int $pull_request_id, string|null $pull_request_html_url = null)
{
try {
- $this->set_deployment_uuid();
+ $this->setDeploymentUuid();
$found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first();
if (!$found && !is_null($pull_request_html_url)) {
ApplicationPreview::create([
diff --git a/app/Http/Livewire/Project/Application/Rollback.php b/app/Http/Livewire/Project/Application/Rollback.php
index ff89fce70c..2e708ec36b 100644
--- a/app/Http/Livewire/Project/Application/Rollback.php
+++ b/app/Http/Livewire/Project/Application/Rollback.php
@@ -16,7 +16,7 @@ class Rollback extends Component
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function rollbackImage($commit)
{
diff --git a/app/Http/Livewire/Project/Application/Storages/Add.php b/app/Http/Livewire/Project/Application/Storages/Add.php
index 6bb7557f18..5c9c2a0444 100644
--- a/app/Http/Livewire/Project/Application/Storages/Add.php
+++ b/app/Http/Livewire/Project/Application/Storages/Add.php
@@ -2,10 +2,6 @@
namespace App\Http\Livewire\Project\Application\Storages;
-use App\Models\Application;
-use App\Models\LocalPersistentVolume;
-use Illuminate\Database\QueryException;
-use Illuminate\Support\Facades\Route;
use Livewire\Component;
class Add extends Component
@@ -23,7 +19,7 @@ class Add extends Component
];
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function submit()
{
diff --git a/app/Http/Livewire/Project/DeleteEnvironment.php b/app/Http/Livewire/Project/DeleteEnvironment.php
index a009b268e3..a322a28262 100644
--- a/app/Http/Livewire/Project/DeleteEnvironment.php
+++ b/app/Http/Livewire/Project/DeleteEnvironment.php
@@ -14,7 +14,7 @@ class DeleteEnvironment extends Component
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function delete()
{
diff --git a/app/Http/Livewire/Project/DeleteProject.php b/app/Http/Livewire/Project/DeleteProject.php
index 89bd7bc5e6..d60710f2d6 100644
--- a/app/Http/Livewire/Project/DeleteProject.php
+++ b/app/Http/Livewire/Project/DeleteProject.php
@@ -13,7 +13,7 @@ class DeleteProject extends Component
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
}
public function delete()
{
diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepository.php b/app/Http/Livewire/Project/New/GithubPrivateRepository.php
index 09ae573f35..6159b81977 100644
--- a/app/Http/Livewire/Project/New/GithubPrivateRepository.php
+++ b/app/Http/Livewire/Project/New/GithubPrivateRepository.php
@@ -44,7 +44,7 @@ class GithubPrivateRepository extends Component
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
$this->query = request()->query();
$this->repositories = $this->branches = collect();
$this->github_apps = GithubApp::private();
diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
index 94c2ca5c27..3fd4b6f0bb 100644
--- a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
+++ b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php
@@ -53,7 +53,7 @@ class GithubPrivateRepositoryDeployKey extends Component
if (config('app.env') === 'local') {
$this->repository_url = 'https://github.com/coollabsio/coolify-examples';
}
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
$this->query = request()->query();
$this->private_keys = PrivateKey::where('team_id', session('currentTeam')->id)->get();
}
diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php
index 94e5bd258d..52e63bb706 100644
--- a/app/Http/Livewire/Project/New/PublicGitRepository.php
+++ b/app/Http/Livewire/Project/New/PublicGitRepository.php
@@ -43,7 +43,7 @@ class PublicGitRepository extends Component
$this->repository_url = 'https://github.com/coollabsio/coolify-examples';
$this->port = 3000;
}
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
$this->query = request()->query();
}
diff --git a/app/Http/Livewire/Server/PrivateKey.php b/app/Http/Livewire/Server/PrivateKey.php
index 4cfa601917..2bd939723f 100644
--- a/app/Http/Livewire/Server/PrivateKey.php
+++ b/app/Http/Livewire/Server/PrivateKey.php
@@ -23,7 +23,7 @@ class PrivateKey extends Component
}
public function mount()
{
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
$this->private_keys = ModelsPrivateKey::where('team_id', session('currentTeam')->id)->get();
}
}
diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php
index 161073b81e..b020e0ca43 100644
--- a/app/Http/Livewire/Source/Github/Change.php
+++ b/app/Http/Livewire/Source/Github/Change.php
@@ -38,7 +38,7 @@ class Change extends Component
public function mount()
{
$this->webhook_endpoint = $this->ipv4;
- $this->parameters = get_parameters();
+ $this->parameters = getRouteParameters();
$this->is_system_wide = $this->github_app->is_system_wide;
}
public function submit()
diff --git a/app/Models/Git.php b/app/Models/Git.php
deleted file mode 100644
index a615b65f4e..0000000000
--- a/app/Models/Git.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-namespace App\Models;
-
-use Illuminate\Database\Eloquent\Model;
-
-class Git extends Model
-{
- public function applications()
- {
- return $this->morphMany(Application::class, 'source');
- }
-}
diff --git a/app/Models/ProjectSetting.php b/app/Models/ProjectSetting.php
index 1d0d7c48ca..50192099e0 100644
--- a/app/Models/ProjectSetting.php
+++ b/app/Models/ProjectSetting.php
@@ -2,7 +2,9 @@
namespace App\Models;
-class ProjectSetting extends BaseModel
+use Illuminate\Database\Eloquent\Model;
+
+class ProjectSetting extends Model
{
protected $fillable = [
'project_id'
diff --git a/app/Models/ServerSetting.php b/app/Models/ServerSetting.php
index 03faf30677..43a4f2e642 100644
--- a/app/Models/ServerSetting.php
+++ b/app/Models/ServerSetting.php
@@ -2,7 +2,9 @@
namespace App\Models;
-class ServerSetting extends BaseModel
+use Illuminate\Database\Eloquent\Model;
+
+class ServerSetting extends Model
{
protected $fillable = [
'server_id'
diff --git a/app/Models/Team.php b/app/Models/Team.php
index 562c3e1aa9..02660e90f9 100644
--- a/app/Models/Team.php
+++ b/app/Models/Team.php
@@ -5,10 +5,11 @@ namespace App\Models;
use App\Notifications\Channels\SendsEmail;
use App\Notifications\Channels\SendsDiscord;
use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Spatie\SchemalessAttributes\Casts\SchemalessAttributes;
-class Team extends BaseModel implements SendsDiscord, SendsEmail
+class Team extends Model implements SendsDiscord, SendsEmail
{
use Notifiable;
diff --git a/app/Models/User.php b/app/Models/User.php
index a043ae89d1..b1804d7b4f 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -31,9 +31,6 @@ class User extends Authenticatable implements SendsEmail
{
parent::boot();
- static::creating(function (Model $model) {
- $model->uuid = (string) new Cuid2(7);
- });
static::created(function (User $user) {
$team = [
'name' => $user->name . "'s Team",
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index 3001b24b11..d23e66d110 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -37,7 +37,7 @@ function general_error_handler(\Throwable|null $err = null, $that = null, $isJso
}
}
-function get_parameters()
+function getRouteParameters()
{
return Route::current()->parameters();
}
diff --git a/database/migrations/2023_03_20_112811_create_teams_table.php b/database/migrations/2023_03_20_112811_create_teams_table.php
index 4396c8db72..6c59b184aa 100644
--- a/database/migrations/2023_03_20_112811_create_teams_table.php
+++ b/database/migrations/2023_03_20_112811_create_teams_table.php
@@ -13,7 +13,6 @@ return new class extends Migration
{
Schema::create('teams', function (Blueprint $table) {
$table->id();
- $table->string('uuid')->unique();
$table->string('name');
$table->boolean('personal_team')->default(false);
$table->schemalessAttributes('extra_attributes');
diff --git a/database/migrations/2023_03_24_140712_create_server_settings_table.php b/database/migrations/2023_03_24_140712_create_server_settings_table.php
index 30ede38702..8b5f432fa8 100644
--- a/database/migrations/2023_03_24_140712_create_server_settings_table.php
+++ b/database/migrations/2023_03_24_140712_create_server_settings_table.php
@@ -13,13 +13,10 @@ return new class extends Migration
{
Schema::create('server_settings', function (Blueprint $table) {
$table->id();
- $table->string('uuid')->unique();
-
$table->boolean('is_part_of_swarm')->default(false);
$table->boolean('is_jump_server')->default(false);
$table->boolean('is_build_server')->default(false);
$table->boolean('is_validated')->default(false);
-
$table->foreignId('server_id');
$table->timestamps();
});
diff --git a/database/migrations/2023_03_27_075443_create_project_settings_table.php b/database/migrations/2023_03_27_075443_create_project_settings_table.php
index 40e8bed1fa..35f691ea83 100644
--- a/database/migrations/2023_03_27_075443_create_project_settings_table.php
+++ b/database/migrations/2023_03_27_075443_create_project_settings_table.php
@@ -13,11 +13,8 @@ return new class extends Migration
{
Schema::create('project_settings', function (Blueprint $table) {
$table->id();
- $table->string('uuid')->unique();
$table->string('wildcard_domain')->nullable();
-
$table->foreignId('project_id');
-
$table->timestamps();
});
}
diff --git a/database/migrations/2023_03_28_083722_create_gits_table.php b/database/migrations/2023_03_28_083722_create_gits_table.php
deleted file mode 100644
index cb7a8de1d7..0000000000
--- a/database/migrations/2023_03_28_083722_create_gits_table.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-use Illuminate\Database\Migrations\Migration;
-use Illuminate\Database\Schema\Blueprint;
-use Illuminate\Support\Facades\Schema;
-
-return new class extends Migration
-{
- /**
- * Run the migrations.
- */
- public function up(): void
- {
- Schema::create('gits', function (Blueprint $table) {
- $table->id();
- $table->enum('type', ['github', 'gitlab', 'bitbucket', 'custom']);
-
- $table->string('api_url');
- $table->string('html_url');
-
- $table->integer('custom_port')->default(22);
- $table->string('custom_user')->default('git');
-
- $table->longText('webhook_secret')->nullable();
- $table->foreignId('private_key_id')->nullable();
- $table->foreignId('project_id');
- $table->timestamps();
- });
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('gits');
- }
-};
diff --git a/database/migrations/2023_04_03_111012_create_local_persistent_volumes_table.php b/database/migrations/2023_04_03_111012_create_local_persistent_volumes_table.php
index e6f6c2e4a2..c3f2a976a9 100644
--- a/database/migrations/2023_04_03_111012_create_local_persistent_volumes_table.php
+++ b/database/migrations/2023_04_03_111012_create_local_persistent_volumes_table.php
@@ -13,7 +13,6 @@ return new class extends Migration
{
Schema::create('local_persistent_volumes', function (Blueprint $table) {
$table->id();
- $table->string('uuid')->unique();
$table->string('name');
$table->string('mount_path');
$table->string('host_path')->nullable();
diff --git a/resources/views/components/helper.blade.php b/resources/views/components/helper.blade.php
new file mode 100644
index 0000000000..a074aca2c7
--- /dev/null
+++ b/resources/views/components/helper.blade.php
@@ -0,0 +1,16 @@
+@props([
+ 'helper' => $attributes->has('helper'),
+])
+<div class="group">
+ <div class="cursor-pointer text-warning">
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-4 h-4 stroke-current">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
+ </svg>
+ </div>
+ <div class="absolute hidden text-xs group-hover:block border-coolgray-400 bg-coolgray-500">
+ <div class="p-4 card-body">
+ {!! $helper !!}
+ </div>
+ </div>
+</div>
diff --git a/resources/views/livewire/project/application/deploy.blade.php b/resources/views/livewire/project/application/deploy.blade.php
index e4d4aa53dc..dda1e9a9a1 100644
--- a/resources/views/livewire/project/application/deploy.blade.php
+++ b/resources/views/livewire/project/application/deploy.blade.php
@@ -1,4 +1,4 @@
-<div class="flex items-center gap-2" wire:poll.10000ms="pollStatus">
+<div class="flex items-center gap-2" wire:poll.10000ms="pollStatus" x-init="$wire.pollStatus">
<div class="group">
<label tabindex="0" class="flex items-center gap-2 cursor-pointer hover:text-white"> Actions
<x-chevron-down />
diff --git a/resources/views/livewire/project/application/environment-variable/add.blade.php b/resources/views/livewire/project/application/environment-variable/add.blade.php
index 8d228cd97b..54cd5eb260 100644
--- a/resources/views/livewire/project/application/environment-variable/add.blade.php
+++ b/resources/views/livewire/project/application/environment-variable/add.blade.php
@@ -1,10 +1,8 @@
-<form wire:submit.prevent='submit' class="flex flex-col max-w-fit">
- <div class="flex items-end justify-center gap-2">
- <x-forms.input placeholder="NODE_ENV" noDirty id="key" label="Name" required />
- <x-forms.input placeholder="production" noDirty id="value" label="Value" required />
- <x-forms.checkbox noDirty class="flex-col text-center w-96" id="is_build_time" label="Build Variable?" />
- <x-forms.button type="submit">
- Add New Variable
- </x-forms.button>
- </div>
+<form wire:submit.prevent='submit' class="flex flex-col gap-2 xl:items-end xl:flex-row"">
+ <x-forms.input placeholder="NODE_ENV" noDirty id="key" label="Name" required />
+ <x-forms.input placeholder="production" noDirty id="value" label="Value" required />
+ <x-forms.checkbox noDirty id="is_build_time" label="Build Variable?" />
+ <x-forms.button type="submit">
+ Add New Variable
+ </x-forms.button>
</form>
diff --git a/resources/views/livewire/project/application/environment-variable/all.blade.php b/resources/views/livewire/project/application/environment-variable/all.blade.php
index e55013ca0b..b6d89ad1cc 100644
--- a/resources/views/livewire/project/application/environment-variable/all.blade.php
+++ b/resources/views/livewire/project/application/environment-variable/all.blade.php
@@ -8,7 +8,7 @@
:env="$env" />
@endforeach
<div class="pt-2 pb-8">
- <livewire:project.application.environment-variable.add />
+ <livewire:project.application.environment-varia /ble.add />
</div>
<div>
<h3>Preview Deployments</h3>
diff --git a/resources/views/livewire/project/application/environment-variable/show.blade.php b/resources/views/livewire/project/application/environment-variable/show.blade.php
index e6ff24f8ba..00ddaf890f 100644
--- a/resources/views/livewire/project/application/environment-variable/show.blade.php
+++ b/resources/views/livewire/project/application/environment-variable/show.blade.php
@@ -1,17 +1,15 @@
<div x-data="{ deleteEnvironment: false }">
- <form wire:submit.prevent='submit' class="flex flex-col max-w-fit">
- <div class="flex items-end gap-2">
- <x-forms.input label="Name" id="env.key" />
- <x-forms.input label="Value" id="env.value" />
- <x-forms.checkbox disabled class="flex-col text-center w-96" id="env.is_build_time" label="Build Variable?" />
- <div class="flex gap-2">
- <x-forms.button type="submit">
- Update
- </x-forms.button>
- <x-forms.button x-on:click.prevent="deleteEnvironment = true">
- Delete
- </x-forms.button>
- </div>
+ <form wire:submit.prevent='submit' class="flex flex-col gap-2 xl:items-end xl:flex-row">
+ <x-forms.input label="Name" id="env.key" />
+ <x-forms.input label="Value" id="env.value" />
+ <x-forms.checkbox disabled id="env.is_build_time" label="Build Variable?" />
+ <div class="flex gap-2">
+ <x-forms.button type="submit">
+ Update
+ </x-forms.button>
+ <x-forms.button x-on:click.prevent="deleteEnvironment = true">
+ Delete
+ </x-forms.button>
</div>
</form>
<x-naked-modal show="deleteEnvironment" message="Are you sure you want to delete {{ $env->key }}?" />
diff --git a/resources/views/livewire/project/application/source.blade.php b/resources/views/livewire/project/application/source.blade.php
index 24fc44e089..617c39ae12 100644
--- a/resources/views/livewire/project/application/source.blade.php
+++ b/resources/views/livewire/project/application/source.blade.php
@@ -21,7 +21,7 @@
<div class="text-sm">Code source of your application.</div>
<x-forms.input placeholder="coollabsio/coolify-example" id="application.git_repository" label="Repository" />
<x-forms.input placeholder="main" id="application.git_branch" label="Branch" />
- <div class="flex items-end gap-2">
+ <div class="flex items-end gap-2 w-96">
<x-forms.input placeholder="HEAD" id="application.git_commit_sha" placeholder="HEAD" label="Commit SHA" />
<a target="_blank" class="flex hover:no-underline" href="{{ $application?->gitCommits }}">
<x-forms.button><svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24"
diff --git a/resources/views/livewire/project/application/storages/add.blade.php b/resources/views/livewire/project/application/storages/add.blade.php
index 74f6fd22c0..948dc70742 100644
--- a/resources/views/livewire/project/application/storages/add.blade.php
+++ b/resources/views/livewire/project/application/storages/add.blade.php
@@ -1,10 +1,8 @@
-<form wire:submit.prevent='submit' class="flex flex-col w-full px-2">
- <div class="flex items-end gap-2">
- <x-forms.input placeholder="pv-name" noDirty id="name" label="Name" required />
- <x-forms.input placeholder="/root" noDirty id="host_path" label="Source Path" />
- <x-forms.input placeholder="/tmp/root" noDirty id="mount_path" label="Destination Path" required />
- <x-forms.button type="submit">
- Add New Volume
- </x-forms.button>
- </div>
+<form wire:submit.prevent='submit' class="flex flex-col gap-2 xl:items-end xl:flex-row">
+ <x-forms.input placeholder="pv-name" noDirty id="name" label="Name" required />
+ <x-forms.input placeholder="/root" noDirty id="host_path" label="Source Path" />
+ <x-forms.input placeholder="/tmp/root" noDirty id="mount_path" label="Destination Path" required />
+ <x-forms.button type="submit">
+ Add New Volume
+ </x-forms.button>
</form>
diff --git a/resources/views/livewire/project/application/storages/all.blade.php b/resources/views/livewire/project/application/storages/all.blade.php
index 96669447b1..10e034d92c 100644
--- a/resources/views/livewire/project/application/storages/all.blade.php
+++ b/resources/views/livewire/project/application/storages/all.blade.php
@@ -1,17 +1,18 @@
<div>
<div>
- <h2>Storages</h2>
- <div class="text-sm">Persistent storage to preserve data between deployments.</div>
- <div class="text-sm">Preview Deployments has a <span class='text-helper'>-pr-#PRNumber</span> in their
+ <div class="flex items-center gap-2">
+ <h2>Storages </h2>
+ <x-helper
+ helper="For Preview Deployments, storage has a <span class='text-helper'>-pr-#PRNumber</span> in their
volume
- name, example: <span class='text-helper'>-pr-1</span>.</div>
+ name, example: <span class='text-helper'>-pr-1</span>" />
+ </div>
+ <div class="text-sm">Persistent storage to preserve data between deployments.</div>
</div>
<div class="flex flex-col gap-2 py-4">
- @forelse ($application->persistentStorages as $storage)
+ @foreach ($application->persistentStorages as $storage)
<livewire:project.application.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage" />
- @empty
- <p>There are no persistent storages attached for this application.</p>
- @endforelse
+ @endforeach
</div>
<livewire:project.application.storages.add />
</div>
diff --git a/resources/views/livewire/project/application/storages/show.blade.php b/resources/views/livewire/project/application/storages/show.blade.php
index cbae847b49..c7f9fe32c5 100644
--- a/resources/views/livewire/project/application/storages/show.blade.php
+++ b/resources/views/livewire/project/application/storages/show.blade.php
@@ -1,9 +1,9 @@
<div x-data="{ deleteStorage: false }">
- <form wire:submit.prevent='submit' class="flex flex-col px-2">
- <div class="flex items-end gap-2">
- <x-forms.input id="storage.name" label="Name" required />
- <x-forms.input id="storage.host_path" label="Source Path" />
- <x-forms.input id="storage.mount_path" label="Destination Path" required />
+ <form wire:submit.prevent='submit' class="flex flex-col gap-2 xl:items-end xl:flex-row">
+ <x-forms.input id="storage.name" label="Name" required />
+ <x-forms.input id="storage.host_path" label="Source Path" />
+ <x-forms.input id="storage.mount_path" label="Destination Path" required />
+ <div class="flex gap-2">
<x-forms.button type="submit">
Update
</x-forms.button>
diff --git a/routes/web.php b/routes/web.php
index 3d07c7d25e..462138669f 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -43,8 +43,8 @@ Route::prefix('magic')->middleware(['auth'])->group(function () {
Route::get('/destinations', [MagicController::class, 'destinations']);
Route::get('/projects', [MagicController::class, 'projects']);
Route::get('/environments', [MagicController::class, 'environments']);
- Route::get('/project/new', [MagicController::class, 'new_project']);
- Route::get('/environment/new', [MagicController::class, 'new_environment']);
+ Route::get('/project/new', [MagicController::class, 'newProject']);
+ Route::get('/environment/new', [MagicController::class, 'newEnvironment']);
});
Route::middleware(['auth'])->group(function () {
@@ -63,10 +63,18 @@ Route::middleware(['auth'])->group(function () {
});
Route::middleware(['auth'])->group(function () {
- Route::get('/servers', [ServerController::class, 'all'])->name('server.all');
- Route::get('/server/new', [ServerController::class, 'create'])->name('server.create');
- Route::get('/server/{server_uuid}', [ServerController::class, 'show'])->name('server.show');
- Route::get('/server/{server_uuid}/proxy', [ServerController::class, 'proxy'])->name('server.proxy');
+ Route::get('/servers', fn () => view('server.all', [
+ 'servers' => Server::ownedByCurrentTeam()->get()
+ ]))->name('server.all');
+ Route::get('/servers/new', fn () => view('server.create', [
+ 'private_keys' => PrivateKey::ownedByCurrentTeam()->get(),
+ ]))->name('server.create');
+ Route::get('/servers/{server_uuid}', fn () => view('server.show', [
+ 'server' => Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(),
+ ]))->name('server.show');
+ Route::get('/servers/{server_uuid}/proxy', fn () => view('server.proxy', [
+ 'server' => Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->firstOrFail(),
+ ]))->name('server.proxy');
Route::get('/server/{server_uuid}/private-key', fn () => view('server.private-key'))->name('server.private-key');
});
@@ -79,8 +87,8 @@ Route::middleware(['auth'])->group(function () {
Route::get('/profile/team', [Controller::class, 'team'])->name('team.show');
Route::get('/profile/team/notifications', fn () => view('team.notifications'))->name('team.notifications');
Route::get('/command-center', fn () => view('command-center', ['servers' => Server::validated()->get()]))->name('command-center');
- Route::get('/invitations/{uuid}', [Controller::class, 'accept_invitation'])->name('team.invitation.accept');
- Route::get('/invitations/{uuid}/revoke', [Controller::class, 'revoke_invitation'])->name('team.invitation.revoke');
+ Route::get('/invitations/{uuid}', [Controller::class, 'acceptInvitation'])->name('team.invitation.accept');
+ Route::get('/invitations/{uuid}/revoke', [Controller::class, 'revokeInvitation'])->name('team.invitation.revoke');
});
Route::middleware(['auth'])->group(function () {