mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
Add kind column to credential list
* Populate kind column with credential_type name * Fix replace/revert input group button sizing
This commit is contained in:
@@ -35,7 +35,10 @@ function LegacyCredentialsService (pathService) {
|
|||||||
let path = GetBasePath(list.basePath) || GetBasePath(list.name);
|
let path = GetBasePath(list.basePath) || GetBasePath(list.name);
|
||||||
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
credentialType: ['CredentialTypeModel', CredentialType => {
|
||||||
|
return new CredentialType('get');
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,12 +47,18 @@
|
|||||||
.at-mixin-InputButton();
|
.at-mixin-InputButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
.at-Input-button--fixed-sm {
|
.at-Input-button--fixed-xs {
|
||||||
.at-mixin-InputButton();
|
.at-mixin-InputButton();
|
||||||
min-width: @at-width-input-button-sm;
|
min-width: @at-width-input-button-sm;
|
||||||
height: @at-height-input;
|
height: @at-height-input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.at-Input-button--fixed-sm {
|
||||||
|
.at-mixin-InputButton();
|
||||||
|
min-width: @at-width-input-button-md;
|
||||||
|
height: @at-height-input;
|
||||||
|
}
|
||||||
|
|
||||||
.at-Input-button--fixed-md {
|
.at-Input-button--fixed-md {
|
||||||
.at-mixin-InputButton();
|
.at-mixin-InputButton();
|
||||||
display: inherit;
|
display: inherit;
|
||||||
|
|||||||
@@ -20,11 +20,13 @@ function AtInputSecretController (baseInputController) {
|
|||||||
scope = _scope_;
|
scope = _scope_;
|
||||||
|
|
||||||
if (!scope.state._value || scope.state._promptOnLaunch) {
|
if (!scope.state._value || scope.state._promptOnLaunch) {
|
||||||
|
scope.mode = 'input';
|
||||||
scope.state._buttonText = vm.strings.get('SHOW');
|
scope.state._buttonText = vm.strings.get('SHOW');
|
||||||
scope.type = 'password';
|
scope.type = 'password';
|
||||||
|
|
||||||
vm.toggle = vm.toggleShowHide;
|
vm.toggle = vm.toggleShowHide;
|
||||||
} else {
|
} else {
|
||||||
|
scope.mode = 'encrypted';
|
||||||
scope.state._buttonText = vm.strings.get('REPLACE');
|
scope.state._buttonText = vm.strings.get('REPLACE');
|
||||||
scope.state._placeholder = vm.strings.get('ENCRYPTED');
|
scope.state._placeholder = vm.strings.get('ENCRYPTED');
|
||||||
vm.toggle = vm.toggleRevertReplace;
|
vm.toggle = vm.toggleRevertReplace;
|
||||||
|
|||||||
@@ -4,7 +4,11 @@
|
|||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-btn at-InputGroup-button">
|
<span class="input-group-btn at-InputGroup-button">
|
||||||
<button class="btn at-ButtonHollow--white at-Input-button--fixed-sm"
|
<button class="btn at-ButtonHollow--white"
|
||||||
|
ng-class="{
|
||||||
|
'at-Input-button--fixed-xs': mode === 'input',
|
||||||
|
'at-Input-button--fixed-sm': mode === 'encrypted'
|
||||||
|
}"
|
||||||
ng-disabled="!state._enableToggle && (state._disabled || form.disabled)"
|
ng-disabled="!state._enableToggle && (state._disabled || form.disabled)"
|
||||||
ng-click="vm.toggle()">
|
ng-click="vm.toggle()">
|
||||||
{{ state._buttonText }}
|
{{ state._buttonText }}
|
||||||
|
|||||||
@@ -28,9 +28,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.at-mixin-InputButton () {
|
.at-mixin-InputButton () {
|
||||||
display: block;
|
|
||||||
height: @at-height-button;
|
height: @at-height-button;
|
||||||
line-height: 1;
|
padding: 0 @at-padding-button-horizontal;
|
||||||
|
|
||||||
&, &:active, &:hover, &:focus {
|
&, &:active, &:hover, &:focus {
|
||||||
color: @at-color-button-text-default;
|
color: @at-color-button-text-default;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
export default ['i18n', function(i18n) {
|
export default ['i18n', function(i18n) {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
name: 'credentials',
|
name: 'credentials',
|
||||||
iterator: 'credential',
|
iterator: 'credential',
|
||||||
selectTitle: i18n._('Add Credentials'),
|
selectTitle: i18n._('Add Credentials'),
|
||||||
@@ -31,8 +30,8 @@ export default ['i18n', function(i18n) {
|
|||||||
dataPlacement: 'top'
|
dataPlacement: 'top'
|
||||||
},
|
},
|
||||||
kind: {
|
kind: {
|
||||||
label: i18n._('Type'),
|
label: i18n._('Kind'),
|
||||||
ngBind: 'credential.kind_label',
|
ngBind: 'credential.kind',
|
||||||
excludeModal: true,
|
excludeModal: true,
|
||||||
nosort: true,
|
nosort: true,
|
||||||
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
* All Rights Reserved
|
* All Rights Reserved
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default ['$scope', 'Rest', 'CredentialList', 'Prompt',
|
export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', 'GetBasePath',
|
||||||
'ProcessErrors', 'GetBasePath', 'Wait', '$state', '$filter', 'rbacUiControlService', 'Dataset', 'i18n',
|
'Wait', '$state', '$filter', 'rbacUiControlService', 'Dataset', 'credentialType', 'i18n',
|
||||||
function($scope, Rest, CredentialList, Prompt,
|
function($scope, Rest, CredentialList, Prompt,
|
||||||
ProcessErrors, GetBasePath, Wait, $state, $filter, rbacUiControlService, Dataset,
|
ProcessErrors, GetBasePath, Wait, $state, $filter, rbacUiControlService, Dataset,
|
||||||
i18n) {
|
credentialType, i18n) {
|
||||||
|
|
||||||
var list = CredentialList,
|
var list = CredentialList,
|
||||||
defaultUrl = GetBasePath('credentials');
|
defaultUrl = GetBasePath('credentials');
|
||||||
@@ -27,6 +27,10 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt',
|
|||||||
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
|
||||||
|
|
||||||
$scope.selected = [];
|
$scope.selected = [];
|
||||||
|
|
||||||
|
$scope[list.name].forEach(credential => {
|
||||||
|
credential.kind = credentialType.getById(credential.credential_type).name;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$on(`${list.iterator}_options`, function(event, data){
|
$scope.$on(`${list.iterator}_options`, function(event, data){
|
||||||
|
|||||||
Reference in New Issue
Block a user