mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 03:01:06 -03:30
Merge pull request #3643 from mabashian/3333-inventory-vars-host-edit
Format the host vars properly on load when editing a host
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default
|
export default
|
||||||
['$state', '$stateParams', '$scope', 'HostForm', 'ParseTypeChange', 'GenerateForm', 'HostManageService', 'host',
|
['$state', '$stateParams', '$scope', 'HostForm', 'ParseTypeChange', 'GenerateForm', 'HostManageService', 'host', 'ParseVariableString',
|
||||||
function($state, $stateParams, $scope, HostForm, ParseTypeChange, GenerateForm, HostManageService, host){
|
function($state, $stateParams, $scope, HostForm, ParseTypeChange, GenerateForm, HostManageService, host, ParseVariableString){
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
form = HostForm;
|
form = HostForm;
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
@@ -31,12 +31,12 @@
|
|||||||
var init = function(){
|
var init = function(){
|
||||||
$scope.host = host;
|
$scope.host = host;
|
||||||
generator.inject(form, {mode: 'edit', related: false, id: 'Inventory-hostManage--panel', scope: $scope});
|
generator.inject(form, {mode: 'edit', related: false, id: 'Inventory-hostManage--panel', scope: $scope});
|
||||||
$scope.variables = host.variables === '' ? '---' : host.variables;
|
$scope.variables = host.variables === '' ? '---' : ParseVariableString(host.variables);
|
||||||
$scope.name = host.name;
|
$scope.name = host.name;
|
||||||
$scope.description = host.description;
|
$scope.description = host.description;
|
||||||
ParseTypeChange({
|
ParseTypeChange({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
field_id: 'host_variables',
|
field_id: 'host_variables'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
init();
|
init();
|
||||||
|
|||||||
Reference in New Issue
Block a user