Add support for in progress jobs and omit expand

* Any event received by the stream service will start rendering
(instead of JOB_START events only)
* Expand/collapse only shown for static results
This commit is contained in:
gconsidine 2018-03-14 15:21:33 -04:00 committed by Jake McDermott
parent 033314e4f6
commit a23e5e920f
3 changed files with 7 additions and 6 deletions

View File

@ -72,12 +72,13 @@ function JobsIndexController (
function init (pageMode) {
page.init({
resource
resource,
});
render.init({
get: () => resource.model.get(`related.${resource.related}.results`),
compile: html => $compile(html)($scope)
compile: html => $compile(html)($scope),
isStreamActive: stream.isActive
});
scroll.init({

View File

@ -22,11 +22,11 @@ const ansi = new Ansi();
const entities = new Entities.AllHtmlEntities();
function JobRenderService ($q, $sce, $window) {
this.init = ({ compile, apply, get }) => {
this.init = ({ compile, apply, isStreamActive }) => {
this.parent = null;
this.record = {};
this.el = $(ELEMENT_TBODY);
this.hooks = { get, compile, apply };
this.hooks = { isStreamActive, compile, apply };
};
this.sortByLineNumber = (a, b) => {
@ -155,7 +155,7 @@ function JobRenderService ($q, $sce, $window) {
}
if (current) {
if (current.isParent && current.line === ln) {
if (!this.hooks.isStreamActive() && current.isParent && current.line === ln) {
id = current.uuid;
tdToggle = `<td class="at-Stdout-toggle" ng-click="vm.toggle('${id}')"><i class="fa fa-angle-down can-toggle"></i></td>`;
}

View File

@ -110,7 +110,7 @@ function JobStreamService ($q) {
this.chain = this.chain
.then(() => {
if (data.event === JOB_START) {
if (!this.isActive()) {
this.start();
} else if (data.event === JOB_END) {
if (this.isPaused()) {