delete server
This commit is contained in:
@@ -54,6 +54,11 @@ class Form extends Component
|
|||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$this->server->delete();
|
||||||
|
redirect()->route('dashboard');
|
||||||
|
}
|
||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
$this->validate();
|
$this->validate();
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ class ByIp extends Component
|
|||||||
}
|
}
|
||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
|
if (!$this->private_key_id) {
|
||||||
|
$this->addError('private_key_id', 'The private key field is required.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
$server = Server::create([
|
$server = Server::create([
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class FormInput extends Component
|
|||||||
public string|null $type = 'text',
|
public string|null $type = 'text',
|
||||||
public bool $instantSave = false,
|
public bool $instantSave = false,
|
||||||
public bool $disabled = false,
|
public bool $disabled = false,
|
||||||
|
public bool $hidden = false
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
<button wire:click.prevent='checkServer'>Check Server</button>
|
<button wire:click.prevent='checkServer'>Check Server</button>
|
||||||
|
<button class="bg-red-500" @confirm.window="$wire.delete()"
|
||||||
|
x-on:click="toggleConfirmModal('Are you sure you would like to delete this application?')">
|
||||||
|
Delete</button>
|
||||||
{{-- <button wire:click.prevent='installDocker'>Install Docker</button> --}}
|
{{-- <button wire:click.prevent='installDocker'>Install Docker</button> --}}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -5,22 +5,29 @@
|
|||||||
<x-form-input id="ip" label="IP Address" required />
|
<x-form-input id="ip" label="IP Address" required />
|
||||||
<x-form-input id="user" label="User" />
|
<x-form-input id="user" label="User" />
|
||||||
<x-form-input type="number" id="port" label="Port" />
|
<x-form-input type="number" id="port" label="Port" />
|
||||||
|
<x-form-input id="private_key_id" label="Private Key" required hidden />
|
||||||
<button class="mt-4" type="submit">
|
<button class="mt-4" type="submit">
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<h1>Select a private key</h1>
|
<div class="flex gap-4">
|
||||||
@foreach ($private_keys as $key)
|
<div>
|
||||||
<button @if ($private_key_id == $key->id) class="bg-green-500" @endif
|
<h1>Select a private key</h1>
|
||||||
wire:click="setPrivateKey('{{ $key->id }}')">{{ $key->name }}</button>
|
@foreach ($private_keys as $key)
|
||||||
@endforeach
|
<button @if ($private_key_id == $key->id) class="bg-green-500" @endif
|
||||||
<h2>Add a new One</h2>
|
wire:click.defer="setPrivateKey('{{ $key->id }}')">{{ $key->name }}</button>
|
||||||
<form wire:submit.prevent='addPrivateKey'>
|
@endforeach
|
||||||
<x-form-input id="new_private_key_name" label="Name" required />
|
</div>
|
||||||
<x-form-input id="new_private_key_description" label="Longer Description" />
|
<div>
|
||||||
<x-form-input type="textarea" id="new_private_key_value" label="Private Key" required />
|
<h2>Add a new One</h2>
|
||||||
<button type="submit">
|
<form class="flex flex-col gap-2" wire:submit.prevent='addPrivateKey'>
|
||||||
Submit
|
<x-form-input id="new_private_key_name" label="Name" required />
|
||||||
</button>
|
<x-form-input id="new_private_key_description" label="Longer Description" />
|
||||||
</form>
|
<x-form-input type="textarea" id="new_private_key_value" label="Private Key" required />
|
||||||
|
<button type="submit">
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user