Skip to content

Commit

Permalink
Merge branch 'master' of github.com:WIPACrepo/iceprod
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Oct 1, 2016
2 parents a795bdc + 8bc2b04 commit 7c82c4f
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 6 deletions.
25 changes: 21 additions & 4 deletions iceprod/server/data/www/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ off-white green: #f6fffd
*/

/* CSS Reset
http://meyerweb.com/eric/tools/css/reset/
http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
Expand All @@ -40,8 +40,8 @@ b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
Expand All @@ -52,7 +52,7 @@ time, mark, audio, video {
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
Expand Down Expand Up @@ -355,3 +355,20 @@ div.logs div.log_body {
color: #fff;
background-color: #aaa
}

.task_completion table, .task_completion tr
{
border: 1px solid #777;
}
.task_completion th, .task_completion td
{
padding: 5px 10px;
}
.task_completion th
{
font-weight: bold;
}
.task_completion
{
margin-top: 15px
}
25 changes: 24 additions & 1 deletion iceprod/server/data/www_templates/dataset_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,28 @@ <h2>Tasks</h2>
</div>
{% end %}
</div>
<div class="task_completion">
<h2>Task Completions by Task Name</h2>
<table>
<tr>
<th>Task Name</th>
<th>Task Type</th>
<th># Q</th>
<th># R</th>
<th># Completions</th>
<th>Avg</th>
<th><sup>max</sup>/<sub>min</sub></th>
<th>Hours</th>
<th>Efficiency</th>
</tr>
{% for t in task_info %}
<tr>
{% for d in t %}
<td>{{ d }}</td>
{% end %}
</tr>
{% end %}
</table>
</div>

{% end %}
{% end %}
9 changes: 9 additions & 0 deletions iceprod/server/dbmethods/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,12 @@ def _web_dataset_by_name_callback(self, ret, callback=None):
callback(ret[0][0])
else:
callback(Exception('name not found'))

@dbmethod
def web_get_task_completion_stats(self, dataset_id, callback=None):
sql = 'select name, requirements from task_rel where dataset_id = ?'
bindings = (dataset_id,)
cb = partial(self._web_get_task_completion_stats_callback, callback=callback)
self.db.sql_read_task(sql,bindings,callback=cb)
def _web_get_task_completion_stats_callback(self, ret, callback=None):
callback(ret)
11 changes: 10 additions & 1 deletion iceprod/server/modules/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,19 @@ def get(self,url):
else:
dataset = None
tasks = yield self.db_call('web_get_tasks_by_status',dataset_id=dataset_id)
task_info = yield self.db_call('web_get_task_completion_stats', dataset_id=dataset_id)
task_info2 = []
for t in task_info:
requirements = tornado.escape.json_decode(t[1])
type = 'CPU'
if 'gpu' in requirements and requirements['gpu']: type = 'GPU'
q = 0
r = 0
task_info2.append([t[0], type, q, r])
if isinstance(tasks,Exception):
raise tasks
self.render_handle('dataset_detail.html',dataset_id=dataset_id,
dataset=dataset,tasks=tasks)
dataset=dataset,tasks=tasks,task_info=task_info2)
else:
datasets = yield self.db_call('web_get_datasets',**filter_results)
if isinstance(datasets,Exception):
Expand Down

0 comments on commit 7c82c4f

Please sign in to comment.