|
|
|
@ -3,38 +3,38 @@ var monitor = {}
|
|
|
|
|
monitor.utils = {}
|
|
|
|
|
monitor.utils.get = {}
|
|
|
|
|
monitor.utils.get.time = function (item) {
|
|
|
|
|
// date = ([item.day + '-' + MONTHS[item.month] + '-' + item.year, hour + ':' + item.minute]).join(' ')
|
|
|
|
|
// date = ([item.day + '-' + MONTHS[item.month] + '-' + item.year, hour + ':' + item.minute]).join(' ')
|
|
|
|
|
var hour = item.hour > 9 ? item.hour : ('0' + item.hour)
|
|
|
|
|
if (hour > 12) {
|
|
|
|
|
var units = 'PM'
|
|
|
|
|
} else {
|
|
|
|
|
var units = 'AM'
|
|
|
|
|
}
|
|
|
|
|
return ([hour+':'+item.minute,units]).join(' ')
|
|
|
|
|
return ([hour+':'+item.minute,units]).join(' ')
|
|
|
|
|
}
|
|
|
|
|
monitor.utils.get.dateTime = function (item) {
|
|
|
|
|
var time = monitor.utils.get.time(item)
|
|
|
|
|
return ([item.day+'-'+MONTHS[item.month]+'-'+item.year,time]).join(' ')
|
|
|
|
|
}
|
|
|
|
|
return ([item.day+'-'+MONTHS[item.month]+'-'+item.year,time]).join(' ')
|
|
|
|
|
}
|
|
|
|
|
monitor.processes = {}
|
|
|
|
|
monitor.processes.fetch = function(){
|
|
|
|
|
var httpclient = HttpClient.instance()
|
|
|
|
|
httpclient.get(HTTP_CONTEXT+'/get/processes',monitor.processes.init);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
monitor.processes.init = function (x) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var r = JSON.parse(x.responseText)
|
|
|
|
|
monitor.processes.summary.init(r)
|
|
|
|
|
var keys = jx.utils.keys(r)
|
|
|
|
|
monitor.processes.summary.init(r)
|
|
|
|
|
var keys = jx.utils.keys(r)
|
|
|
|
|
jx.dom.set.value('menu','')
|
|
|
|
|
jx.utils.patterns.visitor(keys,function(label){
|
|
|
|
|
var div = jx.dom.get.instance('DIV')
|
|
|
|
|
var frame= jx.dom.get.instance('DIV')
|
|
|
|
|
var i = jx.dom.get.instance('I')
|
|
|
|
|
i.className = 'fa fa-chevron-right left'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
div.innerHTML = label
|
|
|
|
|
frame.data = r[label]
|
|
|
|
|
frame.label = label
|
|
|
|
@ -49,13 +49,13 @@ monitor.processes.init = function (x) {
|
|
|
|
|
jx.dom.append('menu',frame)
|
|
|
|
|
})
|
|
|
|
|
//
|
|
|
|
|
// Auto start the first item in the menu
|
|
|
|
|
// Auto start the first item in the menu
|
|
|
|
|
// This is designed not to let the user wander or wonder what is going on
|
|
|
|
|
//
|
|
|
|
|
var nodes = jx.dom.get.children('menu')
|
|
|
|
|
if (nodes.length > 0) {
|
|
|
|
|
nodes[0].click()
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
//
|
|
|
|
|
// We should hide the panes for this
|
|
|
|
|
//
|
|
|
|
@ -73,19 +73,19 @@ monitor.processes.init = function (x) {
|
|
|
|
|
monitor.processes.render = function(label,data) {
|
|
|
|
|
|
|
|
|
|
data = jx.utils.patterns.visitor(data,function(row){
|
|
|
|
|
var status = {"idle":'<i class="fa fa-ellipsis-h" title="IDLE"></i>',"running":'<i class="fa fa-check" title="RUNNING"></i>',"crash":'<i class="fa fa-times" title="CRASHED"></i>'}
|
|
|
|
|
var status = {"idle":'<i class="fa fa-ellipsis-h" title="IDLE"></i>',"running":'<i class="fa fa-check" title="RUNNING"></i>',"crash":'<i class="fa fa-times" title="CRASHED"></i>'}
|
|
|
|
|
if (!row.status.match(/class/)) {
|
|
|
|
|
row.status_id = row.status
|
|
|
|
|
row.status = status[row.status]
|
|
|
|
|
|
|
|
|
|
row.status = status[row.status]
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return row
|
|
|
|
|
})
|
|
|
|
|
jx.dom.set.value('latest_processes','') ;
|
|
|
|
|
jx.dom.set.value('latest_processes_label', label)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
|
width: $('#latest_processes').width(), height:'auto'
|
|
|
|
|
width: "90%", height:'auto', autoload:true
|
|
|
|
|
}
|
|
|
|
|
options.paging = true
|
|
|
|
|
options.pageSize = 4
|
|
|
|
@ -95,10 +95,10 @@ monitor.processes.render = function(label,data) {
|
|
|
|
|
options.pagerFormat= "{prev} Page {pageIndex} of {pageCount} {next}"
|
|
|
|
|
options.pagePrevText= '<i class="fa fa-chevron-left"></i>'
|
|
|
|
|
options.pageNextText= "<i class='fa fa-chevron-right small' title='Next'> </i>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options.data = data
|
|
|
|
|
options.rowClass = function (item, index,evt) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 'small'
|
|
|
|
|
}
|
|
|
|
|
options.rowClick = function(args){
|
|
|
|
@ -106,19 +106,19 @@ monitor.processes.render = function(label,data) {
|
|
|
|
|
var id = jx.dom.get.value('latest_processes_label')
|
|
|
|
|
var app = item.label
|
|
|
|
|
monitor.processes.trend.init(id, app)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.anomaly == true) {
|
|
|
|
|
jx.dom.show('has_anomaly')
|
|
|
|
|
} else {
|
|
|
|
|
jx.dom.hide('has_anomaly')
|
|
|
|
|
}
|
|
|
|
|
// var hour = item.hour < 10? ('0'+item.hour): item.hour
|
|
|
|
|
// date = ([item.day + '-' + MONTHS[item.month] + '-' + item.year, hour + ':' + item.minute]).join(' ')
|
|
|
|
|
|
|
|
|
|
// date = ([item.day + '-' + MONTHS[item.month] + '-' + item.year, hour + ':' + item.minute]).join(' ')
|
|
|
|
|
|
|
|
|
|
jx.dom.set.value('node_last_lookup',monitor.utils.get.dateTime(item))
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options.autoload = true
|
|
|
|
|
options.fields = [
|
|
|
|
|
{ name: 'label', type: 'text', title: "Process", headercss: "small bold", css: "small"},
|
|
|
|
@ -141,7 +141,7 @@ monitor.processes.trend.init = function (label,app) {
|
|
|
|
|
var logs = JSON.parse(x.responseText)
|
|
|
|
|
var dom = jx.dom.get.instance('trend_info');
|
|
|
|
|
dom.logs = logs
|
|
|
|
|
jx.dom.set.value('trend_info',app.trim())
|
|
|
|
|
jx.dom.set.value('trend_info',app.trim())
|
|
|
|
|
// jx.dom.set.attribute(label,'logs',logs)
|
|
|
|
|
monitor.processes.trend.render(logs,null,app)
|
|
|
|
|
})
|
|
|
|
@ -151,7 +151,7 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
|
// key = 'memory_usage'
|
|
|
|
|
// }
|
|
|
|
|
// if (logs == null || label == null){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// logs = jx.dom.get.instance('trend_info').logs
|
|
|
|
|
// label= jx.dom.get.value('trend_info') ;
|
|
|
|
|
// }
|
|
|
|
@ -165,21 +165,21 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
|
conf.data = {}
|
|
|
|
|
conf.options = { legend: { position: 'bottom' } }
|
|
|
|
|
conf.options.scales = {}
|
|
|
|
|
conf.options.scales.yAxes = [
|
|
|
|
|
conf.options.scales.yAxes = [
|
|
|
|
|
{id:'0',scaleLabel:{display:true,labelString:'CPU & MEMORY %'},ticks:{min:0,max:100,beginAtZero:true},gridLines: {display:false}}
|
|
|
|
|
// {id:'1',position:'right',scaleLabel:{display:true,labelString:'PROCESS COUNT'},ticks:{min:0,stepSize:1,beginAtZero:true},gridLines: {display:false}}
|
|
|
|
|
]
|
|
|
|
|
conf.options.scales.xAxes = [
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridLines: {display:false},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time: {
|
|
|
|
|
format:'HH:mm'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
conf.data.datasets = [ ]
|
|
|
|
|
var x_axis = []
|
|
|
|
@ -199,26 +199,26 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
|
if (_x[x] == null ){//||(_x[x] == null && _y[y] == null)) {
|
|
|
|
|
_x[x] = 1
|
|
|
|
|
// _y[y] = 1
|
|
|
|
|
x_axis.push(x)
|
|
|
|
|
x_axis.push(x)
|
|
|
|
|
cpu.data.push({ x: x, y: item.cpu_usage })
|
|
|
|
|
mem.data.push({x:x,y:item.memory_usage})
|
|
|
|
|
// proc.data.push({x:x,y:item.proc_count})
|
|
|
|
|
// return {x:x,y:y}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var item = logs[logs.length - 1]
|
|
|
|
|
jx.dom.set.value('trend_last_lookup',monitor.utils.get.dateTime(item))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conf.data.datasets = [cpu,mem]
|
|
|
|
|
x_axis = jx.utils.unique(x_axis)
|
|
|
|
|
conf.data.labels = x_axis
|
|
|
|
|
// console.log(conf)
|
|
|
|
|
jx.dom.append('trends_chart',context)
|
|
|
|
|
var chart = new Chart(context,conf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
monitor.processes.summary = {}
|
|
|
|
@ -236,10 +236,10 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
for( label in logs ){
|
|
|
|
|
var rows = logs[label]
|
|
|
|
|
series[label] = {data:[0,0,0],label:label}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jx.utils.patterns.visitor(rows,function(item){
|
|
|
|
|
if (date == null) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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(' ')
|
|
|
|
|
date = monitor.utils.get.dateTime(item)
|
|
|
|
@ -252,7 +252,7 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
xc += 1
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
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')
|
|
|
|
@ -261,22 +261,22 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
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)
|
|
|
|
|
$("#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
|
|
|
|
|
conf.data = data
|
|
|
|
|
conf.options = { legend: { position: 'right' }, repsonsive: true }
|
|
|
|
|
var _chart = new Chart(context,conf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#summary_chart').click(function (evt) {
|
|
|
|
|
console.log(_chart)
|
|
|
|
|
console.log($(_chart))
|
|
|
|
@ -286,17 +286,17 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
jx.dom.set.value('summary_ranking','')
|
|
|
|
|
context = jx.dom.get.instance('CANVAS')
|
|
|
|
|
jx.dom.append('summary_ranking',context)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conf = { type: 'bar', responsive: true }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conf.options={scales:{xAxes:[{gridLines: {display:false}}],yAxes:[{gridLines: {display:false},scaleLabel:{display:true,labelString:'PROCESS COUNTS'} }] }}
|
|
|
|
|
conf.options.legend ={position:'right'}
|
|
|
|
|
/*
|
|
|
|
|
conf.data = {labels:['Running','Idle','Crash']}
|
|
|
|
|
var labels = jx.utils.keys(series)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var i = 0
|
|
|
|
|
conf.data.datasets = jx.utils.patterns.visitor(labels,function(id){
|
|
|
|
|
conf.data.datasets = jx.utils.patterns.visitor(labels,function(id){
|
|
|
|
|
series[id].backgroundColor = COLORS[i++]
|
|
|
|
|
return series[id]})
|
|
|
|
|
chart = new Chart(context,conf);
|
|
|
|
@ -305,7 +305,7 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
conf.data = { labels: labels, backgroundColor:colors }
|
|
|
|
|
var xr = [], xi = [], xc = [],xr_bg = [],xc_bg = [],xi_bg = []
|
|
|
|
|
jx.utils.patterns.visitor(labels, function (id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rows = logs[id]
|
|
|
|
|
var index = xr.length
|
|
|
|
|
xr_bg[index] = RUNNING_COLOR
|
|
|
|
@ -316,25 +316,25 @@ monitor.processes.summary.init = function(logs){
|
|
|
|
|
xc[index] = 0
|
|
|
|
|
xi[index] = 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jx.utils.patterns.visitor(logs[id], function (row) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (row.status.match(/running/i)) {
|
|
|
|
|
xr[index] += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (row.status.match(/idle/i)) {
|
|
|
|
|
xi[index] += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
xc[index] += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conf.data.datasets = [{ label: 'Running', data:xr,backgroundColor:xr_bg},{label:'Crash',data:xc,backgroundColor:xc_bg},{label:'Idle',data:xi,backgroundColor:xi_bg} ]
|
|
|
|
|
chart = new Chart(context, conf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
monitor.sandbox = {}
|
|
|
|
@ -342,9 +342,9 @@ monitor.sandbox.init = function () {
|
|
|
|
|
jx.dom.hide('inspect_sandbox')
|
|
|
|
|
var httpclient = HttpClient.instance()
|
|
|
|
|
httpclient.get(HTTP_CONTEXT+'/sandbox', function (x) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var r = JSON.parse(x.responseText)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (r.length > 0) {
|
|
|
|
|
jx.dom.show('sandbox')
|
|
|
|
|
monitor.sandbox.render(r);
|
|
|
|
@ -355,19 +355,19 @@ monitor.sandbox.init = function () {
|
|
|
|
|
}
|
|
|
|
|
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('')
|
|
|
|
|
var item = logs[logs.length -1]
|
|
|
|
|
jx.dom.set.value('sandbox_date', monitor.utils.get.dateTime(item))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var options = { width: $('#sandbox_status').width()-8, height: 'auto' }
|
|
|
|
|
options.data = jx.utils.patterns.visitor(logs, function (item) {
|
|
|
|
|
options.data = jx.utils.patterns.visitor(logs, function (item) {
|
|
|
|
|
if (item.value == 100) {
|
|
|
|
|
item.status = '<i class="fa fa-check" style="color:green"></i>'
|
|
|
|
|
} else {
|
|
|
|
|
item.status = '<i class="fa fa-download" style="color:black"></i>'
|
|
|
|
|
}
|
|
|
|
|
return item
|
|
|
|
|
return item
|
|
|
|
|
})
|
|
|
|
|
options.paging = true
|
|
|
|
|
options.pageSize = 4
|
|
|
|
@ -378,7 +378,7 @@ monitor.sandbox.render = function (logs) {
|
|
|
|
|
options.pagePrevText = '<i class="fa fa-chevron-left"></i>'
|
|
|
|
|
options.pageNextText = "<i class='fa fa-chevron-right small' title='Next'> </i>";
|
|
|
|
|
options.rowClass = function (item) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.value < 70) {
|
|
|
|
|
return 'bad'
|
|
|
|
|
} else if (item.value < 100) {
|
|
|
|
@ -395,7 +395,7 @@ monitor.sandbox.render = function (logs) {
|
|
|
|
|
dom.type = 'hidden'
|
|
|
|
|
dom.name = 'missing'
|
|
|
|
|
dom.value = JSON.stringify(item.missing)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form.action = HTTP_CONTEXT+'/download'
|
|
|
|
|
form.method = 'POST'
|
|
|
|
|
form.appendChild(dom)
|
|
|
|
@ -407,11 +407,11 @@ monitor.sandbox.render = function (logs) {
|
|
|
|
|
{name:"status",title:"",width:20},
|
|
|
|
|
{ name: 'label',title:'Virtual Environment Label',type:'text',css:'small',headercss:'small bold' },
|
|
|
|
|
{ name: 'value', title:'Completeness %',type: 'number', css: 'small', headercss: 'small bold' }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
var grid = $('#sandbox_status').jsGrid(options)
|
|
|
|
|
jx.dom.show('inspect_sandbox')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -427,7 +427,7 @@ monitor.folders.init = function () {
|
|
|
|
|
// item.id = id
|
|
|
|
|
data = data.concat(item)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
monitor.folders.render.init(data)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -436,20 +436,20 @@ monitor.folders.search.reset = function () {
|
|
|
|
|
jx.dom.set.value('folder_search', '')
|
|
|
|
|
var data = jx.dom.get.attribute('folder_search', 'data')
|
|
|
|
|
monitor.folders.render.summary(data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
monitor.folders.search.init = function(){
|
|
|
|
|
var term = jx.dom.get.value('folder_search')
|
|
|
|
|
var data = jx.dom.get.attribute('folder_search', 'data')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
term = term.replace(/ /g,'')
|
|
|
|
|
if (term.length == 0) {
|
|
|
|
|
monitor.folders.render.summary(data)
|
|
|
|
|
} else if (term.length > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = jx.utils.patterns.visitor(data, function (row) {
|
|
|
|
|
pattern = "(.*" + term + ".*)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (row.id.match(pattern)) {
|
|
|
|
|
return row
|
|
|
|
|
}
|
|
|
|
@ -473,7 +473,7 @@ monitor.folders.show.grid = function () {
|
|
|
|
|
$('#folder_plan').slideUp(function () {
|
|
|
|
|
$('#folder_summary').slideDown()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/***
|
|
|
|
|
* This function is designed to establish a folder clean up strategy i.e :
|
|
|
|
@ -491,7 +491,7 @@ monitor.folders.render.details = function (folder,data) {
|
|
|
|
|
var xy = r[i]
|
|
|
|
|
var mode = jx.math.mode(jx.utils.vector('x', xy))
|
|
|
|
|
var yvalues = jx.utils.patterns.visitor(xy, function (row) {
|
|
|
|
|
if (row.x == mode) {
|
|
|
|
|
if (row.x == mode) {
|
|
|
|
|
return row.y
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -514,7 +514,7 @@ monitor.folders.render.details = function (folder,data) {
|
|
|
|
|
prefix = 'size'
|
|
|
|
|
var mean = jx.math.sum(yvalues)
|
|
|
|
|
var max = 0// (mean + (1.5 * sd))
|
|
|
|
|
if (mean > 1000) {
|
|
|
|
|
if (mean > 1000) {
|
|
|
|
|
divide_by = 1000
|
|
|
|
|
units = 'GB'
|
|
|
|
|
} else {
|
|
|
|
@ -541,15 +541,15 @@ monitor.folders.render.details = function (folder,data) {
|
|
|
|
|
monitor.folders.show.plan()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jx.dom.set.value('folder_name', folder)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
monitor.folders.render.summary = function (data) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jx.dom.set.value('gridfolders', '')
|
|
|
|
|
var options = {
|
|
|
|
|
width: $('#gfolderframe').width()-8, height:'auto'
|
|
|
|
@ -562,15 +562,15 @@ monitor.folders.render.summary = function (data) {
|
|
|
|
|
options.pagerFormat= "{prev} Page {pageIndex} of {pageCount} {next}"
|
|
|
|
|
options.pagePrevText= '<i class="fa fa-chevron-left"></i>'
|
|
|
|
|
options.pageNextText= "<i class='fa fa-chevron-right small' title='Next'> </i>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options.data = data
|
|
|
|
|
options.rowClass = function (item, index,evt) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 'small'
|
|
|
|
|
}
|
|
|
|
|
options.rowClick = function(args){
|
|
|
|
|
// var item = args.item
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// age = jx.utils.patterns.visitor(item.details.age, function (row) {
|
|
|
|
|
// return {y:row[0],x:row[1]}
|
|
|
|
|
// })
|
|
|
|
@ -586,26 +586,26 @@ monitor.folders.render.summary = function (data) {
|
|
|
|
|
options.fields = [
|
|
|
|
|
{ name: 'id', type: 'text', title: "Host", headercss: "small bold", css: "small"},
|
|
|
|
|
{ name: 'name', type: 'text', title: "Folder Name", headercss: "small bold", css: "small"},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ name: "size", type: "number", title: "Folder Size", type: "number", headercss: "small bold" },
|
|
|
|
|
{ name: "count", type: "number", title: "File Count", type: "number", headercss: "small bold" }
|
|
|
|
|
]
|
|
|
|
|
var grid = $('#gridfolders').jsGrid(options) ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
monitor.menu = {}
|
|
|
|
|
monitor.menu.event = {}
|
|
|
|
|
monitor.menu.event.toggle = function () {
|
|
|
|
|
var dom = jx.dom.get.instance('menuframe')
|
|
|
|
|
var value = dom.style.marginLeft.trim()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (value==0 || value == "0px" || value == "") {
|
|
|
|
|
var width = -$(dom).width() - 10
|
|
|
|
|
$('#menuframe').animate({marginLeft:"-12%"})
|
|
|
|
|
var width = -$(dom).width() - 20
|
|
|
|
|
$('#menuframe').animate({marginLeft:"-20%"})
|
|
|
|
|
} else {
|
|
|
|
|
$('#menuframe').animate({marginLeft:"0"})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Socket handler, check for learning status
|
|
|
|
|