X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=action_list_graphs.c;h=c239222051679003587bbcf769d407d9b2abd4df;hb=8f210aa3a93bafab43eba645c9bc2babab999b93;hp=14a13bbc6211c9ba6338a7388c7d6b0d2f9a6dca;hpb=54970371d071601fcac80f5356cfa857915cea91;p=collection4.git diff --git a/action_list_graphs.c b/action_list_graphs.c index 14a13bb..c239222 100644 --- a/action_list_graphs.c +++ b/action_list_graphs.c @@ -43,33 +43,34 @@ static int print_graph_json (const graph_list_t *gl, void *user_data) /* {{{ */ return (0); } /* }}} int print_graph_json */ -static int print_graph_html (const graph_list_t *gl, - void __attribute__((unused)) *user_data) +static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */ + graph_instance_t *inst, + __attribute__((unused)) void *user_data) { - if (gl == NULL) - return (EINVAL); + char buffer[1024]; - printf ("
  • "); + memset (buffer, 0, sizeof (buffer)); + gl_instance_get_params (cfg, inst, buffer, sizeof (buffer)); - printf ("host, gl->plugin); - if (gl->plugin_instance != NULL) - printf ("plugin_instance=%s;", gl->plugin_instance); - printf ("type=%s;", gl->type); - if (gl->type_instance != NULL) - printf ("type_instance=%s;", gl->type_instance); - printf ("\">"); + printf ("
  • %s
  • \n", buffer, buffer); - printf ("%s/%s", gl->host, gl->plugin); - if (gl->plugin_instance != NULL) - printf ("-%s", gl->plugin_instance); - printf ("/%s", gl->type); - if (gl->type_instance != NULL) - printf ("-%s", gl->type_instance); - printf ("\n"); + return (0); +} /* }}} int print_graph_inst_html */ + +static int print_graph_html (graph_config_t *cfg, /* {{{ */ + __attribute__((unused)) void *user_data) +{ + char buffer[1024]; + + memset (buffer, 0, sizeof (buffer)); + gl_graph_get_title (cfg, buffer, sizeof (buffer)); + + printf ("
  • %s\n\n"); return (0); -} +} /* }}} int print_graph_html */ static int list_graphs_json (void) /* {{{ */ { @@ -89,7 +90,7 @@ static int list_graphs_html (void) /* {{{ */ printf ("Content-Type: text/html\n\n"); printf ("\n"); return (0);