-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrender.html.erb
46 lines (42 loc) · 1.36 KB
/
render.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Schedule</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="table">
<div id="labels">
<% (0...@finish).step(10) do |n| %>
<div class="column"><div class="line"></div><div class="label"><%= n %></div></div>
<% end %>
<div id="axis">Time (ms)</div>
</div>
<% @tasks.each do |task, period| %>
<div class="task">
<div class="name"><%= task.name %></div>
<% i = 0 %>
<% (0...@finish).step(period) do |time| %>
<% i += 1 %>
<div class="job" style="background: <%= color(task.name) %>; left: <%= time.to_f * 100 / @finish %>%; width: <%= task.runtime.to_f * 100 / @finish %>%">
<%= task.name %><%= i %>
</div>
<% end %>
</div>
<% end %>
<div class="task">
<div class="name">EDF</div>
<% i = Hash.new(0) %>
<% @scheduler.timeline.each do |job, ranges| %>
<% i[job.task] += 1 %>
<% ranges.each do |range| %>
<div class="job" style="background: <%= color(job.task.name) %>; left: <%= range.begin.to_f * 100 / @finish %>%; width: <%= (range.end - range.begin).to_f * 100 / @finish %>%">
<%= job.task.name %><%= i[job.task] %>
</div>
<% end %>
<% end %>
</div>
</div>
</body>
</html>