summaryrefslogtreecommitdiffstats
path: root/install/ui/dns.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-06-14 12:34:56 -0400
committerEndi S. Dewata <edewata@redhat.com>2011-06-14 23:28:19 +0000
commit7d72eb291a89f8fef372905df5fbb051f15be1c9 (patch)
tree2ad62d6dc8a5d9d20228bd78eb46483c8278a226 /install/ui/dns.js
parent980848b45bb42fc828d52d0af231211c8393d9e9 (diff)
downloadfreeipa-7d72eb291a89f8fef372905df5fbb051f15be1c9.tar.gz
freeipa-7d72eb291a89f8fef372905df5fbb051f15be1c9.tar.xz
freeipa-7d72eb291a89f8fef372905df5fbb051f15be1c9.zip
dns multiple records show multiple records that share the same dnsname
Diffstat (limited to 'install/ui/dns.js')
-rw-r--r--install/ui/dns.js34
1 files changed, 21 insertions, 13 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js
index 55feaa034..1d6b81813 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -421,28 +421,33 @@ IPA.records_facet = function(spec) {
that.set_title(this.container, title);
};
- that.get_record = function(result, index) {
- var record = {};
+ that.get_records = function(result) {
+ var idnsname;
if (result.idnsname) {
- record.idnsname = result.idnsname[0];
+ idnsname = result.idnsname[0];
} else {
- record.idnsname = result.dn.split(',')[0].split('=')[1];
+ idnsname = result.dn.split(',')[0].split('=')[1];
}
+ var records = [];
for (var i=0; i<record_types.length; i++){
var type = record_types[i];
- var data = result[type+'record'];
- if (data) {
- record.type = type;
- record.data = data[0];
- break;
+ var data = result[type+'record'] || [];
+ for (var j =0 ; j < data.length; j+=1){
+ var record = {
+ idnsname: idnsname,
+ type : type,
+ data : data[j]
+ };
+ records.unshift(record);
}
}
- return record;
+ return records;
};
+
that.refresh = function() {
function on_success(data, text_status, xhr) {
@@ -451,8 +456,12 @@ IPA.records_facet = function(spec) {
var result = data.result.result;
for (var i = 0; i<result.length; i++) {
- var record = that.get_record(result[i], 0);
- that.table.add_record(record);
+ var records = that.get_records(result[i]);
+
+ for (var j =0; j < records.length; j +=1){
+ var record = records[j];
+ that.table.add_record(record);
+ }
}
var summary = $('span[name=summary]', that.table.tfoot);
@@ -509,4 +518,3 @@ IPA.records_facet = function(spec) {
return that;
};
-