diff --git a/Dockerfiles/ubuntu2404.dockerfile b/Dockerfiles/ubuntu2404.dockerfile index 12cc6af..57993cd 100644 --- a/Dockerfiles/ubuntu2404.dockerfile +++ b/Dockerfiles/ubuntu2404.dockerfile @@ -68,7 +68,7 @@ RUN cd /root \ && tar -xvf qt-everywhere-src-${QT_VERSION}.tar.xz > /dev/null \ && cd ./qt-everywhere-src-${QT_VERSION} \ && ./configure -prefix /opt/Qt/${QT_VERSION}/gcc_64 -opensource -debug-and-release -confirm-license -nomake examples -nomake tests -skip qtwebengine -skip qtcoap -skip qtopcua \ - && cmake --build . --parallel \ + && cmake --build . --parallel > /dev/null \ && ninja install \ && rm -fr /root/qt-everywhere-src-${QT_VERSION}* \ && echo 'export PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:$PATH' >> /etc/profile \ diff --git a/Server/Application.cpp b/Server/Application.cpp index 6e2fb51..dc59ef8 100644 --- a/Server/Application.cpp +++ b/Server/Application.cpp @@ -159,7 +159,7 @@ Application::Application(const std::string &path) url = root["url"].as_string(); } auto database = Database::session(); - if (std::filesystem::exists("amass_blog" + url) && url.find("/我的博客/page") != 0) { + if (std::filesystem::exists("amass_blog" + url) && (url.find("/我的博客/page") != 0) && (url.find("/wt") != 0)) { if (url.size() > 1 && url.back() == '/') { url.pop_back(); } diff --git a/WebApplication/BulmaTheme.cpp b/WebApplication/BulmaTheme.cpp index 3c5fffa..b068dee 100644 --- a/WebApplication/BulmaTheme.cpp +++ b/WebApplication/BulmaTheme.cpp @@ -83,6 +83,16 @@ void BulmaTheme::apply(Wt::WWidget *widget, Wt::WWidget *child, int widgetRole) child->addStyleClass("bulma-delete"); break; } + case NavbarBtn: { + child->addStyleClass("bulma-navbar-burger"); + child->setAttributeValue("aria-label", "menu"); + child->setAttributeValue("aria-expanded", "false"); + break; + } + case NavBrand: { + child->addStyleClass("bulma-navbar-brand"); + break; + } default: break; } diff --git a/WebApplication/CMakeLists.txt b/WebApplication/CMakeLists.txt index a98a8ec..bbb93e5 100644 --- a/WebApplication/CMakeLists.txt +++ b/WebApplication/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(WebApplication BulmaTheme.h BulmaTheme.cpp HomePage.h HomePage.cpp LoginPage.h LoginPage.cpp + NavigationBar.h NavigationBar.cpp VisitorRecordsPage.h VisitorRecordsPage.cpp VisitorRecordTableModel.h VisitorRecordTableModel.cpp Restful.h Restful.cpp diff --git a/WebApplication/HomePage.cpp b/WebApplication/HomePage.cpp index e237513..5c8b947 100644 --- a/WebApplication/HomePage.cpp +++ b/WebApplication/HomePage.cpp @@ -1,14 +1,12 @@ #include "HomePage.h" #include "Dialog.h" +#include "NavigationBar.h" #include #include -#include #include HomePage::HomePage() { - auto navigation = addNew(); - navigation->setResponsive(true); - navigation->setTitle("子非鱼", "https://amass.fun"); + auto navigation = addNew(); addStyleClass("bulma-content"); auto p = addWidget(std::make_unique("这是一个结合 C++ Web Toolkit 和 CSS Bulma 框架的前后端一体应用程序。")); diff --git a/WebApplication/NavigationBar.cpp b/WebApplication/NavigationBar.cpp new file mode 100644 index 0000000..fd60fd6 --- /dev/null +++ b/WebApplication/NavigationBar.cpp @@ -0,0 +1,23 @@ +#include "NavigationBar.h" + +constexpr auto Template = R"( + +)"; + +NavigationBar::NavigationBar() : Wt::WTemplate(Template) { +} diff --git a/WebApplication/NavigationBar.h b/WebApplication/NavigationBar.h new file mode 100644 index 0000000..d54e147 --- /dev/null +++ b/WebApplication/NavigationBar.h @@ -0,0 +1,11 @@ +#ifndef __NAVIGATIONBAR_H__ +#define __NAVIGATIONBAR_H__ + +#include + +class NavigationBar: public Wt::WTemplate { +public: + NavigationBar(); +}; + +#endif // __NAVIGATIONBAR_H__ \ No newline at end of file diff --git a/resources/build.sh b/resources/build.sh index 96dc4ff..6193a2a 100755 --- a/resources/build.sh +++ b/resources/build.sh @@ -24,9 +24,6 @@ function build() { # docker run -it --rm --user 1000:1000 -v $(pwd):$(pwd) -w $(pwd) registry.cn-shenzhen.aliyuncs.com/amass_toolset/ubuntu_dev:22.04 resources/build.sh # reset # pkill -9 HttpServer - # cp -r /mnt/e/Lifestyle/static/resources/themes/bulma resources/themes/ - # cp -r /opt/Libraries/wt-4.11.1/share/Wt/resources ./build/ - # cp -r resources/themes resources/icons resources/*.css build/resources/ if [ ! -f "${build_path}/CMakeCache.txt" ]; then cmake_scan @@ -38,6 +35,14 @@ function build() { if [ $? -ne 0 ]; then exit 1 fi + + # if [ ! -d ${base_path}/resources/themes/bulma ]; then + # mkdir -p ${base_path}/resources/themes/bulma + # fi + # cp -r /mnt/e/Lifestyle/static/resources/themes/bulma resources/themes + # cp -r /opt/Libraries/wt-4.11.1/share/Wt/resources build/ + # cp -r resources/themes resources/icons resources/fontawesome resources/*.css build/resources/ + build/UnitTest/UnitTest }