[icinga-checkins] icinga.org: icinga-core/test/cgis: classi-ui: fixed some stuff in lost commit for modified attributes #2473, #2474

git at icinga.org git at icinga.org
Tue Apr 24 17:05:02 CEST 2012


Module: icinga-core
Branch: test/cgis
Commit: b37cbf278f2bd709b35e2ea4bf1fb9a51ed057ec
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=b37cbf278f2bd709b35e2ea4bf1fb9a51ed057ec

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Tue Apr 24 16:55:59 2012 +0200

classi-ui: fixed some stuff in lost commit for modified attributes #2473, #2474

refs: #2473
refs: #2474

* added Changelog entry I forgot to add earlier
* removed compiler errors for extinfo.c and idoutils/logging.c
* added "Reset Modified Attributes" command to
  host and service command list in status.cgi
* remove left over line for debugging.

---

 Changelog                     |    1 +
 cgi/cmd.c                     |   13 ++++++++-----
 cgi/extinfo.c                 |    4 ++--
 cgi/status.c                  |    2 ++
 module/idoutils/src/logging.c |    1 -
 5 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/Changelog b/Changelog
index 51b5b03..e2db3dd 100644
--- a/Changelog
+++ b/Changelog
@@ -95,6 +95,7 @@ FIXES
 * classic ui: fixed Availability Records Break if JavaScript is disabled #2412 - RB
 * classic ui: fixed Truncated HTML table when displaying outages in outages.cgi #2323 - RB
 * classic ui: fixed Log File Navigation in current/ealier/recent archive clarification #2441 - RB
+* classic ui: fixed Extra leading space in status.cgi CSV output #2535 - RB
 
 * idoutils: fix ORA-00913 too many values when MERGE INTO eventhandlers #2319 - MF
 * idoutils: change standard string escaping for postgresql queries to use the E'foo' notation #1974 - MF
diff --git a/cgi/cmd.c b/cgi/cmd.c
index b8becbc..e38534c 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -1872,16 +1872,20 @@ void request_command_data(int cmd) {
 
         case CMD_CHANGE_HOST_MODATTR:
 		print_object_list(PRINT_HOST_LIST);
-		printf("<tr><td COLSPAN=\"2\"> </td></tr>\n");
+		print_form_element(PRINT_COMMON_HEADER, cmd);
 		printf("<tr class=\"statusEven\"><td width=\"50%%\" style=\"font-weight:bold;\">Modified Attributes:</td>");
-		printf("<td><INPUT TYPE='HIDDEN' NAME='attr' VALUE='%lu'>%lu</td></tr>\n", attr, attr);
+		printf("<td><INPUT TYPE='HIDDEN' NAME='attr' VALUE='%lu'>", attr);
+		print_modified_attributes(HTML_CONTENT, CMD_CGI, attr);
+		printf("</td></tr>\n");
 		break;
 
         case CMD_CHANGE_SVC_MODATTR:
 		print_object_list(PRINT_SERVICE_LIST);
-		printf("<tr><td COLSPAN=\"2\"> </td></tr>\n");
+		print_form_element(PRINT_COMMON_HEADER, cmd);
 		printf("<tr class=\"statusEven\"><td width=\"50%%\" style=\"font-weight:bold;\">Modified Attributes:</td>");
-		printf("<td><INPUT TYPE='HIDDEN' NAME='attr' VALUE='%lu'>%lu</td></tr>\n", attr, attr);
+		printf("<td><INPUT TYPE='HIDDEN' NAME='attr' VALUE='%lu'>", attr);
+		print_modified_attributes(HTML_CONTENT, CMD_CGI, attr);
+		printf("</td></tr>\n");
 		break;
 
 	default:
@@ -2970,7 +2974,6 @@ int commit_command(int cmd) {
                                 continue;
 			if (is_authorized[x])
 				submit_result[x] = cmd_submitf(cmd, "%s;%s;%lu", commands[x].host_name, commands[x].description, attr);
-		printf("hst: %s, svc: %s, attr: %lu x: %d", commands[x].host_name, commands[x].description, attr, x);
 		}
 		break;
 
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index 460acff..92dfe4a 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -1682,7 +1682,7 @@ void show_host_info(void) {
 			printf("Add a new Host comment</a></td>");
 
                         /* allow modified attributes to be reset */
-                        printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Reset Modified Attributes' TITLE='Reset Modified Attributes'></td><td CLASS='command'><a href='%s?cmd_typ=%d&attr=%lu&host=%s'>", url_images_path, DISABLED_ICON, CMD_CGI, CMD_CHANGE_HOST_MODATTR, MODATTR_NONE, (display_type == DISPLAY_COMMENTS) ? "" : url_encode(host_name));
+                        printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Reset Modified Attributes' TITLE='Reset Modified Attributes'></td><td CLASS='command'><a href='%s?cmd_typ=%d&attr=%d&host=%s'>", url_images_path, DISABLED_ICON, CMD_CGI, CMD_CHANGE_HOST_MODATTR, MODATTR_NONE, (display_type == DISPLAY_COMMENTS) ? "" : url_encode(host_name));
                         printf("Reset Modified Attributes</a></td>");
 
 			printf("</TABLE>\n");
@@ -2135,7 +2135,7 @@ void show_service_info(void) {
 			printf("Add a new Service comment</a></td>");
 
 			/* allow modified attributes to be reset */
-			printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Reset Modified Attributes' TITLE='Reset Modified Attributes'></td><td CLASS='command'><a href='%s?cmd_typ=%d&attr=%lu&host=%s&", url_images_path, DISABLED_ICON, CMD_CGI, CMD_CHANGE_SVC_MODATTR, MODATTR_NONE, (display_type == DISPLAY_COMMENTS) ? "" : url_encode(host_name));
+			printf("<tr CLASS='command'><td><img src='%s%s' border=0 ALT='Reset Modified Attributes' TITLE='Reset Modified Attributes'></td><td CLASS='command'><a href='%s?cmd_typ=%d&attr=%d&host=%s&", url_images_path, DISABLED_ICON, CMD_CGI, CMD_CHANGE_SVC_MODATTR, MODATTR_NONE, (display_type == DISPLAY_COMMENTS) ? "" : url_encode(host_name));
 			printf("service=%s'>", (display_type == DISPLAY_COMMENTS) ? "" : url_encode(service_desc));
 			printf("Reset Modified Attributes</a></td>");
 
diff --git a/cgi/status.c b/cgi/status.c
index a27bb15..feb51d9 100644
--- a/cgi/status.c
+++ b/cgi/status.c
@@ -6588,6 +6588,7 @@ void show_servicecommand_table(void) {
 		printf("<option value='%d' title='%s%s'>Enable Event Handler For Checked Service(s)</option>\n", CMD_ENABLE_SVC_EVENT_HANDLER, url_images_path, ENABLED_ICON);
 		printf("<option value='%d' title='%s%s'>Disable Flap Detection For Checked Service(s)</option>\n", CMD_DISABLE_SVC_FLAP_DETECTION, url_images_path, DISABLED_ICON);
 		printf("<option value='%d' title='%s%s'>Enable Flap Detection For Checked Service(s)</option>\n", CMD_ENABLE_SVC_FLAP_DETECTION, url_images_path, ENABLED_ICON);
+		printf("<option value='%d' title='%s%s'>Reset Modified Attributes For Checked Service(s)</option>\n", CMD_CHANGE_SVC_MODATTR, url_images_path, DISABLED_ICON);
 		printf("</select>\n");
 
 		/* Print out the activator for the dropdown (which must be between the body tags */
@@ -6644,6 +6645,7 @@ void show_hostcommand_table(void) {
 		printf("<option value='%d' title='%s%s' >Enable Event Handler For Checked Host(s)</option>\n", CMD_ENABLE_HOST_EVENT_HANDLER, url_images_path, ENABLED_ICON);
 		printf("<option value='%d' title='%s%s' >Disable Flap Detection For Checked Host(s)</option>\n", CMD_DISABLE_HOST_FLAP_DETECTION, url_images_path, DISABLED_ICON);
 		printf("<option value='%d' title='%s%s' >Enable Flap Detection For Checked Host(s)</option>\n", CMD_ENABLE_HOST_FLAP_DETECTION, url_images_path, ENABLED_ICON);
+		printf("<option value='%d' title='%s%s' >Reset Modified Attributes For Checked Host(s)</option>\n", CMD_CHANGE_HOST_MODATTR, url_images_path, DISABLED_ICON);
 		printf("</select>\n");
 
 		/* Print out the activator for the dropdown (which must be between the body tags */
diff --git a/module/idoutils/src/logging.c b/module/idoutils/src/logging.c
index 0aa5f99..746ba9c 100644
--- a/module/idoutils/src/logging.c
+++ b/module/idoutils/src/logging.c
@@ -105,7 +105,6 @@ int ido2db_log_debug_info(int level, int verbosity, const char *fmt, ...) {
         struct timeval current_time;
         unsigned long tid;
         unsigned long pid;
-	int dummy = 0;
 
         if (!(ido2db_debug_level == IDO2DB_DEBUGL_ALL || (level & ido2db_debug_level)))
                 return IDO_OK;





More information about the icinga-checkins mailing list