diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/static/Makefile.am | 1 | ||||
-rw-r--r-- | install/static/add.js | 10 | ||||
-rw-r--r-- | install/static/index.xhtml | 1 | ||||
-rw-r--r-- | install/static/navigation.js | 7 | ||||
-rw-r--r-- | install/static/sampledata/service_add.json | 29 | ||||
-rw-r--r-- | install/static/sampledata/service_add_host.json | 21 | ||||
-rw-r--r-- | install/static/sampledata/service_del.json | 9 | ||||
-rw-r--r-- | install/static/sampledata/service_find.json | 48 | ||||
-rw-r--r-- | install/static/sampledata/service_remove_host.sh | 18 | ||||
-rw-r--r-- | install/static/sampledata/service_show.json | 18 | ||||
-rw-r--r-- | install/static/service.js | 96 |
11 files changed, 255 insertions, 3 deletions
diff --git a/install/static/Makefile.am b/install/static/Makefile.am index 63e58943c..b0c4c7f7b 100644 --- a/install/static/Makefile.am +++ b/install/static/Makefile.am @@ -19,6 +19,7 @@ app_DATA = \ jquery.cookie.js \ navigation.js \ netgroup.js \ + service.js \ pageparams.js \ search.js \ details.js \ diff --git a/install/static/add.js b/install/static/add.js index 4af6a8e72..97f7666a1 100644 --- a/install/static/add.js +++ b/install/static/add.js @@ -96,15 +96,23 @@ function EntityBuilder(obj,addProperties,addOptionsFunction ){ function addAnother(response){ + if (response.error){ + alert("error adding entry"); + return; + } var params = ipa_parse_qs(); builders[params["tab"]].setup(); } function addEdit(response){ + if (response.error){ + alert("error adding entry"); + return; + } var params = ipa_parse_qs(); var hash= "tab=" + params["tab"] +"&facet=details&pkey=" +$("#pkey").val(); window.location.hash = hash; -}
\ No newline at end of file +} diff --git a/install/static/index.xhtml b/install/static/index.xhtml index 4077d4f32..6e1d04352 100644 --- a/install/static/index.xhtml +++ b/install/static/index.xhtml @@ -20,6 +20,7 @@ <script type="text/javascript" src="host.js"></script> <script type="text/javascript" src="hostgroup.js"></script> <script type="text/javascript" src="netgroup.js"></script> + <script type="text/javascript" src="service.js"></script> <script type="text/javascript"> diff --git a/install/static/navigation.js b/install/static/navigation.js index 94fe47a94..ed1907789 100644 --- a/install/static/navigation.js +++ b/install/static/navigation.js @@ -24,6 +24,7 @@ function getParentTabs(){ host : "identity", hostgroup: "identity", netgroup : "identity", + service : "identity", policy : "policy", config : "config" }; @@ -54,7 +55,8 @@ function buildNavigation(){ {name:"Hostgroups", tab:"hostgroup", setup: setupHostgroup}, - {name:"Netgroups",tab:"netgroup", setup:setupNetgroup} + {name:"Netgroups",tab:"netgroup", setup:setupNetgroup}, + {name:"Services",tab:"service", setup:setupService} ]}, {name:"POLICY", tab:"policy", setup: unimplemented}, {name:"CONFIG", tab:"config", setup: unimplemented }]; @@ -139,6 +141,7 @@ function getSetupFunctions(){ host: setupHost, hostgroup:setupHostgroup, netgroup:setupNetgroup, + service:setupService, }; } return setupFunctions; @@ -236,4 +239,4 @@ function showDetails(){ function showAssociations(){ clearOld(); $('#associations').css("display","block"); -}
\ No newline at end of file +} diff --git a/install/static/sampledata/service_add.json b/install/static/sampledata/service_add.json new file mode 100644 index 000000000..4275d9bba --- /dev/null +++ b/install/static/sampledata/service_add.json @@ -0,0 +1,29 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "dn": "krbprincipalname=test/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "5b314ad9-bae4-11df-b82f-00163e72f2d9" + ], + "krbprincipalname": [ + "test/dev.example.com@DEV.EXAMPLE.COM" + ], + "managedby_host": [ + "dev.example.com" + ], + "objectclass": [ + "krbprincipal", + "krbprincipalaux", + "krbticketpolicyaux", + "ipaobject", + "ipaservice", + "pkiuser", + "top" + ] + }, + "summary": "Added service \"test/dev.example.com@DEV.EXAMPLE.COM\"", + "value": "test/dev.example.com@DEV.EXAMPLE.COM" + } +} diff --git a/install/static/sampledata/service_add_host.json b/install/static/sampledata/service_add_host.json new file mode 100644 index 000000000..cb199e310 --- /dev/null +++ b/install/static/sampledata/service_add_host.json @@ -0,0 +1,21 @@ +{ + "error": null, + "id": 0, + "result": { + "completed": 1, + "failed": { + "managedby": { + "host": [] + } + }, + "result": { + "dn": "krbprincipalname=test/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "krbprincipalname": [ + "test/dev.example.com@DEV.EXAMPLE.COM" + ], + "managedby_host": [ + "dev.example.com" + ] + } + } +} diff --git a/install/static/sampledata/service_del.json b/install/static/sampledata/service_del.json new file mode 100644 index 000000000..053b0ad99 --- /dev/null +++ b/install/static/sampledata/service_del.json @@ -0,0 +1,9 @@ +{ + "error": null, + "id": 0, + "result": { + "result": true, + "summary": "Deleted service \"test/dev.example.com@DEV.EXAMPLE.COM\"", + "value": "test/dev.example.com@DEV.EXAMPLE.COM" + } +} diff --git a/install/static/sampledata/service_find.json b/install/static/sampledata/service_find.json new file mode 100644 index 000000000..b71ea9e31 --- /dev/null +++ b/install/static/sampledata/service_find.json @@ -0,0 +1,48 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 3, + "result": [ + { + "dn": "krbprincipalname=ldap/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "has_keytab": true, + "krbprincipalname": [ + "ldap/dev.example.com@DEV.EXAMPLE.COM" + ], + "managedby_host": [ + "dev.example.com" + ], + "usercertificate": [ + { + "__base64__": "MIICbjCCAdegAwIBAgICA+0wDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMDkwMjA2NTYzMloXDTIwMDkwMjA2NTYzMlowKDEMMAoGA1UEChMDSVBBMRgwFgYDVQQDEw9kZXYuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDc63RjpqUCI84j9kjn0XYmpAOjkYbLddT9F0UUanASg1iIhscwWjvp/Mf5ZIzEYoB+dloI9gvEUWb8CU/x42QZr4lgEK4m/vCSDA0CkAnWvU/DHdtcAgpdZeBOQ1CMynyvNvN/ajyaA8dPwRcs9yJDrWXMa7LzMuw+ct5HA7HRdDdvUeIFr8YZEd/Mt1N96BmlVf3GA3P89cWfCKr1iVnmyewanjKuwcws1GCxawCnp0w1GHbKct4PPhB3k6EN8ZipFDGZmSeDVsa3gF7y2reLAYTS1/RwWPAHNeQ0cpOMe155cF3uHGSoX+RWtgo0BZ1+wgLMU5sf9W3ZMln3WmoFAgMBAAGjIjAgMBEGCWCGSAGG+EIBAQQEAwIGQDALBgNVHQ8EBAMCBSAwDQYJKoZIhvcNAQEFBQADgYEAbSYTU+IQvfppQE7setcpO/PiFNnMaZ3Ss7UGjm6XoPem9X0ktQOfWhBuhfH/7MbPdg2zn+55soaRpd8rOThr187G40GAMM5I3Jr+8386Q4zwCvED7B09pzBhQd/4ecVTIYFc82EytsM6I1aBrG9cLLuT+RL2dK5efOymCf/zjsw=" + } + ] + }, + { + "dn": "krbprincipalname=http/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "has_keytab": true, + "krbprincipalname": [ + "HTTP/dev.example.com@DEV.EXAMPLE.COM" + ], + "usercertificate": [ + { + "__base64__": "MIICbjCCAdegAwIBAgICA+4wDQYJKoZIhvcNAQEFBQAwKTEnMCUGA1UEAxMeSVBBIFRlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMDkwMjA2NTY1MFoXDTIwMDkwMjA2NTY1MFowKDEMMAoGA1UEChMDSVBBMRgwFgYDVQQDEw9kZXYuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2g0DTtC0f7StYfbVqc3bZ6niWHCBZp9SVEgD1lGY9+efQnO1Z6dqbUxLI+oUcVqA2aoeWVSTQ1KZLglF0pYUJcMVfUAQaFbwhY05rLtKya0+6DgYbnJ187fSHNOLQ71v/6pFt9THyLFICFJgKX64ouQYxV7+UY/vyqaKCjonWBJznJHaw07cEYj6tFkQxwNIhQRWZP2yLrSEay1cDLtA7Rm6AYRKIhiBKwFVewi4VEo6HbgfKpeZRZ2G8w1UErxTuPom2WymByoOg1Z8Xn23OiW+CkcrwRFhDYyp3LRiIT+86fPYkF4TBqO9lWbxKy4ZtcHXfMcGBmQSc3yjN+IctAgMBAAGjIjAgMBEGCWCGSAGG+EIBAQQEAwIGQDALBgNVHQ8EBAMCBSAwDQYJKoZIhvcNAQEFBQADgYEAi1vdSKmUUPdkwxv6tnabo6sEpTCdyV33Jops5hMkdtIKsvOG+CeXuvPYIwZpvwozAppL3tcXsh6t35YklpjeoX8qX5gYTZvuusCUAQHfJC4H/ggU+TrjQW5GnGOLTpgew/NtLKj7LACp/YrwMNA5ktdsBbj2kESIEVlokLvITy4=" + } + ] + }, + { + "dn": "krbprincipalname=test/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "has_keytab": false, + "krbprincipalname": [ + "test/dev.example.com@DEV.EXAMPLE.COM" + ], + "managedby_host": [ + "dev.example.com" + ] + } + ], + "summary": "3 services matched", + "truncated": false + } +} diff --git a/install/static/sampledata/service_remove_host.sh b/install/static/sampledata/service_remove_host.sh new file mode 100644 index 000000000..15234f4d0 --- /dev/null +++ b/install/static/sampledata/service_remove_host.sh @@ -0,0 +1,18 @@ +{ + "error": null, + "id": 0, + "result": { + "completed": 1, + "failed": { + "managedby": { + "host": [] + } + }, + "result": { + "dn": "krbprincipalname=test/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "krbprincipalname": [ + "test/dev.example.com@DEV.EXAMPLE.COM" + ] + } + } +} diff --git a/install/static/sampledata/service_show.json b/install/static/sampledata/service_show.json new file mode 100644 index 000000000..30025eb76 --- /dev/null +++ b/install/static/sampledata/service_show.json @@ -0,0 +1,18 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "dn": "krbprincipalname=test/dev.example.com@dev.example.com,cn=services,cn=accounts,dc=dev,dc=example,dc=com", + "has_keytab": false, + "krbprincipalname": [ + "test/dev.example.com@DEV.EXAMPLE.COM" + ], + "managedby_host": [ + "dev.example.com" + ] + }, + "summary": null, + "value": "test/dev.example.com@DEV.EXAMPLE.COM" + } +} diff --git a/install/static/service.js b/install/static/service.js new file mode 100644 index 000000000..467e56a81 --- /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; +} |