Browse Source

add rest

master
zeus 4 years ago
parent
commit
e560ad5cda
  1. 14
      swarmlab-app/src/run/app.js

14
swarmlab-app/src/run/app.js

@ -358,7 +358,15 @@ cors(corsOptions), (req, res, next) => {
RES.token = req.query["token"] RES.token = req.query["token"]
RES.start = req.query["start"] RES.start = req.query["start"]
RES.end = req.query["end"] RES.end = req.query["end"]
RES.swarmlabname = req.query["swarmlabname"] RES.swarmlabname = req.query["swarmlabname"]
/*
*
* validate
*
*/
var isvalid = await checkToken(RES.token); var isvalid = await checkToken(RES.token);
if(isvalid.action == 'ok'){ if(isvalid.action == 'ok'){
console.log("Authserver ok " + RES.token); console.log("Authserver ok " + RES.token);
@ -409,8 +417,12 @@ cors(corsOptions), (req, res, next) => {
//if( resdata.data.filter(item1 => item1.res25swarmlabname.includes(nameofswarmlab)).length > 0 ){ //if( resdata.data.filter(item1 => item1.res25swarmlabname.includes(nameofswarmlab)).length > 0 ){
var regexlog = new RegExp(nameofswarmlab); var regexlog = new RegExp(nameofswarmlab);
if( resdata.data.filter(item1 => regexlog.test(item1.res25swarmlabname))){ if( resdata.data.filter(item1 => regexlog.test(item1.res25swarmlabname))){
console.log('----->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>--- ' + nameofswarmlab)
resdataarray.push(item[i]) resdataarray.push(item[i])
RES.found = item[i] RES.found = item[i]
}else{
console.log('-----<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<--- ' + nameofswarmlab)
} }
} }

Loading…
Cancel
Save