projects
/
collection4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8ef2ef7
)
"show graph" action: Create exact field searches in the breadcrump.
author
Florian Forster
<ff@octo.it>
Wed, 23 Jun 2010 07:20:57 +0000
(09:20 +0200)
committer
Florian Forster
<octo@verplant.org>
Wed, 23 Jun 2010 07:20:57 +0000
(09:20 +0200)
src/action_show_graph.c
patch
|
blob
|
history
diff --git
a/src/action_show_graph.c
b/src/action_show_graph.c
index
2f124de
..
7b3c93a
100644
(file)
--- a/
src/action_show_graph.c
+++ b/
src/action_show_graph.c
@@
-28,7
+28,8
@@
struct show_graph_data_s
};
typedef struct show_graph_data_s show_graph_data_t;
};
typedef struct show_graph_data_s show_graph_data_t;
-static void show_breadcrump_field (const char *str) /* {{{ */
+static void show_breadcrump_field (const char *str, /* {{{ */
+ const char *field_name)
{
if ((str == NULL) || (str[0] == 0))
printf ("<em>none</em>");
{
if ((str == NULL) || (str[0] == 0))
printf ("<em>none</em>");
@@
-39,8
+40,14
@@
static void show_breadcrump_field (const char *str) /* {{{ */
else
{
char *str_html = html_escape (str);
else
{
char *str_html = html_escape (str);
- printf ("<a href=\"%s?action=list_graphs;q=%s\">%s</a>",
- script_name (), str_html, str_html);
+
+ 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 */
free (str_html);
}
} /* }}} void show_breadcrump_field */
@@
-62,15
+69,15
@@
static int show_breadcrump (show_graph_data_t *data) /* {{{ */
}
printf ("<div class=\"breadcrump\">%s: "", prefix);
}
printf ("<div class=\"breadcrump\">%s: "", prefix);
- show_breadcrump_field (ident_get_host (ident));
+ show_breadcrump_field (ident_get_host (ident)
, "host"
);
printf (" / ");
printf (" / ");
- show_breadcrump_field (ident_get_plugin (ident));
+ show_breadcrump_field (ident_get_plugin (ident)
, "plugin"
);
printf (" – ");
printf (" – ");
- show_breadcrump_field (ident_get_plugin_instance (ident));
+ show_breadcrump_field (ident_get_plugin_instance (ident)
, NULL
);
printf (" / ");
printf (" / ");
- show_breadcrump_field (ident_get_type (ident));
+ show_breadcrump_field (ident_get_type (ident)
, "type"
);
printf (" – ");
printf (" – ");
- show_breadcrump_field (ident_get_type_instance (ident));
+ show_breadcrump_field (ident_get_type_instance (ident)
, NULL
);
printf (""</div>\n");
return (0);
printf (""</div>\n");
return (0);