add credentials to mock

This commit is contained in:
medcl 2020-03-21 20:38:27 +08:00
parent 0722b05c06
commit 651e652c56
1 changed files with 9 additions and 8 deletions

View File

@ -5,18 +5,18 @@ const random_endpoints = [
ip: '192.168.3.1',
status: "active", //active/inactive/unmonitored
last_active: "2020-03-21 11:12:33"
},
{
os: 'Windows',
ip: '192.168.3.100',
},
{
os: 'Linux',
ip: '192.168.3.91',
os: "Linux",
name: 'RaspberryPi',
ip: '192.168.3.81',
credentials:{
user: "pi",
password: "elastic"
}
},
];
let random_endpoint_pick = 0;
export default {
@ -25,6 +25,7 @@ const random_endpoints = [
res.json(random_endpoints);
}, 3000);
},
'get /endpoints/get_endpoint/1': function (req, res) {
const responseObj = random_endpoints[random_endpoint_pick % random_endpoints.length];
random_endpoint_pick += 1;