start getting nodename passed to init function

community
michael mead 7 years ago
parent 9b25ed97b0
commit 11aaab210f

@ -82,7 +82,7 @@ def get_nodes():
def get_apps():
"""
This function returns the applications for a given node
@param node identifier e.g: apps@zulu.org <--------------------no it doesnt
@param node identifier e.g: apps@zulu.org
"""
r = []
try:

@ -1,5 +1,12 @@
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(){
@ -17,11 +24,14 @@ dashboard = {
initChartist: function(){
var getData = $.get('/1/app/usage/trend');
function loadDashboard(name){
console.log('loadDashboard...', name);
}
getData.done(function(results) {
var data = JSON.parse(results)
// if (typeof nodeName === 'undefined'){
// console.log("undefined nodename.........")
// } else {
// var node = data[nodeName.name]
// console.log('data.name..', data[name])
// }
var node = data['apps@michaels-MBP'];
var app = node['chrome'];
var cpu = app['cpu'];

@ -156,21 +156,8 @@
</a>
<ul class="dropdown-menu">
{% for name in app_names %}
<div class="action" data-name="{{name}}" id="app_names"><i class="fa fa-angle-right"></i><a href='#'
onclick="loadDashboard({{ 'name|tojson' }});">{{name|safe}}</a>
<script type="text/javascript">
// onclick=loadDashboard({{ name|tojson }})
// {
// console.log('name...', "{{ name }}") //this works, but returns same variable......
//
// var appName = $('#app_names').data("name");
// console.log('name...', appName )
// }
</script>
</div>
<div class="action" data-name="{{name}}" id="app_names"><i class="fa fa-angle-right"></i>
<a href='#' onclick="getNode('{{name}}')">{{name|safe}}</a></div>
{% endfor %}
</ul>
</li>

Loading…
Cancel
Save