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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: add navbar for source + keys
Andras Bacsai3e3024d47e2d
diff --git a/app/Http/Livewire/PrivateKey/Change.php b/app/Http/Livewire/PrivateKey/Change.phpindex bd9332ca25..528c445066 100644--- a/app/Http/Livewire/PrivateKey/Change.php+++ b/app/Http/Livewire/PrivateKey/Change.php@@ -27,7 +27,7 @@ class Change extends Componentif ($this->private_key->isEmpty()) {$this->private_key->delete();currentTeam()->privateKeys = PrivateKey::where('team_id', currentTeam()->id)->get();- return redirect()->route('private-key.all');+ return redirect()->route('security.private-key.index');}$this->emit('error', 'This private key is in use and cannot be deleted. Please delete all servers, applications, and GitHub/GitLab apps that use this private key before deleting it.');} catch (\Exception $e) {diff --git a/resources/js/components/MagicBar.vue b/resources/js/components/MagicBar.vueindex 5719bc1d6e..8f052e96e6 100644--- a/resources/js/components/MagicBar.vue+++ b/resources/js/components/MagicBar.vue@@ -593,7 +593,7 @@ async function redirect() {targetUrl.pathname = `/source/new`break;case 7:- targetUrl.pathname = `/private-key/new`+ targetUrl.pathname = `/security/private-key/new`break;case 8:targetUrl.pathname = `/destination/new`@@ -612,7 +612,7 @@ async function redirect() {targetUrl.pathname = `/servers`break;case 13:- targetUrl.pathname = `/private-keys`+ targetUrl.pathname = `/security/private-key`break;case 14:targetUrl.pathname = `/projects`diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.phpindex 65cbc482ba..2b30acab14 100644--- a/resources/views/components/navbar.blade.php+++ b/resources/views/components/navbar.blade.php@@ -50,6 +50,23 @@</svg></a></li>+ <li title="Source">+ <a class="hover:bg-transparent" href="{{ route('source.all') }}">+ <svg class="icon" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg">+ <path fill="currentColor"+ d="m6.793 1.207l.353.354l-.353-.354ZM1.207 6.793l-.353-.354l.353.354Zm0 1.414l.354-.353l-.354.353Zm5.586 5.586l-.354.353l.354-.353Zm1.414 0l-.353-.354l.353.354Zm5.586-5.586l.353.354l-.353-.354Zm0-1.414l-.354.353l.354-.353ZM8.207 1.207l.354-.353l-.354.353ZM6.44.854L.854 6.439l.707.707l5.585-5.585L6.44.854ZM.854 8.56l5.585 5.585l.707-.707l-5.585-5.585l-.707.707Zm7.707 5.585l5.585-5.585l-.707-.707l-5.585 5.585l.707.707Zm5.585-7.707L8.561.854l-.707.707l5.585 5.585l.707-.707Zm0 2.122a1.5 1.5 0 0 0 0-2.122l-.707.707a.5.5 0 0 1 0 .708l.707.707ZM6.44 14.146a1.5 1.5 0 0 0 2.122 0l-.707-.707a.5.5 0 0 1-.708 0l-.707.707ZM.854 6.44a1.5 1.5 0 0 0 0 2.122l.707-.707a.5.5 0 0 1 0-.708L.854 6.44Zm6.292-4.878a.5.5 0 0 1 .708 0L8.56.854a1.5 1.5 0 0 0-2.122 0l.707.707Zm-2 1.293l1 1l.708-.708l-1-1l-.708.708ZM7.5 5a.5.5 0 0 1-.5-.5H6A1.5 1.5 0 0 0 7.5 6V5Zm.5-.5a.5.5 0 0 1-.5.5v1A1.5 1.5 0 0 0 9 4.5H8ZM7.5 4a.5.5 0 0 1 .5.5h1A1.5 1.5 0 0 0 7.5 3v1Zm0-1A1.5 1.5 0 0 0 6 4.5h1a.5.5 0 0 1 .5-.5V3Zm.646 2.854l1.5 1.5l.707-.708l-1.5-1.5l-.707.708ZM10.5 8a.5.5 0 0 1-.5-.5H9A1.5 1.5 0 0 0 10.5 9V8Zm.5-.5a.5.5 0 0 1-.5.5v1A1.5 1.5 0 0 0 12 7.5h-1Zm-.5-.5a.5.5 0 0 1 .5.5h1A1.5 1.5 0 0 0 10.5 6v1Zm0-1A1.5 1.5 0 0 0 9 7.5h1a.5.5 0 0 1 .5-.5V6ZM7 5.5v4h1v-4H7Zm.5 5.5a.5.5 0 0 1-.5-.5H6A1.5 1.5 0 0 0 7.5 12v-1Zm.5-.5a.5.5 0 0 1-.5.5v1A1.5 1.5 0 0 0 9 10.5H8Zm-.5-.5a.5.5 0 0 1 .5.5h1A1.5 1.5 0 0 0 7.5 9v1Zm0-1A1.5 1.5 0 0 0 6 10.5h1a.5.5 0 0 1 .5-.5V9Z" />+ </svg>+ </a>+ </li>+ <li title="Security">+ <a class="hover:bg-transparent" href="{{ route('security.private-key.index') }}">+ <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="m16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1-4.069 0l-.301-.301l-6.558 6.558a2 2 0 0 1-1.239.578L5.172 21H4a1 1 0 0 1-.993-.883L3 20v-1.172a2 2 0 0 1 .467-1.284l.119-.13L4 17h2v-2h2v-2l2.144-2.144l-.301-.301a2.877 2.877 0 0 1 0-4.069l2.643-2.643a2.877 2.877 0 0 1 4.069 0zM15 9h.01" />+ </svg>+ </a>+ </li><li title="Teams"><a class="hover:bg-transparent" href="{{ route('team.index') }}"><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"@@ -64,6 +81,7 @@</svg></a></li>+<div class="flex-1"></div>@if (isInstanceAdmin() && !isCloud())<livewire:upgrade />diff --git a/resources/views/components/security/navbar.blade.php b/resources/views/components/security/navbar.blade.phpnew file mode 100644index 0000000000..1d2296cc1e--- /dev/null+++ b/resources/views/components/security/navbar.blade.php@@ -0,0 +1,17 @@+<div class="pb-6">+ <h1>Security</h1>+ <nav class="flex pt-2 pb-10">+ <ol class="inline-flex items-center">+ <li>+ <div class="flex items-center">+ <span>Security related settings</span>+ </div>+ </li>+ </ol>+ </nav>+ <nav class="navbar-main">+ <a class="{{ request()->routeIs('security.private-key.index') ? 'text-white' : '' }}" href="{{ route('security.private-key.index') }}">+ <button>Private Keys</button>+ </a>+ </nav>+</div>diff --git a/resources/views/livewire/private-key/change.blade.php b/resources/views/livewire/private-key/change.blade.phpindex 26772c4250..7fe31776f7 100644--- a/resources/views/livewire/private-key/change.blade.php+++ b/resources/views/livewire/private-key/change.blade.php@@ -6,7 +6,7 @@</x-modal><form class="flex flex-col gap-2" wire:submit.prevent='changePrivateKey'><div class="flex items-end gap-2">- <h1>Private Key</h1>+ <h2>Private Key</h2><x-forms.button type="submit">Save</x-forms.button>@@ -16,7 +16,6 @@</x-forms.button>@endif</div>- <div class="pb-8">Private Key used for SSH connection</div><x-forms.input id="private_key.name" label="Name" required /><x-forms.input id="private_key.description" label="Description" /><div>diff --git a/resources/views/livewire/server/show-private-key.blade.php b/resources/views/livewire/server/show-private-key.blade.phpindex ae5877e97a..15aecb4f4d 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('private-key.new') }}">+ <a href="{{ route('security.private-key.new') }}"><x-forms.button>Add a new Private Key</x-forms.button></a><x-forms.button wire:click.prevent='checkConnection'>@@ -13,7 +13,7 @@@if (data_get($server, 'privateKey.uuid'))<div>Currently attached Private Key:- <a href="{{ route('private-key.show', ['private_key_uuid' => data_get($server, 'privateKey.uuid')]) }}">+ <a href="{{ route('security.private-key.show', ['private_key_uuid' => data_get($server, 'privateKey.uuid')]) }}"><button class="text-white btn-link">{{ data_get($server, 'privateKey.name') }}</button></a></div>diff --git a/resources/views/private-key/new.blade.php b/resources/views/private-key/new.blade.phpdeleted file mode 100644index 65f1633909..0000000000--- a/resources/views/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 for connection to servers.</div>- <livewire:private-key.create />-</x-layout>diff --git a/resources/views/security/index.blade.php b/resources/views/security/index.blade.phpnew file mode 100644index 0000000000..aed0712e1c--- /dev/null+++ b/resources/views/security/index.blade.php@@ -0,0 +1,9 @@+<x-layout>+ <x-security.navbar />+ <a class="text-center hover:no-underline group"+ href="{{ route('security.private-key.index')}}">+ <div class="group-hover:text-white">+ <div>Private Keys</div>+ </div>+ </a>+</x-layout>diff --git a/resources/views/private-key/all.blade.php b/resources/views/security/private-key/index.blade.phpsimilarity index 52%rename from resources/views/private-key/all.blade.phprename to resources/views/security/private-key/index.blade.phpindex 23cf45f9aa..207c6a2707 100644--- a/resources/views/private-key/all.blade.php+++ b/resources/views/security/private-key/index.blade.php@@ -1,10 +1,13 @@<x-layout>- <h1>Private Keys</h1>- <div class="subtitle ">All Private Keys</div>+ <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>+ </div><div class="grid gap-2 lg:grid-cols-2">@forelse ($privateKeys as $key)<a class="text-center hover:no-underline box group"- href="{{ route('private-key.show', ['private_key_uuid' => data_get($key, 'uuid')]) }}">+ href="{{ route('security.private-key.show', ['private_key_uuid' => data_get($key, 'uuid')]) }}"><div class="group-hover:text-white"><div>{{ $key->name }}</div></div>@@ -12,7 +15,7 @@@empty<div><div>No private keys found.</div>- <x-use-magic-bar link="/private-key/new" />+ <x-use-magic-bar link="/security/private-key/new" /></div>@endforelse</div>diff --git a/resources/views/security/private-key/new.blade.php b/resources/views/security/private-key/new.blade.phpnew file mode 100644index 0000000000..b5e59eea2f--- /dev/null+++ b/resources/views/security/private-key/new.blade.php@@ -0,0 +1,5 @@+<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/private-key/show.blade.php b/resources/views/security/private-key/show.blade.phpsimilarity index 76%rename from resources/views/private-key/show.blade.phprename to resources/views/security/private-key/show.blade.phpindex f3efc02a1d..82cf634f01 100644--- a/resources/views/private-key/show.blade.php+++ b/resources/views/security/private-key/show.blade.php@@ -1,3 +1,4 @@<x-layout>+ <x-security.navbar /><livewire:private-key.change :private_key="$private_key" /></x-layout>diff --git a/resources/views/team/index.blade.php b/resources/views/team/index.blade.phpindex 3bb81512b1..d0b2d0a65f 100644--- a/resources/views/team/index.blade.php+++ b/resources/views/team/index.blade.php@@ -1,7 +1,5 @@<x-layout>- <x-team.navbar :team="auth()- ->user()- ->currentTeam()" />+ <x-team.navbar /><livewire:team.form />@if (isCloud())<div class="pb-8">diff --git a/resources/views/team/members.blade.php b/resources/views/team/members.blade.phpindex 5366e61f49..9191d4c6b3 100644--- a/resources/views/team/members.blade.php+++ b/resources/views/team/members.blade.php@@ -1,7 +1,5 @@<x-layout>- <x-team.navbar :team="auth()- ->user()- ->currentTeam()" />+ <x-team.navbar /><h2>Members</h2><div class="pt-4 overflow-hidden"><table>diff --git a/resources/views/team/notifications.blade.php b/resources/views/team/notifications.blade.phpindex 4714c30a76..b766195b44 100644--- a/resources/views/team/notifications.blade.php+++ b/resources/views/team/notifications.blade.php@@ -1,7 +1,5 @@<x-layout>- <x-team.navbar :team="auth()- ->user()- ->currentTeam()" />+ <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"><div class="flex flex-col gap-4 min-w-fit">diff --git a/routes/web.php b/routes/web.phpindex f2e0935e67..6d96710af0 100644--- a/routes/web.php+++ b/routes/web.php@@ -121,13 +121,14 @@ Route::middleware(['auth'])->group(function () {});Route::middleware(['auth'])->group(function () {- Route::get('/private-keys', fn () => view('private-key.all', [+ 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'])->where('is_git_related', false)->get()- ]))->name('private-key.all');- Route::get('/private-key/new', fn () => view('private-key.new'))->name('private-key.new');- Route::get('/private-key/{private_key_uuid}', fn () => view('private-key.show', [+ ]))->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('private-key.show');+ ]))->name('security.private-key.show');});