|
|
@ -59,7 +59,7 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, { |
|
|
//
|
|
|
//
|
|
|
function zeroPad(num, places) { |
|
|
function zeroPad(num, places) { |
|
|
var zero = places - num.toString().length + 1; |
|
|
var zero = places - num.toString().length + 1; |
|
|
return Array(+(zero > 0 && zero)).join("0") + num; |
|
|
|
|
|
|
|
|
return new Array(+(zero > 0 && zero)).join("0") + num; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// build the resulting IP
|
|
|
// build the resulting IP
|
|
|
@ -99,29 +99,35 @@ function get_os_data(url, element) { |
|
|
|
|
|
|
|
|
var dashboard = {}; |
|
|
var dashboard = {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dashboard.getUptime = function () { |
|
|
dashboard.getUptime = function () { |
|
|
get_os_data('/info/uptime/', "#get-uptime"); |
|
|
get_os_data('/info/uptime/', "#get-uptime"); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getOSname = function () { |
|
|
dashboard.getOSname = function () { |
|
|
get_os_data('/info/platform/osname/', "#get-osname"); |
|
|
get_os_data('/info/platform/osname/', "#get-osname"); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getHostname = function () { |
|
|
dashboard.getHostname = function () { |
|
|
get_os_data('/info/platform/hostname/', "#get-hostname"); |
|
|
get_os_data('/info/platform/hostname/', "#get-hostname"); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getKernel = function () { |
|
|
dashboard.getKernel = function () { |
|
|
get_os_data('/info/platform/kernel/', "#get-kernel"); |
|
|
get_os_data('/info/platform/kernel/', "#get-kernel"); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getCPUcount = function () { |
|
|
dashboard.getCPUcount = function () { |
|
|
get_os_data('/info/getcpus/count/', "#get-cpucount"); |
|
|
get_os_data('/info/getcpus/count/', "#get-cpucount"); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getCPUtype = function () { |
|
|
dashboard.getCPUtype = function () { |
|
|
get_os_data('/info/getcpus/type/', "#get-cputype"); |
|
|
get_os_data('/info/getcpus/type/', "#get-cputype"); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getDisk = function () { |
|
|
dashboard.getDisk = function () { |
|
|
$.getJSON('/info/getdisk/', function (data) { |
|
|
$.getJSON('/info/getdisk/', function (data) { |
|
|
destroy_dataTable("get_disk"); |
|
|
destroy_dataTable("get_disk"); |
|
|
$("#filter-ps").val("").off("keyup"); |
|
|
|
|
|
|
|
|
var $filterPs = $("#filter-ps"); |
|
|
|
|
|
$filterPs.val("").off("keyup"); |
|
|
var psTable = $("#get_disk").dataTable({ |
|
|
var psTable = $("#get_disk").dataTable({ |
|
|
aaData: data, |
|
|
aaData: data, |
|
|
aoColumns: [ |
|
|
aoColumns: [ |
|
|
@ -138,15 +144,17 @@ dashboard.getDisk = function() { |
|
|
bAutoWidth: false, |
|
|
bAutoWidth: false, |
|
|
bInfo: false |
|
|
bInfo: false |
|
|
}).fadeIn(); |
|
|
}).fadeIn(); |
|
|
$("#filter-ps").on("keyup", function() { |
|
|
|
|
|
|
|
|
$filterPs.on("keyup", function () { |
|
|
psTable.fnFilter(this.value); |
|
|
psTable.fnFilter(this.value); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getUsers = function () { |
|
|
dashboard.getUsers = function () { |
|
|
$.getJSON('/info/getusers/', function (data) { |
|
|
$.getJSON('/info/getusers/', function (data) { |
|
|
destroy_dataTable("get_users"); |
|
|
destroy_dataTable("get_users"); |
|
|
$("#filter-ps").val("").off("keyup"); |
|
|
|
|
|
|
|
|
var $filterPs = $("#filter-ps"); |
|
|
|
|
|
$filterPs.val("").off("keyup"); |
|
|
var psTable = $("#get_users").dataTable({ |
|
|
var psTable = $("#get_users").dataTable({ |
|
|
aaData: data, |
|
|
aaData: data, |
|
|
aoColumns: [ |
|
|
aoColumns: [ |
|
|
@ -164,15 +172,17 @@ dashboard.getUsers = function() { |
|
|
bAutoWidth: false, |
|
|
bAutoWidth: false, |
|
|
bInfo: false |
|
|
bInfo: false |
|
|
}).fadeIn(); |
|
|
}).fadeIn(); |
|
|
$("#filter-ps").on("keyup", function() { |
|
|
|
|
|
|
|
|
$filterPs.on("keyup", function () { |
|
|
psTable.fnFilter(this.value); |
|
|
psTable.fnFilter(this.value); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getNetstat = function () { |
|
|
dashboard.getNetstat = function () { |
|
|
$.getJSON('/info/getnetstat/', function (data) { |
|
|
$.getJSON('/info/getnetstat/', function (data) { |
|
|
destroy_dataTable("get_netstat"); |
|
|
destroy_dataTable("get_netstat"); |
|
|
$("#filter-ps").val("").off("keyup"); |
|
|
|
|
|
|
|
|
var $filterPs = $("#filter-ps"); |
|
|
|
|
|
$filterPs.val("").off("keyup"); |
|
|
var psTable = $("#get_netstat").dataTable({ |
|
|
var psTable = $("#get_netstat").dataTable({ |
|
|
aaData: data, |
|
|
aaData: data, |
|
|
aoColumns: [ |
|
|
aoColumns: [ |
|
|
@ -188,15 +198,17 @@ dashboard.getNetstat = function() { |
|
|
bAutoWidth: false, |
|
|
bAutoWidth: false, |
|
|
bInfo: false |
|
|
bInfo: false |
|
|
}).fadeIn(); |
|
|
}).fadeIn(); |
|
|
$("#filter-ps").on("keyup", function() { |
|
|
|
|
|
|
|
|
$filterPs.on("keyup", function () { |
|
|
psTable.fnFilter(this.value); |
|
|
psTable.fnFilter(this.value); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getProc = function () { |
|
|
dashboard.getProc = function () { |
|
|
$.getJSON('/info/proc/', function (data) { |
|
|
$.getJSON('/info/proc/', function (data) { |
|
|
destroy_dataTable("get_proc"); |
|
|
destroy_dataTable("get_proc"); |
|
|
$("#filter-ps").val("").off("keyup"); |
|
|
|
|
|
|
|
|
var $filterPs = $("#filter-ps"); |
|
|
|
|
|
$filterPs.val("").off("keyup"); |
|
|
var psTable = $("#get_proc").dataTable({ |
|
|
var psTable = $("#get_proc").dataTable({ |
|
|
aaData: data, |
|
|
aaData: data, |
|
|
aoColumns: [ |
|
|
aoColumns: [ |
|
|
@ -219,16 +231,17 @@ dashboard.getProc = function() { |
|
|
bAutoWidth: false, |
|
|
bAutoWidth: false, |
|
|
bInfo: false |
|
|
bInfo: false |
|
|
}).fadeIn(); |
|
|
}).fadeIn(); |
|
|
$("#filter-ps").on("keyup", function() { |
|
|
|
|
|
|
|
|
$filterPs.on("keyup", function () { |
|
|
psTable.fnFilter(this.value); |
|
|
psTable.fnFilter(this.value); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
dashboard.getIps = function () { |
|
|
dashboard.getIps = function () { |
|
|
$.getJSON('/info/getips/', function (data) { |
|
|
$.getJSON('/info/getips/', function (data) { |
|
|
destroy_dataTable("get_ips"); |
|
|
destroy_dataTable("get_ips"); |
|
|
$("#filter-ps").val("").off("keyup"); |
|
|
|
|
|
|
|
|
var $filterPs = $("#filter-ps"); |
|
|
|
|
|
$filterPs.val("").off("keyup"); |
|
|
var psTable = $("#get_ips").dataTable({ |
|
|
var psTable = $("#get_ips").dataTable({ |
|
|
aaData: data, |
|
|
aaData: data, |
|
|
aoColumns: [ |
|
|
aoColumns: [ |
|
|
@ -244,17 +257,16 @@ dashboard.getIps = function() { |
|
|
bAutoWidth: false, |
|
|
bAutoWidth: false, |
|
|
bInfo: false |
|
|
bInfo: false |
|
|
}).fadeIn(); |
|
|
}).fadeIn(); |
|
|
$("#filter-ps").on("keyup", function() { |
|
|
|
|
|
|
|
|
$filterPs.on("keyup", function () { |
|
|
psTable.fnFilter(this.value); |
|
|
psTable.fnFilter(this.value); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
// Expand-Contract div/table
|
|
|
// Expand-Contract div/table
|
|
|
$(document).ready(function () { |
|
|
$(document).ready(function () { |
|
|
$(".widget-content").show(); |
|
|
$(".widget-content").show(); |
|
|
$(".widget-header").click(function() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
$(".widget-header").click(function () { |
|
|
$(this).next(".widget-content").slideToggle(500); |
|
|
$(this).next(".widget-content").slideToggle(500); |
|
|
$("i", this).toggleClass("icon-minus icon-plus"); |
|
|
$("i", this).toggleClass("icon-minus icon-plus"); |
|
|
}); |
|
|
}); |
|
|
|