ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-6567. Views: Browser refresh leaves a blank page (Buzhor Denys via alexantonenko)
Date Tue, 22 Jul 2014 19:49:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk bb79b152f -> e784e2631


AMBARI-6567. Views: Browser refresh leaves a blank page (Buzhor Denys via alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e784e263
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e784e263
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e784e263

Branch: refs/heads/trunk
Commit: e784e26310c7d8664b2a40c189dab5e265fe0ccc
Parents: bb79b15
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Tue Jul 22 22:41:29 2014 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Tue Jul 22 22:41:29 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers.js                   |  1 +
 .../app/controllers/main/views_controller.js    |  5 +----
 ambari-web/app/routes/main.js                   | 19 ++++++------------
 ambari-web/app/views/main/views/details.js      |  4 ++--
 .../app/views/main/views/details_controller.js  | 21 ++++++++++++++++++++
 5 files changed, 31 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e784e263/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 8e80aa1..9e915a6 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -126,6 +126,7 @@ require('controllers/main/mirroring/datasets_controller');
 require('controllers/main/mirroring/jobs_controller');
 require('controllers/main/mirroring/manage_clusters_controller');
 require('controllers/main/views_controller');
+require('controllers/main/views/details_controller');
 require('controllers/wizard/slave_component_groups_controller');
 require('controllers/wizard/step0_controller');
 require('controllers/wizard/step1_controller');

http://git-wip-us.apache.org/repos/asf/ambari/blob/e784e263/ambari-web/app/controllers/main/views_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/views_controller.js b/ambari-web/app/controllers/main/views_controller.js
index 5401911..5d64da6 100644
--- a/ambari-web/app/controllers/main/views_controller.js
+++ b/ambari-web/app/controllers/main/views_controller.js
@@ -21,12 +21,9 @@ var App = require('app');
 App.MainViewsController = Em.Controller.extend({
   name:'mainViewsController',
 
-  selectedView: null,
-
   setView: function(event) {
     if(event.context){
-      this.set('selectedView', event.context);
       App.router.transitionTo('main.views.viewDetails', event.context);
     }
   }
-})
\ No newline at end of file
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e784e263/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 8bd1716..9fd01a5 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -72,27 +72,20 @@ module.exports = Em.Route.extend({
 
   views: Em.Route.extend({
     route: '/views',
-    connectOutlets: function (router, context) {
-      router.get('mainController').connectOutlet('mainViews');
-    },
     index: Em.Route.extend({
       route: '/',
-      enter: function (router) {
-        Em.run.next(function () {
-          router.transitionTo('allViews');
-        });
-      }
-    }),
-    allViews: Em.Route.extend({
-      route: '/',
       connectOutlets: function (router, context) {
         router.get('mainController').connectOutlet('mainViews');
       }
     }),
     viewDetails: Em.Route.extend({
       route: '/:viewName/:version/:instanceName',
-      connectOutlets: function (router, view) {
-        router.get('mainController').connectOutlet('mainViewsDetails');
+      connectOutlets: function (router, params) {
+        router.get('mainController').dataLoading().done(function() {
+          // find and set content for `mainViewsDetails` and associated controller
+          router.get('mainController').connectOutlet('mainViewsDetails', App.router.get('clusterController.ambariViews')
+            .findProperty('href', ['/views', params.viewName, params.version, params.instanceName].join('/')));
+        });
       }
     })
   }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/e784e263/ambari-web/app/views/main/views/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/views/details.js b/ambari-web/app/views/main/views/details.js
index 1479657..98184ef 100644
--- a/ambari-web/app/views/main/views/details.js
+++ b/ambari-web/app/views/main/views/details.js
@@ -28,7 +28,7 @@ App.MainViewsDetailsView = Em.View.extend({
   seamless: "seamless",
 
   src: function() {
-    return window.location.origin + App.router.get('mainViewsController.selectedView.href');
-  }.property('App.MainViewsController.selectedView')
+    return window.location.origin + this.get('controller.content.href');
+  }.property('controller.content')
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/e784e263/ambari-web/app/views/main/views/details_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/views/details_controller.js b/ambari-web/app/views/main/views/details_controller.js
new file mode 100644
index 0000000..451fa07
--- /dev/null
+++ b/ambari-web/app/views/main/views/details_controller.js
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.MainViewsDetailsController = Em.Controller.extend({
+  name:'mainViewsDetailsController'
+});


Mime
View raw message