mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-08 22:52:54 -04:00
fixed restart of webui
This commit is contained in:
parent
b8b7d103e1
commit
d1a9f839a4
5 changed files with 16 additions and 12 deletions
|
@ -141,10 +141,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void setNewAccessRequestCallback(const std::function<bool(const std::string&,std::string&)>& callback );
|
void setNewAccessRequestCallback(const std::function<bool(const std::string&,std::string&)>& callback );
|
||||||
|
|
||||||
protected:
|
|
||||||
/// @see RsSingleJobThread
|
|
||||||
virtual void run();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// @see p3Config::setupSerialiser
|
/// @see p3Config::setupSerialiser
|
||||||
|
|
|
@ -31,6 +31,14 @@ RestbedService::RestbedService()
|
||||||
mBindingAddress = "127.0.0.1";
|
mBindingAddress = "127.0.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RestbedService::restart()
|
||||||
|
{
|
||||||
|
stop();
|
||||||
|
start("Restbed Service");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool RestbedService::stop()
|
bool RestbedService::stop()
|
||||||
{
|
{
|
||||||
mService->stop();
|
mService->stop();
|
||||||
|
|
|
@ -31,11 +31,10 @@ class RestbedService: public RsThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RestbedService() ;
|
RestbedService() ;
|
||||||
virtual ~RestbedService();
|
virtual ~RestbedService() = default;
|
||||||
|
|
||||||
bool restart();
|
bool restart();
|
||||||
bool stop();
|
bool stop();
|
||||||
bool isRunning() const;
|
|
||||||
|
|
||||||
void setListeningPort(uint16_t port) ;
|
void setListeningPort(uint16_t port) ;
|
||||||
void setBindAddress(const std::string& bind_address);
|
void setBindAddress(const std::string& bind_address);
|
||||||
|
|
|
@ -63,9 +63,12 @@ template<int MIME_TYPE_INDEX> class handler
|
||||||
{
|
{
|
||||||
const auto request = session->get_request( );
|
const auto request = session->get_request( );
|
||||||
const std::string filename = request->get_path_parameter( "filename" );
|
const std::string filename = request->get_path_parameter( "filename" );
|
||||||
const std::string directory = request->get_path_parameter( "dir" );
|
std::string directory = request->get_path_parameter( "dir" );
|
||||||
|
|
||||||
std::string resource_filename = _base_directory + directory + "/" + filename;
|
if(!directory.empty())
|
||||||
|
directory += "/";
|
||||||
|
|
||||||
|
std::string resource_filename = _base_directory + "/" + directory + filename;
|
||||||
std::cerr << "Reading file: \"" << resource_filename << "\"" << std::endl;
|
std::cerr << "Reading file: \"" << resource_filename << "\"" << std::endl;
|
||||||
std::ifstream stream( resource_filename, std::ifstream::in );
|
std::ifstream stream( resource_filename, std::ifstream::in );
|
||||||
|
|
||||||
|
@ -109,7 +112,7 @@ std::vector<std::shared_ptr<restbed::Resource> > p3WebUI::getResources() const
|
||||||
|
|
||||||
auto resource2 = std::make_shared< restbed::Resource >();
|
auto resource2 = std::make_shared< restbed::Resource >();
|
||||||
resource2->set_paths( {
|
resource2->set_paths( {
|
||||||
"/{dir: css]/{filename: fontawesome.css}",
|
"/{dir: css}/{filename: fontawesome.css}",
|
||||||
"/{dir: css}/{filename: solid.css}",
|
"/{dir: css}/{filename: solid.css}",
|
||||||
"/{filename: app.css}",
|
"/{filename: app.css}",
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -110,11 +110,9 @@ void WebuiPage::onPasswordValueChanged(QString password)
|
||||||
|
|
||||||
bool WebuiPage::restart()
|
bool WebuiPage::restart()
|
||||||
{
|
{
|
||||||
// apply config
|
|
||||||
checkShutdownWebui();
|
|
||||||
|
|
||||||
return checkStartWebui();
|
return checkStartWebui();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebuiPage::load()
|
void WebuiPage::load()
|
||||||
{
|
{
|
||||||
std::cerr << "WebuiPage::load()" << std::endl;
|
std::cerr << "WebuiPage::load()" << std::endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue