фильтрация источников
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-05-03 14:00:16 +10:00
parent e20f2a95df
commit e9129667ed
2 changed files with 8 additions and 6 deletions

View File

@@ -108,9 +108,11 @@ const fetchCategories = async () => {
}
};
const fetchSources = async () => {
const fetchSources = async (category) => {
try {
const data = await axios.get("https://allowlgroup.ru/api/8001/all_sources");
const data = await axios.get(`https://allowlgroup.ru/api/8001/all_sources`, {
params: { category }
});
sources.value = data.data.sources || [];
} catch (err) {
console.error("Ошибка загрузки источников:", err);
@@ -147,7 +149,7 @@ const addSource = async () => {
};
const onfilterItems = (filterValue) => {
console.log("Фильтр:", filterValue);
fetchSources(filterValue);
};
const handleSourceStarted = (url) => {
@@ -169,6 +171,6 @@ onMounted(() => {
});
fetchCategories();
fetchSources();
fetchSources("all");
});
</script>

View File

@@ -2,7 +2,7 @@
<div
class="flex flex-col sm:flex-row justify-between w-full lg:w-auto gap-2 p-2 bg-white shadow dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-600"
>
<dev class="">
<div class="">
<input
v-model="displayUrl"
type="text"
@@ -18,7 +18,7 @@
readonly
class="flex-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 w-1/3 sm:max-w-20"
/>
</dev>
</div>
<div class="min-w-40">
<button
@click="deleteParsing"