moar dashboard eyecandy

This commit is contained in:
deflax 2018-03-25 15:09:10 +03:00
parent 8efe280735
commit c653c27509
3 changed files with 8 additions and 4 deletions

View file

@ -53,7 +53,11 @@ def dashboard():
for invcls in inv_deployments:
if invcls.user_id == cuser.pid:
inv_deploycubeids.extend([invcls.machine_id])
#warning detector
if invcls.warning == True or invcls.enabled == False:
warnflag = True
else:
warnflag = False
inv_services = cuser.inv_services.filter_by(deleted=False).order_by(Service.date_last_charge.asc()).all()
inv_domains = cuser.inv_domains.filter_by(deleted=False).order_by(Domain.date_created.desc()).all()
@ -89,5 +93,5 @@ def dashboard():
send_email(current_app.config['MAIL_USERNAME'], 'Cube {} is unreachable'.format(unit_id),
'vmanager/email/adm_unreachable', user=current_user, unit_id=unit_id, error=str(e))
return render_template('panel/dashboard.html', form=form, sys_regions=sys_regions, inv_deployments=inv_deployments, inv_services=inv_services, inv_domains=inv_domains, inv_addresses=inv_addresses, rrd=rrd, status=statuses, regions=regions)
return render_template('panel/dashboard.html', form=form, sys_regions=sys_regions, inv_deployments=inv_deployments, inv_services=inv_services, inv_domains=inv_domains, inv_addresses=inv_addresses, rrd=rrd, status=statuses, warnflag=warnflag, regions=regions)

View file

@ -35,6 +35,7 @@
{% block content %}
{% block outside_container %}{% endblock %}
<div class="custom-container">
<div class="container-fluid">
{% for message in get_flashed_messages() %}
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">x</button>
@ -42,7 +43,6 @@
</div>
{% endfor %}
<div class="container-fluid">
{% block page_content %}{% endblock %}
</div>
</div>

View file

@ -16,7 +16,7 @@
{% if deploy.enabled == False or deploy.warning == True %}
<div id="cube{{ deploy.machine_id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading{{ deploy.machine_id }}" style="border:3px solid #faebcc; border-top: none; margin-bottom: 10px;">
{% else %}
<div id="cube{{ deploy.machine_id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading{{ deploy.machine_id }}" style="border:3px solid #d6e9c6; border-top: none; margin-bottom: 10px;">
<div id="cube{{ deploy.machine_id }}" class="panel-collapse collapse {% if not warnflag %}in{% endif %}" role="tabpanel" aria-labelledby="heading{{ deploy.machine_id }}" style="border:3px solid #d6e9c6; border-top: none; margin-bottom: 10px;">
{% endif %}
<div class="panel-body">
<ul class="nav nav-tabs">