From 02e315f85994205257149b07cc870b30793d6921 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/ipa.css | 9 +++ install/ui/src/freeipa/certificate.js | 103 +++++++++++++++++++++++++++++++++- install/ui/src/freeipa/search.js | 8 ++- install/ui/test/data/ipa_init.json | 12 ++++ 4 files changed, 128 insertions(+), 4 deletions(-) (limited to 'install') diff --git a/install/ui/ipa.css b/install/ui/ipa.css index 4e51c305..71cad420 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -727,6 +727,15 @@ div[name=settings].facet-group li a { color: gray; } +.search-option { + border: 1px solid #9f9e9e; + background: url(images/search-background.png); + border-radius: 15px !important; + height: 22px; + line-height: 22px; + padding: 0 8px 0; +} + .search-filter { width: 215px; -moz-border-radius: 15px !important; 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; }; diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index 68536747..e4d9c2a9 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -183,6 +183,18 @@ "common_name": "Common Name", "expires_on": "Expires On", "fingerprints": "Fingerprints", + "find_issuedon_from": "Issued on from", + "find_issuedon_to": "Issued on to", + "find_max_serial_number": "Maximum serial number", + "find_min_serial_number": "Minimum serial number", + "find_revocation_reason": "Revocation reason", + "find_revokedon_from": "Revoked on from", + "find_revokedon_to": "Revoked on to", + "find_subject": "Subject", + "find_validnotafter_from": "Valid not after from", + "find_validnotafter_to": "Valid not after to", + "find_validnotbefore_from": "Valid not before from", + "find_validnotbefore_to": "Valid not before to", "issue_certificate": "Issue New Certificate for ${entity} ${primary_key}", "issued_by": "Issued By", "issued_on": "Issued On", -- cgit