Skip to content

Commit

Permalink
MythFrontend: http status page improvements.
Browse files Browse the repository at this point in the history
- Use the default site and status style sheets.

- add minimal information about the frontend itself (identifier and
version)
  • Loading branch information
Mark Kendall committed May 16, 2011
1 parent c77e408 commit 4938c83
Showing 1 changed file with 14 additions and 83 deletions.
97 changes: 14 additions & 83 deletions mythtv/programs/mythfrontend/mediarenderer.cpp
Expand Up @@ -37,6 +37,7 @@ class MythFrontendStatus : public HttpServerExtension

QString shortdateformat = gCoreContext->GetSetting("ShortDateFormat", "M/d");
QString timeformat = gCoreContext->GetSetting("TimeFormat", "h:mm AP");
QString hostname = gCoreContext->GetHostName();
QDateTime qdtNow = QDateTime::currentDateTime();
QString masterhost = gCoreContext->GetMasterHostName();
QString masterip = gCoreContext->GetSetting("MasterServerIP");
Expand All @@ -53,104 +54,34 @@ class MythFrontendStatus : public HttpServerExtension
<< "<head>\r\n"
<< " <meta http-equiv=\"Content-Type\""
<< "content=\"text/html; charset=UTF-8\" />\r\n"
<< " <style type=\"text/css\" title=\"Default\" media=\"all\">\r\n"
<< " <!--\r\n"
<< " body {\r\n"
<< " background-color:#fff;\r\n"
<< " font:11px verdana, arial, helvetica, sans-serif;\r\n"
<< " margin:20px;\r\n"
<< " }\r\n"
<< " h1 {\r\n"
<< " font-size:28px;\r\n"
<< " font-weight:900;\r\n"
<< " color:#ccc;\r\n"
<< " letter-spacing:0.5em;\r\n"
<< " margin-bottom:30px;\r\n"
<< " width:650px;\r\n"
<< " text-align:center;\r\n"
<< " }\r\n"
<< " h2 {\r\n"
<< " font-size:18px;\r\n"
<< " font-weight:800;\r\n"
<< " color:#360;\r\n"
<< " border:none;\r\n"
<< " letter-spacing:0.3em;\r\n"
<< " padding:0px;\r\n"
<< " margin-bottom:10px;\r\n"
<< " margin-top:0px;\r\n"
<< " }\r\n"
<< " hr {\r\n"
<< " display:none;\r\n"
<< " }\r\n"
<< " div.content {\r\n"
<< " width:650px;\r\n"
<< " border-top:1px solid #000;\r\n"
<< " border-right:1px solid #000;\r\n"
<< " border-bottom:1px solid #000;\r\n"
<< " border-left:10px solid #000;\r\n"
<< " padding:10px;\r\n"
<< " margin-bottom:30px;\r\n"
<< " -moz-border-radius:8px 0px 0px 8px;\r\n"
<< " }\r\n"
<< " div.schedule a {\r\n"
<< " display:block;\r\n"
<< " color:#000;\r\n"
<< " text-decoration:none;\r\n"
<< " padding:.2em .8em;\r\n"
<< " border:thin solid #fff;\r\n"
<< " width:350px;\r\n"
<< " }\r\n"
<< " div.schedule a span {\r\n"
<< " display:none;\r\n"
<< " }\r\n"
<< " div.schedule a:hover {\r\n"
<< " background-color:#F4F4F4;\r\n"
<< " border-top:thin solid #000;\r\n"
<< " border-bottom:thin solid #000;\r\n"
<< " border-left:thin solid #000;\r\n"
<< " cursor:default;\r\n"
<< " }\r\n"
<< " div.schedule a:hover span {\r\n"
<< " display:block;\r\n"
<< " position:absolute;\r\n"
<< " background-color:#F4F4F4;\r\n"
<< " color:#000;\r\n"
<< " left:400px;\r\n"
<< " margin-top:-20px;\r\n"
<< " width:280px;\r\n"
<< " padding:5px;\r\n"
<< " border:thin dashed #000;\r\n"
<< " }\r\n"
<< " div.loadstatus {\r\n"
<< " width:325px;\r\n"
<< " height:7em;\r\n"
<< " }\r\n"
<< " .jobfinished { color: #0000ff; }\r\n"
<< " .jobaborted { color: #7f0000; }\r\n"
<< " .joberrored { color: #ff0000; }\r\n"
<< " .jobrunning { color: #005f00; }\r\n"
<< " .jobqueued { }\r\n"
<< " -->\r\n"
<< " </style>\r\n"
<< " <title>MythFrontend Status - "
<< qdtNow.toString(shortdateformat) << " "
<< qdtNow.toString(timeformat) << " - "
<< MYTH_BINARY_VERSION << "</title>\r\n"
<< " <link rel=\"stylesheet\" href=\"/css/site.css\" type=\"text/css\">\r\n"
<< " <link rel=\"stylesheet\" href=\"/css/Status.css\" type=\"text/css\">\r\n"
<< "</head>\r\n"
<< "<body>\r\n\r\n"
<< " <h1>MythFrontend Status</h1>\r\n";
<< " <h1 class=\"status\">MythFrontend Status</h1>\r\n";

stream
<< " <div class=\"content\">\r\n"
<< " <h2>Master Backend</h2>\r\n"
<< " <h2 class=\"status\">This Frontend</h2>\r\n"
<< "Name : " << hostname << "<br />\r\n"
<< "Version : " << MYTH_BINARY_VERSION << "\r\n"
<< " </div>\r\n";

stream
<< " <div class=\"content\">\r\n"
<< " <h2 class=\"status\">Master Backend</h2>\r\n"
<< masterhost << "&nbsp(<a href=\"http://"
<< masterip << ":" << masterport
<< "\">Status page</a>)\r\n"
<< " </div>\r\n";

stream
<< " <div class=\"content\">\r\n"
<< " <h2>Services</h2>\r\n"
<< " <h2 class=\"status\">Services</h2>\r\n"
<< " <a href=\"MythFE/GetRemote\">Remote Control</a>\r\n"
<< " </div>\r\n";

Expand All @@ -159,7 +90,7 @@ class MythFrontendStatus : public HttpServerExtension
{
stream
<< " <div class=\"content\">\r\n"
<< " <h2>Machine Information</h2>\r\n"
<< " <h2 class=\"status\">Machine Information</h2>\r\n"
<< " <div class=\"loadstatus\">\r\n"
<< " This machine's load average:"
<< "\r\n <ul>\r\n <li>"
Expand Down

0 comments on commit 4938c83

Please sign in to comment.