Skip to content

Commit

Permalink
make tokenized search actually work, and add a few tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
jcran committed Jul 31, 2018
1 parent 77f677c commit 13883fb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/routes/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _tokenized_search(search_string, selected_entities)
# Simple tokenized search......
if search_string && search_string.length > 0
#tokens = search_string.split("'")
tokens = search_string.split(" ")
tokens = search_string.split("|")
tokens.each do |t|
if t =~ /^!/ || t =~ /^~/ || t =~ /^-/ # exclude whatever comes next
ss = t[1..-1] # pull the token and remove any single quotes
Expand Down
3 changes: 3 additions & 0 deletions app/views/_task_runner.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
</option>
<% end %>
</select>
<div class="hint">'Strategy' specifies the strategy that will be used to iterate.</div>
</div>
</div>
</div>
Expand All @@ -82,9 +83,11 @@
<option value=7>7 Iterations</option>
<option value=8>8 Iterations</option>
</select>
<div class="hint">'Iterations' specifies the depth to which the chosen strategy is run.</div>
</div>
</div>
</div>

<!--
<div id="handler">
<div class="form-group">
Expand Down
6 changes: 3 additions & 3 deletions app/views/analysis/stats/applications.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
<p>Servers:</p>
<p>
<% @server_fingerprints.each do |k,v| %>
<a href="/<%= h @project_name%>/entities?search_string=details:<%=h k.split(" ").first%>"><%= h k %></a>: <%=h v %><br>
<a href="/<%= h @project_name%>/entities?search_string=details:<%=h k%>"><%= h k %></a>: <%=h v %><br>
<% end %>
</p>
</div>
<div id="applications" class="col-sm-3">
<p>Applications:</p>
<p>
<% @app_fingerprints.each do |k,v| %>
<a href="/<%=h @project_name%>/entities?search_string=details:<%=h k.split(" ").first%>"><%= h k %></a>: <%=h v %><br>
<a href="/<%=h @project_name%>/entities?search_string=details:<%=h k%>"><%= h k %></a>: <%=h v %><br>
<% end %>
</p>
</div>
<div id="includes" class="col-sm-3">
<p>Includes:</p>
<p>
<% @include_fingerprints.each do |k,v| %>
<a href="/<%=h @project_name%>/entities?search_string=details:<%=h k.split(" ").first%>"><%= h k %></a>: <%=h v %><br>
<a href="/<%=h @project_name%>/entities?search_string=details:<%=h k%>"><%= h k %></a>: <%=h v %><br>
<% end %>
</p>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/views/entities/_search.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

Search:
<input type="text" style='width:100%' class="form-control sm" id="search_string" name="search_string" value="<%= h params["search_string"] %>">
<br/>
Types:<br/>
<div class="hint">Hint: Use "name:" and "details:" to search specfic fields. Separate search tokens with a "|" character.</div>
<br>
Types:<br>
<select size=16 style='height:100%; width:100%; color:#000000;' multiple name="entity_types[]">
<% Intrigue::Model::Entity.descendants.map{|x|x.to_s}.sort.each do |d| %>
<option value="<%=d%>" <%="selected" if (@entity_types && @entity_types.include?(d.to_s))%>> <%=d%></option>
Expand Down
5 changes: 5 additions & 0 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ a:hover {
margin-top: 5px;
margin-left: 1px;
}

.hint {
color: light-grey;
font-size: 10px;
}

0 comments on commit 13883fb

Please sign in to comment.