парсер всех источников добавлен, без адаптации фронтента
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-12 19:12:57 +10:00
parent 3942501a94
commit 80b1c9fc59
2 changed files with 31 additions and 29 deletions

View File

@@ -45,7 +45,7 @@
<input
v-model="newSourceUrl"
type="text"
placeholder="введите url источника"
placeholder="https://example.com"
class="flex-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0"
/>
@@ -73,7 +73,7 @@
</div>
<!-- Список источников -->
<div class="p-4">
<div class="p-4 xl:flex gap-2 justify-between">
<div
v-for="source in filteredSources"
:key="source.url"

View File

@@ -1,27 +1,28 @@
<template>
<div
class="flex flex-row w-full lg:w-auto gap-2 p-2 bg-gray-50 dark:bg-gray-700 rounded-xl border border-gray-200 dark:border-gray-600"
class="flex flex-row justify-between w-full lg:w-auto gap-2 p-2 bg-gray-100 shadow dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-600"
>
<input
v-model="displayUrl"
type="text"
placeholder="URL источника"
readonly
class="flex-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0"
/>
<input
v-model="displayPromt"
type="text"
placeholder="Промт"
readonly
class="flex-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0"
/>
<dev class="">
<input
v-model="displayUrl"
type="text"
placeholder="URL источника"
readonly
class="flex-1 m-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0"
/>
<input
v-model="displayPromt"
type="text"
placeholder="Промт"
readonly
class="flex-1 m-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 max-w-20"
/>
</dev>
<button
@click="startParsing"
:disabled="isLoading"
class="w-20 h-12 bg-green-600 text-white px-2 rounded-xl shadow hover:bg-green-700 cursor-pointer whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed"
class="w-25 h-11 m-1 dark:bg-orange-500 hover:dark:bg-orange-600 shadow text-white bg-sky-700 hover:bg-sky-900 rounded-xl px-2 cursor-pointer whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed"
>
{{ isLoading ? "..." : "Start" }}
</button>
@@ -36,8 +37,8 @@ const props = defineProps({
source: {
type: Object,
required: true,
default: () => ({ url: "", promt: "" })
}
default: () => ({ url: "", promt: "" }),
},
});
const emit = defineEmits(["sourceStarted"]);
@@ -48,14 +49,14 @@ const displayUrl = computed({
get: () => props.source.url || "",
set: (val) => {
// Только для чтения
}
},
});
const displayPromt = computed({
get: () => props.source.promt || "",
set: (val) => {
// Только для чтения
}
},
});
const startParsing = async () => {
@@ -65,13 +66,14 @@ const startParsing = async () => {
}
isLoading.value = true;
try {
await axios.post("https://allowlgroup.ru/api/parser_all", {
// await axios.post("https://allowlgroup.ru/api/8001/parser_all", {
await axios.post("http://127.0.0.1:8001/parser_all", {
url: props.source.url,
promt: props.source.promt
promt: props.source.promt,
});
emit("sourceStarted", props.source.url);
alert(`Парсинг для ${props.source.url} запущен`);
} catch (err) {
@@ -81,4 +83,4 @@ const startParsing = async () => {
isLoading.value = false;
}
};
</script>
</script>