[ARVADOS] updated: 358a23f9c4aa0016b5cfbee70c4897e2e8d4d871
git at public.curoverse.com
git at public.curoverse.com
Fri Jun 13 10:10:48 EDT 2014
Summary of changes:
.../workbench/app/assets/javascripts/log_viewer.js | 56 +++++++++++++++++++++
apps/workbench/app/views/jobs/_show_log.html.erb | 58 ----------------------
2 files changed, 56 insertions(+), 58 deletions(-)
create mode 100644 apps/workbench/app/assets/javascripts/log_viewer.js
via 358a23f9c4aa0016b5cfbee70c4897e2e8d4d871 (commit)
from a441b0496a0f217856f23ae084502afdba959e81 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 358a23f9c4aa0016b5cfbee70c4897e2e8d4d871
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Jun 13 10:10:40 2014 -0400
2883: Moved addToLogViewer function out of the template and into assets and
reformatted it properly.
diff --git a/apps/workbench/app/assets/javascripts/log_viewer.js b/apps/workbench/app/assets/javascripts/log_viewer.js
new file mode 100644
index 0000000..e152c6f
--- /dev/null
+++ b/apps/workbench/app/assets/javascripts/log_viewer.js
@@ -0,0 +1,56 @@
+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) {
+
+ var ts = new Date(Date.UTC(v[2], v[3], v[4], v[6], v[7], v[8]));
+
+ v11 = v[11];
+ if (typeof v[11] === 'undefined') {
+ v11 = ' ';
+ }
+
+ var message = v[12];
+ var type = "";
+ if (v11 != ' ') {
+ if (/^stderr /.test(message)) {
+ if (/^stderr crunchstat: /.test(message)) {
+ type = "crunchstat";
+ message = message.substr(19);
+ } else if (/^stderr srun: /.test(message)) {
+ type = "task-dispatch";
+ message = message.substr(7);
+ } else if (/^stderr slurmd/.test(message)) {
+ type = "task-dispatch";
+ message = message.substr(7);
+ } else {
+ type = "task-output";
+ message = message.substr(7);
+ }
+ } else {
+ type = "task-dispatch";
+ }
+ } else {
+ if (/^status: /.test(message)) {
+ type = "job-status";
+ message = message.substr(8);
+ } else {
+ type = "crunch";
+ }
+ }
+
+ logViewer.add({
+ id: logViewer.items.length,
+ timestamp: ts.toLocaleDateString() + " " + ts.toLocaleTimeString(),
+ taskid: v11,
+ message: message,
+ type: type
+ });
+
+ } else {
+ console.log("Did not parse: " + lines[a]);
+ }
+ }
+ logViewer.update();
+}
diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index 042e5cb..717eb71 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -1,62 +1,4 @@
<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) {
-
- var ts = new Date(Date.UTC(v[2], v[3], v[4], v[6], v[7], v[8]));
-
- v11 = v[11];
- if (typeof v[11] === 'undefined') {
- v11 = ' ';
- }
-
- var message = v[12];
- var type = "";
- if (v11 != ' ') {
- if (/^stderr /.test(message)) {
- if (/^stderr crunchstat: /.test(message)) {
- type = "crunchstat";
- message = message.substr(19);
- } else if (/^stderr srun: /.test(message)) {
- type = "task-dispatch";
- message = message.substr(7);
- } else if (/^stderr slurmd/.test(message)) {
- type = "task-dispatch";
- message = message.substr(7);
- } else {
- type = "task-output";
- message = message.substr(7);
- }
- } else {
- type = "task-dispatch";
- }
- } else {
- if (/^status: /.test(message)) {
- type = "job-status";
- message = message.substr(8);
- } else {
- type = "crunch";
- }
- }
-
- logViewer.add({
- id: logViewer.items.length,
- timestamp: ts.toLocaleDateString() + " " + ts.toLocaleTimeString(),
- 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'],
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list