app.js 896 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. 'vg'
  12. ]);
  13. app.constant('urlPrefix', '/mod/dashboard');
  14. app.constant('keyPrefix', '/v2/keys/');
  15. app.config(function($routeProvider, $locationProvider, urlPrefix) {
  16. function prefixUrl(url) {
  17. return urlPrefix + url;
  18. }
  19. $locationProvider.html5Mode(true);
  20. $routeProvider
  21. .when(prefixUrl('/'), {
  22. controller: 'HomeCtrl',
  23. templateUrl: prefixUrl('/views/home.html')
  24. })
  25. .when(prefixUrl('/stats'), {
  26. controller: 'StatsCtrl',
  27. templateUrl: prefixUrl('/views/stats.html')
  28. })
  29. .when(prefixUrl('/browser'), {
  30. controller: 'BrowserCtrl',
  31. templateUrl: prefixUrl('/views/browser.html')
  32. })
  33. .otherwise({
  34. templateUrl: prefixUrl('/404.html')
  35. });
  36. });