/*jsl:import ipa.js */ /*jsl:import search.js */ /* Authors: * Adam Young * * Copyright (C) 2010 Red Hat * see file 'COPYING' for use and warranty information * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js, widget.js */ /* DNS */ IPA.entity_factories.dnszone = function() { if (!IPA.dns_enabled) { throw "DNS not enabled on server"; } return IPA.entity_builder(). entity('dnszone'). search_facet({ title: IPA.metadata.objects.dnszone.label, columns:['idnsname'] }). details_facet({ sections:[{ name:'identity', fields:[ 'idnsname', 'idnszoneactive', 'idnssoamname', 'idnssoarname', 'idnssoaserial', 'idnssoarefresh', 'idnssoaretry', 'idnssoaexpire', 'idnssoaminimum', 'dnsttl', 'dnsclass', 'idnsallowdynupdate', 'idnsupdatepolicy']}] }). facet({ factory: IPA.dnsrecord_facet, name: 'records', facet_group: 'member', title: IPA.metadata.objects.dnszone.label_singular, 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({ fields: [ 'idnsname', 'idnssoamname', 'idnssoarname', {factory:IPA.force_dnszone_add_checkbox_widget}] }). build(); }; 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; spec.tooltip = param_info.doc; spec.undo = false; return IPA.checkbox_widget(spec); }; IPA.dnsrecord_facet = function(spec) { spec = spec || {}; spec.disable_breadcrumb = false; spec.disable_facet_tabs = false; var that = IPA.search_facet(spec); 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({ 'class': 'content-table', name: 'search', label: IPA.metadata.objects[that.entity_name].label, entity_name: that.entity_name, scrollable: true }); var columns = that.columns.values; for (var i=0; i',{ id: id }); if (add_none){ type_select.append($('