From b64e6b6983c49fa5924fa8558fe1d65f7ea5aea0 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 6 Jul 2010 09:44:00 +0200 Subject: [PATCH] "show instance" action: Parse the time parameters and pass them along to the "graph" action. --- src/action_show_instance.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/action_show_instance.c b/src/action_show_instance.c index c4ca6cd..08d1bc0 100644 --- a/src/action_show_instance.c +++ b/src/action_show_instance.c @@ -206,6 +206,11 @@ static int show_instance_cb (graph_config_t *cfg, /* {{{ */ char descr[128]; char params[1024]; + long begin; + long end; + char time_params[128]; + int status; + memset (title, 0, sizeof (title)); graph_get_title (cfg, title, sizeof (title)); html_escape_buffer (title, sizeof (title)); @@ -218,14 +223,26 @@ static int show_instance_cb (graph_config_t *cfg, /* {{{ */ inst_get_params (cfg, inst, params, sizeof (params)); html_escape_buffer (params, sizeof (params)); + time_params[0] = 0; + begin = 0; + end = 0; + + status = get_time_args (&begin, &end, /* now = */ NULL); + if (status == 0) + { + snprintf (time_params, sizeof (time_params), ";begin=%li;end=%li", + begin, end); + time_params[sizeof (time_params) - 1] = 0; + } + printf ("

Instance "%s"

\n", descr); show_breadcrump (cfg, inst); if (data->graph_count < MAX_SHOW_GRAPHS) - printf ("
\n", - script_name (), params, title, descr); + script_name (), params, time_params, title, descr); else printf ("Show graph " ""%s / %s"\n", -- 2.11.0