From 94840d5720b660e145aaca4bea0ec623c74396d8 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 27 Jan 2014 13:23:31 -0500 Subject: Added TPS UI navigation. A navigation bar has been added to the top of the UI. When a navigation link is clicked, the target page will be loaded into the content area in the same page. Ticket #654 --- base/server/share/webapps/pki/js/pki-ui.js | 34 ++++++++-- base/tps-tomcat/shared/webapps/tps/activities.html | 6 +- .../shared/webapps/tps/authenticators.html | 6 +- base/tps-tomcat/shared/webapps/tps/certs.html | 6 +- .../tps-tomcat/shared/webapps/tps/connections.html | 6 +- base/tps-tomcat/shared/webapps/tps/groups.html | 6 +- base/tps-tomcat/shared/webapps/tps/index.html | 78 ++++++++++++++++++---- base/tps-tomcat/shared/webapps/tps/profiles.html | 6 +- base/tps-tomcat/shared/webapps/tps/selftests.html | 6 +- base/tps-tomcat/shared/webapps/tps/tokens.html | 6 +- base/tps-tomcat/shared/webapps/tps/users.html | 6 +- 11 files changed, 122 insertions(+), 44 deletions(-) (limited to 'base') diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js index dc41668c6..c16af03ba 100644 --- a/base/server/share/webapps/pki/js/pki-ui.js +++ b/base/server/share/webapps/pki/js/pki-ui.js @@ -107,6 +107,30 @@ var Collection = Backbone.Collection.extend({ } }); +var Navigation = Backbone.View.extend({ + initialize: function(options) { + var self = this; + Navigation.__super__.initialize.call(self, options); + + self.content = options.content; + self.homeURL = options.homeURL; + + $("li", self.$el).each(function(index) { + var li = $(this); + var link = $("a", li); + var url = link.attr("href"); + link.click(function(e) { + if (url != "#") { + self.content.load(url); + } + e.preventDefault(); + }); + }); + + if (self.homeURL) self.content.load(self.homeURL); + } +}); + var Dialog = Backbone.View.extend({ initialize: function(options) { var self = this; @@ -316,10 +340,10 @@ var BlankTableItem = Backbone.View.extend({ } }); -var TableItemView = Backbone.View.extend({ +var TableItem = Backbone.View.extend({ initialize: function(options) { var self = this; - TableItemView.__super__.initialize.call(self, options); + TableItem.__super__.initialize.call(self, options); self.table = options.table; }, render: function() { @@ -366,11 +390,11 @@ var TableItemView = Backbone.View.extend({ } }); -var TableView = Backbone.View.extend({ +var Table = Backbone.View.extend({ initialize: function(options) { var self = this; - TableView.__super__.initialize.call(self, options); + Table.__super__.initialize.call(self, options); self.addDialog = options.addDialog; self.editDialog = options.editDialog; @@ -417,7 +441,7 @@ var TableView = Backbone.View.extend({ // display result page _(self.collection.models).each(function(model) { - var item = new TableItemView({ + var item = new TableItem({ el: self.template.clone(), table: self, model: model diff --git a/base/tps-tomcat/shared/webapps/tps/activities.html b/base/tps-tomcat/shared/webapps/tps/activities.html index b0a2469db..367b5e459 100644 --- a/base/tps-tomcat/shared/webapps/tps/activities.html +++ b/base/tps-tomcat/shared/webapps/tps/activities.html @@ -32,7 +32,7 @@ $(function() { "operation", "result", "date"] }); - new TableView({ + new Table({ el: $("table[name='activities']"), collection: new ActivityCollection({ size: 3 }), editDialog: editDialog @@ -53,7 +53,7 @@ $(function() { - + Activity ID Token ID User ID @@ -65,7 +65,7 @@ $(function() { - +       diff --git a/base/tps-tomcat/shared/webapps/tps/authenticators.html b/base/tps-tomcat/shared/webapps/tps/authenticators.html index 68afa3278..fa588ebbb 100644 --- a/base/tps-tomcat/shared/webapps/tps/authenticators.html +++ b/base/tps-tomcat/shared/webapps/tps/authenticators.html @@ -31,7 +31,7 @@ $(function() { readonly: ["id", "status"] }); - new TableView({ + new Table({ el: $("table[name='authenticators']"), collection: new AuthenticatorCollection({ size: 3 }), editDialog: editDialog @@ -52,14 +52,14 @@ $(function() { - + Authenticator ID Status - +     diff --git a/base/tps-tomcat/shared/webapps/tps/certs.html b/base/tps-tomcat/shared/webapps/tps/certs.html index 43b405261..f5335b7a5 100644 --- a/base/tps-tomcat/shared/webapps/tps/certs.html +++ b/base/tps-tomcat/shared/webapps/tps/certs.html @@ -32,7 +32,7 @@ $(function() { "keyType", "status", "createTime", "modifyTime"] }); - new TableView({ + new Table({ el: $("table[name='certificates']"), collection: new CertificateCollection({ size: 3 }), editDialog: editDialog @@ -53,7 +53,7 @@ $(function() { - + Certificate ID Serial Number Subject @@ -67,7 +67,7 @@ $(function() { - +       diff --git a/base/tps-tomcat/shared/webapps/tps/connections.html b/base/tps-tomcat/shared/webapps/tps/connections.html index 85eaf57c2..33f43d7ff 100644 --- a/base/tps-tomcat/shared/webapps/tps/connections.html +++ b/base/tps-tomcat/shared/webapps/tps/connections.html @@ -31,7 +31,7 @@ $(function() { readonly: ["id", "status"] }); - new TableView({ + new Table({ el: $("table[name='connections']"), collection: new ConnectionCollection({ size: 3 }), editDialog: editDialog @@ -52,14 +52,14 @@ $(function() { - + Connection ID Status - +     diff --git a/base/tps-tomcat/shared/webapps/tps/groups.html b/base/tps-tomcat/shared/webapps/tps/groups.html index bab15295c..27bd77a90 100644 --- a/base/tps-tomcat/shared/webapps/tps/groups.html +++ b/base/tps-tomcat/shared/webapps/tps/groups.html @@ -38,7 +38,7 @@ $(function() { actions: ["cancel", "save"] }); - new TableView({ + new Table({ el: $("table[name='groups']"), collection: new GroupCollection({ size: 3 }), addDialog: addDialog, @@ -63,14 +63,14 @@ $(function() { - + Group ID Description - +     diff --git a/base/tps-tomcat/shared/webapps/tps/index.html b/base/tps-tomcat/shared/webapps/tps/index.html index ace02a9cf..b5c8c957a 100644 --- a/base/tps-tomcat/shared/webapps/tps/index.html +++ b/base/tps-tomcat/shared/webapps/tps/index.html @@ -17,23 +17,77 @@ --- END COPYRIGHT BLOCK --- --> + + + + + + + + -

Token Processing Service

+ - +
+
diff --git a/base/tps-tomcat/shared/webapps/tps/profiles.html b/base/tps-tomcat/shared/webapps/tps/profiles.html index 875ec7934..151fdc1a4 100644 --- a/base/tps-tomcat/shared/webapps/tps/profiles.html +++ b/base/tps-tomcat/shared/webapps/tps/profiles.html @@ -31,7 +31,7 @@ $(function() { readonly: ["id", "status"] }); - new TableView({ + new Table({ el: $("table[name='profiles']"), collection: new ProfileCollection({ size: 3 }), editDialog: editDialog @@ -52,14 +52,14 @@ $(function() { - + Profile ID Status - +     diff --git a/base/tps-tomcat/shared/webapps/tps/selftests.html b/base/tps-tomcat/shared/webapps/tps/selftests.html index 1f93655ef..8cac37a24 100644 --- a/base/tps-tomcat/shared/webapps/tps/selftests.html +++ b/base/tps-tomcat/shared/webapps/tps/selftests.html @@ -31,7 +31,7 @@ $(function() { readonly: ["id", "enabledAtStartup", "criticalAtStartup", "enabledOnDemand", "criticalOnDemand"] }); - new TableView({ + new Table({ el: $("table[name='selftests']"), collection: new SelfTestCollection({ size: 3 }), editDialog: editDialog @@ -52,7 +52,7 @@ $(function() { - + Self Test ID Enabled at Statup Critical at Startup @@ -62,7 +62,7 @@ $(function() { - +       diff --git a/base/tps-tomcat/shared/webapps/tps/tokens.html b/base/tps-tomcat/shared/webapps/tps/tokens.html index a04a66b71..e82c9a320 100644 --- a/base/tps-tomcat/shared/webapps/tps/tokens.html +++ b/base/tps-tomcat/shared/webapps/tps/tokens.html @@ -41,7 +41,7 @@ $(function() { actions: ["cancel", "save"] }); - new TableView({ + new Table({ el: $("table[name='tokens']"), collection: new TokenCollection({ size: 3 }), addDialog: addDialog, @@ -66,7 +66,7 @@ $(function() { - + Token ID User ID Status @@ -79,7 +79,7 @@ $(function() { - +       diff --git a/base/tps-tomcat/shared/webapps/tps/users.html b/base/tps-tomcat/shared/webapps/tps/users.html index eb86a3d6f..08656fbef 100644 --- a/base/tps-tomcat/shared/webapps/tps/users.html +++ b/base/tps-tomcat/shared/webapps/tps/users.html @@ -39,7 +39,7 @@ $(function() { actions: ["cancel", "save"] }); - new TableView({ + new Table({ el: $("table[name='users']"), collection: new UserCollection({ size: 3 }), addDialog: addDialog, @@ -64,14 +64,14 @@ $(function() { - + User ID Full Name - +     -- cgit