diff --git a/app/main/routes.py b/app/main/routes.py index 2f8c935..4d1d237 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -77,7 +77,8 @@ def dashboard(): rrd[cubeid] = {} try: query = contact_proxmaster({}, 'vmrrd', cubeid) - except: + except Exception as e: + current_app.logger.error(e) flash('Deploy #{} unreachable. Support is notified'.format(str(cubeid))) send_email(current_app.config['MAIL_USERNAME'], 'Cube {} is unreachable'.format(cubeid), 'vmanager/email/adm_unreachable', user=current_user, cubeid=cubeid) diff --git a/app/models.py b/app/models.py index 764a562..bca1e9e 100644 --- a/app/models.py +++ b/app/models.py @@ -208,15 +208,12 @@ def contact_proxmaster(data, method, cubeid=0): url = current_app.config['PROXMASTER_URL'] data['apikey'] = current_app.config['APIKEY'] data_json = json.dumps(data) - #print('--> {}'.format(data)) if method == 'vmcreate': url = '{}/{}'.format(url, method) else: url = '{}/{}/{}'.format(url, method, cubeid) - db_result = requests.post( url, data=data_json, headers={"content-type": "application/json"}, timeout=30 ) - try: proxjson = db_result.json() #print('proxmaster query {}'.format(str(proxjson))) diff --git a/app/templates/main/dashboard.html b/app/templates/main/dashboard.html index dc77116..f72ceb2 100644 --- a/app/templates/main/dashboard.html +++ b/app/templates/main/dashboard.html @@ -187,60 +187,12 @@ addEventListener("DOMContentLoaded", function() { - + {% endif %} - {% if inv_services != [] %} -
-
Category | -Description | -Last Charged | -Time Left | -||
---|---|---|---|---|---|
{{ service.category }} | -{{ service.description }} | -{{ moment(service.date_last_charge).format('lll') }} ({{ moment(service.date_last_charge).fromNow() }}) | - {% if service.enabled == False %} -- {% else %} - {% if service.warning == True %} - | - {% else %} - | {{ service.daysleft }} day(s) | - {% endif %} - {% endif %} -
+
Category | +Description | +Last Charged | +Time Left | +||
---|---|---|---|---|---|
{{ service.category }} | +{{ service.description }} | +{{ moment(service.date_last_charge).format('lll') }} ({{ moment(service.date_last_charge).fromNow() }}) | + {% if service.enabled == False %} ++ {% else %} + {% if service.warning == True %} + | + {% else %} + | {{ service.daysleft }} day(s) | + {% endif %} + {% endif %} +