X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Faction_show_instance.c;h=c6a8918c09b25089f228bfb8b41a0d0e168e96b9;hb=aad37c335476e60109c0039af6412c0efd1962c8;hp=0e1e43c9c79875bfe1699cab4c0dc07242dba7f0;hpb=ec060bd3831805d241bcd00d4d09b59ec8b10c26;p=collection4.git diff --git a/src/action_show_instance.c b/src/action_show_instance.c index 0e1e43c..c6a8918 100644 --- a/src/action_show_instance.c +++ b/src/action_show_instance.c @@ -146,6 +146,7 @@ static int left_menu (void *user_data) /* {{{ */ { show_graph_data_t *data = user_data; char params[1024]; + graph_instance_t *inst; graph_ident_t *ident; const char *host; @@ -153,7 +154,8 @@ static int left_menu (void *user_data) /* {{{ */ graph_get_params (data->cfg, params, sizeof (params)); html_escape_buffer (params, sizeof (params)); - ident = inst_get_selector (data->inst); + inst = inst_get_selected (data->cfg); + ident = inst_get_selector (inst); host = ident_get_host (ident); if (IS_ANY (host)) host = NULL; @@ -176,6 +178,9 @@ static int left_menu (void *user_data) /* {{{ */ } printf ("\n"); + host = NULL; + ident_destroy (ident); + return (0); } /* }}} int left_menu */ @@ -222,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", @@ -238,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, @@ -246,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 */