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(): def get_apps():
""" """
This function returns the applications for a given node 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 = [] r = []
try: try:

@ -1,5 +1,12 @@
type = ['','info','success','warning','danger']; type = ['','info','success','warning','danger'];
function getNode(name){
var nodeName = {}
nodeName.name = name
console.log('nodename...', nodeName.name)
// dashboard.initChartist(nodeName)
}
dashboard = { dashboard = {
initPickColor: function(){ initPickColor: function(){
$('.pick-class-label').click(function(){ $('.pick-class-label').click(function(){
@ -17,11 +24,14 @@ dashboard = {
initChartist: function(){ initChartist: function(){
var getData = $.get('/1/app/usage/trend'); var getData = $.get('/1/app/usage/trend');
function loadDashboard(name){
console.log('loadDashboard...', name);
}
getData.done(function(results) { getData.done(function(results) {
var data = JSON.parse(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 node = data['apps@michaels-MBP'];
var app = node['chrome']; var app = node['chrome'];
var cpu = app['cpu']; var cpu = app['cpu'];

@ -155,22 +155,9 @@
<b class="caret"></b> <b class="caret"></b>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for name in app_names %} {% for name in app_names %}
<div class="action" data-name="{{name}}" id="app_names"><i class="fa fa-angle-right"></i><a href='#' <div class="action" data-name="{{name}}" id="app_names"><i class="fa fa-angle-right"></i>
onclick="loadDashboard({{ 'name|tojson' }});">{{name|safe}}</a> <a href='#' onclick="getNode('{{name}}')">{{name|safe}}</a></div>
<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>
{% endfor %} {% endfor %}
</ul> </ul>
</li> </li>

Loading…
Cancel
Save