mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-12 19:05:08 +00:00
35 lines
669 B
JavaScript
35 lines
669 B
JavaScript
'use strict';
|
|
|
|
define([
|
|
'underscore',
|
|
'reflux', 'app/actions/build', 'app/connect'
|
|
], function(_, Reflux, BuildActions, connect) {
|
|
var Store = Reflux.createStore({
|
|
listenables: BuildActions,
|
|
|
|
output: '',
|
|
|
|
init: function() {
|
|
console.log('init builds console output');
|
|
},
|
|
|
|
onReadConsoleOutput: function(buildId) {
|
|
this.output = ''
|
|
|
|
var resourceName = 'build' + buildId,
|
|
self = this;
|
|
|
|
connect.resource(resourceName).unsubscribeAll();
|
|
connect.resource(resourceName).subscribe(function(data) {
|
|
self.output += data;
|
|
self.trigger({
|
|
name: 'Console for build #' + buildId,
|
|
data: data
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
return Store;
|
|
});
|