This commit is contained in:
parent
105db1cbab
commit
f8a38365a6
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
namespace WebToolkit {
|
namespace WebToolkit {
|
||||||
Application::Application(const Wt::WEnvironment &env, bool embedded)
|
Application::Application(const Wt::WEnvironment &env, bool embedded)
|
||||||
: Wt::WApplication(env), m_startup(this, "startup"), m_quit(this, "quit"), m_logout(this, "logout") {
|
: Wt::WApplication(env), m_startup(this, "startup"), m_logout(this, "logout") {
|
||||||
messageResourceBundle().use(appRoot() + "wt");
|
messageResourceBundle().use(appRoot() + "wt");
|
||||||
messageResourceBundle().use(appRoot() + "auth_strings");
|
messageResourceBundle().use(appRoot() + "auth_strings");
|
||||||
messageResourceBundle().use(appRoot() + "auth_css_theme");
|
messageResourceBundle().use(appRoot() + "auth_css_theme");
|
||||||
@ -96,10 +96,6 @@ Application::Application(const Wt::WEnvironment &env, bool embedded)
|
|||||||
dynamic_cast<Application *>(app)->handlePathChange(path);
|
dynamic_cast<Application *>(app)->handlePathChange(path);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m_quit.connect(this, []() {
|
|
||||||
LOG(info) << "wtapp quit.";
|
|
||||||
Wt::WApplication::instance()->quit();
|
|
||||||
});
|
|
||||||
internalPathChanged().connect(this, &Application::handlePathChange);
|
internalPathChanged().connect(this, &Application::handlePathChange);
|
||||||
doJavaScript(m_startup.createCall({}));
|
doJavaScript(m_startup.createCall({}));
|
||||||
}
|
}
|
||||||
@ -177,7 +173,8 @@ void Application::handlePathChange(const std::string &path) {
|
|||||||
if (path.starts_with("/wt/register")) {
|
if (path.starts_with("/wt/register")) {
|
||||||
} else if (path.starts_with("/wt/visitor/analysis")) {
|
} else if (path.starts_with("/wt/visitor/analysis")) {
|
||||||
m_root->clear();
|
m_root->clear();
|
||||||
m_root->addNew<VisitorRecordsPage>(*m_session);
|
auto p = m_root->addNew<VisitorRecordsPage>(*m_session);
|
||||||
|
p->addStyleClass("bulma-is-flex-grow-1");
|
||||||
} else if (path.starts_with("/wt/redirect")) {
|
} else if (path.starts_with("/wt/redirect")) {
|
||||||
m_root->clear();
|
m_root->clear();
|
||||||
auto p = m_root->addNew<RedirectPage>();
|
auto p = m_root->addNew<RedirectPage>();
|
||||||
|
@ -37,7 +37,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
std::unique_ptr<Session> m_session;
|
std::unique_ptr<Session> m_session;
|
||||||
Wt::JSignal<> m_startup;
|
Wt::JSignal<> m_startup;
|
||||||
Wt::JSignal<> m_quit;
|
|
||||||
|
|
||||||
Wt::WContainerWidget *m_root = nullptr;
|
Wt::WContainerWidget *m_root = nullptr;
|
||||||
NavigationBar *m_navigationBar = nullptr;
|
NavigationBar *m_navigationBar = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user