Add new common inventory source fields

This commit is contained in:
Jake McDermott
2020-08-04 16:04:04 -04:00
committed by Ryan Petrello
parent 42e70bc852
commit b253540047
3 changed files with 38 additions and 0 deletions

View File

@@ -194,6 +194,9 @@ export default ['$state', 'ConfigData', '$scope', 'SourcesFormDefinition', 'Pars
verbosity: $scope.verbosity.value,
update_cache_timeout: $scope.update_cache_timeout || 0,
custom_virtualenv: $scope.custom_virtualenv || null,
enabled_var: $scope.enabled_var,
enabled_value: $scope.enabled_value,
host_filter: $scope.host_filter
};
if ($scope.source) {

View File

@@ -233,6 +233,8 @@ export default ['$state', '$scope', 'ParseVariableString', 'ParseTypeChange',
$scope.formSave = function() {
var params;
console.log($scope);
params = {
id: inventorySourceData.id,
name: $scope.name,
@@ -246,6 +248,9 @@ export default ['$state', '$scope', 'ParseVariableString', 'ParseTypeChange',
update_cache_timeout: $scope.update_cache_timeout || 0,
verbosity: $scope.verbosity.value,
custom_virtualenv: $scope.custom_virtualenv || null,
enabled_var: $scope.enabled_var,
enabled_value: $scope.enabled_value,
host_filter: $scope.host_filter
};
if ($scope.source) {

View File

@@ -300,6 +300,36 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n){
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
},
host_filter: {
label: i18n._("Host Filter"),
type: 'text',
dataTitle: i18n._('Host Filter'),
dataPlacement: 'right',
awPopOver: "<p>" + i18n._("Regular expression where only matching hosts will be imported.") + "</p>",
dataContainer: 'body',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
},
enabled_var: {
label: i18n._("Enabled Variable"),
type: 'text',
dataTitle: i18n._('Enabled Variable'),
dataPlacement: 'right',
awPopOver: "<p>" + i18n._("Retrieve the enabled state from the given dict of host variables. The enabled variable may be specified using dot notation, e.g: 'foo.bar'") + "</p>",
dataContainer: 'body',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
},
enabled_value: {
label: i18n._("Enabled Value"),
type: 'text',
dataTitle: i18n._('Enabled Value'),
dataPlacement: 'right',
awPopOver: "<p>" + i18n._("If the enabled variable matches this value, the host will be enabled on import.") + "</p>",
dataContainer: 'body',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
},
checkbox_group: {
label: i18n._('Update Options'),
type: 'checkbox_group',