Added the new user web page classes to the build. They still need binds, so they won't do anything at the moment.

This commit is contained in:
Relintai 2022-07-22 14:52:55 +02:00
parent 3028c08e9e
commit 16fda02f48
6 changed files with 36 additions and 10 deletions

View File

@ -18,6 +18,14 @@ sources = [
if env['module_web_enabled']: if env['module_web_enabled']:
sources.append("web/middleware/user_session_setup_web_server_middleware.cpp") sources.append("web/middleware/user_session_setup_web_server_middleware.cpp")
sources.append("web/web_nodes/user_web_page.cpp")
sources.append("web/web_nodes/user_delete_web_page.cpp")
sources.append("web/web_nodes/user_login_web_page.cpp")
sources.append("web/web_nodes/user_logout_web_page.cpp")
sources.append("web/web_nodes/user_password_reset_web_page.cpp")
sources.append("web/web_nodes/user_register_web_page.cpp")
sources.append("web/web_nodes/user_settings_web_page.cpp")
sources.append("web/web_nodes/user_stats_web_page.cpp")
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':
# Shared lib compilation # Shared lib compilation

View File

@ -17,6 +17,15 @@ def get_doc_classes():
"UserDB", "UserDB",
"UserSessionSetupWebServerMiddleware", "UserSessionSetupWebServerMiddleware",
"UserWebPage",
"UserDeleteWebPage",
"UserLoginWebPage",
"UserLogoutWebPage",
"UserPasswordResetWebPage",
"UserRegisterWebPage",
"UserSettingsWebPage",
"UserStatsWebPage",
] ]

View File

@ -36,6 +36,15 @@ SOFTWARE.
#ifdef MODULE_WEB_ENABLED #ifdef MODULE_WEB_ENABLED
#include "web/middleware/user_session_setup_web_server_middleware.h" #include "web/middleware/user_session_setup_web_server_middleware.h"
#include "web/web_nodes/user_delete_web_page.cpp"
#include "web/web_nodes/user_login_web_page.cpp"
#include "web/web_nodes/user_logout_web_page.cpp"
#include "web/web_nodes/user_password_reset_web_page.cpp"
#include "web/web_nodes/user_register_web_page.cpp"
#include "web/web_nodes/user_settings_web_page.cpp"
#include "web/web_nodes/user_stats_web_page.cpp"
#include "web/web_nodes/user_web_page.cpp"
#endif #endif
UserDB *_user_db = nullptr; UserDB *_user_db = nullptr;
@ -54,6 +63,15 @@ void register_users_types() {
#ifdef MODULE_WEB_ENABLED #ifdef MODULE_WEB_ENABLED
ClassDB::register_class<UserSessionSetupWebServerMiddleware>(); ClassDB::register_class<UserSessionSetupWebServerMiddleware>();
ClassDB::register_class<UserWebPage>();
ClassDB::register_class<UserDeleteWebPage>();
ClassDB::register_class<UserLoginWebPage>();
ClassDB::register_class<UserLogoutWebPage>();
ClassDB::register_class<UserPasswordResetWebPage>();
ClassDB::register_class<UserRegisterWebPage>();
ClassDB::register_class<UserSettingsWebPage>();
ClassDB::register_class<UserStatsWebPage>();
#endif #endif
} }

View File

@ -25,7 +25,7 @@ void UserSettingsWebPage::_handle_request_main(Ref<WebServerRequest> request) {
Ref<User> u = request->get_meta("user"); Ref<User> u = request->get_meta("user");
if (u.is_valid()) { if (u.is_valid()) {
handle_request(u, request); //handle_request(u, request);
return; return;
} }

View File

@ -17,9 +17,6 @@ class UserSettingsWebPage : public UserWebPage {
public: public:
void _handle_request_main(Ref<WebServerRequest> request); void _handle_request_main(Ref<WebServerRequest> request);
virtual void handle_request(Ref<User> &user, Ref<WebServerRequest> request);
virtual void handle_main_page_request(Ref<User> &user, Ref<WebServerRequest> request);
struct SettingsRequestData { struct SettingsRequestData {
String error_str; String error_str;

View File

@ -16,16 +16,10 @@ class UserStatsWebPage : public UserWebPage {
GDCLASS(UserStatsWebPage, UserWebPage); GDCLASS(UserStatsWebPage, UserWebPage);
public: public:
virtual void handle_request(Ref<User> &user, Ref<WebServerRequest> request);
virtual void handle_main_page_request(Ref<User> &user, Ref<WebServerRequest> request);
UserStatsWebPage(); UserStatsWebPage();
~UserStatsWebPage(); ~UserStatsWebPage();
protected: protected:
Ref<FormValidator> _login_validator;
Ref<FormValidator> _registration_validator;
Ref<FormValidator> _profile_validator;
}; };
#endif #endif