1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

fix CodeMirror vars in host add/edit view, resolves #2518 (#2590)

This commit is contained in:
Leigh Johnson 2016-06-23 09:52:05 -04:00 committed by GitHub
parent a22cbebcb9
commit e7615edd91
2 changed files with 3 additions and 7 deletions

View File

@ -10,7 +10,6 @@
var generator = GenerateForm,
form = HostForm;
$scope.parseType = 'yaml';
$scope.extraVars = '---';
$scope.formCancel = function(){
$state.go('^');
};
@ -19,7 +18,7 @@
};
$scope.formSave = function(){
var params = {
variables: $scope.extraVars === '---' || $scope.extraVars === '{}' ? null : $scope.extraVars,
variables: $scope.variables === '---' || $scope.variables === '{}' ? null : $scope.variables,
name: $scope.name,
description: $scope.description,
enabled: $scope.host.enabled,
@ -43,7 +42,6 @@
ParseTypeChange({
scope: $scope,
field_id: 'host_variables',
variable: 'extraVars',
});
};
init();

View File

@ -19,7 +19,7 @@
$scope.formSave = function(){
var host = {
id: $scope.host.id,
variables: $scope.extraVars === '---' || $scope.extraVars === '{}' ? null : $scope.extraVars,
variables: $scope.variables === '---' || $scope.variables === '{}' ? null : $scope.variables,
name: $scope.name,
description: $scope.description,
enabled: $scope.host.enabled
@ -30,15 +30,13 @@
};
var init = function(){
$scope.host = host;
$scope.extraVars = host.variables === '' ? '---' : host.variables;
generator.inject(form, {mode: 'edit', related: false, id: 'Inventory-hostManage--panel', scope: $scope});
$scope.extraVars = $scope.host.variables === '' ? '---' : $scope.host.variables;
$scope.variables = host.variables === '' ? '---' : host.variables;
$scope.name = host.name;
$scope.description = host.description;
ParseTypeChange({
scope: $scope,
field_id: 'host_variables',
variable: 'extraVars',
});
};
init();