fixed syntax javascript warnings
This commit is contained in:
parent
6c3968869b
commit
906cd019c7
|
@ -5,12 +5,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Status = require('../models/Status');
|
var Status = require('../models/Status');
|
||||||
var async = require('async');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Status
|
* Status
|
||||||
*/
|
*/
|
||||||
exports.show = function(req, res) {
|
exports.show = function(req, res, next) {
|
||||||
|
|
||||||
if (! req.query.q) {
|
if (! req.query.q) {
|
||||||
res.status(400).send('Bad Request');
|
res.status(400).send('Bad Request');
|
||||||
|
@ -19,25 +18,25 @@ exports.show = function(req, res) {
|
||||||
var s = req.query.q;
|
var s = req.query.q;
|
||||||
var d = Status.new();
|
var d = Status.new();
|
||||||
|
|
||||||
if (s == 'getInfo') {
|
if (s === 'getInfo') {
|
||||||
d.getInfo(function(err) {
|
d.getInfo(function(err) {
|
||||||
if (err) next(err);
|
if (err) next(err);
|
||||||
res.jsonp(d);
|
res.jsonp(d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (s == 'getDifficulty') {
|
else if (s === 'getDifficulty') {
|
||||||
d.getDifficulty(function(err) {
|
d.getDifficulty(function(err) {
|
||||||
if (err) next(err);
|
if (err) next(err);
|
||||||
res.jsonp(d);
|
res.jsonp(d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (s == 'getTxOutSetInfo') {
|
else if (s === 'getTxOutSetInfo') {
|
||||||
d.getTxOutSetInfo(function(err) {
|
d.getTxOutSetInfo(function(err) {
|
||||||
if (err) next(err);
|
if (err) next(err);
|
||||||
res.jsonp(d);
|
res.jsonp(d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (s == 'getBestBlockHash') {
|
else if (s === 'getBestBlockHash') {
|
||||||
d.getBestBlockHash(function(err) {
|
d.getBestBlockHash(function(err) {
|
||||||
if (err) next(err);
|
if (err) next(err);
|
||||||
res.jsonp(d);
|
res.jsonp(d);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var app = angular.module('mystery',
|
angular.module('mystery',
|
||||||
['ngAnimate',
|
['ngAnimate',
|
||||||
'ngCookies',
|
'ngCookies',
|
||||||
'ngResource',
|
'ngResource',
|
||||||
|
|
|
@ -7,16 +7,16 @@ angular.module('mystery.status').controller('StatusController', ['$scope', '$rou
|
||||||
Status.get({
|
Status.get({
|
||||||
q: q
|
q: q
|
||||||
}, function(d) {
|
}, function(d) {
|
||||||
if (q == 'getInfo') {
|
if (q === 'getInfo') {
|
||||||
$scope.info = d.info;
|
$scope.info = d.info;
|
||||||
}
|
}
|
||||||
if (q == 'getDifficulty') {
|
if (q === 'getDifficulty') {
|
||||||
$scope.difficulty = d.difficulty;
|
$scope.difficulty = d.difficulty;
|
||||||
}
|
}
|
||||||
if (q == 'getTxOutSetInfo') {
|
if (q === 'getTxOutSetInfo') {
|
||||||
$scope.txoutsetinfo = d.txoutsetinfo;
|
$scope.txoutsetinfo = d.txoutsetinfo;
|
||||||
}
|
}
|
||||||
if (q == 'getBestBlockHash') {
|
if (q === 'getBestBlockHash') {
|
||||||
$scope.bestblockhash = d.bestblockhash;
|
$scope.bestblockhash = d.bestblockhash;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue