From 4270e26adb56b6d1b7a9e80433581b82519d9eec Mon Sep 17 00:00:00 2001 From: Adam Young Date: Fri, 18 Mar 2011 16:43:54 -0400 Subject: define entities using builder and more declarative syntax merged hbac and sudo in to single files associaton facet and table supports linking --- install/ui/dns.js | 531 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 531 insertions(+) create mode 100644 install/ui/dns.js (limited to 'install/ui/dns.js') diff --git a/install/ui/dns.js b/install/ui/dns.js new file mode 100644 index 00000000..e1fce532 --- /dev/null +++ b/install/ui/dns.js @@ -0,0 +1,531 @@ +/*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 */ + +/* DNS */ +IPA.entity_factories.dnszone = function() { + + return IPA.entity_builder(). + entity('dnszone'). + search_facet({ + columns:['idnsname'], + add_fields: ['idnsname','idnssoamname','idnssoarname'] + }). + details_facet([{ + section:'identity', + fields:[ + 'idnsname', + 'idnszoneactive', + 'idnssoamname', + 'idnssoarname', + 'idnssoaserial', + 'idnssoarefresh', + 'idnssoaretry', + 'idnssoaexpire', + 'idnssoaminimum', + 'dnsttl', + 'dnsclass', + 'idnsallowdynupdate', + 'idnsupdatepolicy']}]). + facet(IPA.records_facet({ + 'name': 'records', + 'label': IPA.metadata.objects.dnsrecord.label + })). + standard_associations(). + build(); +}; + + +IPA.records_facet = function (spec){ + + spec = spec || {}; + + var that = IPA.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']; + + function create_type_select(id,add_none) { + var type_select = $('', { + type: 'text' + }).appendTo(dd); + + $('
', { + html: IPA.messages.objects.dnsrecord.type + }).appendTo(dl); + + dd = $('
').appendTo(dl); + + dialog.type = create_type_select('dns-record-type').appendTo(dd); + + $('
', { + html: IPA.messages.objects.dnsrecord.data + }).appendTo(dl); + + dd = $('
').appendTo(dl); + + dialog.data = $('