mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 04:10:44 -03: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:
parent
450eaeca96
commit
91e5659042
@ -1,7 +1,7 @@
|
||||
const JOB_END = 'playbook_on_stats';
|
||||
const MAX_LAG = 120;
|
||||
|
||||
function JobStreamService ($q) {
|
||||
function JobEventEngine ($q) {
|
||||
this.init = ({ resource, scroll, page, onEventFrame, onStart, onStop }) => {
|
||||
this.resource = resource;
|
||||
this.scroll = scroll;
|
||||
@ -105,7 +105,7 @@ function JobStreamService ($q) {
|
||||
}
|
||||
};
|
||||
|
||||
this.pushEventData = data => {
|
||||
this.pushEvent = data => {
|
||||
this.lag++;
|
||||
|
||||
this.chain = this.chain
|
||||
@ -221,6 +221,6 @@ function JobStreamService ($q) {
|
||||
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 resource;
|
||||
let scroll;
|
||||
let stream;
|
||||
let engine;
|
||||
|
||||
let vm;
|
||||
|
||||
@ -25,7 +25,7 @@ function JobsIndexController (
|
||||
_page_,
|
||||
_scroll_,
|
||||
_render_,
|
||||
_stream_,
|
||||
_engine_,
|
||||
_$scope_,
|
||||
_$compile_,
|
||||
_$q_,
|
||||
@ -43,7 +43,7 @@ function JobsIndexController (
|
||||
page = _page_;
|
||||
scroll = _scroll_;
|
||||
render = _render_;
|
||||
stream = _stream_;
|
||||
engine = _engine_;
|
||||
|
||||
moment = _moment_;
|
||||
|
||||
@ -113,7 +113,7 @@ function init (pageMode) {
|
||||
render.init({
|
||||
get: () => resource.model.get(`related.${resource.related}.results`),
|
||||
compile: html => $compile(html)($scope),
|
||||
isStreamActive: stream.isActive
|
||||
isStreamActive: engine.isActive
|
||||
});
|
||||
|
||||
scroll.init({
|
||||
@ -122,7 +122,7 @@ function init (pageMode) {
|
||||
next,
|
||||
});
|
||||
|
||||
stream.init({
|
||||
engine.init({
|
||||
page,
|
||||
scroll,
|
||||
resource,
|
||||
@ -178,7 +178,7 @@ function handleSocketEvent (scope, data) {
|
||||
statsEvent = data;
|
||||
}
|
||||
|
||||
stream.pushEventData(data);
|
||||
engine.pushEvent(data);
|
||||
}
|
||||
|
||||
function devClear (pageMode) {
|
||||
@ -228,10 +228,10 @@ function previous () {
|
||||
});
|
||||
}
|
||||
|
||||
function append (events, stream) {
|
||||
function append (events, engine) {
|
||||
return render.append(events)
|
||||
.then(count => {
|
||||
page.updateLineCount(count, stream);
|
||||
page.updateLineCount(count, engine);
|
||||
});
|
||||
}
|
||||
|
||||
@ -292,15 +292,15 @@ function scrollHome () {
|
||||
}
|
||||
|
||||
function scrollEnd () {
|
||||
if (stream.isActive()) {
|
||||
if (stream.isTransitioning()) {
|
||||
if (engine.isActive()) {
|
||||
if (engine.isTransitioning()) {
|
||||
return $q.resolve();
|
||||
}
|
||||
|
||||
if (stream.isPaused()) {
|
||||
stream.resume();
|
||||
if (engine.isPaused()) {
|
||||
engine.resume();
|
||||
} else {
|
||||
stream.pause();
|
||||
engine.pause();
|
||||
}
|
||||
|
||||
return $q.resolve();
|
||||
@ -450,7 +450,7 @@ JobsIndexController.$inject = [
|
||||
'JobPageService',
|
||||
'JobScrollService',
|
||||
'JobRenderService',
|
||||
'JobStreamService',
|
||||
'JobEventEngine',
|
||||
'$scope',
|
||||
'$compile',
|
||||
'$q',
|
||||
|
||||
@ -6,7 +6,7 @@ import Controller from '~features/output/index.controller';
|
||||
import PageService from '~features/output/page.service';
|
||||
import RenderService from '~features/output/render.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 SearchKeyDirective from '~features/output/search-key.directive';
|
||||
@ -208,7 +208,7 @@ angular
|
||||
.service('JobStrings', Strings)
|
||||
.service('JobPageService', PageService)
|
||||
.service('JobScrollService', ScrollService)
|
||||
.service('JobStreamService', StreamService)
|
||||
.service('JobEventEngine', EngineService)
|
||||
.directive('atDetails', DetailsDirective)
|
||||
.directive('atSearchKey', SearchKeyDirective)
|
||||
.directive('atStats', StatsDirective)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user