mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
webui: hide login/shutdown when running in retroshare-gui
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8186 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b05ee805e4
commit
8a4140d904
@ -31,7 +31,7 @@ RsControlModule::RsControlModule(int argc, char **argv, StateTokenServer* sts, A
|
|||||||
if(full_control)
|
if(full_control)
|
||||||
start();
|
start();
|
||||||
else
|
else
|
||||||
mRunState = RUNNING_OK;
|
mRunState = RUNNING_OK_NO_FULL_CONTROL;
|
||||||
|
|
||||||
addResourceHandler("runstate", this, &RsControlModule::handleRunState);
|
addResourceHandler("runstate", this, &RsControlModule::handleRunState);
|
||||||
addResourceHandler("identities", this, &RsControlModule::handleIdentities);
|
addResourceHandler("identities", this, &RsControlModule::handleIdentities);
|
||||||
@ -209,6 +209,9 @@ void RsControlModule::handleRunState(Request &req, Response &resp)
|
|||||||
case RUNNING_OK:
|
case RUNNING_OK:
|
||||||
state = "running_ok";
|
state = "running_ok";
|
||||||
break;
|
break;
|
||||||
|
case RUNNING_OK_NO_FULL_CONTROL:
|
||||||
|
state = "running_ok_no_full_control";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
state = "error_should_not_happen_this_is_a_bug";
|
state = "error_should_not_happen_this_is_a_bug";
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ protected:
|
|||||||
virtual void run();
|
virtual void run();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum RunState { WAITING_INIT, FATAL_ERROR, WAITING_ACCOUNT_SELECT, WAITING_STARTUP, RUNNING_OK};
|
enum RunState { WAITING_INIT, FATAL_ERROR, WAITING_ACCOUNT_SELECT, WAITING_STARTUP, RUNNING_OK, RUNNING_OK_NO_FULL_CONTROL};
|
||||||
void handleRunState(Request& req, Response& resp);
|
void handleRunState(Request& req, Response& resp);
|
||||||
void handleIdentities(Request& req, Response& resp);
|
void handleIdentities(Request& req, Response& resp);
|
||||||
void handleLocations(Request& req, Response& resp);
|
void handleLocations(Request& req, Response& resp);
|
||||||
|
@ -612,9 +612,13 @@ var Menu = React.createClass({
|
|||||||
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "main"});}}>
|
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "main"});}}>
|
||||||
Start
|
Start
|
||||||
</div>
|
</div>
|
||||||
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "login"});}}>
|
{function(){
|
||||||
|
if(outer.props.fullcontrol)
|
||||||
|
return (<div className="btn2" onClick={function(){outer.emit("change_url", {url: "login"});}}>
|
||||||
Login
|
Login
|
||||||
</div>
|
</div>);
|
||||||
|
else return <div></div>;
|
||||||
|
}()}
|
||||||
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "friends"});}}>
|
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "friends"});}}>
|
||||||
Friends
|
Friends
|
||||||
</div>
|
</div>
|
||||||
@ -710,7 +714,7 @@ var MainWidget = React.createClass({
|
|||||||
{
|
{
|
||||||
mainpage = <LoginWidget/>;
|
mainpage = <LoginWidget/>;
|
||||||
}
|
}
|
||||||
if(this.state.data.runstate === "running_ok")
|
if(this.state.data.runstate === "running_ok" || this.state.data.runstate ==="running_ok_no_full_control")
|
||||||
{
|
{
|
||||||
if(this.state.page === "main")
|
if(this.state.page === "main")
|
||||||
{
|
{
|
||||||
@ -744,7 +748,7 @@ var MainWidget = React.createClass({
|
|||||||
}
|
}
|
||||||
if(this.state.page === "menu")
|
if(this.state.page === "menu")
|
||||||
{
|
{
|
||||||
mainpage = <Menu/>;
|
mainpage = <Menu fullcontrol = {this.state.data.runstate === "running_ok"}/>;
|
||||||
}
|
}
|
||||||
if(this.state.page === "testwidget")
|
if(this.state.page === "testwidget")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user