refactor(dashboard): Restructured front-end dashboard code.
This commit is contained in:
42
mod/dashboard/app/scripts/app.js
Normal file
42
mod/dashboard/app/scripts/app.js
Normal 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')
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user