index 89c5d62906d58eec612e28d61a1198bbb71ca5e5..6f919e3afdfdce142a054b71d18a8e8a81844c78 100644 (file)
--- a/src/action_list_graphs.c
+++ b/src/action_list_graphs.c
#include <fcgiapp.h>
#include <fcgi_stdio.h>
+static int left_menu (__attribute__((unused)) void *user_data) /* {{{ */
+{
+ printf ("\n<ul class=\"menu left\">\n"
+ " <li><a href=\"%s?action=search\">Search</a></li>\n"
+ " <li><a href=\"%s?action=list_hosts\">All hosts</a></li>\n"
+ "</ul>\n",
+ script_name (), script_name ());
+
+ return (0);
+} /* }}} int left_menu */
+
static int print_one_graph (graph_config_t *cfg, /* {{{ */
__attribute__((unused)) void *user_data)
{
html_escape_buffer (params, sizeof (params));
printf (" <li class=\"graph\"><a href=\"%s?action=show_graph;%s\">"
- "%s</a> <span class=\"num_instances\">(%lu %s)</span></li>\n",
+ "%s</a> <span class=\"num_instances\">(%lu %s)</span></li>\n",
script_name (), params, title,
(unsigned long) num_instances,
(num_instances == 1) ? "instance" : "instances");
static int print_all_graphs (__attribute__((unused)) void *user_data) /* {{{ */
{
- printf (" <ul id=\"search-output\" class=\"graph_list\">\n");
- gl_graph_get_all (print_one_graph, /* user_data = */ NULL);
+ const char *dynamic;
+ _Bool include_dynamic = 0;
+
+ dynamic = param ("dynamic");
+ if ((dynamic != NULL)
+ && (strcmp ("true", dynamic) == 0))
+ include_dynamic = 1;
+
+ printf (" <ul class=\"graph_list\">\n");
+ gl_graph_get_all (include_dynamic, print_one_graph, /* user_data = */ NULL);
printf (" </ul>\n");
+ if (!include_dynamic)
+ {
+ printf (" <div><a href=\"%s?action=list_graphs;dynamic=true\">"
+ "List dynamic graphs, too."
+ "</a></div>\n", script_name ());
+ }
+
return (0);
} /* }}} int print_all_graphs */
int action_list_graphs (void) /* {{{ */
{
- gl_update ();
-
page_callbacks_t pg_callbacks = PAGE_CALLBACKS_INIT;
char title[512];
title[sizeof (title) - 1] = 0;
pg_callbacks.top_right = html_print_search_box;
+ pg_callbacks.middle_left = left_menu;
pg_callbacks.middle_center = print_all_graphs;
html_print_page (title, &pg_callbacks, /* user data = */ NULL);