add sort by ip

This commit is contained in:
KF7EEL 2021-06-04 18:14:39 -07:00
parent ea39d5fa6a
commit 7429db3a03

View File

@ -951,9 +951,12 @@ def create_app():
elif request.args.get('flush_user_db') == 'true' and request.args.get('portal_username'): elif request.args.get('flush_user_db') == 'true' and request.args.get('portal_username'):
content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('portal_username') + '''</strong></strong></p>\n''' content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('portal_username') + '''</strong></strong></p>\n'''
authlog_flush_user(request.args.get('portal_username')) authlog_flush_user(request.args.get('portal_username'))
elif request.args.get('flush_user_mmdvm') == 'true' and request.args.get('mmdvm_server'): elif request.args.get('flush_db_mmdvm') == 'true' and request.args.get('mmdvm_server'):
content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('mmdvm_server') + '''</strong></strong></p>\n''' content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('mmdvm_server') + '''</strong></strong></p>\n'''
authlog_flush_mmdvm_server(request.args.get('mmdvm_server')) authlog_flush_mmdvm_server(request.args.get('mmdvm_server'))
elif request.args.get('flush_db_ip') == 'true' and request.args.get('peer_ip'):
content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('peer_ip') + '''</strong></strong></p>\n'''
authlog_flush_ip(request.args.get('peer_ip'))
elif request.args.get('flush_dmr_id_db') == 'true' and request.args.get('dmr_id'): elif request.args.get('flush_dmr_id_db') == 'true' and request.args.get('dmr_id'):
content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('dmr_id') + '''</strong></strong></p>\n''' content = '''<p style="text-align: center;"><strong>Flushed auth DB for: ''' + request.args.get('dmr_id') + '''</strong></strong></p>\n'''
authlog_flush_dmr_id(request.args.get('dmr_id')) authlog_flush_dmr_id(request.args.get('dmr_id'))
@ -1007,8 +1010,8 @@ def create_app():
content = content + ''' content = content + '''
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;&nbsp;<a href="edit_user?callsign=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1019,8 +1022,8 @@ def create_app():
content = content + ''' content = content + '''
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="edit_user?callsign=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href=auth_log?portal_username="''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1032,7 +1035,7 @@ def create_app():
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.portal_username + '''&nbsp;</a></td> <td style="text-align: center;">&nbsp;''' + i.portal_username + '''&nbsp;</a></td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1041,8 +1044,7 @@ def create_app():
''' '''
content = content + '</tbody></table>' content = content + '</tbody></table>'
elif request.args.get('mmdvm_server'): elif request.args.get('mmdvm_server') and not request.args.get('flush_db_mmdvm'):
print('mmdvm')
a = AuthLog.query.filter_by(server_name=request.args.get('mmdvm_server')).order_by(AuthLog.login_time.desc()).all() a = AuthLog.query.filter_by(server_name=request.args.get('mmdvm_server')).order_by(AuthLog.login_time.desc()).all()
content = ''' content = '''
<p>&nbsp;</p> <p>&nbsp;</p>
@ -1080,8 +1082,8 @@ def create_app():
content = content + ''' content = content + '''
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;&nbsp;<a href="edit_user?callsign=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.server_name + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.server_name + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1092,8 +1094,8 @@ def create_app():
content = content + ''' content = content + '''
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="edit_user?callsign=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.server_name + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.server_name + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1105,7 +1107,7 @@ def create_app():
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.portal_username + '''&nbsp;</a></td> <td style="text-align: center;">&nbsp;''' + i.portal_username + '''&nbsp;</a></td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.server_name + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.server_name + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1113,6 +1115,78 @@ def create_app():
</tr> </tr>
''' '''
content = content + '</tbody></table>' content = content + '</tbody></table>'
elif request.args.get('peer_ip') and not request.args.get('flush_db_ip'):
a = AuthLog.query.filter_by(peer_ip=request.args.get('peer_ip')).order_by(AuthLog.login_time.desc()).all()
content = '''
<p>&nbsp;</p>
<p style="text-align: center;"><strong><a href="auth_log?flush_db_ip=true&peer_ip=''' + request.args.get('peer_ip') + '''">Flush authentication log for IP: ''' + request.args.get('peer_ip') + '''</a></strong></p>
<p style="text-align: center;"><strong>Log for IP address: ''' + request.args.get('peer_ip') + '''</strong></p>
<table style="width: 1000px; margin-left: auto; margin-right: auto;" border="1">
<tbody>
<tr>
<td style="text-align: center;">
<h4>&nbsp;DMR ID&nbsp;</h4>
</td>
<td style="text-align: center;">
<h4>&nbsp;Portal Username&nbsp;</h4>
</td>
<td style="text-align: center;">
<h4>&nbsp;Login IP&nbsp;</h4>
</td>
<td style="text-align: center;">
<h4>&nbsp;Calculated Passphrase&nbsp;</h4>
</td>
<td style="text-align: center;">
<h4>&nbsp;Server&nbsp;</h4>
</td>
<td style="text-align: center;">
<h4>&nbsp;Time (UTC)&nbsp;</h4>
</td>
<td style="text-align: center;">
<h4>&nbsp;Login Status&nbsp;</h4>
</td>
</tr> \n'''
for i in a:
if i.login_type == 'Attempt':
content = content + '''
<tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<span style="color: #000000; background-color: #ffff00;"><strong>''' + str(i.login_type) + '''</span></strong>&nbsp;</td>
</tr>
'''
if i.login_type == 'Confirmed':
content = content + '''
<tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<span style="color: #000000; background-color: #00ff00;"><strong>''' + str(i.login_type) + '''</span></strong>&nbsp;</td>
</tr>
'''
if i.login_type == 'Failed':
content = content + '''
<tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.portal_username + '''&nbsp;</a></td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
<td style="text-align: center;"><span style="color: #000000; background-color: #FF2400;">&nbsp;<strong>''' + str(i.login_type) + '''</span></strong>&nbsp;</td>
</tr>
'''
content = content + '</tbody></table>'
else: else:
#a = AuthLog.query.all().order_by(AuthLog.login_dmr_id) #a = AuthLog.query.all().order_by(AuthLog.login_dmr_id)
@ -1158,7 +1232,7 @@ def create_app():
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1170,7 +1244,7 @@ def create_app():
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1182,7 +1256,7 @@ def create_app():
<tr > <tr >
<td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td> <td style="text-align: center;">&nbsp;<strong><a href="auth_log?dmr_id=''' + str(i.login_dmr_id) + '''">''' + str(i.login_dmr_id) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</a></td> <td style="text-align: center;">&nbsp;<a href="auth_log?portal_username=''' + i.portal_username + '''">''' + i.portal_username + '''</a>&nbsp;</a></td>
<td style="text-align: center;">&nbsp;<strong>''' + i.peer_ip + '''</strong>&nbsp;</td> <td style="text-align: center;">&nbsp;&nbsp;<strong><a href="auth_log?peer_ip=''' + str(i.peer_ip) + '''">''' + str(i.peer_ip) + '''</a></strong>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + i.login_auth_method + '''&nbsp;</td>
<td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td> <td style="text-align: center;">&nbsp;<a href="auth_log?mmdvm_server=''' + str(i.server_name) + '''">''' + str(i.server_name) + '''</a>&nbsp;</td>
<td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td> <td style="text-align: center;">&nbsp;''' + str(i.login_time) + '''&nbsp;</td>
@ -1362,6 +1436,11 @@ def create_app():
for i in flush_e: for i in flush_e:
db.session.delete(i) db.session.delete(i)
db.session.commit() db.session.commit()
def authlog_flush_ip(_ip):
flush_e = AuthLog.query.filter_by(peer_ip=_ip).all()
for i in flush_e:
db.session.delete(i)
db.session.commit()
@app.route('/add_user', methods=['POST', 'GET']) @app.route('/add_user', methods=['POST', 'GET'])
@login_required @login_required