diff options
author | Peter Wilmott <p@p8952.info> | 2015-01-25 18:18:01 +0000 |
---|---|---|
committer | Peter Wilmott <p@p8952.info> | 2015-01-25 18:18:01 +0000 |
commit | d757ebf5cc97ac9fa1d084790b348e16271760bd (patch) | |
tree | ea8e9f3f2032a34ec12bcb68baec35e2a802c57e | |
parent | Add db table and build scripts for testing repoman outputs (diff) | |
download | ruby-tinderbox-d757ebf5cc97ac9fa1d084790b348e16271760bd.tar.gz ruby-tinderbox-d757ebf5cc97ac9fa1d084790b348e16271760bd.tar.bz2 ruby-tinderbox-d757ebf5cc97ac9fa1d084790b348e16271760bd.zip |
Add main repoman page
-rw-r--r-- | web/app.rb | 5 | ||||
-rw-r--r-- | web/views/build_status.erb | 8 | ||||
-rw-r--r-- | web/views/layout.erb | 1 | ||||
-rw-r--r-- | web/views/repoman_checks.erb | 46 |
4 files changed, 56 insertions, 4 deletions
@@ -43,6 +43,11 @@ class RubyStats < Sinatra::Base erb :build_logs, locals: { build: build } end + get '/repoman_checks' do + repomans = Repoman.distinct(:package_id).order(:package_id, Sequel.desc(:time)) + erb :repoman_checks, locals: { repomans: repomans } + end + get '/visualizations' do # Ruby Targets ruby_1_9_amd64 = Package.where(r19_target: 'ruby19', amd64_keyword: 'amd64').count diff --git a/web/views/build_status.erb b/web/views/build_status.erb index c1fad15..6da0f6d 100644 --- a/web/views/build_status.erb +++ b/web/views/build_status.erb @@ -11,9 +11,9 @@ <thead> <tr> <th class="width-52">Package</th> - <th class="width-17">Date</th> + <th class="width-14">Date</th> <th class="width-17">Result</th> - <th class="width-14">History</th> + <th class="width-17">History</th> </tr> </thead> <%builds.each do |build|%> @@ -26,13 +26,13 @@ <td class="width-52"> <%=build[:package_id]%> </td> - <td class="width-17"> + <td class="width-14"> <%=Time.at(build[:time].to_i).strftime('%Y-%m-%d')%> </td> <td class="width-17 <%=result%>"> <a href="/build_logs/<%=build[:package_id]%>/<%=build[:time]%>"><%=build[:result].camelcase%></a> </td> - <td class="width-14"> + <td class="width-17"> <a href="/build_history/<%=build[:package_id]%>"><%=Build.where(package_id: build[:package_id]).count%> Build(s)</a> </td> <td style="display:none;"> diff --git a/web/views/layout.erb b/web/views/layout.erb index 28b4d1e..918b4d9 100644 --- a/web/views/layout.erb +++ b/web/views/layout.erb @@ -66,6 +66,7 @@ <li><a href="/ruby_targets">Ruby Targets</a></li> <li><a href="/outdated_gems">Outdated Gems</a></li> <li><a href="/build_status">Build Status (CI)</a></li> + <li><a href="/repoman_checks">Repoman Checks</a></li> <li><a href="/visualizations">Visualizations</a></li> </ul> </div> diff --git a/web/views/repoman_checks.erb b/web/views/repoman_checks.erb new file mode 100644 index 0000000..cd57add --- /dev/null +++ b/web/views/repoman_checks.erb @@ -0,0 +1,46 @@ +<div id="repoman_checks"> + <h1>Repoman Checks</h1> +</div> + +<form class="pull-right"> + <input type="checkbox" onclick="$('td:contains(\'+amd64\')').parent().toggle();" checked> amd64 + <input type="checkbox" onclick="$('td:contains(\'+~amd64\')').parent().toggle();" checked> ~amd64 +</form> + +<table id="sortable" class="table table-bordered table-condensed"> + <thead> + <tr> + <th class="width-52">Package</th> + <th class="width-14">Date</th> + <th class="width-17">Current</th> + <th class="width-17">Next</th> + </tr> + </thead> + <%repomans.each do |repoman|%> + <%package = Package.where(identifier: repoman[:package_id]).first%> + <%next if package.nil?%> + <%c_result = 'success' if repoman[:current_result] == 'succeeded'%> + <%c_result = 'info' if repoman[:current_result] == 'unknown'%> + <%c_result = 'danger' if repoman[:current_result] == 'failed'%> + <%n_result = 'success' if repoman[:next_result] == 'succeeded'%> + <%n_result = 'info' if repoman[:next_result] == 'unknown'%> + <%n_result = 'danger' if repoman[:next_result] == 'failed'%> + <tr> + <td class="width-52"> + <%=repoman[:package_id]%> + </td> + <td class="width-14"> + <%=Time.at(repoman[:time].to_i).strftime('%Y-%m-%d')%> + </td> + <td class="width-17 <%=c_result%>"> + <%=repoman[:current_result].camelcase%> + </td> + <td class="width-17 <%=n_result%>"> + <%=repoman[:next_result].camelcase%> + </td> + <td style="display:none;"> + +<%=package[:amd64_keyword]%> + </td> + </tr> + <%end%> +</table> |