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.

refactor routes

Andras Bacsai4c3907c2962a
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 6338d76252..fcc570f306 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,11 +2,13 @@
namespace App\Http\Controllers;
+use App\Events\TestEvent;
use App\Models\InstanceSettings;
use App\Models\S3Storage;
use App\Models\StandalonePostgresql;
use App\Models\TeamInvitation;
use App\Models\User;
+use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
@@ -14,11 +16,55 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
+use Laravel\Fortify\Fortify;
+use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
+use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
+use Illuminate\Support\Facades\Password;
class Controller extends BaseController
{
use AuthorizesRequests, ValidatesRequests;
+ public function realtime_test() {
+ if (auth()->user()?->currentTeam()->id !== 0) {
+ return redirect(RouteServiceProvider::HOME);
+ }
+ TestEvent::dispatch();
+ return 'Look at your other tab.';
+ }
+ public function verify() {
+ return view('auth.verify-email');
+ }
+ public function email_verify() {
+ request()->fulfill();
+ $name = request()->user()?->name;
+ send_internal_notification("User {$name} verified their email address.");
+ return redirect(RouteServiceProvider::HOME);
+ }
+ public function forgot_password() {
+ if (is_transactional_emails_active()) {
+ $arrayOfRequest = request()->only(Fortify::email());
+ request()->merge([
+ 'email' => Str::lower($arrayOfRequest['email']),
+ ]);
+ $type = set_transanctional_email_settings();
+ if (!$type) {
+ return response()->json(['message' => 'Transactional emails are not active'], 400);
+ }
+ request()->validate([Fortify::email() => 'required|email']);
+ $status = Password::broker(config('fortify.passwords'))->sendResetLink(
+ request()->only(Fortify::email())
+ );
+ if ($status == Password::RESET_LINK_SENT) {
+ return app(SuccessfulPasswordResetLinkRequestResponse::class, ['status' => $status]);
+ }
+ if ($status == Password::RESET_THROTTLED) {
+ return response('Already requested a password reset in the past minutes.', 400);
+ }
+ return app(FailedPasswordResetLinkRequestResponse::class, ['status' => $status]);
+ }
+ return response()->json(['message' => 'Transactional emails are not active'], 400);
+ }
public function link()
{
$token = request()->get('token');
@@ -51,90 +97,7 @@ class Controller extends BaseController
return redirect()->route('login')->with('error', 'Invalid credentials.');
}
- public function license()
- {
- if (!isCloud()) {
- abort(404);
- }
- return view('settings.license', [
- 'settings' => InstanceSettings::get(),
- ]);
- }
-
- public function force_passoword_reset()
- {
- return view('auth.force-password-reset');
- }
- public function boarding()
- {
- if (currentTeam()->boarding || isDev()) {
- return view('boarding');
- } else {
- return redirect()->route('dashboard');
- }
- }
-
- public function settings()
- {
- if (isInstanceAdmin()) {
- $settings = InstanceSettings::get();
- $database = StandalonePostgresql::whereName('coolify-db')->first();
- if ($database) {
- if ($database->status !== 'running') {
- $database->status = 'running';
- $database->save();
- }
- $s3s = S3Storage::whereTeamId(0)->get();
- }
- return view('settings.configuration', [
- 'settings' => $settings,
- 'database' => $database,
- 's3s' => $s3s ?? [],
- ]);
- } else {
- return redirect()->route('dashboard');
- }
- }
-
- public function team()
- {
- $invitations = [];
- if (auth()->user()->isAdminFromSession()) {
- $invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
- }
- return view('team.index', [
- 'invitations' => $invitations,
- ]);
- }
-
- public function storages()
- {
- $s3 = S3Storage::ownedByCurrentTeam()->get();
- return view('team.storages.all', [
- 's3' => $s3,
- ]);
- }
-
- public function storages_show()
- {
- $storage = S3Storage::ownedByCurrentTeam()->whereUuid(request()->storage_uuid)->firstOrFail();
- return view('team.storages.show', [
- 'storage' => $storage,
- ]);
- }
-
- public function members()
- {
- $invitations = [];
- if (auth()->user()->isAdminFromSession()) {
- $invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
- }
- return view('team.members', [
- 'invitations' => $invitations,
- ]);
- }
-
- public function acceptInvitation()
+ public function accept_invitation()
{
try {
$resetPassword = request()->query('reset-password');
@@ -169,7 +132,7 @@ class Controller extends BaseController
}
}
- public function revokeInvitation()
+ public function revoke_invitation()
{
try {
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
diff --git a/app/Http/Controllers/DatabaseController.php b/app/Http/Controllers/DatabaseController.php
deleted file mode 100644
index 684e427f95..0000000000
--- a/app/Http/Controllers/DatabaseController.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Foundation\Validation\ValidatesRequests;
-
-class DatabaseController extends Controller
-{
- use AuthorizesRequests, ValidatesRequests;
-
- public function configuration()
- {
- $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
- if (!$environment) {
- return redirect()->route('dashboard');
- }
- $database = $environment->databases()->where('uuid', request()->route('database_uuid'))->first();
- if (!$database) {
- return redirect()->route('dashboard');
- }
- return view('project.database.configuration', ['database' => $database]);
- }
-
- public function executions()
- {
- $backup_uuid = request()->route('backup_uuid');
- $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
- if (!$environment) {
- return redirect()->route('dashboard');
- }
- $database = $environment->databases()->where('uuid', request()->route('database_uuid'))->first();
- if (!$database) {
- return redirect()->route('dashboard');
- }
- $backup = $database->scheduledBackups->where('uuid', $backup_uuid)->first();
- if (!$backup) {
- return redirect()->route('dashboard');
- }
- $executions = collect($backup->executions)->sortByDesc('created_at');
- return view('project.database.backups.executions', [
- 'database' => $database,
- 'backup' => $backup,
- 'executions' => $executions,
- 's3s' => currentTeam()->s3s,
- ]);
- }
-
- public function backups()
- {
- $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
- if (!$environment) {
- return redirect()->route('dashboard');
- }
- $database = $environment->databases()->where('uuid', request()->route('database_uuid'))->first();
- if (!$database) {
- return redirect()->route('dashboard');
- }
- // No backups for redis
- if ($database->getMorphClass() === 'App\Models\StandaloneRedis') {
- return redirect()->route('project.database.configuration', [
- 'project_uuid' => $project->uuid,
- 'environment_name' => $environment->name,
- 'database_uuid' => $database->uuid,
- ]);
- }
- return view('project.database.backups.all', [
- 'database' => $database,
- 's3s' => currentTeam()->s3s,
- ]);
- }
-}
diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php
index 16d0efa206..c28e266ddb 100644
--- a/app/Jobs/ContainerStatusJob.php
+++ b/app/Jobs/ContainerStatusJob.php
@@ -162,6 +162,10 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
// Notify user that this container should not be there.
}
}
+ if (data_get($container,'Name') === '/coolify-db') {
+ $foundDatabases[] = 0;
+ }
+
}
$serviceLabelId = data_get($labels, 'coolify.serviceId');
if ($serviceLabelId) {
@@ -212,7 +216,7 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
}
$name = data_get($exitedService, 'name');
$fqdn = data_get($exitedService, 'fqdn');
- $containerName = $name ? "$name ($fqdn)" : $fqdn;
+ $containerName = $name ? "$name, available at $fqdn" : $fqdn;
$projectUuid = data_get($service, 'environment.project.uuid');
$serviceUuid = data_get($service, 'uuid');
$environmentName = data_get($service, 'environment.name');
diff --git a/app/Livewire/Boarding/Index.php b/app/Livewire/Boarding/Index.php
index 9c59f66abd..cc282d4c0d 100644
--- a/app/Livewire/Boarding/Index.php
+++ b/app/Livewire/Boarding/Index.php
@@ -274,7 +274,7 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
{
$this->skipBoarding();
return redirect()->route(
- 'project.resources.new',
+ 'project.resource.create',
[
'project_uuid' => $this->createdProject->uuid,
'environment_name' => 'production',
diff --git a/app/Livewire/CommandCenter/Index.php b/app/Livewire/CommandCenter/Index.php
new file mode 100644
index 0000000000..fd6bb7ed6c
--- /dev/null
+++ b/app/Livewire/CommandCenter/Index.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Livewire\CommandCenter;
+
+use App\Models\Server;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public $servers = [];
+ public function mount() {
+ $this->servers = Server::isReachable()->get();
+ }
+ public function render()
+ {
+ return view('livewire.command-center.index');
+ }
+}
diff --git a/app/Livewire/ForcePasswordReset.php b/app/Livewire/ForcePasswordReset.php
index e5a9a079a4..7bbec9d324 100644
--- a/app/Livewire/ForcePasswordReset.php
+++ b/app/Livewire/ForcePasswordReset.php
@@ -22,6 +22,10 @@ class ForcePasswordReset extends Component
{
$this->email = auth()->user()->email;
}
+ public function render()
+ {
+ return view('livewire.force-password-reset')->layout('layouts.simple');
+ }
public function submit()
{
try {
diff --git a/app/Livewire/Profile/Form.php b/app/Livewire/Profile/Index.php
similarity index 85%
rename from app/Livewire/Profile/Form.php
rename to app/Livewire/Profile/Index.php
index 3d395bf8f3..0a2a347667 100644
--- a/app/Livewire/Profile/Form.php
+++ b/app/Livewire/Profile/Index.php
@@ -5,21 +5,19 @@ namespace App\Livewire\Profile;
use Livewire\Attributes\Validate;
use Livewire\Component;
-class Form extends Component
+class Index extends Component
{
public int $userId;
public string $email;
#[Validate('required')]
public string $name;
-
public function mount()
{
$this->userId = auth()->user()->id;
$this->name = auth()->user()->name;
$this->email = auth()->user()->email;
}
-
public function submit()
{
@@ -34,4 +32,8 @@ class Form extends Component
return handleError($e, $this);
}
}
+ public function render()
+ {
+ return view('livewire.profile.index');
+ }
}
diff --git a/app/Livewire/Project/AddEnvironment.php b/app/Livewire/Project/AddEnvironment.php
index be80c21e15..c28cafd160 100644
--- a/app/Livewire/Project/AddEnvironment.php
+++ b/app/Livewire/Project/AddEnvironment.php
@@ -27,7 +27,7 @@ class AddEnvironment extends Component
'project_id' => $this->project->id,
]);
- return redirect()->route('project.resources', [
+ return redirect()->route('project.resource.index', [
'project_uuid' => $this->project->uuid,
'environment_name' => $environment->name,
]);
diff --git a/app/Livewire/Project/Application/Configuration.php b/app/Livewire/Project/Application/Configuration.php
index 691cbb7c4b..1bf9e6c3b5 100644
--- a/app/Livewire/Project/Application/Configuration.php
+++ b/app/Livewire/Project/Application/Configuration.php
@@ -4,7 +4,6 @@ namespace App\Livewire\Project\Application;
use App\Models\Application;
use App\Models\Server;
-use App\Models\StandaloneDocker;
use Livewire\Component;
class Configuration extends Component
diff --git a/app/Livewire/Project/Application/Deployments.php b/app/Livewire/Project/Application/Deployment/Index.php
similarity index 56%
rename from app/Livewire/Project/Application/Deployments.php
rename to app/Livewire/Project/Application/Deployment/Index.php
index 241167a8f3..9d07550f43 100644
--- a/app/Livewire/Project/Application/Deployments.php
+++ b/app/Livewire/Project/Application/Deployment/Index.php
@@ -1,15 +1,15 @@
<?php
-namespace App\Livewire\Project\Application;
+namespace App\Livewire\Project\Application\Deployment;
use App\Models\Application;
use Illuminate\Support\Collection;
use Livewire\Component;
-class Deployments extends Component
+class Index extends Component
{
public Application $application;
- public Array|Collection $deployments = [];
+ public array|Collection $deployments = [];
public int $deployments_count = 0;
public string $current_url;
public int $skip = 0;
@@ -19,11 +19,28 @@ class Deployments extends Component
protected $queryString = ['pull_request_id'];
public function mount()
{
+ $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ if (!$environment) {
+ return redirect()->route('dashboard');
+ }
+ $application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
+ if (!$application) {
+ return redirect()->route('dashboard');
+ }
+ ['deployments' => $deployments, 'count' => $count] = $application->deployments(0, 40);
+ $this->application = $application;
+ $this->deployments = $deployments;
+ $this->deployments_count = $count;
$this->current_url = url()->current();
$this->show_pull_request_only();
$this->show_more();
}
- private function show_pull_request_only() {
+ private function show_pull_request_only()
+ {
if ($this->pull_request_id) {
$this->deployments = $this->deployments->where('pull_request_id', $this->pull_request_id);
}
@@ -57,4 +74,8 @@ class Deployments extends Component
$this->show_pull_request_only();
$this->show_more();
}
+ public function render()
+ {
+ return view('livewire.project.application.deployment.index');
+ }
}
diff --git a/app/Http/Controllers/ApplicationController.php b/app/Livewire/Project/Application/Deployment/Show.php
similarity index 52%
rename from app/Http/Controllers/ApplicationController.php
rename to app/Livewire/Project/Application/Deployment/Show.php
index 12411d3fdf..b83c3f3af3 100644
--- a/app/Http/Controllers/ApplicationController.php
+++ b/app/Livewire/Project/Application/Deployment/Show.php
@@ -1,35 +1,20 @@
<?php
-namespace App\Http\Controllers;
+namespace App\Livewire\Project\Application\Deployment;
+use App\Models\Application;
use App\Models\ApplicationDeploymentQueue;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Foundation\Validation\ValidatesRequests;
+use Livewire\Component;
-class ApplicationController extends Controller
+class Show extends Component
{
- use AuthorizesRequests, ValidatesRequests;
+ public Application $application;
+ public ApplicationDeploymentQueue $application_deployment_queue;
+ public string $deployment_uuid;
+ public $isKeepAliveOn = true;
+ protected $listeners = ['refreshQueue'];
- public function deployments()
- {
- $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
- if (!$environment) {
- return redirect()->route('dashboard');
- }
- $application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
- if (!$application) {
- return redirect()->route('dashboard');
- }
- ['deployments' => $deployments, 'count' => $count] = $application->deployments(0, 40);
- return view('project.application.deployments', ['application' => $application, 'deployments' => $deployments, 'deployments_count' => $count]);
- }
-
- public function deployment()
- {
+ public function mount() {
$deploymentUuid = request()->route('deployment_uuid');
$project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
@@ -46,7 +31,7 @@ class ApplicationController extends Controller
}
// $activity = Activity::where('properties->type_uuid', '=', $deploymentUuid)->first();
// if (!$activity) {
- // return redirect()->route('project.application.deployments', [
+ // return redirect()->route('project.application.deployment.index', [
// 'project_uuid' => $project->uuid,
// 'environment_name' => $environment->name,
// 'application_uuid' => $application->uuid,
@@ -54,17 +39,32 @@ class ApplicationController extends Controller
// }
$application_deployment_queue = ApplicationDeploymentQueue::where('deployment_uuid', $deploymentUuid)->first();
if (!$application_deployment_queue) {
- return redirect()->route('project.application.deployments', [
+ return redirect()->route('project.application.deployment.index', [
'project_uuid' => $project->uuid,
'environment_name' => $environment->name,
'application_uuid' => $application->uuid,
]);
}
- return view('project.application.deployment', [
- 'application' => $application,
- // 'activity' => $activity,
- 'application_deployment_queue' => $application_deployment_queue,
- 'deployment_uuid' => $deploymentUuid,
- ]);
+ $this->application = $application;
+ $this->application_deployment_queue = $application_deployment_queue;
+ $this->deployment_uuid = $deploymentUuid;
+ }
+
+ public function refreshQueue()
+ {
+ $this->application_deployment_queue->refresh();
+ }
+
+ public function polling()
+ {
+ $this->dispatch('deploymentFinished');
+ $this->application_deployment_queue->refresh();
+ if (data_get($this->application_deployment_queue, 'status') == 'finished' || data_get($this->application_deployment_queue, 'status') == 'failed') {
+ $this->isKeepAliveOn = false;
+ }
+ }
+ public function render()
+ {
+ return view('livewire.project.application.deployment.show');
}
}
diff --git a/app/Livewire/Project/Application/DeploymentLogs.php b/app/Livewire/Project/Application/DeploymentLogs.php
deleted file mode 100644
index d2d07035d6..0000000000
--- a/app/Livewire/Project/Application/DeploymentLogs.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-namespace App\Livewire\Project\Application;
-
-use App\Models\ApplicationDeploymentQueue;
-use Livewire\Component;
-
-class DeploymentLogs extends Component
-{
- public ApplicationDeploymentQueue $application_deployment_queue;
- public $isKeepAliveOn = true;
- protected $listeners = ['refreshQueue'];
-
- public function refreshQueue()
- {
- $this->application_deployment_queue->refresh();
- }
-
- public function polling()
- {
- $this->dispatch('deploymentFinished');
- $this->application_deployment_queue->refresh();
- if (data_get($this->application_deployment_queue, 'status') == 'finished' || data_get($this->application_deployment_queue, 'status') == 'failed') {
- $this->isKeepAliveOn = false;
- }
- }
-}
diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php
index f6bf4852b8..170f1db6e2 100644
--- a/app/Livewire/Project/Application/Heading.php
+++ b/app/Livewire/Project/Application/Heading.php
@@ -60,7 +60,7 @@ class Heading extends Component
force_rebuild: false,
is_new_deployment: true,
);
- return redirect()->route('project.application.deployment', [
+ return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deploymentUuid,
@@ -83,7 +83,7 @@ class Heading extends Component
deployment_uuid: $this->deploymentUuid,
force_rebuild: $force_rebuild,
);
- return redirect()->route('project.application.deployment', [
+ return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deploymentUuid,
@@ -113,7 +113,7 @@ class Heading extends Component
restart_only: true,
is_new_deployment: true,
);
- return redirect()->route('project.application.deployment', [
+ return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deploymentUuid,
@@ -128,7 +128,7 @@ class Heading extends Component
deployment_uuid: $this->deploymentUuid,
restart_only: true,
);
- return redirect()->route('project.application.deployment', [
+ return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deploymentUuid,
diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php
index 91a28c9945..dffb9461ca 100644
--- a/app/Livewire/Project/Application/Previews.php
+++ b/app/Livewire/Project/Application/Previews.php
@@ -52,7 +52,7 @@ class Previews extends Component
force_rebuild: true,
pull_request_id: $pull_request_id,
);
- return redirect()->route('project.application.deployment', [
+ return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $this->deployment_uuid,
diff --git a/app/Livewire/Project/Application/Rollback.php b/app/Livewire/Project/Application/Rollback.php
index 64d83a5be6..a26d5cd475 100644
--- a/app/Livewire/Project/Application/Rollback.php
+++ b/app/Livewire/Project/Application/Rollback.php
@@ -29,7 +29,7 @@ class Rollback extends Component
commit: $commit,
force_rebuild: false,
);
- return redirect()->route('project.application.deployment', [
+ return redirect()->route('project.application.deployment.show', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'deployment_uuid' => $deployment_uuid,
diff --git a/app/Livewire/Project/CloneProject.php b/app/Livewire/Project/CloneMe.php
similarity index 97%
rename from app/Livewire/Project/CloneProject.php
rename to app/Livewire/Project/CloneMe.php
index 2dea157a2f..993c9516cd 100644
--- a/app/Livewire/Project/CloneProject.php
+++ b/app/Livewire/Project/CloneMe.php
@@ -8,7 +8,7 @@ use App\Models\Server;
use Livewire\Component;
use Visus\Cuid2\Cuid2;
-class CloneProject extends Component
+class CloneMe extends Component
{
public string $project_uuid;
public string $environment_name;
@@ -41,7 +41,7 @@ class CloneProject extends Component
public function render()
{
- return view('livewire.project.clone-project');
+ return view('livewire.project.clone-me');
}
public function selectServer($server_id, $destination_id)
@@ -152,7 +152,7 @@ class CloneProject extends Component
}
$newService->parse();
}
- return redirect()->route('project.resources', [
+ return redirect()->route('project.resource.index', [
'project_uuid' => $newProject->uuid,
'environment_name' => $newEnvironment->name,
]);
diff --git a/app/Livewire/Project/Database/Backup/Execution.php b/app/Livewire/Project/Database/Backup/Execution.php
new file mode 100644
index 0000000000..07f7db03c4
--- /dev/null
+++ b/app/Livewire/Project/Database/Backup/Execution.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Livewire\Project\Database\Backup;
+
+use Livewire\Component;
+
+class Execution extends Component
+{
+ public $database;
+ public $backup;
+ public $executions;
+ public $s3s;
+ public function mount() {
+ $backup_uuid = request()->route('backup_uuid');
+ $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ if (!$environment) {
+ return redirect()->route('dashboard');
+ }
+ $database = $environment->databases()->where('uuid', request()->route('database_uuid'))->first();
+ if (!$database) {
+ return redirect()->route('dashboard');
+ }
+ $backup = $database->scheduledBackups->where('uuid', $backup_uuid)->first();
+ if (!$backup) {
+ return redirect()->route('dashboard');
+ }
+ $executions = collect($backup->executions)->sortByDesc('created_at');
+ $this->database = $database;
+ $this->backup = $backup;
+ $this->executions = $executions;
+ $this->s3s = currentTeam()->s3s;
+ }
+ public function render()
+ {
+ return view('livewire.project.database.backup.execution');
+ }
+}
diff --git a/app/Livewire/Project/Database/Backup/Index.php b/app/Livewire/Project/Database/Backup/Index.php
new file mode 100644
index 0000000000..6211a0e478
--- /dev/null
+++ b/app/Livewire/Project/Database/Backup/Index.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Livewire\Project\Database\Backup;
+
+use Livewire\Component;
+
+class Index extends Component
+{
+ public $database;
+ public $s3s;
+ public function mount() {
+ $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ if (!$environment) {
+ return redirect()->route('dashboard');
+ }
+ $database = $environment->databases()->where('uuid', request()->route('database_uuid'))->first();
+ if (!$database) {
+ return redirect()->route('dashboard');
+ }
+ // No backups for redis
+ if ($database->getMorphClass() === 'App\Models\StandaloneRedis') {
+ return redirect()->route('project.database.configuration', [
+ 'project_uuid' => $project->uuid,
+ 'environment_name' => $environment->name,
+ 'database_uuid' => $database->uuid,
+ ]);
+ }
+ $this->database = $database;
+ $this->s3s = currentTeam()->s3s;
+ }
+ public function render()
+ {
+ return view('livewire.project.database.backup.index');
+ }
+}
diff --git a/app/Livewire/Project/Database/BackupEdit.php b/app/Livewire/Project/Database/BackupEdit.php
index e8e763c734..86aec0f6a1 100644
--- a/app/Livewire/Project/Database/BackupEdit.php
+++ b/app/Livewire/Project/Database/BackupEdit.php
@@ -52,7 +52,7 @@ class BackupEdit extends Component
$url = $url->getPath() . "#{$url->getFragment()}";
return redirect($url);
} else {
- return redirect()->route('project.database.backups.all', $this->parameters);
+ return redirect()->route('project.database.backup.index', $this->parameters);
}
}
diff --git a/app/Livewire/Project/Database/Configuration.php b/app/Livewire/Project/Database/Configuration.php
new file mode 100644
index 0000000000..c988477de6
--- /dev/null
+++ b/app/Livewire/Project/Database/Configuration.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Livewire\Project\Database;
+
+use Livewire\Component;
+
+class Configuration extends Component
+{
+ public $database;
+ public function mount() {
+ $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
+ if (!$environment) {
+ return redirect()->route('dashboard');
+ }
+ $database = $environment->databases()->where('uuid', request()->route('database_uuid'))->first();
+ if (!$database) {
+ return redirect()->route('dashboard');
+ }
+ $this->database = $database;
+ }
+ public function render()
+ {
+ return view('livewire.project.database.configuration');
+ }
+}
diff --git a/app/Livewire/Project/DeleteProject.php b/app/Livewire/Project/DeleteProject.php
index 23ca8eb798..7ac4aa281c 100644
--- a/app/Livewire/Project/DeleteProject.php
+++ b/app/Livewire/Project/DeleteProject.php
@@ -25,6 +25,6 @@ class DeleteProject extends Component
return $this->dispatch('error', 'Project has resources defined, please delete them first.');
}
$project->delete();
- return redirect()->route('projects');
+ return redirect()->route('project.index');
}
}
diff --git a/app/Livewire/Project/Edit.php b/app/Livewire/Project/Edit.php
index d08aa3e599..e674e3dd9f 100644
--- a/app/Livewire/Project/Edit.php
+++ b/app/Livewire/Project/Edit.php
@@ -12,6 +12,15 @@ class Edit extends Component
'project.name' => 'required|min:3|max:255',
'project.description' => 'nullable|string|max:255',
];
+ public function mount() {
+ $projectUuid = request()->route('project_uuid');
+ $teamId = currentTeam()->id;
+ $project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $this->project = $project;
+ }
public function submit()
{
diff --git a/app/Livewire/Project/Index.php b/app/Livewire/Project/Index.php
new file mode 100644
index 0000000000..1e6f79855a
--- /dev/null
+++ b/app/Livewire/Project/Index.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Livewire\Project;
+
+use App\Models\Project;
+use App\Models\Server;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public $projects;
+ public $servers;
+ public function mount() {
+ $this->projects = Project::ownedByCurrentTeam()->get();
+ $this->servers = Server::ownedByCurrentTeam()->count();
+ }
+ public function render()
+ {
+ return view('livewire.project.index');
+ }
+}
diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php
index 47834a7fc6..3133efc976 100644
--- a/app/Livewire/Project/New/Select.php
+++ b/app/Livewire/Project/New/Select.php
@@ -55,7 +55,7 @@ class Select extends Component
public function updatedSelectedEnvironment()
{
- return redirect()->route('project.resources.new', [
+ return redirect()->route('project.resource.create', [
'project_uuid' => $this->parameters['project_uuid'],
'environment_name' => $this->selectedEnvironment,
]);
@@ -157,7 +157,7 @@ class Select extends Component
public function setDestination(string $destination_uuid)
{
$this->destination_uuid = $destination_uuid;
- return redirect()->route('project.resources.new', [
+ return redirect()->route('project.resource.create', [
'project_uuid' => $this->parameters['project_uuid'],
'environment_name' => $this->parameters['environment_name'],
'type' => $this->type,
diff --git a/app/Http/Controllers/ProjectController.php b/app/Livewire/Project/Resource/Create.php
similarity index 63%
rename from app/Http/Controllers/ProjectController.php
rename to app/Livewire/Project/Resource/Create.php
index 1e7d6b9cde..db5dc03f48 100644
--- a/app/Http/Controllers/ProjectController.php
+++ b/app/Livewire/Project/Resource/Create.php
@@ -1,52 +1,18 @@
<?php
-namespace App\Http\Controllers;
+namespace App\Livewire\Project\Resource;
use App\Models\EnvironmentVariable;
-use App\Models\Project;
-use App\Models\Server;
use App\Models\Service;
use App\Models\StandaloneDocker;
-use Illuminate\Support\Str;
+use Livewire\Component;
-class ProjectController extends Controller
+class Create extends Component
{
- public function all()
- {
- return view('projects', [
- 'projects' => Project::ownedByCurrentTeam()->get(),
- 'servers' => Server::ownedByCurrentTeam()->count(),
- ]);
- }
-
- public function edit()
- {
- $projectUuid = request()->route('project_uuid');
- $teamId = currentTeam()->id;
- $project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- return view('project.edit', ['project' => $project]);
- }
-
- public function show()
- {
- $projectUuid = request()->route('project_uuid');
- $teamId = currentTeam()->id;
-
- $project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- $project->load(['environments']);
- return view('project.show', ['project' => $project]);
- }
-
- public function new()
- {
+ public $type;
+ public function mount() {
$services = getServiceTemplates();
- $type = Str::of(request()->query('type'));
+ $type = str(request()->query('type'));
$destination_uuid = request()->query('destination');
$server_id = request()->query('server_id');
@@ -81,14 +47,14 @@ class ProjectController extends Controller
$oneClickService = data_get($services, "$oneClickServiceName.compose");
$oneClickDotEnvs = data_get($services, "$oneClickServiceName.envs", null);
if ($oneClickDotEnvs) {
- $oneClickDotEnvs = Str::of(base64_decode($oneClickDotEnvs))->split('/\r\n|\r|\n/')->filter(function ($value) {
+ $oneClickDotEnvs = str(base64_decode($oneClickDotEnvs))->split('/\r\n|\r|\n/')->filter(function ($value) {
return !empty($value);
});
}
if ($oneClickService) {
$destination = StandaloneDocker::whereUuid($destination_uuid)->first();
$service = Service::create([
- 'name' => "$oneClickServiceName-" . Str::random(10),
+ 'name' => "$oneClickServiceName-" . str()->random(10),
'docker_compose_raw' => base64_decode($oneClickService),
'environment_id' => $environment->id,
'server_id' => (int) $server_id,
@@ -99,8 +65,8 @@ class ProjectController extends Controller
$service->save();
if ($oneClickDotEnvs?->count() > 0) {
$oneClickDotEnvs->each(function ($value) use ($service) {
- $key = Str::before($value, '=');
- $value = Str::of(Str::after($value, '='));
+ $key = str()->before($value, '=');
+ $value = str(str()->after($value, '='));
$generatedValue = $value;
if ($value->contains('SERVICE_')) {
$command = $value->after('SERVICE_')->beforeLast('_');
@@ -123,24 +89,10 @@ class ProjectController extends Controller
]);
}
}
- return view('project.new', [
- 'type' => $type->value()
- ]);
+ $this->type = $type->value();
}
-
- public function resources()
+ public function render()
{
- $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
- if (!$project) {
- return redirect()->route('dashboard');
- }
- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
- if (!$environment) {
- return redirect()->route('dashboard');
- }
- return view('project.resources', [
- 'project' => $project,
- 'environment' => $environment
- ]);
+ return view('livewire.project.resource.create');
}
}
diff --git a/app/Livewire/Project/Resource/Index.php b/app/Livewire/Project/Resource/Index.php
new file mode 100644
index 0000000000..2a7570c9df
--- /dev/null
+++ b/app/Livewire/Project/Resource/Index.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Livewire\Project\Resource;
+
+use App\Models\Environment;
+use App\Models\Project;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public Project $project;
+ public Environment $environment;
+ public function mount () {
+ $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
+ if (!$environment) {
+ return redirect()->route('dashboard');
+ }
+ $this->project = $project;
+ $this->environment = $environment;
+ }
+ public function render()
+ {
+ return view('livewire.project.resource.index');
+ }
+}
diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php
new file mode 100644
index 0000000000..5954b3b36d
--- /dev/null
+++ b/app/Livewire/Project/Service/Configuration.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace App\Livewire\Project\Service;
+
+use App\Jobs\ContainerStatusJob;
+use App\Models\Service;
+use Livewire\Component;
+
+class Configuration extends Component
+{
+ public Service $service;
+ public $applications;
+ public $databases;
+ public array $parameters;
+ public array $query;
+ public function getListeners()
+ {
+ $userId = auth()->user()->id;
+ return [
+ "echo-private:user.{$userId},ServiceStatusChanged" => 'checkStatus',
+ "refreshStacks",
+ "checkStatus",
+ ];
+ }
+ public function render()
+ {
+ return view('livewire.project.service.configuration');
+ }
+ public function mount()
+ {
+ $this->parameters = get_route_parameters();
+ $this->query = request()->query();
+ $this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
+ $this->applications = $this->service->applications->sort();
+ $this->databases = $this->service->databases->sort();
+ }
+ public function checkStatus()
+ {
+ dispatch_sync(new ContainerStatusJob($this->service->server));
+ $this->refreshStacks();
+ $this->dispatch('serviceStatusChanged');
+ }
+ public function refreshStacks()
+ {
+ $this->applications = $this->service->applications->sort();
+ $this->applications->each(function ($application) {
+ $application->refresh();
+ });
+ $this->databases = $this->service->databases->sort();
+ $this->databases->each(function ($database) {
+ $database->refresh();
+ });
+ }
+}
diff --git a/app/Livewire/Project/Service/Index.php b/app/Livewire/Project/Service/Index.php
index e55dc610c6..21009cb445 100644
--- a/app/Livewire/Project/Service/Index.php
+++ b/app/Livewire/Project/Service/Index.php
@@ -2,53 +2,51 @@
namespace App\Livewire\Project\Service;
-use App\Jobs\ContainerStatusJob;
use App\Models\Service;
+use App\Models\ServiceApplication;
+use App\Models\ServiceDatabase;
+use Illuminate\Support\Collection;
use Livewire\Component;
class Index extends Component
{
public Service $service;
- public $applications;
- public $databases;
+ public ?ServiceApplication $serviceApplication = null;
+ public ?ServiceDatabase $serviceDatabase = null;
public array $parameters;
public array $query;
- public function getListeners()
- {
- $userId = auth()->user()->id;
- return [
- "echo-private:user.{$userId},ServiceStatusChanged" => 'checkStatus',
- "refreshStacks",
- "checkStatus",
- ];
- }
- public function render()
- {
- return view('livewire.project.service.index');
- }
+ public Collection $services;
+ public $s3s;
+
+ protected $listeners = ['generateDockerCompose'];
+
public function mount()
{
- $this->parameters = get_route_parameters();
- $this->query = request()->query();
- $this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
- $this->applications = $this->service->applications->sort();
- $this->databases = $this->service->databases->sort();
+ try {
+ $this->services = collect([]);
+ $this->parameters = get_route_parameters();
+ $this->query = request()->query();
+ $this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
+ $service = $this->service->applications()->whereName($this->parameters['service_name'])->first();
+ if ($service) {
+ $this->serviceApplication = $service;
+ $this->serviceApplication->getFilesFromServer();
+ } else {
+ $this->serviceDatabase = $this->service->databases()->whereName($this->parameters['service_name'])->first();
+ $this->serviceDatabase->getFilesFromServer();
+ }
+ $this->s3s = currentTeam()->s3s;
+ } catch(\Throwable $e) {
+ return handleError($e, $this);
+ }
+
}
- public function checkStatus()
+ public function generateDockerCompose()
{
- dispatch_sync(new ContainerStatusJob($this->service->server));
- $this->refreshStacks();
- $this->dispatch('serviceStatusChanged');
+ $this->service->parse();
}
- public function refreshStacks()
+ public function render()
{
- $this->applications = $this->service->applications->sort();
- $this->applications->each(function ($application) {
- $application->refresh();
- });
- $this->databases = $this->service->databases->sort();
- $this->databases->each(function ($database) {
- $database->refresh();
- });
+ return view('livewire.project.service.index');
}
}
diff --git a/app/Livewire/Project/Service/Show.php b/app/Livewire/Project/Service/Show.php
deleted file mode 100644
index 272e0a399f..0000000000
--- a/app/Livewire/Project/Service/Show.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-namespace App\Livewire\Project\Service;
-
-use App\Models\Service;
-use App\Models\ServiceApplication;
-use App\Models\ServiceDatabase;
-use Illuminate\Support\Collection;
-use Livewire\Component;
-
-class Show extends Component
-{
- public Service $service;
- public ?ServiceApplication $serviceApplication = null;
- public ?ServiceDatabase $serviceDatabase = null;
- public array $parameters;
- public array $query;
- public Collection $services;
- public $s3s;
-
- protected $listeners = ['generateDockerCompose'];
-
- public function mount()
- {
- try {
- $this->services = collect([]);
- $this->parameters = get_route_parameters();
- $this->query = request()->query();
- $this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
- $service = $this->service->applications()->whereName($this->parameters['service_name'])->first();
- if ($service) {
- $this->serviceApplication = $service;
- $this->serviceApplication->getFilesFromServer();
- } else {
- $this->serviceDatabase = $this->service->databases()->whereName($this->parameters['service_name'])->first();
- $this->serviceDatabase->getFilesFromServer();
- }
- $this->s3s = currentTeam()->s3s;
- } catch(\Throwable $e) {
- return handleError($e, $this);
- }
-
- }
- public function generateDockerCompose()
- {
- $this->service->parse();
- }
- public function render()
- {
- return view('livewire.project.service.show');
- }
-}
diff --git a/app/Livewire/Project/Shared/Danger.php b/app/Livewire/Project/Shared/Danger.php
index 44a9d5cf32..37664c870f 100644
--- a/app/Livewire/Project/Shared/Danger.php
+++ b/app/Livewire/Project/Shared/Danger.php
@@ -25,7 +25,7 @@ class Danger extends Component
{
try {
DeleteResourceJob::dispatchSync($this->resource);
- return redirect()->route('project.resources', [
+ return redirect()->route('project.resource.index', [
'project_uuid' => $this->projectUuid,
'environment_name' => $this->environmentName
]);
diff --git a/app/Livewire/Project/Shared/ExecuteContainerCommand.php b/app/Livewire/Project/Shared/ExecuteContainerCommand.php
index a3a63c1548..f06f7784d0 100644
--- a/app/Livewire/Project/Shared/ExecuteContainerCommand.php
+++ b/app/Livewire/Project/Shared/ExecuteContainerCommand.php
@@ -10,7 +10,6 @@ use App\Models\StandaloneMongodb;
use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
-use Illuminate\Support\Sleep;
use Livewire\Component;
class ExecuteContainerCommand extends Component
diff --git a/app/Livewire/Project/Show.php b/app/Livewire/Project/Show.php
new file mode 100644
index 0000000000..0824ab32e1
--- /dev/null
+++ b/app/Livewire/Project/Show.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Livewire\Project;
+
+use App\Models\Project;
+use Livewire\Component;
+
+class Show extends Component
+{
+ public Project $project;
+ public function mount() {
+ $projectUuid = request()->route('project_uuid');
+ $teamId = currentTeam()->id;
+
+ $project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
+ if (!$project) {
+ return redirect()->route('dashboard');
+ }
+ $project->load(['environments']);
+ $this->project = $project;
+ }
+ public function render()
+ {
+ return view('livewire.project.show');
+ }
+}
diff --git a/app/Livewire/PrivateKey/Create.php b/app/Livewire/Security/PrivateKey/Create.php
similarity index 98%
rename from app/Livewire/PrivateKey/Create.php
rename to app/Livewire/Security/PrivateKey/Create.php
index a82b6fb489..62d7636012 100644
--- a/app/Livewire/PrivateKey/Create.php
+++ b/app/Livewire/Security/PrivateKey/Create.php
@@ -1,6 +1,6 @@
<?php
-namespace App\Livewire\PrivateKey;
+namespace App\Livewire\Security\PrivateKey;
use App\Models\PrivateKey;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
diff --git a/app/Livewire/PrivateKey/Change.php b/app/Livewire/Security/PrivateKey/Show.php
similarity index 87%
rename from app/Livewire/PrivateKey/Change.php
rename to app/Livewire/Security/PrivateKey/Show.php
index 8177ea55b2..a4fbaef529 100644
--- a/app/Livewire/PrivateKey/Change.php
+++ b/app/Livewire/Security/PrivateKey/Show.php
@@ -1,11 +1,11 @@
<?php
-namespace App\Livewire\PrivateKey;
+namespace App\Livewire\Security\PrivateKey;
use App\Models\PrivateKey;
use Livewire\Component;
-class Change extends Component
+class Show extends Component
{
public PrivateKey $private_key;
public $public_key;
@@ -24,6 +24,7 @@ class Change extends Component
public function mount()
{
try {
+ $this->private_key = PrivateKey::ownedByCurrentTeam(['name', 'description', 'private_key', 'is_git_related'])->whereUuid(request()->private_key_uuid)->firstOrFail();
$this->public_key = $this->private_key->publicKey();
}catch(\Throwable $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Server/Delete.php b/app/Livewire/Server/Delete.php
index 73edf5ffe9..3333283ebd 100644
--- a/app/Livewire/Server/Delete.php
+++ b/app/Livewire/Server/Delete.php
@@ -19,7 +19,7 @@ class Delete extends Component
return;
}
$this->server->delete();
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
} catch (\Throwable $e) {
return handleError($e, $this);
}
diff --git a/app/Livewire/Server/Destination/Show.php b/app/Livewire/Server/Destination/Show.php
index 7fa2a28235..4e0f54296c 100644
--- a/app/Livewire/Server/Destination/Show.php
+++ b/app/Livewire/Server/Destination/Show.php
@@ -15,7 +15,7 @@ class Show extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
}
} catch (\Throwable $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Server/All.php b/app/Livewire/Server/Index.php
similarity index 80%
rename from app/Livewire/Server/All.php
rename to app/Livewire/Server/Index.php
index fad5f3fba1..45bb1c3e19 100644
--- a/app/Livewire/Server/All.php
+++ b/app/Livewire/Server/Index.php
@@ -6,7 +6,7 @@ use App\Models\Server;
use Illuminate\Database\Eloquent\Collection;
use Livewire\Component;
-class All extends Component
+class Index extends Component
{
public ?Collection $servers = null;
@@ -15,6 +15,6 @@ class All extends Component
}
public function render()
{
- return view('livewire.server.all');
+ return view('livewire.server.index');
}
}
diff --git a/app/Livewire/Server/LogDrains.php b/app/Livewire/Server/LogDrains.php
index 902ec4b75d..b922cc0c9b 100644
--- a/app/Livewire/Server/LogDrains.php
+++ b/app/Livewire/Server/LogDrains.php
@@ -43,7 +43,7 @@ class LogDrains extends Component
try {
$server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($server)) {
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
}
$this->server = $server;
} catch (\Throwable $e) {
diff --git a/app/Livewire/Server/PrivateKey/Show.php b/app/Livewire/Server/PrivateKey/Show.php
index 9fa0acb75f..71dea7c9d2 100644
--- a/app/Livewire/Server/PrivateKey/Show.php
+++ b/app/Livewire/Server/PrivateKey/Show.php
@@ -17,7 +17,7 @@ class Show extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
}
$this->privateKeys = PrivateKey::ownedByCurrentTeam()->get()->where('is_git_related', false);
} catch (\Throwable $e) {
diff --git a/app/Livewire/Server/Proxy/Logs.php b/app/Livewire/Server/Proxy/Logs.php
index ed12f8c492..7949b00868 100644
--- a/app/Livewire/Server/Proxy/Logs.php
+++ b/app/Livewire/Server/Proxy/Logs.php
@@ -15,7 +15,7 @@ class Logs extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
}
} catch (\Throwable $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Server/Proxy/Show.php b/app/Livewire/Server/Proxy/Show.php
index b1175d3b70..7e21e33449 100644
--- a/app/Livewire/Server/Proxy/Show.php
+++ b/app/Livewire/Server/Proxy/Show.php
@@ -20,7 +20,7 @@ class Show extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
}
} catch (\Throwable $e) {
return handleError($e, $this);
diff --git a/app/Livewire/Server/Show.php b/app/Livewire/Server/Show.php
index 065335835f..13ebc97d46 100644
--- a/app/Livewire/Server/Show.php
+++ b/app/Livewire/Server/Show.php
@@ -17,7 +17,7 @@ class Show extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid(request()->server_uuid)->first();
if (is_null($this->server)) {
- return redirect()->route('server.all');
+ return redirect()->route('server.index');
}
} catch (\Throwable $e) {
diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php
new file mode 100644
index 0000000000..44c653b741
--- /dev/null
+++ b/app/Livewire/Settings/Index.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Livewire\Settings;
+
+use App\Models\InstanceSettings;
+use App\Models\S3Storage;
+use App\Models\StandalonePostgresql;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public InstanceSettings $settings;
+ public StandalonePostgresql $database;
+ public $s3s;
+ public function mount()
+ {
+ if (isInstanceAdmin()) {
+ $settings = InstanceSettings::get();
+ $database = StandalonePostgresql::whereName('coolify-db')->first();
+ if ($database) {
+ if ($database->status !== 'running') {
+ $database->status = 'running';
+ $database->save();
+ }
+ $s3s = S3Storage::whereTeamId(0)->get();
+ }
+ $this->settings = $settings;
+ $this->database = $database;
+ $this->s3s = $s3s ?? [];
+ } else {
+ return redirect()->route('dashboard');
+ }
+ }
+ public function render()
+ {
+ return view('livewire.settings.index');
+ }
+}
diff --git a/app/Livewire/CheckLicense.php b/app/Livewire/Settings/License.php
similarity index 79%
rename from app/Livewire/CheckLicense.php
rename to app/Livewire/Settings/License.php
index 8d4351fce6..64ad0a6f77 100644
--- a/app/Livewire/CheckLicense.php
+++ b/app/Livewire/Settings/License.php
@@ -1,15 +1,16 @@
<?php
-namespace App\Livewire;
+namespace App\Livewire\Settings;
use App\Actions\License\CheckResaleLicense;
use App\Models\InstanceSettings;
use Livewire\Component;
-class CheckLicense extends Component
+class License extends Component
{
- public InstanceSettings|null $settings = null;
+ public InstanceSettings $settings;
public string|null $instance_id = null;
+
protected $rules = [
'settings.resale_license' => 'nullable',
'settings.is_resale_license_active' => 'nullable',
@@ -20,12 +21,17 @@ class CheckLicense extends Component
'settings.is_resale_license_active' => 'Is License Active',
];
- public function mount()
- {
+ public function mount () {
+ if (!isCloud()) {
+ abort(404);
+ }
$this->instance_id = config('app.id');
$this->settings = InstanceSettings::get();
}
-
+ public function render()
+ {
+ return view('livewire.settings.license')->layout('layouts.subscription');
+ }
public function submit()
{
$this->validate();
diff --git a/app/Livewire/Subscription/Show.php b/app/Livewire/Subscription/Index.php
similarity index 86%
rename from app/Livewire/Subscription/Show.php
rename to app/Livewire/Subscription/Index.php
index 6c92f7555f..afc3729c63 100644
--- a/app/Livewire/Subscription/Show.php
+++ b/app/Livewire/Subscription/Index.php
@@ -6,7 +6,7 @@ use App\Models\InstanceSettings;
use App\Providers\RouteServiceProvider;
use Livewire\Component;
-class Show extends Component
+class Index extends Component
{
public InstanceSettings $settings;
public bool $alreadySubscribed = false;
@@ -26,6 +26,6 @@ class Show extends Component
}
public function render()
{
- return view('livewire.subscription.show')->layout('layouts.subscription');
+ return view('livewire.subscription.index')->layout('layouts.subscription');
}
}
diff --git a/app/Livewire/Team/Delete.php b/app/Livewire/Team/Delete.php
deleted file mode 100644
index 097419c4c7..0000000000
--- a/app/Livewire/Team/Delete.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace App\Livewire\Team;
-
-use Illuminate\Support\Facades\DB;
-use Livewire\Component;
-
-class Delete extends Component
-{
- public function delete()
- {
- $currentTeam = currentTeam();
- $currentTeam->delete();
-
- $currentTeam->members->each(function ($user) use ($currentTeam) {
- if ($user->id === auth()->user()->id) {
- return;
- }
- $user->teams()->detach($currentTeam);
- $session = DB::table('sessions')->where('user_id', $user->id)->first();
- if ($session) {
- DB::table('sessions')->where('id', $session->id)->delete();
- }
- });
-
- refreshSession();
- return redirect()->route('team.index');
- }
-}
diff --git a/app/Livewire/Team/Form.php b/app/Livewire/Team/Form.php
deleted file mode 100644
index 3deaf0b928..0000000000
--- a/app/Livewire/Team/Form.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-namespace App\Livewire\Team;
-
-use App\Models\Team;
-use Livewire\Component;
-
-class Form extends Component
-{
- public Team $team;
- protected $rules = [
- 'team.name' => 'required|min:3|max:255',
- 'team.description' => 'nullable|min:3|max:255',
- ];
- protected $validationAttributes = [
- 'team.name' => 'name',
- 'team.description' => 'description',
- ];
-
- public function mount()
- {
- $this->team = currentTeam();
- }
-
- public function submit()
- {
- $this->validate();
- try {
- $this->team->save();
- refreshSession();
- } catch (\Throwable $e) {
- return handleError($e, $this);
- }
- }
-}
diff --git a/app/Livewire/Team/Index.php b/app/Livewire/Team/Index.php
new file mode 100644
index 0000000000..b7482e671b
--- /dev/null
+++ b/app/Livewire/Team/Index.php
@@ -0,0 +1,65 @@
+<?php
+
+namespace App\Livewire\Team;
+
+use App\Models\Team;
+use App\Models\TeamInvitation;
+use Illuminate\Support\Facades\DB;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public $invitations = [];
+ public Team $team;
+ protected $rules = [
+ 'team.name' => 'required|min:3|max:255',
+ 'team.description' => 'nullable|min:3|max:255',
+ ];
+ protected $validationAttributes = [
+ 'team.name' => 'name',
+ 'team.description' => 'description',
+ ];
+ public function mount() {
+ $this->team = currentTeam();
+
+ if (auth()->user()->isAdminFromSession()) {
+ $this->invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
+ }
+ }
+ public function render()
+ {
+ return view('livewire.team.index');
+ }
+
+ public function submit()
+ {
+ $this->validate();
+ try {
+ $this->team->save();
+ refreshSession();
+ $this->dispatch('success', 'Team updated successfully.');
+ } catch (\Throwable $e) {
+ return handleError($e, $this);
+ }
+ }
+
+ public function delete()
+ {
+ $currentTeam = currentTeam();
+ $currentTeam->delete();
+
+ $currentTeam->members->each(function ($user) use ($currentTeam) {
+ if ($user->id === auth()->user()->id) {
+ return;
+ }
+ $user->teams()->detach($currentTeam);
+ $session = DB::table('sessions')->where('user_id', $user->id)->first();
+ if ($session) {
+ DB::table('sessions')->where('id', $session->id)->delete();
+ }
+ });
+
+ refreshSession();
+ return redirect()->route('team.index');
+ }
+}
diff --git a/app/Livewire/Team/Member/Index.php b/app/Livewire/Team/Member/Index.php
new file mode 100644
index 0000000000..bca24c26c2
--- /dev/null
+++ b/app/Livewire/Team/Member/Index.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Livewire\Team\Member;
+
+use App\Models\TeamInvitation;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public $invitations = [];
+ public function mount() {
+ if (auth()->user()->isAdminFromSession()) {
+ $this->invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
+ }
+ }
+ public function render()
+ {
+ return view('livewire.team.member.index');
+ }
+}
diff --git a/app/Livewire/Team/Notification/Index.php b/app/Livewire/Team/Notification/Index.php
new file mode 100644
index 0000000000..86754d619e
--- /dev/null
+++ b/app/Livewire/Team/Notification/Index.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Livewire\Team\Notification;
+
+use Livewire\Component;
+
+class Index extends Component
+{
+ public function render()
+ {
+ return view('livewire.team.notification.index');
+ }
+}
diff --git a/app/Livewire/Team/Storage/Create.php b/app/Livewire/Team/Storage/Create.php
index cbbba398ff..82f93320b7 100644
--- a/app/Livewire/Team/Storage/Create.php
+++ b/app/Livewire/Team/Storage/Create.php
@@ -65,7 +65,7 @@ class Create extends Component
$this->storage->team_id = currentTeam()->id;
$this->storage->testConnection();
$this->storage->save();
- return redirect()->route('team.storages.show', $this->storage->uuid);
+ return redirect()->route('team.storage.show', $this->storage->uuid);
} catch (\Throwable $e) {
return handleError($e, $this);
}
diff --git a/app/Livewire/Team/Storage/Form.php b/app/Livewire/Team/Storage/Form.php
index 23b0fe34c1..8a26a34715 100644
--- a/app/Livewire/Team/Storage/Form.php
+++ b/app/Livewire/Team/Storage/Form.php
@@ -43,7 +43,7 @@ class Form extends Component
{
try {
$this->storage->delete();
- return redirect()->route('team.storages.all');
+ return redirect()->route('team.storage.index');
} catch (\Throwable $e) {
return handleError($e, $this);
}
diff --git a/app/Livewire/Team/Storage/Index.php b/app/Livewire/Team/Storage/Index.php
new file mode 100644
index 0000000000..c158345648
--- /dev/null
+++ b/app/Livewire/Team/Storage/Index.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Livewire\Team\Storage;
+
+use App\Models\S3Storage;
+use Livewire\Component;
+
+class Index extends Component
+{
+ public $s3;
+ public function mount() {
+ $this->s3 = S3Storage::ownedByCurrentTeam()->get();
+ }
+ public function render()
+ {
+ return view('livewire.team.storage.index');
+ }
+}
diff --git a/app/Livewire/Team/Storage/Show.php b/app/Livewire/Team/Storage/Show.php
new file mode 100644
index 0000000000..6fbb6034f7
--- /dev/null
+++ b/app/Livewire/Team/Storage/Show.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace App\Livewire\Team\Storage;
+
+use App\Models\S3Storage;
+use Livewire\Component;
+
+class Show extends Component
+{
+ public $storage = null;
+ public function mount()
+ {
+ $this->storage = S3Storage::ownedByCurrentTeam()->whereUuid(request()->storage_uuid)->first();
+ if (!$this->storage) {
+ abort(404);
+ }
+ }
+ public function render()
+ {
+ return view('livewire.team.storage.show');
+ }
+}
diff --git a/app/Models/S3Storage.php b/app/Models/S3Storage.php
index ec18477eb0..9d60ce4919 100644
--- a/app/Models/S3Storage.php
+++ b/app/Models/S3Storage.php
@@ -48,7 +48,7 @@ class S3Storage extends BaseModel
if ($this->unusable_email_sent === false && is_transactional_emails_active()) {
$mail = new MailMessage();
$mail->subject('Coolify: S3 Storage Connection Error');
- $mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => route('team.storages.show', ['storage_uuid' => $this->uuid])]);
+ $mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => route('team.storage.show', ['storage_uuid' => $this->uuid])]);
$users = collect([]);
$members = $this->team->members()->get();
foreach ($members as $user) {
diff --git a/app/Notifications/Container/ContainerRestarted.php b/app/Notifications/Container/ContainerRestarted.php
index 723cad8f60..21dc799f86 100644
--- a/app/Notifications/Container/ContainerRestarted.php
+++ b/app/Notifications/Container/ContainerRestarted.php
@@ -27,7 +27,7 @@ class ContainerRestarted extends Notification implements ShouldQueue
public function toMail(): MailMessage
{
$mail = new MailMessage();
- $mail->subject("Coolify: A service ({$this->name}) has been restarted automatically on {$this->server->name}");
+ $mail->subject("Coolify: A resource ({$this->name}) has been restarted automatically on {$this->server->name}");
$mail->view('emails.container-restarted', [
'containerName' => $this->name,
'serverName' => $this->server->name,
@@ -38,12 +38,12 @@ class ContainerRestarted extends Notification implements ShouldQueue
public function toDiscord(): string
{
- $message = "Coolify: A service ({$this->name}) has been restarted automatically on {$this->server->name}";
+ $message = "Coolify: A resource ({$this->name}) has been restarted automatically on {$this->server->name}";
return $message;
}
public function toTelegram(): array
{
- $message = "Coolify: A service ({$this->name}) has been restarted automatically on {$this->server->name}";
+ $message = "Coolify: A resource ({$this->name}) has been restarted automatically on {$this->server->name}";
$payload = [
"message" => $message,
];
diff --git a/app/Notifications/Container/ContainerStopped.php b/app/Notifications/Container/ContainerStopped.php
index ea474a3e91..ac218c5feb 100644
--- a/app/Notifications/Container/ContainerStopped.php
+++ b/app/Notifications/Container/ContainerStopped.php
@@ -26,7 +26,7 @@ class ContainerStopped extends Notification implements ShouldQueue
public function toMail(): MailMessage
{
$mail = new MailMessage();
- $mail->subject("Coolify: A service ({$this->name}) has been stopped on {$this->server->name}");
+ $mail->subject("Coolify: A resource has been stopped unexpectedly on {$this->server->name}");
$mail->view('emails.container-stopped', [
'containerName' => $this->name,
'serverName' => $this->server->name,
@@ -37,12 +37,12 @@ class ContainerStopped extends Notification implements ShouldQueue
public function toDiscord(): string
{
- $message = "Coolify: A service ({$this->name}) has been stopped on {$this->server->name}";
+ $message = "Coolify: A resource has been stopped unexpectedly on {$this->server->name}";
return $message;
}
public function toTelegram(): array
{
- $message = "Coolify: A service ($this->name} has been stopped on {$this->server->name}";
+ $message = "Coolify: A resource has been stopped unexpectedly on {$this->server->name}";
$payload = [
"message" => $message,
];
diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php
index ccd90d14bf..630da761dc 100644
--- a/app/Providers/FortifyServiceProvider.php
+++ b/app/Providers/FortifyServiceProvider.php
@@ -31,7 +31,7 @@ class FortifyServiceProvider extends ServiceProvider
{
// First user (root) will be redirected to /settings instead of / on registration.
if ($request->user()->currentTeam->id === 0) {
- return redirect()->route('settings.configuration');
+ return redirect()->route('settings.index');
}
return redirect(RouteServiceProvider::HOME);
}
diff --git a/resources/views/auth/force-password-reset.blade.php b/resources/views/auth/force-password-reset.blade.php
deleted file mode 100644
index df1f415f6f..0000000000
--- a/resources/views/auth/force-password-reset.blade.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<x-layout-simple>
- <livewire:force-password-reset />
-</x-layout-simple>
diff --git a/resources/views/components/applications/navbar.blade.php b/resources/views/components/applications/navbar.blade.php
index fd01ae4742..db69feb6be 100644
--- a/resources/views/components/applications/navbar.blade.php
+++ b/resources/views/components/applications/navbar.blade.php
@@ -13,8 +13,8 @@
href="{{ route('project.application.logs', $parameters) }}">
<button>Logs</button>
</a>
- <a class="{{ request()->routeIs('project.application.deployments') ? 'text-white' : '' }}"
- href="{{ route('project.application.deployments', $parameters) }}">
+ <a class="{{ request()->routeIs('project.application.deployment.index') ? 'text-white' : '' }}"
+ href="{{ route('project.application.deployment.index', $parameters) }}">
<button>Deployments</button>
</a>
<x-applications.links :application="$application" />
diff --git a/resources/views/components/databases/navbar.blade.php b/resources/views/components/databases/navbar.blade.php
index 8774fa1dff..9f3dfad3b7 100644
--- a/resources/views/components/databases/navbar.blade.php
+++ b/resources/views/components/databases/navbar.blade.php
@@ -16,8 +16,8 @@
$database->getMorphClass() === 'App\Models\StandaloneMongodb' ||
$database->getMorphClass() === 'App\Models\StandaloneMysql' ||
$database->getMorphClass() === 'App\Models\StandaloneMariadb')
- <a class="{{ request()->routeIs('project.database.backups.all') ? 'text-white' : '' }}"
- href="{{ route('project.database.backups.all', $parameters) }}">
+ <a class="{{ request()->routeIs('project.database.backup.index') ? 'text-white' : '' }}"
+ href="{{ route('project.database.backup.index', $parameters) }}">
<button>Backups</button>
</a>
@endif
diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php
index b7e24eb61c..5b529e7a2f 100644
--- a/resources/views/components/resources/breadcrumbs.blade.php
+++ b/resources/views/components/resources/breadcrumbs.blade.php
@@ -14,7 +14,7 @@
clip-rule="evenodd"></path>
</svg>
<a class="text-xs truncate lg:text-sm"
- href="{{ route('project.resources', ['environment_name' => $this->parameters['environment_name'], 'project_uuid' => $this->parameters['project_uuid']]) }}">{{ $this->parameters['environment_name'] }}</a>
+ href="{{ route('project.resource.index', ['environment_name' => $this->parameters['environment_name'], 'project_uuid' => $this->parameters['project_uuid']]) }}">{{ $this->parameters['environment_name'] }}</a>
</div>
</li>
<li>
diff --git a/resources/views/components/settings/navbar.blade.php b/resources/views/components/settings/navbar.blade.php
index a4839cab3a..93625efd94 100644
--- a/resources/views/components/settings/navbar.blade.php
+++ b/resources/views/components/settings/navbar.blade.php
@@ -2,8 +2,8 @@
<h1>Settings</h1>
<div class="subtitle">Instance wide settings for Coolify.</div>
<nav class="navbar-main">
- <a class="{{ request()->routeIs('settings.configuration') ? 'text-white' : '' }}"
- href="{{ route('settings.configuration') }}">
+ <a class="{{ request()->routeIs('settings.index') ? 'text-white' : '' }}"
+ href="{{ route('settings.index') }}">
<button>Configuration</button>
</a>
@if (isCloud())
diff --git a/resources/views/components/team/navbar.blade.php b/resources/views/components/team/navbar.blade.php
index 7cf5e805c3..3b7fb1f406 100644
--- a/resources/views/components/team/navbar.blade.php
+++ b/resources/views/components/team/navbar.blade.php
@@ -17,15 +17,15 @@
<a class="{{ request()->routeIs('team.index') ? 'text-white' : '' }}" href="{{ route('team.index') }}">
<button>General</button>
</a>
- <a class="{{ request()->routeIs('team.members') ? 'text-white' : '' }}" href="{{ route('team.members') }}">
+ <a class="{{ request()->routeIs('team.member.index') ? 'text-white' : '' }}" href="{{ route('team.member.index') }}">
<button>Members</button>
</a>
- <a class="{{ request()->routeIs('team.storages.all') ? 'text-white' : '' }}"
- href="{{ route('team.storages.all') }}">
+ <a class="{{ request()->routeIs('team.storage.index') ? 'text-white' : '' }}"
+ href="{{ route('team.storage.index') }}">
<button>S3 Storages</button>
</a>
- <a class="{{ request()->routeIs('team.notifications') ? 'text-white' : '' }}"
- href="{{ route('team.notifications') }}">
+ <a class="{{ request()->routeIs('team.notification.index') ? 'text-white' : '' }}"
+ href="{{ route('team.notification.index') }}">
<button>Notifications</button>
</a>
<div class="flex-1"></div>
diff --git a/resources/views/emails/application-deployment-failed.blade.php b/resources/views/emails/application-deployment-failed.blade.php
index c1ae3ebb66..a97c650b2a 100644
--- a/resources/views/emails/application-deployment-failed.blade.php
+++ b/resources/views/emails/application-deployment-failed.blade.php
@@ -1,11 +1,10 @@
<x-emails.layout>
- @if ($pull_request_id === 0)
- Failed to deploy a new version of {{ $name }} at [{{ $fqdn }}]({{ $fqdn }}) .
- @else
- Failed to deploy a pull request #{{ $pull_request_id }} of {{ $name }} at
- [{{ $fqdn }}]({{ $fqdn }}).
- @endif
-
- [View Deployment Logs]({{ $deployment_url }})
+@if ($pull_request_id === 0)
+Failed to deploy a new version of {{ $name }} at [{{ $fqdn }}]({{ $fqdn }}) .
+@else
+Failed to deploy a pull request #{{ $pull_request_id }} of {{ $name }} at
+[{{ $fqdn }}]({{ $fqdn }}).
+@endif
+[View Deployment Logs]({{ $deployment_url }})
</x-emails.layout>
diff --git a/resources/views/emails/application-deployment-success.blade.php b/resources/views/emails/application-deployment-success.blade.php
index 227089a4b5..bc09a24796 100644
--- a/resources/views/emails/application-deployment-success.blade.php
+++ b/resources/views/emails/application-deployment-success.blade.php
@@ -1,11 +1,11 @@
<x-emails.layout>
- @if ($pull_request_id === 0)
- A new version of {{ $name }} is available at [{{ $fqdn }}]({{ $fqdn }}) .
- @else
- Pull request #{{ $pull_request_id }} of {{ $name }} deployed successfully
- [{{ $fqdn }}]({{ $fqdn }}).
- @endif
+@if ($pull_request_id === 0)
+A new version of {{ $name }} is available at [{{ $fqdn }}]({{ $fqdn }}) .
+@else
+Pull request #{{ $pull_request_id }} of {{ $name }} deployed successfully
+[{{ $fqdn }}]({{ $fqdn }}).
+@endif
- [View Deployment Logs]({{ $deployment_url }})
+[View Deployment Logs]({{ $deployment_url }})
</x-emails.layout>
diff --git a/resources/views/emails/application-status-changes.blade.php b/resources/views/emails/application-status-changes.blade.php
index 0aba5cd261..30966060f5 100644
--- a/resources/views/emails/application-status-changes.blade.php
+++ b/resources/views/emails/application-status-changes.blade.php
@@ -1,9 +1,7 @@
<x-emails.layout>
+{{ $name }} has been stopped.
- {{ $name }} has been stopped.
-
- If it was your intention to stop this application, you can ignore this email.
-
- If not, [check what is going on]({{ $application_url }}).
+If it was your intention to stop this application, you can ignore this email.
+If not, [check what is going on]({{ $application_url }}).
</x-emails.layout>
diff --git a/resources/views/emails/backup-failed.blade.php b/resources/views/emails/backup-failed.blade.php
index 1ddc9b397a..de6a7c981e 100644
--- a/resources/views/emails/backup-failed.blade.php
+++ b/resources/views/emails/backup-failed.blade.php
@@ -1,8 +1,7 @@
<x-emails.layout>
- Database backup for {{ $name }} with frequency of {{ $frequency }} was FAILED.
+Database backup for {{ $name }} with frequency of {{ $frequency }} was FAILED.
- ### Reason
-
- {{ $output }}
+### Reason
+{{ $output }}
</x-emails.layout>
diff --git a/resources/views/emails/backup-success.blade.php b/resources/views/emails/backup-success.blade.php
index 0628f7ec96..0d54a254c7 100644
--- a/resources/views/emails/backup-success.blade.php
+++ b/resources/views/emails/backup-success.blade.php
@@ -1,3 +1,3 @@
<x-emails.layout>
- Database backup for {{ $name }} with frequency of {{ $frequency }} was successful.
+Database backup for {{ $name }} with frequency of {{ $frequency }} was successful.
</x-emails.layout>
diff --git a/resources/views/emails/before-trial-conversion.blade.php b/resources/views/emails/before-trial-conversion.blade.php
index 08a220c34f..8caee2dbc3 100644
--- a/resources/views/emails/before-trial-conversion.blade.php
+++ b/resources/views/emails/before-trial-conversion.blade.php
@@ -1,9 +1,7 @@
<x-emails.layout>
- We would like to inform you that a {{ config('constants.limits.trial_period') }} days of trial has been added to all
- subscription plans.
+We would like to inform you that a {{ config('constants.limits.trial_period') }} days of trial has been added to all subscription plans.
- You can try out Coolify, without payment information for free. If you like it, you can upgrade to a paid plan at any
- time.
+You can try out Coolify, without payment information for free. If you like it, you can upgrade to a paid plan at any time.
- [Click here](https://app.coolify.io/subscription) to start your trial.
+[Click here](https://app.coolify.io/subscription) to start your trial.
</x-emails.layout>
diff --git a/resources/views/emails/container-restarted.blade.php b/resources/views/emails/container-restarted.blade.php
index f93b5dcba5..68503b316a 100644
--- a/resources/views/emails/container-restarted.blade.php
+++ b/resources/views/emails/container-restarted.blade.php
@@ -1,13 +1,9 @@
<x-emails.layout>
+A resource ({{ $containerName }}) has been restarted automatically on {{ $serverName }}, because it was stopped unexpectedly.
- A service ({{ $containerName }}) has been restarted automatically on {{ $serverName }}, because it was stopped
- unexpectedly.
-
- @if ($containerName === 'coolify-proxy')
- Coolify Proxy should run on your server as you have FQDNs set up in one of your resources.
-
- If you don't want to use Coolify Proxy, please remove FQDN from your resources or set Proxy type to
- Custom(None).
- @endif
+@if ($containerName === 'coolify-proxy')
+Coolify Proxy should run on your server as you have FQDNs set up in one of your resources.
+If you don't want to use Coolify Proxy, please remove FQDN from your resources or set Proxy type to Custom(None).
+@endif
</x-emails.layout>
diff --git a/resources/views/emails/container-stopped.blade.php b/resources/views/emails/container-stopped.blade.php
index b16c0b90be..cc1cec1da9 100644
--- a/resources/views/emails/container-stopped.blade.php
+++ b/resources/views/emails/container-stopped.blade.php
@@ -1,9 +1,7 @@
<x-emails.layout>
+A resource ({{ $containerName }}) has been stopped unexpectedly on {{ $serverName }}.
- A service ({{ $containerName }}) has been stopped unexpectedly on {{ $serverName }}.
-
- @if ($url)
- Please check what is going on [here]({{ $url }}).
- @endif
-
+@if ($url)
+Please check what is going on [here]({{ $url }}).
+@endif
</x-emails.layout>
diff --git a/resources/views/emails/email-verification.blade.php b/resources/views/emails/email-verification.blade.php
index ec09f024b1..458ff61566 100644
--- a/resources/views/emails/email-verification.blade.php
+++ b/resources/views/emails/email-verification.blade.php
@@ -1,3 +1,3 @@
<x-emails.layout>
- Verify your email [here]({{ $url }}).
+Verify your email [here]({{ $url }}).
</x-emails.layout>
diff --git a/resources/views/emails/high-disk-usage.blade.php b/resources/views/emails/high-disk-usage.blade.php
index 8e95794361..5330ebd7f6 100644
--- a/resources/views/emails/high-disk-usage.blade.php
+++ b/resources/views/emails/high-disk-usage.blade.php
@@ -1,10 +1,7 @@
<x-emails.layout>
+Your server ({{ $name }}) has high disk usage ({{ $disk_usage }}% used). Threshold is {{ $threshold }}%.
- Your server ({{ $name }}) has high disk usage ({{ $disk_usage }}% used). Threshold is
- {{ $threshold }}%.
-
- Please cleanup your disk to prevent data-loss. Here are some [tips](https://coolify.io/docs/automated-cleanup).
-
- (You can change the threshold in the Server Settings menu.)
+Please cleanup your disk to prevent data-loss. Here are some [tips](https://coolify.io/docs/automated-cleanup).
+(You can change the threshold in the Server Settings menu.)
</x-emails.layout>
diff --git a/resources/views/emails/invitation-link.blade.php b/resources/views/emails/invitation-link.blade.php
index afced0abc3..eb3fe7362c 100644
--- a/resources/views/emails/invitation-link.blade.php
+++ b/resources/views/emails/invitation-link.blade.php
@@ -1,10 +1,9 @@
<x-emails.layout>
+You have been invited to "{{ $team }}" on "{{ config('app.name') }}".
- You have been invited to "{{ $team }}" on "{{ config('app.name') }}".
+Please [click here]({{ $invitation_link }}) to accept the invitation.
- Please [click here]({{ $invitation_link }}) to accept the invitation.
+If you have any questions, please contact the team owner.<br><br>
- If you have any questions, please contact the team owner.<br><br>
-
- If it was not you who requested this invitation, please ignore this email.
+If it was not you who requested this invitation, please ignore this email.
</x-emails.layout>
diff --git a/resources/views/emails/reset-password.blade.php b/resources/views/emails/reset-password.blade.php
index 49b0ee74bf..02488175d7 100644
--- a/resources/views/emails/reset-password.blade.php
+++ b/resources/views/emails/reset-password.blade.php
@@ -1,7 +1,7 @@
<x-emails.layout>
- A password reset has been requested for this email address.
+A password reset has been requested for this email address.
- Click [here]({{ $url }}) to reset your password.
+Click [here]({{ $url }}) to reset your password.
- This link will expire in {{ $count }} minutes.
+This link will expire in {{ $count }} minutes.
</x-emails.layout>
diff --git a/resources/views/emails/s3-connection-error.blade.php b/resources/views/emails/s3-connection-error.blade.php
index 68faa06081..c9ca020668 100644
--- a/resources/views/emails/s3-connection-error.blade.php
+++ b/resources/views/emails/s3-connection-error.blade.php
@@ -1,6 +1,5 @@
<x-emails.layout>
- Connection could not be establised with one of your S3 Storage ({{ $name }}). Please fix it
- [here]({{ $url }}).
+Connection could not be establised with one of your S3 Storage ({{ $name }}). Please fix it [here]({{ $url }}).
- {{ $reason }}
+{{ $reason }}
</x-emails.layout>
diff --git a/resources/views/emails/server-lost-connection.blade.php b/resources/views/emails/server-lost-connection.blade.php
index 7d89e02aa5..f0b1046f20 100644
--- a/resources/views/emails/server-lost-connection.blade.php
+++ b/resources/views/emails/server-lost-connection.blade.php
@@ -1,12 +1,9 @@
<x-emails.layout>
+Coolify cannot connect to your server ({{ $name }}). Please check your server and make sure it is running.
- Coolify cannot connect to your server ({{ $name }}). Please check your server and make sure it is running.
+All automations & integrations are turned off!
- All automations & integrations are turned off!
-
- IMPORTANT: We automatically try to revive your server. If your server is back online, we will automatically turn on
- all automations & integrations.
-
- If you have any questions, please contact us.
+IMPORTANT: We automatically try to revive your server. If your server is back online, we will automatically turn onall automations & integrations.
+If you have any questions, please contact us.
</x-emails.layout>
diff --git a/resources/views/emails/server-revived.blade.php b/resources/views/emails/server-revived.blade.php
index 45d855d73d..f58e644aac 100644
--- a/resources/views/emails/server-revived.blade.php
+++ b/resources/views/emails/server-revived.blade.php
@@ -1,6 +1,3 @@
<x-emails.layout>
-
- Your server ({{ $name }}) was offline for a while, but it is back online now. All automations & integrations
- are turned on again.
-
+Your server ({{ $name }}) was offline for a while, but it is back online now. All automations & integrationsare turned on again.
</x-emails.layout>
diff --git a/resources/views/emails/subscription-invoice-failed.blade.php b/resources/views/emails/subscription-invoice-failed.blade.php
index d4a38fb6aa..644f520ca9 100644
--- a/resources/views/emails/subscription-invoice-failed.blade.php
+++ b/resources/views/emails/subscription-invoice-failed.blade.php
@@ -1,6 +1,5 @@
<x-emails.layout>
- Your last invoice has failed to be paid for Coolify Cloud.
-
- Please update payment details [here]({{ $stripeCustomerPortal }}).
+Your last invoice has failed to be paid for Coolify Cloud.
+Please update payment details [here]({{ $stripeCustomerPortal }}).
</x-emails.layout>
diff --git a/resources/views/emails/test.blade.php b/resources/views/emails/test.blade.php
index a94ac5b378..a845efee53 100644
--- a/resources/views/emails/test.blade.php
+++ b/resources/views/emails/test.blade.php
@@ -1,3 +1,3 @@
<x-emails.layout>
- If you are seeing this, it means that your Email settings are correct.
+If you are seeing this, it means that your Email settings are correct.
</x-emails.layout>
diff --git a/resources/views/emails/trial-ended.blade.php b/resources/views/emails/trial-ended.blade.php
index 77d72f455d..347078034c 100644
--- a/resources/views/emails/trial-ended.blade.php
+++ b/resources/views/emails/trial-ended.blade.php
@@ -1,8 +1,5 @@
<x-emails.layout>
+Your trial ended. All automations and integrations are disabled for all of your servers.
- Your trial ended. All automations and integrations are disabled for all of your servers.
-
- Please update payment details [here]({{ $stripeCustomerPortal }}) or in [Coolify Cloud](https://app.coolify.io) to
- continue using our services.
-
+Please update payment details [here]({{ $stripeCustomerPortal }}) or in [Coolify Cloud](https://app.coolify.io) to continue using our services.
</x-emails.layout>
diff --git a/resources/views/emails/trial-ends-soon.blade.php b/resources/views/emails/trial-ends-soon.blade.php
index 6248c6190c..b60692c02a 100644
--- a/resources/views/emails/trial-ends-soon.blade.php
+++ b/resources/views/emails/trial-ends-soon.blade.php
@@ -1,8 +1,5 @@
<x-emails.layout>
+Your trial ends soon. Please update payment details [here]({{ $stripeCustomerPortal }}),
- Your trial ends soon. Please update payment details [here]({{ $stripeCustomerPortal }}),
-
- Your servers & deployed resources will be untouched, but you won't be able to deploy new resources and lost all
- automations and integrations.
-
+Your servers & deployed resources will be untouched, but you won't be able to deploy new resources and lost all automations and integrations.
</x-emails.layout>
diff --git a/resources/views/emails/updates.blade.php b/resources/views/emails/updates.blade.php
index eb6a18026c..c215727a64 100644
--- a/resources/views/emails/updates.blade.php
+++ b/resources/views/emails/updates.blade.php
@@ -1,5 +1,3 @@
<x-emails.layout>
-
- <br><br>
- If you do not like to receive these emails, you can unsubscribe [here]({{ $unsubscribeUrl }}).
+If you do not like to receive these emails, you can unsubscribe [here]({{ $unsubscribeUrl }}).
</x-emails.layout>
diff --git a/resources/views/emails/waitlist-confirmation.blade.php b/resources/views/emails/waitlist-confirmation.blade.php
index 9e22cb9f6f..afd22916a7 100644
--- a/resources/views/emails/waitlist-confirmation.blade.php
+++ b/resources/views/emails/waitlist-confirmation.blade.php
@@ -1,10 +1,7 @@
<x-emails.layout>
- Someone added this email to the Coolify Cloud's waitlist. [Click here]({{ $confirmation_url }}) to confirm!
+Someone added this email to the Coolify Cloud's waitlist. [Click here]({{ $confirmation_url }}) to confirm!
- The link will expire in {{ config('constants.waitlist.expiration') }} minutes.
-
-
- You have no idea what [Coolify Cloud](https://coolify.io) is or this waitlist? [Click here]({{ $cancel_url }}) to
- remove you from the waitlist.
+The link will expire in {{ config('constants.waitlist.expiration') }} minutes.
+You have no idea what [Coolify Cloud](https://coolify.io) is or this waitlist? [Click here]({{ $cancel_url }}) to remove you from the waitlist.
</x-emails.layout>
diff --git a/resources/views/emails/waitlist-invitation.blade.php b/resources/views/emails/waitlist-invitation.blade.php
index 201659e0b5..de8d646507 100644
--- a/resources/views/emails/waitlist-invitation.blade.php
+++ b/resources/views/emails/waitlist-invitation.blade.php
@@ -1,3 +1,3 @@
<x-emails.layout>
- You have been invited to join the Coolify Cloud: [Get Started]({{ $loginLink }})
+You have been invited to join the Coolify Cloud: [Get Started]({{ $loginLink }})
</x-emails.layout>
diff --git a/resources/views/livewire/check-license.blade.php b/resources/views/livewire/check-license.blade.php
deleted file mode 100644
index 706b1f5e7e..0000000000
--- a/resources/views/livewire/check-license.blade.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<form wire:submit='submit' class="flex flex-col gap-2">
- <div>
- @if ($settings->is_resale_license_active)
- <div class="text-success">License is active</div>
- @else
- <div class="text-error">License is not active</div>
- @endif
- </div>
- <div class="flex gap-2">
- <x-forms.input type="password" id="settings.resale_license" placeholder="eg: BE558E91-0CC5-4AA2-B1C0-B6403C2988DD"
- label="License Key" />
- <x-forms.input type="password" id="instance_id" label="Instance Id (do not change this)" disabled />
- </div>
- <div class="flex gap-2">
- <x-forms.button type="submit">
- Check License
- </x-forms.button>
- </div>
- @if (session()->has('error'))
- <div class="text-error">
- {!! session('error') !!}
- </div>
- @endif
-</form>
diff --git a/resources/views/livewire/command-center/index.blade.php b/resources/views/livewire/command-center/index.blade.php
new file mode 100644
index 0000000000..ad4875e5d3
--- /dev/null
+++ b/resources/views/livewire/command-center/index.blade.php
@@ -0,0 +1,12 @@
+<div>
+ <h1>Command Center</h1>
+ <div class="subtitle">Execute commands on your servers without leaving the browser.</div>
+ @if ($servers->count() > 0)
+ <livewire:run-command :servers="$servers" />
+ @else
+ <div>
+ <div>No servers found. Without a server, you won't be able to do much.</div>
+ <x-use-magic-bar link="/server/new" />
+ </div>
+ @endif
+</div>
diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php
index 755c7f80c1..64a8616533 100644
--- a/resources/views/livewire/dashboard.blade.php
+++ b/resources/views/livewire/dashboard.blade.php
@@ -30,7 +30,7 @@
<div class="gap-2 border border-transparent cursor-pointer box group">
@if (data_get($project, 'environments.0.name'))
<a class="flex flex-col flex-1 mx-6 hover:no-underline"
- href="{{ route('project.resources', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($project, 'environments.0.name', 'production')]) }}">
+ href="{{ route('project.resource.index', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($project, 'environments.0.name', 'production')]) }}">
<div class="font-bold text-white">{{ $project->name }}</div>
<div class="description">
{{ $project->description }}</div>
@@ -45,7 +45,7 @@
@endif
<div class="flex items-center">
<a class="mx-4 rounded group-hover:text-white hover:no-underline"
- href="{{ route('project.resources.new', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($project, 'environments.0.name', 'production')]) }}">
+ href="{{ route('project.resource.create', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($project, 'environments.0.name', 'production')]) }}">
<span class="font-bold hover:text-warning">+ New Resource</span>
</a>
<a class="mx-4 rounded group-hover:text-white"
diff --git a/resources/views/livewire/private-key/change.blade.php b/resources/views/livewire/private-key/change.blade.php
deleted file mode 100644
index 7c1dbe3ea0..0000000000
--- a/resources/views/livewire/private-key/change.blade.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<div x-data="{ showPrivateKey: false }">
- <x-modal yesOrNo modalId="deletePrivateKey" modalTitle="Delete Private Key">
- <x-slot:modalBody>
- <p>This private key will be deleted. It is not reversible. <br>Please think again.</p>
- </x-slot:modalBody>
- </x-modal>
- <form class="flex flex-col gap-2" wire:submit='changePrivateKey'>
- <div class="flex items-end gap-2">
- <h2>Private Key</h2>
- <x-forms.button type="submit">
- Save
- </x-forms.button>
- @if ($private_key->id > 0)
- <x-forms.button isError isModal modalId="deletePrivateKey">
- Delete
- </x-forms.button>
- @endif
- </div>
- <x-forms.input id="private_key.name" label="Name" required />
- <x-forms.input id="private_key.description" label="Description" />
- <div>
- <div class="flex items-end gap-2 py-2 ">
- <div class="pl-1 ">Public Key</div>
- </div>
- <x-forms.input readonly id="public_key" />
- <div class="flex items-end gap-2 py-2 ">
- <div class="pl-1 ">Private Key <span class='text-helper'>*</span></div>
- <div class="text-xs text-white underline cursor-pointer" x-cloak x-show="!showPrivateKey"
- x-on:click="showPrivateKey = true">
- Edit
- </div>
- <div class="text-xs text-white underline cursor-pointer" x-cloak x-show="showPrivateKey"
- x-on:click="showPrivateKey = false">
- Hide
- </div>
- </div>
- @if ($private_key->is_git_related)
- <div class="w-48">
- <x-forms.checkbox id="private_key.is_git_related" disabled label="Is used by a Git App?" />
- </div>
- @endif
- <div x-cloak x-show="!showPrivateKey">
- <x-forms.input allowToPeak="false" type="password" rows="10" id="private_key.private_key" required
- disabled />
- </div>
- <div x-cloak x-show="showPrivateKey">
- <x-forms.textarea rows="10" id="private_key.private_key" required />
- </div>
- </div>
-
- </form>
-</div>
diff --git a/resources/views/livewire/profile/form.blade.php b/resources/views/livewire/profile/form.blade.php
deleted file mode 100644
index f664121e47..0000000000
--- a/resources/views/livewire/profile/form.blade.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<div>
- <form wire:submit='submit' class="flex flex-col">
- <div class="flex items-center gap-2">
- <h2>General</h2>
- <x-forms.button type="submit" label="Save">Save</x-forms.button>
- </div>
- <div class="flex gap-2">
- <x-forms.input id="name" label="Name" required />
- <x-forms.input id="email" label="Email" readonly />
- </div>
- </form>
-</div>
diff --git a/resources/views/livewire/profile/index.blade.php b/resources/views/livewire/profile/index.blade.php
new file mode 100644
index 0000000000..aa8cb57086
--- /dev/null
+++ b/resources/views/livewire/profile/index.blade.php
@@ -0,0 +1,92 @@
+<div>
+ <h1>Profile</h1>
+ <div class="subtitle ">Your user profile settings.</div>
+ <form wire:submit='submit' class="flex flex-col">
+ <div class="flex items-center gap-2">
+ <h2>General</h2>
+ <x-forms.button type="submit" label="Save">Save</x-forms.button>
+ </div>
+ <div class="flex gap-2">
+ <x-forms.input id="name" label="Name" required />
+ <x-forms.input id="email" label="Email" readonly />
+ </div>
+ </form>
+ <h2 class="py-4">Subscription</h2>
+ <a href="{{ route('team.index') }}">Check in Team Settings</a>
+ <h2 class="py-4">Two-factor Authentication</h2>
+ @if (session('status') == 'two-factor-authentication-enabled')
+ <div class="mb-4 font-medium">
+ Please finish configuring two factor authentication below. Read the QR code or enter the secret key
+ manually.
+ </div>
+ <div class="flex flex-col gap-2">
+ <form action="/user/confirmed-two-factor-authentication" method="POST" class="flex items-end gap-2">
+ @csrf
+ <x-forms.input type="number" id="code" label="One-time code" required />
+ <x-forms.button type="submit">Validate 2FA</x-forms.button>
+ </form>
+ <div>
+ <div>{!! request()->user()->twoFactorQrCodeSvg() !!}</div>
+ <div x-data="{ showCode: false }" class="py-2">
+ <template x-if="showCode">
+ <div class="py-2 ">{!! decrypt(request()->user()->two_factor_secret) !!}</div>
+ </template>
+ <x-forms.button x-on:click="showCode = !showCode">Show secret key to manually
+ enter</x-forms.button>
+ </div>
+ </div>
+ </div>
+ @elseif(session('status') == 'two-factor-authentication-confirmed')
+ <div class="mb-4 ">
+ Two factor authentication confirmed and enabled successfully.
+ </div>
+ <div>
+ <div class="pb-6 ">Here are the recovery codes for your account. Please store them in a secure
+ location.
+ </div>
+ <div class="text-white">
+ @foreach (request()->user()->recoveryCodes() as $code)
+ <div>{{ $code }}</div>
+ @endforeach
+ </div>
+ </div>
+ @else
+ @if (request()->user()->two_factor_confirmed_at)
+ <div class="pb-4 "> Two factor authentication is <span class="text-helper">enabled</span>.</div>
+ <div class="flex gap-2">
+ <form action="/user/two-factor-authentication" method="POST">
+ @csrf
+ @method ('DELETE')
+ <x-forms.button type="submit">Disable</x-forms.button>
+ </form>
+ <form action="/user/two-factor-recovery-codes" method="POST">
+ @csrf
+ <x-forms.button type="submit">Regenerate Recovery Codes</x-forms.button>
+ </form>
+ </div>
+ @if (session('status') == 'recovery-codes-generated')
+ <div>
+ <div class="py-6 ">Here are the recovery codes for your account. Please store them in a
+ secure
+ location.
+ </div>
+ <div class="text-white">
+ @foreach (request()->user()->recoveryCodes() as $code)
+ <div>{{ $code }}</div>
+ @endforeach
+ </div>
+ </div>
+ @endif
+ @else
+ <form action="/user/two-factor-authentication" method="POST">
+ @csrf
+ <x-forms.button type="submit">Configure 2FA</x-forms.button>
+ </form>
+ @endif
+ @endif
+ @if (session()->has('errors'))
+ <div class="text-error">
+ Something went wrong. Please try again.
+ </div>
+ @endif
+</div>
diff --git a/resources/views/livewire/project/application/deployment-logs.blade.php b/resources/views/livewire/project/application/deployment-logs.blade.php
deleted file mode 100644
index 6afabbe13a..0000000000
--- a/resources/views/livewire/project/application/deployment-logs.blade.php
+++ /dev/null
@@ -1,98 +0,0 @@
-<div class="pt-4" x-data="{ fullscreen: false, alwaysScroll: false, intervalId: null }">
- <livewire:project.application.deployment-navbar :application_deployment_queue="$application_deployment_queue" />
- @if (data_get($application_deployment_queue, 'status') === 'in_progress')
- <div class="flex items-center gap-1 pt-2 ">Deployment is
- <div class="text-warning"> {{ Str::headline(data_get($this->application_deployment_queue, 'status')) }}.
- </div>
- <x-loading class="loading-ring" />
- </div>
- {{-- <div class="">Logs will be updated automatically.</div> --}}
- @else
- <div class="pt-2 ">Deployment is <span
- class="text-warning">{{ Str::headline(data_get($application_deployment_queue, 'status')) }}</span>.
- </div>
- @endif
- <div id="screen" :class="fullscreen ? 'fullscreen' : ''">
- <div @if ($isKeepAliveOn) wire:poll.2000ms="polling" @endif
- class="relative flex flex-col-reverse w-full p-2 px-4 mt-4 overflow-y-auto text-white bg-coolgray-100 scrollbar border-coolgray-300"
- :class="fullscreen ? '' : 'max-h-[40rem] border border-dotted rounded'">
- <button title="Minimize" x-show="fullscreen" class="fixed top-4 right-4" x-on:click="makeFullscreen"><svg
- class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
- stroke-width="2" d="M6 14h4m0 0v4m0-4l-6 6m14-10h-4m0 0V6m0 4l6-6" />
- </svg></button>
- <button title="Go Top" x-show="fullscreen" class="fixed top-4 right-28" x-on:click="goTop"> <svg
- class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
- stroke-width="2" d="M12 5v14m4-10l-4-4M8 9l4-4" />
- </svg></button>
- <button title="Follow Logs" x-show="fullscreen" :class="alwaysScroll ? 'text-warning' : ''"
- class="fixed top-4 right-16" x-on:click="toggleScroll"><svg class="icon" viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg">
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
- stroke-width="2" d="M12 5v14m4-4l-4 4m-4-4l4 4" />
- </svg></button>
-
- <button title="Fullscreen" x-show="!fullscreen" class="absolute top-2 right-8"
- x-on:click="makeFullscreen"><svg class="fixed icon" viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg">
- <g fill="none">
- <path
- d="M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z" />
- <path fill="currentColor"
- d="M9.793 12.793a1 1 0 0 1 1.497 1.32l-.083.094L6.414 19H9a1 1 0 0 1 .117 1.993L9 21H4a1 1 0 0 1-.993-.883L3 20v-5a1 1 0 0 1 1.993-.117L5 15v2.586l4.793-4.793ZM20 3a1 1 0 0 1 .993.883L21 4v5a1 1 0 0 1-1.993.117L19 9V6.414l-4.793 4.793a1 1 0 0 1-1.497-1.32l.083-.094L17.586 5H15a1 1 0 0 1-.117-1.993L15 3h5Z" />
- </g>
- </svg></button>
- <div id="logs" class="flex flex-col">
- @if (decode_remote_command_output($application_deployment_queue)->count() > 0)
- @foreach (decode_remote_command_output($application_deployment_queue) as $line)
- <div @class([
- 'font-mono whitespace-pre-line',
- 'text-warning' => $line['hidden'],
- 'text-red-500' => $line['type'] == 'stderr',
- ])>[{{ $line['timestamp'] }}] @if ($line['hidden'])
- <br>COMMAND: <br>{{ $line['command'] }} <br><br>OUTPUT:
- @endif{{ $line['output'] }}@if ($line['hidden'])
- @endif
- </div>
- @endforeach
- @else
- <span class="font-mono text-neutral-400">No logs yet.</span>
- @endif
- </div>
- </div>
- </div>
- <script>
- function makeFullscreen() {
- this.fullscreen = !this.fullscreen;
- if (this.fullscreen === false) {
- this.alwaysScroll = false;
- clearInterval(this.intervalId);
- }
- }
-
- function toggleScroll() {
- this.alwaysScroll = !this.alwaysScroll;
-
- if (this.alwaysScroll) {
- this.intervalId = setInterval(() => {
- const screen = document.getElementById('screen');
- const logs = document.getElementById('logs');
- if (screen.scrollTop !== logs.scrollHeight) {
- screen.scrollTop = logs.scrollHeight;
- }
- }, 100);
- } else {
- clearInterval(this.intervalId);
- this.intervalId = null;
- }
- }
-
- function goTop() {
- this.alwaysScroll = false;
- clearInterval(this.intervalId);
- const screen = document.getElementById('screen');
- screen.scrollTop = 0;
- }
- </script>
-</div>
diff --git a/resources/views/livewire/project/application/deployment/index.blade.php b/resources/views/livewire/project/application/deployment/index.blade.php
new file mode 100644
index 0000000000..818005a124
--- /dev/null
+++ b/resources/views/livewire/project/application/deployment/index.blade.php
@@ -0,0 +1,105 @@
+<div>
+ <h1>Deployments</h1>
+ <livewire:project.application.heading :application="$application" />
+ {{-- <livewire:project.application.deployment.show :application="$application" :deployments="$deployments" :deployments_count="$deployments_count" /> --}}
+ <div class="flex flex-col gap-2 pb-10" @if ($skip == 0) wire:poll.5000ms='reload_deployments' @endif>
+ <div class="flex items-end gap-2 pt-4">
+ <h2>Deployments <span class="text-xs">({{ $deployments_count }})</span></h2>
+ @if ($show_next)
+ <x-forms.button wire:click="load_deployments({{ $default_take }})">Next Page
+ </x-forms.button>
+ @endif
+ </div>
+ <form class="flex items-end gap-2">
+ <x-forms.input id="pull_request_id" label="Pull Request"></x-forms.input>
+ <x-forms.button type="submit">Filter</x-forms.button>
+ </form>
+ @forelse ($deployments as $deployment)
+ <a @class([
+ 'bg-coolgray-100 p-2 border-l border-dashed transition-colors hover:no-underline',
+ 'hover:bg-coolgray-200' => data_get($deployment, 'status') === 'queued',
+ 'border-warning hover:bg-warning hover:text-black' =>
+ data_get($deployment, 'status') === 'in_progress' ||
+ data_get($deployment, 'status') === 'cancelled-by-user',
+ 'border-error hover:bg-error' =>
+ data_get($deployment, 'status') === 'failed',
+ 'border-success hover:bg-success' =>
+ data_get($deployment, 'status') === 'finished',
+ ]) href="{{ $current_url . '/' . data_get($deployment, 'deployment_uuid') }}"
+ class="hover:no-underline">
+ <div class="flex flex-col justify-start">
+ <div class="flex gap-1">
+ {{ $deployment->created_at }} UTC
+ <span class=" text-warning">></span>
+ {{ $deployment->status }}
+ </div>
+ @if (data_get($deployment, 'pull_request_id'))
+ <div>
+ <span class=" text-warning">></span>
+ Pull Request #{{ data_get($deployment, 'pull_request_id') }}
+ @if (data_get($deployment, 'is_webhook'))
+ (Webhook)
+ @endif
+ Webhook (SHA
+ @if (data_get($deployment, 'commit'))
+ {{ data_get($deployment, 'commit') }})
+ @else
+ HEAD)
+ @endif
+ </div>
+ @endif
+ </div>
+
+ <div class="flex flex-col" x-data="elapsedTime('{{ $deployment->deployment_uuid }}', '{{ $deployment->status }}', '{{ $deployment->created_at }}', '{{ $deployment->updated_at }}')">
+ <div>
+ @if ($deployment->status !== 'in_progress')
+ Finished <span x-text="measure_since_started()">0s</span> in
+ @else
+ Running for
+ @endif
+ <span class="font-bold" x-text="measure_finished_time()">0s</span>
+ </div>
+ </div>
+ </a>
+ @empty
+ <div class="">No deployments found</div>
+ @endforelse
+ <script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
+ <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/utc.js"></script>
+ <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.js"></script>
+ <script>
+ document.addEventListener('alpine:init', () => {
+ let timers = {};
+
+ dayjs.extend(window.dayjs_plugin_utc);
+ dayjs.extend(window.dayjs_plugin_relativeTime);
+
+ Alpine.data('elapsedTime', (uuid, status, created_at, updated_at) => ({
+ finished_time: 'calculating...',
+ started_time: 'calculating...',
+ init() {
+ if (timers[uuid]) {
+ clearInterval(timers[uuid]);
+ }
+ if (status === 'in_progress') {
+ timers[uuid] = setInterval(() => {
+ this.finished_time = dayjs().diff(dayjs.utc(created_at),
+ 'second') + 's'
+ }, 1000);
+ } else {
+ let seconds = dayjs.utc(updated_at).diff(dayjs.utc(created_at), 'second')
+ this.finished_time = seconds + 's';
+ }
+ },
+ measure_finished_time() {
+ return this.finished_time;
+ },
+ measure_since_started() {
+ return dayjs.utc(created_at).fromNow();
+ }
+ }))
+ })
+ </script>
+ </div>
+
+</div>
diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php
new file mode 100644
index 0000000000..257cf7a1ad
--- /dev/null
+++ b/resources/views/livewire/project/application/deployment/show.blade.php
@@ -0,0 +1,104 @@
+<div>
+ <h1 class="py-0">Deployment</h1>
+ <livewire:project.application.heading :application="$application" />
+ <div class="pt-4" x-data="{ fullscreen: false, alwaysScroll: false, intervalId: null }">
+ <livewire:project.application.deployment-navbar :application_deployment_queue="$application_deployment_queue" />
+ @if (data_get($application_deployment_queue, 'status') === 'in_progress')
+ <div class="flex items-center gap-1 pt-2 ">Deployment is
+ <div class="text-warning"> {{ Str::headline(data_get($this->application_deployment_queue, 'status')) }}.
+ </div>
+ <x-loading class="loading-ring" />
+ </div>
+ {{-- <div class="">Logs will be updated automatically.</div> --}}
+ @else
+ <div class="pt-2 ">Deployment is <span
+ class="text-warning">{{ Str::headline(data_get($application_deployment_queue, 'status')) }}</span>.
+ </div>
+ @endif
+ <div id="screen" :class="fullscreen ? 'fullscreen' : ''">
+ <div @if ($isKeepAliveOn) wire:poll.2000ms="polling" @endif
+ class="relative flex flex-col-reverse w-full p-2 px-4 mt-4 overflow-y-auto text-white bg-coolgray-100 scrollbar border-coolgray-300"
+ :class="fullscreen ? '' : 'max-h-[40rem] border border-dotted rounded'">
+ <button title="Minimize" x-show="fullscreen" class="fixed top-4 right-4"
+ x-on:click="makeFullscreen"><svg class="icon" viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg">
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
+ stroke-width="2" d="M6 14h4m0 0v4m0-4l-6 6m14-10h-4m0 0V6m0 4l6-6" />
+ </svg></button>
+ <button title="Go Top" x-show="fullscreen" class="fixed top-4 right-28" x-on:click="goTop"> <svg
+ class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
+ stroke-width="2" d="M12 5v14m4-10l-4-4M8 9l4-4" />
+ </svg></button>
+ <button title="Follow Logs" x-show="fullscreen" :class="alwaysScroll ? 'text-warning' : ''"
+ class="fixed top-4 right-16" x-on:click="toggleScroll"><svg class="icon" viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg">
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
+ stroke-width="2" d="M12 5v14m4-4l-4 4m-4-4l4 4" />
+ </svg></button>
+
+ <button title="Fullscreen" x-show="!fullscreen" class="absolute top-2 right-8"
+ x-on:click="makeFullscreen"><svg class="fixed icon" viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg">
+ <g fill="none">
+ <path
+ d="M24 0v24H0V0h24ZM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018Zm.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022Zm-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01l-.184-.092Z" />
+ <path fill="currentColor"
+ d="M9.793 12.793a1 1 0 0 1 1.497 1.32l-.083.094L6.414 19H9a1 1 0 0 1 .117 1.993L9 21H4a1 1 0 0 1-.993-.883L3 20v-5a1 1 0 0 1 1.993-.117L5 15v2.586l4.793-4.793ZM20 3a1 1 0 0 1 .993.883L21 4v5a1 1 0 0 1-1.993.117L19 9V6.414l-4.793 4.793a1 1 0 0 1-1.497-1.32l.083-.094L17.586 5H15a1 1 0 0 1-.117-1.993L15 3h5Z" />
+ </g>
+ </svg></button>
+ <div id="logs" class="flex flex-col">
+ @if (decode_remote_command_output($application_deployment_queue)->count() > 0)
+ @foreach (decode_remote_command_output($application_deployment_queue) as $line)
+ <div @class([
+ 'font-mono whitespace-pre-line',
+ 'text-warning' => $line['hidden'],
+ 'text-red-500' => $line['type'] == 'stderr',
+ ])>[{{ $line['timestamp'] }}] @if ($line['hidden'])
+ <br>COMMAND: <br>{{ $line['command'] }} <br><br>OUTPUT:
+ @endif{{ $line['output'] }}@if ($line['hidden'])
+ @endif
+ </div>
+ @endforeach
+ @else
+ <span class="font-mono text-neutral-400">No logs yet.</span>
+ @endif
+ </div>
+ </div>
+ </div>
+ <script>
+ function makeFullscreen() {
+ this.fullscreen = !this.fullscreen;
+ if (this.fullscreen === false) {
+ this.alwaysScroll = false;
+ clearInterval(this.intervalId);
+ }
+ }
+
+ function toggleScroll() {
+ this.alwaysScroll = !this.alwaysScroll;
+
+ if (this.alwaysScroll) {
+ this.intervalId = setInterval(() => {
+ const screen = document.getElementById('screen');
+ const logs = document.getElementById('logs');
+ if (screen.scrollTop !== logs.scrollHeight) {
+ screen.scrollTop = logs.scrollHeight;
+ }
+ }, 100);
+ } else {
+ clearInterval(this.intervalId);
+ this.intervalId = null;
+ }
+ }
+
+ function goTop() {
+ this.alwaysScroll = false;
+ clearInterval(this.intervalId);
+ const screen = document.getElementById('screen');
+ screen.scrollTop = 0;
+ }
+ </script>
+ </div>
+
+</div>
diff --git a/resources/views/livewire/project/application/deployments.blade.php b/resources/views/livewire/project/application/deployments.blade.php
deleted file mode 100644
index be5d7f821b..0000000000
--- a/resources/views/livewire/project/application/deployments.blade.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<div class="flex flex-col gap-2 pb-10" @if ($skip == 0) wire:poll.5000ms='reload_deployments' @endif>
- <div class="flex items-end gap-2 pt-4">
- <h2>Deployments <span class="text-xs">({{ $deployments_count }})</span></h2>
- @if ($show_next)
- <x-forms.button wire:click="load_deployments({{ $default_take }})">Next Page
- </x-forms.button>
- @endif
- </div>
- <form class="flex items-end gap-2">
- <x-forms.input id="pull_request_id" label="Pull Request"></x-forms.input>
- <x-forms.button type="submit">Filter</x-forms.button>
- </form>
- @forelse ($deployments as $deployment)
- <a @class([
- 'bg-coolgray-100 p-2 border-l border-dashed transition-colors hover:no-underline',
- 'hover:bg-coolgray-200' => data_get($deployment, 'status') === 'queued',
- 'border-warning hover:bg-warning hover:text-black' =>
- data_get($deployment, 'status') === 'in_progress' ||
- data_get($deployment, 'status') === 'cancelled-by-user',
- 'border-error hover:bg-error' =>
- data_get($deployment, 'status') === 'failed',
- 'border-success hover:bg-success' =>
- data_get($deployment, 'status') === 'finished',
- ]) href="{{ $current_url . '/' . data_get($deployment, 'deployment_uuid') }}"
- class="hover:no-underline">
- <div class="flex flex-col justify-start">
- <div class="flex gap-1">
- {{ $deployment->created_at }} UTC
- <span class=" text-warning">></span>
- {{ $deployment->status }}
- </div>
- @if (data_get($deployment, 'pull_request_id'))
- <div>
- <span class=" text-warning">></span>
- Pull Request #{{ data_get($deployment, 'pull_request_id') }}
- @if (data_get($deployment, 'is_webhook'))
- (Webhook)
- @endif
- Webhook (SHA
- @if (data_get($deployment, 'commit'))
- {{ data_get($deployment, 'commit') }})
- @else
- HEAD)
- @endif
- </div>
- @endif
- </div>
-
- <div class="flex flex-col" x-data="elapsedTime('{{ $deployment->deployment_uuid }}', '{{ $deployment->status }}', '{{ $deployment->created_at }}', '{{ $deployment->updated_at }}')">
- <div>
- @if ($deployment->status !== 'in_progress')
- Finished <span x-text="measure_since_started()">0s</span> in
- @else
- Running for
- @endif
- <span class="font-bold" x-text="measure_finished_time()">0s</span>
- </div>
- </div>
- </a>
- @empty
- <div class="">No deployments found</div>
- @endforelse
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/utc.js"></script>
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.js"></script>
- <script>
- document.addEventListener('alpine:init', () => {
- let timers = {};
-
- dayjs.extend(window.dayjs_plugin_utc);
- dayjs.extend(window.dayjs_plugin_relativeTime);
-
- Alpine.data('elapsedTime', (uuid, status, created_at, updated_at) => ({
- finished_time: 'calculating...',
- started_time: 'calculating...',
- init() {
- if (timers[uuid]) {
- clearInterval(timers[uuid]);
- }
- if (status === 'in_progress') {
- timers[uuid] = setInterval(() => {
- this.finished_time = dayjs().diff(dayjs.utc(created_at),
- 'second') + 's'
- }, 1000);
- } else {
- let seconds = dayjs.utc(updated_at).diff(dayjs.utc(created_at), 'second')
- this.finished_time = seconds + 's';
- }
- },
- measure_finished_time() {
- return this.finished_time;
- },
- measure_since_started() {
- return dayjs.utc(created_at).fromNow();
- }
- }))
- })
- </script>
-</div>
diff --git a/resources/views/livewire/project/application/previews.blade.php b/resources/views/livewire/project/application/previews.blade.php
index 9d33a2e2a5..37c9f4057e 100644
--- a/resources/views/livewire/project/application/previews.blade.php
+++ b/resources/views/livewire/project/application/previews.blade.php
@@ -84,7 +84,7 @@
wire:click="stop({{ data_get($preview, 'pull_request_id') }})">Remove Preview
</x-forms.button>
<a
- href="{{ route('project.application.deployments', [...$parameters, 'pull_request_id' => data_get($preview, 'pull_request_id')]) }}">
+ href="{{ route('project.application.deployment.index', [...$parameters, 'pull_request_id' => data_get($preview, 'pull_request_id')]) }}">
<x-forms.button class="bg-coolgray-500">
Get Deployment Logs
</x-forms.button>
diff --git a/resources/views/livewire/project/clone-project.blade.php b/resources/views/livewire/project/clone-me.blade.php
similarity index 100%
rename from resources/views/livewire/project/clone-project.blade.php
rename to resources/views/livewire/project/clone-me.blade.php
diff --git a/resources/views/livewire/project/database/backup/execution.blade.php b/resources/views/livewire/project/database/backup/execution.blade.php
new file mode 100644
index 0000000000..437186b608
--- /dev/null
+++ b/resources/views/livewire/project/database/backup/execution.blade.php
@@ -0,0 +1,19 @@
+<div>
+ <h1>Backups</h1>
+ <livewire:project.database.heading :database="$database" />
+ <x-modal modalId="startDatabase">
+ <x-slot:modalBody>
+ <livewire:activity-monitor header="Database Startup Logs" />
+ </x-slot:modalBody>
+ <x-slot:modalSubmit>
+ <x-forms.button onclick="startDatabase.close()" type="submit">
+ Close
+ </x-forms.button>
+ </x-slot:modalSubmit>
+ </x-modal>
+ <div class="pt-6">
+ <livewire:project.database.backup-edit :backup="$backup" :s3s="$s3s" :status="data_get($database, 'status')" />
+ <h3 class="py-4">Executions</h3>
+ <livewire:project.database.backup-executions :backup="$backup" :executions="$executions" />
+ </div>
+</div>
diff --git a/resources/views/livewire/project/database/backup/index.blade.php b/resources/views/livewire/project/database/backup/index.blade.php
new file mode 100644
index 0000000000..7c827c93d7
--- /dev/null
+++ b/resources/views/livewire/project/database/backup/index.blade.php
@@ -0,0 +1,22 @@
+<div>
+ <h1>Backups</h1>
+ <livewire:project.database.heading :database="$database" />
+ <x-modal modalId="startDatabase">
+ <x-slot:modalBody>
+ <livewire:activity-monitor header="Database Startup Logs" />
+ </x-slot:modalBody>
+ <x-slot:modalSubmit>
+ <x-forms.button onclick="startDatabase.close()" type="submit">
+ Close
+ </x-forms.button>
+ </x-slot:modalSubmit>
+ </x-modal>
+ <livewire:project.database.create-scheduled-backup :database="$database" :s3s="$s3s" />
+ <div class="pt-6">
+ <div class="flex gap-2 ">
+ <h2 class="pb-4">Scheduled Backups</h2>
+ <x-forms.button onclick="createScheduledBackup.showModal()">+ Add</x-forms.button>
+ </div>
+ <livewire:project.database.scheduled-backups :database="$database" />
+ </div>
+</div>
diff --git a/resources/views/livewire/project/database/configuration.blade.php b/resources/views/livewire/project/database/configuration.blade.php
new file mode 100644
index 0000000000..1486d729f7
--- /dev/null
+++ b/resources/views/livewire/project/database/configuration.blade.php
@@ -0,0 +1,82 @@
+<div>
+ <h1>Configuration</h1>
+ <livewire:project.database.heading :database="$database" />
+ <x-modal modalId="startDatabase">
+ <x-slot:modalBody>
+ <livewire:activity-monitor header="Database Startup Logs" />
+ </x-slot:modalBody>
+ <x-slot:modalSubmit>
+ <x-forms.button onclick="startDatabase.close()" type="submit">
+ Close
+ </x-forms.button>
+ </x-slot:modalSubmit>
+ </x-modal>
+ <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex h-full pt-6">
+ <div class="flex flex-col gap-4 min-w-fit">
+ <a :class="activeTab === 'general' && 'text-white'"
+ @click.prevent="activeTab = 'general';
+ window.location.hash = 'general'"
+ href="#">General</a>
+ <a :class="activeTab === 'environment-variables' && 'text-white'"
+ @click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"
+ href="#">Environment
+ Variables</a>
+ <a :class="activeTab === 'server' && 'text-white'"
+ @click.prevent="activeTab = 'server';
+ window.location.hash = 'server'"
+ href="#">Server
+ </a>
+ <a :class="activeTab === 'storages' && 'text-white'"
+ @click.prevent="activeTab = 'storages';
+ window.location.hash = 'storages'"
+ href="#">Storages
+ </a>
+ <a :class="activeTab === 'webhooks' && 'text-white'"
+ @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks
+ </a>
+ <a :class="activeTab === 'resource-limits' && 'text-white'"
+ @click.prevent="activeTab = 'resource-limits';
+ window.location.hash = 'resource-limits'"
+ href="#">Resource Limits
+ </a>
+ <a :class="activeTab === 'danger' && 'text-white'"
+ @click.prevent="activeTab = 'danger';
+ window.location.hash = 'danger'"
+ href="#">Danger Zone
+ </a>
+ </div>
+ <div class="w-full pl-8">
+ <div x-cloak x-show="activeTab === 'general'" class="h-full">
+ @if ($database->type() === 'standalone-postgresql')
+ <livewire:project.database.postgresql.general :database="$database" />
+ @elseif ($database->type() === 'standalone-redis')
+ <livewire:project.database.redis.general :database="$database" />
+ @elseif ($database->type() === 'standalone-mongodb')
+ <livewire:project.database.mongodb.general :database="$database" />
+ @elseif ($database->type() === 'standalone-mysql')
+ <livewire:project.database.mysql.general :database="$database" />
+ @elseif ($database->type() === 'standalone-mariadb')
+ <livewire:project.database.mariadb.general :database="$database" />
+ @endif
+ </div>
+ <div x-cloak x-show="activeTab === 'environment-variables'">
+ <livewire:project.shared.environment-variable.all :resource="$database" />
+ </div>
+ <div x-cloak x-show="activeTab === 'server'">
+ <livewire:project.shared.destination :resource="$database" />
+ </div>
+ <div x-cloak x-show="activeTab === 'storages'">
+ <livewire:project.service.storage :resource="$database" />
+ </div>
+ <div x-cloak x-show="activeTab === 'webhooks'">
+ <livewire:project.shared.webhooks :resource="$database" />
+ </div>
+ <div x-cloak x-show="activeTab === 'resource-limits'">
+ <livewire:project.shared.resource-limits :resource="$database" />
+ </div>
+ <div x-cloak x-show="activeTab === 'danger'">
+ <livewire:project.shared.danger :resource="$database" />
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/resources/views/livewire/project/database/scheduled-backups.blade.php b/resources/views/livewire/project/database/scheduled-backups.blade.php
index 8ce548a6db..942fc546b1 100644
--- a/resources/views/livewire/project/database/scheduled-backups.blade.php
+++ b/resources/views/livewire/project/database/scheduled-backups.blade.php
@@ -3,7 +3,7 @@
@forelse($database->scheduledBackups as $backup)
@if ($type === 'database')
<a class="flex flex-col box"
- href="{{ route('project.database.backups.executions', [...$parameters, 'backup_uuid' => $backup->uuid]) }}">
+ href="{{ route('project.database.backup.execution', [...$parameters, 'backup_uuid' => $backup->uuid]) }}">
<div>Frequency: {{ $backup->frequency }}</div>
<div>Last backup: {{ data_get($backup->latest_log, 'status', 'No backup yet') }}</div>
<div>Number of backups to keep (locally): {{ $backup->number_of_backups_locally }}</div>
diff --git a/resources/views/livewire/project/environment-edit.blade.php b/resources/views/livewire/project/environment-edit.blade.php
index f88bbdb056..dfa6109cde 100644
--- a/resources/views/livewire/project/environment-edit.blade.php
+++ b/resources/views/livewire/project/environment-edit.blade.php
@@ -20,7 +20,7 @@
clip-rule="evenodd"></path>
</svg>
<a class="text-xs truncate lg:text-sm"
- href="{{ route('project.resources', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
+ href="{{ route('project.resource.index', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
</div>
</li>
<li>
diff --git a/resources/views/projects.blade.php b/resources/views/livewire/project/index.blade.php
similarity index 99%
rename from resources/views/projects.blade.php
rename to resources/views/livewire/project/index.blade.php
index 387750b6b5..4e3f28c9f4 100644
--- a/resources/views/projects.blade.php
+++ b/resources/views/livewire/project/index.blade.php
@@ -1,4 +1,4 @@
-<x-layout>
+<div>
<div class="flex gap-2">
<h1>Projects</span></h1>
@if ($servers > 0)
@@ -51,4 +51,4 @@
}
</script>
</div>
-</x-layout>
+</div>
diff --git a/resources/views/livewire/project/resource/create.blade.php b/resources/views/livewire/project/resource/create.blade.php
new file mode 100644
index 0000000000..efbdd37535
--- /dev/null
+++ b/resources/views/livewire/project/resource/create.blade.php
@@ -0,0 +1,17 @@
+<div>
+ @if ($type === 'public')
+ <livewire:project.new.public-git-repository :type="$type" />
+ @elseif ($type === 'private-gh-app')
+ <livewire:project.new.github-private-repository :type="$type" />
+ @elseif ($type === 'private-deploy-key')
+ <livewire:project.new.github-private-repository-deploy-key :type="$type" />
+ @elseif ($type === 'dockerfile')
+ <livewire:project.new.simple-dockerfile :type="$type" />
+ @elseif ($type === 'docker-compose-empty')
+ <livewire:project.new.docker-compose :type="$type" />
+ @elseif ($type === 'docker-image')
+ <livewire:project.new.docker-image :type="$type" />
+ @else
+ <livewire:project.new.select />
+ @endif
+</div>
diff --git a/resources/views/livewire/project/resource/index.blade.php b/resources/views/livewire/project/resource/index.blade.php
new file mode 100644
index 0000000000..a1ff056930
--- /dev/null
+++ b/resources/views/livewire/project/resource/index.blade.php
@@ -0,0 +1,97 @@
+<div>
+ <div class="flex flex-col">
+ <div class="flex items-center gap-2">
+ <h1>Resources</h1>
+ @if ($environment->isEmpty())
+ <a class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation"
+ href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
+ Clone
+ </a>
+ <livewire:project.delete-environment :environment_id="$environment->id" />
+ @else
+ <a href="{{ route('project.resource.create', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
+ class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation">+
+ New</a>
+ <a class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation"
+ href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
+ Clone
+ </a>
+ @endif
+ </div>
+ <nav class="flex pt-2 pb-10">
+ <ol class="flex items-center">
+ <li class="inline-flex items-center">
+ <a class="text-xs truncate lg:text-sm"
+ href="{{ route('project.show', ['project_uuid' => request()->route('project_uuid')]) }}">
+ {{ $project->name }}</a>
+ </li>
+ <li>
+ <div class="flex items-center">
+ <svg aria-hidden="true" class="w-4 h-4 mx-1 font-bold text-warning" fill="currentColor"
+ viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd"
+ d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
+ clip-rule="evenodd"></path>
+ </svg>
+ <a class="text-xs truncate lg:text-sm"
+ href="{{ route('project.resource.index', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
+ </div>
+ </li>
+ </ol>
+ </nav>
+ </div>
+ @if ($environment->isEmpty())
+ <a href="{{ route('project.resource.create', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
+ class="items-center justify-center box">+ Add New Resource</a>
+ @endif
+ <div class="grid gap-2 lg:grid-cols-2">
+ @foreach ($environment->applications->sortBy('name') as $application)
+ <a class="relative box group"
+ href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">
+ <div class="flex flex-col mx-6">
+ <div class="font-bold text-white">{{ $application->name }}</div>
+ <div class="description">{{ $application->description }}</div>
+ </div>
+ @if (Str::of(data_get($application, 'status'))->startsWith('running'))
+ <div class="absolute bg-success -top-1 -left-1 badge badge-xs"></div>
+ @elseif (Str::of(data_get($application, 'status'))->startsWith('exited'))
+ <div class="absolute bg-error -top-1 -left-1 badge badge-xs"></div>
+ @elseif (Str::of(data_get($application, 'status'))->startsWith('restarting'))
+ <div class="absolute bg-warning -top-1 -left-1 badge badge-xs"></div>
+ @endif
+ </a>
+ @endforeach
+ @foreach ($environment->databases()->sortBy('name') as $database)
+ <a class="relative box group"
+ href="{{ route('project.database.configuration', [$project->uuid, $environment->name, $database->uuid]) }}">
+ <div class="flex flex-col mx-6">
+ <div class="font-bold text-white">{{ $database->name }}</div>
+ <div class="description">{{ $database->description }}</div>
+ </div>
+ @if (Str::of(data_get($database, 'status'))->startsWith('running'))
+ <div class="absolute bg-success -top-1 -left-1 badge badge-xs"></div>
+ @elseif (Str::of(data_get($database, 'status'))->startsWith('exited'))
+ <div class="absolute bg-error -top-1 -left-1 badge badge-xs"></div>
+ @elseif (Str::of(data_get($database, 'status'))->startsWith('restaring'))
+ <div class="absolute bg-warning -top-1 -left-1 badge badge-xs"></div>
+ @endif
+ </a>
+ @endforeach
+ @foreach ($environment->services->sortBy('name') as $service)
+ <a class="relative box group"
+ href="{{ route('project.service.configuration', [$project->uuid, $environment->name, $service->uuid]) }}">
+ <div class="flex flex-col mx-6">
+ <div class="font-bold text-white">{{ $service->name }}</div>
+ <div class="description">{{ $service->description }}</div>
+ </div>
+ @if (Str::of(serviceStatus($service))->startsWith('running'))
+ <div class="absolute bg-success -top-1 -left-1 badge badge-xs"></div>
+ @elseif (Str::of(serviceStatus($service))->startsWith('degraded'))
+ <div class="absolute bg-warning -top-1 -left-1 badge badge-xs"></div>
+ @elseif (Str::of(serviceStatus($service))->startsWith('exited'))
+ <div class="absolute bg-error -top-1 -left-1 badge badge-xs"></div>
+ @endif
+ </a>
+ @endforeach
+ </div>
+</div>
diff --git a/resources/views/livewire/project/service/configuration.blade.php b/resources/views/livewire/project/service/configuration.blade.php
new file mode 100644
index 0000000000..c02a2ea05b
--- /dev/null
+++ b/resources/views/livewire/project/service/configuration.blade.php
@@ -0,0 +1,169 @@
+<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }" x-init="$wire.checkStatus">
+ <livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
+ <div class="flex h-full pt-6">
+ <div class="flex flex-col items-start gap-4 min-w-fit">
+ <a target="_blank" href="{{ $service->documentation() }}">Documentation <x-external-link /></a>
+ <a :class="activeTab === 'service-stack' && 'text-white'"
+ @click.prevent="activeTab = 'service-stack';
+ window.location.hash = 'service-stack'"
+ href="#">Service Stack</a>
+ <a :class="activeTab === 'execute-command' && 'text-white'"
+ @click.prevent="activeTab = 'execute-command';
+ window.location.hash = 'execute-command'"
+ href="#">Execute Command</a>
+ <a :class="activeTab === 'logs' && 'text-white'"
+ @click.prevent="activeTab = 'logs';
+ window.location.hash = 'logs'"
+ href="#">Logs</a>
+ <a :class="activeTab === 'storages' && 'text-white'"
+ @click.prevent="activeTab = 'storages';
+ window.location.hash = 'storages'"
+ href="#">Storages</a>
+ <a :class="activeTab === 'webhooks' && 'text-white'"
+ @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks
+ </a>
+ <a :class="activeTab === 'environment-variables' && 'text-white'"
+ @click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"
+ href="#">Environment
+ Variables</a>
+ <a :class="activeTab === 'danger' && 'text-white'"
+ @click.prevent="activeTab = 'danger';
+ window.location.hash = 'danger'"
+ href="#">Danger Zone
+ </a>
+ </div>
+ <div class="w-full pl-8">
+ <div x-cloak x-show="activeTab === 'service-stack'">
+ <livewire:project.service.stack-form :service="$service" />
+ <div class="grid grid-cols-1 gap-2 pt-4 xl:grid-cols-1">
+ @foreach ($applications as $application)
+ <div @class([
+ 'border-l border-dashed border-red-500' => Str::of(
+ $application->status)->contains(['exited']),
+ 'border-l border-dashed border-success' => Str::of(
+ $application->status)->contains(['running']),
+ 'border-l border-dashed border-warning' => Str::of(
+ $application->status)->contains(['starting']),
+ 'flex gap-2 box-without-bg bg-coolgray-100 hover:text-neutral-300 group',
+ ])>
+ <div class="flex flex-row w-full">
+ <div class="flex flex-col flex-1">
+ <div class="pb-2">
+ @if ($application->human_name)
+ {{ Str::headline($application->human_name) }}
+ @else
+ {{ Str::headline($application->name) }}
+ @endif
+ <span class="text-xs">({{ $application->image }})</span>
+ </div>
+ @if ($application->configuration_required)
+ <span class="text-xs text-error">(configuration required)</span>
+ @endif
+ @if ($application->description)
+ <span class="text-xs">{{ Str::limit($application->description, 60) }}</span>
+ @endif
+ @if ($application->fqdn)
+ <span class="text-xs">{{ Str::limit($application->fqdn, 60) }}</span>
+ @endif
+ <div class="text-xs">{{ $application->status }}</div>
+ </div>
+ <div class="flex items-center px-4">
+ <a
+ class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
+ href="{{ route('project.service.index', [...$parameters, 'service_name' => $application->name]) }}">
+ <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
+ viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
+ stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
+ <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
+ </svg>
+ </a>
+ </div>
+ </div>
+ </div>
+ @endforeach
+ @foreach ($databases as $database)
+ <div @class([
+ 'border-l border-dashed border-red-500' => Str::of(
+ $database->status)->contains(['exited']),
+ 'border-l border-dashed border-success' => Str::of(
+ $database->status)->contains(['running']),
+ 'border-l border-dashed border-warning' => Str::of(
+ $database->status)->contains(['restarting']),
+ 'flex gap-2 box-without-bg bg-coolgray-100 hover:text-neutral-300 group',
+ ])>
+
+
+ <div class="flex flex-row w-full">
+ <div class="flex flex-col flex-1">
+ <div class="pb-2">
+ @if ($database->human_name)
+ {{ Str::headline($database->human_name) }}
+ @else
+ {{ Str::headline($database->name) }}
+ @endif
+ <span class="text-xs">({{ $database->image }})</span>
+ </div>
+ @if ($database->configuration_required)
+ <span class="text-xs text-error">(configuration required)</span>
+ @endif
+ @if ($database->description)
+ <span class="text-xs">{{ Str::limit($database->description, 60) }}</span>
+ @endif
+ <div class="text-xs">{{ $database->status }}</div>
+ </div>
+ <div class="flex items-center px-4">
+ <a
+ class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
+ href="{{ route('project.service.index', [...$parameters, 'service_name' => $database->name]) }}">
+ <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
+ viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
+ stroke-linecap="round" stroke-linejoin="round">
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
+ <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
+ </svg>
+ </a>
+ </div>
+ </div>
+ </div>
+ @endforeach
+ </div>
+ </div>
+ <div x-cloak x-show="activeTab === 'storages'">
+ <div class="flex items-center gap-2">
+ <h2>Storages</h2>
+ </div>
+ <div class="pb-4">Persistent storage to preserve data between deployments.</div>
+ <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
+ @foreach ($applications as $application)
+ <livewire:project.service.storage wire:key="application-{{ $application->id }}"
+ :resource="$application" />
+ @endforeach
+ @foreach ($databases as $database)
+ <livewire:project.service.storage wire:key="database-{{ $database->id }}" :resource="$database" />
+ @endforeach
+ </div>
+ <div x-cloak x-show="activeTab === 'webhooks'">
+ <livewire:project.shared.webhooks :resource="$service" />
+ </div>
+ <div x-cloak x-show="activeTab === 'logs'">
+ <livewire:project.shared.logs :resource="$service" />
+ </div>
+ <div x-cloak x-show="activeTab === 'execute-command'">
+ <livewire:project.shared.execute-container-command :resource="$service" />
+ </div>
+ <div x-cloak x-show="activeTab === 'environment-variables'">
+ <div x-cloak x-show="activeTab === 'environment-variables'">
+ <livewire:project.shared.environment-variable.all :resource="$service" />
+ </div>
+ </div>
+ <div x-cloak x-show="activeTab === 'danger'">
+ <livewire:project.shared.danger :resource="$service" />
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/resources/views/livewire/project/service/index.blade.php b/resources/views/livewire/project/service/index.blade.php
index 5f4363b31e..15e9b9d210 100644
--- a/resources/views/livewire/project/service/index.blade.php
+++ b/resources/views/livewire/project/service/index.blade.php
@@ -1,169 +1,62 @@
-<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }" x-init="$wire.checkStatus">
+<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }">
<livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
<div class="flex h-full pt-6">
- <div class="flex flex-col items-start gap-4 min-w-fit">
- <a target="_blank" href="{{ $service->documentation() }}">Documentation <x-external-link /></a>
- <a :class="activeTab === 'service-stack' && 'text-white'"
- @click.prevent="activeTab = 'service-stack';
- window.location.hash = 'service-stack'"
- href="#">Service Stack</a>
- <a :class="activeTab === 'execute-command' && 'text-white'"
- @click.prevent="activeTab = 'execute-command';
- window.location.hash = 'execute-command'"
- href="#">Execute Command</a>
- <a :class="activeTab === 'logs' && 'text-white'"
- @click.prevent="activeTab = 'logs';
- window.location.hash = 'logs'"
- href="#">Logs</a>
- <a :class="activeTab === 'storages' && 'text-white'"
- @click.prevent="activeTab = 'storages';
- window.location.hash = 'storages'"
- href="#">Storages</a>
- <a :class="activeTab === 'webhooks' && 'text-white'"
- @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks
+ <div class="flex flex-col gap-4 min-w-fit">
+ <a class="{{ request()->routeIs('project.service.configuration') ? 'text-white' : '' }}"
+ href="{{ route('project.service.configuration', [...$parameters, 'service_name' => null]) }}">
+ <button><- Back</button>
</a>
- <a :class="activeTab === 'environment-variables' && 'text-white'"
- @click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"
- href="#">Environment
- Variables</a>
- <a :class="activeTab === 'danger' && 'text-white'"
- @click.prevent="activeTab = 'danger';
- window.location.hash = 'danger'"
- href="#">Danger Zone
+ <a :class="activeTab === 'general' && 'text-white'"
+ @click.prevent="activeTab = 'general'; window.location.hash = 'general'; if(window.location.search) window.location.search = ''"
+ href="#">General</a>
+ <a :class="activeTab === 'storages' && 'text-white'"
+ @click.prevent="activeTab = 'storages'; window.location.hash = 'storages'; if(window.location.search) window.location.search = ''"
+ href="#">Storages
</a>
+ @if (
+ $serviceDatabase?->databaseType() === 'standalone-mysql' ||
+ $serviceDatabase?->databaseType() === 'standalone-postgresql' ||
+ $serviceDatabase?->databaseType() === 'standalone-mariadb')
+ <a :class="activeTab === 'backups' && 'text-white'"
+ @click.prevent="activeTab = 'backups'; window.location.hash = 'backups'" href="#">Backups</a>
+ @endif
</div>
<div class="w-full pl-8">
- <div x-cloak x-show="activeTab === 'service-stack'">
- <livewire:project.service.stack-form :service="$service" />
- <div class="grid grid-cols-1 gap-2 pt-4 xl:grid-cols-1">
- @foreach ($applications as $application)
- <div @class([
- 'border-l border-dashed border-red-500' => Str::of(
- $application->status)->contains(['exited']),
- 'border-l border-dashed border-success' => Str::of(
- $application->status)->contains(['running']),
- 'border-l border-dashed border-warning' => Str::of(
- $application->status)->contains(['starting']),
- 'flex gap-2 box-without-bg bg-coolgray-100 hover:text-neutral-300 group',
- ])>
- <div class="flex flex-row w-full">
- <div class="flex flex-col flex-1">
- <div class="pb-2">
- @if ($application->human_name)
- {{ Str::headline($application->human_name) }}
- @else
- {{ Str::headline($application->name) }}
- @endif
- <span class="text-xs">({{ $application->image }})</span>
- </div>
- @if ($application->configuration_required)
- <span class="text-xs text-error">(configuration required)</span>
- @endif
- @if ($application->description)
- <span class="text-xs">{{ Str::limit($application->description, 60) }}</span>
- @endif
- @if ($application->fqdn)
- <span class="text-xs">{{ Str::limit($application->fqdn, 60) }}</span>
- @endif
- <div class="text-xs">{{ $application->status }}</div>
- </div>
- <div class="flex items-center px-4">
- <a
- class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
- href="{{ route('project.service.show', [...$parameters, 'service_name' => $application->name]) }}">
- <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
- viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
- stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path
- d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
- <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
- </svg>
- </a>
- </div>
- </div>
- </div>
- @endforeach
- @foreach ($databases as $database)
- <div @class([
- 'border-l border-dashed border-red-500' => Str::of(
- $database->status)->contains(['exited']),
- 'border-l border-dashed border-success' => Str::of(
- $database->status)->contains(['running']),
- 'border-l border-dashed border-warning' => Str::of(
- $database->status)->contains(['restarting']),
- 'flex gap-2 box-without-bg bg-coolgray-100 hover:text-neutral-300 group',
- ])>
-
-
- <div class="flex flex-row w-full">
- <div class="flex flex-col flex-1">
- <div class="pb-2">
- @if ($database->human_name)
- {{ Str::headline($database->human_name) }}
- @else
- {{ Str::headline($database->name) }}
- @endif
- <span class="text-xs">({{ $database->image }})</span>
- </div>
- @if ($database->configuration_required)
- <span class="text-xs text-error">(configuration required)</span>
- @endif
- @if ($database->description)
- <span class="text-xs">{{ Str::limit($database->description, 60) }}</span>
- @endif
- <div class="text-xs">{{ $database->status }}</div>
- </div>
- <div class="flex items-center px-4">
- <a
- class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
- href="{{ route('project.service.show', [...$parameters, 'service_name' => $database->name]) }}">
- <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
- viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
- stroke-linecap="round" stroke-linejoin="round">
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path
- d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z" />
- <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
- </svg>
- </a>
- </div>
- </div>
- </div>
- @endforeach
+ @isset($serviceApplication)
+ <div x-cloak x-show="activeTab === 'general'" class="h-full">
+ <livewire:project.service.application :application="$serviceApplication" />
+ </div>
+ <div x-cloak x-show="activeTab === 'storages'">
+ <div class="flex items-center gap-2">
+ <h2>Storages</h2>
+ </div>
+ <div class="pb-4">Persistent storage to preserve data between deployments.</div>
+ <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
+ <livewire:project.service.storage wire:key="application-{{ $serviceApplication->id }}"
+ :resource="$serviceApplication" />
+ </div>
+ @endisset
+ @isset($serviceDatabase)
+ <div x-cloak x-show="activeTab === 'general'" class="h-full">
+ <livewire:project.service.database :database="$serviceDatabase" />
</div>
- </div>
- <div x-cloak x-show="activeTab === 'storages'">
- <div class="flex items-center gap-2">
- <h2>Storages</h2>
+ <div x-cloak x-show="activeTab === 'storages'">
+ <div class="flex items-center gap-2">
+ <h2>Storages</h2>
+ </div>
+ <div class="pb-4">Persistent storage to preserve data between deployments.</div>
+ <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
+ <livewire:project.service.storage wire:key="application-{{ $serviceDatabase->id }}" :resource="$serviceDatabase" />
</div>
- <div class="pb-4">Persistent storage to preserve data between deployments.</div>
- <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
- @foreach ($applications as $application)
- <livewire:project.service.storage wire:key="application-{{ $application->id }}"
- :resource="$application" />
- @endforeach
- @foreach ($databases as $database)
- <livewire:project.service.storage wire:key="database-{{ $database->id }}" :resource="$database" />
- @endforeach
- </div>
- <div x-cloak x-show="activeTab === 'webhooks'">
- <livewire:project.shared.webhooks :resource="$service" />
- </div>
- <div x-cloak x-show="activeTab === 'logs'">
- <livewire:project.shared.logs :resource="$service" />
- </div>
- <div x-cloak x-show="activeTab === 'execute-command'">
- <livewire:project.shared.execute-container-command :resource="$service" />
- </div>
- <div x-cloak x-show="activeTab === 'environment-variables'">
- <div x-cloak x-show="activeTab === 'environment-variables'">
- <livewire:project.shared.environment-variable.all :resource="$service" />
+ <div x-cloak x-show="activeTab === 'backups'">
+ <div class="flex gap-2 ">
+ <h2 class="pb-4">Scheduled Backups</h2>
+ <x-forms.button onclick="createScheduledBackup.showModal()">+ Add</x-forms.button>
+ </div>
+ <livewire:project.database.create-scheduled-backup :database="$serviceDatabase" :s3s="$s3s" />
+ <livewire:project.database.scheduled-backups :database="$serviceDatabase" />
</div>
- </div>
- <div x-cloak x-show="activeTab === 'danger'">
- <livewire:project.shared.danger :resource="$service" />
- </div>
+ @endisset
</div>
</div>
</div>
diff --git a/resources/views/livewire/project/service/show.blade.php b/resources/views/livewire/project/service/show.blade.php
deleted file mode 100644
index 15e9b9d210..0000000000
--- a/resources/views/livewire/project/service/show.blade.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }">
- <livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
- <div class="flex h-full pt-6">
- <div class="flex flex-col gap-4 min-w-fit">
- <a class="{{ request()->routeIs('project.service.configuration') ? 'text-white' : '' }}"
- href="{{ route('project.service.configuration', [...$parameters, 'service_name' => null]) }}">
- <button><- Back</button>
- </a>
- <a :class="activeTab === 'general' && 'text-white'"
- @click.prevent="activeTab = 'general'; window.location.hash = 'general'; if(window.location.search) window.location.search = ''"
- href="#">General</a>
- <a :class="activeTab === 'storages' && 'text-white'"
- @click.prevent="activeTab = 'storages'; window.location.hash = 'storages'; if(window.location.search) window.location.search = ''"
- href="#">Storages
- </a>
- @if (
- $serviceDatabase?->databaseType() === 'standalone-mysql' ||
- $serviceDatabase?->databaseType() === 'standalone-postgresql' ||
- $serviceDatabase?->databaseType() === 'standalone-mariadb')
- <a :class="activeTab === 'backups' && 'text-white'"
- @click.prevent="activeTab = 'backups'; window.location.hash = 'backups'" href="#">Backups</a>
- @endif
- </div>
- <div class="w-full pl-8">
- @isset($serviceApplication)
- <div x-cloak x-show="activeTab === 'general'" class="h-full">
- <livewire:project.service.application :application="$serviceApplication" />
- </div>
- <div x-cloak x-show="activeTab === 'storages'">
- <div class="flex items-center gap-2">
- <h2>Storages</h2>
- </div>
- <div class="pb-4">Persistent storage to preserve data between deployments.</div>
- <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
- <livewire:project.service.storage wire:key="application-{{ $serviceApplication->id }}"
- :resource="$serviceApplication" />
- </div>
- @endisset
- @isset($serviceDatabase)
- <div x-cloak x-show="activeTab === 'general'" class="h-full">
- <livewire:project.service.database :database="$serviceDatabase" />
- </div>
- <div x-cloak x-show="activeTab === 'storages'">
- <div class="flex items-center gap-2">
- <h2>Storages</h2>
- </div>
- <div class="pb-4">Persistent storage to preserve data between deployments.</div>
- <span class="text-warning">Please modify storage layout in your Docker Compose file.</span>
- <livewire:project.service.storage wire:key="application-{{ $serviceDatabase->id }}" :resource="$serviceDatabase" />
- </div>
- <div x-cloak x-show="activeTab === 'backups'">
- <div class="flex gap-2 ">
- <h2 class="pb-4">Scheduled Backups</h2>
- <x-forms.button onclick="createScheduledBackup.showModal()">+ Add</x-forms.button>
- </div>
- <livewire:project.database.create-scheduled-backup :database="$serviceDatabase" :s3s="$s3s" />
- <livewire:project.database.scheduled-backups :database="$serviceDatabase" />
- </div>
- @endisset
- </div>
- </div>
-</div>
diff --git a/resources/views/project/show.blade.php b/resources/views/livewire/project/show.blade.php
similarity index 95%
rename from resources/views/project/show.blade.php
rename to resources/views/livewire/project/show.blade.php
index 98da15b320..319da2b71d 100644
--- a/resources/views/project/show.blade.php
+++ b/resources/views/livewire/project/show.blade.php
@@ -1,4 +1,4 @@
-<x-layout>
+<div>
<div class="flex items-center gap-2">
<h1>Environments</h1>
<x-forms.button class="btn" onclick="newEnvironment.showModal()">+ Add</x-forms.button>
@@ -13,7 +13,7 @@
<div class="gap-2 border border-transparent cursor-pointer box group" x-data
x-on:click="goto('{{ $project->uuid }}','{{ $environment->name }}')">
<a class="flex flex-col flex-1 mx-6 hover:no-underline"
- href="{{ route('project.resources', [$project->uuid, $environment->name]) }}">
+ href="{{ route('project.resource.index', [$project->uuid, $environment->name]) }}">
<div class="font-bold text-white"> {{ $environment->name }}</div>
<div class="description ">
{{ $environment->description }}</div>
@@ -41,4 +41,4 @@
}
</script>
</div>
-</x-layout>
+</div>
diff --git a/resources/views/livewire/private-key/create.blade.php b/resources/views/livewire/security/private-key/create.blade.php
similarity index 86%
rename from resources/views/livewire/private-key/create.blade.php
rename to resources/views/livewire/security/private-key/create.blade.php
index 17d0549457..10ef5185d8 100644
--- a/resources/views/livewire/private-key/create.blade.php
+++ b/resources/views/livewire/security/private-key/create.blade.php
@@ -1,4 +1,6 @@
<div>
+ <h1>Create a new Private Key</h1>
+ <div class="subtitle ">Private Keys are used to connect to your servers without passwords.</div>
<x-forms.button class="mb-4" wire:click="generateNewKey">Generate new SSH key for me</x-forms.button>
<form class="flex flex-col gap-2" wire:submit='createPrivateKey'>
<div class="flex gap-2">
diff --git a/resources/views/livewire/security/private-key/show.blade.php b/resources/views/livewire/security/private-key/show.blade.php
new file mode 100644
index 0000000000..43bcd95f67
--- /dev/null
+++ b/resources/views/livewire/security/private-key/show.blade.php
@@ -0,0 +1,54 @@
+<div>
+ <x-security.navbar />
+ <div x-data="{ showPrivateKey: false }">
+ <x-modal yesOrNo modalId="deletePrivateKey" modalTitle="Delete Private Key">
+ <x-slot:modalBody>
+ <p>This private key will be deleted. It is not reversible. <br>Please think again.</p>
+ </x-slot:modalBody>
+ </x-modal>
+ <form class="flex flex-col gap-2" wire:submit='changePrivateKey'>
+ <div class="flex items-end gap-2">
+ <h2>Private Key</h2>
+ <x-forms.button type="submit">
+ Save
+ </x-forms.button>
+ @if ($private_key->id > 0)
+ <x-forms.button isError isModal modalId="deletePrivateKey">
+ Delete
+ </x-forms.button>
+ @endif
+ </div>
+ <x-forms.input id="private_key.name" label="Name" required />
+ <x-forms.input id="private_key.description" label="Description" />
+ <div>
+ <div class="flex items-end gap-2 py-2 ">
+ <div class="pl-1 ">Public Key</div>
+ </div>
+ <x-forms.input readonly id="public_key" />
+ <div class="flex items-end gap-2 py-2 ">
+ <div class="pl-1 ">Private Key <span class='text-helper'>*</span></div>
+ <div class="text-xs text-white underline cursor-pointer" x-cloak x-show="!showPrivateKey"
+ x-on:click="showPrivateKey = true">
+ Edit
+ </div>
+ <div class="text-xs text-white underline cursor-pointer" x-cloak x-show="showPrivateKey"
+ x-on:click="showPrivateKey = false">
+ Hide
+ </div>
+ </div>
+ @if ($private_key->is_git_related)
+ <div class="w-48">
+ <x-forms.checkbox id="private_key.is_git_related" disabled label="Is used by a Git App?" />
+ </div>
+ @endif
+ <div x-cloak x-show="!showPrivateKey">
+ <x-forms.input allowToPeak="false" type="password" rows="10" id="private_key.private_key"
+ required disabled />
+ </div>
+ <div x-cloak x-show="showPrivateKey">
+ <x-forms.textarea rows="10" id="private_key.private_key" required />
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
diff --git a/resources/views/livewire/server/all.blade.php b/resources/views/livewire/server/index.blade.php
similarity index 100%
rename from resources/views/livewire/server/all.blade.php
rename to resources/views/livewire/server/index.blade.php
diff --git a/resources/views/livewire/server/show-private-key.blade.php b/resources/views/livewire/server/show-private-key.blade.php
index a9bcde0bc0..c10e440b8d 100644
--- a/resources/views/livewire/server/show-private-key.blade.php
+++ b/resources/views/livewire/server/show-private-key.blade.php
@@ -1,7 +1,7 @@
<div>
<div class="flex items-end gap-2 pb-6 ">
<h2>Private Key</h2>
- <a href="{{ route('security.private-key.new') }}">
+ <a href="{{ route('security.private-key.create') }}">
<x-forms.button>Add a new Private Key</x-forms.button>
</a>
<x-forms.button wire:click.prevent='checkConnection'>
diff --git a/resources/views/livewire/settings/index.blade.php b/resources/views/livewire/settings/index.blade.php
new file mode 100644
index 0000000000..7491d8d1c9
--- /dev/null
+++ b/resources/views/livewire/settings/index.blade.php
@@ -0,0 +1,25 @@
+<div>
+ <x-settings.navbar />
+ <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex h-full pt-1">
+ <div class="flex flex-col gap-4 min-w-fit">
+ <a :class="activeTab === 'general' && 'text-white'"
+ @click.prevent="activeTab = 'general'; window.location.hash = 'general'" href="#">General</a>
+ <a :class="activeTab === 'backup' && 'text-white'"
+ @click.prevent="activeTab = 'backup'; window.location.hash = 'backup'" href="#">Instance Backup</a>
+ <a :class="activeTab === 'smtp' && 'text-white'"
+ @click.prevent="activeTab = 'smtp'; window.location.hash = 'smtp'" href="#">Transactional
+ Email</a>
+ </div>
+ <div class="w-full pl-8">
+ <div x-cloak x-show="activeTab === 'general'" class="h-full">
+ <livewire:settings.configuration :settings="$settings" />
+ </div>
+ <div x-cloak x-show="activeTab === 'backup'" class="h-full">
+ <livewire:settings.backup :settings="$settings" :database="$database" :s3s="$s3s" />
+ </div>
+ <div x-cloak x-show="activeTab === 'smtp'" class="h-full">
+ <livewire:settings.email :settings="$settings" />
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/resources/views/livewire/settings/license.blade.php b/resources/views/livewire/settings/license.blade.php
new file mode 100644
index 0000000000..31dc0fb947
--- /dev/null
+++ b/resources/views/livewire/settings/license.blade.php
@@ -0,0 +1,28 @@
+<div>
+ <x-settings.navbar />
+ <h2>Resale License</h2>
+ <form wire:submit='submit' class="flex flex-col gap-2">
+ <div>
+ @if ($settings->is_resale_license_active)
+ <div class="text-success">License is active</div>
+ @else
+ <div class="text-error">License is not active</div>
+ @endif
+ </div>
+ <div class="flex gap-2">
+ <x-forms.input type="password" id="settings.resale_license"
+ placeholder="eg: BE558E91-0CC5-4AA2-B1C0-B6403C2988DD" label="License Key" />
+ <x-forms.input type="password" id="instance_id" label="Instance Id (do not change this)" disabled />
+ </div>
+ <div class="flex gap-2">
+ <x-forms.button type="submit">
+ Check License
+ </x-forms.button>
+ </div>
+ @if (session()->has('error'))
+ <div class="text-error">
+ {!! session('error') !!}
+ </div>
+ @endif
+ </form>
+</div>
diff --git a/resources/views/livewire/subscription/show.blade.php b/resources/views/livewire/subscription/index.blade.php
similarity index 100%
rename from resources/views/livewire/subscription/show.blade.php
rename to resources/views/livewire/subscription/index.blade.php
diff --git a/resources/views/livewire/team/create.blade.php b/resources/views/livewire/team/create.blade.php
index e90ae30408..d6afcbbab0 100644
--- a/resources/views/livewire/team/create.blade.php
+++ b/resources/views/livewire/team/create.blade.php
@@ -1,7 +1,11 @@
-<form class="flex flex-col gap-2" wire:submit='submit'>
- <x-forms.input autofocus id="name" label="Name" required />
- <x-forms.input id="description" label="Description" />
- <x-forms.button type="submit">
- Save Team
- </x-forms.button>
-</form>
+<div>
+ <h1>New Team</h1>
+ <div class="subtitle">Add a new team</div>
+ <form class="flex flex-col gap-2" wire:submit='submit'>
+ <x-forms.input autofocus id="name" label="Name" required />
+ <x-forms.input id="description" label="Description" />
+ <x-forms.button type="submit">
+ Save Team
+ </x-forms.button>
+ </form>
+</div>
diff --git a/resources/views/livewire/team/delete.blade.php b/resources/views/livewire/team/delete.blade.php
deleted file mode 100644
index 4e4bd59773..0000000000
--- a/resources/views/livewire/team/delete.blade.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<div>
- <x-modal yesOrNo modalId="deleteTeam" modalTitle="Delete Team">
- <x-slot:modalBody>
- <p>This team be deleted. It is not reversible. <br>Please think again.</p>
- </x-slot:modalBody>
- </x-modal>
- <h2>Danger Zone</h2>
- <div class="pb-4">Woah. I hope you know what are you doing.</div>
- <h4 class="pb-4">Delete Team</h4>
- @if (session('currentTeam.id') === 0)
- <div>This is the default team. You can't delete it.</div>
- @elseif(auth()->user()->teams()->get()->count() === 1)
- <div>You can't delete your last team.</div>
- @elseif(currentTeam()->subscription && currentTeam()->subscription?->lemon_status !== 'cancelled')
- <div>Please cancel your subscription before delete this team (Manage My Subscription).</div>
- @else
- @if (currentTeam()->isEmpty())
- <div class="pb-4">This will delete your team. Beware! There is no coming back!</div>
- <x-forms.button isError isModal modalId="deleteTeam">
- Delete
- </x-forms.button>
- @else
- <div>
- <div class="pb-4">You need to delete the following resources to be able to delete the team:</div>
- @if (currentTeam()->projects()->count() > 0)
- <h4 class="pb-4">Projects:</h4>
- <ul class="pl-8 list-disc">
- @foreach (currentTeam()->projects as $resource)
- <li>{{ $resource->name }}</li>
- @endforeach
- </ul>
- @endif
- @if (currentTeam()->servers()->count() > 0)
- <h4 class="py-4">Servers:</h4>
- <ul class="pl-8 list-disc">
- @foreach (currentTeam()->servers as $resource)
- <li>{{ $resource->name }}</li>
- @endforeach
- </ul>
- @endif
- @if (currentTeam()->privateKeys()->count() > 0)
- <h4 class="py-4">Private Keys:</h4>
- <ul class="pl-8 list-disc">
- @foreach (currentTeam()->privateKeys as $resource)
- <li>{{ $resource->name }}</li>
- @endforeach
- </ul>
- @endif
- @if (currentTeam()->sources()->count() > 0)
- <h4 class="py-4">Sources:</h4>
- <ul class="pl-8 list-disc">
- @foreach (currentTeam()->sources() as $resource)
- <li>{{ $resource->name }}</li>
- @endforeach
- </ul>
- @endif
- @endif
- @endif
-
-</div>
diff --git a/resources/views/livewire/team/form.blade.php b/resources/views/livewire/team/form.blade.php
deleted file mode 100644
index c484cb3588..0000000000
--- a/resources/views/livewire/team/form.blade.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<form class="flex flex-col gap-2 pb-6" wire:submit='submit'>
- <div class="flex items-end gap-2">
- <h2>General</h2>
- <x-forms.button type="submit">
- Save
- </x-forms.button>
- </div>
- <div class="flex gap-2">
- <x-forms.input id="team.name" label="Name" required />
- <x-forms.input id="team.description" label="Description" />
- </div>
-</form>
diff --git a/resources/views/livewire/team/index.blade.php b/resources/views/livewire/team/index.blade.php
new file mode 100644
index 0000000000..20e164193b
--- /dev/null
+++ b/resources/views/livewire/team/index.blade.php
@@ -0,0 +1,89 @@
+<div>
+ <x-team.navbar />
+
+ <form class="flex flex-col gap-2 pb-6" wire:submit='submit'>
+ <div class="flex items-end gap-2">
+ <h2>General</h2>
+ <x-forms.button type="submit">
+ Save
+ </x-forms.button>
+ </div>
+ <div class="flex gap-2">
+ <x-forms.input id="team.name" label="Name" required />
+ <x-forms.input id="team.description" label="Description" />
+ </div>
+ </form>
+
+ @if (isCloud())
+ <div class="pb-8">
+ <h2>Subscription</h2>
+ @if (data_get(currentTeam(), 'subscription'))
+ <livewire:subscription.actions />
+ @else
+ <x-forms.button class="mt-4"><a class="text-white hover:no-underline"
+ href="{{ route('subscription.index') }}">Subscribe Now</a>
+ </x-forms.button>
+ @endif
+
+ </div>
+ @endif
+ <div>
+ <x-modal yesOrNo modalId="deleteTeam" modalTitle="Delete Team">
+ <x-slot:modalBody>
+ <p>This team be deleted. It is not reversible. <br>Please think again.</p>
+ </x-slot:modalBody>
+ </x-modal>
+ <h2>Danger Zone</h2>
+ <div class="pb-4">Woah. I hope you know what are you doing.</div>
+ <h4 class="pb-4">Delete Team</h4>
+ @if (session('currentTeam.id') === 0)
+ <div>This is the default team. You can't delete it.</div>
+ @elseif(auth()->user()->teams()->get()->count() === 1)
+ <div>You can't delete your last team.</div>
+ @elseif(currentTeam()->subscription && currentTeam()->subscription?->lemon_status !== 'cancelled')
+ <div>Please cancel your subscription before delete this team (Manage My Subscription).</div>
+ @else
+ @if (currentTeam()->isEmpty())
+ <div class="pb-4">This will delete your team. Beware! There is no coming back!</div>
+ <x-forms.button isError isModal modalId="deleteTeam">
+ Delete
+ </x-forms.button>
+ @else
+ <div>
+ <div class="pb-4">You need to delete the following resources to be able to delete the team:</div>
+ @if (currentTeam()->projects()->count() > 0)
+ <h4 class="pb-4">Projects:</h4>
+ <ul class="pl-8 list-disc">
+ @foreach (currentTeam()->projects as $resource)
+ <li>{{ $resource->name }}</li>
+ @endforeach
+ </ul>
+ @endif
+ @if (currentTeam()->servers()->count() > 0)
+ <h4 class="py-4">Servers:</h4>
+ <ul class="pl-8 list-disc">
+ @foreach (currentTeam()->servers as $resource)
+ <li>{{ $resource->name }}</li>
+ @endforeach
+ </ul>
+ @endif
+ @if (currentTeam()->privateKeys()->count() > 0)
+ <h4 class="py-4">Private Keys:</h4>
+ <ul class="pl-8 list-disc">
+ @foreach (currentTeam()->privateKeys as $resource)
+ <li>{{ $resource->name }}</li>
+ @endforeach
+ </ul>
+ @endif
+ @if (currentTeam()->sources()->count() > 0)
+ <h4 class="py-4">Sources:</h4>
+ <ul class="pl-8 list-disc">
+ @foreach (currentTeam()->sources() as $resource)
+ <li>{{ $resource->name }}</li>
+ @endforeach
+ </ul>
+ @endif
+ @endif
+ @endif
+ </div>
+</div>
diff --git a/resources/views/team/members.blade.php b/resources/views/livewire/team/member/index.blade.php
similarity index 98%
rename from resources/views/team/members.blade.php
rename to resources/views/livewire/team/member/index.blade.php
index 60839bcc88..72d7864c68 100644
--- a/resources/views/team/members.blade.php
+++ b/resources/views/livewire/team/member/index.blade.php
@@ -1,4 +1,4 @@
-<x-layout>
+<div>
<x-team.navbar />
<h2>Members</h2>
<div class="pt-4 overflow-hidden">
@@ -41,4 +41,4 @@
</div>
<livewire:team.invitations :invitations="$invitations" />
@endif
-</x-layout>
+</div>
diff --git a/resources/views/team/notifications.blade.php b/resources/views/livewire/team/notification/index.blade.php
similarity index 98%
rename from resources/views/team/notifications.blade.php
rename to resources/views/livewire/team/notification/index.blade.php
index a86db9ad2e..26270b4808 100644
--- a/resources/views/team/notifications.blade.php
+++ b/resources/views/livewire/team/notification/index.blade.php
@@ -1,4 +1,4 @@
-<x-layout>
+<div>
<x-team.navbar />
<h2 class="pb-4">Notifications</h2>
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'email' }" class="flex h-full">
@@ -21,4 +21,4 @@
<livewire:notifications.discord-settings />
</div>
</div>
-</x-layout>
+ </div>
diff --git a/resources/views/team/storages/all.blade.php b/resources/views/livewire/team/storage/index.blade.php
similarity index 98%
rename from resources/views/team/storages/all.blade.php
rename to resources/views/livewire/team/storage/index.blade.php
index 0ac2051b34..c64ff050f6 100644
--- a/resources/views/team/storages/all.blade.php
+++ b/resources/views/livewire/team/storage/index.blade.php
@@ -1,4 +1,4 @@
-<x-layout>
+<div>
<x-team.navbar :team="auth()
->user()
->currentTeam()" />
@@ -30,4 +30,4 @@
window.location.href = '/team/storages/' + uuid;
}
</script>
-</x-layout>
+</div>
diff --git a/resources/views/team/storages/show.blade.php b/resources/views/livewire/team/storage/show.blade.php
similarity index 85%
rename from resources/views/team/storages/show.blade.php
rename to resources/views/livewire/team/storage/show.blade.php
index 88f8780d6c..83fa95a08c 100644
--- a/resources/views/team/storages/show.blade.php
+++ b/resources/views/livewire/team/storage/show.blade.php
@@ -1,6 +1,6 @@
-<x-layout>
+<div>
<x-team.navbar :team="auth()
->user()
->currentTeam()" />
<livewire:team.storage.form :storage="$storage" />
-</x-layout>
+</div>
diff --git a/resources/views/livewire/team/storages/create.blade.php b/resources/views/livewire/team/storages/create.blade.php
new file mode 100644
index 0000000000..379e555e9f
--- /dev/null
+++ b/resources/views/livewire/team/storages/create.blade.php
@@ -0,0 +1,3 @@
+<div>
+ {{-- If you look to others for fulfillment, you will never truly be fulfilled. --}}
+</div>
diff --git a/resources/views/project/edit.blade.php b/resources/views/project/edit.blade.php
deleted file mode 100644
index 14746275f4..0000000000
--- a/resources/views/project/edit.blade.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<x-layout>
- <livewire:project.edit :project="$project" />
-</x-layout>
diff --git a/resources/views/project/resources.blade.php b/resources/views/project/resources.blade.php
index 8e97bf3240..2b5e6fcd12 100644
--- a/resources/views/project/resources.blade.php
+++ b/resources/views/project/resources.blade.php
@@ -4,16 +4,16 @@
<h1>Resources</h1>
@if ($environment->isEmpty())
<a class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation"
- href="{{ route('project.clone', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
+ href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
Clone
</a>
<livewire:project.delete-environment :environment_id="$environment->id" />
@else
- <a href="{{ route('project.resources.new', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
+ <a href="{{ route('project.resource.create', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation">+
New</a>
<a class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation"
- href="{{ route('project.clone', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
+ href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
Clone
</a>
@endif
@@ -34,14 +34,14 @@
clip-rule="evenodd"></path>
</svg>
<a class="text-xs truncate lg:text-sm"
- href="{{ route('project.resources', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
+ href="{{ route('project.resource.index', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
</div>
</li>
</ol>
</nav>
</div>
@if ($environment->isEmpty())
- <a href="{{ route('project.resources.new', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
+ <a href="{{ route('project.resource.create', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
class="items-center justify-center box">+ Add New Resource</a>
@endif
<div class="grid gap-2 lg:grid-cols-2">
diff --git a/resources/views/security/private-key/index.blade.php b/resources/views/security/private-key/index.blade.php
index 6e7190c347..64687d1496 100644
--- a/resources/views/security/private-key/index.blade.php
+++ b/resources/views/security/private-key/index.blade.php
@@ -2,11 +2,11 @@
<x-security.navbar />
<div class="flex gap-2">
<h2 class="pb-4">Private Keys</h2>
- <a href="{{ route('security.private-key.new') }}"><x-forms.button>+ Add</x-forms.button></a>
+ <a href="{{ route('security.private-key.create') }}"><x-forms.button>+ Add</x-forms.button></a>
</div>
<div class="grid gap-2 lg:grid-cols-2">
@forelse ($privateKeys as $key)
- <a class="text-center hover:no-underline box group"
+ <a class="text-center hover:no-underline box group"
href="{{ route('security.private-key.show', ['private_key_uuid' => data_get($key, 'uuid')]) }}">
<div class="group-hover:text-white">
<div>{{ $key->name }}</div>
diff --git a/resources/views/security/private-key/new.blade.php b/resources/views/security/private-key/new.blade.php
deleted file mode 100644
index b5e59eea2f..0000000000
--- a/resources/views/security/private-key/new.blade.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<x-layout>
- <h1>Create a new Private Key</h1>
- <div class="subtitle ">Private Keys are used to connect to your servers without passwords.</div>
- <livewire:private-key.create />
-</x-layout>
diff --git a/resources/views/security/private-key/show.blade.php b/resources/views/security/private-key/show.blade.php
deleted file mode 100644
index 82cf634f01..0000000000
--- a/resources/views/security/private-key/show.blade.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<x-layout>
- <x-security.navbar />
- <livewire:private-key.change :private_key="$private_key" />
-</x-layout>
diff --git a/resources/views/team/create.blade.php b/resources/views/team/create.blade.php
deleted file mode 100644
index a640508491..0000000000
--- a/resources/views/team/create.blade.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<x-layout>
- <h1>New Team</h1>
- <div class="subtitle">Add a new team</div>
- <livewire:team.create />
-</x-layout>
diff --git a/resources/views/team/index.blade.php b/resources/views/team/index.blade.php
deleted file mode 100644
index fa732010e3..0000000000
--- a/resources/views/team/index.blade.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<x-layout>
- <x-team.navbar />
- <livewire:team.form />
- @if (isCloud())
- <div class="pb-8">
- <h2>Subscription</h2>
- @if (data_get(currentTeam(), 'subscription'))
- <livewire:subscription.actions />
- @else
- <x-forms.button class="mt-4"><a class="text-white hover:no-underline"
- href="{{ route('subscription.index') }}">Subscribe Now</a>
- </x-forms.button>
- @endif
-
- </div>
- @endif
- <livewire:team.delete />
-</x-layout>
diff --git a/resources/views/team/storages/create.blade.php b/resources/views/team/storages/create.blade.php
deleted file mode 100644
index 711c521e3d..0000000000
--- a/resources/views/team/storages/create.blade.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<x-layout>
- <livewire:team.storage.create />
-</x-layout>
diff --git a/routes/web.php b/routes/web.php
index ffd9073442..b25ee38194 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,102 +1,86 @@
<?php
-use App\Events\TestEvent;
-use App\Http\Controllers\ApplicationController;
+use App\Models\GitlabApp;
+use App\Models\PrivateKey;
+use App\Models\Server;
+use App\Models\StandaloneDocker;
+use App\Models\SwarmDocker;
+use App\Providers\RouteServiceProvider;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Route;
+
use App\Http\Controllers\Controller;
-use App\Http\Controllers\DatabaseController;
use App\Http\Controllers\MagicController;
-use App\Http\Controllers\ProjectController;
-use App\Livewire\Project\Application\Configuration as ApplicationConfiguration;
-use App\Livewire\Boarding\Index as BoardingIndex;
-use App\Livewire\Project\Service\Index as ServiceIndex;
-use App\Livewire\Project\Service\Show as ServiceShow;
use App\Livewire\Dev\Compose as Compose;
+
use App\Livewire\Dashboard;
-use App\Livewire\Project\CloneProject;
+use App\Livewire\Boarding\Index as BoardingIndex;
+use App\Livewire\Settings\Index as SettingsIndex;
+use App\Livewire\Settings\License as SettingsLicense;
+use App\Livewire\Profile\Index as ProfileIndex;
+
+use App\Livewire\Team\Index as TeamIndex;
+use App\Livewire\Team\Create as TeamCreate;
+use App\Livewire\Team\Notification\Index as TeamNotificationIndex;
+
+use App\Livewire\Team\Storage\Index as TeamStorageIndex;
+use App\Livewire\Team\Storage\Create as TeamStorageCreate;
+use App\Livewire\Team\Storage\Show as TeamStorageShow;
+use App\Livewire\Team\Member\Index as TeamMemberIndex;
+
+use App\Livewire\CommandCenter\Index as CommandCenterIndex;
+use App\Livewire\ForcePasswordReset;
+use App\Livewire\Project\Index as ProjectIndex;
+use App\Livewire\Project\Show as ProjectShow;
+use App\Livewire\Project\Edit as ProjectEdit;
+use App\Livewire\Project\CloneMe as ProjectCloneMe;
+use App\Livewire\Project\Resource\Index as ResourceIndex;
+use App\Livewire\Project\Resource\Create as ResourceCreate;
+
+use App\Livewire\Project\Application\Configuration as ApplicationConfiguration;
+use App\Livewire\Project\Application\Deployment\Index as DeploymentIndex;
+use App\Livewire\Project\Application\Deployment\Show as DeploymentShow;
+use App\Livewire\Project\Database\Configuration as DatabaseConfiguration;
+use App\Livewire\Project\Database\Backup\Index as DatabaseBackupIndex;
+use App\Livewire\Project\Database\Backup\Execution as DatabaseBackupExecution;
+
+use App\Livewire\Project\Service\Configuration as ServiceConfiguration;
+use App\Livewire\Project\Service\Index as ServiceIndex;
+
use App\Livewire\Project\EnvironmentEdit;
use App\Livewire\Project\Shared\ExecuteContainerCommand;
use App\Livewire\Project\Shared\Logs;
+
use App\Livewire\Security\ApiTokens;
-use App\Livewire\Server\All;
-use App\Livewire\Server\Create;
+use App\Livewire\Security\PrivateKey\Create as SecurityPrivateKeyCreate;
+use App\Livewire\Security\PrivateKey\Show as SecurityPrivateKeyShow;
+
+use App\Livewire\Server\Index as ServerIndex;
+use App\Livewire\Server\Create as ServerCreate;
+use App\Livewire\Server\Show as ServerShow;
use App\Livewire\Server\Destination\Show as DestinationShow;
use App\Livewire\Server\LogDrains;
use App\Livewire\Server\PrivateKey\Show as PrivateKeyShow;
use App\Livewire\Server\Proxy\Show as ProxyShow;
use App\Livewire\Server\Proxy\Logs as ProxyLogs;
-use App\Livewire\Server\Show;
+
use App\Livewire\Source\Github\Change as GitHubChange;
-use App\Livewire\Subscription\Show as SubscriptionShow;
+use App\Livewire\Subscription\Index as SubscriptionIndex;
use App\Livewire\Waitlist\Index as WaitlistIndex;
-use App\Models\GitlabApp;
-use App\Models\PrivateKey;
-use App\Models\Server;
-use App\Models\StandaloneDocker;
-use App\Models\SwarmDocker;
-use App\Providers\RouteServiceProvider;
-use Illuminate\Foundation\Auth\EmailVerificationRequest;
-use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Password;
-use Illuminate\Support\Facades\Route;
-use Illuminate\Support\Str;
-use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
-use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
-use Laravel\Fortify\Fortify;
if (isDev()) {
Route::get('/dev/compose', Compose::class)->name('dev.compose');
}
-Route::get('/api/v1/test/realtime', function () {
- if (auth()->user()?->currentTeam()->id !== 0) {
- return redirect(RouteServiceProvider::HOME);
- }
- TestEvent::dispatch('asd');
- return 'Look at your other tab.';
-})->middleware('auth');
-
-
-Route::post('/forgot-password', function (Request $request) {
- if (is_transactional_emails_active()) {
- $arrayOfRequest = $request->only(Fortify::email());
- $request->merge([
- 'email' => Str::lower($arrayOfRequest['email']),
- ]);
- $type = set_transanctional_email_settings();
- if (!$type) {
- return response()->json(['message' => 'Transactional emails are not active'], 400);
- }
- $request->validate([Fortify::email() => 'required|email']);
- $status = Password::broker(config('fortify.passwords'))->sendResetLink(
- $request->only(Fortify::email())
- );
- if ($status == Password::RESET_LINK_SENT) {
- return app(SuccessfulPasswordResetLinkRequestResponse::class, ['status' => $status]);
- }
- if ($status == Password::RESET_THROTTLED) {
- return response('Already requested a password reset in the past minutes.', 400);
- }
- return app(FailedPasswordResetLinkRequestResponse::class, ['status' => $status]);
- }
- return response()->json(['message' => 'Transactional emails are not active'], 400);
-})->name('password.forgot');
-
-
+Route::post('/forgot-password', [Controller::class, 'forgot_password'])->name('password.forgot');
+Route::get('/api/v1/test/realtime', [Controller::class, 'realtime_test'])->middleware('auth');
Route::get('/waitlist', WaitlistIndex::class)->name('waitlist.index');
-
-Route::get('/verify', function () {
- return view('auth.verify-email');
-})->middleware('auth')->name('verify.email');
-
-Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {
- $request->fulfill();
- send_internal_notification("User {$request->user()->name} verified their email address.");
- return redirect(RouteServiceProvider::HOME);
-})->middleware(['auth'])->name('verify.verify');
-
+Route::get('/verify', [Controller::class, 'verify'])->middleware('auth')->name('verify.email');
+Route::get('/email/verify/{id}/{hash}', [Controller::class, 'email_verify'])->middleware(['auth'])->name('verify.verify');
Route::middleware(['throttle:login'])->group(function () {
Route::get('/auth/link', [Controller::class, 'link'])->name('auth.link');
});
+
Route::prefix('magic')->middleware(['auth'])->group(function () {
Route::get('/servers', [MagicController::class, 'servers']);
Route::get('/destinations', [MagicController::class, 'destinations']);
@@ -107,88 +91,90 @@ Route::prefix('magic')->middleware(['auth'])->group(function () {
});
Route::middleware(['auth', 'verified'])->group(function () {
- Route::get('/projects', [ProjectController::class, 'all'])->name('projects');
- Route::get('/project/{project_uuid}', [ProjectController::class, 'show'])->name('project.show');
- Route::get('/project/{project_uuid}/edit', [ProjectController::class, 'edit'])->name('project.edit');
- Route::get('/project/{project_uuid}/{environment_name}/clone', CloneProject::class)->name('project.clone');
-
- Route::get('/project/{project_uuid}/{environment_name}/new', [ProjectController::class, 'new'])->name('project.resources.new');
- Route::get('/project/{project_uuid}/{environment_name}', [ProjectController::class, 'resources'])->name('project.resources');
- Route::get('/project/{project_uuid}/{environment_name}/edit', EnvironmentEdit::class)->name('project.environment.edit');
-
- // Applications
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}', ApplicationConfiguration::class)->name('project.application.configuration');
-
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment', [ApplicationController::class, 'deployments'])->name('project.application.deployments');
- Route::get(
- '/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment/{deployment_uuid}',
- [ApplicationController::class, 'deployment']
- )->name('project.application.deployment');
-
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/logs', Logs::class)->name('project.application.logs');
- Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/command', ExecuteContainerCommand::class)->name('project.application.command');
-
- // Databases
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}', [DatabaseController::class, 'configuration'])->name('project.database.configuration');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/backups', [DatabaseController::class, 'backups'])->name('project.database.backups.all');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/backups/{backup_uuid}', [DatabaseController::class, 'executions'])->name('project.database.backups.executions');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/logs', Logs::class)->name('project.database.logs');
- Route::get('/project/{project_uuid}/{environment_name}/database/{database_uuid}/command', ExecuteContainerCommand::class)->name('project.database.command');
-
-
- // Services
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}', ServiceIndex::class)->name('project.service.configuration');
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/{service_name}', ServiceShow::class)->name('project.service.show');
- Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/command', ExecuteContainerCommand::class)->name('project.service.command');
-});
-
-Route::middleware(['auth'])->group(function () {
- Route::get('/servers', All::class)->name('server.all');
- Route::get('/server/new', Create::class)->name('server.create');
- Route::get('/server/{server_uuid}', Show::class)->name('server.show');
- Route::get('/server/{server_uuid}/proxy', ProxyShow::class)->name('server.proxy');
- Route::get('/server/{server_uuid}/proxy/logs', ProxyLogs::class)->name('server.proxy.logs');
- Route::get('/server/{server_uuid}/private-key', PrivateKeyShow::class)->name('server.private-key');
- Route::get('/server/{server_uuid}/destinations', DestinationShow::class)->name('server.destinations');
- Route::get('/server/{server_uuid}/log-drains', LogDrains::class)->name('server.log-drains');
-});
-
+ Route::middleware(['throttle:force-password-reset'])->group(function () {
+ Route::get('/force-password-reset', ForcePasswordReset::class)->name('auth.force-password-reset');
+ });
-Route::middleware(['auth', 'verified'])->group(function () {
Route::get('/', Dashboard::class)->name('dashboard');
Route::get('/boarding', BoardingIndex::class)->name('boarding');
- Route::middleware(['throttle:force-password-reset'])->group(function () {
- Route::get('/force-password-reset', [Controller::class, 'force_passoword_reset'])->name('auth.force-password-reset');
+
+ Route::get('/subscription', SubscriptionIndex::class)->name('subscription.index');
+
+ Route::get('/settings', SettingsIndex::class)->name('settings.index');
+ Route::get('/settings/license', SettingsLicense::class)->name('settings.license');
+
+ Route::get('/profile', ProfileIndex::class)->name('profile');
+
+ Route::prefix('team')->group(function () {
+ Route::get('/', TeamIndex::class)->name('team.index');
+ Route::get('/new', TeamCreate::class)->name('team.create');
+ Route::get('/members', TeamMemberIndex::class)->name('team.member.index');
+ Route::get('/notifications', TeamNotificationIndex::class)->name('team.notification.index');
+ Route::get('/storages', TeamStorageIndex::class)->name('team.storage.index');
+ Route::get('/storages/new', TeamStorageCreate::class)->name('team.storage.create');
+ Route::get('/storages/{storage_uuid}', TeamStorageShow::class)->name('team.storage.show');
});
- Route::get('/subscription', SubscriptionShow::class)->name('subscription.index');
- Route::get('/settings', [Controller::class, 'settings'])->name('settings.configuration');
- Route::get('/settings/license', [Controller::class, 'license'])->name('settings.license');
- Route::get('/profile', fn () => view('profile', ['request' => request()]))->name('profile');
- Route::get('/team', [Controller::class, 'team'])->name('team.index');
- Route::get('/team/new', fn () => view('team.create'))->name('team.create');
- Route::get('/team/notifications', fn () => view('team.notifications'))->name('team.notifications');
- Route::get('/team/storages', [Controller::class, 'storages'])->name('team.storages.all');
- Route::get('/team/storages/new', fn () => view('team.storages.create'))->name('team.storages.new');
- Route::get('/team/storages/{storage_uuid}', [Controller::class, 'storages_show'])->name('team.storages.show');
- Route::get('/team/members', [Controller::class, 'members'])->name('team.members');
- Route::get('/command-center', fn () => view('command-center', ['servers' => Server::isReachable()->get()]))->name('command-center');
- 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 () {
- Route::get('/security', fn () => view('security.index'))->name('security.index');
+ Route::get('/command-center', CommandCenterIndex::class)->name('command-center');
+
+ Route::prefix('invitations')->group(function () {
+ Route::get('/{uuid}', [Controller::class, 'accept_invitation'])->name('team.invitation.accept');
+ Route::get('/{uuid}/revoke', [Controller::class, 'revoke_invitation'])->name('team.invitation.revoke');
+ });
+
+ Route::get('/projects', ProjectIndex::class)->name('project.index');
+ Route::prefix('project/{project_uuid}')->group(function () {
+ Route::get('/', ProjectShow::class)->name('project.show');
+ Route::get('/edit', ProjectEdit::class)->name('project.edit');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}')->group(function () {
+ Route::get('/', ResourceIndex::class)->name('project.resource.index');
+ Route::get('/clone', ProjectCloneMe::class)->name('project.clone-me');
+ Route::get('/new', ResourceCreate::class)->name('project.resource.create');
+ Route::get('/edit', EnvironmentEdit::class)->name('project.environment.edit');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}/application/{application_uuid}')->group(function () {
+ Route::get('/', ApplicationConfiguration::class)->name('project.application.configuration');
+ Route::get('/deployment', DeploymentIndex::class)->name('project.application.deployment.index');
+ Route::get('/deployment/{deployment_uuid}', DeploymentShow::class)->name('project.application.deployment.show');
+ Route::get('/logs', Logs::class)->name('project.application.logs');
+ Route::get('/command', ExecuteContainerCommand::class)->name('project.application.command');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}/database/{database_uuid}')->group(function () {
+ Route::get('/', DatabaseConfiguration::class)->name('project.database.configuration');
+ Route::get('/logs', Logs::class)->name('project.database.logs');
+ Route::get('/command', ExecuteContainerCommand::class)->name('project.database.command');
+ Route::get('/backups', DatabaseBackupIndex::class)->name('project.database.backup.index');
+ Route::get('/backups/{backup_uuid}', DatabaseBackupExecution::class)->name('project.database.backup.execution');
+ });
+ Route::prefix('project/{project_uuid}/{environment_name}/service/{service_uuid}')->group(function () {
+ Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
+ Route::get('/{service_name}', ServiceIndex::class)->name('project.service.index');
+ Route::get('/command', ExecuteContainerCommand::class)->name('project.service.command');
+ });
+
+ Route::get('/servers', ServerIndex::class)->name('server.index');
+ Route::get('/server/new', ServerCreate::class)->name('server.create');
+
+ Route::prefix('server/{server_uuid}')->group(function () {
+ Route::get('/', ServerShow::class)->name('server.show');
+ Route::get('/proxy', ProxyShow::class)->name('server.proxy');
+ Route::get('/proxy/logs', ProxyLogs::class)->name('server.proxy.logs');
+ Route::get('/private-key', PrivateKeyShow::class)->name('server.private-key');
+ Route::get('/destinations', DestinationShow::class)->name('server.destinations');
+ Route::get('/log-drains', LogDrains::class)->name('server.log-drains');
+ });
+
+ // Route::get('/security', fn () => view('security.index'))->name('security.index');
Route::get('/security/private-key', fn () => view('security.private-key.index', [
'privateKeys' => PrivateKey::ownedByCurrentTeam(['name', 'uuid', 'is_git_related'])->get()
]))->name('security.private-key.index');
- Route::get('/security/private-key/new', fn () => view('security.private-key.new'))->name('security.private-key.new');
- Route::get('/security/private-key/{private_key_uuid}', fn () => view('security.private-key.show', [
- 'private_key' => PrivateKey::ownedByCurrentTeam(['name', 'description', 'private_key', 'is_git_related'])->whereUuid(request()->private_key_uuid)->firstOrFail()
- ]))->name('security.private-key.show');
+ Route::get('/security/private-key/new', SecurityPrivateKeyCreate::class)->name('security.private-key.create');
+ Route::get('/security/private-key/{private_key_uuid}', SecurityPrivateKeyShow::class)->name('security.private-key.show');
+
Route::get('/security/api-tokens', ApiTokens::class)->name('security.api-tokens');
});
-
Route::middleware(['auth'])->group(function () {
Route::get('/source/new', fn () => view('source.new'))->name('source.new');
Route::get('/sources', function () {