From cf7d7c8f5a7fb6a49d598f2ff3f9b077fa4b837f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=90=D0=BD=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BF=D0=BE=D0=B2?= Date: Sun, 17 Aug 2025 06:09:18 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20docker-compose.yml=20=D0=B8=20templates/in?= =?UTF-8?q?dex.html,=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?test=5Fws.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 1 + templates/index.html | 334 ++++++++++++++++++++++++++++++++----------- test_ws.py | 42 ------ 3 files changed, 252 insertions(+), 125 deletions(-) delete mode 100644 test_ws.py diff --git a/docker-compose.yml b/docker-compose.yml index dbf8d21..5516f9b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,7 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./snapshots:/app/snapshots + - ./:/app restart: unless-stopped user: 0:0 networks: diff --git a/templates/index.html b/templates/index.html index eaa0737..e022008 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1182,12 +1182,9 @@ footer{position:fixed;right:10px;bottom:10px;opacity:.6;font-size:11px}
@@ -1336,6 +1333,8 @@ footer{position:fixed;right:10px;bottom:10px;opacity:.6;font-size:11px} diff --git a/test_ws.py b/test_ws.py deleted file mode 100644 index 3558f12..0000000 --- a/test_ws.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -Простой тест WebSocket соединения -Автор: Сергей Антропов -Сайт: https://devops.org.ru -""" - -import asyncio -import websockets -import base64 - -async def test_websocket(): - """Тестирует WebSocket соединение""" - - # Параметры подключения - uri = "ws://localhost:9001/ws/logs/c90f6c8bfbb6?tail=10&token=YWRtaW46YWRtaW4%3D" - - print(f"🔍 Тестирование WebSocket соединения...") - print(f"URI: {uri}") - print("-" * 50) - - try: - async with websockets.connect(uri) as websocket: - print("✅ WebSocket соединение установлено") - - # Ждем сообщения - try: - async for message in websocket: - print(f"📨 Получено сообщение: {message[:200]}...") - break # Получаем только первое сообщение - except websockets.exceptions.ConnectionClosed: - print("❌ WebSocket соединение закрыто") - - except Exception as e: - print(f"❌ Ошибка WebSocket: {e}") - return False - - return True - -if __name__ == "__main__": - asyncio.run(test_websocket())