3 var logViewer = new List('log-viewer', {
4 valueNames: [ 'id', 'timestamp', 'taskid', 'message', 'type'],
8 var makeFilter = function() {
10 $(".toggle-filter").each(function(i, e) {
12 pass.push(e.id.substr(5));
15 return (function(item) {
17 if (pass[a] == item.values().type) { return true; }
24 <% logcollection = Collection.find @object.log %>
26 $.ajax('<%=j url_for logcollection %>/<%=j logcollection.files[0][1] %>').
27 done(function(data, status, jqxhr) {
29 addToLogViewer(logViewer, data.split("\n"));
30 logViewer.filter(makeFilter());
31 $("#logloadspinner").detach();
34 <%# Live log loading not implemented yet. %>
37 $(".toggle-filter").on("change", function() {
38 logViewer.filter(makeFilter());
41 $("#filter-all").on("click", function() {
42 $(".toggle-filter").each(function(i, f) { f.checked = true; });
43 logViewer.filter(makeFilter());
46 $("#filter-none").on("click", function() {
47 $(".toggle-filter").each(function(i, f) { f.checked = false; console.log(f); });
48 logViewer.filter(makeFilter());
51 $("#sort-by-time").on("change", function() {
55 $("#sort-by-task").on("change", function() {
56 logViewer.sort("taskid");
65 <div class="radio-inline">
66 <label><input id="sort-by-time" type="radio" name="sort-radio" checked> Sort by time</label>
68 <div class="radio-inline">
69 <label><input id="sort-by-task" type="radio" name="sort-radio" > Sort by task</label>
72 <div class="checkbox-inline">
73 <label><input id="show-crunch" type="checkbox" checked="true" class="toggle-filter"> Show crunch output</label>
75 <div class="checkbox-inline">
76 <label><input id="show-job-status" type="checkbox" checked="true" class="toggle-filter"> Show job status</label>
78 <div class="checkbox-inline">
79 <label><input id="show-task-dispatch" type="checkbox" checked="true" class="toggle-filter"> Show task dispatch</label>
81 <div class="checkbox-inline">
82 <label><input id="show-task-output" type="checkbox" checked="true" class="toggle-filter"> Show task output</label>
84 <div class="checkbox-inline">
85 <label><input id="show-crunchstat" type="checkbox" checked="true" class="toggle-filter"> Show compute usage</label>
88 <div class="pull-right">
89 <button id="filter-all" class="btn">
92 <button id="filter-none" class="btn">
97 <table class="log-viewer-table">
100 <th class="id" data-sort="id"></th>
101 <th class="timestamp" data-sort="timestamp">Timestamp</th>
102 <th class="type" data-sort="type">Log type</th>
103 <th class="taskid" data-sort="taskid">Task</th>
104 <th class="message" data-sort="message">Message</th>
110 <td class="timestamp"></td>
111 <td class="type"></td>
112 <td class="taskid"></td>
113 <td class="message"></td>
120 <% if !@object.log %>
121 This job is still running. The job log will be available when the job is complete.
124 <%= image_tag 'ajax-loader.gif', id: "logloadspinner" %>