From 473bad24b78fe56f8aac732a13d75ee0f5ec15c6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 21 Mar 2024 14:30:35 +0100 Subject: [PATCH] ux ux ux ux ui ui ui ui --- app/Livewire/Dashboard.php | 3 + app/Livewire/Project/Edit.php | 3 +- app/Livewire/Security/PrivateKey/Create.php | 2 +- app/Livewire/Subscription/Index.php | 2 +- app/Livewire/SwitchTeam.php | 4 +- bootstrap/helpers/shared.php | 5 +- resources/css/app.css | 2 +- .../components/layout-subscription.blade.php | 1 - .../components/navbar-subscription.blade.php | 47 -- resources/views/components/navbar.blade.php | 408 +++++++++--------- .../components/notifications/navbar.blade.php | 27 +- .../components/security/navbar.blade.php | 6 +- .../views/components/server/navbar.blade.php | 2 +- .../views/components/team/navbar.blade.php | 23 +- resources/views/components/toast.blade.php | 48 ++- .../views/components/use-magic-bar.blade.php | 9 +- resources/views/layouts/app.blade.php | 4 +- resources/views/layouts/boarding.blade.php | 20 +- resources/views/layouts/simple.blade.php | 1 - .../views/layouts/subscription.blade.php | 18 - .../views/livewire/boarding/index.blade.php | 12 +- .../livewire/command-center/index.blade.php | 1 - resources/views/livewire/dashboard.blade.php | 68 ++- .../notifications/email-settings.blade.php | 3 +- .../livewire/project/add-empty.blade.php | 2 +- .../views/livewire/project/edit.blade.php | 19 +- .../views/livewire/project/index.blade.php | 21 +- .../livewire/project/new/select.blade.php | 6 +- .../livewire/security/api-tokens.blade.php | 1 - .../security/private-key/create.blade.php | 3 +- .../views/livewire/server/create.blade.php | 8 +- .../views/livewire/server/index.blade.php | 20 +- .../views/livewire/server/new/by-ip.blade.php | 1 - .../server/show-private-key.blade.php | 15 +- .../views/livewire/settings/email.blade.php | 11 - .../livewire/subscription/actions.blade.php | 4 +- .../livewire/subscription/index.blade.php | 15 +- .../livewire/subscription/show.blade.php | 6 +- .../views/livewire/switch-team.blade.php | 14 +- resources/views/livewire/tags/index.blade.php | 4 +- .../views/livewire/team/create.blade.php | 18 +- .../team/notification/index.blade.php | 1 - .../livewire/team/storage/create.blade.php | 1 - .../livewire/team/storage/index.blade.php | 17 +- .../security/private-key/index.blade.php | 14 +- resources/views/source/all.blade.php | 1 - routes/web.php | 9 +- 47 files changed, 449 insertions(+), 481 deletions(-) delete mode 100644 resources/views/components/layout-subscription.blade.php delete mode 100644 resources/views/components/navbar-subscription.blade.php delete mode 100644 resources/views/layouts/subscription.blade.php diff --git a/app/Livewire/Dashboard.php b/app/Livewire/Dashboard.php index 632f14d65..8a5d491e4 100644 --- a/app/Livewire/Dashboard.php +++ b/app/Livewire/Dashboard.php @@ -3,6 +3,7 @@ namespace App\Livewire; use App\Models\ApplicationDeploymentQueue; +use App\Models\PrivateKey; use App\Models\Project; use App\Models\Server; use Illuminate\Support\Collection; @@ -13,9 +14,11 @@ class Dashboard extends Component { public $projects = []; public Collection $servers; + public Collection $private_keys; public $deployments_per_server; public function mount() { + $this->private_keys = PrivateKey::ownedByCurrentTeam()->get(); $this->servers = Server::ownedByCurrentTeam()->get(); $this->projects = Project::ownedByCurrentTeam()->get(); $this->get_deployments(); diff --git a/app/Livewire/Project/Edit.php b/app/Livewire/Project/Edit.php index a80b1af76..17cb6902b 100644 --- a/app/Livewire/Project/Edit.php +++ b/app/Livewire/Project/Edit.php @@ -46,10 +46,11 @@ public function mount() public function submit() { - $this->validate(); try { + $this->validate(); $this->project->save(); $this->dispatch('saved'); + $this->dispatch('success', 'Project updated.'); } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/app/Livewire/Security/PrivateKey/Create.php b/app/Livewire/Security/PrivateKey/Create.php index 62d763601..cd1c06568 100644 --- a/app/Livewire/Security/PrivateKey/Create.php +++ b/app/Livewire/Security/PrivateKey/Create.php @@ -67,7 +67,7 @@ public function createPrivateKey() 'team_id' => currentTeam()->id ]); if ($this->from === 'server') { - return redirect()->route('server.create'); + return redirect()->route('dashboard'); } return redirect()->route('security.private-key.show', ['private_key_uuid' => $private_key->uuid]); } catch (\Throwable $e) { diff --git a/app/Livewire/Subscription/Index.php b/app/Livewire/Subscription/Index.php index 4f36750c7..c87f7d0b6 100644 --- a/app/Livewire/Subscription/Index.php +++ b/app/Livewire/Subscription/Index.php @@ -31,6 +31,6 @@ public function stripeCustomerPortal() } public function render() { - return view('livewire.subscription.index')->layout('layouts.subscription'); + return view('livewire.subscription.index'); } } diff --git a/app/Livewire/SwitchTeam.php b/app/Livewire/SwitchTeam.php index 845619820..49b73cdc6 100644 --- a/app/Livewire/SwitchTeam.php +++ b/app/Livewire/SwitchTeam.php @@ -8,7 +8,9 @@ class SwitchTeam extends Component { public string $selectedTeamId = 'default'; - + public function mount() { + $this->selectedTeamId = auth()->user()->currentTeam()->id; + } public function updatedSelectedTeamId() { $this->switch_to($this->selectedTeamId); diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 7810e0155..2645a6a22 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -280,6 +280,10 @@ function base_url(bool $withPort = true): string return url('/'); } +function isSubscribed() +{ + return auth()->user()->currentTeam()->subscription()->exists() || auth()->user()->isInstanceAdmin(); +} function isDev(): bool { return config('app.env') === 'local'; @@ -1282,7 +1286,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal $volume = str("$name:$mount"); } } - } else if (is_array($volume)) { $source = data_get($volume, 'source'); $target = data_get($volume, 'target'); diff --git a/resources/css/app.css b/resources/css/app.css index f76067b51..a3fc32386 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -152,7 +152,7 @@ .custom-modal { } .navbar-main { - @apply flex items-end gap-6 py-2 border-b-2 border-solid border-coolgray-200; + @apply flex items-end gap-6 pb-2 border-b-2 border-solid border-coolgray-200; } .loading { diff --git a/resources/views/components/layout-subscription.blade.php b/resources/views/components/layout-subscription.blade.php deleted file mode 100644 index 5fdd838af..000000000 --- a/resources/views/components/layout-subscription.blade.php +++ /dev/null @@ -1 +0,0 @@ -@extends('layouts.subscription') diff --git a/resources/views/components/navbar-subscription.blade.php b/resources/views/components/navbar-subscription.blade.php deleted file mode 100644 index f1f68b50e..000000000 --- a/resources/views/components/navbar-subscription.blade.php +++ /dev/null @@ -1,47 +0,0 @@ -@auth - -@endauth diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index ee856d2ab..f0e4588e6 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -4,225 +4,237 @@
Coolify
- + {{-- --}} + +
+