Merge "Append default podm username/password"

This commit is contained in:
Jenkins 2016-10-17 16:25:20 +00:00 committed by Gerrit Code Review
commit ce11d4b4a9
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,8 @@
*/
exports.url = "http://127.0.0.1:6000"
exports.username = "admin"
exports.password = "admin"
exports.nodeConfig =
{

View File

@ -1,6 +1,15 @@
var config = require('./config.js');
var util = require('./util.js');
// Base64 username:password on client-side, and append into request header
$.ajaxSetup({
beforeSend: function (xhr)
{
xhr.setRequestHeader('Authorization',
'Basic ' + btoa(config.username + ':' + config.password));
}
});
exports.getPods = function(callback) {
var url = config.url + '/redfish/v1/Chassis';
$.ajax({