mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 06:45:09 -02:30
@@ -90,23 +90,14 @@ export default [ 'templateUrl', '$timeout', '$location', '$anchorScroll',
|
|||||||
var visItem,
|
var visItem,
|
||||||
parentItem;
|
parentItem;
|
||||||
|
|
||||||
var containerHeight = $container.height();
|
|
||||||
var containerTop = $container.position().top;
|
|
||||||
var containerNetHeight = containerHeight + containerTop;
|
|
||||||
|
|
||||||
// iterate through each line of standard out
|
// iterate through each line of standard out
|
||||||
$container.find('.JobResultsStdOut-aLineOfStdOut')
|
$container.find('.JobResultsStdOut-aLineOfStdOut:visible')
|
||||||
.each( function () {
|
.each( function () {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
var lineHeight = $this.height();
|
|
||||||
var lineTop = $this.position().top;
|
|
||||||
var lineNetHeight = lineHeight + lineTop;
|
|
||||||
|
|
||||||
// check to see if the line is the first visible
|
// check to see if the line is the first visible
|
||||||
// line in the viewport...
|
// line in the viewport...
|
||||||
if (lineNetHeight > containerTop &&
|
if ($this.position().top >= 0) {
|
||||||
lineTop < containerNetHeight) {
|
|
||||||
|
|
||||||
// ...if it is, return the line number
|
// ...if it is, return the line number
|
||||||
// for this line
|
// for this line
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count', '$scope', 'ParseTypeChange', 'ParseVariableString', 'jobResultsService', 'eventQueue', '$compile', '$log', 'Dataset', '$q', 'Rest', '$state', 'QuerySet', function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTypeChange, ParseVariableString, jobResultsService, eventQueue, $compile, $log, Dataset, $q, Rest, $state, QuerySet) {
|
export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count', '$scope', 'ParseTypeChange', 'ParseVariableString', 'jobResultsService', 'eventQueue', '$compile', '$log', 'Dataset', '$q', 'Rest', '$state', 'QuerySet', '$rootScope', function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTypeChange, ParseVariableString, jobResultsService, eventQueue, $compile, $log, Dataset, $q, Rest, $state, QuerySet, $rootScope) {
|
||||||
|
|
||||||
// used for tag search
|
// used for tag search
|
||||||
$scope.job_event_dataset = Dataset.data;
|
$scope.job_event_dataset = Dataset.data;
|
||||||
|
|
||||||
@@ -47,7 +48,6 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.status_label = getTowerLabel('status');
|
|
||||||
$scope.type_label = getTowerLabel('job_type');
|
$scope.type_label = getTowerLabel('job_type');
|
||||||
$scope.verbosity_label = getTowerLabel('verbosity');
|
$scope.verbosity_label = getTowerLabel('verbosity');
|
||||||
};
|
};
|
||||||
@@ -63,6 +63,27 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
$scope.labels = jobLabels;
|
$scope.labels = jobLabels;
|
||||||
$scope.jobFinished = jobFinished;
|
$scope.jobFinished = jobFinished;
|
||||||
|
|
||||||
|
// update label in left pane and tooltip in right pane when the job_status
|
||||||
|
// changes
|
||||||
|
$scope.$watch('job_status', function(status) {
|
||||||
|
if (status) {
|
||||||
|
$scope.status_label = $scope.jobOptions.status.choices
|
||||||
|
.filter(val => val[0] === status)
|
||||||
|
.map(val => val[1])[0];
|
||||||
|
$scope.status_tooltip = "Job " + $scope.status_label;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// update the job_status value. Use the cached rootScope value if there
|
||||||
|
// is one. This is a workaround when the rest call for the jobData is
|
||||||
|
// made before some socket events come in for the job status
|
||||||
|
if ($rootScope['lastSocketStatus' + jobData.id]) {
|
||||||
|
$scope.job_status = $rootScope['lastSocketStatus' + jobData.id];
|
||||||
|
delete $rootScope['lastSocketStatus' + jobData.id];
|
||||||
|
} else {
|
||||||
|
$scope.job_status = jobData.status;
|
||||||
|
}
|
||||||
|
|
||||||
// turn related api browser routes into tower routes
|
// turn related api browser routes into tower routes
|
||||||
getTowerLinks();
|
getTowerLinks();
|
||||||
|
|
||||||
@@ -114,7 +135,6 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
|
|
||||||
$scope.relaunchJob = function() {
|
$scope.relaunchJob = function() {
|
||||||
jobResultsService.relaunchJob($scope);
|
jobResultsService.relaunchJob($scope);
|
||||||
$state.reload();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.lessLabels = false;
|
$scope.lessLabels = false;
|
||||||
@@ -420,13 +440,19 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
$scope.$on(`ws-jobs`, function(e, data) {
|
$scope.$on(`ws-jobs`, function(e, data) {
|
||||||
if (parseInt(data.unified_job_id, 10) ===
|
if (parseInt(data.unified_job_id, 10) ===
|
||||||
parseInt($scope.job.id,10)) {
|
parseInt($scope.job.id,10)) {
|
||||||
$scope.job.status = data.status;
|
// controller is defined, so set the job_status
|
||||||
}
|
$scope.job_status = data.status;
|
||||||
if (parseInt(data.project_id, 10) ===
|
} else if (parseInt(data.project_id, 10) ===
|
||||||
parseInt($scope.job.project,10)) {
|
parseInt($scope.job.project,10)) {
|
||||||
|
// this is a project status update message, so set the
|
||||||
|
// project status in the left pane
|
||||||
$scope.project_status = data.status;
|
$scope.project_status = data.status;
|
||||||
$scope.project_update_link = `/#/scm_update/${data
|
$scope.project_update_link = `/#/scm_update/${data
|
||||||
.unified_job_id}`;
|
.unified_job_id}`;
|
||||||
|
} else {
|
||||||
|
// controller was previously defined, but is not yet defined
|
||||||
|
// for this job. cache the socket status on root scope
|
||||||
|
$rootScope['lastSocketStatus' + data.unified_job_id] = data.status;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<div class="JobResults-resultRowText">
|
<div class="JobResults-resultRowText">
|
||||||
<i class="JobResults-statusResultIcon
|
<i class="JobResults-statusResultIcon
|
||||||
fa
|
fa
|
||||||
icon-job-{{ job.status }}">
|
icon-job-{{ job_status }}">
|
||||||
</i> {{ status_label }}
|
</i> {{ status_label }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -417,9 +417,10 @@
|
|||||||
<div class="StandardOut-panelHeader">
|
<div class="StandardOut-panelHeader">
|
||||||
<div class="StandardOut-panelHeaderText">
|
<div class="StandardOut-panelHeaderText">
|
||||||
<i class="JobResults-statusResultIcon
|
<i class="JobResults-statusResultIcon
|
||||||
fa icon-job-{{ job.status }}"
|
fa icon-job-{{ job_status }}"
|
||||||
ng-show="stdoutFullScreen"
|
ng-show="stdoutFullScreen"
|
||||||
aw-tool-tip="Job {{status_label}}"
|
aw-tool-tip="Job {{status_label}}"
|
||||||
|
data-tip-watch="status_tooltip"
|
||||||
aw-tip-placement="top"
|
aw-tip-placement="top"
|
||||||
data-original-title>
|
data-original-title>
|
||||||
</i>
|
</i>
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ export default {
|
|||||||
resolve: {
|
resolve: {
|
||||||
// the GET for the particular job
|
// the GET for the particular job
|
||||||
jobData: ['Rest', 'GetBasePath', '$stateParams', '$q', '$state', 'Alert', function(Rest, GetBasePath, $stateParams, $q, $state, Alert) {
|
jobData: ['Rest', 'GetBasePath', '$stateParams', '$q', '$state', 'Alert', function(Rest, GetBasePath, $stateParams, $q, $state, Alert) {
|
||||||
Rest.setUrl(GetBasePath('jobs') + $stateParams.id);
|
|
||||||
var val = $q.defer();
|
var val = $q.defer();
|
||||||
|
|
||||||
|
Rest.setUrl(GetBasePath('jobs') + $stateParams.id);
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
val.resolve(data.data);
|
val.resolve(data.data);
|
||||||
@@ -51,6 +52,7 @@ export default {
|
|||||||
|
|
||||||
$state.go('jobs');
|
$state.go('jobs');
|
||||||
});
|
});
|
||||||
|
|
||||||
return val.promise;
|
return val.promise;
|
||||||
}],
|
}],
|
||||||
Dataset: ['QuerySet', '$stateParams', 'jobData',
|
Dataset: ['QuerySet', '$stateParams', 'jobData',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<li><a href="#stdout" id="stdout-link" data-toggle="tab" ng-click="toggleTab($event, 'stdout-link', 'logview-tabs')">Standard Out</a></li>
|
<li><a href="#stdout" id="stdout-link" data-toggle="tab" ng-click="toggleTab($event, 'stdout-link', 'logview-tabs')">Standard Out</a></li>
|
||||||
<li><a href="#traceback" id="traceback-link" data-toggle="tab" ng-click="toggleTab($event, 'traceback-link', 'logview-tabs')">Traceback</a></li>
|
<li><a href="#traceback" id="traceback-link" data-toggle="tab" ng-click="toggleTab($event, 'traceback-link', 'logview-tabs')">Traceback</a></li>
|
||||||
<li><a href="#options" id="options-link" data-toggle="tab" ng-click="toggleTab($event, 'options-link', 'logview-tabs')">Options</a></li>
|
<li><a href="#options" id="options-link" data-toggle="tab" ng-click="toggleTab($event, 'options-link', 'logview-tabs')">Options</a></li>
|
||||||
<li><a href="#variables" id="variables-link" data-toggle="tab" ng-click="toggleTab($event, 'variable-link', 'logview-tabs')">Extra Vars</a></li>
|
<li><a href="#variables" id="variables-link" data-toggle="tab" ng-click="toggleTab($event, 'variable-link', 'logview-tabs')">Extra Variables</a></li>
|
||||||
<li><a href="#source-variables" id="source-variables-link" data-toggle="tab" ng-click="toggleTab($event, 'source-variable-link', 'logview-tabs')">Source Vars</a></li>
|
<li><a href="#source-variables" id="source-variables-link" data-toggle="tab" ng-click="toggleTab($event, 'source-variable-link', 'logview-tabs')">Source Vars</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: @default-interface-txt;
|
color: @default-interface-txt;
|
||||||
background-color: @default-bg;
|
background-color: @default-bg;
|
||||||
margin-right: 5px;
|
margin-right: 10px;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
max-width: ~"calc(100% - 23px)";
|
max-width: ~"calc(100% - 23px)";
|
||||||
background-color: @default-link;
|
background-color: @default-link;
|
||||||
color: @default-bg;
|
color: @default-bg;
|
||||||
margin-right: 5px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.SmartSearch-deleteContainer {
|
.SmartSearch-deleteContainer {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="StandardOut-detailsRow--extraVars" ng-show="job.extra_vars">
|
<div class="StandardOut-detailsRow--extraVars" ng-show="job.extra_vars">
|
||||||
<div class="StandardOut-detailsLabel">EXTRA VARS</div>
|
<div class="StandardOut-detailsLabel">EXTRA VARIABLES</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="StandardOut-extraVarsContainer" ng-show="job.extra_vars">
|
<div class="StandardOut-extraVarsContainer" ng-show="job.extra_vars">
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ describe('Controller: jobResultsController', () => {
|
|||||||
status: 'finished'
|
status: 'finished'
|
||||||
};
|
};
|
||||||
$rScope.$broadcast('ws-jobs', eventPayload);
|
$rScope.$broadcast('ws-jobs', eventPayload);
|
||||||
expect($scope.job.status).toBe(eventPayload.status);
|
expect($scope.job_status).toBe(eventPayload.status);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user