[icinga-checkins] icinga.org: icinga-core/master: classic ui: move "add service/host comment" to the command box on extinfo.cgi, abandon remove all in favor of multiple comment delete #837

git at icinga.org git at icinga.org
Mon Jan 10 16:19:18 CET 2011


Module: icinga-core
Branch: master
Commit: 2fc2ef5112eb24c2354cc0b31b6f95c59a5d81ba
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=2fc2ef5112eb24c2354cc0b31b6f95c59a5d81ba

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Jan  5 10:58:48 2011 +0100

classic ui: move "add service/host comment" to the command box on extinfo.cgi, abandon remove all in favor of multiple comment delete #837

looks more smooth, and eases handling of comment add/delete.
remove all is not necessary anymore with multiple cmds.

thx Christoph and Ricardo for the pointers.

fixes #837

---

 Changelog     |    1 +
 cgi/extinfo.c |   34 +++++++++-------------------------
 2 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/Changelog b/Changelog
index 41315a9..066c95e 100644
--- a/Changelog
+++ b/Changelog
@@ -17,6 +17,7 @@ ENHANCEMENTS
 * classic ui: change default url target frame to main #1014
 * classic ui: add url_stylesheet_path to cgi.cfg to allow custom css path #898
 * classic ui: change color of unknown/unreachable state to more warm signalling purple #1029
+* classic ui: move "add service/host comment" to the command box on extinfo.cgi, abandon remove all in favor of multiple comment delete #837
 
 * core: add support for same host service dependencies with servicegroups (Mathieu Gagné) #928
 * core: allow eventbroker modules to override sending notifications (Matthieu Kermagoret) #1057
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index a95e6f8..b1083d6 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -1353,6 +1353,10 @@ void show_host_info(void){
 		else
 			printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Enable Flap Detection For This Host' TITLE='Enable Flap Detection For This Host'></td><td CLASS='command'><a href='%s?cmd_typ=%d&host=%s'>Enable flap detection for this host</a></td></tr>\n",url_images_path,ENABLED_ICON,CMD_CGI,CMD_ENABLE_HOST_FLAP_DETECTION,url_encode(host_name));
 
+                printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Add a new Host comment' TITLE='Add a new Host comment'></td><td CLASS='command'><a href='%s?cmd_typ=%d&host=%s'>",url_images_path,COMMENT_ICON,CMD_CGI,CMD_ADD_HOST_COMMENT,(display_type==DISPLAY_COMMENTS)?"":url_encode(host_name));
+                printf("Add a new Host comment</a></td>");
+
+
 		printf("</TABLE>\n");
 		}
         else if (is_authorized_for_read_only(&current_authdata)==TRUE){
@@ -1701,6 +1705,11 @@ void show_service_info(void){
 			printf("&service=%s'>Enable flap detection for this service</a></td></tr>\n",url_encode(service_desc));
 		        }
 
+                printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Add a new Service comment' TITLE='Add a new Service comment'></td><td CLASS='command'><a href='%s?cmd_typ=%d&host=%s&",url_images_path,COMMENT_ICON,CMD_CGI,CMD_ADD_SVC_COMMENT,(display_type==DISPLAY_COMMENTS)?"":url_encode(host_name));
+                printf("service=%s'>",(display_type==DISPLAY_COMMENTS)?"":url_encode(service_desc));
+                printf("Add a new Service comment</a></td>");
+
+
 		printf("</table>\n");
 		}
         else if (is_authorized_for_read_only(&current_authdata)==TRUE){
@@ -2503,31 +2512,6 @@ void show_comments(int type){
 		printf("<A NAME=%sCOMMENTS></A>\n",(type==HOST_COMMENT)?"HOST":"SERVICE");
 		printf("<DIV CLASS='commentTitle'>%s Comments</DIV>\n",(type==HOST_COMMENT)?"Host":"Service");
 
-		printf("<TABLE BORDER=0 align=center>\n");
-		printf("<tr CLASS='comment' valign=middle><td><img src='%s%s' border=0></td>",url_images_path,COMMENT_ICON);
-
-		if(type==HOST_COMMENT){
-			printf("<td><a href='%s?cmd_typ=%d&host=%s'>",CMD_CGI,CMD_ADD_HOST_COMMENT,(display_type==DISPLAY_COMMENTS)?"":url_encode(host_name));
-		}else{
-			printf("<td><a href='%s?cmd_typ=%d&host=%s&",CMD_CGI,CMD_ADD_SVC_COMMENT,(display_type==DISPLAY_COMMENTS)?"":url_encode(host_name));
-			printf("service=%s'>",(display_type==DISPLAY_COMMENTS)?"":url_encode(service_desc));
-			}
-		printf("Add a new %s comment</a></td>",(type==HOST_COMMENT)?"Host":"Service");
-
-		/* display delete all comments for single hosts or services */
-		if(display_type!=DISPLAY_COMMENTS) {
-			printf("<td><img src='%s%s' border=0 align=center></td>",url_images_path,DELETE_ICON);
-			if(type==HOST_COMMENT)
-				printf("<td><a href='%s?cmd_typ=%d&host=%s' CLASS='comment'>",CMD_CGI,CMD_DEL_ALL_HOST_COMMENTS,url_encode(host_name));
-			else{
-				printf("<td><a href='%s?cmd_typ=%d&host=%s&",CMD_CGI,CMD_DEL_ALL_SVC_COMMENTS,url_encode(host_name));
-				printf("service=%s' CLASS='comment'>",url_encode(service_desc));
-				}
-			printf("Delete all %s comments</a></td>",(type==HOST_COMMENT)?"Host":"Service");
-		}
-		printf("</tr>\n");
-		printf("</TABLE>\n");
-
 		printf("<form name='tableform%s' id='tableform%s'>",(type==HOST_COMMENT)?"host":"service",(type==HOST_COMMENT)?"host":"service");
 		printf("<input type=hidden name=buttonCheckboxChecked>");
 		printf("<input type=hidden name='hiddencmdfield' value=%d>",(type==HOST_COMMENT)?CMD_DEL_HOST_COMMENT:CMD_DEL_SVC_COMMENT);





More information about the icinga-checkins mailing list