Added a new admin_panel module.

This commit is contained in:
Relintai 2021-10-31 23:11:48 +01:00
parent 4c5c439faf
commit 6d77f78494
6 changed files with 138 additions and 0 deletions

12
modules/admin_panel/SCsub Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python
Import("env_mod")
Import("env")
env_mod.core_sources = []
env_mod.add_source_files(env_mod.core_sources, "*.cpp")
# Build it all as a library
lib = env_mod.add_library("admin_panel", env_mod.core_sources)
env.Prepend(LIBS=[lib])

View File

@ -0,0 +1,16 @@
#include "admin_controller.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
AdminController::AdminController() :
Controller() {
}
AdminController::~AdminController() {
}

View File

@ -0,0 +1,21 @@
#ifndef ADMIN_CONTROLLER_H
#define ADMIN_CONTROLLER_H
#include "core/http/controller.h"
#include <string>
class Request;
class FormValidator;
class AdminController : public Controller {
RCPP_OBJECT(AdminController, Controller);
public:
AdminController();
~AdminController();
protected:
};
#endif

View File

@ -0,0 +1,36 @@
#include "admin_panel.h"
#include "core/html/form_validator.h"
#include "core/html/html_builder.h"
#include "core/http/cookie.h"
#include "core/http/http_session.h"
#include "core/http/request.h"
#include "core/http/session_manager.h"
void AdminPanel::handle_request_main(Request *request) {
}
void AdminPanel::create_validators() {
}
AdminPanel *AdminPanel::get_singleton() {
return _self;
}
AdminPanel::AdminPanel() :
Controller() {
if (_self) {
printf("AdminPanel::AdminPanel(): Error! self is not null!/n");
}
_self = this;
}
AdminPanel::~AdminPanel() {
if (_self == this) {
_self = nullptr;
}
}
AdminPanel *AdminPanel::_self = nullptr;

View File

@ -0,0 +1,27 @@
#ifndef ADMIN_PANEL_H
#define ADMIN_PANEL_H
#include "core/http/controller.h"
#include <string>
class Request;
class FormValidator;
class AdminPanel : public Controller {
RCPP_OBJECT(AdminPanel, Controller);
public:
void handle_request_main(Request *request);
void create_validators();
static AdminPanel *get_singleton();
AdminPanel();
~AdminPanel();
protected:
static AdminPanel *_self;
};
#endif

View File

@ -0,0 +1,26 @@
import os
import platform
import sys
def is_active():
return True
def get_name():
return "users"
def can_build():
return True
def get_opts():
return []
def get_flags():
return []
def configure(env):
pass