[icinga-checkins] icinga.org: icinga-core/dev/cgis: classic ui: add passive icon to scheduled checks on cmd.cgi, table header new background #2697

git at icinga.org git at icinga.org
Fri Aug 31 14:55:27 CEST 2012


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

Author: Michael Friedrich <michael.friedrich at gmail.com>
Date:   Fri Aug 31 14:53:31 2012 +0200

classic ui: add passive icon to scheduled checks on cmd.cgi, table header new background #2697

refs #2697

---

 cgi/cmd.c                |   33 +++++++++++++++++++++++++++------
 html/stylesheets/cmd.css |   11 ++++++++++-
 2 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/cgi/cmd.c b/cgi/cmd.c
index b4e4cf5..569b648 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -828,9 +828,9 @@ void print_object_list(int list_type) {
 	printf("<TABLE cellspacing='2' cellpadding='0' border='0' width='100%%'>\n");
 
 	if (list_type == PRINT_SERVICE_LIST)
-		printf("<tr class=\"objectDescription\"><td width=\"46%%\">Host</td><td width=\"46%%\">Service</td><td width='16'><input type='checkbox' onclick=\"checkAllBoxes();\" title=\"Check All\"></td></tr>\n");
+		printf("<tr class=\"objectTableHeader\"><td width=\"46%%\">Host</td><td width=\"46%%\">Service</td><td width='16'><input type='checkbox' onclick=\"checkAllBoxes();\" title=\"Check All\"></td></tr>\n");
 	else if (list_type == PRINT_HOST_LIST)
-		printf("<tr class=\"objectDescription\"><td colspan=\"2\" width=\"96%%\">Hosts</td><td width='16'><input type='checkbox' onclick=\"checkAllBoxes();\" title=\"Check All\"></td></tr>\n");
+		printf("<tr class=\"objectTableHeader\"><td colspan=\"2\" width=\"96%%\">Hosts</td><td width='16'><input type='checkbox' onclick=\"checkAllBoxes();\" title=\"Check All\"></td></tr>\n");
 	else
 		printf("<tr><td colspan=\"3\"> </td></tr>\n");
 
@@ -875,8 +875,19 @@ void print_object_list(int list_type) {
 		if (list_type == PRINT_SERVICE_LIST) {
 			/* hostname and service description are present */
 			if (strlen(commands[x].host_name) != 0  && strlen(commands[x].description) != 0) {
-				printf(">%s</td><td>%s</td>", escape_string(commands[x].host_name), escape_string(commands[x].description));
-				printf("<td align='center'><input type='checkbox' name='hostservice' id=\"cb_%d\" value='%s^%s' title=\"%s Service\" %s></td></tr>\n", x, escape_string(commands[x].host_name), escape_string(commands[x].description), (service_passive == FALSE) ? "Active" : "Passive", (service_passive == FALSE) ? "checked" : "");
+				printf(">%s</td><td>%s",
+					escape_string(commands[x].host_name), escape_string(commands[x].description)
+				);
+				if (service_passive == TRUE) {
+					printf("<img src='%s%s' align=right border=0 alt='Passive' title='Passive Service'>",
+						url_images_path, PASSIVE_ICON
+					);
+				}
+                                printf("</td>\n");
+
+				printf("<td align='center'><input type='checkbox' name='hostservice' id=\"cb_%d\" value='%s^%s' title=\"%s Service\" %s></td></tr>\n",
+					x, escape_string(commands[x].host_name), escape_string(commands[x].description),
+					(service_passive == FALSE) ? "Active" : "Passive", (service_passive == FALSE) ? "checked" : "");
 			} else {
 				/* if hostname is empty print inputbox instead */
 				if (!strcmp(commands[x].host_name, ""))
@@ -896,8 +907,18 @@ void print_object_list(int list_type) {
 			if (!strcmp(commands[x].host_name, ""))
 				printf(" style=\"font-weight:bold;\">Host:</td><td><INPUT TYPE='TEXT' NAME='host' SIZE=30></td><td></td></tr>\n");
 			else {
-				printf(" style=\"font-weight:bold;\">Host:</td><td>%s</td>", escape_string(commands[x].host_name));
-				printf("<td align='center'><input type='checkbox' name='host' id=\"cb_%d\" value='%s' title=\"%s Host\" %s></td></tr>\n", x, escape_string(commands[x].host_name), (host_passive == FALSE) ? "Active" : "Passive", (host_passive == FALSE) ? "checked" : "");
+				printf(" style=\"font-weight:bold;\">Host:</td><td>%s", escape_string(commands[x].host_name));
+				if (host_passive == TRUE) {
+					printf("<img src='%s%s' align=right border=0 alt='Passive' title='Passive Service'>",
+						url_images_path, PASSIVE_ICON
+					);
+				}
+                                printf("</td>\n");
+
+				printf("<td align='center'><input type='checkbox' name='host' id=\"cb_%d\" value='%s' title=\"%s Host\" %s></td></tr>\n",
+					x, escape_string(commands[x].host_name),
+					(host_passive == FALSE) ? "Active" : "Passive", (host_passive == FALSE) ? "checked" : ""
+				);
 			}
 		} else if (list_type == PRINT_COMMENT_LIST) {
 			printf(" style=\"font-weight:bold;\">Comment ID:</td><td><INPUT TYPE='HIDDEN' NAME='com_id' VALUE='%lu'>%lu</td></tr>\n", multi_ids[x], multi_ids[x]);
diff --git a/html/stylesheets/cmd.css b/html/stylesheets/cmd.css
index 6a678d0..75bd93a 100644
--- a/html/stylesheets/cmd.css
+++ b/html/stylesheets/cmd.css
@@ -19,10 +19,19 @@ td {
 	padding-bottom:3px;
 }
 
-.objectDescription {
+.objectTableHeader {
 	font-size: 8pt;
 	font-weight: bold;
 	height:25px;
+	background-color: #707677;
+	color: #fff;
+	border: 0;
+}
+
+.objectDescription {
+        font-size: 8pt;
+        font-weight: bold;
+        height:25px;
 }
 
 .descriptionleft {





More information about the icinga-checkins mailing list