Browse Source

add better render for summary and result

master
Simon Vieille 3 months ago
parent
commit
b7b1330bde
Signed by: Simon Vieille <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
3 changed files with 25 additions and 16 deletions
  1. 1
    1
      bin/vhost-add
  2. 5
    2
      src/templates/result.twig
  3. 19
    13
      src/templates/summary.twig

+ 1
- 1
bin/vhost-add View File

@@ -151,5 +151,5 @@ export USER_PASSWORD
TMP_FILE="/tmp/vhost-add-$(tr -dc "qwertQWERTasdfgASDFGzxcvbZXCVB" < /dev/urandom | head -c 16)"
template result > "$TMP_FILE"
chmod 600 "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 8 0
whiptail --textbox "$TMP_FILE" 25 80
rm "$TMP_FILE"

+ 5
- 2
src/templates/result.twig View File

@@ -1,2 +1,5 @@
Username: {{ SYSTEM_USER_USERNAME }}
Password: {{ USER_PASSWORD }}
{% extends 'summary.twig' %}

{% block user_password %}
│ PASSWORD │ {{ '%- 25s'|format(USER_PASSWORD) }} │
{% endblock %}

+ 19
- 13
src/templates/summary.twig View File

@@ -1,13 +1,19 @@
DOMAIN: {{ DOMAIN }}
DOMAIN_ALIASES: {{ DOMAIN }}
DOCUMENT_ROOT: {{ DOCUMENT_ROOT }}

SYSTEM_USER_USERNAME: {{ SYSTEM_USER_USERNAME }}
SYSTEM_USER_GROUP: {{ SYSTEM_USER_GROUP }}

WEB_HTTP: {{ WEB_HTTP }}
WEB_HTTPS: {{ WEB_HTTPS }}
WEB_HTTPS_FORCE: {{ WEB_HTTPS_FORCE }}

PHP_ENABLED: {{ PHP_ENABLED }}
PHP_VERSION: {{ PHP_VERSION }}
┌───────────┬─────────────────────────────────────────────────────────┐
│ DOMAIN │ {{ '%- 55s'|format(DOMAIN) }} │
│ ALIASES │ {{ '%- 55s'|format(DOMAIN_ALIASES) }} │
│ DIRECTORY │ {{ '%- 55s'|format(DOCUMENT_ROOT) }} │
└───────────┴─────────────────────────────────────────────────────────┘
┌──────────┬───────────────────────────┐
│ USERNAME │ {{ '%- 25s'|format(SYSTEM_USER_USERNAME) }} │
{% block user_password %}{% endblock %}
│ GROUP │ {{ '%- 25s'|format(SYSTEM_USER_GROUP) }} │
└──────────┴───────────────────────────┘
┌──────────────┬─────┐
│ HTTP │ {{ '%- 3s'|format(WEB_HTTP) }} │
│ HTTPS │ {{ '%- 3s'|format(WEB_HTTPS) }} │
│ HTTP → HTTPS │ {{ '%- 3s'|format(WEB_HTTPS_FORCE) }} │
└──────────────┴─────┘
┌─────────────┬─────┐
│ PHP ENABLED │ {{ '%- 3s'|format(PHP_ENABLED) }} │
│ PHP VERSION │ {{ '%- 3s'|format(PHP_VERSION) }} │
└─────────────┴─────┘

Loading…
Cancel
Save