diff --git a/src/sunstone/etc/sunstone-plugins.yaml b/src/sunstone/etc/sunstone-plugins.yaml index 7330791c4e..edde7af592 100644 --- a/src/sunstone/etc/sunstone-plugins.yaml +++ b/src/sunstone/etc/sunstone-plugins.yaml @@ -53,6 +53,11 @@ :ALL: true :user: :group: +- plugins/clusters-tab.js: + :ALL: false + :user: + :group: + oneadmin: true - plugins/hosts-tab.js: :ALL: true :user: @@ -65,8 +70,3 @@ :ALL: true :user: :group: -- plugins/clusters-tab.js: - :ALL: false - :user: - :group: - oneadmin: true diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index df9659a96c..20e82c3909 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -465,7 +465,19 @@ function insertTab(tab_name){ $('div#'+tab_name,main_tabs_context).html(tab_info.content); - $('div#menu ul#navigation').append('
  • '+tab_info.title+'
  • '); + var li_item = '
  • '+tab_info.title+'
  • '; + + //if this is a submenu... + if (parent.length) { + var children = $('div#menu ul#navigation li.'+parent); + //if there are other submenus, insert after last of them + if (children.length) + $(children[children.length-1]).after(li_item); + else //instert after parent menu + $('div#menu ul#navigation li#li_'+parent).after(li_item); + } else { //not a submenu, instert in the end + $('div#menu ul#navigation').append(li_item); + }; if (parent){ //this is a subtab $('div#menu li#li_'+tab_name).hide();//hide by default