[icinga-checkins] icinga.org: icinga-core/rbartels/next: classic-ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00: 00 when not triggered #3980

git at icinga.org git at icinga.org
Tue Apr 30 10:39:43 CEST 2013


Module: icinga-core
Branch: rbartels/next
Commit: 6c497f11d4cc5e035135e1aaba6ef27e6ce7e297
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=6c497f11d4cc5e035135e1aaba6ef27e6ce7e297

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Sat Apr 20 23:26:00 2013 +0200

classic-ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00:00 when not triggered #3980

refs: #3980

it now displays "N/A"

---

 Changelog     |    1 +
 cgi/extinfo.c |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 7e60608..3084dd2 100644
--- a/Changelog
+++ b/Changelog
@@ -99,6 +99,7 @@ FIXES
 * classic ui: fixed possible NULL dereference-bug in summary.c #3740 - RB
 * classic ui: fixed Command expansion problem with percentage signs #3929 - RB
 * classic ui: cleaned up the jquery-ui includes to allow debian pkg dependencies #3808 - RB
+* classic ui: fixed Trigger Time in Scheduled Downtime displaying 01-01-1970 01:00:00 when not triggered #3980 - RB
 
 * docs: add missing cmd_mod description in cgi params #3438 - MF
 * docs: search_string as cgi GET param works also for status.cgi #3451 - MF
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index bc84f8e..0a7be27 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -3337,11 +3337,14 @@ void show_downtime(int type) {
 
 		get_time_string(&temp_downtime->trigger_time, date_time, (int)sizeof(date_time), SHORT_DATE_TIME);
 		if (content_type == JSON_CONTENT) {
-			printf("\"trigger_time\": \"%s\", ", date_time);
+			if (temp_downtime->trigger_time != 0)
+				printf("\"trigger_time\": \"%s\", ", date_time);
+			else
+				printf("\"trigger_time\": null, ");
 		} else if (content_type == CSV_CONTENT) {
-			printf("%s%s%s%s", csv_data_enclosure, date_time, csv_data_enclosure, csv_delimiter);
+			printf("%s%s%s%s", csv_data_enclosure, (temp_downtime->trigger_time != 0) ? date_time : "N/A", csv_data_enclosure, csv_delimiter);
 		} else {
-			printf("<td CLASS='%s'>%s</td>", bg_class, date_time);
+			printf("<td CLASS='%s'>%s</td>", bg_class, (temp_downtime->trigger_time != 0) ? date_time : "N/A");
 		}
 
 		get_time_breakdown(temp_downtime->duration, &days, &hours, &minutes, &seconds);





More information about the icinga-checkins mailing list