This commit is contained in:
2024-10-27 16:01:47 +01:00
parent 96faf44779
commit f3336125f5

View File

@@ -59,6 +59,10 @@ class MyHandler(http.server.SimpleHTTPRequestHandler):
self.send_response(200) self.send_response(200)
self.end_headers() self.end_headers()
self.wfile.write(b'<html><head><title>Synology Webhook</title></head><body><p>Shutdown active: ' + str(config['shutdown_active']).encode() + b'</p><form method="post" action="/toggle_shutdown"><input type="submit" value="Toggle shutdown"></form></body></html>') self.wfile.write(b'<html><head><title>Synology Webhook</title></head><body><p>Shutdown active: ' + str(config['shutdown_active']).encode() + b'</p><form method="post" action="/toggle_shutdown"><input type="submit" value="Toggle shutdown"></form></body></html>')
else:
self.send_response(404)
self.end_headers()
self.wfile.write(b'Not found')
httpd = socketserver.TCPServer(('', 48080), MyHandler) httpd = socketserver.TCPServer(('', 48080), MyHandler)
httpd.serve_forever() httpd.serve_forever()