1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

[system_tracking] Display error when no scans for a particular date

This commit is contained in:
Joe Fiorini 2015-06-17 17:20:08 -04:00
parent 5a0ba44155
commit 159ad0d2a9
4 changed files with 24 additions and 4 deletions

View File

@ -9,6 +9,8 @@ export default
rightHostname: '=',
leftScanDate: '=',
rightScanDate: '=',
leftDataNoScans: '=',
rightDataNoScans: '=',
factData: '='
}
};

View File

@ -6,11 +6,13 @@
</span>
</h3>
<h3 class="FactDataTable-column FactDataTableHeading">
<span class="FactDataTableHeading-host">{{leftHostname}}</span>
<span ng-if="leftDataNoScans">No scans for {{leftHostname}} on</span>
<span class="FactDataTableHeading-host" ng-if="!leftDataNoScans">{{leftHostname}}</span>
<span class="FactDataTableHeading-date">{{leftScanDate|longDate}}</span>
</h3>
<h3 class="FactDataTable-column FactDataTableHeading">
<span class="FactDataTableHeading-host">{{rightHostname}}</span>
<span ng-if="rightDataNoScans">No scans for {{rightHostname}} on</span>
<span class="FactDataTableHeading-host" ng-if="!rightDataNoScans">{{rightHostname}}</span>
<span class="FactDataTableHeading-date">{{rightScanDate|longDate}}</span>
</h3>
</div>

View File

@ -63,6 +63,9 @@ function controller($rootScope,
rightRange = searchConfig.leftRange;
}
$scope.leftDataNoScans = false;
$scope.rightDataNoScans = false;
waitIndicator('start');
return getDataForComparison(
@ -73,8 +76,19 @@ function controller($rootScope,
.then(function(responses) {
var data = _.pluck(responses, 'fact');
$scope.leftScanDate = moment(responses[0].timestamp);
$scope.rightScanDate = moment(responses[1].timestamp);
if (_.isEmpty(data[0])) {
$scope.leftDataNoScans = true;
$scope.leftScanDate = $scope.leftDate;
} else {
$scope.leftScanDate = moment(responses[0].timestamp);
}
if (_.isEmpty(data[1])) {
$scope.rightDataNoScans = true;
$scope.rightScanDate = $scope.rightDate;
} else {
$scope.rightScanDate = moment(responses[1].timestamp);
}
return data;
})

View File

@ -45,6 +45,8 @@
right-hostname="rightHostname"
left-scan-date="leftScanDate"
right-scan-date="rightScanDate"
left-data-no-scans="leftDataNoScans"
right-data-no-scans="rightDataNoScans"
fact-data="factData">
</fact-data-table>
</section>