mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
Merge (#127)
This commit is contained in:
50
resources/views/settings/ssh-keys/partials/add-key.blade.php
Normal file
50
resources/views/settings/ssh-keys/partials/add-key.blade.php
Normal 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>
|
@ -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>
|
@ -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 name="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>
|
Reference in New Issue
Block a user