diff --git a/html/main.html b/html/main.html index 94cb858..6627d1a 100644 --- a/html/main.html +++ b/html/main.html @@ -1,3 +1,5 @@ + + @@ -45,7 +47,7 @@ Online: {{ONLINE}}
- {{ONLINE_LIST}} +{{ONLINE_LIST}}
diff --git a/httpserver.cpp b/httpserver.cpp index 0be45fe..c8f4213 100644 --- a/httpserver.cpp +++ b/httpserver.cpp @@ -384,6 +384,7 @@ void HttpServer::replaceTag(QString &page, const QString &tag, const QString &pa void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHeadRequest) { + auto renderStart = QDateTime::currentMSecsSinceEpoch(); QString searchRequest; bool isRegexp {false}; int specSymbol = urlPath.indexOf('?'); // any actions like a ?toSearch= @@ -1064,6 +1065,8 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead QString mainHeader = HEADER_HTML; replaceTag(mainHeader, "SIZE", QString::number(QByteArray(page.toUtf8()).size())); + replaceTag(page, "RENDERING_TIMER", QString::number(QDateTime::currentMSecsSinceEpoch() - renderStart)); + if (socket->isOpen()) { socket->write(mainHeader.toUtf8()); if (not isHeadRequest) socket->write(page.toUtf8()); diff --git a/httpserver.h b/httpserver.h index 7fa9239..4bc3530 100644 --- a/httpserver.h +++ b/httpserver.h @@ -88,7 +88,7 @@ Content-Length: {{SIZE}}\r\n\r\n"; {{CHANNEL_NAME}}\n"; const QString HTML_ONLINE_POINT = "\ -
\n\ +
\n\ {{NICKNAME}}\n\
\n"; @@ -121,10 +121,10 @@ Content-Length: {{SIZE}}\r\n\r\n";
\n"; const QString HTML_PAYLOAD_ERROR = "\ -
\n\ +
\n\ {{ERROR_TITLE}}
\n\ {{ERROR_TEXT}}\n\ -
"; +
"; private slots: void acceptor();