mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 13:25:02 -02:30
Fixed basePath at the root level of the inventory manage (thanks @jared)
This commit is contained in:
@@ -101,7 +101,11 @@ export default {
|
|||||||
templateProvider: function(InventoryGroups, generateList, $templateRequest, $stateParams, GetBasePath) {
|
templateProvider: function(InventoryGroups, generateList, $templateRequest, $stateParams, GetBasePath) {
|
||||||
let list = _.cloneDeep(InventoryGroups);
|
let list = _.cloneDeep(InventoryGroups);
|
||||||
if($stateParams && $stateParams.group) {
|
if($stateParams && $stateParams.group) {
|
||||||
list.basePath = GetBasePath('groups') + $stateParams.group[$stateParams.group.length-1] + '/children';
|
list.basePath = GetBasePath('groups') + _.last($stateParams.group) + '/children';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//reaches here if the user is on the root level group
|
||||||
|
list.basePath = GetBasePath('inventory') + $stateParams.inventory_id + '/root_groups';
|
||||||
}
|
}
|
||||||
let html = generateList.build({
|
let html = generateList.build({
|
||||||
list: list,
|
list: list,
|
||||||
@@ -119,7 +123,11 @@ export default {
|
|||||||
templateProvider: function(InventoryHosts, generateList, $stateParams, GetBasePath) {
|
templateProvider: function(InventoryHosts, generateList, $stateParams, GetBasePath) {
|
||||||
let list = _.cloneDeep(InventoryHosts);
|
let list = _.cloneDeep(InventoryHosts);
|
||||||
if($stateParams && $stateParams.group) {
|
if($stateParams && $stateParams.group) {
|
||||||
list.basePath = GetBasePath('groups') + $stateParams.group[$stateParams.group.length-1] + '/all_hosts';
|
list.basePath = GetBasePath('groups') + _.last($stateParams.group) + '/all_hosts';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//reaches here if the user is on the root level group
|
||||||
|
list.basePath = GetBasePath('inventory') + $stateParams.inventory_id + '/hosts';
|
||||||
}
|
}
|
||||||
let html = generateList.build({
|
let html = generateList.build({
|
||||||
list: list,
|
list: list,
|
||||||
|
|||||||
Reference in New Issue
Block a user