diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php index 7cf1ed538..53d5f374c 100644 --- a/app/Http/Livewire/Source/Github/Change.php +++ b/app/Http/Livewire/Source/Github/Change.php @@ -55,7 +55,6 @@ public function mount() $this->host = $settings->fqdn; } $this->parameters = getParameters(); - $this->github_app = GithubApp::where('uuid', $this->parameters['github_app_uuid'])->first(); $this->is_system_wide = $this->github_app->is_system_wide; } public function createGithubApp() diff --git a/app/Models/GithubApp.php b/app/Models/GithubApp.php index 918beb53d..e8f25a96a 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)->get(); + return GithubApp::where('team_id', session('currentTeam')->id)->where('is_public', false)->whereNotNull('app_id')->whereNotNull('installation_id')->get(); } } diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 8e6787fbe..cd9f8b532 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -21,6 +21,8 @@ + @livewireScripts + @auth @endauth @@ -28,7 +30,6 @@ {{ $slot }} - @livewireScripts @auth @endauth + diff --git a/resources/views/livewire/source/github/change.blade.php b/resources/views/livewire/source/github/change.blade.php index 2d50714fe..652efd8f3 100644 --- a/resources/views/livewire/source/github/change.blade.php +++ b/resources/views/livewire/source/github/change.blade.php @@ -23,22 +23,9 @@ @else
Save -
@endif -
- - - - + + diff --git a/resources/views/source/github/show.blade.php b/resources/views/source/github/show.blade.php index 0af07010f..7c6e8d992 100644 --- a/resources/views/source/github/show.blade.php +++ b/resources/views/source/github/show.blade.php @@ -1,4 +1,53 @@

GitHub App

- + +
+ Create GitHub Application +
+
diff --git a/routes/web.php b/routes/web.php index 6909cd74d..bc697d1aa 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,6 +13,7 @@ use App\Models\Server; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; +use Illuminate\Support\Str; /* |-------------------------------------------------------------------------- @@ -84,7 +85,17 @@ Route::middleware(['auth'])->group(function () { Route::get('/source/new', fn () => view('source.new'))->name('source.new'); Route::get('/source/github/{github_app_uuid}', function (Request $request) { - return view('source.github.show', ['host' => $request->schemeAndHttpHost()]); + $settings = InstanceSettings::first(); + $host = $request->schemeAndHttpHost(); + if ($settings->fqdn) { + $host = $settings->fqdn; + } + $github_app = GithubApp::where('uuid', request()->github_app_uuid)->first(); + return view('source.github.show', [ + 'github_app' => $github_app, + 'host' => $host, + 'name' => Str::kebab('coolify' . $github_app->name) + ]); })->name('source.github.show'); }); Route::middleware(['auth'])->group(function () {