✨ Улучшена обработка IP-адресов и добавлены стили для мобильных устройств
- Обновлена функция получения IP-адреса клиента с учетом различных заголовков и удалением порта из IPv6 и IPv4 адресов. - Добавлены стили для кнопок и интерактивных элементов, чтобы убрать выделение при нажатии на мобильных устройствах.
This commit is contained in:
parent
bfa15465f8
commit
dd2a6cfa1a
13
.continue/agents/new-config.yaml
Normal file
13
.continue/agents/new-config.yaml
Normal file
@ -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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
|
||||
10
.continue/mcpServers/new-mcp-server.yaml
Normal file
10
.continue/mcpServers/new-mcp-server.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
name: New MCP server
|
||||
version: 0.0.1
|
||||
schema: v1
|
||||
mcpServers:
|
||||
- name: New MCP server
|
||||
command: npx
|
||||
args:
|
||||
- -y
|
||||
- <your-mcp-server>
|
||||
env: {}
|
||||
@ -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;
|
||||
|
||||
21
server.js
21
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;
|
||||
}
|
||||
|
||||
// Миграции базы данных
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user