|
@ -8,7 +8,7 @@ var bitcoin = require("bitcoin"); |
|
|
var rpcApi = require("./../app/rpcApi"); |
|
|
var rpcApi = require("./../app/rpcApi"); |
|
|
|
|
|
|
|
|
router.get("/", function(req, res) { |
|
|
router.get("/", function(req, res) { |
|
|
if (!req.session.host) { |
|
|
if (req.session.host == null || req.session.host.trim() == "") { |
|
|
if (req.cookies['rpc-host']) { |
|
|
if (req.cookies['rpc-host']) { |
|
|
res.locals.host = req.cookies['rpc-host']; |
|
|
res.locals.host = req.cookies['rpc-host']; |
|
|
} |
|
|
} |
|
@ -140,6 +140,25 @@ router.post("/connect", function(req, res) { |
|
|
res.redirect("/"); |
|
|
res.redirect("/"); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
router.get("/disconnect", function(req, res) { |
|
|
|
|
|
res.cookie('rpc-host', ""); |
|
|
|
|
|
res.cookie('rpc-port', ""); |
|
|
|
|
|
res.cookie('rpc-username', ""); |
|
|
|
|
|
|
|
|
|
|
|
req.session.host = ""; |
|
|
|
|
|
req.session.port = ""; |
|
|
|
|
|
req.session.username = ""; |
|
|
|
|
|
|
|
|
|
|
|
console.log("destroyed client."); |
|
|
|
|
|
|
|
|
|
|
|
global.client = null; |
|
|
|
|
|
|
|
|
|
|
|
req.session.userMessage = "Disconnected from node."; |
|
|
|
|
|
req.session.userMessageType = "success"; |
|
|
|
|
|
|
|
|
|
|
|
res.redirect("/"); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
router.get("/blocks", function(req, res) { |
|
|
router.get("/blocks", function(req, res) { |
|
|
var limit = 20; |
|
|
var limit = 20; |
|
|
var offset = 0; |
|
|
var offset = 0; |
|
|