Migrate to HTMX (#114)

Dropped Livewire
Added HTMX
Added Blade code lint
Drop Mysql and Redis
Migrate to SQLite
This commit is contained in:
Saeed Vaziry
2024-03-06 17:02:59 +01:00
committed by GitHub
parent 5b2c419e91
commit b2083fc6b2
486 changed files with 8609 additions and 8707 deletions

View File

@ -0,0 +1,5 @@
<x-profile-layout>
<x-slot name="pageTitle">{{ __("Source Controls") }}</x-slot>
@include("settings.source-controls.partials.source-controls-list")
</x-profile-layout>

View File

@ -0,0 +1,91 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'connect-source-control')">
{{ __("Connect") }}
</x-primary-button>
<x-modal name="connect-source-control" :show="request()->has('provider')">
@php
$oldProvider = old("provider", request()->input("provider") ?? "");
@endphp
<form
id="connect-source-control-form"
hx-post="{{ route("source-controls.connect") }}"
hx-swap="outerHTML"
hx-select="#connect-source-control-form"
hx-ext="disable-element"
hx-disable-element="#btn-connect-source-control"
class="p-6"
x-data="{ provider: '{{ $oldProvider }}' }"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Connect to a Source Control") }}
</h2>
<div class="mt-6">
<x-input-label for="provider" value="Provider" />
<x-select-input x-model="provider" id="provider" name="provider" class="mt-1 w-full">
<option value="" selected disabled>
{{ __("Select") }}
</option>
@foreach (config("core.source_control_providers") as $p)
@if ($p !== "custom")
<option value="{{ $p }}" @if($oldProvider === $p) selected @endif>
{{ $p }}
</option>
@endif
@endforeach
</x-select-input>
@error("provider")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="name" value="Name" />
<x-text-input value="{{ old('name') }}" id="name" name="name" type="text" class="mt-1 w-full" />
@error("name")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="provider === 'gitlab'" class="mt-6">
<x-input-label for="url" value="Url (optional)" />
<x-text-input
value="{{ old('url') }}"
id="url"
name="url"
type="text"
class="mt-1 w-full"
placeholder="e.g. https://gitlab.example.com/"
/>
<x-input-help>
If you run a self-managed gitlab enter the url here, leave empty to use gitlab.com
</x-input-help>
@error("url")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="token" value="API Key" />
<x-text-input value="{{ old('token') }}" id="token" name="token" type="text" class="mt-1 w-full" />
@error("token")
<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-connect-source-control" class="ml-3">
{{ __("Connect") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,18 @@
<x-modal name="delete-source-control" :show="$errors->isNotEmpty()">
<form id="delete-source-control-form" method="post" x-bind:action="deleteAction" class="p-6">
@csrf
@method("delete")
<h2 class="text-lg font-medium">Are you sure that you want to delete this source control?</h2>
<div class="mt-6 flex justify-end">
<x-secondary-button type="button" x-on:click="$dispatch('close')">
{{ __("Cancel") }}
</x-secondary-button>
<x-danger-button class="ml-3">
{{ __("Delete") }}
</x-danger-button>
</div>
</form>
</x-modal>

View File

@ -0,0 +1 @@
<x-fab-bitbucket class="h-10 w-10" />

View File

@ -0,0 +1 @@
<x-fab-github class="h-10 w-10" />

View File

@ -0,0 +1 @@
<x-fab-gitlab class="h-10 w-10" />

View File

@ -0,0 +1,43 @@
<div>
<x-card-header>
<x-slot name="title">Source Controls</x-slot>
<x-slot name="description">You can connect your source controls via API Tokens</x-slot>
<x-slot name="aside">
@include("settings.source-controls.partials.connect")
</x-slot>
</x-card-header>
<div x-data="{ deleteAction: '' }" class="space-y-3">
@if (count($sourceControls) > 0)
@foreach ($sourceControls as $sourceControl)
<x-item-card>
<div class="flex-none text-gray-600 dark:text-gray-300">
@include("settings.source-controls.partials.icons." . $sourceControl->provider . "-icon")
</div>
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
<span class="mb-1">{{ $sourceControl->profile }}</span>
<span class="text-sm text-gray-400">
<x-datetime :value="$sourceControl->created_at" />
</span>
</div>
<div class="flex items-center">
<div class="inline">
<x-icon-button
x-on:click="deleteAction = '{{ route('source-controls.delete', $sourceControl->id) }}'; $dispatch('open-modal', 'delete-source-control')"
>
<x-heroicon-o-trash class="h-5 w-5" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
@include("settings.source-controls.partials.delete-source-control")
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any server source controls yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>