web/views/expected_failures.erb in sidekiq-expected_failures-0.3.0 vs web/views/expected_failures.erb in sidekiq-expected_failures-0.4.0

- old
+ new

@@ -1,9 +1,36 @@ <script type="text/javascript"> <%= @javascript %> </script> +<style type="text/css"> + @media screen and (min-width: 800px) { + .dl-horizontal dt { + width: 320px; + } + + .dl-horizontal dd { + margin-left: 330px; + } + } + + .modal-dialog { + min-width: 85vw; + } + + .simple-search { + width: 100%; + margin-bottom: 10px; + } + + .search-warning { + text-align: center; + font-weight: 700; + padding: 10px; + } +</style> + <h3>Expected failures log <% if @date %> <small>(<%= @date %>)</small> <% end %> </h3> @@ -69,38 +96,43 @@ <form id="filter-jobs" class="form-inline pull-left" action="<%= root_path %>expected_failures" method="get"> <label>Choose date:</label> <select name="date"> <% @dates.each do |date, count| %> - <option value="<%= date %>" <%= "selected" if date == @date %>><%= date %> (<%= count %>)</option> + <option value="<%= "#{root_path}expected_failures/day/#{date}" %>" <%= "selected" if date == @date %>><%= date %> (<%= count %>)</option> <% end %> </select> </form> <p class="clearfix"></p> - <%= erb :_paging, locals: { url: "#{root_path}expected_failures?date=#{@date}" } %> + <%= erb :_paging, locals: { url: "#{root_path}expected_failures/day/#{@date}" } %> + <p class="clearfix"></p> + <input autocomplete="off" type="text" id="search" class="simple-search hidden" placeholder="Search visible results" /> + <table id="expected" class="queues table table-hover table-bordered table-striped table-white"> <thead> <th>Datetime</th> <th>Worker</th> <th>Exception</th> <th>Queue</th> <th>Arguments</th> </thead> - <% @jobs.each do |job| %> - <tr> - <td><%= Time.parse(job['failed_at']).strftime('%m/%d/%Y %H:%M:%S') %></td> - <td><%= job["worker"] %></td> - <td><%= job["exception"] %> <small>(<%= job["error"]%>)</small></td> - <td><a href="<%= "#{root_path}/queues/#{job["queue"]}"%>"><%= job["queue"] %></a></td> - <td><%= link_to_details(job) %></td> - </tr> - <% end %> + <tbody> + <% @jobs.each do |job| %> + <tr> + <td><%= Time.parse(job['failed_at']).strftime('%m/%d/%Y %H:%M:%S') %></td> + <td><%= job["worker"] %></td> + <td><div data-search="<%= job['exception'].to_s.downcase %><%= h job["error"].to_s.downcase %>"><%= job["exception"] %> <small>(<%= h job["error"]%>)</small></div></td> + <td><a href="<%= "#{root_path}/queues/#{job["queue"]}"%>"><%= job["queue"] %></a></td> + <td><%= link_to_details(job) %></td> + </tr> + <% end %> + </tbody> </table> - <%= erb :_paging, locals: { url: "#{root_path}expected_failures/#{@date}" } %> + <%= erb :_paging, locals: { url: "#{root_path}expected_failures/day/#{@date}" } %> <% else %> <p class="clearfix"></p> <div class="alert alert-success"> No failed jobs found.