Browse Source

add venus start

master
zeus 4 years ago
parent
commit
5e9af46d34
  1. 17
      files/mongo/venus-stats.js

17
files/mongo/venus-stats.js

@ -22,13 +22,6 @@ function getArgs () {
} }
const args = getArgs(); const args = getArgs();
function mysearch(nameKey, myArray){
for (var i=0; i < myArray.length; i++) {
if (myArray[i].name === nameKey) {
return myArray[i];
}
}
}
const { spawn, exec, execSync } = require('child_process') const { spawn, exec, execSync } = require('child_process')
//console.log(args) //console.log(args)
@ -60,6 +53,16 @@ if (args["insert"] == 'yes'){
}, },
}); });
var datajsontmp = stdout.toString() var datajsontmp = stdout.toString()
datajsontmp = datajsontmp.replace(/(\r\n|\n|\r|\t)/g,"");
datajsontmp = JSON.parse(datajsontmp)
var datajson = []
for (let key in datajsontmp) {
if (datajsontmp.hasOwnProperty(key) && key == devname) {
datajson.push(datajsontmp[key])
}
}
var datajson = mysearch(devname, Object.values(datajsontmp)); var datajson = mysearch(devname, Object.values(datajsontmp));
console.error('exec ' + JSON.stringify(datajson)); console.error('exec ' + JSON.stringify(datajson));
} catch (error) { } catch (error) {

Loading…
Cancel
Save