Selaa lähdekoodia

AMBARI-5573. UI does not redirect on 'Dashboard' page after login (Denys Buzhor via alexantonenko)

Alex Antonenko 11 vuotta sitten
vanhempi
commit
739d35e385

+ 1 - 1
ambari-web/app/controllers/main/host/details.js

@@ -46,7 +46,7 @@ App.MainHostDetailsController = Em.Controller.extend({
    * @method routeHome
    */
   routeHome: function () {
-    App.router.transitionTo('main.dashboard');
+    App.router.transitionTo('main.dashboard.index');
   },
 
   /**

+ 1 - 1
ambari-web/app/controllers/main/jobs/hive_job_details_controller.js

@@ -73,7 +73,7 @@ App.MainHiveJobDetailsController = Em.Controller.extend({
    * open dashboard page
    */
   routeHome : function() {
-    App.router.transitionTo('main.dashboard');
+    App.router.transitionTo('main.dashboard.index');
   },
 
   /**

+ 2 - 2
ambari-web/app/router.js

@@ -275,13 +275,13 @@ App.Router = Em.Router.extend({
       if (App.alwaysGoToInstaller) {
         return 'installer';
       } else {
-        return 'main.dashboard';
+        return 'main.dashboard.index';
       }
     }
     App.clusterStatus.updateFromServer(false, false);
     var clusterStatusOnServer = App.clusterStatus.get('value');
     if (!App.get('isAdmin') || clusterStatusOnServer && clusterStatusOnServer.clusterState === 'DEFAULT') {
-      return 'main.dashboard';
+      return 'main.dashboard.index';
     } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('addHostController.name')) {
       // if wizardControllerName == "addHostController", then it means someone closed the browser or the browser was crashed when we were last in Add Hosts wizard
       return 'main.hostAdd';

+ 2 - 2
ambari-web/app/routes/installer.js

@@ -70,7 +70,7 @@ module.exports = Em.Route.extend({
                   break;
                 case 'DEFAULT' :
                 default:
-                  router.transitionTo('main.dashboard');
+                  router.transitionTo('main.dashboard.index');
                   break;
               }
             }
@@ -410,7 +410,7 @@ module.exports = Em.Route.extend({
       // We need to do recovery based on whether we are in Add Host or Installer wizard
       controller.saveClusterState('DEFAULT');
 
-      router.transitionTo('main.dashboard');
+      router.transitionTo('main.dashboard.index');
     }
   }),
 

+ 15 - 7
ambari-web/app/routes/main.js

@@ -87,7 +87,11 @@ module.exports = Em.Route.extend({
     },
     index: Em.Route.extend({
       route: '/',
-      redirectsTo: 'widgets'
+      enter: function(router) {
+        Em.run.next(function(){
+          router.transitionTo('widgets');
+        });
+      }
     }),
     //on click nav tabs events, go to widgets view or heatmap view
     goToDashboardView: function (router, event) {
@@ -108,7 +112,11 @@ module.exports = Em.Route.extend({
       },
       index: Ember.Route.extend({
         route: '/',
-        redirectsTo: 'heatmap'
+        enter: function(router) {
+         Em.run.next(function(){
+           router.transitionTo('heatmap');
+         });
+        }
       }),
       heatmap: Em.Route.extend({
         route: '/heatmap',
@@ -136,7 +144,7 @@ module.exports = Em.Route.extend({
     connectOutlets: function (router) {
       if (App.get('isHadoop2Stack')) {
         Em.run.next(function () {
-          router.transitionTo('main.dashboard');
+          router.transitionTo('main.dashboard.index');
         });
       } else {
         router.get('mainAppsController').loadRuns();
@@ -150,7 +158,7 @@ module.exports = Em.Route.extend({
     enter: function (router) {
       if(!App.router.get('mainAdminAccessController.showJobs') && !App.get('isAdmin')){
         Em.run.next(function () {
-          router.transitionTo('main.dashboard');
+          router.transitionTo('main.dashboard.index');
         });
       }
     },
@@ -162,7 +170,7 @@ module.exports = Em.Route.extend({
       connectOutlets : function(router) {
         if (!App.get('isHadoop2Stack')) {
           Em.run.next(function() {
-            router.transitionTo('main.dashboard');
+            router.transitionTo('main.dashboard.index');
           });
         } else {
           router.get('mainJobsController').updateJobs('mainJobsController', 'refreshLoadedJobs');
@@ -329,7 +337,7 @@ module.exports = Em.Route.extend({
     enter: function (router, transition) {
       if (!App.isAdmin) {
         Em.run.next(function () {
-          router.transitionTo('main.dashboard');
+          router.transitionTo('main.dashboard.index');
         });
       }
     },
@@ -337,7 +345,7 @@ module.exports = Em.Route.extend({
     routePath: function (router, event) {
       if (!App.isAdmin) {
         Em.run.next(function () {
-          App.router.transitionTo('main.dashboard');
+          App.router.transitionTo('main.dashboard.index');
         });
       } else {
         var controller = router.get('mainAdminController');