mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
using static resources for webui
This commit is contained in:
parent
c2d47b01df
commit
c7af86b4c1
@ -106,8 +106,10 @@ static void service_ready_handler( restbed::Service& )
|
||||
|
||||
std::vector<std::shared_ptr<restbed::Resource> > p3WebUI::getResources() const
|
||||
{
|
||||
std::vector<std::shared_ptr<restbed::Resource> > rtab;
|
||||
static std::vector<std::shared_ptr<restbed::Resource> > rtab;
|
||||
|
||||
if(rtab.empty())
|
||||
{
|
||||
auto resource1 = std::make_shared< restbed::Resource >( );
|
||||
resource1->set_paths( {
|
||||
"/{filename: index.html}",
|
||||
@ -156,6 +158,7 @@ std::vector<std::shared_ptr<restbed::Resource> > p3WebUI::getResources() const
|
||||
rtab.push_back(resource4);
|
||||
rtab.push_back(resource5);
|
||||
rtab.push_back(resource6);
|
||||
}
|
||||
|
||||
return rtab;
|
||||
}
|
||||
@ -189,17 +192,12 @@ void p3WebUI::setUserPassword(const std::string& passwd)
|
||||
bool p3WebUI::restart()
|
||||
{
|
||||
rsJsonAPI->registerResourceProvider(this);
|
||||
|
||||
return rsJsonAPI->restart();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3WebUI::stop()
|
||||
{
|
||||
rsJsonAPI->unregisterResourceProvider(this);
|
||||
|
||||
if(rsJsonAPI->status()==RsJsonAPI::JSONAPI_STATUS_RUNNING)
|
||||
return rsJsonAPI->restart();
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user