Added button to force check-in and find the public IP (#59)

* added button to force check-in and find the public IP

* remove timer
This commit is contained in:
Abhishek Shandilya 2019-12-06 22:42:46 -05:00 committed by Taylor Helsper
parent 68aa533ee4
commit a0498a94a4
5 changed files with 23 additions and 4 deletions

View File

@ -172,6 +172,12 @@ def get_latest_version_page():
update_latest_version() update_latest_version()
return redirect("/settings") return redirect("/settings")
@mynode_settings.route("/settings/check-in")
def check_in_page():
check_logged_in()
check_in()
return redirect("/settings")
@mynode_settings.route("/settings/reset-blockchain") @mynode_settings.route("/settings/reset-blockchain")
def reset_blockchain_page(): def reset_blockchain_page():
check_logged_in() check_logged_in()

View File

@ -334,7 +334,10 @@
<div class="divider"></div> <div class="divider"></div>
<div class="settings_block_subheader">Info</div> <div class="settings_block_subheader">
Info
<a href="/settings/check-in" class="ui-button ui-widget ui-corner-all settings_button_small">Refresh</a>
</div>
<table border="0"> <table border="0">
<tr> <tr>
<td>Serial Number</td> <td>Serial Number</td>

View File

@ -73,7 +73,11 @@
{% include 'includes/message_display.html' %} {% include 'includes/message_display.html' %}
<div class="main_header">VPN Status</div> <div class="main_header">
VPN Status
<br/>
<a href="/vpn-info/check-in" class="ui-button ui-widget ui-corner-all settings_button_small">Refresh</a>
</div>
<br/> <br/>
<div class="app_tile_row"> <div class="app_tile_row">

View File

@ -151,7 +151,7 @@ def check_in():
try: try:
public_ip = get('https://mynodebtc.com/device_api/get_public_ip.php').text public_ip = get('https://mynodebtc.com/device_api/get_public_ip.php').text
except Exception as e: except Exception as e:
public_ip = "error" public_ip = "Failed to find public IP. Click on the refresh button above."
# Check for new version # Check for new version
update_latest_version() update_latest_version()

View File

@ -1,5 +1,5 @@
from flask import Blueprint, render_template, session, abort, Markup, request, redirect, send_from_directory, url_for, flash from flask import Blueprint, render_template, session, abort, Markup, request, redirect, send_from_directory, url_for, flash
from thread_functions import get_public_ip from thread_functions import get_public_ip, check_in
from device_info import is_community_edition from device_info import is_community_edition
from settings import read_ui_settings from settings import read_ui_settings
from user_management import check_logged_in from user_management import check_logged_in
@ -83,3 +83,9 @@ def page_download_ovpn():
# Download ovpn # Download ovpn
return send_from_directory(directory="/home/pivpn/ovpns/", filename="mynode_vpn.ovpn") return send_from_directory(directory="/home/pivpn/ovpns/", filename="mynode_vpn.ovpn")
@mynode_vpn.route("/vpn-info/check-in")
def check_in_page():
check_logged_in()
check_in()
return redirect("/vpn-info")