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>
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue