This commit is contained in:
Andras Bacsai
2023-05-31 22:23:17 +02:00
parent eae167f8bd
commit 7341e2586d
10 changed files with 60 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\Http\Livewire\Source; namespace App\Http\Livewire\Source\Github;
use App\Models\GithubApp; use App\Models\GithubApp;
use Livewire\Component; use Livewire\Component;

View File

@@ -65,7 +65,7 @@ a {
} }
.main-navbar { .main-navbar {
@apply fixed top-0 left-0 min-h-screen overflow-hidden; @apply fixed h-full overflow-hidden;
} }
.icon { .icon {
@apply w-6 h-6; @apply w-6 h-6;

View File

@@ -49,8 +49,7 @@
</svg> </svg>
</a> </a>
</li> </li>
<li class="{{ request()->is('settings') ? 'absolute bottom-0 pb-4 text-warning' : 'absolute bottom-0 pb-4' }}" <li class="{{ request()->is('settings') ? 'text-warning' : ' ' }}" title="Settings">
title="Settings">
<a @if (!request()->is('settings')) href="/settings" @endif> <a @if (!request()->is('settings')) href="/settings" @endif>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
@@ -64,7 +63,7 @@
@endif @endif
</ul> </ul>
</nav> </nav>
<div class="absolute top-0 right-0 p-2"> <div class="fixed top-0 right-0 p-2">
<div class="dropdown dropdown-left dropdown-hover"> <div class="dropdown dropdown-left dropdown-hover">
<label tabindex="0" class="btn btn-ghost no-animation hover:bg-transparent hover:text-warning"> <label tabindex="0" class="btn btn-ghost no-animation hover:bg-transparent hover:text-warning">
<div class="flex items-center justify-center gap-2 placeholder"> <div class="flex items-center justify-center gap-2 placeholder">

View File

@@ -1,5 +1,5 @@
<div> <div>
<h1 class="pb-0">Command Center</h1> <h1 class="pb-2">Command Center</h1>
<div class="pb-4 text-sm">Outputs are not saved at the moment, only available until you refresh or navigate.</div> <div class="pb-4 text-sm">Outputs are not saved at the moment, only available until you refresh or navigate.</div>
<form class="flex items-end justify-center gap-2" wire:submit.prevent='runCommand'> <form class="flex items-end justify-center gap-2" wire:submit.prevent='runCommand'>
<x-forms.input placeholder="ls -l" autofocus noDirty id="command" label="Command" required /> <x-forms.input placeholder="ls -l" autofocus noDirty id="command" label="Command" required />

View File

@@ -1,11 +1,13 @@
<div> <div>
<form wire:submit.prevent='submit' class="flex flex-col"> <form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex items-center gap-2 border-b-2 border-solid border-coolgray-200"> <div class="flex gap-2">
<h1>Settings</h1> <h1 class="pb-2">Settings</h1>
<x-forms.button type="submit"> <x-forms.button type="submit">
Save Save
</x-forms.button> </x-forms.button>
</div> </div>
<div class="pb-4 text-sm">Instance wide settings for Coolify.
</div>
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<div class="flex gap-2"> <div class="flex gap-2">
<x-forms.input id="settings.fqdn" label="Coolify's Domain" /> <x-forms.input id="settings.fqdn" label="Coolify's Domain" />
@@ -22,13 +24,12 @@
</form> </form>
<h3>Advanced</h3> <h3>Advanced</h3>
<div class="flex flex-col pt-4 text-right w-52"> <div class="flex flex-col text-right w-52">
<x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Coolify" /> <x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Coolify" />
<x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" /> <x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
{{-- <x-forms.checkbox instantSave id="is_https_forced" label="Force https?" /> --}} {{-- <x-forms.checkbox instantSave id="is_https_forced" label="Force https?" /> --}}
<x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" /> <x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
</div> </div>
<h3>Upgrade</h3>
@if (auth()->user()->isPartOfRootTeam()) @if (auth()->user()->isPartOfRootTeam())
<livewire:force-upgrade /> <livewire:force-upgrade />
@endif @endif

View File

@@ -25,14 +25,20 @@
<x-forms.button x-on:click.prevent="deleteSource = true"> <x-forms.button x-on:click.prevent="deleteSource = true">
Delete Delete
</x-forms.button> </x-forms.button>
<form x-data>
<x-forms.button isHighlighted x-on:click.prevent="createGithubApp">Create GitHub Application
</x-forms.button>
</form>
@endif @endif
</div> </div>
</div> </div>
@if (!$github_app->app_id)
<div class="pb-4">
<div class="text-sm">You need to register a GitHub App before using this source!</div>
<form>
<x-forms.button isHighlighted x-on:click.prevent="createGithubApp">Register a GitHub
Application
</x-forms.button>
</form>
</div>
@endif
<x-forms.input id="github_app.name" label="App Name" required /> <x-forms.input id="github_app.name" label="App Name" required />
@if ($github_app->app_id) @if ($github_app->app_id)
@@ -41,10 +47,15 @@
@else @else
<x-forms.input id="github_app.organization" label="Organization" placeholder="Personal user if empty" /> <x-forms.input id="github_app.organization" label="Organization" placeholder="Personal user if empty" />
@endif @endif
<x-forms.input id="github_app.api_url" label="API Url" disabled />
<x-forms.input id="github_app.html_url" label="HTML Url" disabled /> <x-forms.input id="github_app.html_url" label="HTML Url" disabled />
<x-forms.input id="github_app.api_url" label="API Url" disabled />
@if ($github_app->html_url === 'https://github.com')
<x-forms.input id="github_app.custom_user" label="User" disabled />
<x-forms.input type="number" id="github_app.custom_port" label="Port" disabled />
@else
<x-forms.input id="github_app.custom_user" label="User" required /> <x-forms.input id="github_app.custom_user" label="User" required />
<x-forms.input type="number" id="github_app.custom_port" label="Port" required /> <x-forms.input type="number" id="github_app.custom_port" label="Port" required />
@endif
@if ($github_app->app_id) @if ($github_app->app_id)
<x-forms.input type="number" id="github_app.app_id" label="App Id" disabled /> <x-forms.input type="number" id="github_app.app_id" label="App Id" disabled />

View File

@@ -1,11 +1,13 @@
<div> <div>
<form wire:submit.prevent='createGitHubApp'> <form wire:submit.prevent='createGitHubApp'>
<div class="flex items-start gap-2 pt-6">
<h2 class="">General</h2>
<x-forms.button type="submit"> <x-forms.button type="submit">
Submit Save
</x-forms.button> </x-forms.button>
<h3 class="pt-4">General</h3> </div>
<x-forms.input id="name" label="Name" required /> <x-forms.input id="name" label="Name" required />
<x-forms.input helper="If empty, your user will be used." id="organization" label="Organization" /> <x-forms.input helper="If empty, your GitHub user will be used." id="organization" label="Organization" />
<h3 class="pt-4">Advanced</h3> <h3 class="pt-4">Advanced</h3>
<x-forms.input id="html_url" label="HTML Url" required /> <x-forms.input id="html_url" label="HTML Url" required />
<x-forms.input id="api_url" label="API Url" required /> <x-forms.input id="api_url" label="API Url" required />

View File

@@ -1,6 +1,6 @@
<x-layout> <x-layout>
<h1 class="pb-0">Server</h1> <h1 class="pb-0">Server</h1>
<div class="text-sm border-b-2 border-solid breadcrumbs border-coolgray-200"> <div class="text-sm breadcrumbs">
<ul> <ul>
<li>{{ data_get($server, 'name') }}</li> <li>{{ data_get($server, 'name') }}</li>
</ul> </ul>

View File

@@ -0,0 +1,4 @@
<x-layout>
<h1>New GitHub Source</h1>
</x-layout>

View File

@@ -1,4 +1,21 @@
<x-layout> <x-layout>
<h1>New Git App</h1> <h1>New Source</h1>
<livewire:source.create /> <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : '' }">
<div class="flex justify-center h-full gap-2">
<a class="flex items-center justify-center w-1/2 p-2 text-sm 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'"
@click.prevent="activeTab = 'github'; window.location.hash = 'github'" href="#">GitHub
</a>
<a class="flex items-center justify-center w-1/2 p-2 text-sm transition-colors rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white hover:no-underline"
:class="activeTab === 'gitlab' && 'bg-coollabs text-white'"
@click.prevent="activeTab = 'gitlab'; window.location.hash = 'gitlab'" href="#">GitLab
</a>
</div>
<div x-cloak x-show="activeTab === 'github'" class="h-full">
<livewire:source.github.create />
</div>
<div x-cloak x-show="activeTab === 'gitlab'" class="h-full">
GitLab here
</div>
</div>
</x-layout> </x-layout>