Skip to content

Commit abe6c06

Browse files
committed
fix:修复相关实现
1 parent 64345ba commit abe6c06

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

ui/executor.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,18 @@ func (e *CommandExecutor) Execute(selectedOptions map[string]bool, language stri
122122
PrintCenteredTitle("System-Basic-Information", 82)
123123
}
124124
}
125-
// TODO: 需要实现BasicsAndSecurityCheck函数
126-
// _, _, basicInfo, securityInfo, _ = BasicsAndSecurityCheck(language, "ipv4", securityTestStatus)
127-
basicInfo = "基础信息检测功能待实现\n"
128-
securityInfo = "安全信息检测功能待实现\n"
125+
// 根据网络连接状态选择检测类型
126+
checkType := nt3Type
127+
if preCheck.Connected && preCheck.StackType == "DualStack" {
128+
_, _, basicInfo, securityInfo, _ = BasicsAndSecurityCheck(language, checkType, securityTestStatus)
129+
} else if preCheck.Connected && preCheck.StackType == "IPv4" {
130+
_, _, basicInfo, securityInfo, _ = BasicsAndSecurityCheck(language, "ipv4", securityTestStatus)
131+
} else if preCheck.Connected && preCheck.StackType == "IPv6" {
132+
_, _, basicInfo, securityInfo, _ = BasicsAndSecurityCheck(language, "ipv6", securityTestStatus)
133+
} else {
134+
_, _, basicInfo, securityInfo, _ = BasicsAndSecurityCheck(language, "", false)
135+
securityTestStatus = false
136+
}
129137
if basicStatus {
130138
fmt.Printf("%s", basicInfo)
131139
}

ui/ui_actions.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ func (ui *TestUI) onPresetChanged(preset string) {
1616
switch preset {
1717
case "1. 融合怪完全体(能测全测)":
1818
ui.setAllChecks(true)
19-
// 注意:原goecs.go的完全体不包括ping测试,ping仅在选项6和10或中国模式下启用
19+
// 注意:原goecs.go的完全体不包括三网ping测试,但包括TGDC和Web测试
2020
ui.PingCheck.Checked = false
21+
// 启用TGDC和主流网站PING测试(非中国模式下的默认行为)
22+
ui.PingTgdcCheck.Checked = true
23+
ui.PingWebCheck.Checked = true
2124
case "2. 极简版(系统+CPU+内存+磁盘+5测速节点)":
2225
ui.setAllChecks(false)
2326
ui.BasicCheck.Checked = true

0 commit comments

Comments
 (0)