diff --git a/frontend/src/lib/i18n/en.json b/frontend/src/lib/i18n/en.json index da927d7..08a3843 100644 --- a/frontend/src/lib/i18n/en.json +++ b/frontend/src/lib/i18n/en.json @@ -748,7 +748,11 @@ "syntaxError": "Syntax error", "undefinedVar": "Unknown variable", "line": "line", - "add": "Add" + "add": "Add", + "filterByName": "Filter by name...", + "allTypes": "All types", + "allProviders": "All providers", + "noFilterResults": "No items match the current filter." }, "error": { "notFound": "Page not found", diff --git a/frontend/src/lib/i18n/ru.json b/frontend/src/lib/i18n/ru.json index e304daa..e4e9f1c 100644 --- a/frontend/src/lib/i18n/ru.json +++ b/frontend/src/lib/i18n/ru.json @@ -748,7 +748,11 @@ "syntaxError": "Ошибка синтаксиса", "undefinedVar": "Неизвестная переменная", "line": "строка", - "add": "Добавить" + "add": "Добавить", + "filterByName": "Фильтр по имени...", + "allTypes": "Все типы", + "allProviders": "Все провайдеры", + "noFilterResults": "Нет элементов, соответствующих фильтру." }, "error": { "notFound": "Страница не найдена", diff --git a/frontend/src/routes/command-configs/+page.svelte b/frontend/src/routes/command-configs/+page.svelte index 86a1fde..0e3b57b 100644 --- a/frontend/src/routes/command-configs/+page.svelte +++ b/frontend/src/routes/command-configs/+page.svelte @@ -24,7 +24,13 @@ return tpl?.name || `#${id}`; } - let configs = $derived(commandConfigsCache.items); + let allCmdConfigs = $derived(commandConfigsCache.items); + let filterText = $state(''); + let filterType = $state(''); + let configs = $derived(allCmdConfigs.filter(c => + (!filterText || c.name.toLowerCase().includes(filterText.toLowerCase())) && + (!filterType || c.provider_type === filterType) + )); let cmdTemplateConfigs = $derived(commandTemplateConfigsCache.items); const templateItems = $derived(cmdTemplateConfigs .filter((c: any) => c.provider_type === form.provider_type) @@ -229,10 +235,27 @@ {/if} -{#if configs.length === 0 && !showForm} +{#if !showForm && allCmdConfigs.length > 0} +