summaryrefslogtreecommitdiffstats
path: root/install/static/hostgroup.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/static/hostgroup.js')
-rw-r--r--install/static/hostgroup.js121
1 files changed, 40 insertions, 81 deletions
diff --git a/install/static/hostgroup.js b/install/static/hostgroup.js
index 3872d125..512ebcf8 100644
--- a/install/static/hostgroup.js
+++ b/install/static/hostgroup.js
@@ -1,82 +1,41 @@
+/* Authors:
+ * Pavel Zuna <pzuna@redhat.com>
+ *
+ * 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; version 2 only
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
+
+ipa_entity_set_search_definition('hostgroup', [
+ ['cn', 'Name', null],
+ ['description', 'Description', null]
+]);
+
+ipa_entity_set_add_definition('hostgroup', [
+ 'dialog-add-hostgroup', 'Add New Hostgroup', [
+ ['cn', 'Name', null],
+ ['description', 'Description', null]
+ ]
+]);
+
+ipa_entity_set_details_definition('hostgroup', [
+ ['identity', 'Hostgroup Details', [
+ ['cn', 'Name', null],
+ ['description', 'Description', null]
+ ]]
+]);
-function setupHostgroup(facet){
- hostgroupForms.setup(facet);
-}
-
-var hostgroup_details_list =
- [['identity', 'Hostgroup Details', [
- ['cn', 'Hostgroup Name'],
- ['description', 'Description']]]];
-
-var hostgroupFacets = ["details","hosts","assignhosts"];
-
-
-
-var hostgroupForms = new HostgroupsForms();
-
-function HostgroupsForms(){
-
- this.setup = function(facet){
- if (this[facet]){
- this[facet].setup();
- }else{
- this.unspecified.setup();
- }
- }
-
-
-/**
-* used to initialize the search
-*/
- this.hostgroupSearchColumns = [
- {
- title:"Hostgroup",
- column:"cn",
- render: function(current,cell){
- renderPkeyColumn2('hostgroup', 'cn', current,cell);
- }
- },
- {title:"Description", column:"description",render: renderSimpleColumn}];
-
- this.hostgroupAddProperties =
- [{title: 'Hostgroup Name', id: 'pkey', type: 'text'},
- {title: 'Description', id: 'description', type: 'text'}];
-
-
- /**
- Facets
- */
- this.hostListColumns = [ {title:"host",column:"member_host" }];
- this.obj="hostgroup";
- this.hosts = new AssociationList(
- this.obj,
- "hosts",
- "assignhosts",
- this.hostListColumns, hostgroupFacets );
-
- this.assignhosts = new AssociationForm(
- this.obj,
- "host",
- "assignhosts",
- hostgroupFacets,
- "fqdn",
- function(){
- return 'Add Hosts to to hostgroup : ' + qs['pkey'] ;
- },
- BulkAssociator);
-
- this.details = new DetailsForm("hostgroup",hostgroup_details_list,"cn",hostgroupFacets) ;
-
- 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;
-}