This commit is contained in:
Andras Bacsai 2023-06-22 09:38:44 +02:00
parent cfe9aed42a
commit d5d671bac1
5 changed files with 19 additions and 18 deletions

View File

@ -13,12 +13,14 @@ class Show extends Component
public function scan()
{
$alreadyAddedNetworks = $this->server->standaloneDockers;
ray($alreadyAddedNetworks);
$networks = instant_remote_process(['docker network ls --format "{{json .}}"'], $this->server, false);
$this->networks = format_docker_command_output_to_json($networks)->filter(function ($network) {
return $network['Name'] !== 'bridge' && $network['Name'] !== 'host' && $network['Name'] !== 'none';
})->filter(function ($network) use ($alreadyAddedNetworks) {
return !$alreadyAddedNetworks->contains('network', $network['Name']);
});
if ($this->networks->count() === 0) {
$this->emit('success', 'No new networks found.');
}
}
}

View File

@ -13,9 +13,6 @@
class ServerSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$root_team = Team::find(0);

View File

@ -1,6 +1,6 @@
<div>
<div class="flex items-end gap-2">
<h1>Destinations</h1>
<h2>Destinations</h2>
<a href="{{ route('destination.new', ['server_id' => $server->id]) }}">
<x-forms.button>Add a new destination</x-forms.button>
</a>
@ -19,14 +19,14 @@
</div>
<div class="grid gap-2 pt-2">
@if (count($networks) > 0)
<h3>Scanned available Destinations</h3>
<h4>Found Destinations</h4>
@endif
@foreach ($networks as $network)
<div class="flex gap-2 w-96">
<div class="flex gap-2 w-96">
<div class="w-32">{{ data_get($network, 'Name') }}</div>
<a
href="{{ route('destination.new', ['server_id' => $server->id, 'network_name' => data_get($network, 'Name')]) }}">
<x-forms.button>Add to Coolify</x-forms.button>
<x-forms.button>Configure</x-forms.button>
</a>
</div>
@endforeach

View File

@ -40,13 +40,15 @@
<x-forms.button wire:click.prevent='validateServer'>
Check Server Details
</x-forms.button>
<x-forms.button wire:click.prevent='installDocker' isHighlighted>
@if ($server->settings->is_usable)
Reconfigure Docker Engine
@else
Install Docker Engine
@endif
</x-forms.button>
@if ($server->id !== 0)
<x-forms.button wire:click.prevent='installDocker' isHighlighted>
@if ($server->settings->is_usable)
Reconfigure Docker Engine
@else
Install Docker Engine
@endif
</x-forms.button>
@endif
</div>
@else
<div class="w-full">
@ -59,8 +61,8 @@
<livewire:activity-monitor :header="true" />
</div>
@isset($uptime)
<h4 class="pb-3">Server Info</h4>
<div class="">
<h3 class="pb-3">Server Info</h3>
<div class="py-2 pb-4">
<p>Uptime: {{ $uptime }}</p>
@isset($dockerVersion)
<p>Docker Engine {{ $dockerVersion }}</p>

View File

@ -1,6 +1,6 @@
<div>
<div class="flex items-end gap-2 pb-6 ">
<h1>Private Key</h1>
<h2>Private Key</h2>
<a href="{{ route('private-key.new') }}">
<x-forms.button>Add a new Private Key</x-forms.button>
</a>