From 44eccd85fd86c77a415a329d91115ffa49b31985 Mon Sep 17 00:00:00 2001 From: hagen Date: Sat, 28 May 2016 00:00:00 +0000 Subject: [PATCH] * HTTPServer.cpp : * autorefresh for status page * autoreturn to commands list --- HTTPServer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index 5d54711d..2af92057 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -755,12 +755,14 @@ namespace http { // Html5 head start ShowPageHead (s); - if (req.uri.find("page=") != std::string::npos) + if (req.uri.find("page=") != std::string::npos) { HandlePage (req, res, s); - else if (req.uri.find("cmd=") != std::string::npos) + } else if (req.uri.find("cmd=") != std::string::npos) { HandleCommand (req, res, s); - else + } else { ShowStatus (s); + res.add_header("Refresh", "5"); + } ShowPageTail (s); res.code = 200; @@ -841,7 +843,9 @@ namespace http { return; } s << "SUCCESS: Command accepted

\r\n"; - s << "Back to commands list"; + s << "Back to commands list
\r\n"; + s << "

You will be redirected in 5 seconds"; + res.add_header("Refresh", "5; url=/?page=commands"); } void HTTPConnection::SendReply (HTTPRes& reply, std::string& content)