From 8d369519116cb1f257304d79d13e63188fc7d978 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 22 Feb 2013 17:12:53 +0100 Subject: Web UI:Choose different search option for cert-find This extends certificate search page by search option select. Therefore the search is not restricted to 'subject'. It should be replaced by https://fedorahosted.org/freeipa/ticket/191 in a future. https://fedorahosted.org/freeipa/ticket/3419 --- install/ui/src/freeipa/certificate.js | 103 +++++++++++++++++++++++++++++++++- install/ui/src/freeipa/search.js | 8 ++- 2 files changed, 107 insertions(+), 4 deletions(-) (limited to 'install/ui/src') diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js index 84cff41f..854a909a 100755 --- a/install/ui/src/freeipa/certificate.js +++ b/install/ui/src/freeipa/certificate.js @@ -1066,6 +1066,56 @@ IPA.cert.entity = function(spec) { name: 'status', width: '120px' } + ], + search_options: [ + { + value: 'subject', + label: IPA.messages.objects.cert.find_subject + }, + { + value: 'revocation_reason', + label: IPA.messages.objects.cert.find_revocation_reason + }, + { + value: 'min_serial_number', + label: IPA.messages.objects.cert.find_min_serial_number + }, + { + value: 'max_serial_number', + label: IPA.messages.objects.cert.find_max_serial_number + }, + { + value: 'validnotafter_from', + label: IPA.messages.objects.cert.find_validnotafter_from + }, + { + value: 'validnotafter_to', + label: IPA.messages.objects.cert.find_validnotafter_to + }, + { + value: 'validnotbefore_from', + label: IPA.messages.objects.cert.find_validnotbefore_from + }, + { + value: 'validnotbefore_to', + label: IPA.messages.objects.cert.find_validnotbefore_to + }, + { + value: 'issuedon_from', + label: IPA.messages.objects.cert.find_issuedon_from + }, + { + value: 'issuedon_to', + label: IPA.messages.objects.cert.find_issuedon_to + }, + { + value: 'revokedon_from', + label: IPA.messages.objects.cert.find_revokedon_from + }, + { + value: 'revokedon_to', + label: IPA.messages.objects.cert.find_revokedon_to + } ] }). details_facet({ @@ -1134,19 +1184,70 @@ IPA.cert.search_facet = function(spec) { var that = IPA.search_facet(spec); + that.search_options = spec.search_options || []; + + that.create_header = function(container) { + that.search_facet_create_header(container); + + that.search_option = $('', { type: 'text', name: 'filter' - }).appendTo(filter_container); + }).appendTo(that.filter_container); that.filter.keypress(function(e) { /* if the key pressed is the enter key */ @@ -106,7 +106,7 @@ IPA.search_facet = function(spec, no_init) { that.find(); return false; } - }).appendTo(filter_container); + }).appendTo(that.filter_container); that.create_control_buttons(that.controls); }; @@ -258,6 +258,8 @@ IPA.search_facet = function(spec, no_init) { // methods that should be invoked by subclasses that.search_facet_refresh = that.refresh; that.search_facet_create_refresh_command = that.create_refresh_command; + that.search_facet_create_header = that.create_header; + that.search_facet_show = that.show; return that; }; -- cgit