mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
related groups for host-edit form
This commit is contained in:
@@ -88,9 +88,7 @@ function(i18n, nestedGroupListState, nestedHostsListState, buildHostAddState){
|
||||
includeForm: "NestedGroupFormDefinition",
|
||||
title: i18n._('Groups'),
|
||||
iterator: 'nested_group',
|
||||
listState: nestedGroupListState,
|
||||
// addState: buildGroupsAddState,
|
||||
// editState: buildGroupsEditState
|
||||
listState: nestedGroupListState
|
||||
},
|
||||
nested_hosts: {
|
||||
name: 'nested_hosts',
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
$scope.toggleEnabled = function(){
|
||||
$scope.host.enabled = !$scope.host.enabled;
|
||||
};
|
||||
$scope.groupsTab = function(){
|
||||
let id = $scope.host.summary_fields.inventory.id;
|
||||
$state.go('hosts.edit.nested_groups', {inventory_id: id});
|
||||
};
|
||||
$scope.formSave = function(){
|
||||
var host = {
|
||||
id: $scope.host.id,
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
* @description This form is for adding/editing a host on the inventory page
|
||||
*/
|
||||
|
||||
export default ['i18n', function(i18n) {
|
||||
export default ['i18n', 'nestedGroupListState',
|
||||
function(i18n, nestedGroupListState) {
|
||||
return {
|
||||
|
||||
addTitle: i18n._('CREATE HOST'),
|
||||
@@ -107,6 +108,21 @@ export default ['i18n', function(i18n) {
|
||||
name: 'ansible_facts',
|
||||
title: i18n._('Facts'),
|
||||
skipGenerator: true
|
||||
},
|
||||
nested_groups: {
|
||||
name: 'nested_groups',
|
||||
// ngClick: "$state.go('hosts.edit.nested_groups')",
|
||||
ngClick: "groupsTab()",
|
||||
include: "NestedGroupListDefinition",
|
||||
includeForm: "NestedGroupFormDefinition",
|
||||
title: i18n._('Groups'),
|
||||
iterator: 'nested_group',
|
||||
listState: nestedGroupListState
|
||||
},
|
||||
insights: {
|
||||
name: 'insights',
|
||||
title: i18n._('Insights'),
|
||||
skipGenerator: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
* @description This form is for adding/editing a host on the inventory page
|
||||
*/
|
||||
|
||||
export default ['i18n', function(i18n) {
|
||||
export default ['i18n', 'nestedGroupListState',
|
||||
function(i18n,nestedGroupListState) {
|
||||
return {
|
||||
|
||||
addTitle: i18n._('CREATE HOST'),
|
||||
@@ -108,6 +109,20 @@ export default ['i18n', function(i18n) {
|
||||
name: 'ansible_facts',
|
||||
title: i18n._('Facts'),
|
||||
skipGenerator: true
|
||||
},
|
||||
nested_groups: {
|
||||
name: 'nested_groups',
|
||||
ngClick: "$state.go('inventories.edit.hosts.edit.nested_groups')",
|
||||
include: "NestedGroupListDefinition",
|
||||
includeForm: "NestedGroupFormDefinition",
|
||||
title: i18n._('Groups'),
|
||||
iterator: 'nested_group',
|
||||
listState: nestedGroupListState
|
||||
},
|
||||
insights: {
|
||||
name: 'insights',
|
||||
title: i18n._('Insights'),
|
||||
skipGenerator: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user