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

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


The following commit has been merged in the debian/master branch:
commit 2ee9a644bc3465dc63b372f32379b9854c5bbb62
Author: Naparuba <naparuba at gmail.com>
Date:   Tue Dec 13 15:52:27 2011 +0100

    Add : left/right effect on the mobile impacts page.

diff --git a/shinken/webui/plugins/mobile/htdocs/css/impacts.css b/shinken/webui/plugins/mobile/htdocs/css/impacts.css
index 512452b..3811d11 100644
--- a/shinken/webui/plugins/mobile/htdocs/css/impacts.css
+++ b/shinken/webui/plugins/mobile/htdocs/css/impacts.css
@@ -1,3 +1,9 @@
+
+.contains{
+    positon : absolute;
+    left : 150px;
+}
+
 .impacts{
     positon : absolute;
 }
diff --git a/shinken/webui/htdocs/js/reload.js b/shinken/webui/plugins/mobile/htdocs/js/mobile_impacts.js
similarity index 50%
copy from shinken/webui/htdocs/js/reload.js
copy to shinken/webui/plugins/mobile/htdocs/js/mobile_impacts.js
index 6a9ed83..0044805 100644
--- a/shinken/webui/htdocs/js/reload.js
+++ b/shinken/webui/plugins/mobile/htdocs/js/mobile_impacts.js
@@ -22,26 +22,57 @@
 */
 
 
-/* By default, we set the page to reload each 60s*/
-var refresh_timeout = 60;
+var offset = 100;
 
-/* Each second, we check for timeout and restart page */
-function check_refresh(){
-    if(refresh_timeout < 0){
-	location.assign(location.href);
+var nb_impacts = 0;
+var current_idx = 0;
+
+function focus_on(idx){
+    
+
+    var first_right = $('impact-1');
+    if(first_right != null){
+	first_right.style.opacity = '0.7';
     }
-    refresh_timeout = refresh_timeout - 1;    
+
+    // And make others nearly disapears
+    for(var j=0;j<nb_impacts;j++){
+	var impact = $('impact-'+j);
+	if(j == idx){
+	    impact.style.opacity = '1';
+	    impact.style.left = ''+offset+'px';
+	}else if(j == idx-1 || j == idx+1){
+	    impact.style.opacity = '0.7';
+	    impact.style.left = ''+((j-idx)*250+offset)+'px';
+	}else{
+	    impact.style.opacity = '0.1';
+	    impact.style.left = ''+((j-idx)*250+offset)+'px';
+	}
+    }
+    
 }
 
 
-/* Someone ask us to reinit the refresh so the user will have time to
-   do some thigns like ask actions or something like that */
-function reinit_refresh(){
-    refresh_timeout = 60;
+function go_left(){
+    if(current_idx > 0){
+	current_idx -= 1;
+	focus_on(current_idx);
+    }
+}
+
+function go_right(){
+    if(current_idx < nb_impacts-1){
+	current_idx += 1;
+	focus_on(current_idx);
+    }
 }
 
-/* We will check timeout each 1s*/
+
 window.addEvent('domready', function(){
-	setInterval("check_refresh();", 1000); 
-    });
 
+    // First we make opacity low for distant
+    var all_impacts = $$('.impact');
+    nb_impacts = all_impacts.length;
+
+    focus_on(0);
+});
\ No newline at end of file
diff --git a/shinken/webui/plugins/mobile/views/mobile_impacts.tpl b/shinken/webui/plugins/mobile/views/mobile_impacts.tpl
index 30199c5..bfe3ba2 100644
--- a/shinken/webui/plugins/mobile/views/mobile_impacts.tpl
+++ b/shinken/webui/plugins/mobile/views/mobile_impacts.tpl
@@ -1,5 +1,8 @@
 
-%rebase layout globals(), title="Tactical view", js=['mobile/js/mobile_main.js'], css=['mobile/css/main.css', 'mobile/css/impacts.css']
+%helper = app.helper
+%datamgr = app.datamgr
+
+%rebase layout globals(), title="Tactical view", js=['mobile/js/mobile_main.js', 'mobile/js/mobile_impacts.js'], css=['mobile/css/main.css', 'mobile/css/impacts.css']
 
 <div id="all">
 <div> <h1> Shinken business apps</h1> </div>
@@ -8,13 +11,32 @@
 
 
 
-<img src="/static/images/state_critical.png" >
-<a href="#" onclick="slide_and_go('/mobile/impacts');"><img src="/static/images/next.png"/></a>
+<a href="#" onclick="go_left();"><img src="/static/images/previous.png"/></a>
+<a href="#" onclick="go_right();"><img src="/static/images/next.png"/></a>
+<br/>
 %i = 0
+
 <div class="impacts">
-  %for imp in impacts:
-    <div class="impact" style="left:{{i*250}}px">
-      <p class="{{imp.state.lower()}}">{{imp.get_full_name()}} is {{imp.state}}</p>
+  %for impact in impacts:
+    <div class="impact" id="impact-{{i}}" style="left:{{i*250}}px;">
+      <p class="{{impact.state.lower()}}">{{impact.get_full_name()}} is {{impact.state}}</p>
+
+      %for j in range(2, impact.business_impact):
+      <div class="criticity-inpb-icon-{{j-1}}">
+	<img src="/static/images/star.png">
+      </div>
+      %end
+      <h2 class="state_{{impact.state.lower()}}"><img style="width : 64px; height:64px" src="{{helper.get_icon_state(impact)}}" />{{impact.state}}: {{impact.get_full_name()}}</h2>
+		
+    %if len(impact.parent_dependencies) > 0:
+      <a id="togglelink-{{impact.get_dbg_name()}}" href="javascript:toggleBusinessElt('{{impact.get_dbg_name()}}')"> {{!helper.get_button('Show dependency tree', img='/static/images/expand.png')}}</a>
+      <div class="clear"></div>
+      {{!helper.print_business_rules(datamgr.get_business_parents(impact))}}
+    %end  
+
+
+
+
     </div>
     %i += 1
   %end

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list