{% extends "base.html" %} {% block content %} {% set attribute_name = "services" %} {% set methods = ["all"] %} {% set states = ["all", "draft", "online"] %} {% set draft_services = [] %} {% set online_services = [] %} {% for service in services %} {% if service['SERVER_NAME']['method'] not in methods %} {% if methods.append(service['SERVER_NAME']['method']) %}{% endif %} {% endif %} {% if service.get('IS_DRAFT', 'no') == "yes" %} {% if draft_services.append(1) %}{% endif %} {% else %} {% if online_services.append(1) %}{% endif %} {% endif %} {% endfor %} {# Get name of multiples #} {% set multiple_settings = [] %} {% for plugin in plugins %} {% for setting, value in plugin.get('settings', {}).items() %} {% if value.get("multiple", "") %} {% if multiple_settings.append(setting) %}{% endif %} {% endif %} {% endfor %} {% endfor %}
{% if services|length >= 4 %}
{% set infos = [ {"name" : "SERVICES TOTAL", "data" : services|length|string}, {"name" : "TOTAL DRAFT", "data" : draft_services|length|string}, {"name" : "TOTAL ONLINE", "data" : online_services|length|string}, ] %} {% include "card_info.html" %} {% set filters = [ { "type": "input", "name": "Search", "label": "search", "id": "service-name-keyword", "placeholder": "service name", "pattern": "(.*?)" }, { "type": "select", "name": "Method", "id": "method", "value": "all", "values": methods }, { "type": "select", "name": "State", "id": "state", "value": "all", "values": states } ] %} {% include "card_filter.html" %} {% include "filter_nomatch.html" %}
{% endif %}
{% if services|length == 0 %}
No service to show
{% endif %} {% if services|length > 0 %} {% for service in services %} {% set id_server_name = service["SERVER_NAME"]['value'].replace(".", "-") %}
{{ service["SERVER_NAME"]['value'] }}
{{ service["SERVER_NAME"]['method'] }}
{% if service.get('IS_DRAFT', "no") == "yes" and service["SERVER_NAME"]['method'] in ["ui", "default"] %} {% else %} {% endif %}
{% set details = [ { "name": "Reverse proxy", "settings": [ "USE_REVERSE_PROXY" ] }, { "name": "Serve files", "settings": [ "SERVE_FILES" ] }, { "name": "Remote PHP", "settings": [ "REMOTE_PHP" ] }, { "name": "HTTPS", "settings": [ "AUTO_LETS_ENCRYPT", "USE_CUSTOM_SSL", "GENERATE_SELF_SIGNED_SSL" ] }, { "name": "ModSecurity", "settings": [ "USE_MODSECURITY" ] }, { "name": "Bad behavior", "settings": [ "USE_BAD_BEHAVIOR" ] }, { "name": "Limit req", "settings": [ "USE_LIMIT_REQ" ] }, { "name": "DNSBL", "settings": [ "USE_DNSBL" ] } ] %}
{% for detail in details %} {% set use = [] %} {% for setting in detail['settings'] %} {% if service[setting]['value'] == 'yes' %} {% if use.append(1) %}{% endif %} {% endif %} {% endfor %}

{{ detail['name'] }}

{% if use %} yes {% else %} no {% endif %}

{% endfor %}
{% set action_buttons = [ { "name": "clone", "label": "clone service settings", "color": "emerald-500" }, { "name": "edit", "label": "edit service settings", "color": "yellow-500" } ] %} {% if service["SERVER_NAME"]['method'] == "ui" %} {% if action_buttons.append({"name" : "delete", "label" : "delete service settings", "color" : "red-500"}) %} {% endif %} {% endif %} {% for button in action_buttons %} {% endfor %}
{% endfor %} {% endif %}
{% include "services_modal.html" %} {% endblock content %}