add better render for summary and result

This commit is contained in:
Simon Vieille 2019-07-31 11:35:41 +02:00
parent 6203df8a73
commit b7b1330bde
Signed by: deblan
GPG Key ID: 03383D15A1D31745
3 changed files with 25 additions and 16 deletions

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"

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 %}

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) }}
└─────────────┴─────┘