- show_breadcrump (data);
-
- memset (title, 0, sizeof (title));
- graph_get_title (data->cfg, title, sizeof (title));
- html_escape_buffer (title, sizeof (title));
+ if ((data->search_term != NULL) && (data->search_term[0] != 0))
+ {
+ _Bool matches = 0;
+ char *term_lc = strtolower_copy (data->search_term);
+
+ if (strncmp ("host:", term_lc, strlen ("host:")) == 0)
+ {
+ if (inst_matches_field (inst, GIF_HOST, term_lc + strlen ("host:")))
+ matches = 1;
+ }
+ else if (strncmp ("plugin:", term_lc, strlen ("plugin:")) == 0)
+ {
+ if (inst_matches_field (inst, GIF_PLUGIN, term_lc + strlen ("plugin:")))
+ matches = 1;
+ }
+ else if (strncmp ("plugin_instance:", term_lc,
+ strlen ("plugin_instance:")) == 0)
+ {
+ if (inst_matches_field (inst, GIF_PLUGIN_INSTANCE,
+ term_lc + strlen ("plugin_instance:")))
+ matches = 1;
+ }
+ else if (strncmp ("type:", term_lc, strlen ("type:")) == 0)
+ {
+ if (inst_matches_field (inst, GIF_TYPE, term_lc + strlen ("type:")))
+ matches = 1;
+ }
+ else if (strncmp ("type_instance:", term_lc,
+ strlen ("type_instance:")) == 0)
+ {
+ if (inst_matches_field (inst, GIF_TYPE_INSTANCE,
+ term_lc + strlen ("type_instance:")))
+ matches = 1;
+ }
+ else if (inst_matches_string (data->cfg, inst, term_lc))
+ {
+ matches = 1;
+ }
+
+ free (term_lc);
+
+ if (!matches)
+ return (0);
+ } /* if (data->search_term) */