mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
Added owners column to the credentials list
This commit is contained in:
parent
b999206ffd
commit
18c74a8020
@ -52,6 +52,7 @@ import activityStream from './activity-stream/main';
|
||||
import standardOut from './standard-out/main';
|
||||
import JobTemplates from './job-templates/main';
|
||||
import search from './search/main';
|
||||
import credentials from './credentials/main';
|
||||
import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects';
|
||||
import OrganizationsList from './organizations/list/organizations-list.controller';
|
||||
import OrganizationsAdd from './organizations/add/organizations-add.controller';
|
||||
@ -109,6 +110,7 @@ var tower = angular.module('Tower', [
|
||||
JobTemplates.name,
|
||||
portalMode.name,
|
||||
search.name,
|
||||
credentials.name,
|
||||
'ngToast',
|
||||
'templates',
|
||||
'Utilities',
|
||||
|
||||
11
awx/ui/client/src/credentials/main.js
Normal file
11
awx/ui/client/src/credentials/main.js
Normal file
@ -0,0 +1,11 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import ownerList from './ownerList.directive';
|
||||
|
||||
export default
|
||||
angular.module('credentials', [])
|
||||
.directive('ownerList', ownerList);
|
||||
13
awx/ui/client/src/credentials/ownerList.directive.js
Normal file
13
awx/ui/client/src/credentials/ownerList.directive.js
Normal file
@ -0,0 +1,13 @@
|
||||
export default
|
||||
[ 'templateUrl',
|
||||
function(templateUrl) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: false,
|
||||
templateUrl: templateUrl('credentials/ownerList'),
|
||||
link: function(scope) {
|
||||
scope.owners_list = scope.credential.summary_fields.owners && scope.credential.summary_fields.owners.length > 0 ? scope.credential.summary_fields.owners : [];
|
||||
}
|
||||
};
|
||||
}
|
||||
];
|
||||
3
awx/ui/client/src/credentials/ownerList.partial.html
Normal file
3
awx/ui/client/src/credentials/ownerList.partial.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div ng-repeat="owner in owners_list">
|
||||
<a ui-sref="organizations.edit({ organization_id: owner.id })">{{ owner.name }}{{$last ? '' : ', '}}</a>
|
||||
</div>
|
||||
@ -39,7 +39,14 @@ export default
|
||||
searchOptions: [], // will be set by Options call to credentials resource
|
||||
excludeModal: true,
|
||||
nosort: true,
|
||||
columnClass: 'col-md-3 hidden-sm hidden-xs'
|
||||
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
||||
},
|
||||
owners: {
|
||||
label: 'Owners',
|
||||
type: 'owners',
|
||||
nosort: true,
|
||||
excludeModal: true,
|
||||
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
||||
}
|
||||
},
|
||||
|
||||
@ -55,7 +62,7 @@ export default
|
||||
|
||||
fieldActions: {
|
||||
|
||||
columnClass: 'col-md-3 col-sm-3 col-xs-3',
|
||||
columnClass: 'col-md-2 col-sm-3 col-xs-3',
|
||||
|
||||
edit: {
|
||||
ngClick: "editCredential(credential.id)",
|
||||
|
||||
@ -482,7 +482,15 @@ angular.module('GeneratorHelpers', [systemStatus.name])
|
||||
</labels-list>
|
||||
</td>
|
||||
`;
|
||||
} else if (field.type === 'badgeCount') {
|
||||
} else if (field.type === 'owners') {
|
||||
classList = (field.columnClass) ?
|
||||
Attr(field, 'columnClass') : "";
|
||||
html += `
|
||||
<td ${classList}>
|
||||
<owner-list></owner-list>
|
||||
</td>
|
||||
`;
|
||||
}else if (field.type === 'badgeCount') {
|
||||
html = BadgeCount(params);
|
||||
} else if (field.type === 'badgeOnly') {
|
||||
html = Badge(field);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user