all.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. define([
  2. 'angular',
  3. '../core_module',
  4. './bundle_loader',
  5. './dashboard_loaders',
  6. ], function(angular, coreModule, BundleLoader) {
  7. "use strict";
  8. coreModule.default.config(function($routeProvider, $locationProvider) {
  9. $locationProvider.html5Mode(true);
  10. var loadOrgBundle = new BundleLoader.BundleLoader('app/features/org/all');
  11. var loadAppsBundle = new BundleLoader.BundleLoader('app/features/apps/all');
  12. $routeProvider
  13. .when('/', {
  14. templateUrl: 'public/app/partials/dashboard.html',
  15. controller : 'LoadDashboardCtrl',
  16. reloadOnSearch: false,
  17. })
  18. .when('/dashboard/:type/:slug', {
  19. templateUrl: 'public/app/partials/dashboard.html',
  20. controller : 'LoadDashboardCtrl',
  21. reloadOnSearch: false,
  22. })
  23. .when('/dashboard-solo/:type/:slug', {
  24. templateUrl: 'public/app/features/panel/partials/soloPanel.html',
  25. controller : 'SoloPanelCtrl',
  26. })
  27. .when('/dashboard-import/:file', {
  28. templateUrl: 'public/app/partials/dashboard.html',
  29. controller : 'DashFromImportCtrl',
  30. reloadOnSearch: false,
  31. })
  32. .when('/dashboard/new', {
  33. templateUrl: 'public/app/partials/dashboard.html',
  34. controller : 'NewDashboardCtrl',
  35. reloadOnSearch: false,
  36. })
  37. .when('/import/dashboard', {
  38. templateUrl: 'public/app/features/dashboard/partials/import.html',
  39. controller : 'DashboardImportCtrl',
  40. })
  41. .when('/datasources', {
  42. templateUrl: 'public/app/features/datasources/partials/list.html',
  43. controller : 'DataSourcesCtrl',
  44. resolve: loadOrgBundle,
  45. })
  46. .when('/datasources/edit/:id', {
  47. templateUrl: 'public/app/features/datasources/partials/edit.html',
  48. controller : 'DataSourceEditCtrl',
  49. resolve: loadOrgBundle,
  50. })
  51. .when('/datasources/new', {
  52. templateUrl: 'public/app/features/datasources/partials/edit.html',
  53. controller : 'DataSourceEditCtrl',
  54. resolve: loadOrgBundle,
  55. })
  56. .when('/org', {
  57. templateUrl: 'public/app/features/org/partials/orgDetails.html',
  58. controller : 'OrgDetailsCtrl',
  59. resolve: loadOrgBundle,
  60. })
  61. .when('/org/new', {
  62. templateUrl: 'public/app/features/org/partials/newOrg.html',
  63. controller : 'NewOrgCtrl',
  64. resolve: loadOrgBundle,
  65. })
  66. .when('/org/users', {
  67. templateUrl: 'public/app/features/org/partials/orgUsers.html',
  68. controller : 'OrgUsersCtrl',
  69. resolve: loadOrgBundle,
  70. })
  71. .when('/org/apikeys', {
  72. templateUrl: 'public/app/features/org/partials/orgApiKeys.html',
  73. controller : 'OrgApiKeysCtrl',
  74. resolve: loadOrgBundle,
  75. })
  76. .when('/profile', {
  77. templateUrl: 'public/app/features/profile/partials/profile.html',
  78. controller : 'ProfileCtrl',
  79. })
  80. .when('/profile/password', {
  81. templateUrl: 'public/app/features/profile/partials/password.html',
  82. controller : 'ChangePasswordCtrl',
  83. })
  84. .when('/profile/select-org', {
  85. templateUrl: 'public/app/features/profile/partials/select_org.html',
  86. controller : 'SelectOrgCtrl',
  87. })
  88. .when('/admin/settings', {
  89. templateUrl: 'public/app/features/admin/partials/settings.html',
  90. controller : 'AdminSettingsCtrl',
  91. })
  92. .when('/admin/users', {
  93. templateUrl: 'public/app/features/admin/partials/users.html',
  94. controller : 'AdminListUsersCtrl',
  95. })
  96. .when('/admin/users/create', {
  97. templateUrl: 'public/app/features/admin/partials/new_user.html',
  98. controller : 'AdminEditUserCtrl',
  99. })
  100. .when('/admin/users/edit/:id', {
  101. templateUrl: 'public/app/features/admin/partials/edit_user.html',
  102. controller : 'AdminEditUserCtrl',
  103. })
  104. .when('/admin/orgs', {
  105. templateUrl: 'public/app/features/admin/partials/orgs.html',
  106. controller : 'AdminListOrgsCtrl',
  107. })
  108. .when('/admin/orgs/edit/:id', {
  109. templateUrl: 'public/app/features/admin/partials/edit_org.html',
  110. controller : 'AdminEditOrgCtrl',
  111. })
  112. .when('/admin/stats', {
  113. templateUrl: 'public/app/features/admin/partials/stats.html',
  114. controller : 'AdminStatsCtrl',
  115. controllerAs: 'ctrl',
  116. })
  117. .when('/login', {
  118. templateUrl: 'public/app/partials/login.html',
  119. controller : 'LoginCtrl',
  120. })
  121. .when('/invite/:code', {
  122. templateUrl: 'public/app/partials/signup_invited.html',
  123. controller : 'InvitedCtrl',
  124. })
  125. .when('/signup', {
  126. templateUrl: 'public/app/partials/signup_step2.html',
  127. controller : 'SignUpCtrl',
  128. })
  129. .when('/user/password/send-reset-email', {
  130. templateUrl: 'public/app/partials/reset_password.html',
  131. controller : 'ResetPasswordCtrl',
  132. })
  133. .when('/user/password/reset', {
  134. templateUrl: 'public/app/partials/reset_password.html',
  135. controller : 'ResetPasswordCtrl',
  136. })
  137. .when('/dashboard/snapshots', {
  138. templateUrl: 'public/app/features/snapshot/partials/snapshots.html',
  139. controller : 'SnapshotsCtrl',
  140. controllerAs: 'ctrl',
  141. })
  142. .when('/apps', {
  143. templateUrl: 'public/app/features/apps/partials/list.html',
  144. controller: 'AppListCtrl',
  145. controllerAs: 'ctrl',
  146. resolve: loadAppsBundle,
  147. })
  148. .when('/apps/edit/:appId', {
  149. templateUrl: 'public/app/features/apps/partials/edit.html',
  150. controller: 'AppEditCtrl',
  151. controllerAs: 'ctrl',
  152. resolve: loadAppsBundle,
  153. })
  154. .when('/global-alerts', {
  155. templateUrl: 'public/app/features/dashboard/partials/globalAlerts.html',
  156. })
  157. .otherwise({
  158. templateUrl: 'public/app/partials/error.html',
  159. controller: 'ErrorCtrl'
  160. });
  161. });
  162. });