mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
webui: make login work
This commit is contained in:
parent
c7cbd257a5
commit
fd12b25cdd
@ -8,7 +8,11 @@ var currentpasswd = null;
|
|||||||
var accountMap = new Map();
|
var accountMap = new Map();
|
||||||
|
|
||||||
function login(){
|
function login(){
|
||||||
alert("login:" + curraccount.location + "; passwort: " + currentpasswd);
|
//alert("login:" + curraccount.location + "; passwort: " + currentpasswd);
|
||||||
|
rs("control/login", {data: {id: curraccount.id}, callback:function(){
|
||||||
|
//alert("login send");
|
||||||
|
rs("control/password",{data: {password: currentpasswd}});
|
||||||
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancel(){
|
function cancel(){
|
||||||
|
@ -31,10 +31,6 @@ module.exports = {view: function(){
|
|||||||
} else {
|
} else {
|
||||||
return m("div", "unknown runstate: " + runstate.runstate);
|
return m("div", "unknown runstate: " + runstate.runstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return m("div", peers.map(function(peer){
|
|
||||||
return m("div",peer.name)
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -141,13 +141,20 @@ function rs(path, optionen){
|
|||||||
schedule_request_missing();
|
schedule_request_missing();
|
||||||
}
|
}
|
||||||
return cache[path].data;
|
return cache[path].data;
|
||||||
} else if (optionen.args != undefined) {
|
} else{
|
||||||
return m.request({
|
m.request({
|
||||||
method: "GET",
|
method: "POST",
|
||||||
url: api_url + path,
|
url: api_url + path,
|
||||||
args: optionen.args,
|
data: optionen.data,
|
||||||
background: false,
|
background: true,
|
||||||
})();
|
}).then(function(){
|
||||||
|
// i'm not happy about this.
|
||||||
|
// wouldn't it be nicer to return the thennable to the caller?
|
||||||
|
// but it is not nice to return different things from the rs function
|
||||||
|
// maybe make anotehr function which returns thennables
|
||||||
|
if(optionen.callback)
|
||||||
|
optionen.callback();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user