cleanup + изменение цветов темы

This commit is contained in:
Vladislav Ostapov 2024-11-15 13:45:25 +03:00
parent 4a27a46c27
commit 1d73547eae
7 changed files with 17 additions and 31 deletions

View File

@ -109,13 +109,11 @@ public:
// картинки, их даже можно кешировать // картинки, их даже можно кешировать
static constexpr const char* FAVICON_ICO = "static/favicon.png"; static constexpr const char* FAVICON_ICO = "static/favicon.png";
static constexpr const char* KROKODIL_GIF = "static/krokodil.gif";
static constexpr const char* VUE_JS = "static/js/vue.js"; // это тоже можно кешировать static constexpr const char* VUE_JS = "static/js/vue.js"; // это тоже можно кешировать
// а эти стили нельзя кешировать в отладочной версии // а эти стили нельзя кешировать в отладочной версии
static constexpr const char* STYLE_CSS = "static/style.css"; static constexpr const char* STYLE_CSS = "static/style.css";
static constexpr const char* FIELDS_CSS = "static/fields.css"; static constexpr const char* FIELDS_CSS = "static/fields.css";
static constexpr const char* KB_MP4 = "static/video_2024-11-06_15-49-35.mp4";
ServerResources(const ServerResources&) = delete; ServerResources(const ServerResources&) = delete;
@ -124,9 +122,7 @@ public:
auth.users.emplace_back(std::make_shared<http::auth::User>("admin", "", http::auth::User::SUPERUSER)); auth.users.emplace_back(std::make_shared<http::auth::User>("admin", "", http::auth::User::SUPERUSER));
sf->registerFile(FAVICON_ICO, mime_types::image_png, true); sf->registerFile(FAVICON_ICO, mime_types::image_png, true);
sf->registerFile(KROKODIL_GIF, mime_types::image_gif, true);
sf->registerFile(VUE_JS, mime_types::javascript, true); sf->registerFile(VUE_JS, mime_types::javascript, true);
sf->registerFile(KB_MP4, mime_types::video_mp4, true);
sf->registerFile(STYLE_CSS, mime_types::text_css, true); sf->registerFile(STYLE_CSS, mime_types::text_css, true);
sf->registerFile(FIELDS_CSS, mime_types::text_css, true); sf->registerFile(FIELDS_CSS, mime_types::text_css, true);
@ -187,11 +183,9 @@ public:
})); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/favicon.ico", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(FAVICON_ICO, rep); })); s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/favicon.ico", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(FAVICON_ICO, rep); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/images/krokodil_vzryvaetsya_hd.gif", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(KROKODIL_GIF, rep); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/style.css", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(STYLE_CSS, rep); })); s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/style.css", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(STYLE_CSS, rep); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/fields.css", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(FIELDS_CSS, rep); })); s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/fields.css", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(FIELDS_CSS, rep); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/js/vue.js", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(VUE_JS, rep); })); s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/js/vue.js", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(VUE_JS, rep); }));
s.resources.emplace_back(std::make_unique<http::resource::GenericResource>("/vid/video_2024-11-06_15-49-35.mp4", [this](const auto& req, auto& rep) { boost::ignore_unused(req); sf->serve(KB_MP4, rep); }));
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/get/statistics", this->auth, http::auth::User::WATCH_STATISTICS, [this](const auto& req, auto& rep) { s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/get/statistics", this->auth, http::auth::User::WATCH_STATISTICS, [this](const auto& req, auto& rep) {
if (req.method != "GET") { if (req.method != "GET") {

View File

@ -1,5 +1,5 @@
.tabs-header { .tabs-header {
margin: 0.5em 0; margin: 0.5em 0 3px;
background: var(--brand-bg); background: var(--brand-bg);
} }
.tabs-header > * { .tabs-header > * {
@ -17,7 +17,7 @@
} }
.tabs-btn.active { .tabs-btn.active {
color: var(--brand-text); color: var(--brand-text);
border-bottom: 3px solid var(--brand-text); border-bottom: 3px solid var(--bg-action);
} }
.tabs-body-item { .tabs-body-item {
padding: 20px 0; padding: 20px 0;
@ -58,7 +58,7 @@
} }
.action-button { .action-button {
background: var(--brand-bg); background: var(--bg-action);
} }
.nav-bar-element { .nav-bar-element {
@ -113,7 +113,7 @@ label {
.settings-set-container input, .settings-set-container select { .settings-set-container input, .settings-set-container select {
margin-top: 0.5em; margin-top: 0.5em;
border: none; border: none;
border-bottom: solid 2px var(--text-color); border-bottom: solid 2px var(--text-color2);
width: 20em; width: 20em;
box-sizing: border-box; box-sizing: border-box;
} }
@ -121,7 +121,7 @@ label {
.settings-set-container input:focus { .settings-set-container input:focus {
outline: none; outline: none;
border: none; border: none;
border-bottom: solid 2px var(--brand-text); border-bottom: solid 2px var(--bg-action);
} }
.settings-set-container input:invalid { .settings-set-container input:invalid {
@ -193,7 +193,7 @@ details > summary {
.toggle-input input[type="checkbox"]:checked + .slider { .toggle-input input[type="checkbox"]:checked + .slider {
left: 25px; left: 25px;
background-color: var(--brand-text); background-color: var(--bg-action);
} }
.toggle-input input[type="checkbox"]:checked + .slider:before { .toggle-input input[type="checkbox"]:checked + .slider:before {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -35,7 +35,7 @@
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
border: none; border: none;
border-bottom: var(--brand-bg) 2px solid; border-bottom: var(--text-color2) 2px solid;
background-color: var(--bg-color); background-color: var(--bg-color);
text-overflow: ellipsis; text-overflow: ellipsis;
min-height: 2em; min-height: 2em;
@ -44,7 +44,7 @@
.form-row input:focus { .form-row input:focus {
outline: none; outline: none;
border: none; border: none;
border-bottom: var(--brand-text) 2px solid; border-bottom: var(--bg-action) 2px solid;
background-color: var(--bg-selected); background-color: var(--bg-selected);
} }
@ -52,6 +52,7 @@
border: none; border: none;
font-weight: bolder; font-weight: bolder;
background: var(--bg-action); background: var(--bg-action);
color: var(--text-color);
text-align: center; text-align: center;
} }

View File

@ -116,7 +116,7 @@
<table> <table>
<tbody> <tbody>
<tr><th>Температура ADRV</th><td>{{ stat_device.adrv }} °C</td></tr> <tr><th>Температура ADRV</th><td>{{ stat_device.adrv }} °C</td></tr>
<tr><th>Температура ZYNQ <span hidden>ULTRASUCK</span></th><td>{{ stat_device.zynq }} °C</td></tr> <tr><th>Температура ZYNQ</th><td>{{ stat_device.zynq }} °C</td></tr>
<tr><th>Температура FPGA</th><td>{{ stat_device.fpga }} °C</td></tr> <tr><th>Температура FPGA</th><td>{{ stat_device.fpga }} °C</td></tr>
</tbody> </tbody>
</table> </table>
@ -441,8 +441,7 @@
</div> </div>
<template> <template>
<div v-for="classesGroup in ['rt1', 'rt2', 'rt3', 'cd']"> <div v-for="classesGroup in ['rt1', 'rt2', 'rt3', 'cd']">
<h3>Классы {{ classesGroup.toUpperCase() }}</h3> <h3>Классы {{ classesGroup.toUpperCase() }} <button class="action-button" @click="qosAddClass(classesGroup)"> + </button></h3>
<button class="action-button" @click="qosAddClass(classesGroup)">Добавить класс {{ classesGroup.toUpperCase() }}</button>
<details v-for="(qosClass, index) in param.qos[classesGroup]" :key="index" class="settings-set-container"> <details v-for="(qosClass, index) in param.qos[classesGroup]" :key="index" class="settings-set-container">
<summary> <summary>
<span v-if="classesGroup === 'cd'">#{{ index }} CIR={{ qosClass.cir }}кбит, PIR={{ qosClass.pir }}кбит {{ qosClass.description }}</span> <span v-if="classesGroup === 'cd'">#{{ index }} CIR={{ qosClass.cir }}кбит, PIR={{ qosClass.pir }}кбит {{ qosClass.description }}</span>
@ -632,14 +631,6 @@
<button class="action-button" @click="settingsUploadUpdate()">Загрузить<span class="submit-spinner" v-show="submitStatus.firmwareUpload"></span></button> <button class="action-button" @click="settingsUploadUpdate()">Загрузить<span class="submit-spinner" v-show="submitStatus.firmwareUpload"></span></button>
<button class="dangerous-button" v-show="uploadFw.sha256 !== null" @click="settingsPerformFirmwareUpgrade()">Обновить встроенное ПО <span class="submit-spinner" v-show="submitStatus.firmwareUpgrade"></span></button> <button class="dangerous-button" v-show="uploadFw.sha256 !== null" @click="settingsPerformFirmwareUpgrade()">Обновить встроенное ПО <span class="submit-spinner" v-show="submitStatus.firmwareUpgrade"></span></button>
</div> </div>
<div hidden>
<p>
Эти настройки пока недоступны, но скоро разработчик это поправит. А пока смотри на крокодила, или купи разработчику банку <span style="text-decoration: line-through;">пива</span> колы для ускорения процесса)
</p>
<div><img loading="lazy" src="/images/krokodil_vzryvaetsya_hd.gif" alt="krokodil"></div>
<div><video preload="auto" controls style="max-width: 100%"><source src="/vid/video_2024-11-06_15-49-35.mp4" type="video/mp4" /></video></div>
</div>
</div> </div>
<p>Последнее обновление статистики: {{ lastUpdateTime }}</p> <p>Последнее обновление статистики: {{ lastUpdateTime }}</p>
</div> </div>

View File

@ -2,11 +2,11 @@
body { body {
--text-color: #262626; --text-color: #262626;
--text-color2: #3d3d3d; --text-color2: #3d3d3d;
--text-good: green; --text-good: #0CF500;
--text-bad: red; --text-bad: #F5000C;
--brand-bg: #EDF3FE; --brand-bg: #B3C0D1;
--brand-text: #5488F7; --brand-text: #0146f4;
--bg-color: #FEFEFE; --bg-color: #FEFEFE;
--bg-selected: #F1F1F1; --bg-selected: #F1F1F1;
@ -20,8 +20,8 @@ body {
body { body {
--text-color: #eee; --text-color: #eee;
--text-color2: #bbb; --text-color2: #bbb;
--text-good: greenyellow; --text-good: #91FF00;
--text-bad: orangered; --text-bad: #FF1F2A;
--brand-bg: #393E50; --brand-bg: #393E50;
--brand-text: #5F93F3; --brand-text: #5F93F3;

Binary file not shown.