<script>
-
-function addToLogViewer(logViewer, lines) {
- var re = /((\d\d\d\d)-(\d\d)-(\d\d))_((\d\d):(\d\d):(\d\d)) ([a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}) (\d+) (\d+)? (.*)/;
- for (var a in lines) {
- var v = lines[a].match(re);
- if (v != null) {
- v11 = v[11];
- if (typeof v[11] === 'undefined') {
- v11 = ' ';
- }
-
- var message = v[12];
- var type = "";
- if (v11 != ' ') {
- if (/^stderr /.test(message)) {
- type = "task-output";
- } else {
- type = "task-dispatch";
- }
- } else {
- if (/^status: /.test(message)) {
- type = "job-progress";
- } else {
- type = "crunch";
- }
- }
-
- logViewer.add({
- id: logViewer.items.length,
- timestamp: v[1] + " " + v[5],
- taskid: v11,
- message: message,
- type: type
- });
-
- } else {
- console.log("Did not parse: " + lines[a]);
- }
- }
- logViewer.update();
-}
-
(function() {
var logViewer = new List('log-viewer', {
- valueNames: [ 'id', 'timestamp', 'taskid', 'message', 'type']
+ valueNames: [ 'id', 'timestamp', 'taskid', 'message', 'type'],
+ page: 10000,
});
var makeFilter = function() {
});
}
+<% if @object.log %>
<% logcollection = Collection.find @object.log %>
$.ajax('<%=j url_for logcollection %>/<%=j logcollection.files[0][1] %>').
logViewer.filter(makeFilter());
$("#logloadspinner").detach();
});
+<% else %>
+ <%# Live log loading not implemented yet. %>
+<% end %>
$(".toggle-filter").on("change", function() {
logViewer.filter(makeFilter());
</div>
<br>
<div class="checkbox-inline">
- <label><input id="show-task-output" type="checkbox" checked="true" class="toggle-filter"> Show task output</label>
+ <label><input id="show-crunch" type="checkbox" checked="true" class="toggle-filter"> Show crunch output</label>
+ </div>
+ <div class="checkbox-inline">
+ <label><input id="show-job-status" type="checkbox" checked="true" class="toggle-filter"> Show job status</label>
</div>
<div class="checkbox-inline">
<label><input id="show-task-dispatch" type="checkbox" checked="true" class="toggle-filter"> Show task dispatch</label>
</div>
<div class="checkbox-inline">
- <label><input id="show-crunch" type="checkbox" checked="true" class="toggle-filter"> Show crunch output</label>
+ <label><input id="show-task-output" type="checkbox" checked="true" class="toggle-filter"> Show task output</label>
</div>
<div class="checkbox-inline">
- <label><input id="show-job-progress" type="checkbox" checked="true" class="toggle-filter"> Show job progress</label>
+ <label><input id="show-crunchstat" type="checkbox" checked="true" class="toggle-filter"> Show compute usage</label>
</div>
<div class="pull-right">
</button>
</div>
- <table style='width: 100%; font-family:"Lucida Console", Monaco, monospace; font-size: 11px'>
+ <table class="log-viewer-table">
<thead>
<tr>
- <th class="sort" data-sort="id" style="display:none;"></th>
- <th class="sort" data-sort="timestamp" style="width: 12em">Timestamp</th>
- <th class="sort" data-sort="type" style="width: 8em">Log type</th>
- <th class="sort" data-sort="taskid" style="width: 4em">Task</th>
- <th class="sort" data-sort="message" >Message</th>
+ <th class="id" data-sort="id"></th>
+ <th class="timestamp" data-sort="timestamp">Timestamp</th>
+ <th class="type" data-sort="type">Log type</th>
+ <th class="taskid" data-sort="taskid">Task</th>
+ <th class="message" data-sort="message">Message</th>
</tr>
</thead>
<tbody class="list">
<tr>
- <td class="id" style="display:none;">0</td>
+ <td class="id"></td>
<td class="timestamp"></td>
<td class="type"></td>
- <td class="taskid" style="text-align: center"></td>
+ <td class="taskid"></td>
<td class="message"></td>
</tr>
</tbody>
</div>
+<% if !@object.log %>
+ This job is still running. The job log will be available when the job is complete.
+<% end %>
+
<%= image_tag 'ajax-loader.gif', id: "logloadspinner" %>