Merge branch 'v4-next' into patricio-deploy-proxy

This commit is contained in:
Joao Patricio 2023-05-03 09:33:01 +01:00
commit cc51b1d394
6 changed files with 39 additions and 19 deletions

View File

@ -54,6 +54,11 @@ class Form extends Component
} catch (\Exception $e) {
}
}
public function delete()
{
$this->server->delete();
redirect()->route('dashboard');
}
public function submit()
{
$this->validate();

View File

@ -45,6 +45,10 @@ class ByIp extends Component
}
public function submit()
{
if (!$this->private_key_id) {
$this->addError('private_key_id', 'The private key field is required.');
return;
}
$server = Server::create([
'name' => $this->name,
'description' => $this->description,

View File

@ -16,9 +16,9 @@ class AppServiceProvider extends ServiceProvider
*/
public function register(): void
{
if (config('app.env') === 'production' && Str::contains(config('coolify.version'), ['nightly'])) {
Process::run('php artisan migrate:fresh --force --seed --seeder=ProductionSeeder');
}
// if (config('app.env') === 'production' && Str::contains(config('coolify.version'), ['nightly'])) {
// Process::run('php artisan migrate:fresh --force --seed --seeder=ProductionSeeder');
// }
}
/**

View File

@ -19,6 +19,7 @@ class FormInput extends Component
public string|null $type = 'text',
public bool $instantSave = false,
public bool $disabled = false,
public bool $hidden = false
) {
}

View File

@ -11,7 +11,7 @@
<x-form-input id="server.user" label="User" readonly />
<x-form-input type="number" id="server.port" label="Port" readonly />
@else
<x-form-input id="server.ip" label="IP Address" required />
<x-form-input id="server.ip" label="IP Address" required readonly />
<x-form-input id="server.user" label="User" required />
<x-form-input type="number" id="server.port" label="Port" required />
@endif
@ -22,6 +22,9 @@
Submit
</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> --}}
</div>
</form>

View File

@ -1,26 +1,33 @@
<div>
<form class="flex flex-col" wire:submit.prevent='submit'>
<x-form-input id="name" label="Name" required />
<x-form-input id="description" label="Description" required />
<x-form-input id="description" label="Description" />
<x-form-input id="ip" label="IP Address" required />
<x-form-input id="user" label="User" />
<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">
Submit
</button>
</form>
<h1>Select a private key</h1>
@foreach ($private_keys as $key)
<button @if ($private_key_id == $key->id) class="bg-green-500" @endif
wire:click="setPrivateKey('{{ $key->id }}')">{{ $key->name }}</button>
@endforeach
<h2>Add a new One</h2>
<form wire:submit.prevent='addPrivateKey'>
<x-form-input id="new_private_key_name" label="Name" required />
<x-form-input id="new_private_key_description" label="Longer Description" />
<x-form-input type="textarea" id="new_private_key_value" label="Private Key" required />
<button type="submit">
Submit
</button>
</form>
<div class="flex gap-4">
<div>
<h1>Select a private key</h1>
@foreach ($private_keys as $key)
<button @if ($private_key_id == $key->id) class="bg-green-500" @endif
wire:click.defer="setPrivateKey('{{ $key->id }}')">{{ $key->name }}</button>
@endforeach
</div>
<div>
<h2>Add a new One</h2>
<form class="flex flex-col gap-2" wire:submit.prevent='addPrivateKey'>
<x-form-input id="new_private_key_name" label="Name" required />
<x-form-input id="new_private_key_description" label="Longer Description" />
<x-form-input type="textarea" id="new_private_key_value" label="Private Key" required />
<button type="submit">
Submit
</button>
</form>
</div>
</div>
</div>