start reset

community
michael.mead 7 years ago
parent 0ec0c84117
commit 8a937a61f8

@ -1,5 +1,4 @@
aniso8601==1.2.0
certifi==2017.11.5
chardet==3.0.4
click==6.6
couchdbkit==0.6.5
@ -23,7 +22,6 @@ MarkupSafe==0.23
ngram==3.3.0
numpy==1.11.3
pika==0.10.0
pkg-resources==0.0.0
pycparser==2.18
pyOpenSSL==17.3.0
python-dateutil==2.6.0

@ -1,12 +1,5 @@
type = ['','info','success','warning','danger'];
function getNode(name){
var nodeName = {}
nodeName.name = name
console.log('nodename...', nodeName.name)
dashboard.initChartist(nodeName)
}
dashboard = {
initPickColor: function(){
$('.pick-class-label').click(function(){
@ -22,33 +15,16 @@ dashboard = {
});
},
initChartist: function(nodeName){
initChartist: function(){
var getData = $.get('/1/app/usage/trend');
getData.done(function(results) {
var data = JSON.parse(results)
if (typeof nodeName === 'undefined'){
var node = data['apps@michaels-MBP'];
console.log("undefined nodename.........")
} else {
console.log('this is nodeName...', nodeName)
console.log('this is nodeName.name...', nodeName.name)
var node = data[nodeName.name]
console.log('data.name..', data[name])
}
var app = node['chrome'];
var cpu = app['cpu'];
var memory_used = app['memory_used'];
console.log('data...',data)
console.log('node...',node)
console.log('app...',app)
console.log('cpu...',cpu)
console.log('memory_used...', memory_used)
// monitoring apps chart
var dataChart = {
labels: ['24','23','22','21','20','19','18','17','16','15','14','13','12','11','10','9','8','7','6','5','4','3','2','1' ],
series: [cpu, memory_used, [0,0.1,0.3,0.2,0.4,0.6,0.2], ] // TODO: Check the order, the graph is by index not name.
series: [[1,2,3], [4,5,6], [1,2,3,5], ] // TODO: Check the order, the graph is by index not name.
};
dataChartArray = dataChart.series
@ -86,7 +62,7 @@ dashboard = {
// cpu and memory --------------------------
var data = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
series: [cpu, memory_used]
series: [[1,2,3,4], [5,6,7]]
};
@ -111,18 +87,18 @@ dashboard = {
Chartist.Line('#chartActivity', data, options, responsiveOptions);
var getStatus = $.get('1/get/summary/app_status');
getStatus.done(function(results) {
var data = JSON.parse(results)
let getStatusList = []
getStatusList.push(data.idle)
getStatusList.push(data.crash)
getStatusList.push(data.running)
Chartist.Pie('#chartPreferences', {
labels: getStatusList,
series: getStatusList
},{donut:true});
}) /// end getStatus
// var getStatus = $.get('1/get/summary/app_status');
// getStatus.done(function(results) {
// var data = JSON.parse(results)
// let getStatusList = []
// getStatusList.push(data.idle)
// getStatusList.push(data.crash)
// getStatusList.push(data.running)
// Chartist.Pie('#chartPreferences', {
// labels: getStatusList,
// series: getStatusList
// },{donut:true});
// }) /// end getStatus
})
},
// End chartist function

@ -46,39 +46,40 @@
<!-- Dashboard DEMO methods, don't include it in your project! -->
<script src="{{context}}/static/js/dashboard.js"></script>
<script src="{{context}}/static/js/jx/dom.js"></script>
<script src="{{context}}/static/js/jx/rpc.js"></script>
<script src="{{context}}/static/js/jx/utils.js"></script>
{# <script src="{{context}}/static/js/jx/dom.js"></script>#}
{# <script src="{{context}}/static/js/jx/rpc.js"></script>#}
{# <script src="{{context}}/static/js/jx/utils.js"></script>#}
<script type="text/javascript">
var URI_CONTEXT="{{context}}"
$(document).ready(function(){
var lobservers = [
g.summary.factory('/1/get/summary/app_resources',function(r){
//r = JSON.parse(r.responseText)
jx.dom.set.value('total_cpu',r.cpu_usage)
jx.dom.set.value('total_mem',r.memory_usage)
jx.dom.set.value('mem_units',r.units)
}),
g.summary.factory('/1/get/summary/folder_size',function(r){
//console.log(r.responseText)
//r = JSON.parse(r.responseText)
if (r.length == 0){
r.size = "0.0"
r.units = 'MB'
}
jx.dom.set.value('total_folder_size',r.size)
jx.dom.set.value('folder_units',r.units)
}),
g.summary.factory('/1/get/summary/app_status',function(r){
jx.dom.set.value('total_app_crashes',r.crash)
})
]
jx.utils.patterns.observer(lobservers,"init")
{#var lobservers = [#}
{# g.summary.factory('/1/get/summary/app_resources',function(r){#}
{##}
{# //r = JSON.parse(r.responseText)#}
{# jx.dom.set.value('total_cpu',r.cpu_usage)#}
{# jx.dom.set.value('total_mem',r.memory_usage)#}
{# jx.dom.set.value('mem_units',r.units)#}
{##}
{# }),#}
{# g.summary.factory('/1/get/summary/folder_size',function(r){#}
{# //console.log(r.responseText)#}
{# //r = JSON.parse(r.responseText)#}
{# if (r.length == 0){#}
{# r.size = "0.0"#}
{# r.units = 'MB'#}
{# }#}
{# jx.dom.set.value('total_folder_size',r.size)#}
{# jx.dom.set.value('folder_units',r.units)#}
{# }),#}
{# g.summary.factory('/1/get/summary/app_status',function(r){#}
{##}
{# jx.dom.set.value('total_app_crashes',r.crash)#}
{# })#}
{#]#}
{##}
{#jx.utils.patterns.observer(lobservers,"init")#}
//TODO Do we need the above JX stuff ?
dashboard.initChartist();
});

Loading…
Cancel
Save