git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0839c08
)
make nagios default to (select a controller)
author
Scott Baker
<smbaker@gmail.com>
Tue, 27 Jan 2015 06:12:40 +0000
(22:12 -0800)
committer
Scott Baker
<smbaker@gmail.com>
Tue, 27 Jan 2015 06:12:40 +0000
(22:12 -0800)
planetstack/core/dashboard/views/home.py
patch
|
blob
|
history
diff --git
a/planetstack/core/dashboard/views/home.py
b/planetstack/core/dashboard/views/home.py
index
6f57666
..
3084c0e
100644
(file)
--- a/
planetstack/core/dashboard/views/home.py
+++ b/
planetstack/core/dashboard/views/home.py
@@
-90,10
+90,11
@@
class DashboardDynamicView(TemplateView):
url = view.url
body = body + '<div id="dashtab-%d">\n' % i
if (view.controllers.all().count()>0):
url = view.url
body = body + '<div id="dashtab-%d">\n' % i
if (view.controllers.all().count()>0):
- body = body + '<select id="dashselect-%d">' % i;
+ body = body + 'Controller: <select id="dashselect-%d">' % i;
+ body = body + '<option value="None">(select a controller)</option>';
for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
body = body + '<option value="%d">%s</option>' % (j, controllerdashboard.controller.name)
for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
body = body + '<option value="%d">%s</option>' % (j, controllerdashboard.controller.name)
- body = body + '</select>'
+ body = body + '</select>
<hr>
'
for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
body = body + '<script type="text/template" id="dashtemplate-%d-%d">\n%s\n</script>\n' % (i,j, self.embedDashboard(controllerdashboard.url));
for j,controllerdashboard in enumerate(view.controllerdashboardviews.all()):
body = body + '<script type="text/template" id="dashtemplate-%d-%d">\n%s\n</script>\n' % (i,j, self.embedDashboard(controllerdashboard.url));
@@
-103,11
+104,15
@@
class DashboardDynamicView(TemplateView):
body = body + """<script>
$("#dashselect-%d").change(function() {
v=$("#dashselect-%d").val();
body = body + """<script>
$("#dashselect-%d").change(function() {
v=$("#dashselect-%d").val();
+ if (v=="None") {
+ $("#dashcontent-%d").html("");
+ return;
+ }
$("#dashcontent-%d").html( $("#dashtemplate-%d-" + v).html() );
});
$("#dashcontent-%d").html( $("#dashtemplate-%d-" + v).html() );
});
- $("#dashcontent-%d").html( $("#dashtemplate-%d-0").html() );
+
//
$("#dashcontent-%d").html( $("#dashtemplate-%d-0").html() );
</script>
</script>
- """ % (i,i,i,i,i,i);
+ """ % (i,i,i,i,i,i
,i
);
else:
body = body + self.embedDashboard(url)
body = body + '</div>\n'
else:
body = body + self.embedDashboard(url)
body = body + '</div>\n'