-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add blank php site * fix frontend * fix source control check
- Loading branch information
1 parent
0ec6a9d
commit 8665435
Showing
16 changed files
with
223 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Application; | ||
|
||
use App\Models\Site; | ||
use App\Traits\RefreshComponentOnBroadcast; | ||
use Livewire\Component; | ||
|
||
class PhpBlankApp extends Component | ||
{ | ||
use RefreshComponentOnBroadcast; | ||
|
||
public Site $site; | ||
|
||
public function render() | ||
{ | ||
return view('livewire.application.php-blank-app'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
namespace App\SiteTypes; | ||
|
||
use App\Enums\SiteFeature; | ||
use App\Jobs\Site\CreateVHost; | ||
use Illuminate\Support\Facades\Bus; | ||
use Illuminate\Validation\Rule; | ||
use Throwable; | ||
|
||
class PHPBlank extends PHPSite | ||
{ | ||
public function supportedFeatures(): array | ||
{ | ||
return [ | ||
SiteFeature::DEPLOYMENT, | ||
SiteFeature::ENV, | ||
SiteFeature::SSL, | ||
SiteFeature::QUEUES, | ||
]; | ||
} | ||
|
||
public function createValidationRules(array $input): array | ||
{ | ||
return [ | ||
'php_version' => [ | ||
'required', | ||
Rule::in($this->site->server->installedPHPVersions()), | ||
], | ||
]; | ||
} | ||
|
||
public function createFields(array $input): array | ||
{ | ||
return [ | ||
'web_directory' => $input['web_directory'] ?? '', | ||
'php_version' => $input['php_version'] ?? '', | ||
]; | ||
} | ||
|
||
public function data(array $input): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function install(): void | ||
{ | ||
$chain = [ | ||
new CreateVHost($this->site), | ||
$this->progress(65), | ||
function () { | ||
$this->site->php()?->restart(); | ||
}, | ||
]; | ||
|
||
$chain[] = function () { | ||
$this->site->installationFinished(); | ||
}; | ||
|
||
Bus::chain($chain) | ||
->catch(function (Throwable $e) { | ||
$this->site->installationFailed($e); | ||
}) | ||
->onConnection('ssh-long') | ||
->dispatch(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1 @@ | ||
<div> | ||
<x-card-header> | ||
<x-slot name="title">{{ __("Application") }}</x-slot> | ||
<x-slot name="description">{{ __("Here you can manage your application") }}</x-slot> | ||
<x-slot name="aside"> | ||
<div class="flex items-center"> | ||
<div class="mr-2"> | ||
<livewire:application.deploy :site="$site" /> | ||
</div> | ||
<div class="mr-2"> | ||
<livewire:application.auto-deployment :site="$site" /> | ||
</div> | ||
<x-dropdown> | ||
<x-slot name="trigger"> | ||
<x-secondary-button> | ||
{{ __('Manage') }} | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 ml-1"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" /> | ||
</svg> | ||
</x-secondary-button> | ||
</x-slot> | ||
<x-slot name="content"> | ||
<x-dropdown-link class="cursor-pointer" x-on:click="$dispatch('open-modal', 'change-branch')">{{ __("Branch") }}</x-dropdown-link> | ||
<x-dropdown-link class="cursor-pointer" x-on:click="$dispatch('open-modal', 'deployment-script')">{{ __("Deployment Script") }}</x-dropdown-link> | ||
<x-dropdown-link class="cursor-pointer" x-on:click="$dispatch('open-modal', 'update-env')">{{ __(".env") }}</x-dropdown-link> | ||
</x-slot> | ||
</x-dropdown> | ||
<livewire:application.change-branch :site="$site" /> | ||
<livewire:application.deployment-script :site="$site" /> | ||
<livewire:application.env :site="$site" /> | ||
</div> | ||
</x-slot> | ||
</x-card-header> | ||
|
||
<livewire:application.deployments-list :site="$site" /> | ||
</div> | ||
@include('livewire.application.php-app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,62 @@ | ||
<div> | ||
<x-card-header> | ||
<x-slot name="title">{{ __('Application') }}</x-slot> | ||
<x-slot name="description">{{ __('Here you can manage your application') }}</x-slot> | ||
<x-slot name="aside"> | ||
<div class="flex items-center"> | ||
<div class="mr-2"> | ||
<livewire:application.deploy :site="$site" /> | ||
</div> | ||
@if ($site->source_control_id) | ||
<div class="mr-2"> | ||
<livewire:application.auto-deployment :site="$site" /> | ||
</div> | ||
@endif | ||
<x-dropdown> | ||
<x-slot name="trigger"> | ||
<x-secondary-button> | ||
{{ __('Manage') }} | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke-width="1.5" | ||
stroke="currentColor" | ||
class="ml-1 h-5 w-5" | ||
> | ||
<path | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
d="M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9" | ||
/> | ||
</svg> | ||
</x-secondary-button> | ||
</x-slot> | ||
<x-slot name="content"> | ||
@if ($site->source_control_id) | ||
<x-dropdown-link | ||
class="cursor-pointer" | ||
x-on:click="$dispatch('open-modal', 'change-branch')" | ||
>{{ __('Branch') }}</x-dropdown-link> | ||
@endif | ||
<x-dropdown-link | ||
class="cursor-pointer" | ||
x-on:click="$dispatch('open-modal', 'deployment-script')" | ||
>{{ __('Deployment Script') }}</x-dropdown-link> | ||
<x-dropdown-link | ||
class="cursor-pointer" | ||
x-on:click="$dispatch('open-modal', 'update-env')" | ||
>{{ __('.env') }}</x-dropdown-link> | ||
</x-slot> | ||
</x-dropdown> | ||
@if ($site->source_control_id) | ||
<livewire:application.change-branch :site="$site" /> | ||
@endif | ||
<livewire:application.deployment-script :site="$site" /> | ||
<livewire:application.env :site="$site" /> | ||
</div> | ||
</x-slot> | ||
</x-card-header> | ||
|
||
<livewire:application.deployments-list :site="$site" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@include('livewire.application.php-app') |
3 changes: 3 additions & 0 deletions
3
resources/views/livewire/sites/partials/create/php-blank.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@include('livewire.sites.partials.create.fields.php-version') | ||
|
||
@include('livewire.sites.partials.create.fields.web-directory') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
<x-site-layout :site="$site"> | ||
<x-slot name="pageTitle">{{ __("Application") }}</x-slot> | ||
@if($site->type == \App\Enums\SiteType::LARAVEL) | ||
<livewire:application.laravel-app :site="$site" /> | ||
@endif | ||
|
||
@if($site->type == \App\Enums\SiteType::LARAVEL) | ||
<livewire:application.laravel-app :site="$site" /> | ||
@endif | ||
@if($site->type == \App\Enums\SiteType::PHP) | ||
<livewire:application.php-app :site="$site" /> | ||
@endif | ||
|
||
@if($site->type == \App\Enums\SiteType::PHP) | ||
<livewire:application.php-app :site="$site" /> | ||
@endif | ||
|
||
@if($site->type == \App\Enums\SiteType::WORDPRESS) | ||
<livewire:application.wordpress-app :site="$site" /> | ||
@endif | ||
</x-site-layout> | ||
@if($site->type == \App\Enums\SiteType::WORDPRESS) | ||
<livewire:application.wordpress-app :site="$site" /> | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<x-site-layout :site="$site"> | ||
<x-slot name="pageTitle">{{ __("Settings") }}</x-slot> | ||
<x-slot name="pageTitle">{{ __('Settings') }}</x-slot> | ||
|
||
<livewire:sites.change-php-version :site="$site"/> | ||
<livewire:sites.change-php-version :site="$site" /> | ||
|
||
<livewire:sites.update-source-control-provider :site="$site"/> | ||
@if ($site->source_control_id) | ||
<livewire:sites.update-source-control-provider :site="$site" /> | ||
@endif | ||
|
||
<livewire:sites.update-v-host :site="$site"/> | ||
<livewire:sites.update-v-host :site="$site" /> | ||
|
||
<x-card> | ||
<x-slot name="title">{{ __("Delete Site") }}</x-slot> | ||
<x-slot name="description">{{ __("Permanently delete the site from server") }}</x-slot> | ||
<p>{{ __("Once your site is deleted, all of its files will be deleted from the server.") }}</p> | ||
<x-slot name="title">{{ __('Delete Site') }}</x-slot> | ||
<x-slot name="description">{{ __('Permanently delete the site from server') }}</x-slot> | ||
<p>{{ __('Once your site is deleted, all of its files will be deleted from the server.') }}</p> | ||
<div class="mt-5"> | ||
<livewire:sites.delete-site :site="$site"/> | ||
<livewire:sites.delete-site :site="$site" /> | ||
</div> | ||
</x-card> | ||
</x-site-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters