Adding ui router and perma links to certificates and authorities

This commit is contained in:
kevgliss 2015-10-05 09:00:51 -07:00
parent c0f14db5bb
commit 162482dbc4
16 changed files with 84 additions and 52 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,6 +41,9 @@
<td data-title="'Common Name'" filter="{ 'cn': 'text'}"> <td data-title="'Common Name'" filter="{ 'cn': 'text'}">
{{ certificate.cn }} {{ certificate.cn }}
</td> </td>
<td data-title="''">
<a ui-sref="certificate({'name': '{{ certificate.name }}'})">Permalink</a>
</td>
<td data-title="''"> <td data-title="''">
<div class="btn-group pull-right"> <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> <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> </div>
</tab> </tab>
</tabset> </tabset>
<tabset justified="true" class="col-md-6"> <tabset justified="true" class="col-md-6">
<tab heading="Chain"> <tab heading="Chain">
<p> <p>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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