diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2013-11-26 21:40:28 -0500 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2013-12-06 03:18:59 -0500 |
| commit | 0ae21ef7d59fd446f51ec880f90733dc71afd1bf (patch) | |
| tree | f86ae6d8a5adc2b58bce44fa6e50a803ed8fb6de /base | |
| parent | 8f6de6fd339c156ce3aad13ad5d45b635d194f79 (diff) | |
Added TPS UI skeleton.
An inititial implementation of TPS UI has been added. The UI will
display TPS resources as tables.
Ticket #654
Diffstat (limited to 'base')
22 files changed, 1079 insertions, 6 deletions
diff --git a/base/common/src/com/netscape/certsrv/tps/cert/TPSCertCollection.java b/base/common/src/com/netscape/certsrv/tps/cert/TPSCertCollection.java index 0f927fce5..73b7c890f 100644 --- a/base/common/src/com/netscape/certsrv/tps/cert/TPSCertCollection.java +++ b/base/common/src/com/netscape/certsrv/tps/cert/TPSCertCollection.java @@ -28,7 +28,7 @@ import com.netscape.certsrv.base.DataCollection; /** * @author Endi S. Dewata */ -@XmlRootElement(name="Activities") +@XmlRootElement(name="Certificates") public class TPSCertCollection extends DataCollection<TPSCertData> { @XmlElementRef diff --git a/base/server/share/webapps/pki/css/pki-ui.css b/base/server/share/webapps/pki/css/pki-ui.css new file mode 100644 index 000000000..63df0ffd2 --- /dev/null +++ b/base/server/share/webapps/pki/css/pki-ui.css @@ -0,0 +1,29 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +table { + border: 1px solid black; + border-spacing: 0; +} + +table td { + border: 1px solid black; +} diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js new file mode 100644 index 000000000..35363b0f7 --- /dev/null +++ b/base/server/share/webapps/pki/js/pki-ui.js @@ -0,0 +1,56 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var TableItemView = Backbone.View.extend({ + render: function() { + var self = this; + $("td", self.el).each(function(index) { + var item = $(this); + var name = item.attr("name"); + var value = self.model.get(name); + item.text(value); + }); + } +}); + +var TableView = Backbone.View.extend({ + initialize: function() { + var self = this; + self.tbody = $("tbody", self.el); + self.template = $("tr", self.tbody).detach(); + self.render(); + }, + render: function() { + var self = this; + self.collection.fetch({ + success: function() { + _(self.collection.models).each(function(item) { + var itemView = new TableItemView({ + el: self.template.clone(), + model: item + }); + itemView.render(); + self.tbody.append(itemView.el); + }, self); + } + }); + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/activities.html b/base/tps-tomcat/shared/webapps/tps/activities.html new file mode 100644 index 000000000..e87d6daef --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/activities.html @@ -0,0 +1,65 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/activity.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='activities']"), + collection: new ActivityCollection() + }); +}); + </script> +</head> +<body> + +<h1>Activities</h1> + +<table name="activities"> +<thead> + <tr> + <td>Activity ID</td> + <td>Token ID</td> + <td>User ID</td> + <td>IP</td> + <td>Operation</td> + <td>Result</td> + <td>Date</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="tokenID"> </td> + <td name="userID"> </td> + <td name="ip"> </td> + <td name="operation"> </td> + <td name="result"> </td> + <td name="date"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/authenticators.html b/base/tps-tomcat/shared/webapps/tps/authenticators.html new file mode 100644 index 000000000..0f08c822f --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/authenticators.html @@ -0,0 +1,55 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/authenticator.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='authenticators']"), + collection: new AuthenticatorCollection() + }); +}); + </script> +</head> +<body> + +<h1>Authenticators</h1> + +<table name="authenticators"> +<thead> + <tr> + <td>Authenticator ID</td> + <td>Status</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="status"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/certs.html b/base/tps-tomcat/shared/webapps/tps/certs.html new file mode 100644 index 000000000..58f7c82e8 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/certs.html @@ -0,0 +1,69 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/cert.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='certificates']"), + collection: new CertificateCollection() + }); +}); + </script> +</head> +<body> + +<h1>Certificates</h1> + +<table name="certificates"> +<thead> + <tr> + <td>Certificate ID</td> + <td>Serial Number</td> + <td>Subject</td> + <td>Token ID</td> + <td>User ID</td> + <td>Key Type</td> + <td>Status</td> + <td>Create Time</td> + <td>Modify Time</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="serialNumber"> </td> + <td name="subject"> </td> + <td name="tokenID"> </td> + <td name="userID"> </td> + <td name="keyType"> </td> + <td name="status"> </td> + <td name="createTime"> </td> + <td name="modifyTime"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/connections.html b/base/tps-tomcat/shared/webapps/tps/connections.html new file mode 100644 index 000000000..99136e667 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/connections.html @@ -0,0 +1,55 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/connection.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='connections']"), + collection: new ConnectionCollection() + }); +}); + </script> +</head> +<body> + +<h1>Connections</h1> + +<table name="connections"> +<thead> + <tr> + <td>Connection ID</td> + <td>Status</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="status"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/groups.html b/base/tps-tomcat/shared/webapps/tps/groups.html new file mode 100644 index 000000000..6fd76ee38 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/groups.html @@ -0,0 +1,55 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/group.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='groups']"), + collection: new GroupCollection() + }); +}); + </script> +</head> +<body> + +<h1>Groups</h1> + +<table name="groups"> +<thead> + <tr> + <td>Group ID</td> + <td>Description</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="description"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/index.html b/base/tps-tomcat/shared/webapps/tps/index.html index 30662d47a..ace02a9cf 100644 --- a/base/tps-tomcat/shared/webapps/tps/index.html +++ b/base/tps-tomcat/shared/webapps/tps/index.html @@ -12,12 +12,28 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - Copyright (C) 2007 Red Hat, Inc. + Copyright (C) 2013 Red Hat, Inc. All rights reserved. --- END COPYRIGHT BLOCK --- --> <html> -<script lang="javascript"> - // redirect to 'ROOT' - window.location = "/"; -</script> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> +</head> +<body> + +<h1>Token Processing Service</h1> + +<ul> +<li><a href="tokens.html">Tokens</a></li> +<li><a href="certs.html">Certificates</a></li> +<li><a href="activities.html">Activities</a></li> +<li><a href="profiles.html">Profiles</a></li> +<li><a href="selftests.html">Self Tests</a></li> +<li><a href="users.html">Users</a></li> +<li><a href="groups.html">Groups</a></li> +<li><a href="authenticators.html">Authenticators</a></li> +<li><a href="connections.html">Connections</a></li> +</ul> + +</body> </html> diff --git a/base/tps-tomcat/shared/webapps/tps/js/activity.js b/base/tps-tomcat/shared/webapps/tps/js/activity.js new file mode 100644 index 000000000..425bf6836 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/activity.js @@ -0,0 +1,51 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var ActivityModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/activities" +}); + +var ActivityCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/activities"; + }, + parse: function(response) { + var models = []; + + var list = response.Activities.Activity; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new ActivityModel({ + id: item["@id"], + tokenID: item.TokenID, + userID: item.UserID, + ip: item.IP, + operation: item.Operation, + result: item.Result, + date: item.Date + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/authenticator.js b/base/tps-tomcat/shared/webapps/tps/js/authenticator.js new file mode 100644 index 000000000..13cc33eb8 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/authenticator.js @@ -0,0 +1,46 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var AuthenticatorModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/authenticators" +}); + +var AuthenticatorCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/authenticators"; + }, + parse: function(response) { + var models = []; + + var list = response.Authenticators.Authenticator; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new AuthenticatorModel({ + id: item["@id"], + status: item.Status + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/cert.js b/base/tps-tomcat/shared/webapps/tps/js/cert.js new file mode 100644 index 000000000..4db3bd274 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/cert.js @@ -0,0 +1,53 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var CertificateModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/certs" +}); + +var CertificateCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/certs"; + }, + parse: function(response) { + var models = []; + + var list = response.Certificates.Certificate; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new CertificateModel({ + id: item["@id"], + serialNumber: item.SerialNumber, + subject: item.Subject, + tokenID: item.TokenID, + userID: item.UserID, + keyType: item.KeyType, + status: item.Status, + createTime: item.CreateTime, + modifyTime: item.ModifyTime + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/connection.js b/base/tps-tomcat/shared/webapps/tps/js/connection.js new file mode 100644 index 000000000..8fe52d6a3 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/connection.js @@ -0,0 +1,46 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var ConnectionModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/connections" +}); + +var ConnectionCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/connections"; + }, + parse: function(response) { + var models = []; + + var list = response.Connections.Connection; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new ConnectionModel({ + id: item["@id"], + status: item.Status + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/group.js b/base/tps-tomcat/shared/webapps/tps/js/group.js new file mode 100644 index 000000000..6ab4c0de5 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/group.js @@ -0,0 +1,46 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var GroupModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/admin/groups" +}); + +var GroupCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/admin/groups"; + }, + parse: function(response) { + var models = []; + + var list = response.Groups.Group; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new GroupModel({ + id: item["@id"], + description: item.Description + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/profile.js b/base/tps-tomcat/shared/webapps/tps/js/profile.js new file mode 100644 index 000000000..54afc4324 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/profile.js @@ -0,0 +1,46 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var ProfileModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/profiles" +}); + +var ProfileCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/profiles"; + }, + parse: function(response) { + var models = []; + + var list = response.Profiles.Profile; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new ProfileModel({ + id: item["@id"], + status: item.Status + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/selftest.js b/base/tps-tomcat/shared/webapps/tps/js/selftest.js new file mode 100644 index 000000000..8753d98c6 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/selftest.js @@ -0,0 +1,49 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var SelfTestModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/selftests" +}); + +var SelfTestCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/selftests"; + }, + parse: function(response) { + var models = []; + + var list = response.SelfTests.SelfTest; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new SelfTestModel({ + id: item["@id"], + enabledAtStartup: item.EnabledAtStartup, + criticalAtStartup: item.CriticalAtStartup, + enabledOnDemand: item.EnabledOnDemand, + criticalOnDemand: item.CriticalOnDemand, + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/token.js b/base/tps-tomcat/shared/webapps/tps/js/token.js new file mode 100644 index 000000000..4ff39554c --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/token.js @@ -0,0 +1,52 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var TokenModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/tokens" +}); + +var TokenCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/tokens"; + }, + parse: function(response) { + var models = []; + + var list = response.Tokens.Token; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new TokenModel({ + id: item["@id"], + userID: item.UserID, + status: item.Status, + reason: item.Reason, + appletID: item.AppletID, + keyInfo: item.KeyInfo, + created: item.CreateTimestamp, + modified: item.ModifyTimestamp + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/js/user.js b/base/tps-tomcat/shared/webapps/tps/js/user.js new file mode 100644 index 000000000..6c112a648 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/js/user.js @@ -0,0 +1,46 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * 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 of the License. + * + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright (C) 2013 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + * + * @author Endi S. Dewata + */ + +var UserModel = Backbone.Model.extend({ + urlRoot: "/tps/rest/admin/users" +}); + +var UserCollection = Backbone.Collection.extend({ + url: function() { + return "/tps/rest/admin/users"; + }, + parse: function(response) { + var models = []; + + var list = response.Users.User; + list = list == undefined ? [] : [].concat(list); + + _(list).each(function(item) { + var model = new UserModel({ + id: item["@id"], + fullName: item.FullName + }); + models.push(model); + }); + + return models; + } +}); diff --git a/base/tps-tomcat/shared/webapps/tps/profiles.html b/base/tps-tomcat/shared/webapps/tps/profiles.html new file mode 100644 index 000000000..716ba24b3 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/profiles.html @@ -0,0 +1,55 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/profile.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='profiles']"), + collection: new ProfileCollection() + }); +}); + </script> +</head> +<body> + +<h1>Profiles</h1> + +<table name="profiles"> +<thead> + <tr> + <td>Profile ID</td> + <td>Status</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="status"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/selftests.html b/base/tps-tomcat/shared/webapps/tps/selftests.html new file mode 100644 index 000000000..026796e13 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/selftests.html @@ -0,0 +1,61 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/selftest.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='selftests']"), + collection: new SelfTestCollection() + }); +}); + </script> +</head> +<body> + +<h1>Self Tests</h1> + +<table name="selftests"> +<thead> + <tr> + <td>Self Test ID</td> + <td>Enabled at Statup</td> + <td>Critical at Startup</td> + <td>Enabled on Demand</td> + <td>Critical on Demand</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="enabledAtStartup"> </td> + <td name="criticalAtStartup"> </td> + <td name="enabledOnDemand"> </td> + <td name="criticalOnDemand"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/tokens.html b/base/tps-tomcat/shared/webapps/tps/tokens.html new file mode 100644 index 000000000..06d2d978e --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/tokens.html @@ -0,0 +1,67 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/token.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='tokens']"), + collection: new TokenCollection() + }); +}); + </script> +</head> +<body> + +<h1>Tokens</h1> + +<table name="tokens"> +<thead> + <tr> + <td>Token ID</td> + <td>User ID</td> + <td>Status</td> + <td>Reason</td> + <td>Applet ID</td> + <td>Key Info</td> + <td>Created</td> + <td>Modified</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="userID"> </td> + <td name="status"> </td> + <td name="reason"> </td> + <td name="appletID"> </td> + <td name="keyInfo"> </td> + <td name="created"> </td> + <td name="modified"> </td> + </tr> +</tbody> +</table> + +</body> +</html> diff --git a/base/tps-tomcat/shared/webapps/tps/users.html b/base/tps-tomcat/shared/webapps/tps/users.html new file mode 100644 index 000000000..cd66d2c93 --- /dev/null +++ b/base/tps-tomcat/shared/webapps/tps/users.html @@ -0,0 +1,55 @@ +<!-- --- BEGIN COPYRIGHT BLOCK --- + 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 of the License. + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Copyright (C) 2013 Red Hat, Inc. + All rights reserved. + --- END COPYRIGHT BLOCK --- --> +<html> +<head> + <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> + <script src="/pki/js/jquery.js"></script> + <script src="/pki/js/underscore.js"></script> + <script src="/pki/js/backbone.js"></script> + <script src="/pki/js/pki-ui.js"></script> + <script src="/tps/js/user.js"></script> + <script> +$(function() { + new TableView({ + el: $("table[name='users']"), + collection: new UserCollection() + }); +}); + </script> +</head> +<body> + +<h1>Users</h1> + +<table name="users"> +<thead> + <tr> + <td>User ID</td> + <td>Full Name</td> + </tr> +</thead> +<tbody> + <tr> + <td name="id"> </td> + <td name="fullName"> </td> + </tr> +</tbody> +</table> + +</body> +</html> |
