diff --git a/YACReaderLibrary/server/controllers/webui/statuspagecontroller.cpp b/YACReaderLibrary/server/controllers/webui/statuspagecontroller.cpp index bbec2d8e..80e65d76 100644 --- a/YACReaderLibrary/server/controllers/webui/statuspagecontroller.cpp +++ b/YACReaderLibrary/server/controllers/webui/statuspagecontroller.cpp @@ -10,51 +10,50 @@ using stefanfrings::HttpRequest; using stefanfrings::HttpResponse; -//using stefanfrings::HttpSession; +// using stefanfrings::HttpSession; using stefanfrings::Template; -StatusPageController::StatusPageController() {} +StatusPageController::StatusPageController() { } void StatusPageController::service(HttpRequest &request, HttpResponse &response) { response.setHeader("Content-Type", "text/html; charset=utf-8"); response.setHeader("Connection", "close"); - Template StatusPage = Template(QStringLiteral( - "\n" - "\n" - "\n" - "YACReaderLibrary Server\n" - "\n" - "\n\n" - "
\n" - "\n" - "

YACReaderLibraryServer is up and running.

\n" - "

YACReader {yr.version}

\n" - "

Server {server.version}

\n" - "

OS:\t{os.name} {os.version}

\n" - "

Port:\t{os.port}

\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "{loop Library}" - "\n" - "\n" - "\n" - "\n" - "{end Library}" - "

\n" - "\n" - "\n" - "\n" - ), + Template StatusPage = Template( + QStringLiteral( + "\n" + "\n" + "\n" + "YACReaderLibrary Server\n" + "\n" + "\n\n" + "
\n" + "\n" + "

YACReaderLibraryServer is up and running.

\n" + "

YACReader {yr.version}

\n" + "

Server {server.version}

\n" + "

OS:\t{os.name} {os.version}

\n" + "

Port:\t{os.port}

\n" + "
LibraryPath
{Library.Name}{Library.Path}
\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "{loop Library}" + "\n" + "\n" + "\n" + "\n" + "{end Library}" + "

\n" + "\n" + "\n" + "\n"), - "StatusPage" - ); + "StatusPage"); StatusPage.enableWarnings(); @@ -74,8 +73,7 @@ void StatusPageController::service(HttpRequest &request, HttpResponse &response) // Fill template StatusPage.loop("Library", num_libs); - for (size_t i = 0; i < num_libs; i++) - { + for (size_t i = 0; i < num_libs; i++) { StatusPage.setVariable(QString("Library%1.Name").arg(i), library_names.at(i)); StatusPage.setVariable(QString("Library%1.Path").arg(i), libraries.getPath(library_names.at(i))); } diff --git a/YACReaderLibrary/server/controllers/webui/statuspagecontroller.h b/YACReaderLibrary/server/controllers/webui/statuspagecontroller.h index 09db86b1..22dae09f 100644 --- a/YACReaderLibrary/server/controllers/webui/statuspagecontroller.h +++ b/YACReaderLibrary/server/controllers/webui/statuspagecontroller.h @@ -10,7 +10,7 @@ class StatusPageController : public stefanfrings::HttpRequestHandler Q_OBJECT Q_DISABLE_COPY(StatusPageController); - public: +public: StatusPageController(); void service(stefanfrings::HttpRequest &request, stefanfrings::HttpResponse &response) override; diff --git a/YACReaderLibrary/server/requestmapper.cpp b/YACReaderLibrary/server/requestmapper.cpp index 780fb590..1106bbd6 100644 --- a/YACReaderLibrary/server/requestmapper.cpp +++ b/YACReaderLibrary/server/requestmapper.cpp @@ -160,8 +160,7 @@ void RequestMapper::service(HttpRequest &request, HttpResponse &response) QLOG_TRACE() << "X-Request-Id: " << request.getHeader("x-request-id"); // Browsers ask for text/html - if (path.startsWith("/webui")) - { + if (path.startsWith("/webui")) { serviceWebUI(request, response); } else if (path.startsWith("/v2")) { serviceV2(request, response);
LibraryPath
{Library.Name}{Library.Path}