/*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) { var except = { expected: true }; throw except; } return IPA.entity_builder(). entity('dnszone'). facet_groups([ 'dnsrecord', 'settings' ]). search_facet({ title: IPA.metadata.objects.dnszone.label, columns: [ 'idnsname' ] }). details_facet({ factory: IPA.dnszone_details_facet, sections: [{ name: 'identity', fields: [ 'idnsname', 'idnszoneactive', 'idnssoamname', 'idnssoarname', 'idnssoaserial', 'idnssoarefresh', 'idnssoaretry', 'idnssoaexpire', 'idnssoaminimum', 'dnsttl', 'dnsclass', 'idnsallowdynupdate', 'idnsupdatepolicy' ] }] }). nested_search_facet({ facet_group: 'dnsrecord', nested_entity : 'dnsrecord', name: 'records', title: IPA.metadata.objects.dnszone.label_singular, label: IPA.metadata.objects.dnsrecord.label, load: IPA.dns_record_search_load, get_values: IPA.dnsrecord_get_delete_values, columns: [ { name: 'idnsname', label: IPA.get_entity_param('dnsrecord', 'idnsname').label, primary_key: true }, { name: 'type', label: IPA.messages.objects.dnsrecord.type }, { name: 'data', label: IPA.messages.objects.dnsrecord.data } ] }). standard_association_facets(). adder_dialog({ factory: IPA.dnszone_adder_dialog, height: 300, fields: [ { name: 'idnsname', optional: true }, 'name_from_ip', 'idnssoamname', { name: 'idnssoarname', optional: true }, { factory: IPA.force_dnszone_add_checkbox_widget, name: 'force', param_info: IPA.get_method_option('dnszone_add', 'force') } ] }). build(); }; IPA.dnszone_details_facet = function(spec) { spec = spec || {}; var that = IPA.details_facet(spec); that.update = function(on_success, on_error) { var args = that.get_primary_key(); var modify_operation = { execute: false, command: IPA.command({ entity: that.entity.name, method: 'mod', args: args, options: { all: true, rights: true } }) }; var enable_operation = { execute: false, command: IPA.command({ entity: that.entity.name, method: 'enable', args: args, options: { all: true, rights: true } }) }; var sections = that.sections.values; for (var i=0; i').appendTo(that.container); var field = that.get_field('idnsname'); var tr = $('').appendTo(table); var td = $('', { title: field.label }).appendTo(tr); var label = $('