3 var logViewer = new List('log-viewer', {
4 valueNames: [ 'id', 'timestamp', 'taskid', 'message', 'type'],
10 var makeFilter = function() {
12 $(".toggle-filter").each(function(i, e) {
14 pass.push(e.id.substr(5));
18 return (function(item) {
20 if (item.values().taskid !== "") {
22 if (pass[a] == "successful-tasks" && taskState[item.values().taskid] == "success") { v = true; }
23 if (pass[a] == "failed-tasks" && taskState[item.values().taskid] == "failure") { v = true; }
29 if (pass[a] == item.values().type) { return v; }
36 <% logcollection = Collection.find @object.log %>
38 $.ajax('<%=j url_for logcollection %>/<%=j logcollection.files[0][1] %>').
39 done(function(data, status, jqxhr) {
41 addToLogViewer(logViewer, data.split("\n"), taskState);
42 logViewer.filter(makeFilter());
43 $("#logloadspinner").detach();
46 <%# Live log loading not implemented yet. %>
49 $(".toggle-filter").on("change", function() {
50 logViewer.filter(makeFilter());
53 $("#filter-all").on("click", function() {
54 $(".toggle-filter").each(function(i, f) { f.checked = true; });
55 logViewer.filter(makeFilter());
58 $("#filter-none").on("click", function() {
59 $(".toggle-filter").each(function(i, f) { f.checked = false; console.log(f); });
60 logViewer.filter(makeFilter());
63 $("#sort-by-time").on("change", function() {
67 $("#sort-by-task").on("change", function() {
68 logViewer.sort("taskid", {sortFunction: sortByTaskThenId});
77 <div class="radio-inline">
78 <label><input id="sort-by-time" type="radio" name="sort-radio" checked> Sort by time</label>
80 <div class="radio-inline">
81 <label><input id="sort-by-task" type="radio" name="sort-radio" > Sort by task</label>
84 <div class="checkbox-inline">
85 <label><input id="show-crunch" type="checkbox" checked="true" class="toggle-filter"> Show crunch output</label>
87 <div class="checkbox-inline">
88 <label><input id="show-job-status" type="checkbox" checked="true" class="toggle-filter"> Show job status</label>
90 <div class="checkbox-inline">
91 <label><input id="show-task-dispatch" type="checkbox" checked="true" class="toggle-filter"> Show task dispatch</label>
93 <div class="checkbox-inline">
94 <label><input id="show-task-output" type="checkbox" checked="true" class="toggle-filter"> Show task output</label>
96 <div class="checkbox-inline">
97 <label><input id="show-crunchstat" type="checkbox" checked="true" class="toggle-filter"> Show compute usage</label>
99 <div class="checkbox-inline">
100 <label><input id="show-successful-tasks" type="checkbox" checked="true" class="toggle-filter"> Show successful tasks</label>
102 <div class="checkbox-inline">
103 <label><input id="show-failed-tasks" type="checkbox" checked="true" class="toggle-filter"> Show failed tasks</label>
106 <div class="pull-right">
107 <button id="filter-all" class="btn">
110 <button id="filter-none" class="btn">
115 <table class="log-viewer-table">
118 <th class="id" data-sort="id"></th>
119 <th class="timestamp" data-sort="timestamp">Timestamp</th>
120 <th class="type" data-sort="type">Log type</th>
121 <th class="taskid" data-sort="taskid">Task</th>
122 <th class="message" data-sort="message">Message</th>
128 <td class="timestamp"></td>
129 <td class="type"></td>
130 <td class="taskid"></td>
131 <td class="message"></td>
138 <% if !@object.log %>
139 This job is still running. The job log will be available when the job is complete.
142 <%= image_tag 'ajax-loader.gif', id: "logloadspinner" %>