Better display support status

This commit is contained in:
Taylor Helsper 2023-12-03 23:10:19 -06:00
parent 73f34414cf
commit 4be79f8d3f
2 changed files with 18 additions and 6 deletions

View File

@ -797,7 +797,7 @@ def get_check_in_data():
with open("/tmp/check_in_response.json", "r") as f:
data = json.load(f)
except Exception as e:
data = None
data = None
return data
def dismiss_expiration_warning():

View File

@ -24,16 +24,28 @@
<tr>
<th>Support</th>
<td>
{% if check_in_data.support is defined and check_in_data.support.active is defined and check_in_data.support.days_remaining is defined %}
{% if check_in_data.support is defined and check_in_data.support.active is defined %}
{% if check_in_data.support.active %}
<i class='fas fa-check' style="vertical-align: middle;" data-toggle='tooltip' data-placement='bottom' title='Active - Expires in {{check_in_data.support.days_remaining}} days'></i>
{% if check_in_data.support.days_remaining|int < 45 %}
<i class='fas fa-check' style="vertical-align: middle;" data-toggle='tooltip' data-placement='bottom'
{% if check_in_data.support.days_remaining is defined %}
title='Active - Expires in {{check_in_data.support.days_remaining}} days'
{% else %}
title='Active'
{% endif %}
></i>
{% if check_in_data.support.days_remaining is defined and check_in_data.support.days_remaining|int < 45 %}
<i class='fas fa-exclamation' style="color: red; vertical-align: middle; margin-left: 5px;" data-toggle='tooltip' data-placement='bottom' title='Expiring Soon! {{check_in_data.support.days_remaining}} days remaining.'></i>
<a href="https://mynodebtc.com/order/premium_plus" target="_blank" style="margin-left: 5px;" class="ui-button ui-widget ui-corner-all settings_button_small">Extend</a>
{% endif %}
{% else %}
<i class='fas fa-times' style="vertical-align: middle;" data-toggle='tooltip' data-placement='bottom' title='Inactive - Expired {{check_in_data.support.days_remaining|int|abs}} days ago'></i>
{% if check_in_data.support.days_remaining|int > -45 %}
<i class='fas fa-times' style="vertical-align: middle;" data-toggle='tooltip' data-placement='bottom'
{% if check_in_data.support.days_remaining is defined %}
title='Inactive - Expired {{check_in_data.support.days_remaining|int|abs}} days ago'
{% else %}
title='Inactive - Expired'
{% endif %}
></i>
{% if check_in_data.support.days_remaining is defined and check_in_data.support.days_remaining|int > -45 %}
<i class='fas fa-exclamation' style="color: red; vertical-align: middle; margin-left: 5px;" data-toggle='tooltip' data-placement='bottom' title='Expired recently! Expired {{check_in_data.support.days_remaining|int|abs}} days ago.'></i>
{% endif %}
<a href="https://mynodebtc.com/order/premium_plus" target="_blank" style="margin-left: 5px;" class="ui-button ui-widget ui-corner-all settings_button_small">Extend</a>