提交 a1140884 authored 作者: 陈泽健's avatar 陈泽健

feat(recorder): 远程桌面录制器分辨率调整 1600x900 → 1920x1080

上级 4f075df4
...@@ -130,7 +130,7 @@ class Settings: ...@@ -130,7 +130,7 @@ class Settings:
# Xvfb 虚拟桌面配置(有头模式远程桌面录制用) # Xvfb 虚拟桌面配置(有头模式远程桌面录制用)
# 容器内无物理 DISPLAY,有头模式通过 Xvfb 提供虚拟 X Server,再经 x11vnc + websockify 投流 noVNC # 容器内无物理 DISPLAY,有头模式通过 Xvfb 提供虚拟 X Server,再经 x11vnc + websockify 投流 noVNC
XVFB_DISPLAY: str = os.getenv("XVFB_DISPLAY", ":99") # Xvfb display XVFB_DISPLAY: str = os.getenv("XVFB_DISPLAY", ":99") # Xvfb display
XVFB_SCREEN: str = os.getenv("XVFB_SCREEN", "1600x900x24") # 分辨率 x 色深 XVFB_SCREEN: str = os.getenv("XVFB_SCREEN", "1920x1080x24") # 分辨率 x 色深
NOVNC_PORT: int = int(os.getenv("NOVNC_PORT", "6080")) # websockify 监听端口(noVNC 代理) NOVNC_PORT: int = int(os.getenv("NOVNC_PORT", "6080")) # websockify 监听端口(noVNC 代理)
# 目标机资源监控配置(SSH 方式采集被测系统资源) # 目标机资源监控配置(SSH 方式采集被测系统资源)
......
...@@ -67,7 +67,7 @@ def _start_xvfb_and_novnc() -> None: ...@@ -67,7 +67,7 @@ def _start_xvfb_and_novnc() -> None:
with _XVFB_LOCK: with _XVFB_LOCK:
display = settings.XVFB_DISPLAY # 如 :99 display = settings.XVFB_DISPLAY # 如 :99
screen = settings.XVFB_SCREEN # 如 1600x900x24 screen = settings.XVFB_SCREEN # 如 1920x1080x24
port = settings.NOVNC_PORT # 6080 port = settings.NOVNC_PORT # 6080
display_num = display.lstrip(":") display_num = display.lstrip(":")
x_socket = f"/tmp/.X11-unix/X{display_num}" x_socket = f"/tmp/.X11-unix/X{display_num}"
...@@ -645,7 +645,7 @@ class RecorderEngine: ...@@ -645,7 +645,7 @@ class RecorderEngine:
) )
session._context = session._browser.new_context( session._context = session._browser.new_context(
ignore_https_errors=True, ignore_https_errors=True,
viewport={"width": 1600, "height": 900}, viewport={"width": 1920, "height": 1080},
user_agent=fake_ua, user_agent=fake_ua,
locale="zh-CN", locale="zh-CN",
timezone_id="Asia/Shanghai", timezone_id="Asia/Shanghai",
......
...@@ -798,11 +798,11 @@ class TestXvfbNovnc: ...@@ -798,11 +798,11 @@ class TestXvfbNovnc:
from app.services import recorder_engine as re_mod from app.services import recorder_engine as re_mod
monkeypatch.setenv("XVFB_DISPLAY", ":99") monkeypatch.setenv("XVFB_DISPLAY", ":99")
monkeypatch.setenv("XVFB_SCREEN", "1600x900x24") monkeypatch.setenv("XVFB_SCREEN", "1920x1080x24")
monkeypatch.setenv("NOVNC_PORT", "6080") monkeypatch.setenv("NOVNC_PORT", "6080")
# 强制更新 settings 属性 # 强制更新 settings 属性
re_mod.settings.XVFB_DISPLAY = ":99" re_mod.settings.XVFB_DISPLAY = ":99"
re_mod.settings.XVFB_SCREEN = "1600x900x24" re_mod.settings.XVFB_SCREEN = "1920x1080x24"
re_mod.settings.NOVNC_PORT = 6080 re_mod.settings.NOVNC_PORT = 6080
# poll() 返回 None 代表进程存活运行中(返回 0 代表已退出) # poll() 返回 None 代表进程存活运行中(返回 0 代表已退出)
......
...@@ -57,7 +57,7 @@ services: ...@@ -57,7 +57,7 @@ services:
- TARGET_MONITOR_ENABLED=true - TARGET_MONITOR_ENABLED=true
# Xvfb 虚拟桌面(有头模式录制用) # Xvfb 虚拟桌面(有头模式录制用)
- XVFB_DISPLAY=:99 - XVFB_DISPLAY=:99
- XVFB_SCREEN=1600x900x24 - XVFB_SCREEN=1920x1080x24
- NOVNC_PORT=6080 - NOVNC_PORT=6080
volumes: volumes:
# 后端源码(更新后端只需重启容器,无需重建镜像) # 后端源码(更新后端只需重启容器,无需重建镜像)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论