ui: Fix shutdown link.

This commit is contained in:
tecnovert
2022-11-14 22:56:30 +02:00
parent 8022ada01f
commit 5d4db2c1df
2 changed files with 6 additions and 7 deletions

View File

@@ -131,7 +131,6 @@ class HttpHandler(BaseHTTPRequestHandler):
if swap_client._show_notifications:
args_dict['notifications'] = swap_client.getNotifications()
# TODO: Remove _withids
if 'messages' in args_dict:
messages_with_ids = []
for msg in args_dict['messages']:
@@ -145,6 +144,10 @@ class HttpHandler(BaseHTTPRequestHandler):
self.server.msg_id_counter += 1
args_dict['err_messages'] = err_messages_with_ids
shutdown_token = os.urandom(8).hex()
self.server.session_tokens['shutdown'] = shutdown_token
args_dict['shutdown_token'] = shutdown_token
if self.server.msg_id_counter >= 0x7FFFFFFF:
self.server.msg_id_counter = 0
@@ -486,16 +489,12 @@ class HttpHandler(BaseHTTPRequestHandler):
swap_client.checkSystemStatus()
summary = swap_client.getSummary()
shutdown_token = os.urandom(8).hex()
self.server.session_tokens['shutdown'] = shutdown_token
template = env.get_template('index.html')
return self.render_template(template, {
'refresh': 30,
'version': __version__,
'summary': summary,
'use_tor_proxy': swap_client.use_tor_proxy,
'shutdown_token': shutdown_token
'use_tor_proxy': swap_client.use_tor_proxy
})
def page_404(self, url_split):