[icinga-checkins] icinga.org: icinga-core/dev/core: classic-ui: changed downtime-> is_in_effect in extinfo to true/false #2473/#2474

git at icinga.org git at icinga.org
Fri Apr 27 09:39:09 CEST 2012


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

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Tue Apr 24 23:56:46 2012 +0200

classic-ui: changed downtime->is_in_effect in extinfo to true/false #2473/#2474

refs: #2473
refs: #2474

* changed dispalying of downtime->is_in_effect to true/false
* removed a compile error

---

 base/commands.c |    1 -
 cgi/extinfo.c   |    6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/base/commands.c b/base/commands.c
index a5c4990..e18e103 100644
--- a/base/commands.c
+++ b/base/commands.c
@@ -218,7 +218,6 @@ int process_external_command1(char *cmd) {
 	time_t entry_time = 0L;
 	int command_type = CMD_NONE;
 	char *temp_ptr = NULL;
-	char *username = NULL;
 
 	log_debug_info(DEBUGL_FUNCTIONS, 0, "process_external_command1()\n");
 
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index d6077db..d1583b9 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -3316,17 +3316,17 @@ void show_downtime(int type) {
 		get_time_breakdown(temp_downtime->duration, &days, &hours, &minutes, &seconds);
 		if (content_type == JSON_CONTENT) {
 			printf("\"duration\": \"%dd %dh %dm %ds\", ", days, hours, minutes, seconds);
-			printf("\"is_in_effect\": %d, ", temp_downtime->is_in_effect);
+			printf("\"is_in_effect\": %s, ", (temp_downtime->is_in_effect == TRUE) ? "true" : "false");
 			printf("\"downtime_id\": %lu, ", temp_downtime->downtime_id);
 			printf("\"trigger_id\": \"");
 		} else if (content_type == CSV_CONTENT) {
 			printf("%s%dd %dh %dm %ds%s%s", csv_data_enclosure, days, hours, minutes, seconds, csv_data_enclosure, csv_delimiter);
-			printf("%s%d%s%s", csv_data_enclosure, temp_downtime->is_in_effect, csv_data_enclosure, csv_delimiter);
+			printf("%s%s%s%s", csv_data_enclosure, (temp_downtime->is_in_effect == TRUE) ? "true" : "false", csv_data_enclosure, csv_delimiter);
 			printf("%s%lu%s%s", csv_data_enclosure, temp_downtime->downtime_id, csv_data_enclosure, csv_delimiter);
 			printf("%s", csv_data_enclosure);
 		} else {
 			printf("<td CLASS='%s'>%dd %dh %dm %ds</td>", bg_class, days, hours, minutes, seconds);
-			printf("<td CLASS='%s'>%d</td>", bg_class, temp_downtime->is_in_effect);
+			printf("<td CLASS='%s'>%s</td>", bg_class, (temp_downtime->is_in_effect == TRUE) ? "True" : "False");
 			printf("<td CLASS='%s'>%lu</td>", bg_class, temp_downtime->downtime_id);
 			printf("<td CLASS='%s'>", bg_class);
 		}





More information about the icinga-checkins mailing list