This commit is contained in:
Saeed Vaziry
2023-07-02 12:47:50 +02:00
commit 5c72f12490
825 changed files with 41659 additions and 0 deletions

View File

@ -0,0 +1,36 @@
<div>
<x-secondary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'add-existing-key')">
{{ __('Add existing Key') }}
</x-secondary-button>
<x-modal name="add-existing-key">
<form wire:submit.prevent="add" class="p-6">
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
{{ __('Add existing Key') }}
</h2>
<div class="mt-6">
<x-input-label for="key_id" :value="__('SSH Key')" />
<x-select-input wire:model.defer="key_id" id="key_id" name="key_id" class="mt-1 w-full">
<option value="" selected disabled>{{ __("Select") }}</option>
@foreach($keys as $key)
<option value="{{ $key->id }}" @if($key->id === $key_id) selected @endif>{{ $key->name }}</option>
@endforeach
</x-select-input>
@error('key_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 class="ml-3" @added.window="$dispatch('close')">
{{ __('Add') }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,39 @@
<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 wire:submit.prevent="add" class="p-6">
<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 wire:model.defer="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 wire:model.defer="public_key" id="public_key" name="public_key" class="mt-1 w-full" rows="5" />
@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 class="ml-3" @added.window="$dispatch('close')">
{{ __('Add') }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,9 @@
@if($status == \App\Enums\SshKeyStatus::ADDED)
<x-status status="success">{{ $status }}</x-status>
@endif
@if($status == \App\Enums\SshKeyStatus::ADDING)
<x-status status="warning">{{ $status }}</x-status>
@endif
@if($status == \App\Enums\SshKeyStatus::DELETING)
<x-status status="danger">{{ $status }}</x-status>
@endif

View File

@ -0,0 +1,50 @@
<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">
<div class="flex items-center">
<div>
<livewire:server-ssh-keys.add-new-key :server="$server" />
</div>
<div class="ml-2">
<livewire:server-ssh-keys.add-existing-key :server="$server" />
</div>
</div>
</x-slot>
</x-card-header>
<div x-data="" 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">
@include('livewire.server-ssh-keys.partials.status', ['status' => $key->pivot->status])
<div class="inline">
<x-icon-button x-on:click="$wire.deleteId = '{{ $key->id }}'; $dispatch('open-modal', 'delete-key')">
<x-heroicon-o-trash class="w-4 h-4" />
</x-icon-button>
</div>
</div>
</x-item-card>
@endforeach
<x-confirm-modal
name="delete-key"
:title="__('Confirm')"
:description="__('Are you sure that you want to delete this key?')"
method="delete"
/>
@else
<x-simple-card>
<div class="text-center">
{{ __("You haven't connected to any keys yet!") }}
</div>
</x-simple-card>
@endif
</div>
</div>