This commit is contained in:
Andras Bacsai
2023-06-07 16:47:10 +02:00
parent 6e084db3d9
commit 0f18fbc24c
6 changed files with 88 additions and 54 deletions

View File

@@ -1,9 +1,9 @@
@props([
'id' => $attributes->has('id') || $attributes->has('label'),
'required' => $attributes->has('required'),
'id' => $attributes->has('id'),
'label' => $attributes->has('label'),
'required' => null,
'disabled' => null,
'helper' => $attributes->has('helper'),
'instantSave' => $attributes->has('instantSave'),
'noDirty' => $attributes->has('noDirty'),
])
@@ -39,7 +39,10 @@
</span>
</label>
@endif
<textarea {{ $attributes }} name={{ $id }} wire:model.defer={{ $value ?? $id }}
<textarea {{ $attributes }}
@if ($id) name={{ $id }} wire:model.defer={{ $id }} @endisset
@if ($disabled !== null) disabled @endif
@if ($required !== null) required @endif name={{ $id }} wire:model.defer={{ $value ?? $id }}
@if (!$noDirty) wire:dirty.class="input-warning" @endif></textarea>
@error($id)
<label class="label">

View File

@@ -1,11 +1,13 @@
<div>
<form class="flex flex-col gap-2 " wire:submit.prevent='createPrivateKey'>
<x-forms.input id="name" label="Name" required />
<x-forms.input id="description" label="Description" />
<form class="flex flex-col gap-2" wire:submit.prevent='createPrivateKey'>
<div class="flex gap-2">
<x-forms.input id="name" label="Name" required />
<x-forms.input id="description" label="Description" />
</div>
<x-forms.textarea id="value" rows="10" placeholder="-----BEGIN OPENSSH PRIVATE KEY-----"
label="Private Key" required />
<x-forms.button type="submit" wire.click.prevent>
Save
Save Private Key
</x-forms.button>
</form>
</div>

View File

@@ -1,14 +1,24 @@
<div>
<form class="flex flex-col gap-1" wire:submit.prevent='submit'>
<h1>New Server</h1>
<x-forms.input id="name" label="Name" required />
<x-forms.input id="description" label="Description" />
<x-forms.input id="ip" label="IP Address" required
helper="Could be IP Address (127.0.0.1) or Domain Name (duckduckgo.com)." />
<x-forms.input id="user" label="User" required />
<x-forms.input type="number" id="port" label="Port" required />
<label>Private Key</label>
<x-forms.select wire:model.defer="private_key_id">
<form class="flex flex-col gap-2" wire:submit.prevent='submit'>
<h1>Create a new Server</h1>
<div class="pb-5 text-sm breadcrumbs">
<ul>
<li>
Servers are the main blocks of your infrastructure.
</li>
</ul>
</div>
<div class="flex gap-2">
<x-forms.input id="name" label="Name" required />
<x-forms.input id="description" label="Description" />
</div>
<div class="flex gap-2">
<x-forms.input id="ip" label="IP Address" required
helper="Could be IP Address (127.0.0.1) or Domain Name (duckduckgo.com)." />
<x-forms.input id="user" label="User" required />
<x-forms.input type="number" id="port" label="Port" required />
</div>
<x-forms.select label="Private Key" wire:model.defer="private_key_id">
<option disabled>Select a private key</option>
@foreach ($private_keys as $key)
@if ($loop->first)
@@ -18,9 +28,10 @@
@endif
@endforeach
</x-forms.select>
<x-forms.checkbox instantSave noDirty id="is_part_of_swarm" label="Is it part of a Swarm cluster?" />
<x-forms.checkbox class="pb-8" disabled instantSave noDirty id="is_part_of_swarm"
label="Is it part of a Swarm cluster?" />
<x-forms.button type="submit">
Save
Save Server
</x-forms.button>
</form>
</div>

View File

@@ -1,4 +1,11 @@
<x-layout>
<h1>Add Private Key</h1>
<h1>Create a new Private Key</h1>
<div class="pb-5 text-sm breadcrumbs">
<ul>
<li>
Private Keys are used for connection to servers.
</li>
</ul>
</div>
<livewire:private-key.create />
</x-layout>