3 var logViewer = new List('log-viewer', {
4 valueNames: [ 'id', 'timestamp', 'taskid', 'message', 'type'],
8 var taskState = {"success_count": 0, "failure_count": 0};
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].outcome == "success") { v = true; }
23 if (pass[a] == "failed-tasks" && taskState[item.values().taskid].outcome == "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 generateJobOverview("#log-viewer-overview", logViewer, taskState);
44 $("#logloadspinner").detach();
47 <%# Live log loading not implemented yet. %>
50 $(".toggle-filter").on("change", function() {
51 logViewer.filter(makeFilter());
54 $("#filter-all").on("click", function() {
55 $(".toggle-filter").each(function(i, f) { f.checked = true; });
56 logViewer.filter(makeFilter());
59 $("#filter-none").on("click", function() {
60 $(".toggle-filter").each(function(i, f) { f.checked = false; console.log(f); });
61 logViewer.filter(makeFilter());
64 $("#sort-by-time").on("change", function() {
65 logViewer.sort("id", {sortFunction: sortById});
68 $("#sort-by-task").on("change", function() {
69 logViewer.sort("taskid", {sortFunction: sortByTask});
72 $("#sort-by-node").on("change", function() {
73 logViewer.sort("node", {sortFunction: sortByNode});
83 <div id="log-viewer-overview"></div>
87 <span class="pull-right">
88 <button id="filter-all" class="btn">
91 <button id="filter-none" class="btn">
98 <div class="radio-inline log-viewer-button" style="margin-left: 10px">
99 <label><input id="sort-by-time" type="radio" name="sort-radio" checked> Sort by time</label>
101 <div class="radio-inline log-viewer-button">
102 <label><input id="sort-by-node" type="radio" name="sort-radio" > Sort by node</label>
105 <div class="radio-inline log-viewer-button">
106 <label><input id="sort-by-task" type="radio" name="sort-radio" > Sort by task</label>
111 <div class="checkbox-inline log-viewer-button" style="margin-left: 10px">
112 <label><input id="show-crunch" type="checkbox" checked="true" class="toggle-filter"> Show crunch output</label>
114 <div class="checkbox-inline log-viewer-button">
115 <label><input id="show-job-status" type="checkbox" checked="true" class="toggle-filter"> Show job status</label>
117 <div class="checkbox-inline log-viewer-button">
118 <label><input id="show-task-dispatch" type="checkbox" checked="true" class="toggle-filter"> Show task dispatch</label>
120 <div class="checkbox-inline log-viewer-button">
121 <label><input id="show-task-output" type="checkbox" checked="true" class="toggle-filter"> Show task output</label>
123 <div class="checkbox-inline log-viewer-button">
124 <label><input id="show-crunchstat" type="checkbox" checked="true" class="toggle-filter"> Show compute usage</label>
126 <div class="checkbox-inline log-viewer-button">
127 <label><input id="show-successful-tasks" type="checkbox" checked="true" class="toggle-filter"> Show successful tasks</label>
129 <div class="checkbox-inline log-viewer-button">
130 <label><input id="show-failed-tasks" type="checkbox" checked="true" class="toggle-filter"> Show failed tasks</label>
134 <table class="log-viewer-table">
137 <th class="id" data-sort="id"></th>
138 <th class="timestamp" data-sort="timestamp">Timestamp</th>
139 <th class="node" data-sort="taskid">Node</th>
140 <th class="type" data-sort="type">Log type</th>
141 <th class="taskid" data-sort="taskid">Task</th>
142 <th class="message" data-sort="message">Message</th>
148 <td class="timestamp"></td>
149 <td class="node"></td>
150 <td class="type"></td>
151 <td class="taskid"></td>
152 <td class="message"></td>
159 <% if !@object.log %>
160 This job is still running. The job log will be available when the job is complete.
163 <%= image_tag 'ajax-loader.gif', id: "logloadspinner" %>