From fd056918e6c61d601903c144e3ed3d509c221e28 Mon Sep 17 00:00:00 2001 From: Endi DeWata Date: Fri, 10 Sep 2010 12:59:33 -0400 Subject: Splitting service principal into service name and hostname. The EntityBuilder has been modified to obtain the pkey value by invoking getPKey(). This function can be overriden for different entities. The addOptionsFunction() has been renamed to getOptions() and it can be overriden for different entities. Each entity that uses this function has been modified accordingly. The addEdit(), addAnother(), add_fail() has been moved into the EntityBuilder class. The global builders is no longer needed because a reference to the builder object can be obtained via enclosure. The ServiceForms has been modified to take service name and hostname and combine them to generate the service principal by overriding the getPKey(). --- install/static/hostgroup.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'install/static/hostgroup.js') diff --git a/install/static/hostgroup.js b/install/static/hostgroup.js index 2f40f0b3f..3872d125d 100644 --- a/install/static/hostgroup.js +++ b/install/static/hostgroup.js @@ -12,14 +12,6 @@ var hostgroupFacets = ["details","hosts","assignhosts"]; -function hostgroupAddOptionsFunction (){ - var options = { - name: $('#pkey').val(), - description: $('#description').val() - }; - return options; -} - var hostgroupForms = new HostgroupsForms(); function HostgroupsForms(){ @@ -75,7 +67,15 @@ function HostgroupsForms(){ this.details = new DetailsForm("hostgroup",hostgroup_details_list,"cn",hostgroupFacets) ; - this.add = new EntityBuilder("hostgroup",this.hostgroupAddProperties,hostgroupAddOptionsFunction); + this.add = new EntityBuilder("hostgroup",this.hostgroupAddProperties); + + this.add.getOptions = function() { + var options = { + name: $('#pkey').val(), + description: $('#description').val() + }; + return options; + } this.search = new SearchForm("hostgroup", "find", this.hostgroupSearchColumns); this.unspecified = this.search; -- cgit