mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
new: webui status pages reload /ui after a given interval
This commit is contained in:
@ -75,6 +75,7 @@ INDEX = """<html>
|
|||||||
STATUS_PAGE = """<html>
|
STATUS_PAGE = """<html>
|
||||||
<head>
|
<head>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
|
<meta http-equiv="refresh" content="{{ go_back_after }};URL=/ui">
|
||||||
<style>""" + STYLE + """</style>
|
<style>""" + STYLE + """</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -124,7 +125,8 @@ class Handler:
|
|||||||
# serve a message and shuts down the unit
|
# serve a message and shuts down the unit
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
try:
|
try:
|
||||||
return render_template_string(STATUS_PAGE, title=pwnagotchi.name(), message='Shutting down ...')
|
return render_template_string(STATUS_PAGE, title=pwnagotchi.name(), go_back_after=60,
|
||||||
|
message='Shutting down ...')
|
||||||
finally:
|
finally:
|
||||||
_thread.start_new_thread(pwnagotchi.shutdown, ())
|
_thread.start_new_thread(pwnagotchi.shutdown, ())
|
||||||
|
|
||||||
@ -135,7 +137,7 @@ class Handler:
|
|||||||
mode = 'MANU'
|
mode = 'MANU'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return render_template_string(STATUS_PAGE, title=pwnagotchi.name(),
|
return render_template_string(STATUS_PAGE, title=pwnagotchi.name(), go_back_after=30,
|
||||||
message='Restart in %s mode ...' % mode)
|
message='Restart in %s mode ...' % mode)
|
||||||
finally:
|
finally:
|
||||||
_thread.start_new_thread(pwnagotchi.restart, (mode,))
|
_thread.start_new_thread(pwnagotchi.restart, (mode,))
|
||||||
|
Reference in New Issue
Block a user