polish dashboards

This commit is contained in:
deflax 2017-07-13 17:32:24 +03:00
parent ddcad32cb1
commit 168fbde4e5
2 changed files with 49 additions and 15 deletions

View file

@ -29,7 +29,15 @@
</thead> </thead>
<tbody> <tbody>
{% for deploy in deployments %} {% for deploy in deployments %}
{% if deploy.enabled == False %}<tr class="danger">{% else %}<tr>{% endif %} {% if deploy.enabled == False %}
<tr class="danger">
{% else %}
{% if deploy.warning == True %}
<tr class="warning">
{% else %}
<tr>
{% endif %}
{% endif %}
<td><a href="{{ url_for('admin.dashboard', user_pid=deploy.user_id) }}">{{ deploy.owner.email }}</a></td> <td><a href="{{ url_for('admin.dashboard', user_pid=deploy.user_id) }}">{{ deploy.owner.email }}</a></td>
<td>{{ deploy.machine_id }}</td> <td>{{ deploy.machine_id }}</td>
<td>{{ deploy.machine_alias }}</font></td> <td>{{ deploy.machine_alias }}</font></td>
@ -63,7 +71,15 @@
</thead> </thead>
<tbody> <tbody>
{% for service in services %} {% for service in services %}
{% if service.enabled == False %}<tr class="danger">{% else %}<tr>{% endif %} {% if service.enabled == False %}
<tr class="danger">
{% else %}
{% if service.warning == True %}
<tr class="warning">
{% else %}
<tr>
{% endif %}
{% endif %}
<td><a href="{{ url_for('admin.dashboard', user_pid=service.user_id) }}">{{ service.owner.email }}</a></td> <td><a href="{{ url_for('admin.dashboard', user_pid=service.user_id) }}">{{ service.owner.email }}</a></td>
<td>{{ service.category }}</td> <td>{{ service.category }}</td>
<td>{{ service.description }}</td> <td>{{ service.description }}</td>
@ -94,7 +110,15 @@
</thead> </thead>
<tbody> <tbody>
{% for domain in domains %} {% for domain in domains %}
{% if domain.enabled == False %}<tr class="danger">{% else %}<tr>{% endif %} {% if domain.enabled == False %}
<tr class="danger">
{% else %}
{% if domain.warning == True %}
<tr class="warning">
{% else %}
<tr>
{% endif %}
{% endif %}
<td><a href="{{ url_for('admin.dashboard', user_pid=domain.user_id) }}">{{ domain.owner.email }}</a></td> <td><a href="{{ url_for('admin.dashboard', user_pid=domain.user_id) }}">{{ domain.owner.email }}</a></td>
<td><b><a href="http://{{ domain.fqdn }}">{{ domain.fqdn }}</a></b></td> <td><b><a href="http://{{ domain.fqdn }}">{{ domain.fqdn }}</a></b></td>
<td>{{ domain.date_expire }}</td> <td>{{ domain.date_expire }}</td>

View file

@ -138,6 +138,7 @@ addEventListener("DOMContentLoaded", function() {
<th>HDD</th> <th>HDD</th>
<th>Network</th> <th>Network</th>
<th>Control</th> <th>Control</th>
<th>Remote</th>
<th>Time Left</th> <th>Time Left</th>
</tr> </tr>
</thead> </thead>
@ -151,13 +152,14 @@ addEventListener("DOMContentLoaded", function() {
<td data-title="Disk">{{ deploy.machine_hdd }} GB</td> <td data-title="Disk">{{ deploy.machine_hdd }} GB</td>
<td data-title="Network">{% for addr in deploy.machine_addresses %} {{ addr.ip }}<br /> {% endfor %}</td> <td data-title="Network">{% for addr in deploy.machine_addresses %} {{ addr.ip }}<br /> {% endfor %}</td>
<td data-title="Control"> </td> <td data-title="Control"> </td>
<td data-title="Remote"> </td>
<td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/vmanager/activate/{{ deploy.machine_id }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Activate</td> <td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/vmanager/activate/{{ deploy.machine_id }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Activate</td>
{% else %} {% else %}
{% if deploy.warning == True %} {% if deploy.warning == True %}
<tr class="bg-warning"> <tr class="warning">
{% else %} {% else %}
<tr> <tr>
{% endif %} {% endif %}
<td data-title="Name"><a class="rrd" data-toggle="tooltip" title="ID# {{ deploy.machine_id }}<br />Deployment state: {{ status[deploy.machine_id] }}"><b>{% if status[deploy.machine_id] == 'running' %}<font color="green">{% else %}<font color="red">{% endif %}{{ deploy.machine_alias }}</font></b></a></td> <td data-title="Name"><a class="rrd" data-toggle="tooltip" title="ID# {{ deploy.machine_id }}<br />Deployment state: {{ status[deploy.machine_id] }}"><b>{% if status[deploy.machine_id] == 'running' %}<font color="green">{% else %}<font color="red">{% endif %}{{ deploy.machine_alias }}</font></b></a></td>
<td data-title="CPU"><a class="rrd" data-toggle="tooltip" title="<img src='data:image/png;base64,{{ rrd[deploy.machine_id]['cpu'] }}' />">{{ deploy.machine_cpu }} Cores</a></td> <td data-title="CPU"><a class="rrd" data-toggle="tooltip" title="<img src='data:image/png;base64,{{ rrd[deploy.machine_id]['cpu'] }}' />">{{ deploy.machine_cpu }} Cores</a></td>
<td data-title="Memory"><a class="rrd" data-toggle="tooltip" title="<img src='data:image/png;base64,{{ rrd[deploy.machine_id]['mem'] }}' />">{{ deploy.machine_mem }} MB</a></td> <td data-title="Memory"><a class="rrd" data-toggle="tooltip" title="<img src='data:image/png;base64,{{ rrd[deploy.machine_id]['mem'] }}' />">{{ deploy.machine_mem }} MB</a></td>
@ -172,7 +174,7 @@ addEventListener("DOMContentLoaded", function() {
<td data-title="Remote">{% if status[deploy.machine_id] == 'running' %} <td data-title="Remote">{% if status[deploy.machine_id] == 'running' %}
<button class="btn btn-default btn-info" onclick="window.open('/vmanager/vmvnc/{{ deploy.machine_id }}', '_blank');"><span class="glyphicon glyphicon-console" aria-hidden="true"></span> Console</button> <button class="btn btn-default btn-info" onclick="window.open('/vmanager/vmvnc/{{ deploy.machine_id }}', '_blank');"><span class="glyphicon glyphicon-console" aria-hidden="true"></span> Console</button>
{% if deploy.warning == True %} {% if deploy.warning == True %}
<td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/vmanager/activate/{{ deploy.machine_id }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Activate</button></td> <td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/vmanager/activate/{{ deploy.machine_id }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Renew ({{ deploy.daysleft }} days left)</button></td>
{% else %} {% else %}
<td data-title="Time Left">{{ deploy.daysleft }} day(s)</td> <td data-title="Time Left">{{ deploy.daysleft }} day(s)</td>
{% endif %} {% endif %}
@ -209,15 +211,23 @@ addEventListener("DOMContentLoaded", function() {
{% if service.enabled == False %} {% if service.enabled == False %}
<tr class="danger"> <tr class="danger">
{% else %} {% else %}
<tr> {% if service.warning == True %}
<tr class="warning">
{% else %}
<tr>
{% endif %}
{% endif %} {% endif %}
<td data-title="Category">{{ service.category }}</td> <td data-title="Category">{{ service.category }}</td>
<td data-title="Description" >{{ service.description }}</td> <td data-title="Description" >{{ service.description }}</td>
<td data-title="Last Charged">{{ moment(service.date_last_charge).format('lll') }} ({{ moment(service.date_last_charge).fromNow() }})</td> <td data-title="Last Charged">{{ moment(service.date_last_charge).format('lll') }} ({{ moment(service.date_last_charge).fromNow() }})</td>
{% if service.warning == True or service.enabled == True %} {% if service.enabled == False %}
<td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/smanager/activate/{{ service.pid }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Activate</button></td> <td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/smanager/activate/{{ service.pid }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Activate</button></td>
{% else %} {% else %}
{% if service.warning == True %}
<td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/smanager/activate/{{ service.pid }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Renew ({{ service.daysleft }} days left)</button></td>
{% else %}
<td data-title="Time Left">{{ service.daysleft }} day(s)</td> <td data-title="Time Left">{{ service.daysleft }} day(s)</td>
{% endif %}
{% endif %} {% endif %}
</tr > </tr >
{% endfor %} {% endfor %}
@ -248,14 +258,14 @@ addEventListener("DOMContentLoaded", function() {
<tr> <tr>
<td data-title="Domain"><b><a href="http://{{ domain.fqdn }}">{{ domain.fqdn }}</a></b></td> <td data-title="Domain"><b><a href="http://{{ domain.fqdn }}">{{ domain.fqdn }}</a></b></td>
<td data-title="Expiry Date">{{ domain.date_expire }}</td> <td data-title="Expiry Date">{{ domain.date_expire }}</td>
{% if domain.enabled == True %} {% if domain.enabled == False %}
<td data-title="Time Left">EXPIRED</td>
{% else %}
{% if domain.warning == True %} {% if domain.warning == True %}
<td data-title="Time Left"><button class="btn btn-default btn-success" onclick="window.open('/dmanager/activate/{{ domain.pid }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Activate</button></td> <td data-title="Time Left"><button class="btn btn-default btn-warning" onclick="window.open('/dmanager/activate/{{ domain.pid }}');"><span class="glyphicon glyphicon-bell" aria-hidden="true"></span> Renew </button></td>
{% else %} {% else %}
<td data-title="Time Left">{{ domain.daysleft }} day(s)</td> <td data-title="Time Left">{{ domain.daysleft }} day(s)</td>
{% endif %} {% endif %}
{% else %}
<td data-title="Time Left">EXPIRED</td>
{% endif %} {% endif %}
</tr> </tr>