Merge pull request #113 from kevgliss/perma

Adding ui router and perma links to certificates and authorities
This commit is contained in:
kevgliss 2015-10-05 09:30:52 -07:00
commit ba5d2c925a
16 changed files with 84 additions and 52 deletions

View File

@ -30,7 +30,8 @@
"angular-chart.js": "~0.7.1",
"satellizer": "~0.9.4",
"angularjs-toaster": "~0.4.14",
"ngletteravatar": "~3.0.1"
"ngletteravatar": "~3.0.1",
"angular-ui-router": "~0.2.15"
},
"devDependencies": {
"angular-mocks": "~1.3",

View File

@ -2,7 +2,7 @@
var lemur = angular
.module('lemur', [
'ngRoute',
'ui.router',
'ngTable',
'ngAnimate',
'chart.js',
@ -16,13 +16,13 @@ var lemur = angular
'satellizer',
'ngLetterAvatar'
])
.config(function ($routeProvider, $authProvider) {
$routeProvider
.when('/', {
.config(function ($stateProvider, $urlRouterProvider, $authProvider) {
$urlRouterProvider.otherwise('/welcome');
$stateProvider
.state('welcome', {
url: '/welcome',
templateUrl: 'angular/welcome/welcome.html'
})
.otherwise({
redirectTo: '/'
});
$authProvider.oauth2({

View File

@ -1,8 +1,9 @@
'use strict';
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/login', {
.config(function config($stateProvider) {
$stateProvider.state('login', {
url: '/login',
templateUrl: '/angular/authentication/login/login.tpl.html',
controller: 'LoginController'
});

View File

@ -1,9 +1,10 @@
'use strict';
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/logout', {
controller: 'LogoutCtrl'
.config(function config($stateProvider) {
$stateProvider.state('logout', {
controller: 'LogoutCtrl',
url: '/logout'
});
})
.controller('LogoutCtrl', function ($scope, $location, lemurRestangular, userService) {

View File

@ -2,15 +2,22 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/authorities', {
.config(function config($stateProvider) {
$stateProvider
.state('authorities', {
url: '/authorities',
templateUrl: '/angular/authorities/view/view.tpl.html',
controller: 'AuthoritiesViewController'
})
.state('authority', {
url: '/authorities/:name',
templateUrl: '/angular/authorities/view/view.tpl.html',
controller: 'AuthoritiesViewController'
});
})
.controller('AuthoritiesViewController', function ($scope, $q, $modal, AuthorityApi, AuthorityService, ngTableParams) {
$scope.filter = {};
.controller('AuthoritiesViewController', function ($scope, $q, $modal, $stateParams, AuthorityApi, AuthorityService, ngTableParams) {
$scope.filter = $stateParams;
$scope.authoritiesTable = new ngTableParams({
page: 1, // show first page
count: 10, // count per page

View File

@ -34,6 +34,9 @@
</a>
</div>
</td>
<td data-title="''">
<a ui-sref="authority({'name': '{{ authority.name }}'})">Permalink</a>
</td>
<td data-title="''">
<div class="btn-group-vertical pull-right">
<button tooltip="Edit Authority" ng-click="edit(authority.id)" class="btn btn-sm btn-info">

View File

@ -2,15 +2,23 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/certificates', {
.config(function config($stateProvider) {
$stateProvider
.state('certificates', {
url: '/certificates',
templateUrl: '/angular/certificates/view/view.tpl.html',
controller: 'CertificatesViewController'
})
.state('certificate', {
url: '/certificates/:name',
templateUrl: '/angular/certificates/view/view.tpl.html',
controller: 'CertificatesViewController'
});
})
.controller('CertificatesViewController', function ($q, $scope, $modal, CertificateApi, CertificateService, MomentService, ngTableParams) {
$scope.filter = {};
.controller('CertificatesViewController', function ($q, $scope, $modal, $stateParams, CertificateApi, CertificateService, MomentService, ngTableParams) {
$scope.filter = $stateParams;
$scope.certificateTable = new ngTableParams({
page: 1, // show first page
count: 10, // count per page

View File

@ -41,6 +41,9 @@
<td data-title="'Common Name'" filter="{ 'cn': 'text'}">
{{ certificate.cn }}
</td>
<td data-title="''">
<a ui-sref="certificate({'name': '{{ certificate.name }}'})">Permalink</a>
</td>
<td data-title="''">
<div class="btn-group pull-right">
<button ng-model="certificate.toggle" class="btn btn-sm btn-info" btn-checkbox btn-checkbox-true="1" butn-checkbox-false="0">More</button>
@ -122,6 +125,7 @@
</div>
</tab>
</tabset>
<tabset justified="true" class="col-md-6">
<tab heading="Chain">
<p>

View File

@ -1,8 +1,9 @@
'use strict';
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/dashboard', {
.config(function config($stateProvider) {
$stateProvider.state('dashboard', {
url: '/dashboard',
templateUrl: '/angular/dashboard/dashboard.tpl.html',
controller: 'DashboardController'
});

View File

@ -2,8 +2,9 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/destinations', {
.config(function config($stateProvider) {
$stateProvider.state('destinations', {
url: '/destinations',
templateUrl: '/angular/destinations/view/view.tpl.html',
controller: 'DestinationsViewController'
});

View File

@ -2,8 +2,9 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/domains', {
.config(function config($stateProvider) {
$stateProvider.state('domains', {
url: '/domains',
templateUrl: '/angular/domains/view/view.tpl.html',
controller: 'DomainsViewController'
});

View File

@ -2,8 +2,9 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/notifications', {
.config(function config($stateProvider) {
$stateProvider.state('notifications', {
url: '/notifications',
templateUrl: '/angular/notifications/view/view.tpl.html',
controller: 'NotificationsViewController'
});

View File

@ -2,8 +2,9 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/roles', {
.config(function config($stateProvider) {
$stateProvider.state('roles', {
url: '/roles',
templateUrl: '/angular/roles/view/view.tpl.html',
controller: 'RolesViewController'
});

View File

@ -2,8 +2,9 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/sources', {
.config(function config($stateProvider) {
$stateProvider.state('sources', {
url: '/sources',
templateUrl: '/angular/sources/view/view.tpl.html',
controller: 'SourcesViewController'
});

View File

@ -2,8 +2,9 @@
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/users', {
.config(function config($stateProvider) {
$stateProvider.state('users', {
url: '/users',
templateUrl: '/angular/users/view/view.tpl.html',
controller: 'UsersViewController'
});

View File

@ -49,24 +49,24 @@
</div>
<div class="navbar-collapse collapse" ng-controller="LoginController">
<ul class="nav navbar-nav navbar-left">
<li><a href="/#/dashboard">Dashboard</a></li>
<li><a href="/#/certificates">Certificates</a></li>
<li><a href="/#/authorities">Authorities</a></li>
<li><a href="/#/notifications">Notifications</a></li>
<li><a href="/#/destinations">Destinations</a></li>
<li><a href="/#/sources">Sources</a></li>
<li><a ui-sref="dashboard">Dashboard</a></li>
<li><a ui-sref="certificates">Certificates</a></li>
<li><a ui-sref="authorities">Authorities</a></li>
<li><a ui-sref="notifications">Notifications</a></li>
<li><a ui-sref="destinations">Destinations</a></li>
<li><a ui-sref="sources">Sources</a></li>
<li></li>
<li class="dropdown" dropdown on-toggle="toggled(open)">
<a href class="dropdown-toggle" dropdown-toggle>Settings <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/#/roles">Roles</a></li>
<li><a href="/#/users">Users</a></li>
<li><a href="/#/domains">Domains</a></li>
<li><a ui-sref="roles">Roles</a></li>
<li><a ui-sref="users">Users</a></li>
<li><a ui-sref="domains">Domains</a></li>
</ul>
</li>
</ul>
<ul ng-show="!currentUser.username" class="nav navbar-nav navbar-right">
<li><a href="/#/login">Login</a></li>
<li><a ui-sref="login">Login</a></li>
</ul>
<ul ng-show="currentUser.username" class="nav navbar-nav navbar-right">
<li class="dropdown" dropdown on-toggle="toggled(open)">
@ -88,7 +88,7 @@
</div>
<!-- Add your site or application content here -->
<div class="container-fluid">
<div ng-view></div>
<div ui-view></div>
</div>
<footer class="footer">
<div class="container">