[icinga-checkins] icinga.org: icinga-core/r1.3: classic ui: don't show pause/ continue urls on non-refreshable pages

git at icinga.org git at icinga.org
Wed Mar 30 13:29:38 CEST 2011


Module: icinga-core
Branch: r1.3
Commit: b734b4d89562f83a98c3b1f3feeddf3fcdb4ed8f
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=b734b4d89562f83a98c3b1f3feeddf3fcdb4ed8f

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Mon Mar 14 16:52:56 2011 +0100

classic ui: don't show pause/continue urls on non-refreshable pages

---

 Changelog      |    1 +
 cgi/cgiutils.c |   20 +++++++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Changelog b/Changelog
index bf0b23c..412a098 100644
--- a/Changelog
+++ b/Changelog
@@ -12,6 +12,7 @@ FIXES
 * classic ui: Fixing tooltip's in status.cgi, not showing messages with carriage return #1244
 * classic ui: cmd.cgi: acknowledgement multiline comment -> command not being processed #1257
 * classic ui: fix display_name survive reconfiguration and is use instead of host_name in classic ui #1282
+* classic ui: don't show pause/continue urls on non-refreshable pages
 
 
 1.3.0 - 16/02/2011
diff --git a/cgi/cgiutils.c b/cgi/cgiutils.c
index 6d6daa6..58928b9 100644
--- a/cgi/cgiutils.c
+++ b/cgi/cgiutils.c
@@ -833,6 +833,7 @@ void document_header(int cgi_id, int use_stylesheet){
 			cgi_css         = AVAIL_CSS;
 			cgi_title       = "Availability";
 			cgi_body_class  = "avail";
+			refresh         = FALSE;
 			break;
 		case CMD_CGI_ID:
 			cgi_name        = CMD_CGI;
@@ -858,12 +859,14 @@ void document_header(int cgi_id, int use_stylesheet){
                         cgi_css         = HISTOGRAM_CSS;
                         cgi_title       = "Histogram";
                         cgi_body_class  = "histogram";
+			refresh         = FALSE;
                         break;
                 case HISTORY_CGI_ID:
                         cgi_name        = HISTORY_CGI;
                         cgi_css         = HISTORY_CSS;
                         cgi_title       = "History";
                         cgi_body_class  = "history";
+			refresh         = FALSE;
                         break;
                 case NOTIFICATIONS_CGI_ID:
                         cgi_name        = NOTIFICATIONS_CGI;
@@ -1912,13 +1915,16 @@ void display_info_table(char *title,int refresh, authdata *current_authdata, int
 
 	printf("Last Updated: %s<BR>\n",date_time);
 
-	/* decide if refresh is paused or not */
-	if(refresh==TRUE) {
-		/* if refresh, add paused query to url and set location.href */
-		printf("Updated every %d seconds <small>[<a href=\"javascript:window.location.href += ((window.location.toString().indexOf('?') != -1) ? '&' : '?') + 'paused'\">pause</a>]</small><br>\n",refresh_rate);
-	} else {
-		/* if no refresh, remove the paused query from url and set location.href */
-		printf("Update is paused <small>[<a href=\"javascript:window.location.href = window.location.href.replace(/[\?&]paused/,'')\">continue</a>]</small><br>\n");
+	/* don't show in historical (long) listings */
+	if(CGI_ID!=SHOWLOG_CGI_ID && CGI_ID!=TRENDS_CGI_ID && CGI_ID!=HISTOGRAM_CGI_ID && CGI_ID!=HISTORY_CGI_ID && CGI_ID!=AVAIL_CGI_ID){
+		/* decide if refresh is paused or not */
+		if(refresh==TRUE) {
+			/* if refresh, add paused query to url and set location.href */
+			printf("Updated every %d seconds <small>[<a href=\"javascript:window.location.href += ((window.location.toString().indexOf('?') != -1) ? '&' : '?') + 'paused'\">pause</a>]</small><br>\n",refresh_rate);
+		} else {
+			/* if no refresh, remove the paused query from url and set location.href */
+			printf("Update is paused <small>[<a href=\"javascript:window.location.href = window.location.href.replace(/[\?&]paused/,'')\">continue</a>]</small><br>\n");
+		}
 	}
 
 	printf("%s %s - <A HREF='http://www.icinga.org' TARGET='_new' CLASS='homepageURL'>www.icinga.org</A><BR>\n", PROGRAM_NAME, PROGRAM_VERSION);





More information about the icinga-checkins mailing list