From 30e99d3b2cd23c2f479174a696c496320f2f0f5a Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 4 Apr 2026 14:33:10 +1000 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B1=D0=B4=20=D0=B2=20=D0=BD=D0=B0=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=B9=D0=BA=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Authe.vue | 3 +-- src/components/Setings.vue | 16 ++++++++-------- src/components/Stat.vue | 6 +++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/components/Authe.vue b/src/components/Authe.vue index 1187ca9..b6fccab 100644 --- a/src/components/Authe.vue +++ b/src/components/Authe.vue @@ -63,7 +63,7 @@ const auth_my = async () => { // Обработка глобального нажатия Enter const handleKeyDown = (event) => { - if (event.key === "Enter") { + if (event.key === "Enter" && !isLoggedIn.value) { auth_my(); } }; @@ -71,7 +71,6 @@ const handleKeyDown = (event) => { // Добавляем глобальный слушатель при монтировании onMounted(() => { window.addEventListener("keydown", handleKeyDown); - // Показываем badge reCAPTCHA при монтировании showRecaptchaBadge(); }); diff --git a/src/components/Setings.vue b/src/components/Setings.vue index 865c193..7287305 100644 --- a/src/components/Setings.vue +++ b/src/components/Setings.vue @@ -146,13 +146,12 @@ import { ref, onMounted } from "vue"; import axios from "axios"; const sources = ref([ - { name: "source1", url: "eee", prompt: "" }, - { name: "source2", url: "https://example2.com/api", prompt: "" }, + { url: "", name: "", promt: "" }, ]); const currentSource = ref(sources.value[0]); -const time = ref(""); const promt = ref("Начальный текст"); +const promt_url = ref("https://"); const logs = ref([]); const tasks = ref([]); const showLogs = ref(false); // скрыто по умолчанию @@ -165,7 +164,6 @@ function toggleLogs() { load_log(); } } - const load_log = async () => { try { const response = await axios.get("https://allowlgroup.ru/api/8001/logs"); @@ -218,7 +216,8 @@ const loadSettings = async () => { const response = await axios.get("https://allowlgroup.ru/api/8001/settings"); sources.value = response.data.sources; currentSource.value = sources.value[0]; - promt.value = currentSource.value.prompt; + promt.value = currentSource.value.promt; + promt_url.value = currentSource.value.url; } catch (error) { console.error("Ошибка при загрузке настроек:", error); } @@ -227,16 +226,17 @@ const loadSettings = async () => { // Выбор источника const selectSource = (index) => { currentSource.value = sources.value[index]; - promt.value = currentSource.value.prompt; + promt.value = currentSource.value.promt; + promt_url.value = currentSource.value.url; }; // Сохранение источников const saveSources = async () => { try { await axios.post("https://allowlgroup.ru/api/8001/settings", { + url: currentSource.value.url, name: currentSource.value.name, - url: "", - prompt: promt.value, + promt: promt.value, }); // Здесь можно отправить на сервер, если нужно loadSettings(); diff --git a/src/components/Stat.vue b/src/components/Stat.vue index 008ef36..df0ae29 100644 --- a/src/components/Stat.vue +++ b/src/components/Stat.vue @@ -2,7 +2,7 @@ import { ref, onMounted, onBeforeUnmount } from "vue"; import axios from "axios"; -// ✅ Добавляем emit для уведомления родителя об изменениях +// Добавляем emit для уведомления родителя об изменениях const emit = defineEmits(["update:viewed", "update:status"]); const props = defineProps({ @@ -19,7 +19,7 @@ const props = defineProps({ status: Boolean, }); -// ✅ Делаем viewed и status реактивными для локального обновления +// Делаем viewed и status реактивными для локального обновления const localViewed = ref(props.viewed); const localStatus = ref(props.status); @@ -66,7 +66,7 @@ function handleClickOutside(event) { } } -// ✅ Обновляем локально + отправляем emit +// Обновляем локально + отправляем emit const viewed_b = async () => { const newValue = !localViewed.value; localViewed.value = newValue; // Локальное обновление сразу