diff --git a/install/ui/dns.js b/install/ui/dns.js
index bd8d6e185..6784584b6 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -26,36 +26,53 @@
/* DNS */
IPA.entity_factories.dnszone = function() {
- if (!IPA.dns_enabled){
+ if (!IPA.dns_enabled) {
throw "DNS not enabled on server";
}
- return IPA.entity_builder().
+ return IPA.entity_builder().
entity('dnszone').
search_facet({
columns:['idnsname']
}).
- details_facet({sections:[{
- name:'identity',
- fields:[
- 'idnsname',
- 'idnszoneactive',
- 'idnssoamname',
- 'idnssoarname',
- 'idnssoaserial',
- 'idnssoarefresh',
- 'idnssoaretry',
- 'idnssoaexpire',
- 'idnssoaminimum',
- 'dnsttl',
- 'dnsclass',
- 'idnsallowdynupdate',
- 'idnsupdatepolicy']}]}).
+ details_facet({
+ sections:[{
+ name:'identity',
+ fields:[
+ 'idnsname',
+ 'idnszoneactive',
+ 'idnssoamname',
+ 'idnssoarname',
+ 'idnssoaserial',
+ 'idnssoarefresh',
+ 'idnssoaretry',
+ 'idnssoaexpire',
+ 'idnssoaminimum',
+ 'dnsttl',
+ 'dnsclass',
+ 'idnsallowdynupdate',
+ 'idnsupdatepolicy']}]
+ }).
facet({
factory: IPA.records_facet,
- 'name': 'records',
- 'facet_group':'Member',
- 'label': IPA.metadata.objects.dnsrecord.label
+ name: 'records',
+ facet_group:'Member',
+ label: IPA.metadata.objects.dnsrecord.label,
+ columns: [
+ {
+ name: 'idnsname',
+ label: IPA.get_entity_param('dnsrecord', 'idnsname').label,
+ primary_key: true
+ },
+ {
+ name: 'type',
+ label: 'Record Type'
+ },
+ {
+ name: 'data',
+ label: 'Data'
+ }
+ ]
}).
standard_association_facets().
adder_dialog({
@@ -68,7 +85,7 @@ IPA.entity_factories.dnszone = function() {
build();
};
-IPA.force_dnszone_add_checkbox_widget = function (spec){
+IPA.force_dnszone_add_checkbox_widget = function(spec) {
var param_info = IPA.get_method_option('dnszone_add', 'force');
spec.name = 'force';
spec.label = param_info.label;
@@ -77,18 +94,44 @@ IPA.force_dnszone_add_checkbox_widget = function (spec){
return IPA.checkbox_widget(spec);
};
-IPA.records_facet = function (spec){
+IPA.records_facet = function(spec) {
spec = spec || {};
- var that = IPA.facet(spec);
+ var that = IPA.search_facet(spec);
- that.record = null;
+ var record_types = [
+ 'a', 'aaaa', 'dname', 'cname', 'mx', 'ns', 'ptr',
+ 'srv', 'txt', 'a6', 'afsdb', 'cert', 'ds',
+ 'key', 'kx', 'loc', 'naptr', 'nsec',
+ 'rrsig', 'sshfp'
+ ];
- var record_types =[ 'a', 'aaaa', 'dname', 'cname', 'mx', 'ns', 'ptr',
- 'srv', 'txt', 'a6', 'afsdb', 'cert', 'ds',
- 'key', 'kx', 'loc', 'naptr', 'nsec',
- 'rrsig', 'sshfp'];
+ that.init = function() {
+
+ that.facet_init();
+
+ that.table = IPA.table_widget({
+ name: 'search',
+ label: IPA.metadata.objects[that.entity_name].label,
+ entity_name: that.entity_name
+ });
+
+ for (var i=0; i', {
- 'class': 'search-table'
- }).appendTo(records_results);
-
- var thead = $('
').appendTo(that.records_table);
- var tbody = $('').appendTo(that.records_table);
- var tfoot = $('').appendTo(that.records_table);
-
- var tr = thead.find('tr');
- tr.append($(' ').append(
- $('',{
- type: 'checkbox',
- click : function (evt){
- tbody.find("INPUT[type='checkbox']").
- attr('checked', this.checked);
- }
- })));
- tr.append($(' ',{
- text: IPA.get_entity_param("dnsrecord", "idnsname").label }));
- tr.append($(' Record Type '));
- tr.append($('Data '));
-
+ that.table.create(container);
+ that.table.setup(container);
};
that.setup = function(container) {
that.facet_setup(container);
- that.record = $.bbq.getState(that.entity_name + '-record', true) || '';
-
- that.pkey = $.bbq.getState(that.entity_name+'-pkey', true) || '';
- $('h1',container).
- html(""+IPA.messages.objects.dnsrecord.title+":" + that.pkey);
-
//commented out until data is searchable
//control_span.append('Data');
//control_span.append($('',{
@@ -409,35 +414,78 @@ IPA.records_facet = function (spec){
that.show = function() {
that.facet_show();
+ that.record = $.bbq.getState(that.entity_name + '-record', true) || '';
that.pkey = $.bbq.getState(that.entity_name+'-pkey', true) || '';
that.entity.header.set_pkey(that.pkey);
that.entity.header.back_link.css('visibility', 'visible');
that.entity.header.facet_tabs.css('visibility', 'visible');
+
+ var title = IPA.messages.objects.dnsrecord.title+': '+that.pkey;
+ that.set_title(this.container, title);
};
- function load_on_win(data){
- display(that.entity_name,data);
- }
+ that.get_record = function(result, index) {
+ var record = {};
- function load_on_fail(data){
- display(that.entity_name,data);
- }
+ if (result.idnsname) {
+ record.idnsname = result.idnsname[0];
+ } else {
+ record.idnsname = result.dn.split(',')[0].split('=')[1];
+ }
- function reload(){
- that.refresh();
- }
+ for (var i=0; i
'+error_thrown.title+'
'); + summary.append(''+error_thrown.message+'
'); + } + var options = {}; - var resource_filter = that.container. - find("#dns-record-resource-filter").val(); -// if (resource_filter){ -// options.idnsname = resource_filter; -// } + var filter = that.filter.val(); +/* + if (filter){ + options.idnsname = filter; + } var type_filter = that.container.find("#dns-record-type-filter").val(); if (type_filter){ @@ -448,105 +496,23 @@ IPA.records_facet = function (spec){ if (data_filter){ options.data = data_filter; } +*/ + var args = [$.bbq.getState(that.entity_name + '-pkey', true)]; - var pkey = [$.bbq.getState(that.entity_name + '-pkey', true)]; - - if (resource_filter){ - pkey.push(resource_filter); + if (filter) { + args.push(filter); } + IPA.command({ entity: 'dnsrecord', method: 'find', - args: pkey, + args: args, options: options, - on_success: load_on_win, - on_error:load_on_fail + on_success: on_success, + on_error: on_error }).execute(); }; - - function generate_tr(thead, tbody, result){ - function generate_checkbox_td(tr, pkey) { - var checkbox = $('', { - name: pkey, - title: pkey, - type: 'checkbox', - 'class': 'search-selector' - }); - var td = $('