mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
update credentials
This commit is contained in:
@@ -140,8 +140,7 @@ var tower = angular.module('Tower', [
|
|||||||
'GroupListDefinition',
|
'GroupListDefinition',
|
||||||
'TeamsListDefinition',
|
'TeamsListDefinition',
|
||||||
'TeamFormDefinition',
|
'TeamFormDefinition',
|
||||||
'CredentialsListDefinition',
|
'TeamHelper',
|
||||||
'CredentialFormDefinition',
|
|
||||||
'TemplatesListDefinition',
|
'TemplatesListDefinition',
|
||||||
'PortalJobTemplatesListDefinition',
|
'PortalJobTemplatesListDefinition',
|
||||||
'JobTemplateFormDefinition',
|
'JobTemplateFormDefinition',
|
||||||
|
|||||||
@@ -4,14 +4,13 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$scope', '$rootScope', '$compile', '$location',
|
export default ['$scope', '$rootScope', '$stateParams', 'CredentialForm',
|
||||||
'$log', '$stateParams', 'CredentialForm', 'GenerateForm', 'Rest', 'Alert',
|
'GenerateForm', 'Rest', 'ProcessErrors', 'ClearScope', 'GetBasePath',
|
||||||
'ProcessErrors', 'ClearScope', 'GetBasePath', 'GetChoices', 'Empty', 'KindChange', 'BecomeMethodChange',
|
'GetChoices', 'Empty', 'KindChange', 'BecomeMethodChange',
|
||||||
'OwnerChange', 'CredentialFormSave', '$state', 'CreateSelect2', 'i18n',
|
'OwnerChange', 'CredentialFormSave', '$state', 'CreateSelect2', 'i18n',
|
||||||
function($scope, $rootScope, $compile, $location, $log,
|
function($scope, $rootScope, $stateParams, CredentialForm, GenerateForm,
|
||||||
$stateParams, CredentialForm, GenerateForm, Rest, Alert, ProcessErrors,
|
Rest, ProcessErrors, ClearScope, GetBasePath, GetChoices, Empty, KindChange,
|
||||||
ClearScope, GetBasePath, GetChoices, Empty, KindChange, BecomeMethodChange,
|
BecomeMethodChange, OwnerChange, CredentialFormSave, $state, CreateSelect2, i18n) {
|
||||||
OwnerChange, CredentialFormSave, $state, CreateSelect2, i18n) {
|
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,7 @@
|
|||||||
* @description This form is for adding/editing a Credential
|
* @description This form is for adding/editing a Credential
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default
|
export default ['i18n', function(i18n) {
|
||||||
angular.module('CredentialFormDefinition', [])
|
|
||||||
.factory('CredentialForm', ['i18n', function(i18n) {
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
addTitle: i18n._('CREATE CREDENTIAL'), //Legend in add mode
|
addTitle: i18n._('CREATE CREDENTIAL'), //Legend in add mode
|
||||||
@@ -474,4 +472,4 @@ export default
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};}]);
|
};}];
|
||||||
@@ -7,9 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default
|
export default ['i18n', function(i18n) {
|
||||||
angular.module('CredentialsListDefinition', [])
|
|
||||||
.factory('CredentialList', ['i18n', function(i18n) {
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
name: 'credentials',
|
name: 'credentials',
|
||||||
@@ -95,4 +93,4 @@ export default
|
|||||||
ngShow: 'credential.summary_fields.user_capabilities.delete'
|
ngShow: 'credential.summary_fields.user_capabilities.delete'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};}]);
|
};}];
|
||||||
@@ -4,15 +4,15 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$scope', '$rootScope', '$compile', '$location',
|
export default ['$scope', '$rootScope', '$location', '$stateParams',
|
||||||
'$log', '$stateParams', 'CredentialForm', 'Rest', 'Alert',
|
'CredentialForm', 'Rest', 'ProcessErrors', 'ClearScope', 'Prompt',
|
||||||
'ProcessErrors', 'ClearScope', 'Prompt', 'GetBasePath', 'GetChoices',
|
'GetBasePath', 'GetChoices', 'KindChange', 'BecomeMethodChange', 'Empty',
|
||||||
'KindChange', 'BecomeMethodChange', 'Empty', 'OwnerChange',
|
'OwnerChange', 'Wait', '$state', 'CreateSelect2',
|
||||||
'CredentialFormSave', 'Wait', '$state', 'CreateSelect2', 'Authorization', 'i18n',
|
'Authorization', 'i18n', 'CredentialFormSave',
|
||||||
function($scope, $rootScope, $compile, $location, $log,
|
function($scope, $rootScope, $location, $stateParams, CredentialForm, Rest,
|
||||||
$stateParams, CredentialForm, Rest, Alert, ProcessErrors, ClearScope, Prompt,
|
ProcessErrors, ClearScope, Prompt, GetBasePath, GetChoices, KindChange,
|
||||||
GetBasePath, GetChoices, KindChange, BecomeMethodChange, Empty, OwnerChange, CredentialFormSave, Wait,
|
BecomeMethodChange, Empty, OwnerChange, Wait, $state,
|
||||||
$state, CreateSelect2, Authorization, i18n) {
|
CreateSelect2, Authorization, i18n, CredentialFormSave) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,11 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$scope', '$rootScope', '$location', '$log',
|
export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ClearScope',
|
||||||
'$stateParams', 'Rest', 'Alert', 'CredentialList', 'Prompt', 'ClearScope',
|
'ProcessErrors', 'GetBasePath', 'Wait', '$state', '$filter',
|
||||||
'ProcessErrors', 'GetBasePath', 'Wait', '$state', '$filter', 'rbacUiControlService', 'Dataset', 'i18n',
|
'rbacUiControlService', 'Dataset', 'i18n',
|
||||||
function($scope, $rootScope, $location, $log,
|
function($scope, Rest, CredentialList, Prompt, ClearScope, ProcessErrors,
|
||||||
$stateParams, Rest, Alert, CredentialList, Prompt, ClearScope,
|
GetBasePath, Wait, $state, $filter, rbacUiControlService, Dataset,
|
||||||
ProcessErrors, GetBasePath, Wait, $state, $filter, rbacUiControlService, Dataset,
|
|
||||||
i18n) {
|
i18n) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import BecomeMethodChange from './factories/become-method-change.factory';
|
|||||||
import CredentialFormSave from './factories/credential-form-save.factory';
|
import CredentialFormSave from './factories/credential-form-save.factory';
|
||||||
import KindChange from './factories/kind-change.factory';
|
import KindChange from './factories/kind-change.factory';
|
||||||
import OwnerChange from './factories/owner-change.factory';
|
import OwnerChange from './factories/owner-change.factory';
|
||||||
|
import CredentialList from './credentials.list';
|
||||||
|
import CredentialForm from './credentials.form';
|
||||||
import { N_ } from '../i18n';
|
import { N_ } from '../i18n';
|
||||||
|
|
||||||
export default
|
export default
|
||||||
@@ -24,6 +26,8 @@ export default
|
|||||||
.controller('CredentialsList', CredentialsList)
|
.controller('CredentialsList', CredentialsList)
|
||||||
.controller('CredentialsAdd', CredentialsAdd)
|
.controller('CredentialsAdd', CredentialsAdd)
|
||||||
.controller('CredentialsEdit', CredentialsEdit)
|
.controller('CredentialsEdit', CredentialsEdit)
|
||||||
|
.factory('CredentialList', CredentialList)
|
||||||
|
.factory('CredentialForm', CredentialForm)
|
||||||
.config(['$stateProvider', 'stateDefinitionsProvider',
|
.config(['$stateProvider', 'stateDefinitionsProvider',
|
||||||
function($stateProvider, stateDefinitionsProvider) {
|
function($stateProvider, stateDefinitionsProvider) {
|
||||||
let stateDefinitions = stateDefinitionsProvider.$get();
|
let stateDefinitions = stateDefinitionsProvider.$get();
|
||||||
|
|||||||
@@ -1,12 +1,29 @@
|
|||||||
<div class="OwnerList" ng-init="ownersLimit = 5; ownersLimitConst = 5; ">
|
<div class="OwnerList" ng-init="ownersLimit = 5; ownersLimitConst = 5;">
|
||||||
<div class="OwnerList-Container" ng-repeat="owner in owners_list | limitTo:ownersLimit">
|
<div class="OwnerList-Container"
|
||||||
<a ng-if="owner.type === 'organization'" ui-sref="organizations.edit({ organization_id: owner.id })">{{ owner.name }}{{$last ? '' : ', '}}</a>
|
ng-repeat="owner in owners_list | limitTo:ownersLimit">
|
||||||
<a ng-if="owner.type === 'user'" ui-sref="users.edit({ user_id: owner.id })">{{ owner.name }}{{$last ? '' : ', '}}</a>
|
<a ng-if="owner.type === 'organization'"
|
||||||
<a ng-if="owner.type === 'team'" ui-sref="teams.edit({ team_id: owner.id })">{{ owner.name }}{{$last ? '' : ', '}}</a>
|
ui-sref="organizations.edit({ organization_id: owner.id })">
|
||||||
|
{{ owner.name }}{{$last ? '' : ', '}}
|
||||||
|
</a>
|
||||||
|
<a ng-if="owner.type === 'user'"
|
||||||
|
ui-sref="users.edit({ user_id: owner.id })">
|
||||||
|
{{ owner.name }}{{$last ? '' : ', '}}
|
||||||
|
</a>
|
||||||
|
<a ng-if="owner.type === 'team'"
|
||||||
|
ui-sref="teams.edit({ team_id: owner.id })">
|
||||||
|
{{ owner.name }}{{$last ? '' : ', '}}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="OwnerList-seeMore" ng-show="owners_list.length > ownersLimitConst && ownersLimit == ownersLimitConst"
|
<div class="OwnerList-seeMore"
|
||||||
ng-click="ownersLimit = owners_list.length">View More</div>
|
ng-show="owners_list.length > ownersLimitConst && ownersLimit == ownersLimitConst"
|
||||||
<div class="OwnerList-seeLess" ng-show="owners_list.length > ownersLimitConst && ownersLimit != ownersLimitConst"
|
ng-click="ownersLimit = owners_list.length">
|
||||||
ng-click="ownersLimit = ownersLimitConst">View Less</div>
|
View More
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="OwnerList-seeLess"
|
||||||
|
ng-show="owners_list.length > ownersLimitConst && ownersLimit != ownersLimitConst"
|
||||||
|
ng-click="ownersLimit = ownersLimitConst">
|
||||||
|
View Less
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import ActivityDetail from "./forms/ActivityDetail";
|
import ActivityDetail from "./forms/ActivityDetail";
|
||||||
import Credentials from "./forms/Credentials";
|
|
||||||
import EventsViewer from "./forms/EventsViewer";
|
import EventsViewer from "./forms/EventsViewer";
|
||||||
import Groups from "./forms/Groups";
|
import Groups from "./forms/Groups";
|
||||||
import HostGroups from "./forms/HostGroups";
|
import HostGroups from "./forms/HostGroups";
|
||||||
@@ -27,7 +26,6 @@ import Workflows from "./forms/Workflows";
|
|||||||
|
|
||||||
export
|
export
|
||||||
{ ActivityDetail,
|
{ ActivityDetail,
|
||||||
Credentials,
|
|
||||||
EventsViewer,
|
EventsViewer,
|
||||||
Groups,
|
Groups,
|
||||||
HostGroups,
|
HostGroups,
|
||||||
|
|||||||
@@ -4,10 +4,8 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import CloudCredentials from "./lists/CloudCredentials";
|
|
||||||
import CompletedJobs from "./lists/CompletedJobs";
|
import CompletedJobs from "./lists/CompletedJobs";
|
||||||
import AllJobs from "./lists/AllJobs";
|
import AllJobs from "./lists/AllJobs";
|
||||||
import Credentials from "./lists/Credentials";
|
|
||||||
import Groups from "./lists/Groups";
|
import Groups from "./lists/Groups";
|
||||||
import Hosts from "./lists/Hosts";
|
import Hosts from "./lists/Hosts";
|
||||||
import Inventories from "./lists/Inventories";
|
import Inventories from "./lists/Inventories";
|
||||||
@@ -28,10 +26,8 @@ import Templates from "./lists/Templates";
|
|||||||
import Users from "./lists/Users";
|
import Users from "./lists/Users";
|
||||||
|
|
||||||
export
|
export
|
||||||
{ CloudCredentials,
|
{ CompletedJobs,
|
||||||
CompletedJobs,
|
|
||||||
AllJobs,
|
AllJobs,
|
||||||
Credentials,
|
|
||||||
Groups,
|
Groups,
|
||||||
Hosts,
|
Hosts,
|
||||||
Inventories,
|
Inventories,
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
/*************************************************
|
|
||||||
* Copyright (c) 2015 Ansible, Inc.
|
|
||||||
*
|
|
||||||
* All Rights Reserved
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default
|
|
||||||
angular.module('CloudCredentialsListDefinition', [])
|
|
||||||
.value('CloudCredentialList', {
|
|
||||||
|
|
||||||
name: 'cloudcredentials',
|
|
||||||
iterator: 'cloudcredential',
|
|
||||||
selectTitle: 'Add Cloud Credentials',
|
|
||||||
editTitle: 'CLOUD CREDENTIALS',
|
|
||||||
selectInstructions: '<p>Select existing credentials by clicking each credential or checking the related checkbox. When finished, click the blue ' +
|
|
||||||
'<em>Select</em> button, located bottom right.</p> <p>Create a brand new credential by clicking the <i class=\"fa fa-plus"></i> button.</p>',
|
|
||||||
index: false,
|
|
||||||
hover: true,
|
|
||||||
|
|
||||||
fields: {
|
|
||||||
name: {
|
|
||||||
key: true,
|
|
||||||
label: 'Name'
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
label: 'Description',
|
|
||||||
excludeModal: false
|
|
||||||
},
|
|
||||||
team: {
|
|
||||||
label: 'Team',
|
|
||||||
ngBind: 'credential.team_name',
|
|
||||||
sourceModel: 'team',
|
|
||||||
sourceField: 'name',
|
|
||||||
excludeModal: true
|
|
||||||
},
|
|
||||||
user: {
|
|
||||||
label: 'User',
|
|
||||||
ngBind: 'credential.user_username',
|
|
||||||
sourceModel: 'user',
|
|
||||||
sourceField: 'username',
|
|
||||||
excludeModal: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
actions: {
|
|
||||||
add: {
|
|
||||||
mode: 'all', // One of: edit, select, all
|
|
||||||
ngClick: 'addCredential()',
|
|
||||||
awToolTip: 'Create a new credential',
|
|
||||||
actionClass: 'btn btn-sm List-buttonSubmit',
|
|
||||||
buttonContent: '+ ADD'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
fieldActions: {
|
|
||||||
edit: {
|
|
||||||
ngClick: "editCredential(credential.id)",
|
|
||||||
icon: 'fa-edit',
|
|
||||||
label: 'Edit',
|
|
||||||
"class": 'btn-sm',
|
|
||||||
awToolTip: 'Edit credential',
|
|
||||||
dataPlacement: 'top'
|
|
||||||
},
|
|
||||||
|
|
||||||
"delete": {
|
|
||||||
ngClick: "deleteCredential(credential.id, credential.name)",
|
|
||||||
icon: 'fa-trash-o',
|
|
||||||
label: 'Delete',
|
|
||||||
"class": 'btn-sm',
|
|
||||||
awToolTip: 'Delete credential',
|
|
||||||
dataPlacement: 'top'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user