From bba8b25b489ca07c684e5f084ec1ce316b4b091c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 9 May 2023 09:54:43 +0200 Subject: [PATCH] wip --- .env.development.example | 1 + .../Livewire/Project/Application/General.php | 1 + .../Project/New/PublicGitRepository.php | 1 + app/Http/Livewire/Settings/Form.php | 1 + app/Http/Livewire/Source/Github/Change.php | 1 + app/Models/GithubApp.php | 2 +- bootstrap/getVersion.php | 4 +- config/coolify.php | 2 +- config/version.php | 3 + .../components/applications/navbar.blade.php | 14 ++- resources/views/components/layout.blade.php | 4 + resources/views/components/navbar.blade.php | 2 +- .../project/application/general.blade.php | 9 +- resources/views/source/github/show.blade.php | 101 +++++++++--------- 14 files changed, 87 insertions(+), 59 deletions(-) create mode 100644 config/version.php diff --git a/.env.development.example b/.env.development.example index d37a25ea2..a2345b11a 100644 --- a/.env.development.example +++ b/.env.development.example @@ -6,6 +6,7 @@ USERID= GROUPID= PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify +SERVEO_URL= ############################################################################################################ APP_NAME=Coolify diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php index 9b40b4be3..a0236e3bc 100644 --- a/app/Http/Livewire/Project/Application/General.php +++ b/app/Http/Livewire/Project/Application/General.php @@ -57,6 +57,7 @@ public function instantSave() $this->application->settings->is_dual_cert = $this->is_dual_cert; $this->application->settings->save(); $this->application->refresh(); + $this->emit('saved', 'Application settings updated!'); } public function mount() { diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php index 6e2c1804d..22a0bca96 100644 --- a/app/Http/Livewire/Project/New/PublicGitRepository.php +++ b/app/Http/Livewire/Project/New/PublicGitRepository.php @@ -67,6 +67,7 @@ public function instantSave() $this->port = 3000; $this->publish_directory = null; } + $this->emit('saved', 'Application settings updated!'); } public function submit() diff --git a/app/Http/Livewire/Settings/Form.php b/app/Http/Livewire/Settings/Form.php index ec0b54d73..0c4dcf5a8 100644 --- a/app/Http/Livewire/Settings/Form.php +++ b/app/Http/Livewire/Settings/Form.php @@ -33,6 +33,7 @@ public function instantSave() $this->settings->is_registration_enabled = $this->is_registration_enabled; $this->settings->is_https_forced = $this->is_https_forced; $this->settings->save(); + $this->emit('saved', 'Settings updated!'); } public function submit() { diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php index 53d5f374c..430ea9999 100644 --- a/app/Http/Livewire/Source/Github/Change.php +++ b/app/Http/Livewire/Source/Github/Change.php @@ -44,6 +44,7 @@ public function instantSave() try { $this->github_app->is_system_wide = $this->is_system_wide; $this->github_app->save(); + $this->emit('saved', 'GitHub settings updated!'); } catch (\Exception $e) { return generalErrorHandlerLivewire($e, $this); } diff --git a/app/Models/GithubApp.php b/app/Models/GithubApp.php index e8f25a96a..918beb53d 100644 --- a/app/Models/GithubApp.php +++ b/app/Models/GithubApp.php @@ -22,6 +22,6 @@ static public function public() } static public function private() { - return GithubApp::where('team_id', session('currentTeam')->id)->where('is_public', false)->whereNotNull('app_id')->whereNotNull('installation_id')->get(); + return GithubApp::where('team_id', session('currentTeam')->id)->where('is_public', false)->get(); } } diff --git a/bootstrap/getVersion.php b/bootstrap/getVersion.php index 2a3654315..2653f6575 100644 --- a/bootstrap/getVersion.php +++ b/bootstrap/getVersion.php @@ -1,3 +1,3 @@ '4.0.0-nightly.2', + 'dev_webhook' => env('SERVEO_URL'), ]; diff --git a/config/version.php b/config/version.php new file mode 100644 index 000000000..d5300c6ea --- /dev/null +++ b/config/version.php @@ -0,0 +1,3 @@ + Open on Git ↗️ - + Configuration - + Deployments diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index cd9f8b532..05a45f111 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -79,6 +79,10 @@ function checkHealth() { Livewire.on('error', (message) => { console.log(message); }) + Livewire.on('saved', (message) => { + if (message) console.log(message); + else console.log('saved'); + }) @endauth diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index 7b6f91683..bacc0b37e 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -1,5 +1,5 @@