app.js 896 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. var app = angular.module('etcdControlPanel', [
  3. 'ngRoute',
  4. 'ngResource',
  5. 'etcd',
  6. 'etcdDirectives',
  7. 'timeRelative',
  8. 'underscore',
  9. 'jquery',
  10. 'moment'
  11. ]);
  12. app.constant('urlPrefix', '/mod/dashboard');
  13. app.constant('keyPrefix', '/v2/keys/');
  14. app.config(function($routeProvider, $locationProvider, urlPrefix) {
  15. function prefixUrl(url) {
  16. return urlPrefix + url;
  17. }
  18. $locationProvider.html5Mode(true);
  19. $routeProvider
  20. .when(prefixUrl('/'), {
  21. controller: 'HomeCtrl',
  22. templateUrl: prefixUrl('/views/home.html')
  23. })
  24. //.when(prefixUrl('/stats'), {
  25. //controller: 'StatsCtrl',
  26. //templateUrl: prefixUrl('/views/stats.html')
  27. //})
  28. .when(prefixUrl('/browser'), {
  29. controller: 'BrowserCtrl',
  30. templateUrl: prefixUrl('/views/browser.html')
  31. })
  32. .otherwise({
  33. templateUrl: prefixUrl('/404.html')
  34. });
  35. });