Advances on trusted node addings

ApiServerLocal trim method/path line to avoid white spaces parsing
ApiServerLocal add support for passing METHOD in request
AddTrustedNode.qml add ability to copy and paste keys
This commit is contained in:
Gio 2016-09-22 12:48:08 +02:00
parent 48a9be0ccc
commit cf1c49aa3a
5 changed files with 76 additions and 54 deletions

View file

@ -27,13 +27,41 @@ Item
ColumnLayout
{
id: colLayout
anchors.top: parent.top
anchors.bottom: bottomButton.top
anchors.bottom: rowLayout.top
Text { id: myKeyField }
TextField { id: myKeyField }
TextField { id: otherKeyField }
}
RowLayout
{
id: rowLayout
anchors.top: colLayout.bottom
Button
{
text: "Copy"
onClicked:
{
myKeyField.selectAll()
myKeyField.copy()
}
}
Button
{
text: "Paste"
onClicked:
{
otherKeyField.selectAll()
otherKeyField.paste()
}
}
}
Button
{
id: bottomButton
@ -41,7 +69,20 @@ Item
anchors.bottom: parent.bottom
onClicked:
{
rsApi.request("/peers/examine_cert/", JSON.stringify({ cert_string: otherKeyField.text }))
console.log("retroshare addtrusted: ", otherKeyField.text)
var jsonData =
{
cert_string: otherKeyField.text,
flags:
{
allow_direct_download: true,
allow_push: false,
require_whitelist: false,
}
}
console.log("retroshare addtrusted jsonData: ", JSON.stringify(jsonData))
//rsApi.request("/peers/examine_cert/", JSON.stringify({ cert_string: otherKeyField.text }))
rsApi.request("POST /peers", JSON.stringify(jsonData))
}
}
}