diff --git a/backend/app/services/ssh_service.py b/backend/app/services/ssh_service.py index fb8d18a..49e0449 100644 --- a/backend/app/services/ssh_service.py +++ b/backend/app/services/ssh_service.py @@ -176,8 +176,8 @@ class SSHService: """清理终端控制字符和 More 分页标记,避免污染解析""" # 移除 ANSI 转义序列 output = re.sub(r'\x1b\[[0-9;]*[a-zA-Z]', '', output) - # 移除 ---- More ---- 行(含前后控制字符) - output = re.sub(r'---- More ----[^\n]*', '', output) + # 移除 ---- More ---- 标记(仅标记本身,保留同行后续设备数据) + output = re.sub(r'---- More ----', '', output) # 将独立的 \r(不跟 \n)替换为空,避免覆盖行内容 output = re.sub(r'\r(?!\n)', '', output) return output