|
10 | 10 | // Main application with dependencies |
11 | 11 | var dashboardApp = angular.module('dashboardApp', |
12 | 12 | ['ngRoute', 'dashboardApp.navBar','dashboardControllers', 'ngAnimate']); |
13 | | - |
14 | | -var digExperienceDashboard = 'Digital Experience Dashboard'; |
15 | | - |
| 13 | +var firstRoute = true; |
16 | 14 | // Configure routes for the different views |
17 | 15 | dashboardApp.config(['$routeProvider', function($routeProvider) { |
| 16 | + var redirect = '/listApps'; |
| 17 | + if(firstRoute == true){ |
| 18 | + firstRoute = false; |
| 19 | + var digExperienceDashboard = 'Digital Experience Dashboard'; |
| 20 | + var configInfo = dashConfig.getConfigInfo(); |
| 21 | + var haveServers = configInfo.servers[0].host.length!= 0; |
| 22 | + // first start up and no routes go to settings |
| 23 | + if(haveServers == false){ |
| 24 | + redirect = '/settings'; |
| 25 | + } |
| 26 | + else{ |
| 27 | + redirect = configInfo.lastOpened; |
| 28 | + if(!redirect) |
| 29 | + redirect = '/listApps'; |
| 30 | + } |
| 31 | + |
| 32 | + } |
18 | 33 | $routeProvider.when('/listApps', { |
19 | | - templateUrl: 'partials/listAppsView.html' |
20 | | - ,controller: 'AppsListController' |
21 | | - }).when('/appDetails/:id', { |
22 | | - templateUrl: 'partials/appDetailsView.html' |
23 | | - // , controller : 'AppDetailsController' |
24 | | - }).when('/settings', { |
25 | | - templateUrl: 'partials/settingsView.html' |
26 | | - ,controller: 'SettingsController' |
27 | | - }).when('/listThemes', { |
28 | | - templateUrl: 'partials/listThemesView.html' |
29 | | - ,controller: 'ThemeListController' |
30 | | - }).when('/listWcmDesigns', { |
31 | | - templateUrl: 'partials/listWcmDesignsView.html' |
32 | | - ,controller: 'WcmDesignListController' |
33 | | - }).otherwise({ |
34 | | - redirectTo: '/listApps' |
35 | | - }); |
| 34 | + templateUrl: 'partials/listAppsView.html' |
| 35 | + ,controller: 'AppsListController' |
| 36 | + }).when('/appDetails/:id', { |
| 37 | + templateUrl: 'partials/appDetailsView.html' |
| 38 | + // , controller : 'AppDetailsController' |
| 39 | + }).when('/settings', { |
| 40 | + templateUrl: 'partials/settingsView.html' |
| 41 | + ,controller: 'SettingsController' |
| 42 | + }).when('/listThemes', { |
| 43 | + templateUrl: 'partials/listThemesView.html' |
| 44 | + ,controller: 'ThemeListController' |
| 45 | + }).when('/listWcmDesigns', { |
| 46 | + templateUrl: 'partials/listWcmDesignsView.html' |
| 47 | + ,controller: 'WcmDesignListController' |
| 48 | + }).otherwise({ |
| 49 | + redirectTo: redirect |
| 50 | + }); |
36 | 51 | }]); |
0 commit comments