start templating

master
michael mead 7 years ago
parent 5b0274c9a2
commit 366c535a56

@ -59,7 +59,7 @@ def home():
try: try:
gReader = factory.instance(type=class_read,args=p) gReader = factory.instance(type=class_read,args=p)
apps = gReader.view('summary/nodes',key=p['uid']) apps = gReader.view('summary/nodes',key=p['uid'])
except Exception, e: except Exception, e:
print (e) print (e)
return render_template('dashboard.html',context=context,title=title,app_names=apps) return render_template('dashboard.html',context=context,title=title,app_names=apps)
@ -69,7 +69,6 @@ def get_nodes():
""" """
This function returns the labels of applications for every node registered This function returns the labels of applications for every node registered
@param None @param None
e.g: apps@zulu.org
""" """
r = [] r = []
try: try:
@ -83,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 @param node identifier e.g: apps@zulu.org <--------------------no it doesnt
""" """
r = [] r = []
try: try:
@ -174,11 +173,11 @@ def app_status() :
# #
print[nid,aid] print[nid,aid]
r = r[nid][aid] r = r[nid][aid]
except Exception,e: except Exception,e:
print e print e
return json.dumps(r) return json.dumps(r)
#@app.route('/get/<id>') #@app.route('/get/<id>')
#def procs(id): #def procs(id):
#try: #try:

@ -156,7 +156,16 @@
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for name in app_names %} {% for name in app_names %}
<div class="action"><i class="fa fa-angle-right"></i> {{name|safe}}</div> <div class="action" data-name="{{name}}" id="app_names"><i class="fa fa-angle-right"></i><a href='#'>{{name|safe}}</a>
<script type="text/javascript">onclick=function(){
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>

Loading…
Cancel
Save