mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
global storage-providers, notification channels and server providers (#247)
This commit is contained in:
@ -16,7 +16,7 @@ class="p-6"
|
||||
|
||||
<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">
|
||||
<x-textarea id="script" name="script" class="mt-1 min-h-[400px] w-full font-mono">
|
||||
{{ old("script", $site->deploymentScript?->content) }}
|
||||
</x-textarea>
|
||||
@error("script")
|
||||
|
@ -21,7 +21,7 @@ class="mt-6"
|
||||
>
|
||||
<x-input-label for="env" :value="__('.env')" />
|
||||
<div id="env-content">
|
||||
<x-textarea id="env" name="env" rows="10" class="mt-1 block min-h-[400px] w-full">
|
||||
<x-textarea id="env" name="env" rows="10" class="mt-1 block min-h-[400px] w-full font-mono">
|
||||
{{ old("env", session()->get("env") ?? "Loading...") }}
|
||||
</x-textarea>
|
||||
</div>
|
||||
|
@ -35,7 +35,7 @@ class="p-6"
|
||||
<div class="mt-1 flex items-center">
|
||||
<x-select-input id="backup_storage" name="backup_storage" class="mt-1 w-full">
|
||||
<option value="" selected disabled>{{ __("Select") }}</option>
|
||||
@foreach (auth()->user()->storageProviders as $st)
|
||||
@foreach (\App\Models\StorageProvider::getByProjectId(auth()->user()->current_project_id)->get() as $st)
|
||||
<option value="{{ $st->id }}" @if(old('backup_storage') == $st->id) selected @endif>
|
||||
{{ $st->profile }} - {{ $st->provider }}
|
||||
</option>
|
||||
|
@ -14,7 +14,7 @@ class="p-6"
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="ini" value="php.ini" />
|
||||
<x-textarea id="ini" name="ini" class="mt-1 w-full" rows="15">
|
||||
<x-textarea id="ini" name="ini" class="mt-1 w-full font-mono" rows="15">
|
||||
{{ old("ini", session()->get("ini")) }}
|
||||
</x-textarea>
|
||||
@error("ini")
|
||||
|
@ -1,5 +1,5 @@
|
||||
<x-input-label for="content" :value="__('Content')" />
|
||||
<x-textarea id="content" name="content" class="mt-1 min-h-[400px] w-full">
|
||||
<x-textarea id="content" name="content" class="mt-1 min-h-[400px] w-full font-mono">
|
||||
{{ $value }}
|
||||
</x-textarea>
|
||||
@error("content")
|
||||
|
@ -100,6 +100,15 @@ class="mt-1 w-full"
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox id="global" name="global" :checked="old('global')" value="1">
|
||||
Is Global (Accessible in all projects)
|
||||
</x-checkbox>
|
||||
@error("global")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
|
@ -16,13 +16,29 @@
|
||||
@include("settings.notification-channels.partials.icons." . $channel->provider)
|
||||
</div>
|
||||
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
|
||||
<span class="mb-1">{{ $channel->label }}</span>
|
||||
<div class="mb-1 flex items-center">
|
||||
{{ $channel->label }}
|
||||
@if (! $channel->project_id)
|
||||
<x-status status="disabled" class="ml-2">GLOBAL</x-status>
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-sm text-gray-400">
|
||||
<x-datetime :value="$channel->created_at" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="inline">
|
||||
<x-icon-button
|
||||
id="edit-{{ $channel->id }}"
|
||||
hx-get="{{ route('settings.notification-channels', ['edit' => $channel->id]) }}"
|
||||
hx-replace-url="true"
|
||||
hx-select="#edit"
|
||||
hx-target="#edit"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#edit-{{ $channel->id }}"
|
||||
>
|
||||
<x-heroicon name="o-pencil" class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
<x-icon-button
|
||||
x-on:click="deleteAction = '{{ route('settings.notification-channels.delete', $channel->id) }}'; $dispatch('open-modal', 'delete-channel')"
|
||||
>
|
||||
@ -34,6 +50,12 @@
|
||||
@endforeach
|
||||
|
||||
@include("settings.notification-channels.partials.delete-channel")
|
||||
|
||||
<div id="edit">
|
||||
@if (isset($editChannel))
|
||||
@include("settings.notification-channels.partials.edit-notification-channel", ["notificationChannel" => $editChannel])
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
|
@ -0,0 +1,59 @@
|
||||
<x-modal
|
||||
name="edit-notification-channel"
|
||||
:show="true"
|
||||
x-on:modal-edit-notification-channel-closed.window="window.history.pushState('', '', '{{ route('settings.notification-channels') }}');"
|
||||
>
|
||||
<form
|
||||
id="edit-notification-channel-form"
|
||||
hx-post="{{ route("settings.notification-channels.update", ["notificationChannel" => $notificationChannel->id]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#edit-notification-channel-form"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#btn-edit-notification-channel"
|
||||
class="p-6"
|
||||
>
|
||||
@csrf
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Edit Channel") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="edit-label" value="Label" />
|
||||
<x-text-input
|
||||
value="{{ $notificationChannel->label }}"
|
||||
id="edit-label"
|
||||
name="label"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
/>
|
||||
@error("label")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox
|
||||
id="edit-global"
|
||||
name="global"
|
||||
:checked="old('global', $notificationChannel->project_id === null ? 1 : null)"
|
||||
value="1"
|
||||
>
|
||||
Is Global (Accessible in all projects)
|
||||
</x-checkbox>
|
||||
@error("global")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button id="btn-edit-notification-channel" class="ml-3">
|
||||
{{ __("Save") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
@ -83,6 +83,15 @@ class="mt-1 w-full"
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox id="global" name="global" :checked="old('global')" value="1">
|
||||
Is Global (Accessible in all projects)
|
||||
</x-checkbox>
|
||||
@error("global")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
|
@ -0,0 +1,59 @@
|
||||
<x-modal
|
||||
name="edit-server-provider"
|
||||
:show="true"
|
||||
x-on:modal-edit-server-provider-closed.window="window.history.pushState('', '', '{{ route('settings.server-providers') }}');"
|
||||
>
|
||||
<form
|
||||
id="edit-server-provider-form"
|
||||
hx-post="{{ route("settings.server-providers.update", ["serverProvider" => $serverProvider->id]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#edit-server-provider-form"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#btn-edit-server-provider"
|
||||
class="p-6"
|
||||
>
|
||||
@csrf
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Edit Provider") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="edit-name" value="Name" />
|
||||
<x-text-input
|
||||
value="{{ $serverProvider->profile }}"
|
||||
id="edit-name"
|
||||
name="name"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
/>
|
||||
@error("name")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox
|
||||
id="edit-global"
|
||||
name="global"
|
||||
:checked="old('global', $serverProvider->project_id === null ? 1 : null)"
|
||||
value="1"
|
||||
>
|
||||
Is Global (Accessible in all projects)
|
||||
</x-checkbox>
|
||||
@error("global")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button id="btn-edit-server-provider" class="ml-3">
|
||||
{{ __("Save") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
@ -18,13 +18,29 @@ class="h-10 w-10"
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
|
||||
<span class="mb-1">{{ $provider->profile }}</span>
|
||||
<div class="mb-1 flex items-center">
|
||||
{{ $provider->profile }}
|
||||
@if (! $provider->project_id)
|
||||
<x-status status="disabled" class="ml-2">GLOBAL</x-status>
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-sm text-gray-400">
|
||||
<x-datetime :value="$provider->created_at" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="inline">
|
||||
<x-icon-button
|
||||
id="edit-{{ $provider->id }}"
|
||||
hx-get="{{ route('settings.server-providers', ['edit' => $provider->id]) }}"
|
||||
hx-replace-url="true"
|
||||
hx-select="#edit"
|
||||
hx-target="#edit"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#edit-{{ $provider->id }}"
|
||||
>
|
||||
<x-heroicon name="o-pencil" class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
<x-icon-button
|
||||
x-on:click="deleteAction = '{{ route('settings.server-providers.delete', $provider->id) }}'; $dispatch('open-modal', 'delete-provider')"
|
||||
>
|
||||
@ -36,6 +52,12 @@ class="h-10 w-10"
|
||||
@endforeach
|
||||
|
||||
@include("settings.server-providers.partials.delete-provider")
|
||||
|
||||
<div id="edit">
|
||||
@if (isset($editProvider))
|
||||
@include("settings.server-providers.partials.edit-provider", ["serverProvider" => $editProvider])
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
|
@ -109,7 +109,7 @@ class="text-primary-500"
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox
|
||||
id="global"
|
||||
id="edit-global"
|
||||
name="global"
|
||||
:checked="old('global', $sourceControl->project_id === null ? 1 : null)"
|
||||
value="1"
|
||||
|
@ -201,6 +201,15 @@ class="mt-1 w-full"
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox id="global" name="global" :checked="old('global')" value="1">
|
||||
Is Global (Accessible in all projects)
|
||||
</x-checkbox>
|
||||
@error("global")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
|
@ -0,0 +1,59 @@
|
||||
<x-modal
|
||||
name="edit-storage-provider"
|
||||
:show="true"
|
||||
x-on:modal-edit-storage-provider-closed.window="window.history.pushState('', '', '{{ route('settings.storage-providers') }}');"
|
||||
>
|
||||
<form
|
||||
id="edit-storage-provider-form"
|
||||
hx-post="{{ route("settings.storage-providers.update", ["storageProvider" => $storageProvider->id]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#edit-storage-provider-form"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#btn-edit-storage-provider"
|
||||
class="p-6"
|
||||
>
|
||||
@csrf
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Edit Provider") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="edit-name" value="Name" />
|
||||
<x-text-input
|
||||
value="{{ $storageProvider->profile }}"
|
||||
id="edit-name"
|
||||
name="name"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
/>
|
||||
@error("name")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-checkbox
|
||||
id="edit-global"
|
||||
name="global"
|
||||
:checked="old('global', $storageProvider->project_id === null ? 1 : null)"
|
||||
value="1"
|
||||
>
|
||||
Is Global (Accessible in all projects)
|
||||
</x-checkbox>
|
||||
@error("global")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button id="btn-edit-storage-provider" class="ml-3">
|
||||
{{ __("Save") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
@ -18,13 +18,29 @@ class="h-10 w-10"
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
|
||||
<span class="mb-1">{{ $provider->profile }}</span>
|
||||
<div class="mb-1 flex items-center">
|
||||
{{ $provider->profile }}
|
||||
@if (! $provider->project_id)
|
||||
<x-status status="disabled" class="ml-2">GLOBAL</x-status>
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-sm text-gray-400">
|
||||
<x-datetime :value="$provider->created_at" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="inline">
|
||||
<x-icon-button
|
||||
id="edit-{{ $provider->id }}"
|
||||
hx-get="{{ route('settings.storage-providers', ['edit' => $provider->id]) }}"
|
||||
hx-replace-url="true"
|
||||
hx-select="#edit"
|
||||
hx-target="#edit"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#edit-{{ $provider->id }}"
|
||||
>
|
||||
<x-heroicon name="o-pencil" class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
<x-icon-button
|
||||
x-on:click="deleteAction = '{{ route('settings.storage-providers.delete', $provider->id) }}'; $dispatch('open-modal', 'delete-provider')"
|
||||
>
|
||||
@ -36,6 +52,12 @@ class="h-10 w-10"
|
||||
@endforeach
|
||||
|
||||
@include("settings.storage-providers.partials.delete-storage-provider")
|
||||
|
||||
<div id="edit">
|
||||
@if (isset($editProvider))
|
||||
@include("settings.storage-providers.partials.edit-provider", ["storageProvider" => $editProvider])
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
|
@ -22,7 +22,7 @@ class="space-y-6"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<div id="vhost-container">
|
||||
<x-textarea id="vhost" name="vhost" rows="10" class="mt-1 block min-h-[400px] w-full">
|
||||
<x-textarea id="vhost" name="vhost" rows="10" class="mt-1 block min-h-[400px] w-full font-mono">
|
||||
{{ session()->has("vhost") ? session()->get("vhost") : "Loading..." }}
|
||||
</x-textarea>
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="mt-1 flex items-center">
|
||||
<x-select-input id="source_control" name="source_control" class="mt-1 w-full">
|
||||
<option value="" selected>{{ __("Select") }}</option>
|
||||
@foreach (\App\Models\SourceControl::getByCurrentProject() as $sourceControl)
|
||||
@foreach (\App\Models\SourceControl::getByProjectId(auth()->user()->current_project_id)->get() as $sourceControl)
|
||||
<option
|
||||
value="{{ $sourceControl->id }}"
|
||||
@if($sourceControl->id == old('source_control', isset($site) ? $site->source_control_id : null)) selected @endif
|
||||
|
Reference in New Issue
Block a user