From 77744c7b820c6fbaae25bc76a2a805977ffca550 Mon Sep 17 00:00:00 2001 From: KF7EEL Date: Tue, 3 Aug 2021 08:48:43 -0700 Subject: [PATCH] tweak layout, add anytone CSV --- web/app.py | 78 +++++++++++++++++++--------- web/templates/flask_user_layout.html | 30 +++++------ 2 files changed, 69 insertions(+), 39 deletions(-) diff --git a/web/app.py b/web/app.py index e1599f3..b1de0ed 100644 --- a/web/app.py +++ b/web/app.py @@ -449,9 +449,11 @@ def create_app(): field_1 = db.Column(db.String(100), nullable=True, server_default='') field_2 = db.Column(db.String(100), nullable=True, server_default='') field_3 = db.Column(db.String(100), nullable=True, server_default='') - int_1 = db.Column(db.Integer(), primary_key=True) - int_2 = db.Column(db.Integer(), primary_key=True) - int_3 = db.Column(db.Integer(), primary_key=True) + field_4 = db.Column(db.String(100), nullable=True, server_default='') + int_1 = db.Column(db.Integer(), nullable=True) + int_2 = db.Column(db.Integer(), nullable=True) + int_3 = db.Column(db.Integer(), nullable=True) + int_4 = db.Column(db.Integer(), nullable=True) time = db.Column(db.DateTime()) @@ -1639,7 +1641,7 @@ def create_app(): - @@ -1649,7 +1651,7 @@ def create_app(): - + @@ -1686,13 +1688,17 @@ def create_app(): + + ''' for a in view_news: content = content + ''' - + + + ''' content = content + ''' @@ -1805,12 +1811,24 @@ def create_app(): ## @login_required def tg_csv(): cbl = BridgeList.query.filter_by(public_list=True).all() - gen_csv = 'number, name\n' + gen_csv = 'TG, Name\n' for t in cbl: gen_csv = gen_csv + str(t.tg) + ', ' + t.bridge_name + '\n' response = Response(gen_csv, mimetype="text/csv") return response + @app.route('/hbnet_tg_anytone.csv') +## @login_required + def anytone_tg_csv(): + cbl = BridgeList.query.filter_by(public_list=True).all() + gen_csv = 'No., Radio ID, Name, Call Type, Call Alert\n' + num = 1 + for t in cbl: + gen_csv = gen_csv + str(num) + ', ' + str(t.tg) + ', ' + t.bridge_name + ', Group Call, None' + '\n' + num = num + 1 + response = Response(gen_csv, mimetype="text/csv") + return response + @app.route('/talkgroups') ## @login_required def tg_list(): @@ -1819,7 +1837,7 @@ def create_app(): content = '''

 

Note: Talkgroups listed here may not be available on all servers. See Passphrase(s) for complete list of talkgroup availability per server.

-

Download talkgroup CSV

+

Download talkgroup CSV | Download talkgroup CSV (Anytone format)


+

 



Subject DateID
Delete: ''' + a.subject + '''Delete: ''' + a.subject + ''' ''' + a.date + '''''' + str(a.id) + '''
@@ -1868,7 +1886,10 @@ def create_app(): tg_list = tg_list + ''' - + + + + ''' content = content + '''
 ''' + b.bridge_name + '''  ''' + str(b.tg) + ''' ''' + bl.description + ''' ''' + str(b.ts) + ''' ''' + b.to_type + ''' ''' + str(b.timeout) + '''
''' + ''' @@ -1879,9 +1900,11 @@ def create_app():
- - - + + + + + ''' + tg_list + ''' @@ -1898,7 +1921,9 @@ def create_app(): tg_list = tg_list + ''' - + + + ''' content = content + '''''' tg_list = '' @@ -2192,8 +2219,8 @@ def create_app(): ## db.session.delete(p) ## db.session.commit() - def news_delete(_subject): - del_n = News.query.filter_by(subject=_subject).all() + def news_delete(_id): + del_n = News.query.filter_by(id=_id).all() for i in del_n: db.session.delete(i) db.session.commit() @@ -3281,11 +3308,11 @@ def create_app(): - + - + @@ -3534,6 +3561,9 @@ def create_app():

 

Add an ''' + mode + ''' peer

+

Notice: Before connecting this server to another network, such as Brandmeister, be sure you have permission.
Connecting servers together via PEER connection can cause problems such as audio looping.
OpenBridge connections are designed for server to server connections.

+

 

+
 Name TG Description Name TG TSTimer TypeTime (Min)
 ''' + b.bridge_name + '''  ''' + str(b.tg) + ''' ''' + bl.description + ''' ''' + str(b.ts) + ''' ''' + b.to_type + ''' ''' + str(b.timeout) + '''
''' + ''' @@ -1909,14 +1934,16 @@ def create_app():
- - - + + + + + ''' + tg_list + ''' - - + +
 Name TG Description Name TG TSTimer TypeTime (Min)
 Disconnect 4000  Disconnect from all activated TGs. 4000 
''' + '''
 Notes: Notes (HTML OK):  
 Public Notes: Public Notes (HTML OK):  
@@ -5128,7 +5158,7 @@ def create_app(): - + - + - - - + + + {% if not call_or_get(current_user.is_authenticated) %} @@ -48,15 +48,15 @@ {% endif %} {% if call_or_get(current_user.is_authenticated) %} {% if call_or_get(current_user.has_roles('Admin')) %} - - - - + + + + {% endif %} - - - + + + {% endif %} @@ -69,11 +69,11 @@






HomeNewsTalkgroupsHomeNewsTalkgroupsRegisterAdd a UserEdit UsersWaiting ApprovalAuth LogAdd a UserEdit UsersWaiting ApprovalAuth LogHelpPassphrase(s)HelpPassphrase(s) Edit {{ current_user.username or current_user.email }} Sign out
- - - - - + + + + +
Manage ServersManage PeersManage MastersManage RulesManage NewsManage ServersManage PeersManage MastersManage RulesManage News