Fix a display bug with IP aliasing

This commit is contained in:
Dane Everitt 2016-09-17 14:51:27 -04:00
parent 2afd3e49ab
commit fd8417b5de
4 changed files with 7 additions and 6 deletions

View File

@ -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')

View File

@ -46,7 +46,7 @@
<td><a href="/admin/servers/view/{{ $server->id }}">{{ $server->name }}</a>@if($server->suspended === 1) <span class="label label-warning">Suspended</span>@endif</td>
<td><a href="/admin/users/view/{{ $server->owner }}">{{ $server->a_ownerEmail }}</a></td>
<td class="hidden-xs"><a href="/admin/nodes/view/{{ $server->node }}">{{ $server->a_nodeName }}</a></td>
<td><code>{{ $server->ip_alias }}:{{ $server->port }}</code> @if($server->ip !== $server->ip_alias)<span class="label label-default">alias</span>@endif</td>
<td><code>@if(!is_null($server->ip_alias)){{ $server->ip_alias }}@else{{ $server->ip }}@endif:{{ $server->port }}</code> @if(!is_null($server->ip_alias))<span class="label label-default">alias</span>@endif</td>
<td class="hidden-xs"><code>{{ $server->username }}</code></td>
</tr>
@endforeach

View File

@ -115,7 +115,7 @@
<tr>
<td>Connection Alias</td>
<td>
@if($server->ip !== $server->ip_alias)
@if(!is_null($server->ip_alias))
<code>{{ $server->ip_alias }}:{{ $server->port }}</code>
@else
<span class="label label-default">No Alias Assigned</span>
@ -236,7 +236,7 @@
<span class="input-group-addon">
<input type="radio" @if($assignment->ip == $server->ip && $assignment->port == $server->port) checked="checked" @endif name="default" value="{{ $assignment->ip }}:{{ $assignment->port }}"/>
</span>
<input type="text" class="form-control" value="{{ $assignment->ip_alias }}:{{ $assignment->port }}@if($assignment->ip !== $assignment->ip_alias) (alias of {{ $assignment->ip }})@endif" readonly />
<input type="text" class="form-control" value="@if(!is_null($assignment->ip_alias)){{ $assignment->ip_alias }}@else{{ $assignment->ip }}@endif:{{ $assignment->port }} @if(!is_null($assignment->ip_alias))(alias of {{ $assignment->ip }})@endif" readonly />
</div>
@endforeach
</div>
@ -247,7 +247,7 @@
<div>
<select name="add_additional[]" class="form-control" multiple>
@foreach ($unassigned as $assignment)
<option value="{{ $assignment->ip }}:{{ $assignment->port }}">{{ $assignment->ip_alias }}:{{ $assignment->port }}@if($assignment->ip !== $assignment->ip_alias) (alias of {{ $assignment->ip }})@endif</option>
<option value="{{ $assignment->ip }}:{{ $assignment->port }}">@if(!is_null($assignment->ip_alias)){{ $assignment->ip_alias }}@else{{ $assignment->ip }}@endif:{{ $assignment->port }} @if(!is_null($assignment->ip_alias))(alias of {{ $assignment->ip }})@endif</option>
@endforeach
</select>
</div>
@ -260,7 +260,7 @@
<div>
<select name="remove_additional[]" class="form-control" multiple>
@foreach ($assigned as $assignment)
<option value="{{ $assignment->ip }}:{{ $assignment->port }}" @if($assignment->ip == $server->ip && $assignment->port == $server->port) disabled @endif>{{ $assignment->ip_alias }}:{{ $assignment->port }}@if($assignment->ip !== $assignment->ip_alias) (alias of {{ $assignment->ip }})@endif</option>
<option value="{{ $assignment->ip }}:{{ $assignment->port }}">@if(!is_null($assignment->ip_alias)){{ $assignment->ip_alias }}@else{{ $assignment->ip }}@endif:{{ $assignment->port }} @if(!is_null($assignment->ip_alias))(alias of {{ $assignment->ip }})@endif</option>
@endforeach
</select>
</div>

View File

@ -59,7 +59,7 @@
@endif
<td><a href="/server/{{ $server->uuidShort }}">{{ $server->name }}</a></td>
<td>{{ $server->nodeName }} ({{ $server->a_locationShort }})</td>
<td><code>{{ $server->ip_alias }}:{{ $server->port }}</code></td>
<td><code>@if(!is_null($server->ip_alias)){{ $server->ip_alias }}@else{{ $server->ip }}@endif:{{ $server->port }}</code></td>
<td class="text-center" data-action="players">--</td>
<td class="text-center"><span data-action="memory">--</span> / {{ $server->memory === 0 ? '&infin;' : $server->memory }} MB</td>
<td class="text-center"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>