2025-01-05 00:33:19 +08:00
|
|
|
#ifndef __REDIRECTPAGE_H__
|
|
|
|
#define __REDIRECTPAGE_H__
|
|
|
|
|
|
|
|
#include <Wt/WTemplate.h>
|
|
|
|
|
|
|
|
class RedirectPage : public Wt::WTemplate {
|
|
|
|
public:
|
|
|
|
RedirectPage();
|
2025-01-05 14:23:02 +08:00
|
|
|
void setRedirect(const std::string &path, const std::string &text = "");
|
|
|
|
void setMessage(const std::string &message);
|
|
|
|
void redirect(const std::string &path);
|
2025-01-05 00:33:19 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void onTimeout();
|
|
|
|
|
|
|
|
private:
|
2025-01-05 14:23:02 +08:00
|
|
|
Wt::JSignal<int> m_history;
|
|
|
|
int m_historySize = 0;
|
2025-01-05 00:33:19 +08:00
|
|
|
Wt::WTimer *m_timer = nullptr;
|
2025-01-05 14:23:02 +08:00
|
|
|
Wt::WAnchor *m_anchor = nullptr;
|
2025-01-05 00:33:19 +08:00
|
|
|
int m_time = 5000;
|
|
|
|
std::string m_redirect;
|
2025-01-05 14:23:02 +08:00
|
|
|
std::string m_text;
|
2025-01-05 00:33:19 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __REDIRECTPAGE_H__
|