Bug fixes (#155)

This commit is contained in:
Saeed Vaziry
2024-04-05 19:45:09 +02:00
committed by GitHub
parent 2d566b853f
commit 12c500e125
22 changed files with 288 additions and 36 deletions

View File

@ -4,6 +4,7 @@
<x-slot name="trigger">
<x-secondary-button>
{{ __("Auto Deployment") }}
<x-heroicon name="o-chevron-down" class="ml-1 h-4 w-4" />
</x-secondary-button>
</x-slot>
<x-slot name="content">

View File

@ -12,6 +12,8 @@ class="p-6"
{{ __("Deployment Script") }}
</h2>
<div class="mt-6">A bash script that will be executed when you run the deployment process.</div>
<div class="mt-6">
<x-input-label for="script" :value="__('Script')" />
<x-textarea id="script" name="script" class="mt-1 min-h-[400px] w-full">

View File

@ -19,6 +19,7 @@
<x-slot name="trigger">
<x-secondary-button>
{{ __("Manage") }}
<x-heroicon name="o-chevron-down" class="ml-1 h-4 w-4" />
</x-secondary-button>
</x-slot>
<x-slot name="content">

View File

@ -10,7 +10,7 @@
runUrl: '{{ route("servers.console.run", ["server" => $server]) }}',
async run() {
this.running = true
this.output = 'Running...\n'
this.output = this.command + '\n'
const fetchOptions = {
method: 'POST',
headers: {
@ -23,6 +23,7 @@
}),
}
this.command = ''
const response = await fetch(this.runUrl, fetchOptions)
const reader = response.body.getReader()
const decoder = new TextDecoder('utf-8')

View File

@ -38,6 +38,17 @@ class="p-6"
@endif
@endforeach
</x-select-input>
<x-input-help>
Check
<a
href="https://vitodeploy.com/settings/source-controls.html"
class="text-primary-500"
target="_blank"
>
here
</a>
to see what permissions you need
</x-input-help>
@error("provider")
<x-input-error class="mt-2" :messages="$message" />
@enderror

View File

@ -3,6 +3,10 @@
@include("site-settings.partials.change-php-version")
@if ($site->source_control_id)
@include("site-settings.partials.update-source-control")
@endif
@include("site-settings.partials.update-v-host")
<x-card>

View File

@ -0,0 +1,32 @@
<x-card>
<x-slot name="title">{{ __("Update Source Control") }}</x-slot>
<x-slot name="description">
{{ __("You can switch the source control profile (token) in case of token expiration. Keep in mind that it must be the same account and provider") }}
</x-slot>
<form
id="update-source-control"
hx-post="{{ route("servers.sites.settings.source-control", ["server" => $server, "site" => $site]) }}"
hx-swap="outerHTML"
hx-select="#update-source-control"
hx-ext="disable-element"
hx-disable-element="#btn-update-source-control"
class="space-y-6"
>
@include(
"sites.partials.create.fields.source-control",
[
"sourceControls" => \App\Models\SourceControl::query()
->where("provider", $site->sourceControl()?->provider)
->get(),
]
)
</form>
<x-slot name="actions">
<x-primary-button id="btn-update-source-control" form="update-source-control" hx-disable>
{{ __("Save") }}
</x-primary-button>
</x-slot>
</x-card>

View File

@ -0,0 +1,15 @@
<x-site-layout :site="$site">
<x-slot name="pageTitle">{{ $site->domain }}</x-slot>
<x-live id="site">
@if ($site->status === \App\Enums\SiteStatus::INSTALLING)
@include("sites.partials.installing", ["site" => $site])
@endif
@if ($site->status === \App\Enums\SiteStatus::INSTALLATION_FAILED)
@include("sites.partials.installation-failed", ["site" => $site])
@endif
</x-live>
@include("server-logs.partials.logs-list", ["server" => $site->server, "site" => $site])
</x-site-layout>

View File

@ -6,7 +6,7 @@
@foreach ($sourceControls as $sourceControl)
<option
value="{{ $sourceControl->id }}"
@if($sourceControl->id === old('source_control')) selected @endif
@if($sourceControl->id == old('source_control', isset($site) ? $site->source_control_id : null)) selected @endif
>
{{ $sourceControl->profile }}
({{ $sourceControl->provider }})

View File

@ -1,17 +0,0 @@
<div>
@if ($site->status === \App\Enums\SiteStatus::INSTALLING)
@include("sites.partials.installing", ["site" => $site])
@include("server-logs.partials.logs-list", ["server" => $site->server, "site" => $site])
@endif
@if ($site->status === \App\Enums\SiteStatus::INSTALLATION_FAILED)
@include("sites.partials.installation-failed", ["site" => $site])
@include("server-logs.partials.logs-list", ["server" => $site->server, "site" => $site])
@endif
@if ($site->status === \App\Enums\SiteStatus::READY)
@include("application." . $site->type . "-app", ["site" => $site])
@endif
</div>

View File

@ -1,5 +1,5 @@
<x-site-layout :site="$site">
<x-slot name="pageTitle">{{ $site->domain }}</x-slot>
@include("sites.partials.show-site")
@include("application." . $site->type . "-app", ["site" => $site])
</x-site-layout>