|
|
|
@ -38,6 +38,12 @@ monitor.processes.init = function(x){
|
|
|
|
|
jx.dom.get.children('menu')[0].click()
|
|
|
|
|
setTimeout(monitor.sandbox.init,3000)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This function renders the grid of processes being monitored,
|
|
|
|
|
* @param label label the list of processes belongs to
|
|
|
|
|
* @param data dataset of a selected set of processes (works a bit like top)
|
|
|
|
|
*/
|
|
|
|
|
monitor.processes.render = function(label,data) {
|
|
|
|
|
|
|
|
|
|
data = jx.utils.patterns.visitor(data,function(row){
|
|
|
|
@ -55,9 +61,9 @@ monitor.processes.render = function(label,data) {
|
|
|
|
|
width: $('#latest_processes').width(), height:'auto'
|
|
|
|
|
}
|
|
|
|
|
options.paging = true
|
|
|
|
|
options.pageSize = 3
|
|
|
|
|
options.pageSize = 4
|
|
|
|
|
options.pageIndex = 1
|
|
|
|
|
options.pageButtonCount = 3
|
|
|
|
|
options.pageButtonCount = 4
|
|
|
|
|
options.pagerContainer = '#latest_process_pager'
|
|
|
|
|
options.pagerFormat= "{prev} Page {pageIndex} of {pageCount} {next}"
|
|
|
|
|
options.pagePrevText= '<i class="fa fa-chevron-left"></i>'
|
|
|
|
@ -114,8 +120,10 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
|
var frame = $('#trends_chart')
|
|
|
|
|
jx.dom.set.value('trends_chart','')
|
|
|
|
|
var context = jx.dom.get.instance('CANVAS')
|
|
|
|
|
|
|
|
|
|
var conf = { type: 'line',responsive:true,maintainAspectRatio:true }
|
|
|
|
|
context.width = $(frame).width()
|
|
|
|
|
context.height= $(frame).height()
|
|
|
|
|
|
|
|
|
|
var conf = { type: 'line',responsive:true }
|
|
|
|
|
conf.data = {}
|
|
|
|
|
conf.options = { legend: { position: 'bottom' } }
|
|
|
|
|
conf.options.scales = {}
|
|
|
|
@ -268,19 +276,22 @@ monitor.sandbox.init = function () {
|
|
|
|
|
var httpclient = HttpClient.instance()
|
|
|
|
|
httpclient.get('/sandbox', function (x) {
|
|
|
|
|
var r = JSON.parse(x.responseText)
|
|
|
|
|
monitor.sandbox.render(r);
|
|
|
|
|
if (r.length > 0){
|
|
|
|
|
monitor.sandbox.render(r);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
monitor.sandbox.render = function (logs) {
|
|
|
|
|
months = {1:'Jan',2:'Feb',3:'Mar',4:'Apr',5:'May',6:'Jun',7:'Jul',8:'Aug',9:'Sep',10:'Oct',11:'Nov',12:'Dec'}
|
|
|
|
|
|
|
|
|
|
var d = ([logs[0].day, '-', months[logs[0].month],'-', logs[0].year, ' ', logs[0].hour, ':', logs[0].minute]).join('')
|
|
|
|
|
jx.dom.set.value('sandbox_date',d)
|
|
|
|
|
var options = {width:$('#sandbox_status').width(),height:'auto'}
|
|
|
|
|
options.data = logs
|
|
|
|
|
options.paging = true
|
|
|
|
|
options.pageSize = 3
|
|
|
|
|
options.pageSize = 4
|
|
|
|
|
options.pageIndex = 1
|
|
|
|
|
options.pageButtonCount = 3
|
|
|
|
|
options.pageButtonCount = 4
|
|
|
|
|
options.pagerContainer = '#latest_process_pager'
|
|
|
|
|
options.pagerFormat= "{prev} Page {pageIndex} of {pageCount} {next}"
|
|
|
|
|
options.pagePrevText= '<i class="fa fa-chevron-left"></i>'
|
|
|
|
@ -304,4 +315,4 @@ monitor.sandbox.render = function (logs) {
|
|
|
|
|
var grid = $('#sandbox_status').jsGrid(options)
|
|
|
|
|
jx.dom.show('inspect_sandbox')
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|