dns multiple records show multiple records that share the same dnsname

This commit is contained in:
Adam Young 2011-06-14 12:34:56 -04:00 committed by Endi S. Dewata
parent 980848b45b
commit 7d72eb291a
2 changed files with 78 additions and 65 deletions

View File

@ -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;
};

View File

@ -1,110 +1,115 @@
{
"error": null,
"id": 10,
"id": null,
"result": {
"count": 11,
"result": [
{
"dn": "idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"@"
],
"nsrecord": [
"ipa.ayoung.boston.devel.redhat.com."
"server15.ayoung.boston.devel.redhat.com."
]
},
{
"arecord": [
"192.168.122.81"
],
"dn": "idnsname=ipa,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"ipa"
]
},
{
"dn": "idnsname=_ldap._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_ldap._tcp"
],
"srvrecord": [
"0 100 389 ipa"
]
},
{
"dn": "idnsname=_kerberos,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=_kerberos,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos"
],
"txtrecord": [
"AYOUNG.BOSTON.DEVEL.REDHAT.COM"
"SERVER15.AYOUNG.BOSTON.DEVEL.REDHAT.COM"
]
},
{
"dn": "idnsname=_kerberos._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos._tcp"
],
"srvrecord": [
"0 100 88 ipa"
]
},
{
"dn": "idnsname=_kerberos._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos._udp"
],
"srvrecord": [
"0 100 88 ipa"
]
},
{
"dn": "idnsname=_kerberos-master._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=_kerberos-master._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos-master._tcp"
],
"srvrecord": [
"0 100 88 ipa"
"0 100 88 server15"
]
},
{
"dn": "idnsname=_kerberos-master._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=_kerberos-master._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos-master._udp"
],
"srvrecord": [
"0 100 88 ipa"
"0 100 88 server15"
]
},
{
"dn": "idnsname=_kpasswd._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=_kerberos._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos._tcp"
],
"srvrecord": [
"0 100 88 server15"
]
},
{
"dn": "idnsname=_kerberos._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos._udp"
],
"srvrecord": [
"0 100 88 server15"
]
},
{
"dn": "idnsname=_kpasswd._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kpasswd._tcp"
],
"srvrecord": [
"0 100 464 ipa"
"0 100 464 server15"
]
},
{
"dn": "idnsname=_kpasswd._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=_kpasswd._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kpasswd._udp"
],
"srvrecord": [
"0 100 464 ipa"
"0 100 464 server15"
]
},
{
"dn": "idnsname=_ntp._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"dn": "idnsname=_ldap._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_ldap._tcp"
],
"srvrecord": [
"0 100 389 server15"
]
},
{
"dn": "idnsname=_ntp._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_ntp._udp"
],
"srvrecord": [
"0 100 123 ipa"
"0 100 123 server15"
]
},
{
"aaaarecord": [
"00::11",
"00::112"
],
"arecord": [
"192.168.122.28",
"1.2.3.4"
],
"dn": "idnsname=server15,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=server15,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"server15"
]
}
],
"summary": null,
"truncated": false
}
}
}