''' + str(
return render_template('flask_user_layout.html', markup_content = Markup(content))
+ @app.route('/external_services')
+ def get_known_services():
+ try:
+ svr = ServerList.query.all()
+ web_output = ''
+ table_entry = ''
+ for i in svr:
+ if 'MQTT' in i.other_options:
+ print(i.name)
+ known_services = Misc.query.filter_by(field_1='known_services_' + i.name).first()
+ services_dict = ast.literal_eval(known_services.field_2)
+ print(services_dict)
+ for d in services_dict:
+ print(d)
+ if services_dict[d]['type'] == 'network':
+ table_entry = table_entry + '''
+
+ | #''' + services_dict[d]['shortcut'] + ''' |
+ Network |
+ ''' + services_dict[d]['description'] + ''' |
+ ''' + services_dict[d]['url'] + ''' |
+
+ '''
+ if services_dict[d]['type'] == 'app':
+ table_entry = table_entry + '''
+
+ | !''' + services_dict[d]['shortcut'] + ''' |
+ Application |
+
+ ''' + services_dict[d]['description'] + ''' |
+ ''' + services_dict[d]['url'] + ''' |
+
+ '''
+ web_output = '''
+ External Services for: ''' + i.name + '''
+
+
+
+ | Shortcut |
+ Type |
+ Description |
+ URL |
+
+
+
+ ''' + table_entry + '''
+
+
+
+
+ '''
+ except:
+ web_output = 'Not found or other error'
+
+ return render_template('generic.html', markup_content = Markup(web_output))
+
@login_required
@roles_required('Admin')
@app.route('/unit/')
@@ -7367,6 +7423,17 @@ Name: ''' + p.name + ''' - Port: ''' + str(
except:
print('entry error')
misc_add('unit_table_' + hblink_req['unit_table'], str(hblink_req['data']), '', '', 0, 0, 0, 0, False, False)
+## unit_table_add(hblink_req['data'])
+ response = 'rcvd'
+ elif 'known_services' in hblink_req:
+ print(hblink_req)
+## del_unit_table(hblink_req['unit_table'])
+ try:
+ delete_misc_field_1('known_services_' + hblink_req['known_services'])
+ misc_add('known_services_' + hblink_req['known_services'], str(hblink_req['data']), '', '', 0, 0, 0, 0, False, False)
+ except:
+ print('entry error')
+ misc_add('known_services_' + hblink_req['known_services'], str(hblink_req['data']), '', '', 0, 0, 0, 0, False, False)
## unit_table_add(hblink_req['data'])
response = 'rcvd'
diff --git a/web/templates/flask_user_layout.html b/web/templates/flask_user_layout.html
index 3e876b0..d86f6cb 100644
--- a/web/templates/flask_user_layout.html
+++ b/web/templates/flask_user_layout.html
@@ -64,6 +64,7 @@
Overview
Last Known Location
SMS Log
+ External Services
Bulletin Board
Social Status
Tiny Pages