UI обращений, WebSocket и исправление DnD
- Канбан: шире контейнер, колонки minmax(300px), больше высота списков и колонок, брейкпоинт 1100px. - WebSocket: настраиваемый префикс support_ws_base (occ) и data-support-ws-base; корректная сборка пути /ws/tickets/… - Устранён ReferenceError: clientChatDndBound до инициализации при открытии создания обращения.
This commit is contained in:
+29
-11
@@ -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 @@
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.f7support-wrap { padding: 16px; font-family: sans-serif; max-width: min(1200px, 100%); box-sizing: border-box; }
|
||||
.f7support-wrap { padding: 16px; font-family: sans-serif; max-width: min(1680px, 100%); width: 100%; box-sizing: border-box; }
|
||||
.f7support-error { color: #b00020; min-height: 1.25em; margin: 8px 0; }
|
||||
.f7support-main { margin-top: 12px; }
|
||||
.f7support-main { margin-top: 12px; width: 100%; }
|
||||
.f7-board {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
grid-template-columns: repeat(3, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
margin-top: 12px;
|
||||
align-items: stretch;
|
||||
width: 100%;
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
@media (max-width: 1100px) {
|
||||
.f7-board { grid-template-columns: 1fr; }
|
||||
}
|
||||
.f7-column {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
background: #fafafa;
|
||||
padding: 10px;
|
||||
min-height: 200px;
|
||||
padding: 12px;
|
||||
min-height: min(52vh, 560px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -339,8 +356,8 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
flex: 1;
|
||||
min-height: 160px;
|
||||
max-height: min(56vh, 520px);
|
||||
min-height: min(42vh, 420px);
|
||||
max-height: min(72vh, 820px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.f7-ticket-card {
|
||||
@@ -645,6 +662,8 @@
|
||||
const createModal = document.getElementById("create-ticket-modal");
|
||||
const chatModal = document.getElementById("chat-modal");
|
||||
|
||||
let clientChatDndBound = false;
|
||||
|
||||
bindClientChatDnDOnce();
|
||||
|
||||
function showError(message) {
|
||||
@@ -682,7 +701,6 @@
|
||||
updatePendingFileUi();
|
||||
}
|
||||
|
||||
let clientChatDndBound = false;
|
||||
function bindClientChatDnDOnce() {
|
||||
if (clientChatDndBound) return;
|
||||
clientChatDndBound = true;
|
||||
|
||||
Reference in New Issue
Block a user