diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/ui/ipa.css | 9 | ||||
-rwxr-xr-x | install/ui/src/freeipa/certificate.js | 103 | ||||
-rw-r--r-- | install/ui/src/freeipa/search.js | 8 | ||||
-rw-r--r-- | install/ui/test/data/ipa_init.json | 12 |
4 files changed, 128 insertions, 4 deletions
diff --git a/install/ui/ipa.css b/install/ui/ipa.css index 4e51c3051..71cad4206 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 84cff41f6..854a909ac 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 = $('<select/>', { + name: 'search_option', + 'class': 'search-option' + }); + + that.filter_container.before(that.search_option); + + for (var i=0; i<that.search_options.length; i++) { + var option = that.search_options[i]; + + var metadata = IPA.get_command_option('cert_find', option.value); + var doc = metadata.doc || ''; + + $('<option/>', { + text: option.label, + value: option.value, + title: doc + }).appendTo(that.search_option); + } + }; that.create_refresh_command = function() { var command = that.search_facet_create_refresh_command(); var arg = command.args.pop(); + var option = that.search_option.val(); + if (arg) { - command.set_option('subject', arg); + command.set_option(option, arg); } return command; }; + // parent method only sets expired flag when filter change, it doesn't + // expect that option can change -> set expire flag for every search + that.find = function() { + var filter = that.filter.val(); + var search_opt = that.search_option.val(); + var old_filter = IPA.nav.get_state(that.managed_entity.name+'-filter'); + var state = {}; + state[that.managed_entity.name + '-filter'] = filter; + state[that.managed_entity.name + '-search-option'] = search_opt; + + that.set_expired_flag(); + + IPA.nav.push_state(state); + }; + + that.show = function() { + that.search_facet_show(); + + if (that.search_option) { + var search_opt = IPA.nav.get_state(that.entity.name+'-search-option'); + that.search_option.val(search_opt); + } + }; + return that; }; diff --git a/install/ui/src/freeipa/search.js b/install/ui/src/freeipa/search.js index d57c40126..be37f88b7 100644 --- a/install/ui/src/freeipa/search.js +++ b/install/ui/src/freeipa/search.js @@ -83,14 +83,14 @@ IPA.search_facet = function(spec, no_init) { div.append(IPA.create_network_spinner()); - var filter_container = $('<div/>', { + that.filter_container = $('<div/>', { 'class': 'search-filter' }).appendTo(div); that.filter = $('<input/>', { 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 685367473..e4d9c2a95 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", |