парсер всех источников добавлен, без адаптации фронтента
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 <input
v-model="newSourceUrl" v-model="newSourceUrl"
type="text" 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" 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>
<!-- Список источников --> <!-- Список источников -->
<div class="p-4"> <div class="p-4 xl:flex gap-2 justify-between">
<div <div
v-for="source in filteredSources" v-for="source in filteredSources"
:key="source.url" :key="source.url"

View File

@@ -1,13 +1,14 @@
<template> <template>
<div <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"
> >
<dev class="">
<input <input
v-model="displayUrl" v-model="displayUrl"
type="text" type="text"
placeholder="URL источника" placeholder="URL источника"
readonly readonly
class="flex-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0" class="flex-1 m-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0"
/> />
<input <input
@@ -15,13 +16,13 @@
type="text" type="text"
placeholder="Промт" placeholder="Промт"
readonly readonly
class="flex-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 min-w-0" class="flex-1 m-1 h-12 dark:bg-gray-900 border-slate-100 shadow rounded-xl p-3 max-w-20"
/> />
</dev>
<button <button
@click="startParsing" @click="startParsing"
:disabled="isLoading" :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" }} {{ isLoading ? "..." : "Start" }}
</button> </button>
@@ -36,8 +37,8 @@ const props = defineProps({
source: { source: {
type: Object, type: Object,
required: true, required: true,
default: () => ({ url: "", promt: "" }) default: () => ({ url: "", promt: "" }),
} },
}); });
const emit = defineEmits(["sourceStarted"]); const emit = defineEmits(["sourceStarted"]);
@@ -48,14 +49,14 @@ const displayUrl = computed({
get: () => props.source.url || "", get: () => props.source.url || "",
set: (val) => { set: (val) => {
// Только для чтения // Только для чтения
} },
}); });
const displayPromt = computed({ const displayPromt = computed({
get: () => props.source.promt || "", get: () => props.source.promt || "",
set: (val) => { set: (val) => {
// Только для чтения // Только для чтения
} },
}); });
const startParsing = async () => { const startParsing = async () => {
@@ -67,9 +68,10 @@ const startParsing = async () => {
isLoading.value = true; isLoading.value = true;
try { 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, url: props.source.url,
promt: props.source.promt promt: props.source.promt,
}); });
emit("sourceStarted", props.source.url); emit("sourceStarted", props.source.url);