diff --git a/.continue/agents/new-config.yaml b/.continue/agents/new-config.yaml new file mode 100644 index 0000000..a1a43ed --- /dev/null +++ b/.continue/agents/new-config.yaml @@ -0,0 +1,13 @@ +# This is an example configuration file +# To learn more, see the full config.yaml reference: https://docs.continue.dev/reference + +name: Example Config +version: 1.0.0 +schema: v1 + +models: + - name: qwen/qwen3-235b-a22b:free + provider: openrouter + model: qwen/qwen3-235b-a22b:free + apiBase: https://openrouter.ai/api/v1 + apiKey: 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 diff --git a/.continue/mcpServers/new-mcp-server.yaml b/.continue/mcpServers/new-mcp-server.yaml new file mode 100644 index 0000000..0e32aa6 --- /dev/null +++ b/.continue/mcpServers/new-mcp-server.yaml @@ -0,0 +1,10 @@ +name: New MCP server +version: 0.0.1 +schema: v1 +mcpServers: + - name: New MCP server + command: npx + args: + - -y + - + env: {} diff --git a/public/style.css b/public/style.css index 258b6e6..4e57d1d 100644 --- a/public/style.css +++ b/public/style.css @@ -33,6 +33,24 @@ body { height: 1em; } +/* Убираем выделение при нажатии на кнопки на мобильных устройствах */ +button { + -webkit-tap-highlight-color: transparent; + -moz-tap-highlight-color: transparent; + tap-highlight-color: transparent; +} + +/* Применяем к другим интерактивным элементам */ +input[type="button"], +input[type="submit"], +input[type="reset"], +a, +div[role="button"] { + -webkit-tap-highlight-color: transparent; + -moz-tap-highlight-color: transparent; + tap-highlight-color: transparent; +} + iconify-icon { font-size: 16px; vertical-align: middle; diff --git a/server.js b/server.js index 1914f1c..940ab4d 100644 --- a/server.js +++ b/server.js @@ -292,14 +292,29 @@ function logAction(userId, actionType, details, ipAddress) { // Функция для получения IP-адреса клиента function getClientIP(req) { - return ( + // Проверяем различные заголовки, которые могут содержать внешний IP-адрес + // Приоритет: x-forwarded-for, x-real-ip, cf-connecting-ip (Cloudflare) + let ip = req.headers["x-forwarded-for"]?.split(",")[0].trim() || req.headers["x-real-ip"] || + req.headers["cf-connecting-ip"] || // Для Cloudflare + req.headers["x-forwarded-for"]?.split(",")[0].trim() || // Повтор для надежности + req.headers["x-cluster-client-ip"] || // Для кластеров req.connection?.remoteAddress || req.socket?.remoteAddress || req.connection?.socket?.remoteAddress || - "unknown" - ); + "unknown"; + + // Убираем порт из IPv6 адреса, если есть + if (ip.includes(":") && ip.split(":").length > 2) { + // Это IPv6 адрес, убираем порт + ip = ip.split(":").slice(0, -1).join(":").replace(/[[\]]/g, ""); + } else if (ip.includes(":")) { + // Это IPv4 адрес с портом, убираем порт + ip = ip.split(":")[0]; + } + + return ip; } // Миграции базы данных