mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
fixed error reporting on system tracking
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
// background-color: @ansible-red;
|
// background-color: @ansible-red;
|
||||||
|
|
||||||
&-message {
|
&-message {
|
||||||
font-family: merriweather;
|
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -20,5 +19,8 @@
|
|||||||
|
|
||||||
&-note {
|
&-note {
|
||||||
|
|
||||||
|
&--full {
|
||||||
|
font-size: 22px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
background-color: @enabled-item-background;
|
background-color: @enabled-item-background;
|
||||||
border-color: @enabled-item-border;
|
border-color: @enabled-item-border;
|
||||||
color: @enabled-item-text;
|
color: @enabled-item-text;
|
||||||
|
box-shadow: none;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ function controller($rootScope,
|
|||||||
hostIds.length === 1 ? 'single-host' : 'host-to-host';
|
hostIds.length === 1 ? 'single-host' : 'host-to-host';
|
||||||
$scope.hostIds = $routeParams.hosts;
|
$scope.hostIds = $routeParams.hosts;
|
||||||
$scope.inventory = $routeParams.model.inventory;
|
$scope.inventory = $routeParams.model.inventory;
|
||||||
|
$scope.noModuleData = false;
|
||||||
|
|
||||||
|
// this means no scans have been run
|
||||||
|
if (_.isEmpty(moduleOptions)) {
|
||||||
|
$scope.noModuleData = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($scope.compareMode === 'host-to-host') {
|
if ($scope.compareMode === 'host-to-host') {
|
||||||
$scope.factModulePickersLabelLeft = "Compare latest facts collected across both hosts on or before";
|
$scope.factModulePickersLabelLeft = "Compare latest facts collected across both hosts on or before";
|
||||||
@@ -75,7 +82,16 @@ function controller($rootScope,
|
|||||||
rightRange)
|
rightRange)
|
||||||
.then(function(responses) {
|
.then(function(responses) {
|
||||||
var data = _.pluck(responses, 'fact');
|
var data = _.pluck(responses, 'fact');
|
||||||
|
if (_.isEmpty(data[0]) && _.isEmpty(data[1])) {
|
||||||
|
return _.reject({
|
||||||
|
name: 'NoScanData',
|
||||||
|
message: 'There was insufficient scan data for both of the dates you selected. Please try selecting a different date or module.',
|
||||||
|
dateValues:
|
||||||
|
{ leftDate: $scope.leftDate.clone(),
|
||||||
|
rightDate: $scope.rightDate.clone()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
if (_.isEmpty(data[0])) {
|
if (_.isEmpty(data[0])) {
|
||||||
$scope.leftDataNoScans = true;
|
$scope.leftDataNoScans = true;
|
||||||
$scope.leftScanDate = $scope.leftDate;
|
$scope.leftScanDate = $scope.leftDate;
|
||||||
@@ -119,7 +135,7 @@ function controller($rootScope,
|
|||||||
// we have NO data, throw an error
|
// we have NO data, throw an error
|
||||||
result = _.reject({
|
result = _.reject({
|
||||||
name: 'NoScanData',
|
name: 'NoScanData',
|
||||||
message: 'No scans ran on eithr of the dates you selected. Please try selecting different dates.',
|
message: 'No scans ran on either of the dates you selected. Please try selecting different dates.',
|
||||||
dateValues:
|
dateValues:
|
||||||
{ leftDate: $scope.leftDate.clone(),
|
{ leftDate: $scope.leftDate.clone(),
|
||||||
rightDate: $scope.rightDate.clone()
|
rightDate: $scope.rightDate.clone()
|
||||||
@@ -146,6 +162,16 @@ function controller($rootScope,
|
|||||||
// Clear out any errors from the previous run...
|
// Clear out any errors from the previous run...
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
|
|
||||||
|
if (_.isEmpty(info.factData)) {
|
||||||
|
info = _.reject({
|
||||||
|
name: 'NoScanDifferences',
|
||||||
|
message: 'No differences in the scans on the dates you selected. Please try selecting different dates.',
|
||||||
|
dateValues:
|
||||||
|
{ leftDate: $scope.leftDate.clone(),
|
||||||
|
rightDate: $scope.rightDate.clone()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
$scope.factData = info.factData;
|
$scope.factData = info.factData;
|
||||||
$scope.isNestedDisplay = info.isNestedDisplay;
|
$scope.isNestedDisplay = info.isNestedDisplay;
|
||||||
|
|
||||||
@@ -163,21 +189,22 @@ function controller($rootScope,
|
|||||||
return module.name === newModuleName;
|
return module.name === newModuleName;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (newModule.isActive) {
|
if (newModule) {
|
||||||
return;
|
if (newModule.isActive) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$scope.modules.forEach(function(module) {
|
||||||
|
module.isActive = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
newModule.isActive = true;
|
||||||
|
|
||||||
|
$location.replace();
|
||||||
|
$location.search('module', newModuleName);
|
||||||
|
|
||||||
|
reloadData({ module: newModule
|
||||||
|
}, initialData).value();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.modules.forEach(function(module) {
|
|
||||||
module.isActive = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
newModule.isActive = true;
|
|
||||||
|
|
||||||
$location.replace();
|
|
||||||
$location.search('module', newModuleName);
|
|
||||||
|
|
||||||
reloadData({ module: newModule
|
|
||||||
}, initialData).value();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function dateWatcher(dateProperty) {
|
function dateWatcher(dateProperty) {
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
<section class="SystemTrackingContainer">
|
<section class="SystemTrackingContainer" ng-if="noModuleData">
|
||||||
|
<breadcrumbs>
|
||||||
|
<breadcrumb path="/inventories" title="Inventories"></breadcrumb>
|
||||||
|
<breadcrumb path="/inventories/{{inventory.id}}/manage" title="{{inventory.name}}"></breadcrumb>
|
||||||
|
<breadcrumb path="/inventories/{{inventory.id}}/system-tracking/{{hostIds}}" title="System Tracking" current="true"></breadcrumb>
|
||||||
|
</breadcrumbs>
|
||||||
|
|
||||||
|
<section class="FactDataError SystemTrackingContainer-main">
|
||||||
|
<p class="FactDataError-note--full">
|
||||||
|
To setup or run scan jobs, edit the "<a link-to="inventoryEdit" model="{ inventory_id: inventory }">{{inventory.name}}</a>" inventory and select "Scan Jobs Templates".
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
<section class="SystemTrackingContainer" ng-if="!noModuleData">
|
||||||
<breadcrumbs>
|
<breadcrumbs>
|
||||||
<breadcrumb path="/inventories" title="Inventories"></breadcrumb>
|
<breadcrumb path="/inventories" title="Inventories"></breadcrumb>
|
||||||
<breadcrumb path="/inventories/{{inventory.id}}/manage" title="{{inventory.name}}"></breadcrumb>
|
<breadcrumb path="/inventories/{{inventory.id}}/manage" title="{{inventory.name}}"></breadcrumb>
|
||||||
@@ -31,16 +44,17 @@
|
|||||||
|
|
||||||
<section class="FactDataError SystemTrackingContainer-main" ng-if="error" ng-switch="error.name">
|
<section class="FactDataError SystemTrackingContainer-main" ng-if="error" ng-switch="error.name">
|
||||||
<p class="FactDataError-message" ng-switch-when="NoScanData">
|
<p class="FactDataError-message" ng-switch-when="NoScanData">
|
||||||
There were no facts collected on or before the dates you selected ({{error.dateValues.leftDate|amDateFormat:'L'}} and {{error.dateValues.rightDate|amDateFormat:'L'}}). Please pick a different range or module and try again.
|
There was insufficient scan data for either of the dates you selected. Please try selecting a different date or module.
|
||||||
</p>
|
</p>
|
||||||
<p class="FactDataError-message" ng-switch-when="InsufficientScanData">
|
<p class="FactDataError-message" ng-switch-when="InsufficientScanData">
|
||||||
There were no facts collected on or before one of the dates you selected ({{error.dateValue|amDateFormat:'L'}}). Please select a different date and try again.
|
There were no facts collected on or before one of the dates you selected ({{error.dateValue|amDateFormat:'L'}}). Please select a different date and try again.
|
||||||
</p>
|
</p>
|
||||||
<p class="FactDataError-note">
|
<p class="FactDataError-note">
|
||||||
To setup or run scan jobs, edit the "<a link-to="inventoryEdit" model="{ inventory_id: inventory }">{{inventory.name}}</a>" inventory and select "Scan Jobs Templates".
|
We were not able to find any facts collected for this inventory or module. To setup or run scan jobs, edit the "<a link-to="inventoryEdit" model="{ inventory_id: inventory }">{{inventory.name}}</a>" inventory and select "Scan Jobs Templates".
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<fact-data-table
|
<fact-data-table
|
||||||
|
ng-if="!error"
|
||||||
left-hostname="leftHostname"
|
left-hostname="leftHostname"
|
||||||
right-hostname="rightHostname"
|
right-hostname="rightHostname"
|
||||||
left-scan-date="leftScanDate"
|
left-scan-date="leftScanDate"
|
||||||
|
|||||||
Reference in New Issue
Block a user