mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Vertically center smart status icons if they are all of one type
This commit is contained in:
parent
7c16c8c6e7
commit
3e5244821f
@ -31,6 +31,12 @@
|
||||
.pulsate();
|
||||
}
|
||||
|
||||
.SmartStatus-vertCenter{
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.SmartStatus-tooltip{
|
||||
text-align: left;
|
||||
max-width: 250px;
|
||||
|
||||
@ -12,6 +12,8 @@ export default ['$scope', '$filter',
|
||||
}
|
||||
|
||||
function init(){
|
||||
var singleJobStatus = true;
|
||||
var firstJobStatus;
|
||||
var recentJobs = $scope.jobs;
|
||||
var sparkData =
|
||||
_.sortBy(recentJobs.map(function(job) {
|
||||
@ -34,9 +36,27 @@ export default ['$scope', '$filter',
|
||||
data.finished = $filter('longDate')(job.finished) || job.status+"";
|
||||
data.status_tip = "JOB ID: " + data.jobId + "<br>STATUS: " + data.smartStatus + "<br>FINISHED: " + data.finished;
|
||||
|
||||
// If we've already determined that there are both failed and successful jobs OR if the current job in the loop is
|
||||
// pending/waiting/running then we don't worry about checking for a single job status
|
||||
if(singleJobStatus && (isFailureState(job.status) || job.status === "successful")) {
|
||||
if(firstJobStatus) {
|
||||
// We've already been through at least once and have a first job status
|
||||
if(!(isFailureState(firstJobStatus) && isFailureState(job.status) || firstJobStatus === job.status)) {
|
||||
// We have a different status in the array
|
||||
singleJobStatus = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// We haven't set a first job status yet so go ahead set it
|
||||
firstJobStatus = job.status;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}), "sortDate").reverse();
|
||||
|
||||
$scope.singleJobStatus = singleJobStatus;
|
||||
|
||||
$scope.sparkArray = sparkData;
|
||||
}
|
||||
$scope.$watchCollection('jobs', function(){
|
||||
|
||||
@ -13,7 +13,8 @@
|
||||
DashboardList-status"
|
||||
ng-class="{'SmartStatus--success icon-job-successful': job.value === 1,
|
||||
'SmartStatus--failed icon-job-successful': job.value === -1,
|
||||
'SmartStatus--running icon-job-successful': job.value === 0}">
|
||||
'SmartStatus--running icon-job-successful': job.value === 0,
|
||||
'SmartStatus-vertCenter': singleJobStatus}">
|
||||
</i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user