add external apps page, add som comments

This commit is contained in:
KF7EEL 2021-04-22 19:18:32 -07:00
parent 4881380132
commit 6d7cc08559
6 changed files with 38 additions and 16 deletions

View File

@ -1,20 +1,31 @@
{
# Shortcut used in SMS message
'XYZ':{
# Mode of transfer, this case, message transfer
'mode':'msg_xfer',
# Name of the server/network
'network_name':'My HBlink Server',
'url':'http://example.net/api',
# URL to the dashboard of the server/network
'url':'http://example.net/',
# Username and password given to you by network operator
'user':'test_name',
'password':'passw0rd'
},
'APP':{
# Shortcut used in SMS message
'BBD':{
# Mode for application, operates differently than msg_xfer
'mode':'app',
'app_name':'Test app',
# Name of external application
'app_name':'Bulletin Board',
# Endpoint URL of API
'url':'http://localhost:8080/post',
# Website for users to get info
'website':'http://hbl.ink',
},
'ABC':{
'mode':'msg_xfer',
'network_name':'Regional HBlink Network 1',
'url':'http://localhost:8092/api',
'url':'http://localhost:8092/',
'user':'test_name',
'password':'passw0rd'
}

View File

@ -1,5 +1,7 @@
# This file contains the access credentials of other servers/networks that can
# send messages to this server.
{
'XYZ':{
'DEF':{
'mode':'msg_xfer',
'user':'test_name',
'password':'passw0rd'

View File

@ -151,7 +151,7 @@ APRS_STATIC_REPORT_INTERVAL: 15
APRS_STATIC_MESSAGE:Connected to HBLink
# The email gateway settingns below are OPTIONAL. They are NOT REQUIRED if you don't want
http://www.aprs-is.net/javAPRSFilter.aspx# to enable the email gateway. Leave as is to disable.
# http://www.aprs-is.net/javAPRSFilter.aspx# to enable the email gateway. Leave as is to disable.
EMAIL_SENDER: test@example.org
EMAIL_PASSWORD: letmein
SMTP_SERVER: smtp.gmail.com
@ -170,6 +170,12 @@ USER_SETTINGS_FILE: /path/to/user_settings.txt
# API settings
# Authorized Apps file - data used for the dashboard API
# Authorized Tokens File - location of file to store token for app requests, can be left as default
# Authorized Users File - Stores login data for other servers to send messages
# Access Systems File - Contains data for external applications or other networks/servers
# that this server can access.
# My API Name - Short abbreviation, must match other users access files.
# Server name - can be different than dashboard title, used to identify this network/server
USE_API: True
AUTHORIZED_APPS_FILE: /path/to/authorized_apps.py
AUTHORIZED_TOKENS_FILE: /tmp/hblink_auth_tokens.txt

View File

@ -203,7 +203,7 @@ def user_setting_write(dmr_id, input_ssid, input_icon, input_comment, input_aprs
def index():
value = Markup('<strong>The HTML String</strong>')
#return get_data()
return render_template('index.html', title = dashboard_title, logo = logo, emergency = check_emergency())
return render_template('index.html', title = dashboard_title, logo = logo, emergency = check_emergency(), api = use_api)
@app.route('/bulletin_board')
def dash_bb():
return get_bb_data()
@ -215,11 +215,11 @@ def dash_loc():
@app.route('/help/')
def help():
#return get_data()
return render_template('help.html', title = dashboard_title, logo = logo, description = description, data_call_type = data_call_type, data_call_id = data_call_id, aprs_ssid = aprs_ssid)
return render_template('help.html', title = dashboard_title, logo = logo, description = description, api = use_api, data_call_type = data_call_type, data_call_id = data_call_id, aprs_ssid = aprs_ssid)
@app.route('/about/')
def about():
#return get_data()
return render_template('about.html', title = dashboard_title, logo = logo, contact_name = contact_name, contact_call = contact_call, contact_email = contact_email, contact_website = contact_website)
return render_template('about.html', title = dashboard_title, logo = logo, contact_name = contact_name, api = use_api, contact_call = contact_call, contact_email = contact_email, contact_website = contact_website)
@app.route('/external_apps')
def external_apps():
@ -244,7 +244,7 @@ def external_apps():
</tr> '''
content = '''
<p>&nbsp;</p>
External applications and other HBLink networks that can be accessed via SMS from this gateway:
<h2 style="text-align: center;">External Networks/Servers</h2>
<table style="border-color: black; width: 600px; margin-left: auto; margin-right: auto;" border="3">
<tbody>
@ -283,7 +283,7 @@ def external_apps():
<p>&nbsp;</p>
'''
## content = 'yo'
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(content))
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(content), api = use_api)
@app.route('/view_map')
def view_map():
@ -459,7 +459,7 @@ def view_map():
@app.route('/map/')
def map():
return render_template('map.html', title = dashboard_title, logo = logo)
return render_template('map.html', title = dashboard_title, logo = logo, api = use_api)
@app.route('/user', methods = ['GET', 'POST'])
def user_settings():
@ -651,7 +651,7 @@ def user_settings():
<p style="text-align: center;"><button onclick="history.back()">Back</button>
</p>'''
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(user_result))
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(user_result), api = use_api)
@app.route('/mailbox')
def mailbox():
@ -727,7 +727,7 @@ def mailbox():
<p>&nbsp;</p>
"""
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(mail_content))
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(mail_content), api = use_api)
@app.route('/bulletin_rss.xml')
@ -791,7 +791,7 @@ def mail_rss():
def api(api_mode=None):
if request.method == 'GET':
api_content = '<h3 style="text-align: center;"><strong>API Enabled: ' + str(use_api) + '</strong></h3>'
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(api_content))
return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(api_content), api = use_api)
if use_api == 'True' or use_api == "true":
access_systems = ast.literal_eval(os.popen('cat ' + access_systems_file).read())
authorized_users = ast.literal_eval(os.popen('cat ' + authorized_users_file).read())

View File

@ -1,5 +1,5 @@
<div>
<hr />
<div style="text-align: center;">Dashboard created by KF7EEL - <a href="https://kf7eel.github.io/hblink3/">https://github.com/kf7eel/hblink3</a><br />HBLink created by N0MJS.<br /><a href="https://github.com/HBLink-org">HBLink GitHub page</a><br />This is branch: <strong>gps<strong></div>
<div style="text-align: center;">Dashboard created by KF7EEL - <a href="https://kf7eel.github.io/hblink3/">https://github.com/kf7eel/hblink3</a><br />HBLink created by N0MJS.<br /><a href="https://github.com/HBLink-org">HBLink GitHub page</a><br />This is branch: <strong>sms_dev<strong></div>
</body>
</html>

View File

@ -8,6 +8,9 @@
<td style="text-align: center;"><button onclick="window.location.href='/map';"> Station Map </button></td>
<td style="text-align: center;"><button onclick="window.location.href='/mailbox';"> The Mailbox </button></td>
<td style="text-align: center;"><button onclick="window.location.href='/user';"> User Settings </button></td>
{% if api %}
<td style="text-align: center;"><button onclick="window.location.href='/external_apps';"> External Applications </button></td>
{% endif %}
<td style="text-align: center;"><button onclick="window.location.href='/help';"> Dashboard Help </button></td>
<td style="text-align: center;"><button onclick="window.location.href='/about';"> Gateway Contact </button></td>
</tr>