diff --git a/.gitignore b/.gitignore index 8525730..669d747 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # ---> Qt # C++ objects and libs - *.slo *.lo *.o @@ -8,11 +7,14 @@ *.la *.lai *.so +*.so.* *.dll *.dylib # Qt-es - +object_script.*.Release +object_script.*.Debug +*_plugin_import.cpp /.qmake.cache /.qmake.stash *.pro.user @@ -21,16 +23,33 @@ *.qbs.user.* *.moc moc_*.cpp +moc_*.h qrc_*.cpp ui_*.h +*.qmlc +*.jsc Makefile* -*-build-* +*build-* +*.qm +*.prl + +# Qt unit tests +target_wrapper.* # QtCreator - *.autosave -#QtCtreator Qml +# QtCreator Qml *.qmlproject.user *.qmlproject.user.* +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine specific files for imported projects +*creator.user* + +*_qmlcache.qrc diff --git a/src/html-static.qrc b/src/html-static.qrc index 6ee62f3..89da3f9 100644 --- a/src/html-static.qrc +++ b/src/html-static.qrc @@ -2,5 +2,6 @@ html/index.html html/main.css + html/favicon.ico diff --git a/src/html/favicon.ico b/src/html/favicon.ico new file mode 100644 index 0000000..6277777 Binary files /dev/null and b/src/html/favicon.ico differ diff --git a/src/socketrunnable.cpp b/src/socketrunnable.cpp index 7ebb1d0..8527f51 100644 --- a/src/socketrunnable.cpp +++ b/src/socketrunnable.cpp @@ -45,6 +45,10 @@ void SocketRunnable::get() { httpDocument().setBody(QFile(":/html/main.css"), eTag); } + else if (urlPath() == "/favicon.ico") + { + httpDocument().setBody(QFile(":/html/favicon.ico"), eTag); + } else { httpDocument().setBody(QFile(g::p::WORKING_DIR + "/html" + urlPath()), eTag); diff --git a/src/webpage.cpp b/src/webpage.cpp index de20ffa..bc900ea 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -91,6 +91,7 @@ QByteArray WebPage::document() customStyles(page); lastDestinations(page); trafficBlock(page); + topDestinations(page); blockedDestinations(page); informationBlock(page); copyright(page); @@ -139,11 +140,19 @@ void WebPage::trafficBlock(QString &document) void WebPage::topDestinations(QString &document) { -// QString dailyTopList; -// for (const auto& dTop: Statistics::dailyTopDestinations()) -// { -// QStringList -// } + QString dailyTopList; + for (const auto& dTop: Statistics::dailyTopDestinations()) + { + dailyTopList += dailyTopDestinationItem(dTop); + } + document.replace(g::c::HA_DAILY_TOP_DESTINATIONS_LIST, dailyTopList); + + QString totalTopList; + for (const auto& dTop: Statistics::totalTopDestinations()) + { + totalTopList += totalTopDestinationItem(dTop); + } + document.replace(g::c::HA_TOTAL_TOP_DESTINATIONS_LIST, totalTopList); } void WebPage::blockedDestinations(QString &document)