X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Faction_list_graphs.c;fp=src%2Faction_list_graphs.c;h=b360c1ddbab1400739306b770740e6962c23e708;hp=395d8a14ade0066ccea7ee691d5e4aa0ac64a3e0;hb=2c85f876c1b9d5c161694cfb03cf20773b74c844;hpb=da630143f2fd8a152ec71a9c7ed8b0ae17081fa4 diff --git a/src/action_list_graphs.c b/src/action_list_graphs.c index 395d8a1..b360c1d 100644 --- a/src/action_list_graphs.c +++ b/src/action_list_graphs.c @@ -5,6 +5,7 @@ #include "action_list_graphs.h" #include "graph.h" +#include "graph_ident.h" #include "graph_list.h" #include "utils_params.h" @@ -62,13 +63,33 @@ static int list_graphs_json (void) /* {{{ */ return (0); } /* }}} int list_graphs_json */ +struct callback_data_s +{ + graph_config_t *cfg; +}; +typedef struct callback_data_s callback_data_t; + static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */ graph_instance_t *inst, - __attribute__((unused)) void *user_data) + void *user_data) { + callback_data_t *data = user_data; char params[1024]; char desc[1024]; + if (data->cfg != cfg) + { + if (data->cfg != NULL) + printf (" \n"); + + memset (desc, 0, sizeof (desc)); + graph_get_title (cfg, desc, sizeof (desc)); + + printf ("
  • %s\n \n"); return (0); @@ -120,7 +134,7 @@ int action_list_graphs (void) /* {{{ */ if (strcmp ("json", format) == 0) return (list_graphs_json ()); else - return (list_graphs_html ()); + return (list_graphs_html (param ("search"))); } /* }}} int action_list_graphs */ /* vim: set sw=2 sts=2 et fdm=marker : */