Add platform stats to user page

Re-add user gravatars
Some error catching
Some code clean-up
This commit is contained in:
Tim 2015-06-21 17:19:19 +02:00
parent ba18c5b96e
commit 9364b06c99
12 changed files with 275 additions and 76 deletions

View file

@ -210,13 +210,17 @@ function getPlatformImagePath(platformName) {
}
function isPrivateIP(ip_address) {
var parts = ip_address.split('.');
if (parts[0] === '10' ||
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
(parts[0] === '192' && parts[1] === '168')) {
if (ip_address.indexOf(".") > -1) {
var parts = ip_address.split('.');
if (parts[0] === '10' ||
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
(parts[0] === '192' && parts[1] === '168')) {
return true;
}
return false;
} else {
return true;
}
return false;
}
function humanTime(seconds) {

View file

@ -32,7 +32,11 @@ user_ip_table_options = {
"className": "modal-control",
"createdCell": function (td, cellData, rowData, row, col) {
if (isPrivateIP(cellData)) {
$(td).html(cellData);
if (cellData != '') {
$(td).html(cellData);
} else {
$(td).html('n/a');
}
} else {
$(td).html('<a href="#ip-info-modal" data-toggle="modal"><span data-toggle="ip-tooltip" data-placement="left" title="IP Address Info" id="ip-info"><i class="icon-map-marker icon-white"></i></span>&nbsp' + cellData +'</a>');
}

View file

@ -25,13 +25,13 @@ users_list_table_options = {
"columnDefs": [
{
"targets": [0],
"data": null,
"data": "thumb",
"createdCell": function (td, cellData, rowData, row, col) {
//if (rowData['user_thumb'] === '') {
if (cellData === '') {
$(td).html('<img src="interfaces/default/images/gravatar-default-80x80.png" alt="User Logo"/>');
//} else {
// $(td).html('<img src="' + rowData['user_thumb'] + '" alt="User Logo"/>');
//}
} else {
$(td).html('<img src="' + cellData + '" alt="User Logo"/>');
}
},
"orderable": false,
"className": "users-poster-face",