diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-01-06 05:10:33 +0100 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-01-18 16:45:41 +0100 |
commit | e7f4ecd0cf8455c6c6ce57dae48da246a02f76d0 (patch) | |
tree | 3c0ae403194551aad58e379cda605f61ee53bbb4 /base/server/share/webapps/pki | |
parent | 02b63c6f8200042175b482b9cc00a0bc950f2f06 (diff) | |
download | pki-e7f4ecd0cf8455c6c6ce57dae48da246a02f76d0.tar.gz pki-e7f4ecd0cf8455c6c6ce57dae48da246a02f76d0.tar.xz pki-e7f4ecd0cf8455c6c6ce57dae48da246a02f76d0.zip |
Added interface to run selftest in TPS UI.
The TPS UI has been modified to provide an interface to run the
selftests and display the results.
https://fedorahosted.org/pki/ticket/1502
Diffstat (limited to 'base/server/share/webapps/pki')
-rw-r--r-- | base/server/share/webapps/pki/js/pki-ui.js | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/base/server/share/webapps/pki/js/pki-ui.js b/base/server/share/webapps/pki/js/pki-ui.js index cf4b44e24..c6e326a0c 100644 --- a/base/server/share/webapps/pki/js/pki-ui.js +++ b/base/server/share/webapps/pki/js/pki-ui.js @@ -194,6 +194,8 @@ var Dialog = Backbone.View.extend({ var self = this; Dialog.__super__.initialize.call(self, options); + self.body = self.$(".modal-body"); + self.title = options.title; self.readonly = options.readonly; @@ -231,7 +233,8 @@ var Dialog = Backbone.View.extend({ } // setup input fields - self.$(".modal-body input").each(function(index) { + // TODO: handle drop-down lists + $("input, textarea", self.body).each(function(index) { var input = $(this); var name = input.attr("name"); if (_.contains(self.readonly, name)) { @@ -287,13 +290,7 @@ var Dialog = Backbone.View.extend({ var self = this; // load input fields - self.$(".modal-body input").each(function(index) { - var input = $(this); - self.loadField(input); - }); - - // load drop-down lists - self.$(".modal-body select").each(function(index) { + $("input, select, textarea", self.body).each(function(index) { var input = $(this); self.loadField(input); }); @@ -425,6 +422,17 @@ var TableItem = Backbone.View.extend({ } }); }, + isSelected: function() { + var self = this; + + var checkbox = $("td.pki-select-column input", self.$el); + + // skip blank rows + var value = checkbox.val(); + if (value == "") return false; + + return checkbox.prop("checked"); + }, get: function(name) { var self = this; var attribute = self.table.columnMappings[name] || name; @@ -664,6 +672,10 @@ var Table = Backbone.View.extend({ item.reset(); } }, + getSelectedRows: function() { + var self = this; + return _.filter(self.items, function(item) { return item.isSelected(); }); + }, totalEntries: function() { var self = this; return self.filteredEntries.length; |