bug 7638: Added deep link support for the UI. Only support values are "instance", "volume", and "ip" for now as indicated in the bug.

Use lp=instance, lp=volume, or lp=storage
This commit is contained in:
will 2010-12-21 17:52:20 -08:00
parent bb5859de83
commit eabea789be
2 changed files with 26 additions and 4 deletions

View File

@ -17,6 +17,26 @@
*/
$(document).ready(function() {
function initUI() {
var context = $.urlParam('lp');
if (context != null) {
if (context == 'instance') {
$("#leftmenu_instances").click();
$("#leftmenu_instances_my_instances").click();
} else if (context == 'volume') {
$("#leftmenu_storage").click();
$("#leftmenu_volume").click();
} else if (context == 'ip') {
$("#leftmenu_network").click();
$("#leftmenu_ip").click();
} else {
$("#leftmenu_dashboard").click();
}
} else {
$("#leftmenu_dashboard").click();
}
}
$(".leftmenu_content_flevel").hover(
function() {
$(this).find(".leftmenu_arrows_firstlevel_open").show();
@ -597,9 +617,9 @@ $(document).ready(function() {
$("#main_username").text(g_username);
$("#login_wrapper").hide();
showLeftNavigationBasedOnRole();
showLeftNavigationBasedOnRole();
initUI();
$("#main").show();
$("#leftmenu_dashboard").click();
},
error: function() {
$("#account_password").val("");
@ -672,8 +692,8 @@ $(document).ready(function() {
success: function(json) {
buildSecondLevelNavigation();
$("#main_username").text(g_username);
$("#leftmenu_dashboard").click();
showLeftNavigationBasedOnRole();
showLeftNavigationBasedOnRole();
initUI();
$("#main").show();
},
error: function(xmlHTTP) {

View File

@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (!results) { return 0; } return results[1] || 0;}
//***** actions for a tab in right panel (begin) ************************************************************************
function buildActionLinkForTab(label, actionMap, $actionMenu, $midmenuItem1, $thisTab) {