mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 02:11:36 +00:00
refactoring
This commit is contained in:
parent
643318fcfc
commit
a8295e15c3
@ -3,6 +3,7 @@
|
|||||||
namespace App\Actions\PHP;
|
namespace App\Actions\PHP;
|
||||||
|
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
|
use App\Models\Service;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
||||||
class UninstallPHP
|
class UninstallPHP
|
||||||
@ -11,6 +12,7 @@ public function uninstall(Server $server, string $version): void
|
|||||||
{
|
{
|
||||||
$this->validate($server, $version);
|
$this->validate($server, $version);
|
||||||
|
|
||||||
|
/** @var Service $php */
|
||||||
$php = $server->services()->where('type', 'php')->where('version', $version)->first();
|
$php = $server->services()->where('type', 'php')->where('version', $version)->first();
|
||||||
|
|
||||||
$php->uninstall();
|
$php->uninstall();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class UpdateEnv
|
class UpdateEnv
|
||||||
{
|
{
|
||||||
public function handle(Site $site, array $input): void
|
public function update(Site $site, array $input): void
|
||||||
{
|
{
|
||||||
$typeData = $site->type_data;
|
$typeData = $site->type_data;
|
||||||
$typeData['env'] = $input['env'];
|
$typeData['env'] = $input['env'];
|
||||||
|
37
app/Http/Livewire/Application/Env.php
Normal file
37
app/Http/Livewire/Application/Env.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Livewire\Application;
|
||||||
|
|
||||||
|
use App\Actions\Site\UpdateEnv;
|
||||||
|
use App\Models\Site;
|
||||||
|
use App\Traits\RefreshComponentOnBroadcast;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class Env extends Component
|
||||||
|
{
|
||||||
|
use RefreshComponentOnBroadcast;
|
||||||
|
|
||||||
|
public Site $site;
|
||||||
|
|
||||||
|
public string $env;
|
||||||
|
|
||||||
|
public function mount(): void
|
||||||
|
{
|
||||||
|
$this->env = $this->site->env;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(): void
|
||||||
|
{
|
||||||
|
app(UpdateEnv::class)->update($this->site, $this->all());
|
||||||
|
|
||||||
|
session()->flash('status', 'updating-env');
|
||||||
|
|
||||||
|
$this->emit(Deploy::class, '$refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render(): View
|
||||||
|
{
|
||||||
|
return view('livewire.application.env');
|
||||||
|
}
|
||||||
|
}
|
@ -26,7 +26,9 @@ public function handle(): void
|
|||||||
new EditFileCommand(
|
new EditFileCommand(
|
||||||
$this->site->path.'/.env',
|
$this->site->path.'/.env',
|
||||||
$this->site->env
|
$this->site->env
|
||||||
)
|
),
|
||||||
|
'update-env',
|
||||||
|
$this->site->id
|
||||||
);
|
);
|
||||||
event(
|
event(
|
||||||
new Broadcast('deploy-site-env-finished', [
|
new Broadcast('deploy-site-env-finished', [
|
||||||
|
25
app/SSHCommands/System/ReadFileCommand.php
Normal file
25
app/SSHCommands/System/ReadFileCommand.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\SSHCommands\System;
|
||||||
|
|
||||||
|
use App\SSHCommands\Command;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
|
||||||
|
class ReadFileCommand extends Command
|
||||||
|
{
|
||||||
|
public function __construct(protected string $path)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function file(): string
|
||||||
|
{
|
||||||
|
return File::get(resource_path('commands/system/read-file.sh'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function content(): string
|
||||||
|
{
|
||||||
|
return str($this->file())
|
||||||
|
->replace('__path__', $this->path)
|
||||||
|
->toString();
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,11 @@
|
|||||||
namespace App\SourceControlProviders;
|
namespace App\SourceControlProviders;
|
||||||
|
|
||||||
use App\Exceptions\FailedToDeployGitHook;
|
use App\Exceptions\FailedToDeployGitHook;
|
||||||
|
use App\Exceptions\FailedToDeployGitKey;
|
||||||
use App\Exceptions\FailedToDestroyGitHook;
|
use App\Exceptions\FailedToDestroyGitHook;
|
||||||
|
use App\Exceptions\RepositoryNotFound;
|
||||||
|
use App\Exceptions\RepositoryPermissionDenied;
|
||||||
|
use App\Exceptions\SourceControlIsNotConnected;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@ -102,9 +106,22 @@ public function getLastCommit(string $repo, string $branch): ?array
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws FailedToDeployGitKey
|
||||||
|
*/
|
||||||
public function deployKey(string $title, string $repo, string $key): void
|
public function deployKey(string $title, string $repo, string $key): void
|
||||||
{
|
{
|
||||||
// TODO: Implement deployKey() method.
|
$res = Http::withToken($this->sourceControl->access_token)->post(
|
||||||
|
$this->apiUrl."/repositories/$repo/deploy-keys",
|
||||||
|
[
|
||||||
|
'label' => $title,
|
||||||
|
'key' => $key,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($res->status() != 201) {
|
||||||
|
throw new FailedToDeployGitKey($res->json()['error']['message']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getCommitter(string $raw): array
|
protected function getCommitter(string $raw): array
|
||||||
|
@ -125,7 +125,7 @@ public function deployKey(string $title, string $repo, string $key): void
|
|||||||
$response = Http::withToken($this->sourceControl->access_token)->post(
|
$response = Http::withToken($this->sourceControl->access_token)->post(
|
||||||
$this->apiUrl.'/projects/'.$repository.'/deploy_keys',
|
$this->apiUrl.'/projects/'.$repository.'/deploy_keys',
|
||||||
[
|
[
|
||||||
'title' => 'deploy-key',
|
'title' => $title,
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'can_push' => true,
|
'can_push' => true,
|
||||||
]
|
]
|
||||||
|
@ -263,12 +263,12 @@
|
|||||||
'site_types' => [
|
'site_types' => [
|
||||||
\App\Enums\SiteType::PHP,
|
\App\Enums\SiteType::PHP,
|
||||||
\App\Enums\SiteType::LARAVEL,
|
\App\Enums\SiteType::LARAVEL,
|
||||||
\App\Enums\SiteType::WORDPRESS,
|
// \App\Enums\SiteType::WORDPRESS,
|
||||||
],
|
],
|
||||||
'site_types_class' => [
|
'site_types_class' => [
|
||||||
\App\Enums\SiteType::PHP => PHPSite::class,
|
\App\Enums\SiteType::PHP => PHPSite::class,
|
||||||
\App\Enums\SiteType::LARAVEL => Laravel::class,
|
\App\Enums\SiteType::LARAVEL => Laravel::class,
|
||||||
\App\Enums\SiteType::WORDPRESS => Wordpress::class,
|
// \App\Enums\SiteType::WORDPRESS => Wordpress::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -5,6 +5,18 @@ export NEEDRESTART_MODE=a
|
|||||||
export V_USERNAME=vito
|
export V_USERNAME=vito
|
||||||
export V_PASSWORD=$(openssl rand -base64 12)
|
export V_PASSWORD=$(openssl rand -base64 12)
|
||||||
|
|
||||||
|
echo "Enter the domain you want to install Vito? (your-domain.com)"
|
||||||
|
|
||||||
|
read V_DOMAIN
|
||||||
|
|
||||||
|
echo "Enter your email address:"
|
||||||
|
|
||||||
|
read V_ADMIN_EMAIL
|
||||||
|
|
||||||
|
echo "Enter your password:"
|
||||||
|
|
||||||
|
read V_ADMIN_PASSWORD
|
||||||
|
|
||||||
if [[ -z "${V_DOMAIN}" ]]; then
|
if [[ -z "${V_DOMAIN}" ]]; then
|
||||||
echo "Error: V_DOMAIN environment variable is not set."
|
echo "Error: V_DOMAIN environment variable is not set."
|
||||||
exit 1
|
exit 1
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/build/assets/app-bdf134de.css
Normal file
1
public/build/assets/app-bdf134de.css
Normal file
File diff suppressed because one or more lines are too long
22
public/build/assets/app-fa1f93fa.js
Normal file
22
public/build/assets/app-fa1f93fa.js
Normal file
File diff suppressed because one or more lines are too long
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"resources/css/app.css": {
|
"resources/css/app.css": {
|
||||||
"file": "assets/app-0d136492.css",
|
"file": "assets/app-bdf134de.css",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"src": "resources/css/app.css"
|
"src": "resources/css/app.css"
|
||||||
},
|
},
|
||||||
"resources/js/app.js": {
|
"resources/js/app.js": {
|
||||||
"file": "assets/app-4c878af7.js",
|
"file": "assets/app-fa1f93fa.js",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"src": "resources/js/app.js"
|
"src": "resources/js/app.js"
|
||||||
}
|
}
|
||||||
|
1
resources/commands/system/read-file.sh
Normal file
1
resources/commands/system/read-file.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
cat __path__;
|
@ -30,11 +30,11 @@
|
|||||||
<body class="font-sans antialiased bg-gray-100 dark:bg-gray-900 dark:text-gray-300 min-h-screen min-w-max" x-data="" x-cloak>
|
<body class="font-sans antialiased bg-gray-100 dark:bg-gray-900 dark:text-gray-300 min-h-screen min-w-max" x-data="" x-cloak>
|
||||||
<div class="flex min-h-screen">
|
<div class="flex min-h-screen">
|
||||||
<div class="left-0 top-0 min-h-screen w-64 flex-none bg-gray-800 dark:bg-gray-800/50 p-3 dark:border-r-2 dark:border-gray-800">
|
<div class="left-0 top-0 min-h-screen w-64 flex-none bg-gray-800 dark:bg-gray-800/50 p-3 dark:border-r-2 dark:border-gray-800">
|
||||||
<a href="/" class="h-16 block">
|
<div class="h-16 block">
|
||||||
<div class="flex items-center justify-start text-3xl font-extrabold text-white">
|
<div class="flex items-center justify-start text-3xl font-extrabold text-white">
|
||||||
Vito
|
Vito
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
|
|
||||||
<div class="mb-5 space-y-2">
|
<div class="mb-5 space-y-2">
|
||||||
@include('layouts.partials.server-select', ['server' => isset($server) ? $server : null ])
|
@include('layouts.partials.server-select', ['server' => isset($server) ? $server : null ])
|
||||||
|
@ -68,7 +68,7 @@ function siteCombobox() {
|
|||||||
selectSite(site) {
|
selectSite(site) {
|
||||||
if (this.selected.id !== site.id) {
|
if (this.selected.id !== site.id) {
|
||||||
this.selected = site;
|
this.selected = site;
|
||||||
window.location.href = '{{ url('/servers') }}/' + '{{ $server->id }}/sites' + site.id
|
window.location.href = '{{ url('/servers') }}/' + '{{ $server->id }}/sites/' + site.id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filterSitesAndOpen() {
|
filterSitesAndOpen() {
|
||||||
|
@ -7,8 +7,14 @@
|
|||||||
<h2 class="text-lg font-semibold">
|
<h2 class="text-lg font-semibold">
|
||||||
<a href="{{ $site->activeSsl ? 'https://' : 'http://' . $site->domain }}" target="_blank">{{ $site->domain }}</a>
|
<a href="{{ $site->activeSsl ? 'https://' : 'http://' . $site->domain }}" target="_blank">{{ $site->domain }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="flex flex-col items-end">
|
<div class="flex items-end">
|
||||||
|
<div class="flex flex-col justify-center items-end h-20">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<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 text-gray-500 mr-1">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" />
|
||||||
|
</svg>
|
||||||
<livewire:sites.site-status :site="$site" />
|
<livewire:sites.site-status :site="$site" />
|
||||||
|
</div>
|
||||||
<x-input-label class="cursor-pointer mt-1" x-data="{ copied: false }" x-clipboard.raw="{{ $site->web_directory_path }}">
|
<x-input-label class="cursor-pointer mt-1" x-data="{ copied: false }" x-clipboard.raw="{{ $site->web_directory_path }}">
|
||||||
<div class="text-sm flex items-center" x-on:click="copied = true; setTimeout(() => {copied = false}, 2000)">
|
<div class="text-sm flex items-center" x-on:click="copied = true; setTimeout(() => {copied = false}, 2000)">
|
||||||
<div x-show="copied" class="flex items-center mr-1">
|
<div x-show="copied" class="flex items-center mr-1">
|
||||||
@ -16,10 +22,30 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0118 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3l1.5 1.5 3-3.75" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0118 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3l1.5 1.5 3-3.75" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
{{ $site->web_directory_path }}
|
{{ $site->domain }}
|
||||||
</div>
|
</div>
|
||||||
</x-input-label>
|
</x-input-label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="h-20 mx-5 border-r border-gray-200 dark:border-gray-800"></div>
|
||||||
|
<div class="flex flex-col justify-center items-end h-20">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<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 text-gray-500 mr-1">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M21.75 17.25v-.228a4.5 4.5 0 00-.12-1.03l-2.268-9.64a3.375 3.375 0 00-3.285-2.602H7.923a3.375 3.375 0 00-3.285 2.602l-2.268 9.64a4.5 4.5 0 00-.12 1.03v.228m19.5 0a3 3 0 01-3 3H5.25a3 3 0 01-3-3m19.5 0a3 3 0 00-3-3H5.25a3 3 0 00-3 3m16.5 0h.008v.008h-.008v-.008zm-3 0h.008v.008h-.008v-.008z" />
|
||||||
|
</svg>
|
||||||
|
<livewire:servers.server-status :server="$site->server" />
|
||||||
|
</div>
|
||||||
|
<x-input-label class="cursor-pointer mt-1" x-data="{ copied: false }" x-clipboard.raw="{{ $site->server->ip }}">
|
||||||
|
<div class="text-sm flex items-center" x-on:click="copied = true; setTimeout(() => {copied = false}, 2000)">
|
||||||
|
<div x-show="copied" class="flex items-center mr-1">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-primary-600 dark:text-white font-bold">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0118 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3l1.5 1.5 3-3.75" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
{{ $site->server->ip }}
|
||||||
|
</div>
|
||||||
|
</x-input-label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
|
|
||||||
<x-slot name="sidebar">
|
<x-slot name="sidebar">
|
||||||
@ -32,12 +58,14 @@
|
|||||||
<x-secondary-sidebar-link :href="route('servers.sites.show', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.show')">
|
<x-secondary-sidebar-link :href="route('servers.sites.show', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.show')">
|
||||||
{{ __('Application') }}
|
{{ __('Application') }}
|
||||||
</x-secondary-sidebar-link>
|
</x-secondary-sidebar-link>
|
||||||
|
@if($site->status == \App\Enums\SiteStatus::READY)
|
||||||
<x-secondary-sidebar-link :href="route('servers.sites.ssl', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.ssl')">
|
<x-secondary-sidebar-link :href="route('servers.sites.ssl', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.ssl')">
|
||||||
{{ __('SSL') }}
|
{{ __('SSL') }}
|
||||||
</x-secondary-sidebar-link>
|
</x-secondary-sidebar-link>
|
||||||
<x-secondary-sidebar-link :href="route('servers.sites.queues', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.queues')">
|
<x-secondary-sidebar-link :href="route('servers.sites.queues', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.queues')">
|
||||||
{{ __('Queues') }}
|
{{ __('Queues') }}
|
||||||
</x-secondary-sidebar-link>
|
</x-secondary-sidebar-link>
|
||||||
|
@endif
|
||||||
<x-secondary-sidebar-link :href="route('servers.sites.settings', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.settings')">
|
<x-secondary-sidebar-link :href="route('servers.sites.settings', ['server' => $site->server, 'site' => $site])" :active="request()->routeIs('servers.sites.settings')">
|
||||||
{{ __('Settings') }}
|
{{ __('Settings') }}
|
||||||
</x-secondary-sidebar-link>
|
</x-secondary-sidebar-link>
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
<x-td>
|
<x-td>
|
||||||
@if($deployment->status != \App\Enums\DeploymentStatus::DEPLOYING)
|
@if($deployment->status != \App\Enums\DeploymentStatus::DEPLOYING)
|
||||||
<x-icon-button wire:click="showLog({{ $deployment->id }})" wire:loading.attr="disabled">
|
<x-icon-button wire:click="showLog({{ $deployment->id }})" wire:loading.attr="disabled">
|
||||||
|
Logs
|
||||||
</x-icon-button>
|
</x-icon-button>
|
||||||
@endif
|
@endif
|
||||||
</x-td>
|
</x-td>
|
||||||
|
36
resources/views/livewire/application/env.blade.php
Normal file
36
resources/views/livewire/application/env.blade.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<div x-data="">
|
||||||
|
<x-secondary-button x-on:click="$dispatch('open-modal', 'update-env')">{{ __(".env") }}</x-secondary-button>
|
||||||
|
<x-modal name="update-env">
|
||||||
|
<form wire:submit.prevent="save" class="p-6">
|
||||||
|
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
{{ __('Update .env File') }}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="mt-6">
|
||||||
|
<x-input-label for="env" :value="__('.env')" />
|
||||||
|
<x-textarea wire:model.defer="env" rows="10" id="env" name="env" class="mt-1 w-full" />
|
||||||
|
@error('env')
|
||||||
|
<x-input-error class="mt-2" :messages="$message" />
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-6 flex items-center justify-end">
|
||||||
|
@if (session('status') === 'updating-env')
|
||||||
|
<p class="mr-2">{{ __('Updating env...') }}</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if (session('status') === 'env-updated')
|
||||||
|
<p class="mr-2">{{ __('Saved') }}</p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||||
|
{{ __('Cancel') }}
|
||||||
|
</x-secondary-button>
|
||||||
|
|
||||||
|
<x-primary-button class="ml-3">
|
||||||
|
{{ __('Save') }}
|
||||||
|
</x-primary-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</x-modal>
|
||||||
|
</div>
|
@ -10,6 +10,9 @@
|
|||||||
<div class="mr-2">
|
<div class="mr-2">
|
||||||
<livewire:application.deployment-script :site="$site" />
|
<livewire:application.deployment-script :site="$site" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mr-2">
|
||||||
|
<livewire:application.env :site="$site" />
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<livewire:application.deploy :site="$site" />
|
<livewire:application.deploy :site="$site" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<x-slot name="trigger">
|
<x-slot name="trigger">
|
||||||
<x-secondary-button>
|
<x-secondary-button>
|
||||||
{{ __("Change") }}
|
{{ __("Change") }}
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="ml-1 h-5 w-5"><path fill-rule="evenodd" d="M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z" clip-rule="evenodd"></path></svg>
|
||||||
</x-secondary-button>
|
</x-secondary-button>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
<x-slot name="content">
|
<x-slot name="content">
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
<x-slot name="title">{{ __("Installed PHPs") }}</x-slot>
|
<x-slot name="title">{{ __("Installed PHPs") }}</x-slot>
|
||||||
<x-slot name="description">{{ __("You can see and manage your PHP installations") }}</x-slot>
|
<x-slot name="description">{{ __("You can see and manage your PHP installations") }}</x-slot>
|
||||||
<x-slot name="aside">
|
<x-slot name="aside">
|
||||||
|
<div class="flex items-center">
|
||||||
@include('livewire.php.partials.install-new-php')
|
@include('livewire.php.partials.install-new-php')
|
||||||
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-card-header>
|
</x-card-header>
|
||||||
|
|
||||||
@ -22,6 +24,7 @@
|
|||||||
<x-slot name="trigger">
|
<x-slot name="trigger">
|
||||||
<x-secondary-button>
|
<x-secondary-button>
|
||||||
{{ __("Actions") }}
|
{{ __("Actions") }}
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="ml-1 h-5 w-5"><path fill-rule="evenodd" d="M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z" clip-rule="evenodd"></path></svg>
|
||||||
</x-secondary-button>
|
</x-secondary-button>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
<x-slot name="content">
|
<x-slot name="content">
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<x-dropdown>
|
<x-dropdown>
|
||||||
<x-slot name="trigger">
|
<x-slot name="trigger">
|
||||||
<x-primary-button>
|
<x-primary-button>
|
||||||
{{ __("Install") }}
|
{{ __("Install PHP") }}
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="ml-1 h-5 w-5"><path fill-rule="evenodd" d="M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z" clip-rule="evenodd"></path></svg>
|
||||||
</x-primary-button>
|
</x-primary-button>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<x-card-header>
|
<x-card-header>
|
||||||
<x-slot name="title">{{ __("Queues") }}</x-slot>
|
<x-slot name="title">{{ __("Queues") }}</x-slot>
|
||||||
<x-slot name="description">{{ __("You can manage and create queues for your site") }}</x-slot>
|
<x-slot name="description">{{ __("You can manage and create queues for your site via supervisor") }}</x-slot>
|
||||||
<x-slot name="aside">
|
<x-slot name="aside">
|
||||||
<livewire:queues.create-queue :site="$site" />
|
<livewire:queues.create-queue :site="$site" />
|
||||||
</x-slot>
|
</x-slot>
|
||||||
|
@ -1,11 +1,25 @@
|
|||||||
<div>
|
<div>
|
||||||
@if($site->status === \App\Enums\SiteStatus::INSTALLING)
|
@if($site->status === \App\Enums\SiteStatus::INSTALLING)
|
||||||
@include('livewire.sites.partials.installing', ['site' => $site])
|
@include('livewire.sites.partials.installing', ['site' => $site])
|
||||||
|
|
||||||
|
<livewire:server-logs.logs-list :server="$site->server" :site="$site" :count="10" />
|
||||||
@endif
|
@endif
|
||||||
@if($site->status === \App\Enums\SiteStatus::INSTALLATION_FAILED)
|
@if($site->status === \App\Enums\SiteStatus::INSTALLATION_FAILED)
|
||||||
@include('livewire.sites.partials.installation-failed', ['site' => $site])
|
@include('livewire.sites.partials.installation-failed', ['site' => $site])
|
||||||
|
|
||||||
|
<livewire:server-logs.logs-list :server="$site->server" :site="$site" :count="10" />
|
||||||
@endif
|
@endif
|
||||||
@if($site->status === \App\Enums\SiteStatus::READY)
|
@if($site->status === \App\Enums\SiteStatus::READY)
|
||||||
@include('livewire.sites.partials.site-overview', ['site' => $site])
|
@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::WORDPRESS)
|
||||||
|
<livewire:application.wordpress-app :site="$site" />
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,6 +2,4 @@
|
|||||||
<x-slot name="pageTitle">{{ $site->domain }}</x-slot>
|
<x-slot name="pageTitle">{{ $site->domain }}</x-slot>
|
||||||
|
|
||||||
<livewire:sites.show-site :site="$site" />
|
<livewire:sites.show-site :site="$site" />
|
||||||
|
|
||||||
<livewire:server-logs.logs-list :server="$site->server" :site="$site" :count="10" />
|
|
||||||
</x-site-layout>
|
</x-site-layout>
|
||||||
|
@ -35,8 +35,7 @@
|
|||||||
Route::prefix('/{server}/sites')->group(function () {
|
Route::prefix('/{server}/sites')->group(function () {
|
||||||
Route::get('/', [SiteController::class, 'index'])->name('servers.sites');
|
Route::get('/', [SiteController::class, 'index'])->name('servers.sites');
|
||||||
Route::get('/create', [SiteController::class, 'create'])->name('servers.sites.create');
|
Route::get('/create', [SiteController::class, 'create'])->name('servers.sites.create');
|
||||||
Route::get('/{site}', [SiteController::class, 'application'])->name('servers.sites.show');
|
Route::get('/{site}', [SiteController::class, 'show'])->name('servers.sites.show');
|
||||||
Route::get('/{site}/application', [SiteController::class, 'application'])->name('servers.sites.application');
|
|
||||||
Route::get('/{site}/ssl', [SiteController::class, 'ssl'])->name('servers.sites.ssl');
|
Route::get('/{site}/ssl', [SiteController::class, 'ssl'])->name('servers.sites.ssl');
|
||||||
Route::get('/{site}/queues', [SiteController::class, 'queues'])->name('servers.sites.queues');
|
Route::get('/{site}/queues', [SiteController::class, 'queues'])->name('servers.sites.queues');
|
||||||
Route::get('/{site}/settings', [SiteController::class, 'settings'])->name('servers.sites.settings');
|
Route::get('/{site}/settings', [SiteController::class, 'settings'])->name('servers.sites.settings');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user