diff --git a/src/controllers/dashboard/plugins/installed/index.html b/src/controllers/dashboard/plugins/installed/index.html index d2b11592e..2df85f279 100644 --- a/src/controllers/dashboard/plugins/installed/index.html +++ b/src/controllers/dashboard/plugins/installed/index.html @@ -1,6 +1,10 @@
+
+ + +
diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index b8ddbbbf8..13d0132c9 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -112,7 +112,6 @@ function populateList(page, plugins, pluginConfigurationPages) { if (plugin1.Name > plugin2.Name) { return 1; } - return -1; }); @@ -136,6 +135,12 @@ function populateList(page, plugins, pluginConfigurationPages) { html += '
'; } + // add search box listener + const searchBar = page.querySelector('#txtSearchPlugins'); + if (searchBar) { + searchBar.addEventListener('input', () => onFilterType(page, searchBar)); + } + installedPluginsElement.innerHTML = html; loading.hide(); } @@ -239,6 +244,17 @@ function onInstalledPluginsClick(e) { } } +function onFilterType(page, searchBar) { + const filter = searchBar.value.toLowerCase(); + for (const card of page.querySelectorAll('.card')) { + if (filter && filter != '' && !card.textContent.toLowerCase().includes(filter)) { + card.style.display = 'none'; + } else { + card.style.display = 'unset'; + } + } +} + pageIdOn('pageshow', 'pluginsPage', function () { libraryMenu.setTabs('plugins', 0, getTabs); reloadList(this);