global storage-providers, notification channels and server providers (#247)

This commit is contained in:
Saeed Vaziry
2024-06-29 12:52:03 +03:30
committed by GitHub
parent ad027eb033
commit 11e3b167cc
44 changed files with 678 additions and 77 deletions

View File

@ -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") }}

View File

@ -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>

View File

@ -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">