[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

Naparuba naparuba at gmail.com
Tue Feb 28 22:08:51 UTC 2012


The following commit has been merged in the debian/master branch:
commit 2ea18542e1d31d12ffde7cfbc71535582b42bcff
Author: Naparuba <naparuba at gmail.com>
Date:   Thu Dec 15 14:55:13 2011 +0100

    Add : /mobile/problems page.

diff --git a/shinken/webui/plugins/mobile/mobile.py b/shinken/webui/plugins/mobile/mobile.py
index 225c583..91533bf 100644
--- a/shinken/webui/plugins/mobile/mobile.py
+++ b/shinken/webui/plugins/mobile/mobile.py
@@ -59,7 +59,22 @@ def impacts():
     return {'app' : app, 'user' : user, 'impacts' : all_imp_impacts}
 
 
+def problems():
+    # First we look for the user sid
+    # so we bail out if it's a false one
+    user = app.get_user_auth()
+
+    if not user:
+        redirect("/mobile/")
+        return
+
+    all_pbs = app.datamgr.get_all_problems()
+
+    return {'app' : app, 'user' : user, 'problems' : all_pbs}
+
+
 pages = {main : { 'routes' : ['/mobile/main'], 'view' : 'mobile_main', 'static' : True},
          impacts : { 'routes' : ['/mobile/impacts'], 'view' : 'mobile_impacts', 'static' : True},
+         problems : { 'routes' : ['/mobile/problems'], 'view' : 'mobile_problems', 'static' : True},
          }
 
diff --git a/shinken/webui/plugins/mobile/views/mobile_problems.tpl b/shinken/webui/plugins/mobile/views/mobile_problems.tpl
new file mode 100644
index 0000000..08c7583
--- /dev/null
+++ b/shinken/webui/plugins/mobile/views/mobile_problems.tpl
@@ -0,0 +1,44 @@
+
+%helper = app.helper
+%datamgr = app.datamgr
+
+%rebase layout globals(), title="IT problems", js=['mobile/js/mobile_main.js'], css=['mobile/css/main.css', 'mobile/css/problems.css']
+
+<div id="all">
+
+<h2>IT Problems</h2>
+
+
+
+<div class="problems">
+  %for pb in problems:
+    <div class="problem">
+      <h2 class="state_{{pb.state.lower()}}">
+      %for j in range(2, pb.business_impact):
+	<img src="/static/images/star.png">
+      %end
+
+<img style="width : 20px; height:20px" src="{{helper.get_icon_state(pb)}}" />{{pb.state}}: {{pb.get_full_name()}}</h2>
+		
+   
+    %if len([imp for imp in pb.impacts if imp.business_impact > 2]) > 0:
+      <p>Important impacts</p>
+      <div class="impacts">
+	%for imp in [imp for imp in pb.impacts if imp.business_impact > 2]:
+	<div class="impact">
+	  <p>
+	    <img class="impact_img" src="{{helper.get_icon_state(imp)}}" /> {{imp.get_full_name()}} is {{imp.state}} since {{helper.print_duration(imp.last_state_change, just_duration=True, x_elts=2)}}
+	  </p>
+	</div>
+	%end
+      </div>
+    %end
+
+
+    </div>
+  %end
+</div>
+
+
+
+</div>

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list