mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 14:09:28 -02:30
Merge pull request #2974 from jakemcdermott/fix-2968
delete text nodes when removing output lines
This commit is contained in:
@@ -838,6 +838,15 @@ function OutputIndexController (
|
|||||||
|
|
||||||
return last();
|
return last();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$on('$destroy', () => {
|
||||||
|
stopListening();
|
||||||
|
|
||||||
|
render.clear();
|
||||||
|
render.el.remove();
|
||||||
|
slide.clear();
|
||||||
|
stream.bufferInit();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputIndexController.$inject = [
|
OutputIndexController.$inject = [
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Entities from 'html-entities';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
EVENT_START_PLAY,
|
EVENT_START_PLAY,
|
||||||
|
EVENT_START_PLAYBOOK,
|
||||||
EVENT_STATS_PLAY,
|
EVENT_STATS_PLAY,
|
||||||
EVENT_START_TASK,
|
EVENT_START_TASK,
|
||||||
OUTPUT_ANSI_COLORMAP,
|
OUTPUT_ANSI_COLORMAP,
|
||||||
@@ -208,6 +209,10 @@ function JobRenderService ($q, $sce, $window) {
|
|||||||
const lines = stdout.split('\r\n');
|
const lines = stdout.split('\r\n');
|
||||||
const record = this.createRecord(event, lines);
|
const record = this.createRecord(event, lines);
|
||||||
|
|
||||||
|
if (event.event === EVENT_START_PLAYBOOK) {
|
||||||
|
return { html: '', count: 0 };
|
||||||
|
}
|
||||||
|
|
||||||
let html = '';
|
let html = '';
|
||||||
let count = lines.length;
|
let count = lines.length;
|
||||||
let ln = event.start_line;
|
let ln = event.start_line;
|
||||||
@@ -228,6 +233,10 @@ function JobRenderService ($q, $sce, $window) {
|
|||||||
html += row;
|
html += row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.records[event.uuid]) {
|
||||||
|
this.records[event.uuid].lineCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
return { html, count };
|
return { html, count };
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -433,18 +442,24 @@ function JobRenderService ($q, $sce, $window) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.removeAll = () => {
|
this.removeAll = () => {
|
||||||
const elements = this.el.children();
|
const elements = this.el.contents();
|
||||||
return this.remove(elements);
|
return this.remove(elements);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.shift = lines => {
|
this.shift = lines => {
|
||||||
const elements = this.el.children().slice(0, lines);
|
// We multiply by two here under the assumption that one element and one text node
|
||||||
|
// is generated for each line of output.
|
||||||
|
const count = 2 * lines;
|
||||||
|
const elements = this.el.contents().slice(0, count);
|
||||||
|
|
||||||
return this.remove(elements);
|
return this.remove(elements);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.pop = lines => {
|
this.pop = lines => {
|
||||||
const elements = this.el.children().slice(-lines);
|
// We multiply by two here under the assumption that one element and one text node
|
||||||
|
// is generated for each line of output.
|
||||||
|
const count = 2 * lines;
|
||||||
|
const elements = this.el.contents().slice(-count);
|
||||||
|
|
||||||
return this.remove(elements);
|
return this.remove(elements);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -126,6 +126,13 @@ function SlidingWindowService ($q) {
|
|||||||
return frames.filter(({ counter }) => counter > tail);
|
return frames.filter(({ counter }) => counter > tail);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.clear = () => {
|
||||||
|
this.buffer.events.length = 0;
|
||||||
|
this.buffer.min = 0;
|
||||||
|
this.buffer.max = 0;
|
||||||
|
this.buffer.count = 0;
|
||||||
|
};
|
||||||
|
|
||||||
this.getFrames = () => $q.resolve(this.buffer.events);
|
this.getFrames = () => $q.resolve(this.buffer.events);
|
||||||
|
|
||||||
this.getMaxCounter = () => {
|
this.getMaxCounter = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user