From 7e5f22141f72fd1ad0ec7982df03f126e9c11244 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 31 Aug 2014 12:59:04 +0200 Subject: WebAdmin: Added "files" folder and load the login template from login_template.html --- src/WebAdmin.cpp | 106 +++++++++++++++++++++++++++++++++++++++++++++++++------ src/WebAdmin.h | 6 ++++ 2 files changed, 102 insertions(+), 10 deletions(-) diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp index 23eedbd14..0646c9d1c 100644 --- a/src/WebAdmin.cpp +++ b/src/WebAdmin.cpp @@ -135,6 +135,20 @@ bool cWebAdmin::Start(void) m_TemplateScript.Close(); } + if (!LoadLoginTemplate()) + { + LOGWARN("Could not load WebAdmin login template \"%s\", using fallback template.", FILE_IO_PREFIX "webadmin/login_template.html"); + + // Sets the fallback template: + m_LoginTemplate = \ + "

MCServer WebAdmin

" \ + "
" \ + "
" \ + "" \ + "
" \ + "
"; + } + m_IsRunning = m_HTTPServer.Start(*this); return m_IsRunning; } @@ -159,6 +173,28 @@ void cWebAdmin::Stop(void) +bool cWebAdmin::LoadLoginTemplate(void) +{ + cFile File(FILE_IO_PREFIX "webadmin/login_template.html", cFile::fmRead); + if (!File.IsOpen()) + { + return false; + } + + AString TemplateContent; + if (File.ReadRestOfFile(TemplateContent) == -1) + { + return false; + } + + m_LoginTemplate = TemplateContent; + return true; +} + + + + + void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) { if (!a_Request.HasAuth()) @@ -298,17 +334,11 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque void cWebAdmin::HandleRootRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) { UNUSED(a_Request); - static const char LoginForm[] = \ - "

MCServer WebAdmin

" \ - "
" \ - "
" \ - "" \ - "
" \ - "
"; + cHTTPResponse Resp; Resp.SetContentType("text/html"); a_Connection.Send(Resp); - a_Connection.Send(LoginForm, sizeof(LoginForm) - 1); + a_Connection.Send(m_LoginTemplate); a_Connection.FinishResponse(); } @@ -528,7 +558,64 @@ void cWebAdmin::OnRequestFinished(cHTTPConnection & a_Connection, cHTTPRequest & } else { - // TODO: Handle other requests + AString FileURL = URL; + std::replace(FileURL.begin(), FileURL.end(), '\\', '/'); + + // Remove all backsplashes on the first place: + if (FileURL[0] == '/') + { + size_t FirstCharToRead = FileURL.find_first_not_of('/'); + if (FirstCharToRead != AString::npos) + { + FileURL = FileURL.substr(FirstCharToRead); + } + } + + // Remove all "../" strings: + ReplaceString(FileURL, "../", ""); + + bool LoadedSuccessfull = false; + AString Content = "

404 Not Found

"; + AString Path = Printf(FILE_IO_PREFIX "webadmin/files/%s", FileURL.c_str()); + if (cFile::IsFile(Path)) + { + cFile File(Path, cFile::fmRead); + AString FileContent; + if (File.IsOpen() && (File.ReadRestOfFile(FileContent) != -1)) + { + LoadedSuccessfull = true; + Content = FileContent; + } + } + + // Find content type (The currently method is very bad. We should change it later) + AString ContentType = "text/html"; + size_t LastPointPosition = Path.find_last_of('.'); + if (LoadedSuccessfull && (LastPointPosition != AString::npos) && (LastPointPosition < Path.length())) + { + const AString & FileExtension = StrToLower(Path.substr(LastPointPosition + 1)); + if (FileExtension == "png") ContentType = "image/png"; + if (FileExtension == "fif") ContentType = "image/fif"; + if (FileExtension == "gif") ContentType = "image/gif"; + if (FileExtension == "jpeg") ContentType = "image/jpeg"; + if (FileExtension == "jpg") ContentType = "image/jpeg"; + if (FileExtension == "jpe") ContentType = "image/jpeg"; + if (FileExtension == "tiff") ContentType = "image/tiff"; + if (FileExtension == "ico") ContentType = "image/ico"; + if (FileExtension == "csv") ContentType = "text/comma-separated-values"; + if (FileExtension == "css") ContentType = "text/css"; + if (FileExtension == "js") ContentType = "text/javascript"; + if (FileExtension == "txt") ContentType = "text/plain"; + if (FileExtension == "rtx") ContentType = "text/richtext"; + if (FileExtension == "xml") ContentType = "text/xml"; + } + + // Send the response: + cHTTPResponse Resp; + Resp.SetContentType(ContentType); + a_Connection.Send(Resp); + a_Connection.Send(Content); + a_Connection.FinishResponse(); } // Delete any request data assigned to the request: @@ -551,4 +638,3 @@ void cWebAdmin::cWebadminRequestData::OnBody(const char * a_Data, size_t a_Size) - diff --git a/src/WebAdmin.h b/src/WebAdmin.h index aefc1d145..a59c69096 100644 --- a/src/WebAdmin.h +++ b/src/WebAdmin.h @@ -116,6 +116,9 @@ public: /** Stops the HTTP server, if it was started. */ void Stop(void); + /** Loads the login template. Returns true if the loading success, false if not. */ + bool LoadLoginTemplate(void); + void AddPlugin(cWebPlugin * a_Plugin); void RemovePlugin(cWebPlugin * a_Plugin); @@ -205,6 +208,9 @@ protected: /** The Lua template script to provide templates: */ cLuaState m_TemplateScript; + /** The template who provide the login side: */ + AString m_LoginTemplate; + /** The HTTP server which provides the underlying HTTP parsing, serialization and events */ cHTTPServer m_HTTPServer; -- cgit v1.2.3 From 8934ab487e92d070301617298b3856cddafab643 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 31 Aug 2014 14:20:42 +0200 Subject: WebAdmin: Added login template --- MCServer/webadmin/files/mc-logo.png | Bin 0 -> 66137 bytes MCServer/webadmin/login_template.html | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 MCServer/webadmin/files/mc-logo.png create mode 100644 MCServer/webadmin/login_template.html diff --git a/MCServer/webadmin/files/mc-logo.png b/MCServer/webadmin/files/mc-logo.png new file mode 100644 index 000000000..9a77a490f Binary files /dev/null and b/MCServer/webadmin/files/mc-logo.png differ diff --git a/MCServer/webadmin/login_template.html b/MCServer/webadmin/login_template.html new file mode 100644 index 000000000..dd456607c --- /dev/null +++ b/MCServer/webadmin/login_template.html @@ -0,0 +1,24 @@ + + + MCServer WebAdmin - Login + + + + + +
+ +

MCServer - WebAdmin

+
+ +
+
+ + + -- cgit v1.2.3 From 9a95b006488e2813cf5f7fc73c5bff1b2fb54964 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 31 Aug 2014 14:39:58 +0200 Subject: WebAdmin: Exported stylesheet in a own file. --- MCServer/webadmin/files/style.css | 326 ++++++++++++++++++++++++++++++++++++ MCServer/webadmin/template.lua | 336 +------------------------------------- 2 files changed, 329 insertions(+), 333 deletions(-) create mode 100644 MCServer/webadmin/files/style.css diff --git a/MCServer/webadmin/files/style.css b/MCServer/webadmin/files/style.css new file mode 100644 index 000000000..044204084 --- /dev/null +++ b/MCServer/webadmin/files/style.css @@ -0,0 +1,326 @@ +/* reset CSS */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + vertical-align: baseline; + background: transparent; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} + +/* remember to define focus styles! */ +:focus { + outline: 0; +} + +/* remove textarea resize at Safari */ +textarea { + resize: none; +} + +/* remember to highlight inserts somehow! */ +ins { + text-decoration: none; +} +del { + text-decoration: line-through; +} + +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: collapse; + border-spacing: 0; +} + + +/* + Origional from http://www.perspectived.com/ + Modified by Ben Phelps + Made for FakeTruth - MCServer +*/ + +/* Basic ---------------------------------------- */ + +.clear { clear: both; } + +body { + background: white; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + color: #646464; + text-align: center; +} + +#wrapper { + text-align: left; + width: 930px; + margin: 0 auto; +} + +/* Logo ---------------------------------------- */ + +h1 { + margin: 15px 0 10px 5px; + width: 180px; + height: 36px; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAkCAMAAAAXdeBDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuVQTFRFAAA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u4AAAAAElFTkSuQmCC) no-repeat left top; +} + +h1 a { + display: block; + width: 225px; + height: 28px; +} + +h1 span { display: none; } + +a { + color: #646464; +} + +/* Container ---------------------------------------- */ + +#containerHolder { + background: #eee; + padding: 5px; +} + + +#container { + background: #fff url(data:image/gif;base64,R0lGODlhtAABAIAAAN3d3f///yH5BAAAAAAALAAAAAC0AAEAAAIMjI+py+0Po5y0WgYKADs%3D) repeat-y left top; + border: 1px solid #ddd; + width: 918px; + +} + +#connectHolder { + background: #eee; + padding: 5px; + margin-bottom:8px; +} + + +#connect { + border: 1px solid #ddd; + background-color: #fff; + padding:5px; + width: 908px; +} + +.pics { + height: 375px; + width: 600px; +} + +.pics img { + padding: 5px; + border: 1px solid #ddd; + background-color: #eee; + width: 600px; + height: 375px; + margin-left: 15px; +} + +/* Login -------------------------------------- */ + +#loginLogo { + margin: 0 auto; + margin-top:100px; + width: 180px; + height: 36px; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAkCAMAAAAXdeBDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuVQTFRFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs7OzAAAAAAAAoqKiAAAAvLy8AAAAlZWVtbW1j4+Pra2tiYmJp6enAAAAhISEoaGhAAAAgICAm5ube3t7lZWVd3d3kZGRc3NzjIyMbGxsg4ODgICAeHh43NzcdXV1cnJyy8vLWVlZbGxswcHB09PTvLy8uLi4tLS0sLCwvLy8uLi4tbW1oaGhnp6era2tm5ubqqqq39/f29vblZWV09PT4ODgz8/P3NzckZGRxcXF0tLSwsLCzs7Oy8vLyMjIt7e3vLy85ubm7u7u3d3d5+fn2tra5OTk19fX1dXV3t7e29vb2dnZ1tbW0dHRv7+/8PDw7u7u6+vr8fHx5ubm4+Pj7Ozs4eHh3t7e5+fn5OTk2tra4uL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DUEjuO6pXP4rtAaDp/rI5ETBKn5MRbDl2zyifUMrDFrFgdoeTuHQyrkz4hCcEcF29PMz4lXKlVAk8r3fXHtzey8rw+8JzTtsW5POH++9dkV7twM1ehtlH/w4K6duqteWLCgphiyyJeUd7cMAkDwK0AQ9D5psAuhN5NxpfMQ9jY/y07gsK6ucSSubL1UKWYttJ5UuBY5kruA4BWjf7IOXqxRaoLPJgK5Dh36j0Mo6EJjBEo9on9AifiQeG8BSLbSA7wbou7HHvYcsSUhZ9aQ9YYFN5CJbVRnJ6pLDxYzFLVM8dDkhykA6PSDDe91UQ39X7fV4i+gZ7ceA6tW/HviCVNumwAh4f3k/ljxvmAQBkSs7TpYKheLQnusVJIIMErqxr1TI5QqVvg0gZAjfNzBwH3Lfy0DJeod31ezBO9qXsfOPexqqnQlagGa8y1MJFqviB85bW1o+QiHNTHEENrn3tnZ1tb6RsmMBkyJUcznJ5PIyyRX8OtF+jEsGG/S/fPyIOdOtKZuf2+NhonAPBLqTI6qmKQTDLPhrmbjXjnPmuW60/wtqryt07/tp3oA8z8MdCHHXjBcC7mOd6Bfk7r3udC94aDf6/9T+AzWzIkAbVeu4AAAAAElFTkSuQmCC); +} + +#loginHolder { + background: #eee; + padding: 5px; + width: 310px; + margin: 0 auto; + height: 90px; + margin-top:20px; +} + +#login { + padding:10px; + width: 288px; + height: 68px; + border: 1px solid #ddd; + background:#fff; + text-align: left; +} + + +/* Sidebar ---------------------------------------- */ + +#sidebar { + width: 179px; + float: left; +} + +#sidebar .sideNav { width: 179px; } + +#sidebar .sideNav li { border-bottom: 1px solid #ddd; width: 179px; } + +#sidebar .sideNav li a { + display: block; + color: #646464; + background: #f6f6f6; + text-decoration: none; + height: 29px; + line-height: 29px; + padding: 0 19px; + width: 141px; +} + +#sidebar .sideNav li a:hover { background: #fdfcf6; } + +#sidebar .sideNav li a.active, #sidebar .sideNav li a.active:hover { + background: #f0f7fa; + color: #c66653; +} + +/* Breadcrumb ---------------------------------------- */ + +h2 { + width: 718px; + float: right; + color: #646464; + font-size: 16px; + line-height: 16px; + font-weight: bold; + margin: 20px 0 0 0; + padding: 0 0 10px 0; + border-bottom: 1px solid #ddd; +} + +h2 a { + color: #646464; + text-decoration: none; +} + +h2 a.active { color: #c66653; } + +h2 a:hover { text-decoration: underline; } + +/* Content ---------------------------------------- */ + +#main { + width: 700px; + float: right; + padding: 0 19px 0 0; +} + +#main p { + + padding: 10px; + +} + +h3 { + font-size: 14px; + line-height: 14px; + font-weight: bold; + color: #5494af; + padding: 0 0 0 10px; + margin: 20px 0 10px; +} + +h4 { + padding: 0 0 0 10px; + margin: 20px 0 10px; +} + +#main ul { + padding: 0 0 0 10px; + list-style-type: circle; + list-style-position: inside; +} + +#main table { + border-top: 1px solid #ddd; + width: 700px; +} + +#main table tr th { + text-align: left; + background: #f6f6f6; + padding: 0px 20px; + height: 20px; + line-height: 20px; + border-bottom: 1px solid #ddd; +} + +#main table tr td { + background: #f6f6f6; + padding: 0px 20px; + height: 29px; + line-height: 29px; + border-bottom: 1px solid #ddd; +} + +#main table tr.odd td { + background: #fbfbfb; +} + +#main table tr:hover td { background: #fdfcf6; } + +#main table .action { + text-align: right; + padding: 0 20px 0 10px; +} + +#main table tr .action a { margin: 0 0 0 10px; text-decoration: none; color: #9b9b9b; } +#main table tr:hover .action .edit { color: #c5a059; } +#main table tr:hover .action .delete { color: #a02b2b; } +#main table tr:hover .action .view { color: #55a34a; } + +#main table tr:hover .action a:hover { text-decoration: underline; } + +fieldset { + border: 1px solid #ddd; + padding: 19px; + margin: 0 0 20px 0; + background: #fbfbfb; +} + +form p { margin: 0 0 14px 0; float: left; width: 100%; } + +label { + display: block; + width: 100%; + margin: 0 0 7px 0; + line-height: 12px; +} + +/* Footer ---------------------------------------- */ + +#footer { + margin: 10px 0 30px 0; + font-size: 11px; + line-height: 11px; + color: #9B9B9B; + padding: 0 0 0 5px; +} + +#footer a { color: #9B9B9B; } + +#footer a:hover { text-decoration: none; } diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index a066d8b33..5d5ac7b20 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -57,7 +57,7 @@ end function ShowPage(WebAdmin, TemplateRequest) SiteContent = {} local BaseURL = WebAdmin:GetBaseURL(TemplateRequest.Request.Path) - local Title = "MCServer" + local Title = "MCServer WebAdmin" local MemoryUsageKiB = cRoot:GetPhysicalRAMUsage() local NumChunks = cRoot:Get():GetTotalChunkCount() local PluginPage = WebAdmin:GetPage(TemplateRequest.Request) @@ -76,337 +76,7 @@ function ShowPage(WebAdmin, TemplateRequest) ]] .. Title .. [[ - - - + @@ -464,4 +134,4 @@ function ShowPage(WebAdmin, TemplateRequest) ]]) return table.concat(SiteContent) -end \ No newline at end of file +end -- cgit v1.2.3 From fca986ec7139100939c3290a5f211d868320510f Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 31 Aug 2014 14:51:07 +0200 Subject: WebAdmin: Exported favicon. --- MCServer/webadmin/files/favicon.ico | Bin 0 -> 32038 bytes MCServer/webadmin/template.lua | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 MCServer/webadmin/files/favicon.ico diff --git a/MCServer/webadmin/files/favicon.ico b/MCServer/webadmin/files/favicon.ico new file mode 100644 index 000000000..ea4bde926 Binary files /dev/null and b/MCServer/webadmin/files/favicon.ico differ diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index 5d5ac7b20..a7480f83e 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -74,7 +74,7 @@ function ShowPage(WebAdmin, TemplateRequest) - + ]] .. Title .. [[ @@ -91,16 +91,16 @@ function ShowPage(WebAdmin, TemplateRequest)
    ]]) - + local AllPlugins = WebAdmin:GetPlugins() for key,value in pairs(AllPlugins) do local PluginWebTitle = value:GetWebTitle() local TabNames = value:GetTabNames() if (GetTableSize(TabNames) > 0) then - Output("
  • "..PluginWebTitle.."
  • "); + Output("
  • "..PluginWebTitle.."
  • \n"); for webname,prettyname in pairs(TabNames) do - Output("
  • " .. prettyname .. "
  • ") + Output("
  • " .. prettyname .. "
  • \n") end end end -- cgit v1.2.3 From ceb1a464497ad8babf079278b1b6eca446eaf141 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 31 Aug 2014 14:52:44 +0200 Subject: WebAdmin: Added favicon to the login template. --- MCServer/webadmin/login_template.html | 1 + 1 file changed, 1 insertion(+) diff --git a/MCServer/webadmin/login_template.html b/MCServer/webadmin/login_template.html index dd456607c..913a85db0 100644 --- a/MCServer/webadmin/login_template.html +++ b/MCServer/webadmin/login_template.html @@ -2,6 +2,7 @@ MCServer WebAdmin - Login +