From c92eccfc41e72bcdfe7223ee630fb9d31dd38e4b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 May 2026 10:35:36 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=20API:=20support?= =?UTF-8?q?=5Fapi=5Fbase=20=D0=B8=D0=B7=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8?= =?UTF-8?q?=D0=B3=D0=B0,=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B8=20=D1=82=D0=B8=D0=BA=D0=B5=D1=82=D0=B0?= =?UTF-8?q?,=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=20=D0=BD=D0=B5=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D0=BC=D1=8B=D0=B9=20?= =?UTF-8?q?poll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appinfo/info.xml | 2 +- js/main.js | 9 ++++++--- lib/Controller/PageController.php | 6 +++++- templates/main.php | 3 +-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 29cf46f..e785f7b 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ f7support Support ticket client for F7cloud (F7cloud-compatible) f7support client app for creating and viewing support tickets. - 0.1.2 + 0.1.3 AGPL f7support team F7Support diff --git a/js/main.js b/js/main.js index 22a7443..7f2eb20 100644 --- a/js/main.js +++ b/js/main.js @@ -260,7 +260,7 @@ const node = messageList.querySelector(`[data-f7-msg-id="${id}"]`); if (node) hydrateClientAttachments(node); messageList.scrollTop = messageList.scrollHeight; - if (msg.author_role === "support" && state.currentTicket) { + if (clientReadReceiptsEnabled && msg.author_role === "support" && state.currentTicket) { markClientTicketRead(state.currentTicket).catch(() => {}); } } @@ -775,7 +775,7 @@ "X-F7cloud-Server": serverAddress, }, }); - if (!response.ok) throw new Error("Не удалось получить токены"); + if (!response.ok) throw new Error("Не удалось загрузить список обращений"); state.tickets = await response.json(); renderTickets(); } @@ -956,7 +956,10 @@ try { const response = await fetch(`${apiBase}/api/client/tickets`, { method: "POST", - headers: { "Content-Type": "application/json" }, + headers: { + "Content-Type": "application/json", + ...clientIdentityHeaders(), + }, body: JSON.stringify({ ...payload, duplicate }), signal: controller.signal, }); diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 25fe02b..d5ce2f6 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -32,7 +32,11 @@ class PageController extends Controller { $baseUrl = $this->urlGenerator->getBaseUrl(); $serverHost = parse_url($baseUrl, PHP_URL_HOST) ?: 'localhost'; - $supportApiBase = 'https://support.f7cloud.ru'; + // База REST API поддержки (без завершающего слэша). Переопределение: occ config:app:set f7support support_api_base --value=https://... + $supportApiBase = trim($this->config->getAppValue('f7support', 'support_api_base', 'https://support.f7cloud.ru')); + if ($supportApiBase === '') { + $supportApiBase = 'https://support.f7cloud.ru'; + } $supportParts = parse_url($supportApiBase); $supportApiOrigin = ($supportParts['scheme'] ?? 'https') . '://' . ($supportParts['host'] ?? ''); diff --git a/templates/main.php b/templates/main.php index 772362e..47fbf5d 100644 --- a/templates/main.php +++ b/templates/main.php @@ -5,6 +5,5 @@ data-server-address="" data-support-api-base="" data-support-ws-base="" - data-client-read-receipts="" - data-messages-poll-ms="5000"> + data-client-read-receipts="">