This commit is contained in:
Andras Bacsai
2023-04-19 12:42:15 +02:00
parent d6c725ea83
commit d947175e4b
35 changed files with 333 additions and 112 deletions

View File

@@ -1 +1,2 @@
import './bootstrap';

View File

@@ -0,0 +1,7 @@
<x-layout>
<h1>{{ $title ?? 'NOT SET' }}</h1>
<x-applications.navbar :applicationId="$applicationId" />
<div>
{{ $slot }}
</div>
</x-layout>

View File

@@ -0,0 +1,5 @@
<nav class="flex gap-4 py-2 bg-gray-100">
<a href="{{ route('project.applications.configuration', Route::current()->parameters()) }}">Configuration</a>
<a href="{{ route('project.applications.deployments', Route::current()->parameters()) }}">Deployments</a>
<livewire:deploy-application :applicationId="$applicationId" />
</nav>

View File

@@ -1,6 +1,16 @@
<label for={{ $name }}>{{ $name }}</label>
<input id={{ $name }} wire:model={{ $name }} type="text" name={{ $name }}
{{ $required }} />
<label for={{ $name }}>
@if ($label)
{{ $label }}
@else
{{ $name }}
@endif
@if ($required)
*
@endif
</label>
<input id={{ $name }} wire:model.defer={{ $name }} type="text" name={{ $name }}
@if ($required) required @endif
@if ($readonly) readOnly=true disabled=true @endif />
@error($name)
<span class="text-red-500">{{ $message }}</span>
@enderror

View File

@@ -7,6 +7,8 @@
<title>{{ $title ?? 'Coolify' }}</title>
<meta name="csrf-token" content="{{ csrf_token() }}">
@vite(['resources/js/app.js', 'resources/css/app.css'])
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
<style>[x-cloak] { display: none !important; }</style>
@livewireStyles
</head>

View File

@@ -1,4 +1,4 @@
<nav>
<nav class="flex gap-2 ">
<div>v{{ config('coolify.version') }}</div>
@guest
<a href="/login">Login</a>
@@ -14,6 +14,6 @@
@csrf
<button type="submit">Logout</button>
</form>
<livewire:check-update>
{{-- <livewire:check-update> --}}
@endauth
</nav>

View File

@@ -1,12 +0,0 @@
<div>
<form wire:submit.prevent='submit' class="flex flex-col">
<x-input name="name" required="true" />
<x-input name="fqdn" />
<x-input name="git_repository" />
<x-input name="git_branch" />
<x-input name="git_commit_sha" />
<button type="submit">
Submit
</button>
</form>
</div>

View File

@@ -0,0 +1,3 @@
<div>
<p>{{$destination->name}}</p>
</div>

View File

@@ -0,0 +1,26 @@
<div>
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col xl:flex-row gap-2">
<div class="flex-col flex w-96">
<x-input name="application.name" label="Name" required />
<x-input name="application.fqdn" label="FQDN" />
</div>
<div class="flex-col flex w-96">
<x-input name="application.install_command" label="Install Command" />
<x-input name="application.build_command" label="Build Command" />
<x-input name="application.start_command" label="Start Command" />
<x-input name="application.build_pack" label="Build Pack" />
</div>
<div class="flex-col flex w-96">
<x-input name="application.base_directory" label="Base Directory" />
<x-input name="application.publish_directory" label="Publish Directory" />
<x-input name="application.destination.network" readonly label="Destination Network" />
</div>
</div>
<button class="flex mx-auto mt-4" type="submit">
Submit
</button>
</form>
</div>

View File

@@ -0,0 +1,3 @@
<div>
{{-- Nothing in the world is as soft and yielding as water. --}}
</div>

View File

@@ -0,0 +1,8 @@
<div>
<p>{{ $application->source->name }}</p>
<div class="flex-col flex w-96">
<x-input name="application.git_repository" label="Git Repository" readonly />
<x-input name="application.git_branch" label="Git Branch" readonly />
<x-input name="application.git_commit_sha" label="Git Commit SHA" readonly />
</div>
</div>

View File

@@ -5,5 +5,11 @@
<button wire:click='start'>Start</button>
@endif
<button wire:click='kill'>Kill</button>
<span wire:poll='pollingStatus'>status: {{ $application->status }}</span>
<span wire:poll='pollingStatus'>
@if ($application->status === 'running')
<span class="text-green-500">{{ $application->status }}</span>
@else
<span class="text-red-500">{{ $application->status }}</span>
@endif
</span>
</div>

View File

@@ -0,0 +1,6 @@
<div>
<a @if ($status === 'in_progress' || $status === 'holding') wire:poll='polling' @endif href="{{ url()->current() }}/{{ $deployment_uuid }}">
{{ $created_at }}
{{ $deployment_uuid }}</a>
{{ $status }}
</div>

View File

@@ -1,15 +0,0 @@
<x-layout>
<h1>Application</h1>
<livewire:deploy-application :applicationId="$application->id" />
<livewire:application-form :applicationId="$application->id" />
<div>
<h2>Deployments</h2>
@foreach ($deployments as $deployment)
<p>
<a href="{{ url()->current() }}/deployment/{{ data_get($deployment->properties, 'deployment_uuid') }}">
{{ data_get($deployment->properties, 'deployment_uuid') }}</a>
{{ data_get($deployment->properties, 'status') }}
</p>
@endforeach
</div>
</x-layout>

View File

@@ -0,0 +1,23 @@
<x-applications.layout :applicationId="$application->id" title="Configurations">
<div x-data="{ tab: window.location.hash ? window.location.hash.substring(1) : 'general' }">
<div class="flex gap-4">
<button @click.prevent="tab = 'general'; window.location.hash = 'general'" href="#">General</button>
<button @click.prevent="tab = 'secrets'; window.location.hash = 'secrets'" href="#">Secrets</button>
<button @click.prevent="tab = 'source'; window.location.hash = 'source'" href="#">Source</button>
<button @click.prevent="tab = 'destination'; window.location.hash = 'destination'" href="#">Destination
</button>
</div>
<div x-cloak x-show="tab === 'general'">
<livewire:application.general :applicationId="$application->id" />
</div>
<div x-cloak x-show="tab === 'secrets'">
<livewire:application.secrets :secrets="$application->id" />
</div>
<div x-cloak x-show="tab === 'source'">
<livewire:application.source :applicationId="$application->id" />
</div>
<div x-cloak x-show="tab === 'destination'">
<livewire:application.destination :destination="$application->destination->server" />
</div>
</div>
</x-applications.layout>

View File

@@ -0,0 +1,3 @@
<x-applications.layout :applicationId="$application->id" title="Deployment">
<livewire:poll-activity :activity="$activity" :deployment_uuid="$deployment_uuid" />
</x-applications.layout>

View File

@@ -0,0 +1,10 @@
<x-applications.layout :applicationId="$application->id" title="Deployments">
<div class="pt-2">
@forelse ($deployments as $deployment)
<livewire:poll-deployment :deployment_uuid="data_get($deployment->properties, 'deployment_uuid')" :created_at="data_get($deployment, 'created_at')" :status="data_get($deployment->properties, 'status')" />
@empty
<p>No deployments found.</p>
@endforelse
</div>
</x-applications.layout>

View File

@@ -1,4 +0,0 @@
<x-layout>
<h1>Deployment</h1>
<livewire:poll-activity :activity="$activity" :deployment_uuid="$deployment_uuid" />
</x-layout>

View File

@@ -3,7 +3,7 @@
<div>
@foreach ($environment->applications as $application)
<p>
<a href="{{ route('project.application', [$project->uuid, $environment->name, $application->uuid]) }}">
<a href="{{ route('project.applications.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">
{{ $application->name }}
</a>
</p>