/
monitor.html.erb
140 lines (127 loc) · 5.23 KB
/
monitor.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<% @pagetitle = "Project #{@project} Status Monitor"
@metarobots = 'noindex,nofollow'
project_bread_crumb( 'Status Monitor' ) -%>
<%= content_for :ready_function do %>
project_monitor_ready();
<% end %>
<%= render :partial => "tabs" %>
<div id="monitor-wrapper">
<!-- Filter Settings -->
<%= form_tag({:controller => 'project', :action => 'monitor'}, :method => :get) do %>
<div id='filter_settings'>
<%= submit_tag 'Filter:'%>
<span class="strong filterlink" id="statuslink">Status <%= image_tag 'arrow.png' %></span>
<div id="statusbox" class="filterbox hidden">
<a class="filterbox_close" href="#" id="statusbox_close">[x]</a>
<% unless @avail_status_values.empty? -%>
<ul>
<% @avail_status_values.each do |s| %>
<% id=s.gsub(' ', '') -%>
<li class="nowrap filteritem" id="li_<%= id %>">
<%= check_box_tag id, 1, @status_filter.include?(s), :class => "statusitem" %>
<label for="<%= id %>" class="strong"><%= s %></label>
</li>
<% end %>
</ul>
<% end -%>
<a href="#" id="statusbox_all" class="filterbox_all">Select all</a><a href="#" id="statusbox_none" class="filterbox_none">Select none</a>
</div>
<label for="pkgname" class="strong">Packagename: </label><%= text_field_tag "pkgname", @name_filter %>
<span class="strong filterlink" id="repolink">Repository <%= image_tag 'arrow.png' %></span>
<div id="repobox" class="hidden filterbox">
<a class="filterbox_close" href="#" id="repobox_close">[x]</a>
<% unless @avail_repo_values.empty? -%>
<ul>
<% @avail_repo_values.each do |s| %>
<li class="nowrap filteritem">
<% sname = valid_xml_id('repo_' + s) %>
<%= check_box_tag s, 1, @repo_filter.include?(s), :class => "repoitem", :id => sname, :name => sname %>
<label for="<%= sname %>" class="strong"><%= s %></label>
</li>
<% end %>
</ul>
<% end -%>
<a href="#" id="repobox_all" class="filterbox_all">Select all</a><a href="#" id="repobox_none" class="filterbox_none">Select none</a>
</div>
<span class="strong filterlink" id="archlink">Architecture <%= image_tag 'arrow.png' %></span>
<div id="archbox" class="hidden filterbox">
<a class="filterbox_close" href="#" id="archbox_close">[x]</a>
<% unless @avail_arch_values.empty? -%>
<ul>
<% @avail_arch_values.each do |s| %>
<li class="nowrap filteritem">
<% sname = valid_xml_id('arch_' + s) %>
<%= check_box_tag s, 1, @arch_filter.include?(s), :class => "architem", :id => sname, :name => sname %>
<label for="<%= sname %>" class="strong"><%= s %></label>
</li>
<% end %>
</ul>
<% end -%>
<a href="#" id="archbox_all" class="filterbox_all">Select all</a><a href="#" id="archbox_none" class="filterbox_none">Select none</a>
</div>
<label for="lastbuild" class="strong">Last time results: </label><%= check_box_tag "lastbuild", 1, @lastbuild_switch %>
<%= hidden_field_tag 'project', @project %>
<%= hidden_field_tag 'defaults', '0' %>
</div>
<% end %>
<% if @buildresult_unavailable -%>
<h3>Buildstatus unavailable</h3>
<% elsif @packagenames.empty? -%>
<h3>No Results</h3>
<% else -%>
<table class="buildstatus">
<!-- repo row -->
<thead class="header">
<tr>
<th></th>
<% @repohash.sort.each do |repo,archlist|
next if archlist.empty? -%>
<th colspan="<%= archlist.length %>"><span class="strong"><%= repo %></span></th>
<% end -%>
</tr>
<!-- arch row -->
<tr>
<th></th>
<% @repohash.sort.each do |repo, archlist| -%>
<% archlist.sort.each do |arch| -%>
<th class="buildstatus"><%= repo_status_icon(@repostatushash[repo][arch],@repostatusdetailshash[repo][arch]) %> <%= arch %></th>
<% end -%>
<% end -%>
</tr>
</thead>
<tbody> <!-- package rows -->
<% @packagenames.each do |packname| -%>
<tr>
<td>
<%= link_to word_break(packname, 40), :controller => "package", :action => "show",
:package => packname, :project => @project.to_s %>
</td>
<% @repohash.sort.each do |repo, archlist| -%>
<% archlist.sort.each do |arch| -%>
<%= arch_repo_table_cell(repo, arch, packname) %>
<% end -%>
<% end -%>
</tr>
<% end -%>
</tbody>
</table>
<% end -%>
<div id="refresh_date"><p>Updated at: <%= DateTime.now.to_s.sub(/T/, " ") %></p></div>
<div id="legend">
<h3>Legend</h3>
<ul>
<% Buildresult::STATUS_DESCRIPTION.each do |status, description| %>
<li><strong><%= status %>: </strong><span class="descr"><%= description %></span></li>
<% end %>
</ul>
</div>
<div id="start_link">
</div>
</div>
<% content_for :ready_function do %>
$('.unresolvable, .blocked').click(function() {
var title = $(this).attr('title');
alert(title);
return false;
});
<% end %>