mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Fixed inventory codemirrors and tweaked delete source warning
This commit is contained in:
parent
832e55f964
commit
5c79561b7d
@ -20,7 +20,7 @@ function InventoriesEdit($scope, $location,
|
||||
form = InventoryForm,
|
||||
inventory_id = $stateParams.inventory_id,
|
||||
master = {},
|
||||
fld, json_data, data;
|
||||
fld, data;
|
||||
|
||||
ClearScope();
|
||||
init();
|
||||
@ -45,9 +45,9 @@ function InventoriesEdit($scope, $location,
|
||||
.success(function(data) {
|
||||
var fld;
|
||||
for (fld in form.fields) {
|
||||
if (fld === 'variables') {
|
||||
$scope.variables = ParseVariableString(data.variables);
|
||||
master.variables = $scope.variables;
|
||||
if (fld === 'inventory_variables') {
|
||||
$scope.inventory_variables = ParseVariableString(data.variables);
|
||||
master.inventory_variables = $scope.variables;
|
||||
} else if (fld === 'inventory_name') {
|
||||
$scope[fld] = data.name;
|
||||
master[fld] = $scope[fld];
|
||||
@ -71,9 +71,9 @@ function InventoriesEdit($scope, $location,
|
||||
$scope.parseType = 'yaml';
|
||||
ParseTypeChange({
|
||||
scope: $scope,
|
||||
variable: 'variables',
|
||||
variable: 'inventory_variables',
|
||||
parse_variable: 'parseType',
|
||||
field_id: 'inventory_variables'
|
||||
field_id: 'inventory_inventory_variables'
|
||||
});
|
||||
|
||||
OrgAdminLookup.checkForAdminAccess({organization: data.organization})
|
||||
@ -83,8 +83,6 @@ function InventoriesEdit($scope, $location,
|
||||
|
||||
$scope.inventory_obj = data;
|
||||
$scope.name = data.name;
|
||||
|
||||
$scope.$emit('inventoryLoaded');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors($scope, data, status, null, {
|
||||
@ -96,9 +94,6 @@ function InventoriesEdit($scope, $location,
|
||||
$scope.formSave = function() {
|
||||
Wait('start');
|
||||
|
||||
// Make sure we have valid variable data
|
||||
json_data = ToJSON($scope.parseType, $scope.variables);
|
||||
|
||||
data = {};
|
||||
for (fld in form.fields) {
|
||||
if (form.fields[fld].realName) {
|
||||
|
||||
@ -20,10 +20,10 @@ export default ['$state', '$stateParams', '$scope', 'GroupForm',
|
||||
// apply form definition's default field values
|
||||
GenerateForm.applyDefaults(form, $scope);
|
||||
|
||||
rbacUiControlService.canAdd(GetBasePath('inventory') + $stateParams.inventory_id + "/groups")
|
||||
.then(function(canAdd) {
|
||||
$scope.canAdd = canAdd;
|
||||
});
|
||||
rbacUiControlService.canAdd(GetBasePath('inventory') + $stateParams.inventory_id + "/groups")
|
||||
.then(function(canAdd) {
|
||||
$scope.canAdd = canAdd;
|
||||
});
|
||||
$scope.parseType = 'yaml';
|
||||
$scope.envParseType = 'yaml';
|
||||
ParseTypeChange({
|
||||
|
||||
@ -75,7 +75,8 @@ function(i18n, buildGroupsListState, buildGroupsAddState, buildGroupsEditState,
|
||||
ngDisabled: '!(inventory_obj.summary_fields.user_capabilities.edit || canAdd) || !canEditOrg',
|
||||
awLookupWhen: '(inventory_obj.summary_fields.user_capabilities.edit || canAdd) && canEditOrg'
|
||||
},
|
||||
variables: {
|
||||
inventory_variables: {
|
||||
realName: 'variables',
|
||||
label: i18n._('Variables'),
|
||||
type: 'textarea',
|
||||
class: 'Form-formGroup--fullWidth',
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
$state.go('inventories.edit.inventory_sources.edit', {inventory_source_id: id});
|
||||
};
|
||||
$scope.deleteSource = function(inventory_source){
|
||||
var body = '<div class=\"Prompt-bodyQuery\">Are you sure you want to permanently delete the inventory source below from the inventory?</div><div class=\"Prompt-bodyTarget\">' + $filter('sanitize')(inventory_source.name) + '</div>';
|
||||
var body = '<div class=\"Prompt-bodyQuery\">Are you sure you want to permanently delete the inventory source below from the inventory? Hosts generated by this inventory source will also be deleted.</div><div class=\"Prompt-bodyTarget\">' + $filter('sanitize')(inventory_source.name) + '</div>';
|
||||
var action = function(){
|
||||
delete $rootScope.promptActionBtnClass;
|
||||
Wait('start');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user