mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Fixed adhoc command flow
This commit is contained in:
@@ -25,7 +25,7 @@ angular.module('inventory', [
|
|||||||
// This means inventoryManage states will not be registered correctly on page refresh, unless they're registered at the same time as the inventories state tree
|
// This means inventoryManage states will not be registered correctly on page refresh, unless they're registered at the same time as the inventories state tree
|
||||||
let stateTree, inventories,
|
let stateTree, inventories,
|
||||||
addGroup, editGroup, addHost, editHost,
|
addGroup, editGroup, addHost, editHost,
|
||||||
listSchedules, addSchedule, editSchedule,
|
listSchedules, addSchedule, editSchedule, adhocCredentialLookup,
|
||||||
stateDefinitions = stateDefinitionsProvider.$get(),
|
stateDefinitions = stateDefinitionsProvider.$get(),
|
||||||
stateExtender = $stateExtenderProvider.$get();
|
stateExtender = $stateExtenderProvider.$get();
|
||||||
|
|
||||||
@@ -195,6 +195,60 @@ angular.module('inventory', [
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
adhocCredentialLookup = {
|
||||||
|
searchPrefix: 'credential',
|
||||||
|
name: 'inventoryManage.adhoc.credential',
|
||||||
|
url: '/credential',
|
||||||
|
data: {
|
||||||
|
formChildState: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
credential_search: {
|
||||||
|
value: {
|
||||||
|
page_size: '5'
|
||||||
|
},
|
||||||
|
squash: true,
|
||||||
|
dynamic: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ncyBreadcrumb: {
|
||||||
|
skip: true
|
||||||
|
},
|
||||||
|
views: {
|
||||||
|
'related': {
|
||||||
|
templateProvider: function(ListDefinition, generateList) {
|
||||||
|
let list_html = generateList.build({
|
||||||
|
mode: 'lookup',
|
||||||
|
list: ListDefinition,
|
||||||
|
input_type: 'radio'
|
||||||
|
});
|
||||||
|
return `<lookup-modal>${list_html}</lookup-modal>`;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
ListDefinition: ['CredentialList', function(CredentialList) {
|
||||||
|
let list = _.cloneDeep(CredentialList);
|
||||||
|
list.lookupConfirmText = 'SELECT';
|
||||||
|
return list;
|
||||||
|
}],
|
||||||
|
Dataset: ['ListDefinition', 'QuerySet', '$stateParams', 'GetBasePath',
|
||||||
|
(list, qs, $stateParams, GetBasePath) => {
|
||||||
|
let path = GetBasePath(list.name) || GetBasePath(list.basePath);
|
||||||
|
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
onExit: function($state) {
|
||||||
|
if ($state.transition) {
|
||||||
|
$('#form-modal').modal('hide');
|
||||||
|
$('.modal-backdrop').remove();
|
||||||
|
$('body').removeClass('modal-open');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
inventories,
|
inventories,
|
||||||
addGroup,
|
addGroup,
|
||||||
@@ -210,6 +264,7 @@ angular.module('inventory', [
|
|||||||
stateExtender.buildDefinition(copyMoveGroupRoute),
|
stateExtender.buildDefinition(copyMoveGroupRoute),
|
||||||
stateExtender.buildDefinition(copyMoveHostRoute),
|
stateExtender.buildDefinition(copyMoveHostRoute),
|
||||||
stateExtender.buildDefinition(adHocRoute),
|
stateExtender.buildDefinition(adHocRoute),
|
||||||
|
stateExtender.buildDefinition(adhocCredentialLookup)
|
||||||
|
|
||||||
])
|
])
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ export default function() {
|
|||||||
basePath: 'credentials',
|
basePath: 'credentials',
|
||||||
sourceModel: 'credential',
|
sourceModel: 'credential',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
ngClick: 'lookUpCredential()',
|
|
||||||
class: 'squeeze',
|
class: 'squeeze',
|
||||||
awPopOver: '<p>Select the credential you want to use when ' +
|
awPopOver: '<p>Select the credential you want to use when ' +
|
||||||
'accessing the remote hosts to run the command. ' +
|
'accessing the remote hosts to run the command. ' +
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default
|
|||||||
item: '=item'
|
item: '=item'
|
||||||
},
|
},
|
||||||
require: '^multiSelectList',
|
require: '^multiSelectList',
|
||||||
template: '<input type="checkbox" data-multi-select-list-item ng-model="item.isSelected" ng-change="userInteractionSelect()">',
|
template: '<input type="checkbox" data-multi-select-list-item ng-model="isSelected" ng-change="userInteractionSelect()">',
|
||||||
link: function(scope, element, attrs, multiSelectList) {
|
link: function(scope, element, attrs, multiSelectList) {
|
||||||
|
|
||||||
scope.decoratedItem = multiSelectList.registerItem(scope.item);
|
scope.decoratedItem = multiSelectList.registerItem(scope.item);
|
||||||
|
|||||||
Reference in New Issue
Block a user