фильтрация источников
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 { 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 || []; sources.value = data.data.sources || [];
} catch (err) { } catch (err) {
console.error("Ошибка загрузки источников:", err); console.error("Ошибка загрузки источников:", err);
@@ -147,7 +149,7 @@ const addSource = async () => {
}; };
const onfilterItems = (filterValue) => { const onfilterItems = (filterValue) => {
console.log("Фильтр:", filterValue); fetchSources(filterValue);
}; };
const handleSourceStarted = (url) => { const handleSourceStarted = (url) => {
@@ -169,6 +171,6 @@ onMounted(() => {
}); });
fetchCategories(); fetchCategories();
fetchSources(); fetchSources("all");
}); });
</script> </script>

View File

@@ -2,7 +2,7 @@
<div <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" 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 <input
v-model="displayUrl" v-model="displayUrl"
type="text" type="text"
@@ -18,7 +18,7 @@
readonly 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" 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"> <div class="min-w-40">
<button <button
@click="deleteParsing" @click="deleteParsing"