|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
|
|
|
|
|
var 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 monitor = {}
|
|
|
|
|
monitor.processes = {}
|
|
|
|
|
monitor.processes.fetch = function(){
|
|
|
|
@ -216,8 +216,8 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
jx.utils.patterns.visitor(rows,function(item){
|
|
|
|
|
if (date == null) {
|
|
|
|
|
|
|
|
|
|
date = new Date(item.year,item.month,item.day)
|
|
|
|
|
//date = [item.day,item.month,item.year]
|
|
|
|
|
// date = new Date(item.year,item.month-1,item.day,item.hour,item.minute)
|
|
|
|
|
date = ([item.day+'-'+MONTHS[item.month]+'-'+item.year,item.hour+':'+item.minute]).join(' ')
|
|
|
|
|
}
|
|
|
|
|
if (item.status == 'running'){
|
|
|
|
|
xr += 1
|
|
|
|
@ -231,16 +231,20 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
}
|
|
|
|
|
var data = {labels:['Running','Crash','Idle'],datasets:[{data:[xr,xc,xi],backgroundColor:[RUNNING_COLOR,CRASH_COLOR,IDLE_COLOR/**COLORS[11],COLORS[2],COLORS[100]*/]}]}
|
|
|
|
|
var context = jx.dom.get.instance('CANVAS')
|
|
|
|
|
// jx.dom.set.value('total-running', xr)
|
|
|
|
|
// jx.dom.set.value('total-crash', xc)
|
|
|
|
|
// jx.dom.set.value('total-idle', xi)
|
|
|
|
|
jx.dom.set.value('total-apps', xr + xi + xc)
|
|
|
|
|
context.id = 'doughnut'
|
|
|
|
|
jx.dom.set.value('total-running', xr)
|
|
|
|
|
jx.dom.set.value('total-crash', xc)
|
|
|
|
|
jx.dom.set.value('total-idle', xi)
|
|
|
|
|
// jx.dom.set.value('total-apps', xr + xi + xc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jx.dom.set.value('app-summary-date', date)
|
|
|
|
|
jx.dom.set.value('summary_chart','')
|
|
|
|
|
jx.dom.append('summary_chart', context)
|
|
|
|
|
var conf = {}//width:'auto',height:$('#process_summary').height}
|
|
|
|
|
$("#doughnut").attr('width', 50)
|
|
|
|
|
$("#doughnut").attr('height', 50)
|
|
|
|
|
|
|
|
|
|
var conf = {}//width:100,height:100}//width:'auto',height:$('#process_summary').height}
|
|
|
|
|
|
|
|
|
|
conf.type = 'doughnut'
|
|
|
|
|
conf.responsive = true
|
|
|
|
|