This commit is contained in:
Roland Gruber 2020-01-13 20:14:40 +01:00
parent f1db477fda
commit c1e6b61ecd
2 changed files with 12 additions and 1 deletions

View File

@ -473,7 +473,8 @@ printHeaderContents(_("Edit general settings"), '../..');
$database = new \LAM\LOGIN\WEBAUTHN\PublicKeyCredentialSourceRepositorySQLite();
if ($database->hasRegisteredCredentials()) {
$row->add(new htmlSubTitle(_('Webauthn devices')), 12);
$row->add(new htmlResponsiveInputField(_('User DN'), 'webauthn_searchTerm', null, '252'), 12);
$webauthnSearchField = new htmlResponsiveInputField(_('User DN'), 'webauthn_searchTerm', null, '252');
$row->add($webauthnSearchField, 12);
$row->addVerticalSpacer('0.5rem');
$row->add(new htmlButton('webauthn_search', _('Search')), 12, 12, 12, 'text-center');
$resultDiv = new htmlDiv('webauthn_results', new htmlOutputText(''), array('lam-webauthn-results'));

View File

@ -1551,6 +1551,16 @@ window.lam.webauthn.setupDeviceManagement = function() {
if (searchButton) {
searchButton.click(window.lam.webauthn.searchDevices);
}
const searchInput = jQuery('#webauthn_searchTerm');
if (searchInput) {
searchInput.keydown(function (event) {
if (event.keyCode == 13) {
event.preventDefault();
searchButton.click();
return false;
}
});
}
}
/**