firewall: New styling for status stable

- Drop separate column for showing ports and add a dropdown icon next to the app
name.

- Manage widths so that table widths don't jump when expanded. Tested with
smaller screen size.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2020-12-15 13:50:52 -08:00 committed by Veiko Aasa
parent 123aa03231
commit 1e7ef0b3e4
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -5,6 +5,31 @@
{% load i18n %} {% load i18n %}
{% block page_head %}
<style type="text/css">
a.dropdown-toggle {
color: black;
}
a.dropdown-toggle:hover {
text-decoration: none;
}
td.service {
padding-left: 2rem;
}
.service-name {
font-style: italic;
}
.app-status,
.service-status {
width: 11rem;
}
</style>
{% endblock %}
{% block configuration %} {% block configuration %}
<h3>{% trans "Status" %}</h3> <h3>{% trans "Status" %}</h3>
@ -26,7 +51,6 @@
<div class="table-responsive"> <div class="table-responsive">
<table class='table table-autowidth'> <table class='table table-autowidth'>
<thead> <thead>
<th><center>{% trans "Show Ports" %}</center></th>
<th>{% trans "Service/Port" %}</th> <th>{% trans "Service/Port" %}</th>
<th>{% trans "Status" %}</th> <th>{% trans "Status" %}</th>
</thead> </thead>
@ -35,15 +59,15 @@
{% for component in components|dictsort:"name" %} {% for component in components|dictsort:"name" %}
{% if component.ports %} {% if component.ports %}
<tr> <tr>
<td> <td class="app-name">
<center> <a class="dropdown-toggle" href="#"
<button data-toggle="collapse" data-toggle="collapse" role="button"
data-target=".{{component.component_id}}" data-target=".{{component.component_id}}"
class="btn btn-info btn-sm">+</button> aria-expanded="false"
</center> aria-controls="{{component.component_id}}">
{{ component.name }}</a>
</td> </td>
<td><strong>{{ component.name }}</strong></td> <td class="app-status">
<td>
{% if component.is_enabled %} {% if component.is_enabled %}
<span class='badge badge-success'> <span class='badge badge-success'>
{% trans "Enabled" %}</span> {% trans "Enabled" %}</span>
@ -56,13 +80,13 @@
{% for port in component.ports_details %} {% for port in component.ports_details %}
<tr class="collapse {{component.component_id}}" <tr class="collapse {{component.component_id}}"
style="background-color: #f9f9f9" > style="background-color: #f9f9f9" >
<td></td> <td class='service'>
<td class='cell-indented'><em>{{ port.name }}</em>: <span class="service-name">{{ port.name }}</span>:
{% for port_number, protocol in port.details %} {% for port_number, protocol in port.details %}
{{ port_number }}/{{ protocol }} {{ port_number }}/{{ protocol }}
{% endfor %} {% endfor %}
</td> </td>
<td> <td class="service-status">
{% if port.name in internal_enabled_ports and port.name in external_enabled_ports %} {% if port.name in internal_enabled_ports and port.name in external_enabled_ports %}
<span class='badge badge-success'> <span class='badge badge-success'>
{% trans "Permitted" %}</span> {% trans "Permitted" %}</span>