From c5b300ffa2510ad584ce05b0b87991119c8e0038 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 May 2026 13:24:02 +0300 Subject: [PATCH] =?UTF-8?q?UI=20=D0=BE=D0=B1=D1=80=D0=B0=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9,=20WebSocket=20=D0=B8=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20DnD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Канбан: шире контейнер, колонки minmax(300px), больше высота списков и колонок, брейкпоинт 1100px. - WebSocket: настраиваемый префикс support_ws_base (occ) и data-support-ws-base; корректная сборка пути /ws/tickets/… - Устранён ReferenceError: clientChatDndBound до инициализации при открытии создания обращения. --- js/main.js | 40 ++++++++++++++++++++-------- lib/Controller/PageController.php | 44 ++++++++++++++++++------------- templates/main.php | 1 + 3 files changed, 55 insertions(+), 30 deletions(-) diff --git a/js/main.js b/js/main.js index e68b0aa..8db71c9 100644 --- a/js/main.js +++ b/js/main.js @@ -5,6 +5,7 @@ const username = root.dataset.username; const serverAddress = root.dataset.serverAddress; const apiBase = root.dataset.supportApiBase; + const supportWsBaseOverride = (root.dataset.supportWsBase || "").trim(); const RASTER_IMAGE_EXT = new Set(["jpg", "jpeg", "png", "gif", "webp", "bmp", "tif", "tiff", "heic", "heif"]); const RASTER_IMAGE_MIME = new Set([ @@ -149,10 +150,25 @@ } function wsUrlForTicket(ticketNumber) { + const tail = `/tickets/${encodeURIComponent(ticketNumber)}`; + if (supportWsBaseOverride) { + try { + const raw = supportWsBaseOverride.replace(/\/$/, ""); + const u = new URL(raw.includes("://") ? raw : `wss://${raw}`); + const wsProto = u.protocol === "https:" ? "wss:" : u.protocol === "http:" ? "ws:" : u.protocol; + let path = (u.pathname || "").replace(/\/$/, ""); + if (path === "" || path === "/") { + path = "/ws"; + } + return `${wsProto}//${u.host}${path}${tail}`; + } catch (_) { + return null; + } + } try { const u = new URL(apiBase); const wsProto = u.protocol === "https:" ? "wss:" : "ws:"; - return `${wsProto}//${u.host}/ws/tickets/${encodeURIComponent(ticketNumber)}`; + return `${wsProto}//${u.host}/ws${tail}`; } catch (_) { return null; } @@ -311,25 +327,26 @@