diff --git a/app/Http/Livewire/Destination/Form.php b/app/Http/Livewire/Destination/Form.php
new file mode 100644
index 000000000..437df49c6
--- /dev/null
+++ b/app/Http/Livewire/Destination/Form.php
@@ -0,0 +1,39 @@
+ 'required',
+ 'destination.network' => 'required',
+ 'destination.server.ip' => 'required',
+ ];
+ public function mount()
+ {
+ $standalone = StandaloneDocker::where('uuid', $this->destination_uuid)->first();
+ $swarm = SwarmDocker::where('uuid', $this->destination_uuid)->first();
+ if (!$standalone && !$swarm) {
+ abort(404);
+ }
+ $this->destination = $standalone ? $standalone->load(['server']) : $swarm->load(['server']);
+ }
+ public function submit()
+ {
+ $this->validate();
+ $this->destination->save();
+ }
+ public function delete()
+ {
+ instantRemoteProcess(['docker network rm -f ' . $this->destination->network], $this->destination->server);
+ $this->destination->delete();
+ return redirect()->route('dashboard');
+ }
+}
diff --git a/app/Http/Livewire/Destination/New/StandaloneDocker.php b/app/Http/Livewire/Destination/New/StandaloneDocker.php
index 7b1c1089b..bb555bf4b 100644
--- a/app/Http/Livewire/Destination/New/StandaloneDocker.php
+++ b/app/Http/Livewire/Destination/New/StandaloneDocker.php
@@ -5,6 +5,7 @@ namespace App\Http\Livewire\Destination\New;
use App\Models\Server;
use App\Models\StandaloneDocker as ModelsStandaloneDocker;
use Livewire\Component;
+use Visus\Cuid2\Cuid2;
class StandaloneDocker extends Component
{
@@ -12,7 +13,7 @@ class StandaloneDocker extends Component
public string $network;
public $servers;
- public int|null $server_id = null;
+ public int $server_id;
protected $rules = [
'name' => 'required|string',
@@ -21,13 +22,11 @@ class StandaloneDocker extends Component
];
public function mount()
{
- $this->name = generateRandomName();
$this->servers = Server::where('team_id', session('currentTeam')->id)->get();
+ $this->network = new Cuid2(7);
+ $this->name = generateRandomName();
}
- public function setServerId($server_id)
- {
- $this->server_id = $server_id;
- }
+
public function submit()
{
$this->validate();
diff --git a/resources/css/app.css b/resources/css/app.css
index 93d5c4896..d500237ff 100644
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -8,9 +8,13 @@ body {
a, a:visited {
@apply text-neutral-300 hover:text-purple-500;
}
-input, select, textarea {
- @apply border-none p-2 bg-neutral-800 text-white disabled:text-neutral-600;
+input, textarea {
+ @apply border-none p-2 bg-neutral-800 text-white disabled:text-neutral-600 read-only:text-neutral-600 read-only:select-none
}
+select {
+ @apply border-none p-2 bg-neutral-800 text-white disabled:text-neutral-600 read-only:select-none
+}
+
button {
@apply border-none px-2 p-1 cursor-pointer;
}
diff --git a/resources/views/components/inputs/button.blade.php b/resources/views/components/inputs/button.blade.php
index 74388b531..23e0e0f11 100644
--- a/resources/views/components/inputs/button.blade.php
+++ b/resources/views/components/inputs/button.blade.php
@@ -1,7 +1,7 @@
@props([
'isWarning' => null,
- 'defaultClass' => 'text-white bg-neutral-800 hover:bg-violet-600',
- 'defaultWarningClass' => 'text-white bg-red-500 hover:bg-red-600',
+ 'defaultClass' => 'text-white bg-neutral-800 hover:bg-violet-600 w-28',
+ 'defaultWarningClass' => 'text-white bg-red-500 hover:bg-red-600 w-28',
'loadingClass' => 'text-black bg-green-500',
'confirm' => null,
'confirmAction' => null,
diff --git a/resources/views/components/inputs/input.blade.php b/resources/views/components/inputs/input.blade.php
index a09af0496..eba849e9d 100644
--- a/resources/views/components/inputs/input.blade.php
+++ b/resources/views/components/inputs/input.blade.php
@@ -2,7 +2,6 @@
'id' => null,
'type' => 'text',
'required' => false,
- 'readonly' => false,
'label' => null,
'instantSave' => false,
'disabled' => false,
diff --git a/resources/views/components/inputs/select.blade.php b/resources/views/components/inputs/select.blade.php
new file mode 100644
index 000000000..722039a77
--- /dev/null
+++ b/resources/views/components/inputs/select.blade.php
@@ -0,0 +1,25 @@
+@props([
+ 'id' => null,
+ 'label' => null,
+ 'required' => false,
+])
+
+
+
+
+
+ @error($id)
+ Name: {{ data_get($destination, 'name') }} Server:{{ data_get($destination, 'server.ip') }}:{{ data_get($destination, 'server.port') }} Network: {{ data_get($destination, 'network') }} Uuid: {{ data_get($destination, 'uuid') }}Destination
-
IP: {{ $destination->server->ip }}
-Description: {{ $destination->server->description }}
+Server Name: {{ data_get($destination, 'server.name') }}
+ @if (data_get($destination, 'server.description')) +Description: {{ data_get($destination, 'server.description') }}
+ @endifDocker Network: {{ $destination->network }}
HostPath:{{ data_get($storage, 'host_path') }}
ContainerId:{{ data_get($storage, 'container_id') }}
@empty -No storage found.
+There are no storages added for this application.
@endforelse diff --git a/resources/views/livewire/project/new/public-git-repository.blade.php b/resources/views/livewire/project/new/public-git-repository.blade.php index ae36b76de..bd9cb6bcd 100644 --- a/resources/views/livewire/project/new/public-git-repository.blade.php +++ b/resources/views/livewire/project/new/public-git-repository.blade.php @@ -61,7 +61,7 @@ @if ($is_static)