diff options
author | Adam Young <ayoung@redhat.com> | 2011-07-20 11:43:41 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-07-20 13:40:01 -0400 |
commit | bc4e97e191f68cdf16e0ef76b218c1f602835c2c (patch) | |
tree | c2eb01da980128205ff9ee09a4a455e08fcd6480 /install/ui | |
parent | 7ce57e38c43b4a1f3e422a644760f94043058feb (diff) | |
download | freeipa-bc4e97e191f68cdf16e0ef76b218c1f602835c2c.tar.gz freeipa-bc4e97e191f68cdf16e0ef76b218c1f602835c2c.tar.xz freeipa-bc4e97e191f68cdf16e0ef76b218c1f602835c2c.zip |
no dns
Remove all DNS entities if the DNS server is not installed.
Removes it from the navigation as well.
https://fedorahosted.org/freeipa/ticket/1498
move created count to last thing in the funciton.
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/dns.js | 5 | ||||
-rw-r--r-- | install/ui/navigation.js | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js index 740192653..58aeaddff 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -117,6 +117,11 @@ IPA.dns_record_search_load = function (result) { }; IPA.entity_factories.dnsrecord = function() { + + if (!IPA.dns_enabled) { + throw "DNS not enabled on server"; + } + return IPA.entity_builder(). entity('dnsrecord'). containing_entity('dnszone'). diff --git a/install/ui/navigation.js b/install/ui/navigation.js index 25c519dce..be2936dca 100644 --- a/install/ui/navigation.js +++ b/install/ui/navigation.js @@ -217,6 +217,7 @@ IPA.navigation = function(spec) { container.addClass('tabs'+depth); var ul = $('<ul/>').appendTo(container); + var created_count = 0; for (var i=0; i<tabs.length; i++) { var tab = tabs[i]; @@ -240,7 +241,7 @@ IPA.navigation = function(spec) { href: '#'+tab_id, title: tab.label, html: tab.label - })).appendTo(ul); + })); if (tab.hidden){ tab_li.css('display','none'); @@ -249,12 +250,23 @@ IPA.navigation = function(spec) { tab.container = $('<div/>', { id: tab_id, name: tab.name - }).appendTo(container); + }); if (tab.children && tab.children.length) { - that._create(tab.children, tab.container, depth+1); + var kids = + that._create(tab.children, tab.container, depth+1); + /*If there are no child tabs, remove the container */ + if (kids === 0){ + tabs.splice(i,1); + i -= 1; + continue; + } } + created_count += 1; + tab_li.appendTo(ul); + tab.container.appendTo(container); } + return created_count; }; that.update = function() { |