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

[system_tracking] Disable single result view for host-to-host compares

This commit is contained in:
Joe Fiorini 2015-07-02 16:10:08 -04:00
parent d41b8a363f
commit 714d6a98bf

View File

@ -177,71 +177,75 @@ function controller($rootScope,
$scope.error = null; $scope.error = null;
if (_.isEmpty(info.factData)) { 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.singleFactOnly = true;
$scope.factData = info.leftData.map(function(fact) {
var keyNameMap = activeModule.keyNameMap;
var nameKey = activeModule.nameKey;
var renderOptions = _.merge({}, activeModule);
var isNestedDisplay = false;
var facts;
if (_.isObject(renderOptions.factTemplate) && if ($scope.compareMode === 'host-to-host') {
_.isArray(renderOptions.compareKey)) { 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()
}
});
} else {
$scope.singleFactOnly = true;
$scope.factData = info.leftData.map(function(fact) {
var keyNameMap = activeModule.keyNameMap;
var nameKey = activeModule.nameKey;
var renderOptions = _.merge({}, activeModule);
var isNestedDisplay = false;
var facts;
isNestedDisplay = true; if (_.isObject(renderOptions.factTemplate) &&
_.isArray(renderOptions.compareKey)) {
var templates = _.mapValues(renderOptions.factTemplate, function(template, key) { isNestedDisplay = true;
if (template === true) {
return { render: function(fact) { var templates = _.mapValues(renderOptions.factTemplate, function(template, key) {
return fact[key]; if (template === true) {
} return { render: function(fact) {
return fact[key];
}
};
} else {
return new FactTemplate(template);
}
});
facts = _.map(templates, function(template, key) {
var keyName = key;
if (_.isObject(keyNameMap) && keyNameMap.hasOwnProperty(key)) {
keyName = keyNameMap[key];
}
renderOptions.factTemplate = template;
var formattedValue = formatFactForDisplay(fact, renderOptions);
return { keyName: keyName,
isNestedDisplay: true,
value1: formattedValue
}; };
} else { });
return new FactTemplate(template);
}
});
facts = _.map(templates, function(template, key) {
var keyName = key;
if (_.isObject(keyNameMap) && keyNameMap.hasOwnProperty(key)) { } else {
keyName = keyNameMap[key]; renderOptions.factTemplate = new FactTemplate(renderOptions.factTemplate);
}
renderOptions.factTemplate = template;
var formattedValue = formatFactForDisplay(fact, renderOptions); var formattedValue = formatFactForDisplay(fact, renderOptions);
return { keyName: keyName, isNestedDisplay = false;
isNestedDisplay: true, facts = { keyName: fact[nameKey],
value1: formattedValue value1: formattedValue
}; };
}); }
$scope.isNestedDisplay = isNestedDisplay;
} else { return { displayKeyPath: fact[renderOptions.nameKey],
renderOptions.factTemplate = new FactTemplate(renderOptions.factTemplate); nestingLevel: 0,
var formattedValue = formatFactForDisplay(fact, renderOptions); containsValueArray: false,
isNestedDisplay = false; facts: facts
facts = { keyName: fact[nameKey], };
value1: formattedValue });
}; }
}
$scope.isNestedDisplay = isNestedDisplay;
return { displayKeyPath: fact[renderOptions.nameKey],
nestingLevel: 0,
containsValueArray: false,
facts: facts
};
});
} else { } else {
$scope.singleFactOnly = false; $scope.singleFactOnly = false;
$scope.factData = info.factData; $scope.factData = info.factData;