mirror of https://notabug.org/acetone/ircabot.git
HTML tabs fixes and page rendering timer
parent
459a35718b
commit
dd7fd353b4
|
@ -1,3 +1,5 @@
|
|||
<!-- Create dynamic HTML in C++ code like the master in {{RENDERING_TIMER}}ms -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -45,7 +47,7 @@
|
|||
Online: {{ONLINE}}
|
||||
</label>
|
||||
<div class="main_middle__online_list">
|
||||
{{ONLINE_LIST}}
|
||||
{{ONLINE_LIST}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -88,7 +88,7 @@ Content-Length: {{SIZE}}\r\n\r\n";
|
|||
<a href=\"{{CHANNEL_LINK}}\" class=\"left_menu__item_link__selected\">{{CHANNEL_NAME}}</a>\n";
|
||||
|
||||
const QString HTML_ONLINE_POINT = "\
|
||||
<div class=\"main_middle__online_point\">\n\
|
||||
<div class=\"main_middle__online_point\">\n\
|
||||
{{NICKNAME}}\n\
|
||||
</div>\n";
|
||||
|
||||
|
@ -121,7 +121,7 @@ Content-Length: {{SIZE}}\r\n\r\n";
|
|||
</div>\n";
|
||||
|
||||
const QString HTML_PAYLOAD_ERROR = "\
|
||||
<div class=\"main_payload__error\">\n\
|
||||
<div class=\"main_payload__error\">\n\
|
||||
<span style=\"color: red; display: block; font-size: 24px;\">{{ERROR_TITLE}}</span><br>\n\
|
||||
{{ERROR_TEXT}}\n\
|
||||
</div>";
|
||||
|
|
Loading…
Reference in New Issue