diff options
author | Adam Young <ayoung@redhat.com> | 2010-11-19 15:57:40 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2010-11-29 21:13:26 -0500 |
commit | 7b91e9d83dd12c18ebe5d57f3fb86e1c27703b58 (patch) | |
tree | bd43147c1fde8019b8ff4870ec2b13620aebb1b8 /install/static/webui.js | |
parent | b683c7261bcadc6899168d7cff8bd218a3501ba6 (diff) | |
download | freeipa-7b91e9d83dd12c18ebe5d57f3fb86e1c27703b58.tar.gz freeipa-7b91e9d83dd12c18ebe5d57f3fb86e1c27703b58.tar.xz freeipa-7b91e9d83dd12c18ebe5d57f3fb86e1c27703b58.zip |
top nav index allows links between differnt top level tabs by calculating the index of the top level tab for the target tab. new version creats third level navigation for nested entities, such as SUDO and HBAC
Diffstat (limited to 'install/static/webui.js')
-rw-r--r-- | install/static/webui.js | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/install/static/webui.js b/install/static/webui.js index 5d1f36e5d..093d32b22 100644 --- a/install/static/webui.js +++ b/install/static/webui.js @@ -33,15 +33,20 @@ var admin_tab_set = [ {name:'service', label:'Services', setup: ipa_entity_setup} ]}, {name:'policy', children:[ - {name:'hbac', setup: ipa_entity_setup}, - {name:'sudorule', setup: ipa_entity_setup}, {name:'dns', setup: ipa_entity_setup}, + {name:'hbac', setup: ipa_entity_setup, children:[ + {name:'hbacsvc', setup: ipa_entity_setup}, + {name:'hbacsvcgroup', setup: ipa_entity_setup} + ]}, + {name:'sudorule', setup: ipa_entity_setup,children:[ + {name:'sudocmd', setup: ipa_entity_setup}, + {name:'sudocmdgroup', setup: ipa_entity_setup} + ]}, {name:'automountlocation', setup: ipa_entity_setup}, {name:'pwpolicy', setup: ipa_entity_setup}, {name:'krbtpolicy', setup:ipa_details_only_setup} ]}, {name:'ipaserver', children: [ -// {name:'aci', setup: ipa_entity_setup}, {name:'taskgroup', setup: ipa_entity_setup}, {name:'rolegroup', label:'Rolegroups', setup: ipa_entity_setup}, {name:'config', setup: ipa_details_only_setup} @@ -54,7 +59,39 @@ var self_serv_tab_set = {name:'user', label:'Users', setup:ipa_entity_setup}]}]; - +IPA.tab_state = function(entity_name){ + + var state = {}; + + for (var top_tab_index = 0; + top_tab_index < IPA.tab_set.length; + top_tab_index += 1){ + var top_tab = IPA.tab_set[top_tab_index]; + for (var subtab_index = 0; + subtab_index < top_tab.children.length; + subtab_index += 1){ + if(top_tab.children[subtab_index].name){ + if (top_tab.children[subtab_index].name === entity_name){ + state.navigation = top_tab_index; + state[top_tab.name] = subtab_index; + return state; + }else if (top_tab.children[subtab_index].children){ + var nested_entities = top_tab.children[subtab_index].children; + for (var nested_index = 0; + nested_index < nested_entities.length; + nested_index += 1){ + if (nested_entities[nested_index].name === entity_name){ + state.navigation = top_tab_index; + state[top_tab.name] = subtab_index; + state[ top_tab.children[subtab_index].name+'_entity'] = entity_name; + return state; + } + } + } + } + } + } +} /* main (document onready event handler) */ $(function() { @@ -78,9 +115,10 @@ $(function() { if (whoami.hasOwnProperty('memberof_rolegroup') && whoami.memberof_rolegroup.length > 0){ + IPA.tab_set = admin_tab_set; nav_create(admin_tab_set, navigation, 'tabs'); - } else { + IPA.tab_set = self_serv_tab_set; nav_create(self_serv_tab_set, navigation, 'tabs'); var state = {'user-pkey':IPA.whoami_pkey , |