current server is first in list

master
const an teen 2021-12-30 23:48:48 -05:00
parent 55416bd06c
commit 96819fd3ce
1 changed files with 15 additions and 10 deletions

View File

@ -617,8 +617,11 @@ void HttpServer::writeMainPage(QTcpSocket *socket, QString &urlPath, bool isHead
} else {
replaceTag(htmlServersSection, "ONLINE_STATUS", HTML_SERVER_OFFLINE_MARKER);
}
htmlServersSectionS += htmlServersSection;
if (s.first == originalServerName) {
htmlServersSectionS.push_front(htmlServersSection);
} else {
htmlServersSectionS += htmlServersSection;
}
}
replaceTag(page, "SERVERS_SECTION", htmlServersSectionS);
@ -1231,8 +1234,11 @@ void HttpServer::writeRealTimeChatPage(QTcpSocket *socket, QString &urlPath, boo
} else {
replaceTag(htmlServersSection, "ONLINE_STATUS", HTML_SERVER_OFFLINE_MARKER);
}
htmlServersSectionS += htmlServersSection;
if (s.first == originalServerName) {
htmlServersSectionS.push_front(htmlServersSection);
} else {
htmlServersSectionS += htmlServersSection;
}
}
replaceTag(page, "SERVERS_SECTION", htmlServersSectionS);
@ -1387,10 +1393,6 @@ void HttpServer::writeAboutServerPage(QTcpSocket *socket, QString &urlPath, bool
}
replaceTag(htmlServersSection, "ABOUT_SERVER", "/serverinformation/"+s.first);
replaceTag(htmlServersSection, "SERVER_NAME", s.first);
if (s.first == originalServerName) {
htmlServersSection.replace("<span style=\"font-size: 17px;\">{{ONLINE_STATUS}}",
"<span style=\"font-size: 17px;\" id=\"serverStatus\">{{ONLINE_STATUS}}");
}
QString htmlChannelLineS;
for (const auto &c: s.second) {
@ -1419,8 +1421,11 @@ void HttpServer::writeAboutServerPage(QTcpSocket *socket, QString &urlPath, bool
} else {
replaceTag(htmlServersSection, "ONLINE_STATUS", HTML_SERVER_OFFLINE_MARKER);
}
htmlServersSectionS += htmlServersSection;
if (s.first == originalServerName) {
htmlServersSectionS.push_front(htmlServersSection);
} else {
htmlServersSectionS += htmlServersSection;
}
}
replaceTag(page, "SERVERS_SECTION", htmlServersSectionS);
page.remove(QRegularExpression("<div class=\"main_header\">.*<!-- main_middle -->", QRegularExpression::DotMatchesEverythingOption));