refactor(dashboard): Restructured front-end dashboard code.

This commit is contained in:
Ed Rooth
2014-02-04 11:13:18 -08:00
parent 8a172322ff
commit 06f990236c
27 changed files with 1048 additions and 1100 deletions

View File

@ -0,0 +1,42 @@
'use strict';
var app = angular.module('etcdControlPanel', [
'ngRoute',
'ngResource',
'etcd',
'etcdDirectives',
'timeRelative',
'underscore',
'jquery',
'moment'
]);
app.constant('urlPrefix', '/mod/dashboard');
app.constant('keyPrefix', '/v2/keys/');
app.config(function($routeProvider, $locationProvider, urlPrefix) {
function prefixUrl(url) {
return urlPrefix + url;
}
$locationProvider.html5Mode(true);
$routeProvider
.when(prefixUrl('/'), {
controller: 'HomeCtrl',
templateUrl: prefixUrl('/views/home.html')
})
//.when(prefixUrl('/stats'), {
//controller: 'StatsCtrl',
//templateUrl: prefixUrl('/views/stats.html')
//})
.when(prefixUrl('/browser'), {
controller: 'BrowserCtrl',
templateUrl: prefixUrl('/views/browser.html')
})
.otherwise({
templateUrl: prefixUrl('/404.html')
});
});