Add special message

This commit is contained in:
Taylor Helsper 2020-04-20 23:43:47 -05:00
parent 4349e4ddf6
commit 4a0e7a9c9b
9 changed files with 79 additions and 22 deletions

View File

@ -252,6 +252,7 @@ def index():
mempoolspace_status_color = "gray"
vpn_status_color = "gray"
vpn_status = ""
current_block = 1234
if not get_has_updated_btc_info() or uptime_in_seconds < 150:
error_message = ""
@ -310,6 +311,7 @@ def index():
bitcoind_status = "Syncing<br/>{} blocks remaining...".format(remaining)
else:
bitcoind_status = "Waiting for info..."
current_block = get_mynode_block_height()
# Find lnd status
if is_bitcoind_synced():
@ -429,6 +431,7 @@ def index():
"config": CONFIG,
"bitcoind_status_color": bitcoind_status_color,
"bitcoind_status": Markup(bitcoind_status),
"current_block": current_block,
"lnd_status_color": lnd_status_color,
"lnd_status": Markup(lnd_status),
"lnd_ready": lnd_ready,

View File

@ -591,6 +591,31 @@ a:active {
width: 128px;
}
.halving_message_main_page {
color: #333333;
border: 3px solid orange;
background-color: rgb(255, 250, 238);
width: 600px;
border-radius: 25px;
text-align: center;
display: block;
font-size: 32px;
font-family: Arial, Helvetica, sans-serif;
padding: 5px;
padding-left: 12px;
margin: auto;
margin-bottom: 20px;
}
.halving_message_table {
width: 100%;
font-size: 32px;
border: 0px;
text-align: center;
}
.halving_image {
width: 86px;
}
/* The switch - the box around the slider */
.switch {
position: relative;

View File

@ -61,7 +61,8 @@ table,
}
.main_page_warning_block,
.upgrade_ad_main_page {
.upgrade_ad_main_page,
.halving_message_main_page {
color: #eee;
border: 3px solid #f9c132;
background-color: #3a4750;

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,48 @@
{% if fsck_error %}
<div class="main_page_error_block">
<center>
<p>There may be an error with the filesystem on your drive.</p>
<p>{{ fsck_results }}</p>
</center>
</div>
{% endif %}
{% if sd_rw_error %}
<div class="main_page_error_block">
<center>
<p>There may be an error with the filesystem on your SD card. It was mounted as read-only and has been updated to read/write.</p>
</center>
</div>
{% endif %}
{% if not has_changed_password %}
<div class="upgrade_ad_main_page">
<p style="text-align: center;"><b>Warning!</b><br/>You appear to be using the default password! You should change it to something else on the <a href="/settings">settings</a> page.</p>
</div>
{% endif %}
{% set blocks_until_halving = 210000 - (current_block % 210000) %}
{% if blocks_until_halving < 1000 %}
<div class="halving_message_main_page">
<table class="halving_message_table">
<tr>
<td><img class="halving_image" src="{{ url_for('static', filename='images/stopwatch.png')}}"/></td>
<td>{{ blocks_until_halving }} blocks to the halving...</td>
<td><img class="halving_image" src="{{ url_for('static', filename='images/timer.png')}}"/></td>
</tr>
</table>
</div>
{% endif %}
{% if blocks_until_halving > 209400 %}
<div class="halving_message_main_page">
<table class="halving_message_table">
<tr>
<td><img class="halving_image" src="{{ url_for('static', filename='images/fireworks1.png')}}"/></td>
<td>Happy Halving!!!</td>
<td><img class="halving_image" src="{{ url_for('static', filename='images/fireworks2.png')}}"/></td>
</tr>
</table>
</div>
{% endif %}

View File

@ -153,28 +153,8 @@
{% include 'includes/message_display.html' %}
{% if fsck_error %}
<div class="main_page_error_block">
<center>
<p>There may be an error with the filesystem on your drive.</p>
<p>{{ fsck_results }}</p>
</center>
</div>
{% endif %}
{% include 'includes/main_page_messages.html' %}
{% if sd_rw_error %}
<div class="main_page_error_block">
<center>
<p>There may be an error with the filesystem on your SD card. It was mounted as read-only and has been updated to read/write.</p>
</center>
</div>
{% endif %}
{% if not has_changed_password %}
<div class="upgrade_ad_main_page">
<p style="text-align: center;"><b>Warning!</b><br/>You appear to be using the default password! You should change it to something else on the <a href="/settings">settings</a> page.</p>
</div>
{% endif %}
{% include 'includes/services.html' %}