Browse Source

update var name

main
ghost 10 months ago
parent
commit
776e6c6350
  1. 8
      src/Controller/ServerController.php
  2. 2
      templates/default/server/index.html.twig

8
src/Controller/ServerController.php

@ -77,15 +77,15 @@ class ServerController extends AbstractController @@ -77,15 +77,15 @@ class ServerController extends AbstractController
$online = [];
$players = [];
// Format name
// Format address
if (false === filter_var($server->getHost(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
{
$name = "{$server->getHost()}:{$server->getPort()}";
$address = "{$server->getHost()}:{$server->getPort()}";
}
else
{
$name = "[{$server->getHost()}]:{$server->getPort()}";
$address = "[{$server->getHost()}]:{$server->getPort()}";
}
// Request server info
@ -167,7 +167,7 @@ class ServerController extends AbstractController @@ -167,7 +167,7 @@ class ServerController extends AbstractController
'request' => $request,
'server' =>
[
'name' => $name,
'address' => $address,
'crc32server' => $server->getCrc32Server(),
'host' => $server->getHost(),
'port' => $server->getPort(),

2
templates/default/server/index.html.twig

@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
{% block main_content %}
<div class="border-default padding-8-px margin-y-8-px">
<h2>
{{ server.name }}
{{ server.address }}
{% if server.status %}
<span class="color-success" title="{{ 'Online' | trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16">

Loading…
Cancel
Save