forked from pantsel/konga
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take in account the plugins available_on_server
- Loading branch information
Showing
6 changed files
with
754 additions
and
755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,136 +1,105 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
(function() { | ||
'use strict'; | ||
angular.module('frontend.consumers', [ | ||
'angular.chips', | ||
'ngMessages', | ||
'angularUtils.directives.dirPagination' | ||
]); | ||
|
||
angular.module('frontend.consumers', [ | ||
'angular.chips', | ||
'ngMessages', | ||
'angularUtils.directives.dirPagination' | ||
]); | ||
// Module configuration | ||
angular.module('frontend.consumers') | ||
.config([ | ||
'$stateProvider', | ||
function config($stateProvider) { | ||
$stateProvider | ||
.state('consumers', { | ||
parent: 'frontend', | ||
url: '/consumers', | ||
data: { | ||
activeNode: true, | ||
pageName: "Consumers", | ||
pageDescription: "The Consumer object represents a consumer - or a user - of an API. You can either rely on Kong as the primary datastore, or you can map the consumer list with your database to keep consistency between Kong and your existing primary datastore.", | ||
//displayName : "consumers", | ||
prefix: '<i class="material-icons">perm_identity</i>' | ||
}, | ||
|
||
// Module configuration | ||
angular.module('frontend.consumers') | ||
.config([ | ||
'$stateProvider', | ||
function config($stateProvider) { | ||
$stateProvider | ||
.state('consumers', { | ||
parent : 'frontend', | ||
url: '/consumers', | ||
data : { | ||
activeNode : true, | ||
pageName : "Consumers", | ||
pageDescription : "The Consumer object represents a consumer - or a user - of an API. You can either rely on Kong as the primary datastore, or you can map the consumer list with your database to keep consistency between Kong and your existing primary datastore.", | ||
//displayName : "consumers", | ||
prefix : '<i class="material-icons">perm_identity</i>' | ||
}, | ||
views: { | ||
'content@': { | ||
templateUrl: 'js/app/consumers/index.html', | ||
controller: 'ConsumersController' | ||
} | ||
} | ||
}) | ||
.state('consumers.edit', { | ||
url: '/:id', | ||
data: { | ||
pageName: "Edit Consumer", | ||
pageDescription: null, | ||
displayName: "edit consumer", | ||
prefix: '<i class="material-icons">perm_identity</i>' | ||
}, | ||
views: { | ||
'content@': { | ||
templateUrl: 'js/app/consumers/edit-consumer.html', | ||
controller: 'ConsumerController', | ||
|
||
views: { | ||
'content@': { | ||
templateUrl: 'js/app/consumers/index.html', | ||
controller: 'ConsumersController' | ||
} | ||
} | ||
}) | ||
.state('consumers.edit', { | ||
url: '/:id', | ||
data : { | ||
pageName : "Edit Consumer", | ||
pageDescription : null, | ||
displayName : "edit consumer", | ||
prefix : '<i class="material-icons">perm_identity</i>' | ||
}, | ||
views: { | ||
'content@': { | ||
templateUrl: 'js/app/consumers/edit-consumer.html', | ||
controller: 'ConsumerController', | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/details/consumer-details.html', | ||
controller: 'ConsumerDetailsController', | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/groups/consumer-groups.html', | ||
controller: 'ConsumerGroupsController', | ||
resolve: { | ||
_acls: [ | ||
'_', | ||
'ConsumerService', | ||
'$stateParams', | ||
'$rootScope', | ||
function (_, ConsumerService, $stateParams, $rootScope) { | ||
if (_.get($rootScope, 'Gateway.plugins.available_on_server.acl')) { | ||
return ConsumerService.fetchAcls($stateParams.id) | ||
} | ||
|
||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/details/consumer-details.html', | ||
controller: 'ConsumerDetailsController', | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/groups/consumer-groups.html', | ||
controller: 'ConsumerGroupsController', | ||
resolve : { | ||
_acls : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.fetchAcls($stateParams.id) | ||
} | ||
], | ||
} | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/credentials/consumer-credentials.html', | ||
controller: 'ConsumerCredentialsController', | ||
resolve : { | ||
_keys : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.loadCredentials($stateParams.id,'key-auth') | ||
} | ||
], | ||
_jwts : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.loadCredentials($stateParams.id,'jwt') | ||
} | ||
], | ||
_basic_auth_credentials : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.loadCredentials($stateParams.id,'basic-auth') | ||
} | ||
], | ||
_oauth2_credentials : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.loadCredentials($stateParams.id,'oauth2') | ||
} | ||
], | ||
_hmac_auth_credentials : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.loadCredentials($stateParams.id,'hmac-auth') | ||
} | ||
] | ||
} | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/apis/consumer-apis.html', | ||
controller: 'ConsumerApisController' | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/plugins/consumer-plugins.html', | ||
controller: 'ConsumerPluginsController' | ||
} | ||
}, | ||
resolve : { | ||
_consumer : [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function(ConsumerService,$stateParams){ | ||
return ConsumerService.findById($stateParams.id) | ||
} | ||
], | ||
_activeNode: [ | ||
'NodesService', | ||
function resolve(NodesService) { | ||
return NodesService.isActiveNodeSet() | ||
} | ||
], | ||
}, | ||
}) | ||
return false; | ||
|
||
} | ||
]) | ||
; | ||
} | ||
], | ||
} | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/credentials/consumer-credentials.html', | ||
controller: 'ConsumerCredentialsController' | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/apis/consumer-apis.html', | ||
controller: 'ConsumerApisController' | ||
}, | ||
'[email protected]': { | ||
templateUrl: 'js/app/consumers/plugins/consumer-plugins.html', | ||
controller: 'ConsumerPluginsController' | ||
} | ||
}, | ||
resolve: { | ||
_consumer: [ | ||
'ConsumerService', | ||
'$stateParams', | ||
function (ConsumerService, $stateParams) { | ||
return ConsumerService.findById($stateParams.id) | ||
} | ||
], | ||
_activeNode: [ | ||
'NodesService', | ||
function resolve(NodesService) { | ||
return NodesService.isActiveNodeSet() | ||
} | ||
], | ||
}, | ||
}) | ||
|
||
} | ||
]) | ||
; | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.