1 <%= content_for :css do %>
2 <%# https://github.com/mbostock/d3/wiki/Ordinal-Scales %>
3 <% n=-1; %w(#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf).each do |color| %>
4 .colorseries-10-<%= n += 1 %>, .btn.colorseries-10-<%= n %>:hover, .label.colorseries-10-<%= n %>:hover {
5 *background-color: <%= color %>;
6 background-color: <%= color %>;
7 background-image: none;
25 <%#= render :partial => 'nav' %>
27 <div class="tabbable">
28 <ul class="nav nav-tabs">
29 <li class="active"><a href="#files" data-toggle="tab">Files (<%= @object.files ? @object.files.size : 0 %>)</a></li>
30 <li><a href="#provenance" data-toggle="tab">Provenance (<%= @provenance.size %>)</a></li>
31 <li><a href="#jobs" data-toggle="tab">Jobs (<%= @provenance.size %>)</a></li>
32 <li><a href="#sourcedata" data-toggle="tab">Source data (<%= @sourcedata.size %>)</a></li>
33 <li><a href="#owner-groups-resources" data-toggle="tab">Owner, groups, resources</a></li>
34 <li><a href="#provenance2" data-toggle="tab" id="prov-tab">Provenance graph</a></li>
35 <li><a href="#used-by" data-toggle="tab">Used by</a></li>
38 <div class="tab-content">
39 <div id="files" class="tab-pane fade in active">
40 <table class="table table-bordered" style="table-layout: fixed">
45 <th style="width:1.5em">d/l</th>
46 <th style="width: 7em; text-align:right">size</th>
49 <% if @object then @object.files.sort_by{|f|f[1]}.each do |file| %>
50 <% file_path = "#{file[0]}/#{file[1]}" %>
57 <%= link_to file[1], {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'inline'}, {title: 'View in browser'} %>
61 <div style="display:inline-block">
62 <%= link_to raw('<i class="icon-download"></i>'), {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'attachment'}, {class: 'label label-info', title: 'Download'} %>
66 <td style="text-align:right">
67 <%= raw(human_readable_bytes_html(file[2])) %>
75 <div id="provenance" class="tab-pane fade">
76 <table class="topalign table table-bordered">
81 <% @provenance.reverse.each do |p| %>
87 <td style="padding-bottom: 3em">
88 <table class="table" style="margin-bottom: 0; background: #f0f0ff">
89 <% j.script_parameters.each do |k,v| %>
91 <td style="width: 20%">
93 </td><td style="width: 60%">
94 <% if v and @output2job.has_key? v %>
95 <tt class="label colorseries-10-<%= @output2colorindex[v] %>"><%= link_to_if_arvados_object v %></tt>
97 <span class="deemphasize"><%= link_to_if_arvados_object v %></span>
99 </td><td style="text-align: center; width: 20%">
102 labelclass = 'success'
105 labelclass = @output2job.has_key?(v) ? 'warning' : 'danger'
109 <tt class="label label-<%= labelclass %>"><%= labeltext %></tt>
115 <div style="text-align: center">
118 <span class="label"><%= j.script %><br /><tt><%= link_to_if j.script_version.match(/[0-9a-f]{40}/), j.script_version, "https://arvados.org/projects/arvados/repository/revisions/#{j.script_version}/entry/crunch_scripts/#{j.script}" if j.script_version %></tt></span>
122 <tt class="label colorseries-10-<%= @output2colorindex[p[:output]] %>"><%= link_to_if_arvados_object p[:output] %></tt>
126 <tt><span class="deemphasize">job:</span><br /><%= link_to_if_arvados_object j %><br /><span class="deemphasize"><%= j.submit_id %></span></tt>
133 <span class="label label-danger">lookup fail</span>
135 <tt class="deemphasize"><%= p[:target] %></tt>
136 </td><td colspan="5">
146 <div id="provenance2" class="tab-pane fade">
148 function provenance_sizing_fixup() {
149 var a = document.getElementById("provenance_graph");
150 a.style.height = String(window.innerHeight - (a.getBoundingClientRect().top + window.scrollY) - 2) + "px";
151 a.style.width = String(window.innerWidth - 10) + "px";
153 $(window).resize(provenance_sizing_fixup);
155 function graph_zoom(scale) {
156 var pg = document.getElementById("provenance_graph");
157 vcenter = (pg.scrollTop + (pg.scrollHeight - pg.scrollTopMax)/2.0) / pg.scrollHeight;
158 hcenter = (pg.scrollLeft + (pg.scrollWidth - pg.scrollLeftMax)/2.0) / pg.scrollWidth;
159 var g = document.getElementById("graph1").parentNode;
160 g.setAttribute("height", parseFloat(g.getAttribute("height")) * scale);
161 g.setAttribute("width", parseFloat(g.getAttribute("width")) * scale);
162 pg.scrollTop = (vcenter * pg.scrollHeight) - (pg.scrollHeight - pg.scrollTopMax)/2.0;
163 pg.scrollLeft = (hcenter * pg.scrollWidth) - (pg.scrollWidth - pg.scrollLeftMax)/2.0;
167 $('#prov-tab').on('shown', provenance_sizing_fixup);
170 <div style="text-align: right">
171 <a href="#"><span class="icon-zoom-out" onclick="graph_zoom(.9)"></span></a>
172 <a href="#"><span class="icon-zoom-in" onclick="graph_zoom(1./.9)"></span></a>
175 <div id="provenance_graph">
176 <%= raw(@prov_svg) %>
179 <div id="jobs" class="tab-pane fade">
180 <table class="topalign table table-bordered">
182 <tr class="contain-align-left">
200 <% @provenance.reverse.each do |p| %>
207 <tt><%= j.uuid %></tt>
209 <tt class="deemphasize"><%= j.submit_id %></tt>
211 <%= j.script_version %>
213 <span class="label <%= if j.success then 'label-success'; elsif j.active then 'label-primary'; else 'label-warning'; end %>">
214 <%= j.success || j.active ? 'ok' : 'failed' %>
221 <% if j.started_at and j.finished_at %>
222 <%= raw(distance_of_time_in_words(j.started_at, j.finished_at).sub('about ','~').sub(' ',' ')) %>
223 <% elsif j.started_at and j.running %>
224 <%= raw(distance_of_time_in_words(j.started_at, Time.now).sub('about ','~').sub(' ',' ')) %> (running)
232 <span class="label label-danger">lookup fail</span>
234 <tt class="deemphasize"><%= p[:target] %></tt>
235 </td><td colspan="4">
245 <div id="sourcedata" class="tab-pane fade">
246 <table class="table table-bordered table-striped">
248 <tr class="contain-align-left">
251 </th><th class="data-size">
262 <% @sourcedata.values.each do |sourcedata| %>
264 <tr class="collection">
266 <tt class="label"><%= sourcedata[:uuid] %></tt>
267 </td><td class="data-size">
268 <%= raw(human_readable_bytes_html(sourcedata[:collection].data_size)) if sourcedata[:collection] and sourcedata[:collection].data_size %>
270 <% if @protected[sourcedata[:uuid]] %>
271 <span class="label label-success">keep</span>
273 <span class="label label-danger">cache</span>
276 <% if sourcedata[:data_origins] %>
277 <% sourcedata[:data_origins].each do |data_origin| %>
278 <span class="deemphasize"><%= data_origin[0] %></span>
279 <%= data_origin[2] %>
291 <div id="owner-groups-resources" class="tab-pane fade">
292 <%= render :partial => 'application/arvados_object' %>