fix server edit function

This commit is contained in:
KF7EEL 2021-08-04 19:18:42 -07:00
parent f5f57d7607
commit b7102bab4a

View File

@ -2668,7 +2668,8 @@ def create_app():
db.session.commit()
def server_edit(_name, _secret, _ip, _port, _global_path, _global_ping_time, _global_max_missed, _global_use_acl, _global_reg_acl, _global_sub_acl, _global_tg1_acl, _global_tg2_acl, _ai_subscriber_file, _ai_try_download, _ai_path, _ai_peer_file, _ai_tgid_file, _ai_peer_url, _ai_subs_url, _ai_stale, _um_shorten_passphrase, _um_burn_file, _report_enable, _report_interval, _report_port, _report_clients, _unit_time, _notes, _dash_url, _public_notes):
def server_edit(_name, _secret, _ip, _global_path, _global_ping_time, _global_max_missed, _global_use_acl, _global_reg_acl, _global_sub_acl, _global_tg1_acl, _global_tg2_acl, _ai_subscriber_file, _ai_try_download, _ai_path, _ai_peer_file, _ai_tgid_file, _ai_peer_url, _ai_subs_url, _ai_stale, _um_shorten_passphrase, _um_burn_file, _report_enable, _report_interval, _report_port, _report_clients, _unit_time, _notes, _dash_url, _public_notes):
print(_public_notes)
s = ServerList.query.filter_by(name=_name).first()
# print(_name)
if _secret == '':
@ -2676,7 +2677,6 @@ def create_app():
else:
s.secret = hashlib.sha256(_secret.encode()).hexdigest()
s.ip = _ip
s.port = _port
s.global_path =_global_path
s.global_ping_time = _global_ping_time
s.global_max_missed = _global_max_missed
@ -3124,6 +3124,7 @@ def create_app():
<meta http-equiv="refresh" content="3; URL=manage_servers" />'''
if request.args.get('save_mode') == 'edit':
## print(request.args.get('server'))
print(request.form.get('public_notes'))
server_edit(request.args.get('server'), request.form.get('server_secret'), request.form.get('server_ip'), request.form.get('global_path'), _global_ping_time, _global_max_missed, _global_use_acl, request.form.get('reg_acl'), request.form.get('sub_acl'), request.form.get('global_ts1_acl'), request.form.get('global_ts2_acl'), request.form.get('sub_file'), _ai_try_download, request.form.get('aliases_path'), request.form.get('peer_file'), request.form.get('tgid_file'), request.form.get('peer_url'), request.form.get('sub_url'), _ai_stale, _um_shorten_passphrase, request.form.get('um_burn_file'), _report_enabled, _report_interval, _report_port, request.form.get('report_clients'), request.form.get('unit_time'), request.form.get('notes'), request.form.get('dash_url'), request.form.get('public_notes'))
content = '''<h3 style="text-align: center;">Server changed.</h3>
<p style="text-align: center;">Redirecting in 3 seconds.</p>