This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user