|
|
@ -31,16 +31,18 @@ monitor.processes.init = function(x){
|
|
|
|
monitor.processes.render = function(label,data) {
|
|
|
|
monitor.processes.render = function(label,data) {
|
|
|
|
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>'}
|
|
|
|
data = jx.utils.patterns.visitor(data,function(row){
|
|
|
|
data = jx.utils.patterns.visitor(data,function(row){
|
|
|
|
var m = row.memory_usage >0
|
|
|
|
console.log(row)
|
|
|
|
var c = row.cpu_usage > 0
|
|
|
|
row.status = status[row.status]
|
|
|
|
var r = row.memory_available > 0
|
|
|
|
// var m = row.memory_usage >0
|
|
|
|
if ( r && c && m) {
|
|
|
|
// var c = row.cpu_usage > 0
|
|
|
|
row.status = status['running']
|
|
|
|
// var r = row.memory_available > 0
|
|
|
|
}else if (r && (!m || !c) ){
|
|
|
|
// if ( r && c && m) {
|
|
|
|
row.status = status['idle']
|
|
|
|
// row.status = status['running']
|
|
|
|
}else if (!r){
|
|
|
|
// }else if (r && (!m || !c) ){
|
|
|
|
row.status = status['crash']
|
|
|
|
// row.status = status['idle']
|
|
|
|
}
|
|
|
|
// }else if (!r){
|
|
|
|
|
|
|
|
// row.status = status['crash']
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
return row
|
|
|
|
return row
|
|
|
|
})
|
|
|
|
})
|
|
|
|