[icinga-checkins] icinga.org: icinga-core/dev/cgis: classic-ui: added date_format to JSON status data #3172

git at icinga.org git at icinga.org
Thu Feb 7 01:02:20 CET 2013


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

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Thu Feb  7 00:18:44 2013 +0100

classic-ui: added date_format to JSON status data #3172

refs: #3172

---

 cgi/cgiutils.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/cgi/cgiutils.c b/cgi/cgiutils.c
index 94c184e..6082d57 100644
--- a/cgi/cgiutils.c
+++ b/cgi/cgiutils.c
@@ -1158,6 +1158,12 @@ void document_header(int cgi_id, int use_stylesheet, char *cgi_title) {
 		printf(",\"running_as_a_daemon\": %s\n", (daemon_mode == TRUE) ? "true" : "false");
 #endif
 		printf("\"timezone\": \"%s\",\n", timezone);
+		if (date_format == DATE_FORMAT_EURO)
+			printf("\"date_format\": \"euro\",\n");
+		else if (date_format == DATE_FORMAT_ISO8601 || date_format == DATE_FORMAT_STRICT_ISO8601)
+			printf("\"date_format\": \"%siso8601\",\n", (date_format == DATE_FORMAT_STRICT_ISO8601) ? "strict-" : "");
+		else
+			printf("\"date_format\": \"us\",\n");
 		printf("\"program_start\": %lu,\n", program_start);
 		printf("\"total_running_time\": \"%s\",\n", run_time_string);
 		printf("\"last_external_command_check\": %lu,\n", last_command_check);





More information about the icinga-checkins mailing list