summaryrefslogtreecommitdiffstats
path: root/install/ui/dns.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-11-02 14:07:07 -0500
committerPetr Vobornik <pvoborni@redhat.com>2011-11-04 16:51:54 +0100
commit8ca348b99e350862418ac2fe0addfb0e354ea57e (patch)
tree0b91d8548037f5e10b6c491d7c1b969ce7a1ba57 /install/ui/dns.js
parent5db9fed8a5c62a65adf43f1d8c24a0e061f6b301 (diff)
downloadfreeipa-8ca348b99e350862418ac2fe0addfb0e354ea57e.tar.gz
freeipa-8ca348b99e350862418ac2fe0addfb0e354ea57e.tar.xz
freeipa-8ca348b99e350862418ac2fe0addfb0e354ea57e.zip
Added extensible UI framework.
The entity definitions have been converted into classes. The entity init() method will use the builder to construct the facets and dialogs. The UI can be customized by creating a subclass of the original entity in extension.js and then overriding the init() method. Ticket #2043
Diffstat (limited to 'install/ui/dns.js')
-rw-r--r--install/ui/dns.js38
1 files changed, 25 insertions, 13 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js
index b7de11bd6..2cf5cd4a9 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -23,8 +23,11 @@
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js, widget.js */
-/* DNS */
-IPA.entity_factories.dnszone = function() {
+IPA.dns = {};
+
+IPA.dns.zone_entity = function(spec) {
+
+ var that = IPA.entity(spec);
if (!IPA.dns_enabled) {
var except = {
@@ -33,9 +36,9 @@ IPA.entity_factories.dnszone = function() {
throw except;
}
- return IPA.entity_builder().
- entity('dnszone').
- facet_groups([ 'dnsrecord', 'settings' ]).
+ that.init = function(params) {
+
+ params.builder.facet_groups([ 'dnsrecord', 'settings' ]).
search_facet({
title: IPA.metadata.objects.dnszone.label,
columns: [ 'idnsname' ]
@@ -140,8 +143,10 @@ IPA.entity_factories.dnszone = function() {
]
}
]
- }).
- build();
+ });
+ };
+
+ return that;
};
IPA.dnszone_details_facet = function(spec) {
@@ -429,7 +434,9 @@ IPA.dns_record_search_load = function (result) {
}
};
-IPA.entity_factories.dnsrecord = function() {
+IPA.dns.record_entity = function(spec) {
+
+ var that = IPA.entity(spec);
if (!IPA.dns_enabled) {
var except = {
@@ -438,9 +445,9 @@ IPA.entity_factories.dnsrecord = function() {
throw except;
}
- return IPA.entity_builder().
- entity('dnsrecord').
- containing_entity('dnszone').
+ that.init = function(params) {
+
+ params.builder.containing_entity('dnszone').
details_facet({
post_update_hook:function(data){
var result = data.result.result;
@@ -604,8 +611,10 @@ IPA.entity_factories.dnsrecord = function() {
required: true
}
]
- }).
- build();
+ });
+ };
+
+ return that;
};
IPA.dnsrecord_redirection_dialog = function(spec) {
@@ -710,3 +719,6 @@ IPA.dnsrecord_get_delete_values = function() {
return value_array;
};
+
+IPA.register('dnszone', IPA.dns.zone_entity);
+IPA.register('dnsrecord', IPA.dns.record_entity);