From c04a177847ecb692b0b5f8a4d334aee5bf847b32 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 7 Jan 2024 23:14:03 +0200 Subject: [PATCH] add server descriptions support --- .env | 2 +- public/css/default.css | 5 +++++ src/Controller/MainController.php | 1 + templates/default/main/index.html.twig | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.env b/.env index dc17b85..4b75519 100644 --- a/.env +++ b/.env @@ -43,7 +43,7 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # HLState # Application version, used for API and media cache -APP_VERSION="1.0.1" +APP_VERSION="1.1.0" # Application name APP_NAME="HLState" diff --git a/public/css/default.css b/public/css/default.css index 2b7b394..1b8b74a 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -65,6 +65,11 @@ table td padding: 4px; } +ul +{ + margin-left: 16px; +} + header { display: block; diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 0ceb50b..550db68 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -173,6 +173,7 @@ class MainController extends AbstractController 'crc32server' => $crc32server, 'host' => $hlserver->host, 'port' => $hlserver->port, + 'description' => $hlserver->description, 'aliases' => $aliases, 'info' => $info, 'session' => $session, diff --git a/templates/default/main/index.html.twig b/templates/default/main/index.html.twig index b811246..59db429 100644 --- a/templates/default/main/index.html.twig +++ b/templates/default/main/index.html.twig @@ -54,6 +54,20 @@

#{{ server.crc32server }}

{% endif %}
+ {% if server.description.title %} +
+ {{ server.description.title }} +
+ {% endif %} + {% if server.description.links %} +
+ +
+ {% endif %}

{{ 'Address' | trans }}

{{ server.host }}:{{ server.port }} @@ -74,7 +88,7 @@ {% if server.aliases %}

{{ 'Alias' | trans }}

{% for alias in server.aliases %} -
+
{{ alias.host }}:{{ alias.port }} {% if alias.status %}