diff options
author | Endi DeWata <edewata@redhat.com> | 2010-09-08 19:25:14 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-09-08 19:25:14 -0400 |
commit | 0050e2fcd957cd037e25c3ef68322a6204de7450 (patch) | |
tree | b4bbc622755585b007e4beb7c46a820df1556464 /install/static/service.js | |
parent | 54b3842abac529e550b9a3d94bf240a95d8a6ba5 (diff) | |
download | freeipa.git-0050e2fcd957cd037e25c3ef68322a6204de7450.tar.gz freeipa.git-0050e2fcd957cd037e25c3ef68322a6204de7450.tar.xz freeipa.git-0050e2fcd957cd037e25c3ef68322a6204de7450.zip |
Services
adds the Service tab: search, details, add, associations
It also contains the sample data for some service operations
Diffstat (limited to 'install/static/service.js')
-rw-r--r-- | install/static/service.js | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/install/static/service.js b/install/static/service.js new file mode 100644 index 00000000..467e56a8 --- /dev/null +++ b/install/static/service.js @@ -0,0 +1,96 @@ +function setupService(facet) { + serviceForms.setup(facet); +} + +var serviceForms = new ServiceForms(); + +function ServiceForms() { + + this.obj = "service"; + + this.facets = ['details', 'hosts', 'assignhosts']; + + this.setup = function(facet) { + if (this[facet]) { + this[facet].setup(); + } else { + this.unspecified.setup(); + } + }; + + this.hostListColumns = [ {title:"host",column:"managedby_host"} ]; + + this.hosts = new AssociationList( + this.obj, + "hosts", + "assignhosts", + this.hostListColumns, + this.facets + ); + + this.assignhosts = new AssociationForm( + this.obj, + "host", + "assignhosts", + this.facets, + "fqdn", + function() { + return 'Add Hosts to service : ' + qs['pkey']; + }, + BulkAssociator, + "add_host" + ); + + this.detailsList = [ + ['identity', 'Service Details', [ + ['krbprincipalname', 'Kerberos Principal'] + ]] + ]; + + this.details = new DetailsForm( + "service", + this.detailsList, + "krbprincipalname", + this.facets + ); + + this.addProperties = [ + {title: 'Principal', id: 'pkey', type: 'text'} + ]; + + this.addOptionsFunction = function() { + var options = { + name: $('#pkey').val() + }; + return options; + }; + + this.add = new EntityBuilder( + "service", + this.addProperties, + this.addOptionsFunction + ); + + this.searchColumns = [ + { + title: "Service", + column: "krbprincipalname", + render: function (current, cell) { + renderPkeyColumn2('service', 'krbprincipalname', current, cell); + } + }, + { + title: "Has Keytab", + column: "has_keytab", + render: renderSimpleColumn + } + ]; + + this.search = new SearchForm( + "service", + "find", + this.searchColumns + ); + + this.unspecified = this.search; +} |