wip
This commit is contained in:
67
app/Http/Controllers/ApplicationController.php
Normal file
67
app/Http/Controllers/ApplicationController.php
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Spatie\Activitylog\Models\Activity;
|
||||||
|
|
||||||
|
class ApplicationController extends Controller
|
||||||
|
{
|
||||||
|
public function configuration()
|
||||||
|
{
|
||||||
|
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||||
|
if (!$project) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
||||||
|
if (!$environment) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
|
||||||
|
if (!$application) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
return view('project.applications.configuration', ['application' => $application]);
|
||||||
|
}
|
||||||
|
public function deployments()
|
||||||
|
{
|
||||||
|
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||||
|
if (!$project) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
||||||
|
if (!$environment) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
|
||||||
|
if (!$application) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
return view('project.applications.deployments', ['application' => $application, 'deployments' => $application->deployments()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deployment()
|
||||||
|
{
|
||||||
|
$deployment_uuid = request()->route('deployment_uuid');
|
||||||
|
|
||||||
|
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||||
|
if (!$project) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
||||||
|
if (!$environment) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
|
||||||
|
if (!$application) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$activity = Activity::where('properties->deployment_uuid', '=', $deployment_uuid)->first();
|
||||||
|
|
||||||
|
return view('project.applications.deployment', [
|
||||||
|
'application' => $application,
|
||||||
|
'activity' => $activity,
|
||||||
|
'deployment_uuid' => $deployment_uuid,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@@ -29,7 +29,7 @@ class ProjectController extends Controller
|
|||||||
return view('project.resources', ['project' => $project, 'environment' => $environment]);
|
return view('project.resources', ['project' => $project, 'environment' => $environment]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function application()
|
public function application_configuration()
|
||||||
{
|
{
|
||||||
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||||
if (!$project) {
|
if (!$project) {
|
||||||
@@ -43,10 +43,26 @@ class ProjectController extends Controller
|
|||||||
if (!$application) {
|
if (!$application) {
|
||||||
return redirect()->route('home');
|
return redirect()->route('home');
|
||||||
}
|
}
|
||||||
return view('project.application', ['application' => $application, 'deployments' => $application->deployments()]);
|
return view('project.applications.configuration', ['application' => $application]);
|
||||||
|
}
|
||||||
|
public function application_deployments()
|
||||||
|
{
|
||||||
|
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||||
|
if (!$project) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
|
||||||
|
if (!$environment) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
|
||||||
|
if (!$application) {
|
||||||
|
return redirect()->route('home');
|
||||||
|
}
|
||||||
|
return view('project.applications.deployments', ['application' => $application, 'deployments' => $application->deployments()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deployment()
|
public function application_deployment()
|
||||||
{
|
{
|
||||||
$deployment_uuid = request()->route('deployment_uuid');
|
$deployment_uuid = request()->route('deployment_uuid');
|
||||||
|
|
||||||
@@ -64,7 +80,8 @@ class ProjectController extends Controller
|
|||||||
}
|
}
|
||||||
$activity = Activity::where('properties->deployment_uuid', '=', $deployment_uuid)->first();
|
$activity = Activity::where('properties->deployment_uuid', '=', $deployment_uuid)->first();
|
||||||
|
|
||||||
return view('project.deployment', [
|
return view('project.applications.deployment', [
|
||||||
|
'application' => $application,
|
||||||
'activity' => $activity,
|
'activity' => $activity,
|
||||||
'deployment_uuid' => $deployment_uuid,
|
'deployment_uuid' => $deployment_uuid,
|
||||||
]);
|
]);
|
||||||
|
10
app/Http/Livewire/Application/Destination.php
Normal file
10
app/Http/Livewire/Application/Destination.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\Application;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class Destination extends Component
|
||||||
|
{
|
||||||
|
public $destination;
|
||||||
|
}
|
42
app/Http/Livewire/Application/General.php
Normal file
42
app/Http/Livewire/Application/General.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\Application;
|
||||||
|
|
||||||
|
use App\Models\Application;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class General extends Component
|
||||||
|
{
|
||||||
|
public string $applicationId;
|
||||||
|
|
||||||
|
public Application $application;
|
||||||
|
public string $name;
|
||||||
|
public string|null $fqdn;
|
||||||
|
public string $git_repository;
|
||||||
|
public string $git_branch;
|
||||||
|
public string|null $git_commit_sha;
|
||||||
|
public string $build_pack;
|
||||||
|
|
||||||
|
protected $rules = [
|
||||||
|
'application.name' => 'required|min:6',
|
||||||
|
'application.fqdn' => 'nullable',
|
||||||
|
'application.git_repository' => 'required',
|
||||||
|
'application.git_branch' => 'required',
|
||||||
|
'application.git_commit_sha' => 'nullable',
|
||||||
|
'application.build_pack' => 'required',
|
||||||
|
'application.base_directory' => 'required',
|
||||||
|
'application.publish_directory' => 'nullable',
|
||||||
|
'application.environment.name' => 'required',
|
||||||
|
'application.destination.network' => 'required',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->application = Application::find($this->applicationId)->with('destination')->first();
|
||||||
|
}
|
||||||
|
public function submit()
|
||||||
|
{
|
||||||
|
$this->validate();
|
||||||
|
$this->application->save();
|
||||||
|
}
|
||||||
|
}
|
13
app/Http/Livewire/Application/Secrets.php
Normal file
13
app/Http/Livewire/Application/Secrets.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\Application;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class Secrets extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.application.secrets');
|
||||||
|
}
|
||||||
|
}
|
22
app/Http/Livewire/Application/Source.php
Normal file
22
app/Http/Livewire/Application/Source.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\Application;
|
||||||
|
|
||||||
|
use App\Models\Application;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class Source extends Component
|
||||||
|
{
|
||||||
|
public $applicationId;
|
||||||
|
public Application $application;
|
||||||
|
|
||||||
|
protected $rules = [
|
||||||
|
'application.git_repository' => 'required',
|
||||||
|
'application.git_branch' => 'required',
|
||||||
|
'application.git_commit_sha' => 'nullable',
|
||||||
|
];
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->application = Application::find($this->applicationId)->first();
|
||||||
|
}
|
||||||
|
}
|
@@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Livewire;
|
|
||||||
|
|
||||||
use App\Models\Application;
|
|
||||||
use Livewire\Component;
|
|
||||||
|
|
||||||
class ApplicationForm extends Component
|
|
||||||
{
|
|
||||||
protected Application $application;
|
|
||||||
public string $applicationId;
|
|
||||||
public string $name;
|
|
||||||
public string|null $fqdn;
|
|
||||||
public string $git_repository;
|
|
||||||
public string $git_branch;
|
|
||||||
public string|null $git_commit_sha;
|
|
||||||
|
|
||||||
protected $rules = [
|
|
||||||
'name' => 'required|min:6'
|
|
||||||
];
|
|
||||||
public function mount()
|
|
||||||
{
|
|
||||||
$this->application = Application::find($this->applicationId);
|
|
||||||
$this->fill([
|
|
||||||
'name' => $this->application->name,
|
|
||||||
'fqdn' => $this->application->fqdn,
|
|
||||||
'git_repository' => $this->application->git_repository,
|
|
||||||
'git_branch' => $this->application->git_branch,
|
|
||||||
'git_commit_sha' => $this->application->git_commit_sha,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
public function submit()
|
|
||||||
{
|
|
||||||
$this->validate();
|
|
||||||
dd($this->name);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -22,8 +22,4 @@ class CheckUpdate extends Component
|
|||||||
$this->currentVersion = config('coolify.version');
|
$this->currentVersion = config('coolify.version');
|
||||||
version_compare($this->currentVersion, $this->latestVersion, '<') ? $this->updateAvailable = true : $this->updateAvailable = false;
|
version_compare($this->currentVersion, $this->latestVersion, '<') ? $this->updateAvailable = true : $this->updateAvailable = false;
|
||||||
}
|
}
|
||||||
public function render()
|
|
||||||
{
|
|
||||||
return view('livewire.check-update');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ namespace App\Http\Livewire;
|
|||||||
|
|
||||||
use App\Jobs\DeployApplicationJob;
|
use App\Jobs\DeployApplicationJob;
|
||||||
use App\Models\Application;
|
use App\Models\Application;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Visus\Cuid2\Cuid2;
|
use Visus\Cuid2\Cuid2;
|
||||||
|
|
||||||
@@ -14,36 +15,31 @@ class DeployApplication extends Component
|
|||||||
public $status;
|
public $status;
|
||||||
public Application $application;
|
public Application $application;
|
||||||
public $destination;
|
public $destination;
|
||||||
|
public array $parameters;
|
||||||
|
|
||||||
protected string $deployment_uuid;
|
protected string $deployment_uuid;
|
||||||
protected array $command = [];
|
protected array $command = [];
|
||||||
protected $source;
|
protected $source;
|
||||||
|
|
||||||
public function mount($applicationId)
|
public function mount()
|
||||||
{
|
{
|
||||||
$this->application = Application::find($applicationId)->first();
|
$this->parameters = Route::current()->parameters();
|
||||||
|
$this->application = Application::find($this->applicationId)->first();
|
||||||
$this->destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();
|
$this->destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
|
||||||
{
|
|
||||||
return view('livewire.deploy-application');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function start()
|
public function start()
|
||||||
{
|
{
|
||||||
// Create Deployment ID
|
// Create Deployment ID
|
||||||
$this->deployment_uuid = new Cuid2(7);
|
$this->deployment_uuid = new Cuid2(7);
|
||||||
|
$this->parameters['deployment_uuid'] = $this->deployment_uuid;
|
||||||
|
|
||||||
dispatch(new DeployApplicationJob(
|
dispatch(new DeployApplicationJob(
|
||||||
deployment_uuid: $this->deployment_uuid,
|
deployment_uuid: $this->deployment_uuid,
|
||||||
application_uuid: $this->application->uuid,
|
application_uuid: $this->application->uuid,
|
||||||
));
|
));
|
||||||
|
|
||||||
$currentUrl = url()->previous();
|
return redirect()->route('project.applications.deployment', $this->parameters);
|
||||||
$deploymentUrl = "$currentUrl/deployment/$this->deployment_uuid";
|
|
||||||
return redirect($deploymentUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stop()
|
public function stop()
|
||||||
|
@@ -24,9 +24,4 @@ class PollActivity extends Component
|
|||||||
$this->isKeepAliveOn = false;
|
$this->isKeepAliveOn = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
|
||||||
{
|
|
||||||
return view('livewire.poll-activity');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
19
app/Http/Livewire/PollDeployment.php
Normal file
19
app/Http/Livewire/PollDeployment.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use Spatie\Activitylog\Models\Activity;
|
||||||
|
|
||||||
|
class PollDeployment extends Component
|
||||||
|
{
|
||||||
|
public string $deployment_uuid;
|
||||||
|
public string $created_at;
|
||||||
|
public string $status;
|
||||||
|
public function polling()
|
||||||
|
{
|
||||||
|
$activity = Activity::where('properties->deployment_uuid', '=', $this->deployment_uuid)->first();
|
||||||
|
$this->created_at = $activity->created_at;
|
||||||
|
$this->status = data_get($activity, 'properties.status');
|
||||||
|
}
|
||||||
|
}
|
@@ -27,10 +27,6 @@ class RunCommand extends Component
|
|||||||
$this->servers = Server::all();
|
$this->servers = Server::all();
|
||||||
$this->server = $this->servers[0]->uuid;
|
$this->server = $this->servers[0]->uuid;
|
||||||
}
|
}
|
||||||
public function render()
|
|
||||||
{
|
|
||||||
return view('livewire.run-command');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function runCommand()
|
public function runCommand()
|
||||||
{
|
{
|
||||||
|
@@ -19,8 +19,4 @@ class SwitchTeam extends Component
|
|||||||
session(['currentTeam' => $team_to_switch_to]);
|
session(['currentTeam' => $team_to_switch_to]);
|
||||||
return redirect(request()->header('Referer'));
|
return redirect(request()->header('Referer'));
|
||||||
}
|
}
|
||||||
public function render()
|
|
||||||
{
|
|
||||||
return view('livewire.switch-team');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -124,7 +124,7 @@ class DeployApplicationJob implements ShouldQueue
|
|||||||
$image = explode(':', str_replace('"', '', $image))[1];
|
$image = explode(':', str_replace('"', '', $image))[1];
|
||||||
if ($image == $this->git_commit) {
|
if ($image == $this->git_commit) {
|
||||||
$this->executeNow([
|
$this->executeNow([
|
||||||
"echo 'Application found locally with the same Git Commit SHA. Starting it...'"
|
"echo -n 'Application found locally with the same Git Commit SHA. Starting it... '"
|
||||||
]);
|
]);
|
||||||
$this->executeNow([
|
$this->executeNow([
|
||||||
"docker start {$this->application->uuid}"
|
"docker start {$this->application->uuid}"
|
||||||
|
@@ -11,8 +11,12 @@ class Input extends Component
|
|||||||
/**
|
/**
|
||||||
* Create a new component instance.
|
* Create a new component instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(public string $name, public bool $required = false)
|
public function __construct(
|
||||||
{
|
public string $name,
|
||||||
|
public bool $required = false,
|
||||||
|
public bool $readonly = false,
|
||||||
|
public string|null $label = null,
|
||||||
|
) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
import './bootstrap';
|
import './bootstrap';
|
||||||
|
|
||||||
|
7
resources/views/components/applications/layout.blade.php
Normal file
7
resources/views/components/applications/layout.blade.php
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<x-layout>
|
||||||
|
<h1>{{ $title ?? 'NOT SET' }}</h1>
|
||||||
|
<x-applications.navbar :applicationId="$applicationId" />
|
||||||
|
<div>
|
||||||
|
{{ $slot }}
|
||||||
|
</div>
|
||||||
|
</x-layout>
|
5
resources/views/components/applications/navbar.blade.php
Normal file
5
resources/views/components/applications/navbar.blade.php
Normal 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>
|
@@ -1,6 +1,16 @@
|
|||||||
<label for={{ $name }}>{{ $name }}</label>
|
<label for={{ $name }}>
|
||||||
<input id={{ $name }} wire:model={{ $name }} type="text" name={{ $name }}
|
@if ($label)
|
||||||
{{ $required }} />
|
{{ $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)
|
@error($name)
|
||||||
<span class="text-red-500">{{ $message }}</span>
|
<span class="text-red-500">{{ $message }}</span>
|
||||||
@enderror
|
@enderror
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
<title>{{ $title ?? 'Coolify' }}</title>
|
<title>{{ $title ?? 'Coolify' }}</title>
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
@vite(['resources/js/app.js', 'resources/css/app.css'])
|
@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
|
@livewireStyles
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<nav>
|
<nav class="flex gap-2 ">
|
||||||
<div>v{{ config('coolify.version') }}</div>
|
<div>v{{ config('coolify.version') }}</div>
|
||||||
@guest
|
@guest
|
||||||
<a href="/login">Login</a>
|
<a href="/login">Login</a>
|
||||||
@@ -14,6 +14,6 @@
|
|||||||
@csrf
|
@csrf
|
||||||
<button type="submit">Logout</button>
|
<button type="submit">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
<livewire:check-update>
|
{{-- <livewire:check-update> --}}
|
||||||
@endauth
|
@endauth
|
||||||
</nav>
|
</nav>
|
||||||
|
@@ -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>
|
|
@@ -0,0 +1,3 @@
|
|||||||
|
<div>
|
||||||
|
<p>{{$destination->name}}</p>
|
||||||
|
</div>
|
26
resources/views/livewire/application/general.blade.php
Normal file
26
resources/views/livewire/application/general.blade.php
Normal 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>
|
3
resources/views/livewire/application/secrets.blade.php
Normal file
3
resources/views/livewire/application/secrets.blade.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<div>
|
||||||
|
{{-- Nothing in the world is as soft and yielding as water. --}}
|
||||||
|
</div>
|
8
resources/views/livewire/application/source.blade.php
Normal file
8
resources/views/livewire/application/source.blade.php
Normal 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>
|
@@ -5,5 +5,11 @@
|
|||||||
<button wire:click='start'>Start</button>
|
<button wire:click='start'>Start</button>
|
||||||
@endif
|
@endif
|
||||||
<button wire:click='kill'>Kill</button>
|
<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>
|
</div>
|
||||||
|
6
resources/views/livewire/poll-deployment.blade.php
Normal file
6
resources/views/livewire/poll-deployment.blade.php
Normal 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>
|
@@ -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>
|
|
23
resources/views/project/applications/configuration.blade.php
Normal file
23
resources/views/project/applications/configuration.blade.php
Normal 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>
|
@@ -0,0 +1,3 @@
|
|||||||
|
<x-applications.layout :applicationId="$application->id" title="Deployment">
|
||||||
|
<livewire:poll-activity :activity="$activity" :deployment_uuid="$deployment_uuid" />
|
||||||
|
</x-applications.layout>
|
10
resources/views/project/applications/deployments.blade.php
Normal file
10
resources/views/project/applications/deployments.blade.php
Normal 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>
|
@@ -1,4 +0,0 @@
|
|||||||
<x-layout>
|
|
||||||
<h1>Deployment</h1>
|
|
||||||
<livewire:poll-activity :activity="$activity" :deployment_uuid="$deployment_uuid" />
|
|
||||||
</x-layout>
|
|
@@ -3,7 +3,7 @@
|
|||||||
<div>
|
<div>
|
||||||
@foreach ($environment->applications as $application)
|
@foreach ($environment->applications as $application)
|
||||||
<p>
|
<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 }}
|
{{ $application->name }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\ApplicationController;
|
||||||
use App\Http\Controllers\HomeController;
|
use App\Http\Controllers\HomeController;
|
||||||
use App\Http\Controllers\ProjectController;
|
use App\Http\Controllers\ProjectController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@@ -23,8 +24,10 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
|
|
||||||
Route::get('/project/{project_uuid}/{environment_name}', [ProjectController::class, 'resources'])->name('project.resources');
|
Route::get('/project/{project_uuid}/{environment_name}', [ProjectController::class, 'resources'])->name('project.resources');
|
||||||
|
|
||||||
Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}', [ProjectController::class, 'application'])->name('project.application');
|
Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}', [ApplicationController::class, 'configuration'])->name('project.applications.configuration');
|
||||||
Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment/{deployment_uuid}', [ProjectController::class, 'deployment'])->name('project.deployment');
|
Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment', [ApplicationController::class, 'deployments'])->name('project.applications.deployments');
|
||||||
|
Route::get('/project/{project_uuid}/{environment_name}/application/{application_uuid}/deployment/{deployment_uuid}', [ApplicationController::class, 'deployment'])->name('project.applications.deployment');
|
||||||
|
|
||||||
|
|
||||||
// Route::get('/database/{database_uuid}', [ProjectController::class, 'database'])->name('project.database');
|
// Route::get('/database/{database_uuid}', [ProjectController::class, 'database'])->name('project.database');
|
||||||
// Route::get('//service/{service_uuid}', [ProjectController::class, 'service'])->name('project.service');
|
// Route::get('//service/{service_uuid}', [ProjectController::class, 'service'])->name('project.service');
|
||||||
|
Reference in New Issue
Block a user