dns2 ui replaceing calls for the dns plugin to the dns2 plugin no has attribute permissions and all other benefits of building on the baseldap plugin

This commit is contained in:
Adam Young authored and Endi Sukma Dewata committed 2010-12-03 11:42:38 -05:00
1 parent 188ca3a360
commit e33377bc13
10 files changed
+1352 -165

No files matched your search

+41 -26
View File
@@ -21,12 +21,12 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
/* DNS */
ipa_entity_set_search_definition('dns', [
ipa_entity_set_search_definition('dnszone', [
['idnsname', 'Zone Name', null]
]);
ipa_entity_set_add_definition('dns', [
ipa_entity_set_add_definition('dnszone', [
'dialog-add-dns', 'Add New Zone', [
['idnsname', 'Name', null],
['idnssoamname', 'Authoritative name server'],
@@ -34,7 +34,7 @@ ipa_entity_set_add_definition('dns', [
]
]);
ipa_entity_set_details_definition('dns', [
ipa_entity_set_details_definition('dnszone', [
ipa_stanza({name:'identity', label:'DNS Zone Details'}).
input({name:'idnsname', label:'DNS Name'}).
input({name:'idnszoneactive', label:'Zone Active'}).
@@ -51,11 +51,11 @@ ipa_entity_set_details_definition('dns', [
input({name:'idnsupdatepolicy', label:'BIND update policy'})
]);
ipa_entity_set_association_definition('dns', {
ipa_entity_set_association_definition('dnszone', {
});
ipa_entity_set_facet_definition('dns', [
ipa_entity_set_facet_definition('dnszone', [
ipa_records_facet({
'name': 'records',
'label': 'Records'
@@ -133,12 +133,16 @@ function ipa_records_facet(spec){
function add_fail(data, text_status, xhr) {
}
params.push( $.bbq.getState('dns-pkey', true));
params.push( $.bbq.getState(that.entity_name+'-pkey', true));
params.push(add_dialog.find('#dns-record-resource').val());
params.push(add_dialog.find('#dns-record-type').val());
params.push(add_dialog.find('#dns-record-data').val());
ipa_cmd('dns_add_rr', params, options, add_win, add_fail);
var key = add_dialog.find('#dns-record-type').val().toLowerCase()+
"record";
var value = add_dialog.find('#dns-record-data').val();
options[key] = value;
ipa_cmd('dnsrecord_add', params, options, add_win, add_fail);
//add_dialog.dialog('close');
}
@@ -166,7 +170,7 @@ function ipa_records_facet(spec){
function delete_records(records_table){
var zone = $.bbq.getState('dns-pkey', true);
var zone = $.bbq.getState('dnszone-pkey', true);
var thead = records_table.find('thead');
thead.find("INPUT[type='checkbox']").
@@ -193,10 +197,17 @@ function ipa_records_facet(spec){
var tr = $(box).parents('tr');
var resource = $(tr).find('[title="idnsname"]').text();
var type = $(tr).find('[title="type"]').
text().toUpperCase();
text().toLowerCase();
var data = $(tr).find('[title="data"]').text();
var params = [zone, resource, type, data];
delete_list.push(params);
var rectype=type+"record"
var options = {};
options[rectype]=data;
var command = {
"method":"dnsrecord_del",
"params":[[zone,resource], options]};
delete_list.push(command);
to_delete_body.append(
$('<tr></tr>').
append($('<td></td>',{html:resource}).
@@ -208,16 +219,12 @@ function ipa_records_facet(spec){
function delete_on_click() {
var delete_count = delete_list.length;
function delete_complete(){
delete_count -= 1;
if (delete_count === 0 ){
reload();
delete_dialog.dialog('close');
}
}
for (var i = 0; i < delete_list.length; i += 1){
ipa_cmd('dns_del_rr',delete_list[i],{},
delete_complete,delete_complete);
}
ipa_cmd('batch', delete_list, {},
delete_complete,delete_complete);
}
function cancel_on_click() {
@@ -297,17 +304,25 @@ function ipa_records_facet(spec){
'click': function(){refresh()}
}).appendTo(control_span);
var action_panel_ul = $('.action-panel ul', that.container);
var action_controls = $('<li/>',{
"class":"action-controls"}).appendTo(action_panel_ul);
ipa_button({
'label': IPA.messages.button.add,
'icon': 'ui-icon-plus',
'click': add_click
}).appendTo(control_span);
}).appendTo(action_controls);
ipa_button({
'label': IPA.messages.button.remove,
'icon': 'ui-icon-trash',
'click': function(){delete_records(records_table);}
}).appendTo(control_span);
}).appendTo(action_controls);
div.append('<span class="records-buttons"></span>');
@@ -343,11 +358,11 @@ function ipa_records_facet(spec){
function load_on_win(data){
display('dns',data);
display(that.entity_name,data);
}
function load_on_fail(data){
display('dns',data);
display(that.entity_name,data);
}
function reload(){
@@ -376,8 +391,8 @@ function ipa_records_facet(spec){
}
var pkey = $.bbq.getState('dns' + '-pkey', true);
ipa_cmd('dns_find_rr',[pkey],options,load_on_win, load_on_fail);
var pkey = $.bbq.getState(that.entity_name + '-pkey', true);
ipa_cmd('dnsrecord_find',[pkey],options,load_on_win, load_on_fail);
}
@@ -0,0 +1,21 @@
{
"error": null,
"id": 12,
"result": {
"result": {
"arecord": [
"1.2.3.4"
],
"dn": "idnsname=a4,idnsname=henson.ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"a4"
],
"objectclass": [
"top",
"idnsrecord"
]
},
"summary": null,
"value": "a4"
}
}
@@ -0,0 +1,10 @@
{
"error": null,
"result": {
"idnsname": [
"@"
]
},
"summary": null,
"value": "@"
}
@@ -0,0 +1,110 @@
{
"error": null,
"id": 10,
"result": {
"count": 11,
"result": [
{
"dn": "idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"@"
],
"nsrecord": [
"ipa.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",
"idnsname": [
"_kerberos"
],
"txtrecord": [
"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",
"idnsname": [
"_kerberos-master._tcp"
],
"srvrecord": [
"0 100 88 ipa"
]
},
{
"dn": "idnsname=_kerberos-master._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kerberos-master._udp"
],
"srvrecord": [
"0 100 88 ipa"
]
},
{
"dn": "idnsname=_kpasswd._tcp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kpasswd._tcp"
],
"srvrecord": [
"0 100 464 ipa"
]
},
{
"dn": "idnsname=_kpasswd._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_kpasswd._udp"
],
"srvrecord": [
"0 100 464 ipa"
]
},
{
"dn": "idnsname=_ntp._udp,idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsname": [
"_ntp._udp"
],
"srvrecord": [
"0 100 123 ipa"
]
}
],
"summary": null,
"truncated": false
}
}
+46
View File
@@ -0,0 +1,46 @@
{
"error": null,
"id": 3,
"result": {
"result": {
"dn": "idnsname=henson.ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsallowdynupdate": [
"FALSE"
],
"idnsname": [
"henson.ayoung.boston.devel.redhat.com"
],
"idnssoaexpire": [
"1209600"
],
"idnssoaminimum": [
"3600"
],
"idnssoamname": [
"ayoung.boston.devel.redhat.com"
],
"idnssoarefresh": [
"3600"
],
"idnssoaretry": [
"900"
],
"idnssoarname": [
"root.henson.ayoung.boston.devel.redhat.com."
],
"idnssoaserial": [
"2010021201"
],
"idnszoneactive": [
"TRUE"
],
"objectclass": [
"top",
"idnsrecord",
"idnszone"
]
},
"summary": null,
"value": "henson.ayoung.boston.devel.redhat.com"
}
}
+137
View File
@@ -0,0 +1,137 @@
{
"error": null,
"id": 6,
"result": {
"count": 3,
"result": [
{
"dn": "idnsname=ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsallowdynupdate": [
"TRUE"
],
"idnsname": [
"ayoung.boston.devel.redhat.com"
],
"idnssoaexpire": [
"1209600"
],
"idnssoaminimum": [
"3600"
],
"idnssoamname": [
"ipa.ayoung.boston.devel.redhat.com."
],
"idnssoarefresh": [
"3600"
],
"idnssoaretry": [
"900"
],
"idnssoarname": [
"root.ipa.ayoung.boston.devel.redhat.com."
],
"idnssoaserial": [
"2010021201"
],
"idnsupdatepolicy": [
"grant AYOUNG.BOSTON.DEVEL.REDHAT.COM krb5-self * A;"
],
"idnszoneactive": [
"TRUE"
],
"nsrecord": [
"ipa.ayoung.boston.devel.redhat.com."
],
"objectclass": [
"top",
"idnsrecord",
"idnszone"
]
},
{
"dn": "idnsname=122.168.192.in-addr.arpa,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsallowdynupdate": [
"TRUE"
],
"idnsname": [
"122.168.192.in-addr.arpa"
],
"idnssoaexpire": [
"1209600"
],
"idnssoaminimum": [
"3600"
],
"idnssoamname": [
"ipa.ayoung.boston.devel.redhat.com."
],
"idnssoarefresh": [
"3600"
],
"idnssoaretry": [
"900"
],
"idnssoarname": [
"root.122.168.192.in-addr.arpa."
],
"idnssoaserial": [
"2010021201"
],
"idnsupdatepolicy": [
"grant AYOUNG.BOSTON.DEVEL.REDHAT.COM krb5-subdomain 122.168.192.in-addr.arpa. PTR;"
],
"idnszoneactive": [
"TRUE"
],
"nsrecord": [
"ipa.ayoung.boston.devel.redhat.com."
],
"objectclass": [
"top",
"idnsrecord",
"idnszone"
]
},
{
"dn": "idnsname=henson.ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsallowdynupdate": [
"FALSE"
],
"idnsname": [
"henson.ayoung.boston.devel.redhat.com"
],
"idnssoaexpire": [
"1209600"
],
"idnssoaminimum": [
"3600"
],
"idnssoamname": [
"ayoung.boston.devel.redhat.com"
],
"idnssoarefresh": [
"3600"
],
"idnssoaretry": [
"900"
],
"idnssoarname": [
"root.henson.ayoung.boston.devel.redhat.com."
],
"idnssoaserial": [
"2010021201"
],
"idnszoneactive": [
"TRUE"
],
"objectclass": [
"top",
"idnsrecord",
"idnszone"
]
}
],
"summary": null,
"truncated": false
}
}
@@ -0,0 +1,90 @@
{
"error": null,
"id": 7,
"result": {
"result": {
"attributelevelrights": {
"a6record": "rscwo",
"aaaarecord": "rscwo",
"aci": "rscwo",
"afsdbrecord": "rscwo",
"arecord": "rscwo",
"certrecord": "rscwo",
"cn": "rscwo",
"cnamerecord": "rscwo",
"dnamerecord": "rscwo",
"dnsclass": "rscwo",
"dnsttl": "rscwo",
"dsrecord": "rscwo",
"hinforecord": "rscwo",
"idnsallowdynupdate": "rscwo",
"idnsname": "rscwo",
"idnssoaexpire": "rscwo",
"idnssoaminimum": "rscwo",
"idnssoamname": "rscwo",
"idnssoarefresh": "rscwo",
"idnssoaretry": "rscwo",
"idnssoarname": "rscwo",
"idnssoaserial": "rscwo",
"idnsupdatepolicy": "rscwo",
"idnszoneactive": "rscwo",
"keyrecord": "rscwo",
"kxrecord": "rscwo",
"locrecord": "rscwo",
"mdrecord": "rscwo",
"minforecord": "rscwo",
"mxrecord": "rscwo",
"naptrrecord": "rscwo",
"nsaccountlock": "rscwo",
"nsecrecord": "rscwo",
"nsrecord": "rscwo",
"nxtrecord": "rscwo",
"objectclass": "rscwo",
"ptrrecord": "rscwo",
"rrsigrecord": "rscwo",
"sigrecord": "rscwo",
"srvrecord": "rscwo",
"sshfprecord": "rscwo",
"txtrecord": "rscwo"
},
"dn": "idnsname=henson.ayoung.boston.devel.redhat.com,cn=dns,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
"idnsallowdynupdate": [
"FALSE"
],
"idnsname": [
"henson.ayoung.boston.devel.redhat.com"
],
"idnssoaexpire": [
"1209600"
],
"idnssoaminimum": [
"3600"
],
"idnssoamname": [
"ayoung.boston.devel.redhat.com"
],
"idnssoarefresh": [
"3600"
],
"idnssoaretry": [
"900"
],
"idnssoarname": [
"root.henson.ayoung.boston.devel.redhat.com."
],
"idnssoaserial": [
"2010021201"
],
"idnszoneactive": [
"TRUE"
],
"objectclass": [
"top",
"idnsrecord",
"idnszone"
]
},
"summary": null,
"value": "henson.ayoung.boston.devel.redhat.com"
}
}
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -33,7 +33,7 @@ var admin_tab_set = [
{name:'service', label:'Services', setup: ipa_entity_setup}
]},
{name:'policy', children:[
{name:'dns', setup: ipa_entity_setup},
{name:'dnszone', setup: ipa_entity_setup},
{name:'hbac', setup: ipa_entity_setup, children:[
{name:'hbacsvc', setup: ipa_entity_setup},
{name:'hbacsvcgroup', setup: ipa_entity_setup}
+1 -1
View File
@@ -134,7 +134,7 @@ class dnszone(LDAPObject):
'idnssoaserial', 'idnssoarefresh', 'idnssoaretry', 'idnssoaexpire',
'idnssoaminimum'
] + _record_attributes
label = _('DNS zone')
label = _('DNS')
takes_params = (
Str('idnsname',