+static void show_breadcrump_field (const char *str, /* {{{ */
+ const char *field_name)
+{
+ if ((str == NULL) || (str[0] == 0))
+ printf ("<em>none</em>");
+ else if (IS_ANY (str))
+ printf ("<em>any</em>");
+ else if (IS_ALL (str))
+ printf ("<em>all</em>");
+ else
+ {
+ char *str_html = html_escape (str);
+
+ if (field_name != NULL)
+ printf ("<a href=\"%s?action=list_graphs;q=%s:%s\">%s</a>",
+ script_name (), field_name, str_html, str_html);
+ else
+ printf ("<a href=\"%s?action=list_graphs;q=%s\">%s</a>",
+ script_name (), str_html, str_html);
+
+ free (str_html);
+ }
+} /* }}} void show_breadcrump_field */
+
+static int show_breadcrump (show_graph_data_t *data) /* {{{ */
+{
+ graph_ident_t *ident;
+ char *prefix;
+
+ if (data->inst != NULL)
+ {
+ prefix = "Instance";
+ ident = inst_get_selector (data->inst);
+ }
+ else
+ {
+ prefix = "Graph";
+ ident = graph_get_selector (data->cfg);
+ }
+
+ printf ("<div class=\"breadcrump\">%s: "", prefix);
+ show_breadcrump_field (ident_get_host (ident), "host");
+ printf (" / ");
+ show_breadcrump_field (ident_get_plugin (ident), "plugin");
+ printf (" – ");
+ show_breadcrump_field (ident_get_plugin_instance (ident), "plugin_instance");
+ printf (" / ");
+ show_breadcrump_field (ident_get_type (ident), "type");
+ printf (" – ");
+ show_breadcrump_field (ident_get_type_instance (ident), "type_instance");
+ printf (""</div>\n");
+
+ return (0);
+} /* }}} int show_breadcrump */
+
+static int show_time_selector (__attribute__((unused)) void *user_data) /* {{{ */
+{
+ param_list_t *pl;
+
+ pl = param_create (/* query string = */ NULL);
+ param_set (pl, "begin", NULL);
+ param_set (pl, "end", NULL);
+ param_set (pl, "button", NULL);
+
+ printf ("<form action=\"%s\" method=\"get\">\n", script_name ());
+
+ param_print_hidden (pl);
+
+ printf (" <select name=\"begin\">\n"
+ " <option value=\"-3600\">Hour</option>\n"
+ " <option value=\"-86400\">Day</option>\n"
+ " <option value=\"-604800\">Week</option>\n"
+ " <option value=\"-2678400\">Month</option>\n"
+ " <option value=\"-31622400\">Year</option>\n"
+ " </select>\n"
+ " <input type=\"submit\" name=\"button\" value=\"Go\" />\n");
+
+ printf ("</form>\n");
+
+ param_destroy (pl);
+
+ return (0);
+} /* }}} int show_time_selector */
+