webui: added display of own cert

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8219 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-05-04 18:10:15 +00:00
parent 744f340746
commit df253e65c6
7 changed files with 74 additions and 6 deletions

View File

@ -100,6 +100,12 @@ void PeersHandler::handleWildcard(Request &req, Response &resp)
req.mPath.pop();
if(str != "")
{
if(str == "self" && !req.mPath.empty() && req.mPath.top() == "certificate")
{
resp.mDataStream << makeKeyValue("cert_string", mRsPeers->GetRetroshareInvite(false));
resp.setOk();
return;
}
// assume the path element is a peer id
// sometimes it is a peer id for location info
// another time it is a pgp id

View File

@ -8,6 +8,20 @@ body {
font-size: 1.1em;
}
#overlay{
z-index: 10;
position: fixed;
top:0;
left:0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.8);
}
.paddingbox{
padding:2mm;
}
.nav{
list-style-type: none;
padding: 0em;

View File

@ -245,7 +245,6 @@ var Peers2 = React.createClass({
},
});
var Peers3 = React.createClass({
mixins: [AutoUpdateMixin, SignalSlotMixin],
getPath: function(){return "peers";},
@ -320,6 +319,21 @@ var Peers3 = React.createClass({
},
});
var OwnCert = React.createClass({
mixins: [AutoUpdateMixin, SignalSlotMixin],
getPath: function(){return "peers/self/certificate";},
getInitialState: function(){
return {data: {cert_string: ""}};
},
render: function(){
// use <pre> tag for correct new line behavior!
return (
<pre>
{this.state.data.cert_string}
</pre>);
},
});
var AddPeerWidget = React.createClass({
getInitialState: function(){
return {page: "start"};
@ -344,6 +358,8 @@ var AddPeerWidget = React.createClass({
if(this.state.page === "start")
return(
<div>
<p>Your own key, give it to your friends</p>
<OwnCert/>
<p>paste your friends key below</p>
<textarea ref="cert" cols="70" rows="16"></textarea><br/>
<input
@ -850,6 +866,7 @@ var MainWidget = React.createClass({
menubutton = <div>Retroshare webinterface</div>;
return (
<div>
{/*<div id="overlay"><div className="paddingbox"><div className="btn2">test</div></div></div>*/}
<PasswordWidget/>
<AudioPlayerWidget/>
{menubutton}

View File

@ -18,8 +18,8 @@
</head>
<body>
<p>loading lots of stuff...</p>
<div id="logo_splash">
<!--<div id="logo_splash">
<img src="img/logo_splash.png"></img>
</div>
</div>-->
</body>
</html>

View File

@ -8,6 +8,20 @@ body {
font-size: 1.1em;
}
#overlay{
z-index: 10;
position: fixed;
top:0;
left:0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.8);
}
.paddingbox{
padding:2mm;
}
.nav{
list-style-type: none;
padding: 0em;

View File

@ -245,7 +245,6 @@ var Peers2 = React.createClass({
},
});
var Peers3 = React.createClass({
mixins: [AutoUpdateMixin, SignalSlotMixin],
getPath: function(){return "peers";},
@ -320,6 +319,21 @@ var Peers3 = React.createClass({
},
});
var OwnCert = React.createClass({
mixins: [AutoUpdateMixin, SignalSlotMixin],
getPath: function(){return "peers/self/certificate";},
getInitialState: function(){
return {data: {cert_string: ""}};
},
render: function(){
// use <pre> tag for correct new line behavior!
return (
<pre>
{this.state.data.cert_string}
</pre>);
},
});
var AddPeerWidget = React.createClass({
getInitialState: function(){
return {page: "start"};
@ -344,6 +358,8 @@ var AddPeerWidget = React.createClass({
if(this.state.page === "start")
return(
<div>
<p>Your own key, give it to your friends</p>
<OwnCert/>
<p>paste your friends key below</p>
<textarea ref="cert" cols="70" rows="16"></textarea><br/>
<input
@ -850,6 +866,7 @@ var MainWidget = React.createClass({
menubutton = <div>Retroshare webinterface</div>;
return (
<div>
{/*<div id="overlay"><div className="paddingbox"><div className="btn2">test</div></div></div>*/}
<PasswordWidget/>
<AudioPlayerWidget/>
{menubutton}

View File

@ -18,8 +18,8 @@
</head>
<body>
<p>loading lots of stuff...</p>
<div id="logo_splash">
<!--<div id="logo_splash">
<img src="img/logo_splash.png"></img>
</div>
</div>-->
</body>
</html>