diff --git a/src/sunstone/public/app/main.js b/src/sunstone/public/app/main.js index 75b934c264..54e4317268 100644 --- a/src/sunstone/public/app/main.js +++ b/src/sunstone/public/app/main.js @@ -120,8 +120,8 @@ require.config({ /* Tabs */ "app": { deps: [ - "foundation", "jquery", + "foundation", "tabs/provision-tab", "tabs/dashboard-tab", "tabs/system-top-tab", @@ -173,7 +173,7 @@ require.config({ /* Foundation */ "foundation": { - deps: ["jquery"] + deps: ["jquery"] }, //'foundation.core': { // deps: ['jquery', 'modernizr'], @@ -246,6 +246,12 @@ require.config({ "flot": { deps: ["jquery"] }, + "flot.navigate": { + deps: ["flot"] + }, + "flot.canvas": { + deps: ["flot"] + }, "flot.stack": { deps: ["flot"] }, diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index ab48f88629..4c9cce3082 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -1301,27 +1301,34 @@ define(function(require) { var _setupNavigoRoutes = function() { router = new Navigo(null, true); + var routeForm = function(){ + if(_getTab() == undefined){ + window.sunstoneNoMultipleRedirects = true; + // This will happen if the user opens sunstone directly in a /form url + _showTab(this); + } + }; + var routeWithID = function(id){ + window.sunstoneNoMultipleRedirects = true; + _routerShowElement(this, id); + }; + var routeNormal = function(){ + window.sunstoneNoMultipleRedirects = true; + _routerShowTab(this); + }; + for (var tabName in SunstoneCfg["tabs"]) { - router.on(new RegExp("(?:#|/)"+tabName+"/form"), function(){ - if(_getTab() == undefined){ - window.sunstoneNoMultipleRedirects = true; - // This will happen if the user opens sunstone directly in a /form url - _showTab(this); - } - }.bind(tabName)); + router.on(new RegExp("(?:#|/)"+tabName+"/form"), routeForm.bind(tabName)); + router.on(new RegExp("^"+tabName+"/form"), routeForm.bind(tabName)); - router.on(new RegExp("(?:#|/)"+tabName+"/(\\w+)"), function(id){ - window.sunstoneNoMultipleRedirects = true; - _routerShowElement(this, id); - }.bind(tabName)); + router.on(new RegExp("(?:#|/)"+tabName+"/(\\w+)"), routeWithID.bind(tabName)); + router.on(new RegExp("^"+tabName+"/(\\w+)"), routeWithID.bind(tabName)); - router.on(new RegExp("(?:#|/)"+tabName), function(){ - window.sunstoneNoMultipleRedirects = true; - _routerShowTab(this); - }.bind(tabName)); + router.on(new RegExp("(?:#|/)"+tabName), routeNormal.bind(tabName)); + router.on(new RegExp("^"+tabName), routeNormal.bind(tabName)); } - router.on(function(){ + router.on(function(params){ _routerShowTab(DASHBOARD_TAB_ID); }); diff --git a/src/sunstone/public/app/tabs/hosts-tab/datatable.js b/src/sunstone/public/app/tabs/hosts-tab/datatable.js index 823c90ab6e..ae74c0b62d 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/datatable.js +++ b/src/sunstone/public/app/tabs/hosts-tab/datatable.js @@ -184,10 +184,10 @@ define(function(require) { element.NAME, element.CLUSTER_ID.length ? element.CLUSTER_ID : "-", element.HOST_SHARE.RUNNING_VMS, //rvm - cpuBars.real, - cpuBars.allocated, - memoryBars.real, - memoryBars.allocated, + cpuBars.real||"", + cpuBars.allocated||"", + memoryBars.real||"", + memoryBars.allocated||"", state, element.IM_MAD, element.VM_MAD, diff --git a/src/sunstone/public/app/utils/range-slider.js b/src/sunstone/public/app/utils/range-slider.js index 208d651704..33d1394b60 100644 --- a/src/sunstone/public/app/utils/range-slider.js +++ b/src/sunstone/public/app/utils/range-slider.js @@ -15,6 +15,7 @@ /* -------------------------------------------------------------------------- */ define(function(require) { + require("jquery"); var TemplateHTML = require('hbs!./range-slider/html'); var sliderId = 0;