diff --git a/src/main.cpp b/src/main.cpp index 4078bc2..5694aee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -95,6 +95,9 @@ public: // картинки, их даже можно кешировать static constexpr const char* FAVICON_ICO = "/favicon.ico"; static constexpr const char* VUE_JS = "/js/vue.js"; // это тоже можно кешировать + static constexpr const char* CHARTJS = "/js/chart.js"; + static constexpr const char* MOMENT_JS = "/js/moment.js"; + static constexpr const char* CHARTJS_ADAPTER_MOMENT = "/js/chartjs-adapter-moment.js"; // а эти стили нельзя кешировать в отладочной версии static constexpr const char* STYLE_CSS = "/style.css"; @@ -117,6 +120,9 @@ public: auth.users.emplace_back(std::make_shared("developer", "10628cfc434fb87f31d675d37e0402c2d824cfe8393aff7a61ee57aaa7d909c3", http::auth::User::SUPERUSER)); sf->registerFile(staticFilesPath + "/favicon.png", FAVICON_ICO, mime_types::image_png, true); + sf->registerFile(staticFilesPath + CHARTJS, CHARTJS, mime_types::javascript, true); + sf->registerFile(staticFilesPath + MOMENT_JS, MOMENT_JS, mime_types::javascript, true); + sf->registerFile(staticFilesPath + CHARTJS_ADAPTER_MOMENT, CHARTJS_ADAPTER_MOMENT, mime_types::javascript, true); #ifdef USE_DEBUG sf->registerFile(staticFilesPath + VUE_JS, VUE_JS, mime_types::javascript, true); #else @@ -185,6 +191,9 @@ public: s.resources.emplace_back(std::make_unique(STYLE_CSS, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(STYLE_CSS, rep); })); s.resources.emplace_back(std::make_unique(FIELDS_CSS, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(FIELDS_CSS, rep); })); s.resources.emplace_back(std::make_unique(VUE_JS, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(VUE_JS, rep); })); + s.resources.emplace_back(std::make_unique(CHARTJS, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(CHARTJS, rep); })); + s.resources.emplace_back(std::make_unique(MOMENT_JS, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(MOMENT_JS, rep); })); + s.resources.emplace_back(std::make_unique(CHARTJS_ADAPTER_MOMENT, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(CHARTJS_ADAPTER_MOMENT, rep); })); s.resources.emplace_back(std::make_unique(INTERNET_JPG, [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(INTERNET_JPG, rep); })); s.resources.emplace_back(std::make_unique("/api/get/statistics", this->auth, http::auth::User::WATCH_STATISTICS, [this](const auto& req, auto& rep) { diff --git a/static/dev.html b/static/dev.html index cfa3ab9..c5cd2cb 100644 --- a/static/dev.html +++ b/static/dev.html @@ -94,22 +94,14 @@

Просмотр логов

Скачать -
- - - - - - - - - -
{{ h }}
{{ value }}
-
+
+ + +