mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-21 14:04:18 +01:00
ngrx Store And some other enhancements
ngrx Store And some other enhancements
This commit is contained in:
parent
5f47a9d0ef
commit
26fc18d0c0
7 changed files with 47 additions and 22 deletions
|
@ -23,9 +23,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
SOFTWARE.
|
||||
|
||||
|
||||
@angular/router
|
||||
MIT
|
||||
|
||||
hammerjs
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
@ -316,7 +313,7 @@ Apache-2.0
|
|||
|
||||
|
||||
|
||||
@angular/common
|
||||
@ngrx/store
|
||||
MIT
|
||||
|
||||
@angular/material/dialog
|
||||
|
@ -374,6 +371,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||
THE SOFTWARE.
|
||||
|
||||
|
||||
@angular/common
|
||||
MIT
|
||||
|
||||
@angular/platform-browser
|
||||
MIT
|
||||
|
||||
|
@ -622,6 +622,9 @@ MIT
|
|||
|
||||
@angular/material/progress-spinner
|
||||
|
||||
@angular/router
|
||||
MIT
|
||||
|
||||
@angular/material/form-field
|
||||
|
||||
@angular/material/progress-bar
|
||||
|
@ -634,6 +637,9 @@ MIT
|
|||
|
||||
@angular/material/table
|
||||
|
||||
@ngrx/effects
|
||||
MIT
|
||||
|
||||
@angular/material/select
|
||||
|
||||
angular2-qrcode
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
|
||||
<link rel="stylesheet" href="styles.e8ad9595401679e5b3a6.css"></head>
|
||||
<link rel="stylesheet" href="styles.e4aab088ea7dc1035ccf.css"></head>
|
||||
<body>
|
||||
<rtl-app></rtl-app>
|
||||
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.b2575713cefb95077d85.js"></script><script type="text/javascript" src="main.8d1245ca4bf0bc75a28f.js"></script></body>
|
||||
<script type="text/javascript" src="runtime.ec2944dd8b20ec099bf3.js"></script><script type="text/javascript" src="polyfills.b2575713cefb95077d85.js"></script><script type="text/javascript" src="main.1f46d61aa2787c42811c.js"></script></body>
|
||||
</html>
|
||||
|
|
1
angular/main.1f46d61aa2787c42811c.js
Normal file
1
angular/main.1f46d61aa2787c42811c.js
Normal file
File diff suppressed because one or more lines are too long
1
angular/styles.e4aab088ea7dc1035ccf.css
Normal file
1
angular/styles.e4aab088ea7dc1035ccf.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -2,9 +2,9 @@ var request = require("request-promise");
|
|||
var options = require("../connect");
|
||||
var common = require('../common');
|
||||
|
||||
getAlias = (channel, channelType) => {
|
||||
// console.log('CHANNEL: ');
|
||||
// console.log(channel);
|
||||
getAliasForChannel = (channel, channelType) => {
|
||||
console.log('CHANNEL: ');
|
||||
console.log(channel);
|
||||
return new Promise(function(resolve, reject) {
|
||||
if (undefined === channelType || channelType === 'all') {
|
||||
options.url = common.lnd_server_url + '/graph/node/' + channel.remote_pubkey;
|
||||
|
@ -43,11 +43,15 @@ exports.getChannels = (req, res, next) => {
|
|||
}
|
||||
Promise.all(
|
||||
channels.map(channel => {
|
||||
return getAlias(channel, req.params.channelType);
|
||||
}))
|
||||
// console.log(`\nChannel before getting Alias: ${JSON.stringify(channel)} \nAnd Channel Type: ${req.params.channelType}`);
|
||||
return getAliasForChannel(channel, req.params.channelType);
|
||||
})
|
||||
)
|
||||
.then(function(values) {
|
||||
console.log(`\nChannels Fetched with Alias: ${JSON.stringify(body)}`);
|
||||
res.status(200).json(body);
|
||||
}).catch(err => {
|
||||
console.error(err.error);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -57,7 +57,7 @@ exports.getGraphNode = (req, res, next) => {
|
|||
console.error(`Fetching node Info failed! ${err}`);
|
||||
res.status(500).json({
|
||||
message: "Fetching node Info failed!",
|
||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||
error: (undefined !== err.error) ? err.error : 'Error From Server!'
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,20 +1,33 @@
|
|||
var fs = require('fs');
|
||||
var request = require('request');
|
||||
var request = require('request-promise');
|
||||
var options = require("../connect");
|
||||
var common = require('../common');
|
||||
|
||||
getAliasForPeers = (peer) => {
|
||||
return new Promise(function(resolve, reject) {
|
||||
options.url = common.lnd_server_url + '/graph/node/' + peer.pub_key;
|
||||
request(options)
|
||||
.then(function(aliasBody) {
|
||||
console.log('Alias: ' + JSON.stringify(aliasBody.node.alias));
|
||||
peer.alias = aliasBody.node.alias;
|
||||
resolve(aliasBody.node.alias);
|
||||
})
|
||||
.catch(err => reject(err));
|
||||
});
|
||||
}
|
||||
|
||||
exports.getPeers = (req, res, next) => {
|
||||
options.url = common.lnd_server_url + '/peers';
|
||||
request.get(options, (error, response, body) => {
|
||||
console.log('Peers Received: ' + JSON.stringify(body));
|
||||
if(error) {
|
||||
res.status(500).json({
|
||||
message: "Fetching peers failed!",
|
||||
error: error
|
||||
});
|
||||
} else {
|
||||
request(options).then(function (body) {
|
||||
let peers = (undefined === body.peers) ? [] : body.peers;
|
||||
Promise.all(
|
||||
peers.map(peer => {
|
||||
return getAliasForPeers(peer);
|
||||
}))
|
||||
.then(function(values) {
|
||||
console.log(`\nPeers Fetched with Alias: ${JSON.stringify(body)}`);
|
||||
res.status(200).json(body.peers);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue