Add some css to the webui status page controller

This commit is contained in:
Luis Ángel San Martín 2023-12-16 08:28:42 +01:00
parent ed82f0c801
commit cf99229441

View File

@ -4,13 +4,11 @@
#include "yacreader_global.h"
#include "db_helper.h"
#include "yacreader_libraries.h"
#include "QsLog.h"
#include <QSysInfo>
using stefanfrings::HttpRequest;
using stefanfrings::HttpResponse;
// using stefanfrings::HttpSession;
using stefanfrings::Template;
StatusPageController::StatusPageController() { }
@ -23,36 +21,84 @@ void StatusPageController::service(HttpRequest &request, HttpResponse &response)
Template StatusPage = Template(
QStringLiteral(
"<!DOCTYPE html>\n"
"<html>\n"
"<html lang='en'>\n"
"<head>\n"
"<title>YACReaderLibrary Server</title>\n"
" <meta charset='UTF-8'>\n"
" <meta name='viewport' content='width=device-width, initial-scale=1.0'>\n"
" <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700,300italic,400italic,800italic' rel='stylesheet' type='text/css'>"
" <title>YACReaderLibrary Server</title>\n"
" <style>\n"
" body {\n"
" font-family: 'Open Sans', sans-serif;\n"
" margin: 0;\n"
" padding: 0;\n"
" }\n"
" header {\n"
" text-align: center;\n"
" padding: 20px;\n"
" padding-top: 80px;\n"
" background-color: #fff;\n"
" color: rgb(34, 34, 34);\n"
" }\n"
" header h1 {\n"
" font-size: 40px;\n"
" font-style: normal;\n"
" font-weight: 400;\n"
" }\n"
" img {\n"
" max-width: 100%;\n"
" height: auto;\n"
" }\n"
" h1 {\n"
" color: rgb(34, 34, 34);\n"
" }\n"
" section {\n"
" margin: 20px;\n"
" }\n"
" table {\n"
" border-collapse: collapse;\n"
" margin: 20px auto;\n"
" }\n"
" th, td {\n"
" border: 1px solid #ddd;\n"
" padding: 8px;\n"
" text-align: left;\n"
" }\n"
" th {\n"
" background-color: #eee;\n"
" color: rgb(34, 34, 34);\n"
" }\n"
" </style>\n"
"</head>\n"
"<body>\n\n"
"<center>\n"
"<img src='/images/webui/YACLibraryServer.svg' width=15%>\n"
"<h1>YACReaderLibraryServer is up and running.</h1>\n"
"<p>YACReader {yr.version}<p>\n"
"<p>Server {server.version}<p>\n"
"<p>OS:\t{os.name} {os.version}</p>\n"
"<p>Port:\t{os.port}</p>\n"
"<table>\n"
"<thead>\n"
"<tr>\n"
"<th>Library</th>\n"
"<th>Path</th>\n"
"</tr>\n"
"</thead>\n"
"{loop Library}"
"<tr>\n"
"<td>{Library.Name}</td>\n"
"<td>{Library.Path}</td>\n"
"<tr>\n"
"{end Library}"
"</p>\n"
"</center>\n"
"<body>\n"
" <header>\n"
" <img src='/images/webui/YACLibraryServer.svg' alt='YACReaderLibrary Server Logo' width='200px'>\n"
" <h1>YACReaderLibrary Server <span style = 'display: block;'>is up and running.</span></h1>"
" <p>YACReader {yr.version}</p>\n"
" <p>Server {server.version}</p>\n"
" <p>OS: {os.name} {os.version}</p>\n"
" <p>Port: {os.port}</p>\n"
" </header>\n"
" <section>\n"
" <table>\n"
" <thead>\n"
" <tr>\n"
" <th>Library</th>\n"
" <th>Path</th>\n"
" </tr>\n"
" </thead>\n"
" <tbody>\n"
" {loop Library}\n"
" <tr>\n"
" <td>{Library.Name}</td>\n"
" <td>{Library.Path}</td>\n"
" </tr>\n"
" {end Library}\n"
" </tbody>\n"
" </table>\n"
" </section>\n"
"</body>\n"
"</html>\n"),
"StatusPage");
StatusPage.enableWarnings();