2022-06-30 13:23:14 +02:00
|
|
|
#ifndef ADMIN_PANEL_H
|
|
|
|
#define ADMIN_PANEL_H
|
|
|
|
|
|
|
|
#include "web/http/web_node.h"
|
|
|
|
|
|
|
|
#include "core/containers/vector.h"
|
2022-07-07 00:48:57 +02:00
|
|
|
#include "core/string.h"
|
2022-06-30 13:23:14 +02:00
|
|
|
|
|
|
|
class Request;
|
|
|
|
class FormValidator;
|
|
|
|
class AdminNode;
|
|
|
|
|
|
|
|
class AdminPanel : public WebNode {
|
|
|
|
RCPP_OBJECT(AdminPanel, WebNode);
|
2022-07-07 00:48:57 +02:00
|
|
|
|
2022-06-30 13:23:14 +02:00
|
|
|
public:
|
|
|
|
void handle_request_main(Request *request);
|
|
|
|
|
|
|
|
virtual void render_admin_panel_list(Request *request);
|
|
|
|
virtual void render_controller_panel(Request *request, AdminNode *controller);
|
|
|
|
|
|
|
|
void register_admin_controller(const String §ion, AdminNode *controller);
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
virtual void render_headers(Request *request);
|
|
|
|
virtual void render_main_body_top(Request *request);
|
|
|
|
virtual void render_segment_body_top(Request *request);
|
|
|
|
virtual void render_footer(Request *request);
|
|
|
|
|
|
|
|
void set_default_header(const String &val);
|
|
|
|
void set_default_main_body_top(const String &val);
|
|
|
|
void set_default_segment_body_top(const String &val);
|
|
|
|
void set_default_footer(const String &val);
|
|
|
|
|
|
|
|
static AdminPanel *get_singleton();
|
|
|
|
|
|
|
|
AdminPanel();
|
|
|
|
~AdminPanel();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
struct AdminPanelSection {
|
|
|
|
String section_url;
|
|
|
|
String name;
|
|
|
|
AdminNode *controller;
|
|
|
|
};
|
|
|
|
|
|
|
|
static AdminPanel *_self;
|
|
|
|
|
2022-07-07 00:48:57 +02:00
|
|
|
Vector<AdminPanelSection> _controllers;
|
2022-06-30 13:23:14 +02:00
|
|
|
|
|
|
|
String _default_headers;
|
|
|
|
String _default_main_body_top;
|
|
|
|
String _default_segment_body_top;
|
|
|
|
String _default_footer;
|
|
|
|
};
|
|
|
|
|
2022-07-07 00:48:57 +02:00
|
|
|
#endif
|