add new public repo

This commit is contained in:
Andras Bacsai 2023-04-25 14:43:35 +02:00
parent dd51b002b8
commit 6135c139da
42 changed files with 495 additions and 210 deletions

View File

@ -11,15 +11,15 @@ public function configuration()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
return view('project.application.configuration', ['application' => $application]);
}
@ -27,15 +27,15 @@ public function deployments()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
return view('project.application.deployments', ['application' => $application, 'deployments' => $application->deployments()]);
}
@ -46,15 +46,15 @@ public function deployment()
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$activity = Activity::where('properties->deployment_uuid', '=', $deployment_uuid)->first();

View File

@ -10,7 +10,7 @@ public function environments()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$project->load(['environments']);
if (count($project->environments) == 1) {
@ -23,11 +23,11 @@ public function resources()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
return view('project.resources', ['project' => $project, 'environment' => $environment]);
}
@ -36,15 +36,15 @@ public function application_configuration()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
return view('project.application.configuration', ['application' => $application]);
}
@ -52,15 +52,15 @@ public function application_deployments()
{
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
return view('project.application.deployments', ['application' => $application, 'deployments' => $application->deployments()]);
}
@ -71,15 +71,15 @@ public function application_deployment()
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
if (!$project) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);
if (!$environment) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$application = $environment->applications->where('uuid', request()->route('application_uuid'))->first();
if (!$application) {
return redirect()->route('home');
return redirect()->route('dashboard');
}
$activity = Activity::where('properties->deployment_uuid', '=', $deployment_uuid)->first();

View File

@ -24,7 +24,7 @@ class Deploy extends Component
public function mount()
{
$this->parameters = Route::current()->parameters();
$this->application = Application::find($this->applicationId)->first();
$this->application = Application::where('id', $this->applicationId)->first();
$this->destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();
}
protected function setDeploymentUuid()

View File

@ -36,7 +36,8 @@ class General extends Component
'application.build_pack' => 'required',
'application.base_directory' => 'required',
'application.publish_directory' => 'nullable',
'application.ports_exposes' => 'nullable',
'application.ports_exposes' => 'required',
'application.ports_mappings' => 'nullable',
];
public function instantSave()
{
@ -54,7 +55,7 @@ public function instantSave()
}
public function mount()
{
$this->application = Application::find($this->applicationId)->with('destination', 'settings')->first();
$this->application = Application::where('id', $this->applicationId)->with('destination', 'settings')->firstOrFail();
$this->is_git_submodules_allowed = $this->application->settings->is_git_submodules_allowed;
$this->is_git_lfs_allowed = $this->application->settings->is_git_lfs_allowed;
$this->is_debug = $this->application->settings->is_debug;
@ -64,7 +65,6 @@ public function mount()
$this->is_http2 = $this->application->settings->is_http2;
$this->is_auto_deploy = $this->application->settings->is_auto_deploy;
$this->is_dual_cert = $this->application->settings->is_dual_cert;
}
public function submit()
{

View File

@ -17,6 +17,6 @@ class Source extends Component
];
public function mount()
{
$this->application = Application::find($this->applicationId)->first();
$this->application = Application::where('id', $this->applicationId)->first();
}
}

View File

@ -0,0 +1,90 @@
<?php
namespace App\Http\Livewire\Project\New;
use App\Http\Livewire\Application\Destination;
use App\Models\Application;
use App\Models\Git;
use App\Models\GithubApp;
use App\Models\GitlabApp;
use App\Models\Project;
use App\Models\Server;
use App\Models\StandaloneDocker;
use App\Models\SwarmDocker;
use Livewire\Component;
use Spatie\Url\Url;
class PublicGitRepository extends Component
{
public string $public_repository_url;
public int $port;
public $servers;
public $standalone_docker;
public $swarm_docker;
public $chosenServer;
public $chosenDestination;
public $github_apps;
public $gitlab_apps;
protected $rules = [
'public_repository_url' => 'required|url',
];
public function mount()
{
if (env('APP_ENV') === 'local') {
$this->public_repository_url = 'https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify';
$this->port = 3000;
}
$this->servers = session('currentTeam')->load(['servers'])->servers;
}
public function chooseServer($server_id)
{
$this->chosenServer = $server_id;
$this->standalone_docker = StandaloneDocker::where('server_id', $server_id)->get();
$this->swarm_docker = SwarmDocker::where('server_id', $server_id)->get();
}
public function setDestination($destination_uuid, $destination_type)
{
$class = "App\Models\\{$destination_type}";
$instance = new $class;
$this->chosenDestination = $instance::where('uuid', $destination_uuid)->first();
}
public function submit()
{
$this->validate();
$url = Url::fromString($this->public_repository_url);
$git_host = $url->getHost();
$git_repository = $url->getSegment(1) . '/' . $url->getSegment(2);
$git_branch = $url->getSegment(4) ?? 'main';
$project = Project::create([
'name' => fake()->company(),
'description' => fake()->sentence(),
'team_id' => session('currentTeam')->id,
]);
$application_init = [
'name' => fake()->words(2, true),
'git_repository' => $git_repository,
'git_branch' => $git_branch,
'build_pack' => 'nixpacks',
'ports_exposes' => $this->port,
'environment_id' => $project->environments->first()->id,
'destination_id' => $this->chosenDestination->id,
'destination_type' => $this->chosenDestination->getMorphClass(),
];
if ($git_host == 'github.com') {
$application_init['source_id'] = GithubApp::where('name', 'Public GitHub')->first()->id;
$application_init['source_type'] = GithubApp::class;
} elseif ($git_host == 'gitlab.com') {
$application_init['source_id'] = GitlabApp::where('name', 'Public GitLab')->first()->id;
$application_init['source_type'] = GitlabApp::class;
} elseif ($git_host == 'bitbucket.org') {
// $application_init['source_id'] = GithubApp::where('name', 'Public Bitbucket')->first()->id;
// $application_init['source_type'] = GithubApp::class;
}
Application::create($application_init);
}
}

View File

@ -1,10 +0,0 @@
<?php
namespace App\Http\Livewire\Project;
use Livewire\Component;
class NewProject extends Component
{
}

View File

@ -393,7 +393,7 @@ private function gitImport()
if ($this->application->source->getMorphClass() == 'App\Models\GithubApp') {
if ($this->source->is_public) {
$git_clone_command = "{$git_clone_command} {$this->source->html_url}/{$this->application->git_repository}.git {$this->workdir}";
$git_clone_command = "{$git_clone_command} {$this->source->html_url}/{$this->application->git_repository} {$this->workdir}";
$git_clone_command = $this->setGitImportSettings($git_clone_command);
return [
$this->execute_in_builder($git_clone_command)

View File

@ -16,6 +16,20 @@ protected static function booted()
});
}
protected $fillable = [
'name',
'description',
'git_repository',
'git_branch',
'build_pack',
'environment_id',
'destination_id',
'destination_type',
'source_id',
'source_type',
'ports_mappings',
'ports_exposes',
];
public function environment()
{
return $this->belongsTo(Environment::class);

View File

@ -7,6 +7,7 @@
class ApplicationSetting extends Model
{
protected $fillable = [
'application_id',
'is_git_submodules_allowed',
'is_git_lfs_allowed',
];

View File

@ -2,8 +2,21 @@
namespace App\Models;
class Environment extends BaseModel
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
class Environment extends Model
{
protected $fillable = [
'name',
'project_id',
];
protected function name(): Attribute
{
return Attribute::make(
set: fn (string $value) => strtolower($value),
);
}
public function project()
{
return $this->belongsTo(Project::class);
@ -21,4 +34,3 @@ public function services()
return $this->hasMany(Service::class);
}
}

13
app/Models/Git.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Git extends Model
{
public function applications()
{
return $this->morphMany(Application::class, 'source');
}
}

View File

@ -1,7 +0,0 @@
<?php
namespace App\Models;
class GitDeployKey extends BaseModel
{
}

View File

@ -4,6 +4,10 @@
class GitlabApp extends BaseModel
{
public function applications()
{
return $this->morphMany(Application::class, 'source');
}
public function privateKey()
{
return $this->belongsTo(PrivateKey::class);

View File

@ -2,10 +2,8 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class InstanceSettings extends Model
{
use HasFactory;
}

View File

@ -10,15 +10,28 @@ protected static function booted()
ProjectSetting::create([
'project_id' => $project->id,
]);
Environment::create([
'name' => 'Production',
'project_id' => $project->id,
]);
});
}
public function environments() {
protected $fillable = [
'name',
'description',
'team_id',
'project_id'
];
public function environments()
{
return $this->hasMany(Environment::class);
}
public function settings() {
public function settings()
{
return $this->hasOne(ProjectSetting::class);
}
public function applications() {
public function applications()
{
return $this->hasManyThrough(Application::class, Environment::class);
}
}

View File

@ -4,4 +4,7 @@
class ProjectSetting extends BaseModel
{
protected $fillable = [
'project_id'
];
}

View File

@ -12,6 +12,10 @@ protected static function booted()
]);
});
}
public function destinations()
{
return $this->hasMany(PrivateKey::class);
}
public function privateKey()
{
return $this->belongsTo(PrivateKey::class);

View File

@ -0,0 +1,31 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class FormInput extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $id,
public bool $required = false,
public bool $readonly = false,
public string|null $label = null,
public string|null $type = 'text',
public bool $instantSave = false,
) {
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.form-input');
}
}

View File

@ -12,14 +12,12 @@ class Input extends Component
* Create a new component instance.
*/
public function __construct(
public string $name,
public string $id,
public bool $required = false,
public bool $readonly = false,
public string|null $label = null,
public string|null $type = 'text',
public bool $instantSave = false,
) {
//
}
/**

View File

@ -16,6 +16,7 @@
"spatie/laravel-activitylog": "^4.7.3",
"spatie/laravel-data": "^3.4.3",
"spatie/laravel-ray": "^1.32.4",
"spatie/url": "^2.2",
"symfony/yaml": "^6.2",
"visus/cuid2": "^2.0.0"
},

64
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d7ed21949975efcb1891e098e4d2abfa",
"content-hash": "987e0c4c7aea49957b194208f27253b3",
"packages": [
{
"name": "bacon/bacon-qr-code",
@ -4180,6 +4180,68 @@
],
"time": "2023-03-06T07:22:28+00:00"
},
{
"name": "spatie/url",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/url.git",
"reference": "8a52d669b7ada3bd8ba4a3cdba885056a35a978d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/url/zipball/8a52d669b7ada3bd8ba4a3cdba885056a35a978d",
"reference": "8a52d669b7ada3bd8ba4a3cdba885056a35a978d",
"shasum": ""
},
"require": {
"php": "^8.0",
"psr/http-message": "^1.0",
"spatie/macroable": "^2.0"
},
"require-dev": {
"pestphp/pest": "^1.21"
},
"type": "library",
"autoload": {
"psr-4": {
"Spatie\\Url\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sebastian De Deyne",
"email": "sebastian@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Parse, build and manipulate URL's",
"homepage": "https://github.com/spatie/url",
"keywords": [
"spatie",
"url"
],
"support": {
"issues": "https://github.com/spatie/url/issues",
"source": "https://github.com/spatie/url/tree/2.2.0"
},
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
},
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2022-12-14T09:57:56+00:00"
},
{
"name": "symfony/console",
"version": "v6.2.8",

View File

@ -13,10 +13,10 @@ public function up(): void
{
Schema::create('environments', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->string('name')->unique();
$table->string('name');
$table->foreignId('project_id');
$table->timestamps();
$table->unique(['name', 'project_id']);
});
}

View File

@ -54,7 +54,7 @@ public function up(): void
$table->string('status')->default('exited');
$table->morphs('destination');
$table->nullableMorphs('destination');
$table->morphs('source');
$table->foreignId('environment_id');

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('gits', function (Blueprint $table) {
$table->id();
$table->enum('type', ['github', 'gitlab', 'bitbucket', 'custom']);
$table->string('api_url');
$table->string('html_url');
$table->integer('custom_port')->default(22);
$table->string('custom_user')->default('git');
$table->longText('webhook_secret')->nullable();
$table->foreignId('private_key_id')->nullable();
$table->foreignId('project_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('gits');
}
};

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('git_deploy_keys', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->string('name')->nullable();
$table->string('url');
$table->foreignId('private_key_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('git_deploy_keys');
}
};

View File

@ -14,11 +14,5 @@ class EnvironmentSeeder extends Seeder
*/
public function run(): void
{
$project_1 = Project::find(1);
Environment::create([
'id' => 1,
'name' => 'production',
'project_id' => $project_1->id,
]);
}
}

View File

@ -1,17 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class GitDeployKeySeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Database\Seeders;
use App\Models\Git;
use App\Models\PrivateKey;
use App\Models\Project;
use App\Models\Team;
use Illuminate\Database\Seeder;
class GitSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $project = Project::find(1);
// $private_key_1 = PrivateKey::find(1);
// Git::create([
// 'api_url' => 'https://api.github.com',
// 'html_url' => 'https://github.com',
// 'is_public' => false,
// 'private_key_id' => $private_key_1->id,
// 'project_id' => $project->id,
// ]);
}
}

View File

@ -38,13 +38,5 @@ public function run(): void
'private_key_id' => $private_key_2->id,
'team_id' => $root_team->id,
]);
GithubApp::create([
'name' => 'Private GitHub (deployment key)',
'api_url' => 'https://api.github.com',
'html_url' => 'https://github.com',
'is_public' => false,
'private_key_id' => $private_key_1->id,
'team_id' => $root_team->id,
]);
}
}

View File

@ -12,7 +12,6 @@ public function run(): void
{
$root_team = Team::find(0);
Project::create([
'id' => 1,
'name' => "My first project",
'description' => "This is a test project in development",
'team_id' => $root_team->id,

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<x-layout>
<h1>Projects <button><a class="no-underline" href="{{ route('project.new') }}">New</a></button></h1>
<h1>Projects <a href="{{ route('project.new') }}"><button>New</button></a></h1>
@forelse ($projects as $project)
<a href="{{ route('project.environments', [$project->uuid]) }}">{{ data_get($project, 'name') }}</a>
@empty

View File

@ -1,37 +1,38 @@
<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 class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-form-input id="application.name" label="Name" required />
<x-form-input id="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 class="flex flex-col w-96">
<x-form-input id="application.install_command" label="Install Command" />
<x-form-input id="application.build_command" label="Build Command" />
<x-form-input id="application.start_command" label="Start Command" />
<x-form-input id="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" />
<div class="flex flex-col w-96">
<x-form-input id="application.base_directory" label="Base Directory" />
<x-form-input id="application.publish_directory" label="Publish Directory" />
</div>
<div class="flex-col flex w-96">
<x-input name="application.ports_exposes" label="Ports Exposes" />
<div class="flex flex-col w-96">
<x-form-input id="application.ports_exposes" label="Ports Exposes" />
<x-form-input id="application.ports_mappings" label="Ports Mappings" />
</div>
</div>
<button class="flex mx-auto mt-4" type="submit">
Submit
</button>
</form>
<div class="flex flex-col pt-4 w-52 text-right">
<x-input instantSave type="checkbox" name="is_auto_deploy" label="Auto Deploy?" />
<x-input instantSave type="checkbox" name="is_dual_cert" label="Dual Certs?" />
<x-input instantSave type="checkbox" name="is_previews" label="Previews?" />
<x-input instantSave type="checkbox" name="is_bot" label="Is Bot?" />
<x-input instantSave type="checkbox" name="is_custom_ssl" label="Is Custom SSL?" />
<x-input instantSave type="checkbox" name="is_http2" label="Is Http2?" />
<x-input instantSave type="checkbox" name="is_git_submodules_allowed" label="Git Submodules Allowed?" />
<x-input instantSave type="checkbox" name="is_git_lfs_allowed" label="Git LFS Allowed?" />
<x-input instantSave type="checkbox" name="is_debug" label="Debug" />
<div class="flex flex-col pt-4 text-right w-52">
<x-form-input instantSave type="checkbox" id="is_auto_deploy" label="Auto Deploy?" />
<x-form-input instantSave type="checkbox" id="is_dual_cert" label="Dual Certs?" />
<x-form-input instantSave type="checkbox" id="is_previews" label="Previews?" />
<x-form-input instantSave type="checkbox" id="is_bot" label="Is Bot?" />
<x-form-input instantSave type="checkbox" id="is_custom_ssl" label="Is Custom SSL?" />
<x-form-input instantSave type="checkbox" id="is_http2" label="Is Http2?" />
<x-form-input instantSave type="checkbox" id="is_git_submodules_allowed" label="Git Submodules Allowed?" />
<x-form-input instantSave type="checkbox" id="is_git_lfs_allowed" label="Git LFS Allowed?" />
<x-form-input instantSave type="checkbox" id="is_debug" label="Debug" />
</div>
</div>

View File

@ -1,9 +1,9 @@
<div>
<p>Source Name: {{ data_get($application,'source.name') }}</p>
<p>Is Public Source: {{ data_get($application,'source.is_public') }}</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 class="flex flex-col w-96">
<x-form-input id="application.git_repository" label="Git Repository" readonly />
<x-form-input id="application.git_branch" label="Git Branch" readonly />
<x-form-input id="application.git_commit_sha" label="Git Commit SHA" readonly />
</div>
</div>

View File

@ -1,11 +0,0 @@
<div>
<div class="flex flex-col w-64 gap-2">
<button>Repository (any git)</button>
<button>Repository through GitHub App</button>
<button>Repository through GitLab App</button>
<button>Repository through Bitbucket App</button>
<button>Deploy Database</button>
<button>Deploy Service</button>
<button>Empty Project</button>
</div>
</div>

View File

@ -0,0 +1,31 @@
<div>
@forelse ($servers as $server)
<button @if ($chosenServer == $server->id) class="bg-blue-500" @endif
wire:click="chooseServer({{ $server->id }})">{{ $server->name }}</button>
@empty
No servers
@endforelse
@isset($chosenServer)
<div>
@foreach ($standalone_docker as $standalone)
<button @if ($chosenDestination?->uuid == $standalone->uuid) class="bg-blue-500" @endif
wire:click="setDestination('{{ $standalone->uuid }}','StandaloneDocker')">{{ $standalone->network }}</button>
@endforeach
@foreach ($swarm_docker as $standalone)
<button @if ($chosenDestination?->uuid == $standalone->uuid) class="bg-blue-500" @endif
wire:click="setDestination('{{ $standalone->uuid }}','SwarmDocker')">{{ $standalone->uuid }}</button>
@endforeach
</div>
@endisset
@isset($chosenDestination)
<form wire:submit.prevent='submit'>
<x-form-input id="public_repository_url" label="Repository URL" />
<x-form-input type="number" id="port" label="Port" />
<button type="submit">
Submit
</button>
</form>
@endisset
</div>

View File

@ -2,13 +2,13 @@
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-input name="server.name" label="Name" required />
<x-input name="server.description" label="Description" />
<x-form-input id="server.name" label="Name" required />
<x-form-input id="server.description" label="Description" />
</div>
<div class="flex flex-col w-96">
<x-input name="server.ip" label="IP Address" required />
<x-input name="server.user" label="User" required />
<x-input type="number" name="server.port" label="Port" required />
<x-form-input id="server.ip" label="IP Address" required />
<x-form-input id="server.user" label="User" required />
<x-form-input type="number" id="server.port" label="Port" required />
</div>
</div>
<button class="w-16 mt-4" type="submit">

View File

@ -2,12 +2,12 @@
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-input name="settings.fqdn" label="FQDN" />
<x-input name="settings.wildcard_domain" label="Wildcard Domain" />
<x-form-input id="settings.fqdn" label="FQDN" />
<x-form-input id="settings.wildcard_domain" label="Wildcard Domain" />
</div>
<div class="flex flex-col w-96">
<x-input type="number" name="settings.public_port_min" label="Public Port Min" />
<x-input type="number" name="settings.public_port_max" label="Public Port Max" />
<x-form-input type="number" id="settings.public_port_min" label="Public Port Min" />
<x-form-input type="number" id="settings.public_port_max" label="Public Port Max" />
</div>
</div>
<button class="w-16 mt-4" type="submit">
@ -15,9 +15,9 @@
</button>
</form>
<div class="flex flex-col pt-4 text-right w-52">
<x-input instantSave type="checkbox" name="do_not_track" label="Do Not Track" />
<x-input instantSave type="checkbox" name="is_auto_update_enabled" label="Auto Update?" />
<x-input instantSave type="checkbox" name="is_registration_enabled" label="Registration Enabled?" />
<x-input instantSave type="checkbox" name="is_https_forced" label="Force https?" />
<x-form-input instantSave type="checkbox" id="do_not_track" label="Do Not Track" />
<x-form-input instantSave type="checkbox" id="is_auto_update_enabled" label="Auto Update?" />
<x-form-input instantSave type="checkbox" id="is_registration_enabled" label="Registration Enabled?" />
<x-form-input instantSave type="checkbox" id="is_https_forced" label="Force https?" />
</div>
</div>

View File

@ -1,4 +1,26 @@
<x-layout>
<h1>New Project</h1>
<livewire:project.new-project />
<div x-data="{ tab: window.location.hash ? window.location.hash.substring(1) : 'choose' }">
<div class="flex flex-col w-64 gap-2 mb-10">
<button @click.prevent="tab = 'public-repo'; window.location.hash = 'public-repo'">Public Repository
</button>
<button @click.prevent="tab = 'github-private-repo'; window.location.hash = 'github-private-repo'">Private
Repository (GitHub App)</button>
<button @click.prevent="tab = 'empty-project'; window.location.hash = 'empty-project'">Empty
Project</button>
</div>
<div x-cloak x-show="tab === 'public-repo'">
<livewire:project.new.public-git-repository />
</div>
<div x-cloak x-show="tab === 'github-private-repo'">
github-private-repo
</div>
<div x-cloak x-show="tab === 'empty-project'">
empty-project
</div>
<div x-cloak x-show="tab === 'choose'">
Choose any option
</div>
</div>
</x-layout>

View File

@ -41,7 +41,7 @@
'settings' => $settings
]);
} else {
return redirect()->route('home');
return redirect()->route('dashboard');
}
})->name('settings');