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">{{ __("Notification Channels") }}</x-slot>
@include("settings.notification-channels.partials.channels-list")
</x-profile-layout>

View File

@ -0,0 +1,114 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'add-channel')">
{{ __("Add new Channel") }}
</x-primary-button>
<x-modal name="add-channel">
@php
$oldProvider = old("provider", request()->input("provider") ?? "");
@endphp
<form
id="add-channel-form"
hx-post="{{ route("notification-channels.add") }}"
hx-swap="outerHTML"
hx-select="#add-channel-form"
hx-ext="disable-element"
hx-disable-element="#btn-add-channel"
class="p-6"
x-data="{ provider: '{{ $oldProvider }}' }"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Add new Channel") }}
</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.notification_channels_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="label" :value="__('Label')" />
<x-text-input value="{{ old('label') }}" id="label" name="label" type="text" class="mt-1 w-full" />
@error("label")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="provider === 'email'" class="mt-6">
<x-input-label for="email" :value="__('Email')" />
<x-text-input value="{{ old('email') }}" id="email" name="email" type="text" class="mt-1 w-full" />
@error("email")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="['slack', 'discord'].includes(provider)" class="mt-6">
<x-input-label for="webhook_url" :value="__('Webhook URL')" />
<x-text-input
value="{{ old('webhook_url') }}"
id="webhook_url"
name="webhook_url"
type="text"
class="mt-1 w-full"
/>
@error("webhook_url")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="provider === 'telegram'" class="mt-6">
<x-input-label for="bot_token" :value="__('Bot Token')" />
<x-text-input
value="{{ old('bot_token') }}"
id="bot_token"
name="bot_token"
type="text"
class="mt-1 w-full"
/>
@error("bot_token")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div x-show="provider === 'telegram'" class="mt-6">
<x-input-label for="chat_id" :value="__('Chat ID')" />
<x-text-input
value="{{ old('chat_id') }}"
id="chat_id"
name="chat_id"
type="text"
class="mt-1 w-full"
/>
@error("chat_id")
<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-add-channel" class="ml-3">
{{ __("Add") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,45 @@
<div>
<x-card-header>
<x-slot name="title">{{ __("Notification Channels") }}</x-slot>
<x-slot name="description">
{{ __("Add or modify your notification channels") }}
</x-slot>
<x-slot name="aside">
@include("settings.notification-channels.partials.add-channel")
</x-slot>
</x-card-header>
<div x-data="{ deleteAction: '' }" class="space-y-3">
@if (count($channels) > 0)
@foreach ($channels as $channel)
<x-item-card>
<div class="flex-none text-gray-600 dark:text-gray-300">
@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>
<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
x-on:click="deleteAction = '{{ route('notification-channels.delete', $channel->id) }}'; $dispatch('open-modal', 'delete-channel')"
>
<x-heroicon-o-trash class="h-5 w-5" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
@include("settings.notification-channels.partials.delete-channel")
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any channels yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>

View File

@ -0,0 +1,18 @@
<x-modal name="delete-channel" :show="$errors->isNotEmpty()">
<form id="delete-channel-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 channel?</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-bi-discord class="h-10 w-10" />

View File

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

View File

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

View File

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

View File

@ -0,0 +1,9 @@
<x-profile-layout>
<x-slot name="pageTitle">{{ __("Profile") }}</x-slot>
@include("settings.profile.partials.update-profile-information")
@include("settings.profile.partials.update-password")
@include("settings.profile.partials.two-factor-authentication")
</x-profile-layout>

View File

@ -0,0 +1,60 @@
<x-card>
<x-slot name="title">
{{ __("Two Factor Authentication") }}
</x-slot>
<x-slot name="description">
{{ __("Here you can activate 2FA to secure your account") }}
</x-slot>
@if (! auth()->user()->two_factor_secret)
{{-- Enable 2FA --}}
<form method="POST" action="{{ route("two-factor.enable") }}">
@csrf
<x-primary-button type="submit">
{{ __("Enable Two-Factor") }}
</x-primary-button>
</form>
@else
{{-- Disable 2FA --}}
<form method="POST" action="{{ route("two-factor.disable") }}">
@csrf
@method("DELETE")
<x-danger-button type="submit">
{{ __("Disable Two-Factor") }}
</x-danger-button>
</form>
@if (session("status") == "two-factor-authentication-enabled")
<div class="mt-5">
{{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }}
</div>
<div class="mt-5">
{!! auth()->user()->twoFactorQrCodeSvg() !!}
</div>
@endif
{{-- Show 2FA Recovery Codes --}}
<div class="mt-5">
{{ __("Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.") }}
</div>
<div class="mt-5 rounded-md border border-gray-100 p-2 dark:border-gray-700">
@foreach (json_decode(decrypt(auth()->user()->two_factor_recovery_codes), true) as $code)
<div class="mt-2">{{ $code }}</div>
@endforeach
</div>
{{-- Regenerate 2FA Recovery Codes --}}
<form class="mt-5" method="POST" action="{{ route("two-factor.recovery-codes") }}">
@csrf
<x-primary-button type="submit">
{{ __("Regenerate Recovery Codes") }}
</x-primary-button>
</form>
@endif
</x-card>

View File

@ -0,0 +1,69 @@
<x-card>
<x-slot name="title">
{{ __("Update Password") }}
</x-slot>
<x-slot name="description">
{{ __("Ensure your account is using a long, random password to stay secure.") }}
</x-slot>
<form
id="update-password"
class="mt-6 space-y-6"
hx-post="{{ route("profile.password") }}"
hx-swap="outerHTML"
hx-select="#update-password"
hx-trigger="submit"
hx-ext="disable-element"
hx-disable-element="#btn-save-password"
>
@csrf
<div>
<x-input-label for="current_password" :value="__('Current Password')" />
<x-text-input
id="current_password"
name="current_password"
type="password"
class="mt-1 block w-full"
autocomplete="current-password"
/>
@error("current_password")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div>
<x-input-label for="password" :value="__('New Password')" />
<x-text-input
id="password"
name="password"
type="password"
class="mt-1 block w-full"
autocomplete="new-password"
/>
@error("password")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div>
<x-input-label for="password_confirmation" :value="__('Confirm Password')" />
<x-text-input
id="password_confirmation"
name="password_confirmation"
type="password"
class="mt-1 block w-full"
autocomplete="new-password"
/>
@error("password_confirmation")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</form>
<x-slot name="actions">
<x-primary-button id="btn-save-password" form="update-password">
{{ __("Save") }}
</x-primary-button>
</x-slot>
</x-card>

View File

@ -0,0 +1,80 @@
@php
$user = auth()->user();
@endphp
<x-card>
<x-slot name="title">
{{ __("Profile Information") }}
</x-slot>
<x-slot name="description">
{{ __("Update your account's profile information and email address.") }}
</x-slot>
<form
id="update-profile-information"
hx-post="{{ route("profile.info") }}"
hx-swap="outerHTML"
hx-select="#update-profile-information"
hx-trigger="submit"
hx-ext="disable-element"
hx-disable-element="#btn-save-info"
class="mt-6 space-y-6"
>
@csrf
<div>
<x-input-label for="name" :value="__('Name')" />
<x-text-input
id="name"
name="name"
type="text"
value="{{ old('name', auth()->user()->name) }}"
class="mt-1 block w-full"
required
autocomplete="name"
/>
@error("name")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div>
<x-input-label for="email" :value="__('Email')" />
<x-text-input
id="email"
name="email"
type="email"
value="{{ old('email', auth()->user()->email) }}"
class="mt-1 block w-full"
required
autocomplete="email"
/>
@error("email")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div>
<x-input-label for="timezone" :value="__('Timezone')" />
<x-select-input id="timezone" name="timezone" class="mt-1 block w-full" required>
@foreach (timezone_identifiers_list() as $timezone)
<option
value="{{ $timezone }}"
@if(old('timezone', auth()->user()->timezone) == $timezone) selected @endif
>
{{ $timezone }}
</option>
@endforeach
</x-select-input>
@error("timezone")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</form>
<x-slot name="actions">
<x-primary-button id="btn-save-info" form="update-profile-information">
{{ __("Save") }}
</x-primary-button>
</x-slot>
</x-card>

View File

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

View File

@ -0,0 +1,40 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'create-project')">
{{ __("Create") }}
</x-primary-button>
<x-modal name="create-project" :show="request()->has('create')">
<form
id="create-project-form"
hx-post="{{ route("projects.create") }}"
hx-swap="outerHTML"
hx-select="#create-project-form"
hx-ext="disable-element"
hx-disable-element="#btn-create-project"
class="p-6"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Create Project") }}
</h2>
<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 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-create-project" class="ml-3">
{{ __("Create") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,20 @@
<x-modal name="delete-project" :show="$errors->isNotEmpty()">
<form id="delete-project-form" method="post" x-bind:action="deleteAction" class="p-6">
@csrf
@method("delete")
<h2 class="text-lg font-medium">
Deleting a project will delete all of its servers, sites, etc. Are you sure you want to delete this project?
</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,47 @@
<div>
<x-icon-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'edit-project-{{ $project->id }}')">
<x-heroicon-o-pencil class="h-5 w-5" />
</x-icon-button>
<x-modal name="edit-project-{{ $project->id }}">
<form
id="edit-project-form-{{ $project->id }}"
hx-post="{{ route("projects.update", $project) }}"
hx-swap="outerHTML"
hx-select="#edit-project-form-{{ $project->id }}"
hx-ext="disable-element"
hx-disable-element="#btn-edit-project-{{ $project->id }}"
class="p-6 text-left"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Edit Project") }}
</h2>
<div class="mt-6">
<x-input-label for="edit-name-{{ $project->id }}" value="Name" />
<x-text-input
value="{{ old('name', $project->name) }}"
id="edit-name-{{ $project->id }}"
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 flex justify-end">
<x-secondary-button type="button" x-on:click="$dispatch('close')">
{{ __("Cancel") }}
</x-secondary-button>
<x-primary-button id="btn-edit-project-{{ $project->id }}" class="ml-3">
{{ __("Save") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,40 @@
<div>
<x-card-header>
<x-slot name="title">{{ __("Projects") }}</x-slot>
<x-slot name="description">
{{ __("Here you can manage your projects") }}
</x-slot>
<x-slot name="aside">
@include("settings.projects.partials.create-project")
</x-slot>
</x-card-header>
<div id="projects-list" x-data="{ deleteAction: '' }" class="space-y-3">
@foreach ($projects as $project)
<x-item-card>
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
<div class="mb-1 flex items-center">
{{ $project->name }}
@if ($project->id == auth()->user()->current_project_id)
<x-status status="success" class="ml-1">
{{ __("Current") }}
</x-status>
@endif
</div>
<span class="text-sm text-gray-400">
<x-datetime :value="$project->created_at" />
</span>
</div>
<div class="flex items-center">
@include("settings.projects.partials.edit-project", ["project" => $project])
<x-icon-button
x-on:click="deleteAction = '{{ route('projects.delete', $project) }}'; $dispatch('open-modal', 'delete-project')"
>
<x-heroicon-o-trash class="h-5 w-5" />
</x-icon-button>
</div>
</x-item-card>
@endforeach
@include("settings.projects.partials.delete-project")
</div>
</div>

View File

@ -0,0 +1,5 @@
<x-profile-layout>
<x-slot name="pageTitle">{{ __("Storage Providers") }}</x-slot>
@include("settings.server-providers.partials.providers-list")
</x-profile-layout>

View File

@ -0,0 +1,97 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'connect-provider')">
{{ __("Connect") }}
</x-primary-button>
<x-modal name="connect-provider" :show="request()->has('provider')">
@php
$oldProvider = old("provider", request()->input("provider") ?? "");
@endphp
<form
id="connect-provider-form"
hx-post="{{ route("server-providers.connect") }}"
hx-swap="outerHTML"
hx-select="#connect-provider-form"
hx-ext="disable-element"
hx-disable-element="#btn-connect-provider"
class="p-6"
x-data="{ provider: '{{ $oldProvider }}' }"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Connect to a Server Provider") }}
</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.server_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 === 'aws'">
<div class="mt-6">
<x-input-label for="key" value="Access Key" />
<x-text-input value="{{ old('key') }}" id="key" name="key" type="text" class="mt-1 w-full" />
@error("key")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="secret" value="Secret" />
<x-text-input
value="{{ old('secret') }}"
id="secret"
name="secret"
type="text"
class="mt-1 w-full"
/>
@error("secret")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</div>
<div x-show="['hetzner', 'digitalocean', 'vultr', 'linode'].includes(provider)" 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-provider" class="ml-3">
{{ __("Connect") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,18 @@
<x-modal name="delete-provider" :show="$errors->isNotEmpty()">
<form id="delete-provider-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 provider?</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,47 @@
<div>
<x-card-header>
<x-slot name="title">Server Providers</x-slot>
<x-slot name="description">You can connect to your server providers to create servers using their APIs</x-slot>
<x-slot name="aside">
@include("settings.server-providers.partials.connect-provider")
</x-slot>
</x-card-header>
<div x-data="{ deleteAction: '' }" class="space-y-3">
@if (count($providers) > 0)
@foreach ($providers as $provider)
<x-item-card>
<div class="flex-none">
<img
src="{{ asset("static/images/" . $provider->provider . ".svg") }}"
class="h-10 w-10"
alt=""
/>
</div>
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
<span class="mb-1">{{ $provider->profile }}</span>
<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
x-on:click="deleteAction = '{{ route('server-providers.delete', $provider->id) }}'; $dispatch('open-modal', 'delete-provider')"
>
<x-heroicon-o-trash class="h-5 w-5" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
@include("settings.server-providers.partials.delete-provider")
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any server providers yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>

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>

View File

@ -0,0 +1,5 @@
<x-profile-layout>
<x-slot name="pageTitle">{{ __("SSH Keys") }}</x-slot>
@include("settings.ssh-keys.partials.keys-list")
</x-profile-layout>

View File

@ -0,0 +1,50 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'add-key')">
{{ __("Add new Key") }}
</x-primary-button>
<x-modal name="add-key">
<form
id="add-ssh-key-form"
hx-post="{{ route("ssh-keys.add") }}"
hx-swap="outerHTML"
hx-select="#add-ssh-key-form"
hx-ext="disable-element"
hx-disable-element="#btn-add-key"
class="p-6"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Add new Key") }}
</h2>
<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 class="mt-6">
<x-input-label for="public_key" :value="__('Public Key')" />
<x-textarea id="public_key" name="public_key" class="mt-1 w-full" rows="5">
{{ old("public_key") }}
</x-textarea>
@error("public_key")
<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-add-key" class="ml-3">
{{ __("Add") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,18 @@
<x-modal name="delete-ssh-key" :show="$errors->isNotEmpty()">
<form id="delete-ssh-key-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 key?</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,42 @@
<div>
<x-card-header>
<x-slot name="title">{{ __("SSH Keys") }}</x-slot>
<x-slot name="description">
{{ __("Add or modify your ssh keys") }}
</x-slot>
<x-slot name="aside">
@include("settings.ssh-keys.partials.add-key")
</x-slot>
</x-card-header>
<div x-data="{ deleteAction: '' }" class="space-y-3">
@if (count($keys) > 0)
@foreach ($keys as $key)
<x-item-card>
<div class="flex flex-grow flex-col items-start justify-center">
<span class="mb-1">{{ $key->name }}</span>
<span class="text-sm text-gray-400">
<x-datetime :value="$key->created_at" />
</span>
</div>
<div class="flex items-center">
<div class="inline">
<x-icon-button
x-on:click="deleteAction = '{{ route('ssh-keys.delete', $key->id) }}'; $dispatch('open-modal', 'delete-ssh-key')"
>
<x-heroicon-o-trash class="h-5 w-5" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
@include("settings.ssh-keys.partials.delete-ssh-key")
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any keys yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>

View File

@ -0,0 +1,5 @@
<x-profile-layout>
<x-slot name="pageTitle">{{ __("Storage Providers") }}</x-slot>
@include("settings.storage-providers.partials.providers-list")
</x-profile-layout>

View File

@ -0,0 +1,156 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'connect-provider')">
{{ __("Connect") }}
</x-primary-button>
<x-modal name="connect-provider">
@php
$oldProvider = old("provider", request()->input("provider") ?? "");
@endphp
<form
id="connect-storage-provider-form"
hx-post="{{ route("storage-providers.connect") }}"
hx-swap="outerHTML"
hx-select="#connect-storage-provider-form"
hx-ext="disable-element"
hx-disable-element="#btn-connect-storage-provider"
class="p-6"
x-data="{ provider: '{{ $oldProvider }}' }"
>
@csrf
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __("Connect to a Storage Provider") }}
</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.storage_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 === 'dropbox'" 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 x-show="provider === 'ftp'" class="mt-6">
<div class="grid grid-cols-2 gap-2">
<div class="mt-6">
<x-input-label for="host" value="Host" />
<x-text-input value="{{ old('host') }}" id="host" name="host" type="text" class="mt-1 w-full" />
@error("host")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="port" value="Port" />
<x-text-input value="{{ old('port') }}" id="port" name="port" type="text" class="mt-1 w-full" />
@error("port")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</div>
<div class="mt-6">
<x-input-label for="path" value="Path" />
<x-text-input value="{{ old('path') }}" id="path" name="path" type="text" class="mt-1 w-full" />
@error("path")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="grid grid-cols-2 gap-2">
<div class="mt-6">
<x-input-label for="username" value="Username" />
<x-text-input
value="{{ old('username') }}"
id="username"
name="username"
type="text"
class="mt-1 w-full"
/>
@error("username")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="password" value="Password" />
<x-text-input
value="{{ old('password') }}"
id="password"
name="password"
type="text"
class="mt-1 w-full"
/>
@error("password")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</div>
<div class="grid grid-cols-2 gap-2">
<div class="mt-6">
<x-input-label for="ssl" :value="__('SSL')" />
<x-select-input id="ssl" name="ssl" class="mt-1 w-full">
<option value="1" @if(old('ssl')) selected @endif>
{{ __("Yes") }}
</option>
<option value="0" @if(!old('ssl')) selected @endif>
{{ __("No") }}
</option>
</x-select-input>
@error("ssl")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
<div class="mt-6">
<x-input-label for="passive" :value="__('Passive')" />
<x-select-input id="passive" name="passive" class="mt-1 w-full">
<option value="1" @if(old('passive')) selected @endif>
{{ __("Yes") }}
</option>
<option value="0" @if(!old('passive')) selected @endif>
{{ __("No") }}
</option>
</x-select-input>
@error("passive")
<x-input-error class="mt-2" :messages="$message" />
@enderror
</div>
</div>
</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-storage-provider" class="ml-3">
{{ __("Connect") }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,18 @@
<x-modal name="delete-provider" :show="$errors->isNotEmpty()">
<form id="delete-provider-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 provider?</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,64 @@
<div>
<x-card-header>
<x-slot name="title">Storage Providers</x-slot>
<x-slot name="description">You can connect to your storage providers</x-slot>
<x-slot name="aside">
@include("settings.storage-providers.partials.connect-provider")
</x-slot>
</x-card-header>
<div x-data="{ deleteAction: '' }" class="space-y-3">
@if (count($providers) > 0)
@foreach ($providers as $provider)
<x-item-card>
<div class="flex-none">
@if ($provider->provider == \App\Enums\StorageProvider::FTP)
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="h-10 w-10 text-gray-600 dark:text-gray-200"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
/>
</svg>
@else
<img
src="{{ asset("static/images/" . $provider->provider . ".svg") }}"
class="h-10 w-10"
alt=""
/>
@endif
</div>
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
<span class="mb-1">{{ $provider->profile }}</span>
<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
x-on:click="deleteAction = '{{ route('storage-providers.delete', $provider->id) }}'; $dispatch('open-modal', 'delete-provider')"
>
<x-heroicon-o-trash class="h-5 w-5" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
@include("settings.storage-providers.partials.delete-storage-provider")
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any storage providers yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>