include whisper version in the dashboard

This commit is contained in:
Iuri Matias 2017-06-27 17:05:35 -04:00
parent d9e615453c
commit ffbf6a70c5
2 changed files with 6 additions and 2 deletions

View File

@ -235,11 +235,13 @@ class Engine {
});
self.servicesMonitor.addCheck('Whisper', function (cb) {
self.web3.version.getWhisper(function (err, res) {
self.web3.version.getWhisper(function (err, version) {
if (err) {
return cb({name: 'Whisper', status: 'off'});
} else if (version >= 5) {
return cb({name: 'Whisper (version ' + version + ') - unsupported', status: 'warn'});
} else {
return cb({name: 'Whisper', status: 'on'});
return cb({name: 'Whisper (version ' + version + ')', status: 'on'});
}
});
});

View File

@ -49,6 +49,8 @@ class Dashboard {
services.push(checkObj.name.green);
} else if (checkObj.status === 'off') {
services.push(checkObj.name.red);
} else if (checkObj.status === 'warn') {
services.push(checkObj.name.grey);
} else {
services.push(checkObj.name);
}