From aad37c335476e60109c0039af6412c0efd1962c8 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 9 Sep 2010 17:16:24 +0200 Subject: [PATCH] show_instance action: Add links to the JSON representation. --- src/action_show_instance.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/action_show_instance.c b/src/action_show_instance.c index bb807a6..c6a8918 100644 --- a/src/action_show_instance.c +++ b/src/action_show_instance.c @@ -227,9 +227,14 @@ static int show_instance_cb (graph_config_t *cfg, /* {{{ */ show_breadcrump (cfg, inst); if (data->graph_count < MAX_SHOW_GRAPHS) + { printf ("
\n", script_name (), params, time_params, title, descr); + printf ("
" + "Get graph data as JSON
\n", + script_name (), params, time_params); + } else printf ("Show graph " ""%s / %s"\n", @@ -243,6 +248,7 @@ static int show_instance_cb (graph_config_t *cfg, /* {{{ */ static int show_instance (void *user_data) /* {{{ */ { show_graph_data_t *data = user_data; + char params[1024]; int status; status = inst_get_all_selected (data->cfg, @@ -251,6 +257,14 @@ static int show_instance (void *user_data) /* {{{ */ fprintf (stderr, "show_instance: inst_get_all_selected failed " "with status %i\n", status); + memset (params, 0, sizeof (params)); + graph_get_params (data->cfg, params, sizeof (params)); + html_escape_buffer (params, sizeof (params)); + + printf ("
" + "Get graph definition as JSON
\n", + script_name (), params); + return (0); } /* }}} int show_instance */ -- 2.11.0