From fd8417b5de27c876d51434e17b58f4f152f9c476 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 17 Sep 2016 14:51:27 -0400 Subject: [PATCH] Fix a display bug with IP aliasing --- app/Models/Server.php | 1 + resources/views/admin/servers/index.blade.php | 2 +- resources/views/admin/servers/view.blade.php | 8 ++++---- resources/views/base/index.blade.php | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Models/Server.php b/app/Models/Server.php index 655323e0..e0665ee1 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -131,6 +131,7 @@ class Server extends Model 'servers.*', 'nodes.name as nodeName', 'locations.short as a_locationShort', + 'allocations.ip', 'allocations.ip_alias', 'allocations.port' )->join('nodes', 'servers.node', '=', 'nodes.id') diff --git a/resources/views/admin/servers/index.blade.php b/resources/views/admin/servers/index.blade.php index 54eda116..a1bf5611 100644 --- a/resources/views/admin/servers/index.blade.php +++ b/resources/views/admin/servers/index.blade.php @@ -46,7 +46,7 @@ {{ $server->name }}@if($server->suspended === 1) Suspended@endif {{ $server->a_ownerEmail }} {{ $server->a_nodeName }} - {{ $server->ip_alias }}:{{ $server->port }} @if($server->ip !== $server->ip_alias)alias@endif + @if(!is_null($server->ip_alias)){{ $server->ip_alias }}@else{{ $server->ip }}@endif:{{ $server->port }} @if(!is_null($server->ip_alias))alias@endif {{ $server->username }} @endforeach diff --git a/resources/views/admin/servers/view.blade.php b/resources/views/admin/servers/view.blade.php index 5b5554d6..1f948b1b 100644 --- a/resources/views/admin/servers/view.blade.php +++ b/resources/views/admin/servers/view.blade.php @@ -115,7 +115,7 @@ Connection Alias - @if($server->ip !== $server->ip_alias) + @if(!is_null($server->ip_alias)) {{ $server->ip_alias }}:{{ $server->port }} @else No Alias Assigned @@ -236,7 +236,7 @@ ip == $server->ip && $assignment->port == $server->port) checked="checked" @endif name="default" value="{{ $assignment->ip }}:{{ $assignment->port }}"/> - + @endforeach @@ -247,7 +247,7 @@
@@ -260,7 +260,7 @@
diff --git a/resources/views/base/index.blade.php b/resources/views/base/index.blade.php index a8083625..6df1bc37 100644 --- a/resources/views/base/index.blade.php +++ b/resources/views/base/index.blade.php @@ -59,7 +59,7 @@ @endif {{ $server->name }} {{ $server->nodeName }} ({{ $server->a_locationShort }}) - {{ $server->ip_alias }}:{{ $server->port }} + @if(!is_null($server->ip_alias)){{ $server->ip_alias }}@else{{ $server->ip }}@endif:{{ $server->port }} -- -- / {{ $server->memory === 0 ? '∞' : $server->memory }} MB -- %