Repository: ambari Updated Branches: refs/heads/trunk cc20626ce -> b88de637e
AMBARI-5781. Views: when a particular view is selected, the URL should reflect it so that upon page refresh the right view loads up.(xiwang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b88de637 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b88de637 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b88de637 Branch: refs/heads/trunk Commit: b88de637e36103941e73ba2b500ad1ae4bade7ee Parents: 6180950 Author: Xi Wang <[email protected]> Authored: Thu May 15 11:15:07 2014 -0700 Committer: Xi Wang <[email protected]> Committed: Fri May 16 14:25:49 2014 -0700 ---------------------------------------------------------------------- .../app/controllers/main/views_controller.js | 2 +- ambari-web/app/routes/main.js | 24 ++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b88de637/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 242d989..5401911 100644 --- a/ambari-web/app/controllers/main/views_controller.js +++ b/ambari-web/app/controllers/main/views_controller.js @@ -26,7 +26,7 @@ App.MainViewsController = Em.Controller.extend({ setView: function(event) { if(event.context){ this.set('selectedView', event.context); - App.router.transitionTo('views'); + App.router.transitionTo('main.views.viewDetails', event.context); } } }) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/b88de637/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 8f64ecf..f26b28b 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -62,13 +62,10 @@ module.exports = Em.Route.extend({ redirectsTo: 'dashboard.index' }), + connectOutlets: function (router, context) { + router.get('applicationController').connectOutlet('main'); + }, - views: Ember.Route.extend({ - route: '/views', - connectOutlets: function (router, context) { - router.get('mainController').connectOutlet('mainViews'); - } - }), test: Em.Route.extend({ route: '/test', connectOutlets: function (router, context) { @@ -76,9 +73,18 @@ module.exports = Em.Route.extend({ } }), - connectOutlets: function (router, context) { - router.get('applicationController').connectOutlet('main'); - }, + views: Em.Route.extend({ + route: '/views', + connectOutlets: function (router, context) { + router.get('mainController').connectOutlet('mainViews'); + }, + viewDetails: Em.Route.extend({ + route : '/:viewName/:version/:instanceName', + connectOutlets : function (router, context) { + router.get('mainController').connectOutlet('mainViews'); + } + }) + }), dashboard: Em.Route.extend({ route: '/dashboard',
