fix: do not show system wide git on cloud
This commit is contained in:
		@@ -32,16 +32,19 @@ class Create extends Component
 | 
				
			|||||||
                "custom_port" => 'required|int',
 | 
					                "custom_port" => 'required|int',
 | 
				
			||||||
                "is_system_wide" => 'required|bool',
 | 
					                "is_system_wide" => 'required|bool',
 | 
				
			||||||
            ]);
 | 
					            ]);
 | 
				
			||||||
            $github_app = GithubApp::create([
 | 
					            $payload = [
 | 
				
			||||||
                'name' => $this->name,
 | 
					                'name' => $this->name,
 | 
				
			||||||
                'organization' => $this->organization,
 | 
					                'organization' => $this->organization,
 | 
				
			||||||
                'api_url' => $this->api_url,
 | 
					                'api_url' => $this->api_url,
 | 
				
			||||||
                'html_url' => $this->html_url,
 | 
					                'html_url' => $this->html_url,
 | 
				
			||||||
                'custom_user' => $this->custom_user,
 | 
					                'custom_user' => $this->custom_user,
 | 
				
			||||||
                'custom_port' => $this->custom_port,
 | 
					                'custom_port' => $this->custom_port,
 | 
				
			||||||
                'is_system_wide' => $this->is_system_wide,
 | 
					 | 
				
			||||||
                'team_id' => currentTeam()->id,
 | 
					                'team_id' => currentTeam()->id,
 | 
				
			||||||
            ]);
 | 
					            ];
 | 
				
			||||||
 | 
					            if (isCloud()) {
 | 
				
			||||||
 | 
					                $payload['is_system_wide'] = $this->is_system_wide;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            $github_app = GithubApp::create($payload);
 | 
				
			||||||
            if (session('from')) {
 | 
					            if (session('from')) {
 | 
				
			||||||
                session(['from' => session('from') + ['source_id' => $github_app->id]]);
 | 
					                session(['from' => session('from') + ['source_id' => $github_app->id]]);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -43,11 +43,13 @@
 | 
				
			|||||||
                    Install Repositories on GitHub
 | 
					                    Install Repositories on GitHub
 | 
				
			||||||
                </a>
 | 
					                </a>
 | 
				
			||||||
            @else
 | 
					            @else
 | 
				
			||||||
 | 
					                @if (!isCloud())
 | 
				
			||||||
                    <div class="w-48">
 | 
					                    <div class="w-48">
 | 
				
			||||||
                        <x-forms.checkbox label="System Wide?"
 | 
					                        <x-forms.checkbox label="System Wide?"
 | 
				
			||||||
                            helper="If checked, this GitHub App will be available for everyone in this Coolify instance."
 | 
					                            helper="If checked, this GitHub App will be available for everyone in this Coolify instance."
 | 
				
			||||||
                            instantSave id="is_system_wide" />
 | 
					                            instantSave id="is_system_wide" />
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
 | 
					                @endif
 | 
				
			||||||
                <div class="flex gap-2">
 | 
					                <div class="flex gap-2">
 | 
				
			||||||
                    <x-forms.input id="github_app.name" label="App Name" disabled />
 | 
					                    <x-forms.input id="github_app.name" label="App Name" disabled />
 | 
				
			||||||
                    <x-forms.input id="github_app.organization" label="Organization" disabled
 | 
					                    <x-forms.input id="github_app.organization" label="Organization" disabled
 | 
				
			||||||
@@ -76,7 +78,6 @@
 | 
				
			|||||||
                    <x-forms.input id="github_app.webhook_secret" label="Webhook Secret" type="password" />
 | 
					                    <x-forms.input id="github_app.webhook_secret" label="Webhook Secret" type="password" />
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            @endif
 | 
					            @endif
 | 
				
			||||||
 | 
					 | 
				
			||||||
        @else
 | 
					        @else
 | 
				
			||||||
            <div class="mb-10 rounded alert alert-warning">
 | 
					            <div class="mb-10 rounded alert alert-warning">
 | 
				
			||||||
                <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 stroke-current shrink-0" fill="none"
 | 
					                <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 stroke-current shrink-0" fill="none"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,8 +14,10 @@
 | 
				
			|||||||
            <x-forms.input id="custom_user" label="Custom Git User" required />
 | 
					            <x-forms.input id="custom_user" label="Custom Git User" required />
 | 
				
			||||||
            <x-forms.input id="custom_port" label="Custom Git Port" required />
 | 
					            <x-forms.input id="custom_port" label="Custom Git Port" required />
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					        @if (!isCloud())
 | 
				
			||||||
            <x-forms.checkbox class="pt-2" id="is_system_wide" label="System Wide" />
 | 
					            <x-forms.checkbox class="pt-2" id="is_system_wide" label="System Wide" />
 | 
				
			||||||
        <x-forms.button type="submit">
 | 
					        @endif
 | 
				
			||||||
 | 
					        <x-forms.button class="mt-4" type="submit">
 | 
				
			||||||
            Save New Source
 | 
					            Save New Source
 | 
				
			||||||
        </x-forms.button>
 | 
					        </x-forms.button>
 | 
				
			||||||
    </form>
 | 
					    </form>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
<x-layout>
 | 
					<x-layout>
 | 
				
			||||||
    <h1>New Source</h1>
 | 
					    <h1>New Source</h1>
 | 
				
			||||||
    <div class="subtitle ">Add source providers for your applications.</div>
 | 
					    <div class="subtitle ">Add source providers for your applications.</div>
 | 
				
			||||||
    <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : '' }">
 | 
					    <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'github' }">
 | 
				
			||||||
        <div class="flex justify-center h-full gap-2 pb-6">
 | 
					        {{-- <div class="flex justify-center h-full gap-2 pb-6">
 | 
				
			||||||
            <a class="flex items-center justify-center w-1/2 p-2 transition-colors rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white hover:no-underline"
 | 
					            <a class="flex items-center justify-center w-1/2 p-2 transition-colors rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white hover:no-underline"
 | 
				
			||||||
                :class="activeTab === 'github' && 'bg-coollabs text-white'"
 | 
					                :class="activeTab === 'github' && 'bg-coollabs text-white'"
 | 
				
			||||||
                @click.prevent="activeTab = 'github'; window.location.hash = 'github'" href="#">GitHub
 | 
					                @click.prevent="activeTab = 'github'; window.location.hash = 'github'" href="#">GitHub
 | 
				
			||||||
@@ -11,12 +11,12 @@
 | 
				
			|||||||
                :class="activeTab === 'gitlab' && 'bg-coollabs text-white'"
 | 
					                :class="activeTab === 'gitlab' && 'bg-coollabs text-white'"
 | 
				
			||||||
                @click.prevent="activeTab = 'gitlab'; window.location.hash = 'gitlab'" href="#">GitLab
 | 
					                @click.prevent="activeTab = 'gitlab'; window.location.hash = 'gitlab'" href="#">GitLab
 | 
				
			||||||
            </a>
 | 
					            </a>
 | 
				
			||||||
        </div>
 | 
					        </div> --}}
 | 
				
			||||||
        <div x-cloak x-show="activeTab === 'github'" class="h-full">
 | 
					        <div x-cloak x-show="activeTab === 'github'" class="h-full">
 | 
				
			||||||
            <livewire:source.github.create />
 | 
					            <livewire:source.github.create />
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div x-cloak x-show="activeTab === 'gitlab'" class="h-full">
 | 
					        {{-- <div x-cloak x-show="activeTab === 'gitlab'" class="h-full">
 | 
				
			||||||
            WIP
 | 
					            WIP
 | 
				
			||||||
        </div>
 | 
					        </div> --}}
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</x-layout>
 | 
					</x-layout>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user