mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Add base states for credentials
This commit is contained in:
7
awx/ui/client/lib/credentials.factory.js
Normal file
7
awx/ui/client/lib/credentials.factory.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
function credentials($resource) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
credentials.$inject = ['$resource'];
|
||||||
|
|
||||||
|
angular.module('at.lib');
|
||||||
@@ -30,13 +30,6 @@ export default ['i18n', function(i18n) {
|
|||||||
awToolTip: '{{credential.description}}',
|
awToolTip: '{{credential.description}}',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top'
|
||||||
},
|
},
|
||||||
kind: {
|
|
||||||
label: i18n._('Type'),
|
|
||||||
ngBind: 'credential.kind_label',
|
|
||||||
excludeModal: true,
|
|
||||||
nosort: true,
|
|
||||||
columnClass: 'col-md-2 hidden-sm hidden-xs'
|
|
||||||
},
|
|
||||||
owners: {
|
owners: {
|
||||||
label: i18n._('Owners'),
|
label: i18n._('Owners'),
|
||||||
type: 'owners',
|
type: 'owners',
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ function IndexController () {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// IndexController.$inject = [];
|
IndexController.$inject = [
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
export default IndexController;
|
export default IndexController;
|
||||||
|
|||||||
@@ -1,17 +1,80 @@
|
|||||||
import IndexController from './index.controller';
|
import CredentialList from './credentials.list.js';
|
||||||
|
import ListController from './list/credentials-list.controller';
|
||||||
|
import { N_ } from '../i18n';
|
||||||
|
|
||||||
function routes ($stateProvider) {
|
function routes ($stateExtenderProvider) {
|
||||||
$stateProvider.state({
|
let stateExtender = $stateExtenderProvider.$get();
|
||||||
|
|
||||||
|
stateExtender.addState({
|
||||||
name: 'credentials',
|
name: 'credentials',
|
||||||
url: '/credentials',
|
route: '/credentials',
|
||||||
templateUrl: '/static/views/credentials/index.view.html',
|
ncyBreadcrumb: {
|
||||||
controller: IndexController,
|
label: N_('CREDENTIALS')
|
||||||
controllerAs: 'vm'
|
},
|
||||||
|
views: {
|
||||||
|
'@': {
|
||||||
|
templateUrl: '/static/views/credentials/index.view.html',
|
||||||
|
},
|
||||||
|
'list@credentials': {
|
||||||
|
templateProvider: function(CredentialList, generateList) {
|
||||||
|
let html = generateList.build({
|
||||||
|
list: CredentialList,
|
||||||
|
mode: 'edit'
|
||||||
|
});
|
||||||
|
|
||||||
|
return html;
|
||||||
|
},
|
||||||
|
controller: ListController
|
||||||
|
}
|
||||||
|
},
|
||||||
|
searchPrefix: 'credential',
|
||||||
|
resolve: {
|
||||||
|
Dataset: ['CredentialList', 'QuerySet', '$stateParams', 'GetBasePath',
|
||||||
|
function(list, qs, $stateParams, GetBasePath) {
|
||||||
|
let path = GetBasePath(list.basePath) || GetBasePath(list.name);
|
||||||
|
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
stateExtender.addState({
|
||||||
|
name: 'credentials.add',
|
||||||
|
route: '/add',
|
||||||
|
ncyBreadcrumb: {
|
||||||
|
label: N_('ADD')
|
||||||
|
},
|
||||||
|
views: {
|
||||||
|
'add@credentials': {
|
||||||
|
templateProvider: function() {
|
||||||
|
return '<span>test-add</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
stateExtender.addState({
|
||||||
|
name: 'credentials.edit',
|
||||||
|
route: '/edit',
|
||||||
|
ncyBreadcrumb: {
|
||||||
|
label: N_('EDIT')
|
||||||
|
},
|
||||||
|
views: {
|
||||||
|
'edit@credentials': {
|
||||||
|
templateProvider: function() {
|
||||||
|
return '<span>test-edit</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
routes.$inject = [
|
routes.$inject = [
|
||||||
'$stateProvider'
|
'$stateExtenderProvider'
|
||||||
];
|
];
|
||||||
|
|
||||||
angular.module('at.feature.credentials', []).config(routes);
|
angular
|
||||||
|
.module('at.feature.credentials', [])
|
||||||
|
.config(routes)
|
||||||
|
.factory('CredentialList', CredentialList)
|
||||||
|
.controller('ListController', ListController);
|
||||||
|
|||||||
@@ -1,19 +1,8 @@
|
|||||||
|
<div ui-view="edit"></div>
|
||||||
|
<div ui-view="add"></div>
|
||||||
|
|
||||||
<at-panel>
|
<at-panel>
|
||||||
<at-panel-heading config="vm.panel.heading"></at-panel-heading>
|
<at-panel-body>
|
||||||
<at-panel-body config="vm.panel.body">
|
<div ui-view="list"></div>
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-5">
|
|
||||||
<at-input-search config="vm.panel.search"></at-input-search>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-1 at-u-noPadding">
|
|
||||||
<at-toggle-button config="vm.key"></at-toggle-button>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-1 pull-right">
|
|
||||||
<button class="btn at-Button--success pull-right">
|
|
||||||
+ ADD
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<at-toggle-content config="vm.key"></at-toggle-content>
|
|
||||||
</at-panel-body>
|
</at-panel-body>
|
||||||
</at-panel>
|
</at-panel>
|
||||||
|
|||||||
@@ -25,7 +25,9 @@
|
|||||||
"jshint": "grunt clean:jshint jshint:source --no-color",
|
"jshint": "grunt clean:jshint jshint:source --no-color",
|
||||||
"test:ci": "npm run test -- --single-run --reporter junit,dots --browsers=PhantomJS",
|
"test:ci": "npm run test -- --single-run --reporter junit,dots --browsers=PhantomJS",
|
||||||
"lint": "./node_modules/.bin/eslint -c .eslintrc.js .",
|
"lint": "./node_modules/.bin/eslint -c .eslintrc.js .",
|
||||||
"component-test": "./node_modules/.bin/karma start client/test/karma.conf.js --silent"
|
"component-test": "./node_modules/.bin/karma start client/test/karma.conf.js",
|
||||||
|
"lint-dev": "./node_modules/.bin/nodemon --exec \"./node_modules/.bin/eslint -c .eslintrc.js .\" --watch \"client/components/**/*.js\"",
|
||||||
|
"component-dev": "./node_modules/.bin/karma start client/test/karma.conf.js --auto-watch --no-single-run"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"browser-sync": "^2.14.0",
|
"browser-sync": "^2.14.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user