[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: fixed html tag in showlog. cgi timebreak. Added num entries #1172

git at icinga.org git at icinga.org
Sat Apr 30 13:14:29 CEST 2011


Module: icinga-core
Branch: mfriedrich/core
Commit: 228334a0c6b8ff9f5b7b5d3043462d56c2091ef5
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=228334a0c6b8ff9f5b7b5d3043462d56c2091ef5

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Fri Apr 29 01:17:29 2011 +0200

fixed html tag in showlog.cgi timebreak. Added num entries #1172

refs: #1172

hope its renders faster now

---

 cgi/showlog.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/cgi/showlog.c b/cgi/showlog.c
index 6da5df4..536e6c2 100644
--- a/cgi/showlog.c
+++ b/cgi/showlog.c
@@ -553,6 +553,7 @@ void display_logentries() {
 	int json_start=TRUE;
 	struct tm *time_ptr=NULL;
 	logentry *temp_entry=NULL;
+	int count=0;
 
 
 	/* Add default filters */
@@ -862,7 +863,8 @@ void display_logentries() {
 			current_message_date[sizeof(current_message_date)-1]='\x0';
 
 			if(strcmp(last_message_date,current_message_date)!=0 && display_timebreaks==TRUE){
-				printf("<BR CLEAR='all'>\n");
+				printf("</DIV>\n");
+				printf("<BR>\n");
 				printf("<DIV>\n");
 				printf("<table border=0 width=99%% CLASS='dateTimeBreak' align=center><tr>");
 				printf("<td width=40%%><hr width=100%%></td>");
@@ -870,7 +872,7 @@ void display_logentries() {
 				printf("<td width=40%%><hr width=100%%></td>");
 				printf("</tr></table>\n");
 				printf("</DIV>\n");
-				printf("<BR CLEAR='all'><DIV CLASS='logEntries'>\n");
+				printf("<BR><DIV CLASS='logEntries'>\n");
 				strncpy(last_message_date,current_message_date,sizeof(last_message_date));
 				last_message_date[sizeof(last_message_date)-1]='\x0';
 			}
@@ -900,20 +902,21 @@ void display_logentries() {
 				printf("%s%s%s\n",csv_data_enclosure,temp_entry->entry_text,csv_data_enclosure);
 			}else{
 				if(display_frills==TRUE)
-					printf("<img align='left' src='%s%s' alt='%s' title='%s'>",url_images_path,image,image_alt,image_alt);
+					printf("<img align=left src='%s%s' alt='%s' title='%s'>",url_images_path,image,image_alt,image_alt);
 				printf("[%s] %s",date_time,(temp_entry->entry_text==NULL)?"":html_encode(temp_entry->entry_text,FALSE));
 				if(enable_splunk_integration==TRUE){
 					printf("   ");
 					display_splunk_generic_url(temp_entry->entry_text,2);
 				}
-				printf("<br clear='all'>\n");
+				printf("<br clear=all>\n");
 			}
 
 			user_has_seen_something=TRUE;
+			count++;
 		}
 
 		if(content_type!=CSV_CONTENT && content_type!=JSON_CONTENT){
-			printf("</DIV><HR>\n");
+			printf("</DIV><br><div align=center>%d entries displayed</div><HR>\n",count);
 		}else if (content_type==JSON_CONTENT)
 			printf("\n]\n");
 





More information about the icinga-checkins mailing list