mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
Services
adds the Service tab: search, details, add, associations It also contains the sample data for some service operations
This commit is contained in:
parent
54b3842aba
commit
0050e2fcd9
@ -19,6 +19,7 @@ app_DATA = \
|
||||
jquery.cookie.js \
|
||||
navigation.js \
|
||||
netgroup.js \
|
||||
service.js \
|
||||
pageparams.js \
|
||||
search.js \
|
||||
details.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;
|
||||
}
|
||||
}
|
||||
|
@ -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">
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
29
install/static/sampledata/service_add.json
Normal file
29
install/static/sampledata/service_add.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
21
install/static/sampledata/service_add_host.json
Normal file
21
install/static/sampledata/service_add_host.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
9
install/static/sampledata/service_del.json
Normal file
9
install/static/sampledata/service_del.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
48
install/static/sampledata/service_find.json
Normal file
48
install/static/sampledata/service_find.json
Normal file
@ -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
|
||||
}
|
||||
}
|
18
install/static/sampledata/service_remove_host.sh
Normal file
18
install/static/sampledata/service_remove_host.sh
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
18
install/static/sampledata/service_show.json
Normal file
18
install/static/sampledata/service_show.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
96
install/static/service.js
Normal file
96
install/static/service.js
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user