$('table.dataTable').delegate('a.resource-info','click',function() {
var aPos = sTable.fnGetPosition( this.parentNode );
var aData = sTable.fnGetData( aPos[0] );
- //console.log(aData);
+ console.log(aData);
var index = {}
// XXX Loic @ Hardcoded !!! Maybe a loop over all fields would be better
index['hostname'] = self.getColIndex('hostname',cols);
index['urn'] = self.getColIndex('urn',cols);
index['type'] = self.getColIndex('type',cols);
- index['status'] = self.getColIndex('boot_state',cols);
+ //index['status'] = self.getColIndex('boot_state',cols);
+ index['available'] = self.getColIndex('available',cols);
index['testbed'] = self.getColIndex('testbed_name',cols);
index['facility'] = self.getColIndex('facility_name',cols);
var resourceData = {
'hostname' : strip(aData[index['hostname']]),
'urn' : aData[index['urn']],
'type' : aData[index['type']],
- 'status' : aData[index['status']],
+ //'status' : aData[index['status']],
+ 'available' : aData[index['available']],
'testbed' : aData[index['testbed']],
'facility' : aData[index['facility']],
};
} else {
var logo = resourceData['testbed'];
var resourceLocation = {
- 'longitude' : aData[13],
- 'latitude' : aData[23],
+ 'longitude' : aData[20],
+ 'latitude' : aData[17],
};
var coordinates = resourceLocation['latitude']+','+resourceLocation['longitude'];
+ console.log(coordinates);
}
var modal = $('#resource-info-modal');
modal.find('.modal-title').text(resourceData['testbed'] + ': ' +resourceData['hostname']);
table = modal.find('.modal-resource-info');
- table.html('<tr><td colspan="2"><img class="img-responsive" src="/static/img/testbeds/'+logo+'.png" alt="'+resourceData['facility']+' - '+resourceData['testbed']+'" /></td></tr>');
+ table.html('<tr><td colspan="2"><center><img class="img-responsive" src="/static/img/testbeds/'+logo+'.png" alt="'+resourceData['facility']+' - '+resourceData['testbed']+'" /></center></td></tr>');
for (var j in resourceData) {
table.append('<tr><td>' + j + '</td><td>' + resourceData[j] + '</td></tr>');
}