From b5bfc8ce295ef4757406229c247afba8af401a09 Mon Sep 17 00:00:00 2001 From: oleg Date: Fri, 8 May 2015 23:21:59 +0300 Subject: [PATCH] accumulate console output + show more build info --- static/js/app/components/builds/item.jade | 6 ++++-- static/js/app/stores/console.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/static/js/app/components/builds/item.jade b/static/js/app/components/builds/item.jade index 60a4d58..945f87f 100644 --- a/static/js/app/components/builds/item.jade +++ b/static/js/app/components/builds/item.jade @@ -1,5 +1,7 @@ -li.list-group-item +li.list-group-item(title= item.status === 'in-progress' ? 'Current step is: ' + item.currentStep : 'Build is done') span.badge= item.status a.pull-right(href="javascript:void(0);", onClick=onBuildSelect(item.id), style={marginRight: '5px'}) show console output - span Build # + span # span= item.id + span + span= item.project.name diff --git a/static/js/app/stores/console.js b/static/js/app/stores/console.js index 11948ff..a29d2f6 100644 --- a/static/js/app/stores/console.js +++ b/static/js/app/stores/console.js @@ -14,17 +14,21 @@ define([ }, onReadConsoleOutput: function(buildId) { - this.output = '' + var self = this; - var resourceName = 'build' + buildId, - self = this; + self.output = ''; + + var resourceName = 'build' + buildId; connect.resource(resourceName).unsubscribeAll(); connect.resource(resourceName).subscribe(function(data) { self.output += data; + + if (!/\n$/.test(self.output)) self.output += '\n'; + self.trigger({ name: 'Console for build #' + buildId, - data: data + data: self.output }); }); }