Permalink
Browse files

allow route /nodes/master (WIP)

  • Loading branch information...
1 parent 60648f6 commit 40315e8001b18f270a689abbcdc7cea8a003cf55 @lukas-vlcek committed Jun 8, 2012
Showing with 14 additions and 2 deletions.
  1. +14 −2 js/bigdeskApp.js
View
16 js/bigdeskApp.js
@@ -321,7 +321,7 @@ $(document).ready(
routes: {
"nodes" : "nodes",
-// "nodes/master" : "nodes",
+ "nodes/master" : "nodes_master",
"nodes/:nodeId" : "nodes",
"cluster" : "cluster",
"*other" : "defaultRoute"
@@ -346,6 +346,18 @@ $(document).ready(
}
},
+ nodes_master: function() {
+ console.log("try to connect to the master node");
+ var masterNodeId = "";
+ if (!isConnected() && !applyUrlParamsCalled) {
+ // we are not connected and master node id is not known yet
+ } else {
+ masterNodeId = "/" + bigdeskStore.getCluster(selectedClusterName).getMasterNodeId();
+ }
+
+ this.navigate("nodes" + masterNodeId, {trigger: true, replace: true});
+ },
+
nodes: function(nodeId) {
// console.log("change route: nodes("+(nodeId||"")+")");
if (selectedView && _.isFunction(selectedView.clear)) {
@@ -369,7 +381,7 @@ $(document).ready(
},
defaultRoute: function(other) {
- this.navigate("nodes",{trigger: true, replace: true});
+ this.navigate("nodes", {trigger: true, replace: true});
}
});

0 comments on commit 40315e8

Please sign in to comment.