mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -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)
|
||||
start();
|
||||
else
|
||||
mRunState = RUNNING_OK;
|
||||
mRunState = RUNNING_OK_NO_FULL_CONTROL;
|
||||
|
||||
addResourceHandler("runstate", this, &RsControlModule::handleRunState);
|
||||
addResourceHandler("identities", this, &RsControlModule::handleIdentities);
|
||||
@ -209,6 +209,9 @@ void RsControlModule::handleRunState(Request &req, Response &resp)
|
||||
case RUNNING_OK:
|
||||
state = "running_ok";
|
||||
break;
|
||||
case RUNNING_OK_NO_FULL_CONTROL:
|
||||
state = "running_ok_no_full_control";
|
||||
break;
|
||||
default:
|
||||
state = "error_should_not_happen_this_is_a_bug";
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ protected:
|
||||
virtual void run();
|
||||
|
||||
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 handleIdentities(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"});}}>
|
||||
Start
|
||||
</div>
|
||||
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "login"});}}>
|
||||
Login
|
||||
</div>
|
||||
{function(){
|
||||
if(outer.props.fullcontrol)
|
||||
return (<div className="btn2" onClick={function(){outer.emit("change_url", {url: "login"});}}>
|
||||
Login
|
||||
</div>);
|
||||
else return <div></div>;
|
||||
}()}
|
||||
<div className="btn2" onClick={function(){outer.emit("change_url", {url: "friends"});}}>
|
||||
Friends
|
||||
</div>
|
||||
@ -710,7 +714,7 @@ var MainWidget = React.createClass({
|
||||
{
|
||||
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")
|
||||
{
|
||||
@ -744,7 +748,7 @@ var MainWidget = React.createClass({
|
||||
}
|
||||
if(this.state.page === "menu")
|
||||
{
|
||||
mainpage = <Menu/>;
|
||||
mainpage = <Menu fullcontrol = {this.state.data.runstate === "running_ok"}/>;
|
||||
}
|
||||
if(this.state.page === "testwidget")
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user