mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
rename to engine service
The rename reflects the fact that this service is now driven by an external caller after being initialized with hooks.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
const JOB_END = 'playbook_on_stats';
|
const JOB_END = 'playbook_on_stats';
|
||||||
const MAX_LAG = 120;
|
const MAX_LAG = 120;
|
||||||
|
|
||||||
function JobStreamService ($q) {
|
function JobEventEngine ($q) {
|
||||||
this.init = ({ resource, scroll, page, onEventFrame, onStart, onStop }) => {
|
this.init = ({ resource, scroll, page, onEventFrame, onStart, onStop }) => {
|
||||||
this.resource = resource;
|
this.resource = resource;
|
||||||
this.scroll = scroll;
|
this.scroll = scroll;
|
||||||
@@ -105,7 +105,7 @@ function JobStreamService ($q) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.pushEventData = data => {
|
this.pushEvent = data => {
|
||||||
this.lag++;
|
this.lag++;
|
||||||
|
|
||||||
this.chain = this.chain
|
this.chain = this.chain
|
||||||
@@ -221,6 +221,6 @@ function JobStreamService ($q) {
|
|||||||
this.isDone = () => this.state.ended;
|
this.isDone = () => this.state.ended;
|
||||||
}
|
}
|
||||||
|
|
||||||
JobStreamService.$inject = ['$q'];
|
JobEventEngine.$inject = ['$q'];
|
||||||
|
|
||||||
export default JobStreamService;
|
export default JobEventEngine;
|
||||||
@@ -13,7 +13,7 @@ let qs;
|
|||||||
let render;
|
let render;
|
||||||
let resource;
|
let resource;
|
||||||
let scroll;
|
let scroll;
|
||||||
let stream;
|
let engine;
|
||||||
|
|
||||||
let vm;
|
let vm;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ function JobsIndexController (
|
|||||||
_page_,
|
_page_,
|
||||||
_scroll_,
|
_scroll_,
|
||||||
_render_,
|
_render_,
|
||||||
_stream_,
|
_engine_,
|
||||||
_$scope_,
|
_$scope_,
|
||||||
_$compile_,
|
_$compile_,
|
||||||
_$q_,
|
_$q_,
|
||||||
@@ -43,7 +43,7 @@ function JobsIndexController (
|
|||||||
page = _page_;
|
page = _page_;
|
||||||
scroll = _scroll_;
|
scroll = _scroll_;
|
||||||
render = _render_;
|
render = _render_;
|
||||||
stream = _stream_;
|
engine = _engine_;
|
||||||
|
|
||||||
moment = _moment_;
|
moment = _moment_;
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ function init (pageMode) {
|
|||||||
render.init({
|
render.init({
|
||||||
get: () => resource.model.get(`related.${resource.related}.results`),
|
get: () => resource.model.get(`related.${resource.related}.results`),
|
||||||
compile: html => $compile(html)($scope),
|
compile: html => $compile(html)($scope),
|
||||||
isStreamActive: stream.isActive
|
isStreamActive: engine.isActive
|
||||||
});
|
});
|
||||||
|
|
||||||
scroll.init({
|
scroll.init({
|
||||||
@@ -122,7 +122,7 @@ function init (pageMode) {
|
|||||||
next,
|
next,
|
||||||
});
|
});
|
||||||
|
|
||||||
stream.init({
|
engine.init({
|
||||||
page,
|
page,
|
||||||
scroll,
|
scroll,
|
||||||
resource,
|
resource,
|
||||||
@@ -178,7 +178,7 @@ function handleSocketEvent (scope, data) {
|
|||||||
statsEvent = data;
|
statsEvent = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.pushEventData(data);
|
engine.pushEvent(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function devClear (pageMode) {
|
function devClear (pageMode) {
|
||||||
@@ -228,10 +228,10 @@ function previous () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function append (events, stream) {
|
function append (events, engine) {
|
||||||
return render.append(events)
|
return render.append(events)
|
||||||
.then(count => {
|
.then(count => {
|
||||||
page.updateLineCount(count, stream);
|
page.updateLineCount(count, engine);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,15 +292,15 @@ function scrollHome () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function scrollEnd () {
|
function scrollEnd () {
|
||||||
if (stream.isActive()) {
|
if (engine.isActive()) {
|
||||||
if (stream.isTransitioning()) {
|
if (engine.isTransitioning()) {
|
||||||
return $q.resolve();
|
return $q.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream.isPaused()) {
|
if (engine.isPaused()) {
|
||||||
stream.resume();
|
engine.resume();
|
||||||
} else {
|
} else {
|
||||||
stream.pause();
|
engine.pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $q.resolve();
|
return $q.resolve();
|
||||||
@@ -450,7 +450,7 @@ JobsIndexController.$inject = [
|
|||||||
'JobPageService',
|
'JobPageService',
|
||||||
'JobScrollService',
|
'JobScrollService',
|
||||||
'JobRenderService',
|
'JobRenderService',
|
||||||
'JobStreamService',
|
'JobEventEngine',
|
||||||
'$scope',
|
'$scope',
|
||||||
'$compile',
|
'$compile',
|
||||||
'$q',
|
'$q',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Controller from '~features/output/index.controller';
|
|||||||
import PageService from '~features/output/page.service';
|
import PageService from '~features/output/page.service';
|
||||||
import RenderService from '~features/output/render.service';
|
import RenderService from '~features/output/render.service';
|
||||||
import ScrollService from '~features/output/scroll.service';
|
import ScrollService from '~features/output/scroll.service';
|
||||||
import StreamService from '~features/output/stream.service';
|
import EngineService from '~features/output/engine.service';
|
||||||
|
|
||||||
import DetailsDirective from '~features/output/details.directive';
|
import DetailsDirective from '~features/output/details.directive';
|
||||||
import SearchKeyDirective from '~features/output/search-key.directive';
|
import SearchKeyDirective from '~features/output/search-key.directive';
|
||||||
@@ -208,7 +208,7 @@ angular
|
|||||||
.service('JobStrings', Strings)
|
.service('JobStrings', Strings)
|
||||||
.service('JobPageService', PageService)
|
.service('JobPageService', PageService)
|
||||||
.service('JobScrollService', ScrollService)
|
.service('JobScrollService', ScrollService)
|
||||||
.service('JobStreamService', StreamService)
|
.service('JobEventEngine', EngineService)
|
||||||
.directive('atDetails', DetailsDirective)
|
.directive('atDetails', DetailsDirective)
|
||||||
.directive('atSearchKey', SearchKeyDirective)
|
.directive('atSearchKey', SearchKeyDirective)
|
||||||
.directive('atStats', StatsDirective)
|
.directive('atStats', StatsDirective)
|
||||||
|
|||||||
Reference in New Issue
Block a user