X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Faction_list_graphs.c;h=6a7ce4fe2538c4bfbe249a16654eafba714504fb;hb=8ef2ef705bc5f5b4aa758f92ed8ceb1cec42f7c8;hp=922308b0637df0ebd3e4ce8d672e6e5a70855d5d;hpb=30478870f2afaf991ee19ab7b4c22d3ddcd7b8cd;p=collection4.git diff --git a/src/action_list_graphs.c b/src/action_list_graphs.c index 922308b..6a7ce4f 100644 --- a/src/action_list_graphs.c +++ b/src/action_list_graphs.c @@ -18,8 +18,12 @@ struct callback_data_s { graph_config_t *cfg; - int limit; - _Bool first; + int graph_index; + int graph_limit; + _Bool graph_more; + int inst_index; + int inst_limit; + _Bool inst_more; }; typedef struct callback_data_s callback_data_t; @@ -33,6 +37,13 @@ static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */ if (data->cfg != cfg) { + data->graph_index++; + if (data->graph_index >= data->graph_limit) + { + data->graph_more = 1; + return (1); + } + if (data->cfg != NULL) printf (" \n"); @@ -44,6 +55,19 @@ static int print_graph_inst_html (graph_config_t *cfg, /* {{{ */ " \n"); + if (cb_data.graph_more) + { + printf ("
  • More ...
  • \n"); + } + printf (" \n"); return (0); @@ -177,7 +214,8 @@ static int print_host_list (__attribute__((unused)) void *user_data) /* {{{ */ return (0); } - printf ("\n"); array_destroy (data.array); @@ -232,10 +270,8 @@ int action_list_graphs (void) /* {{{ */ gl_update (); - search = strtolower_copy (param ("search")); - + search = strtolower_copy (param ("q")); status = list_graphs_html (search); - free (search); return (status);