|
|
@@ -98,7 +98,7 @@ func term(pingState *atomic.Bool) {
|
|
|
|
|
|
interruptLoop(&executing, &interrupted) // Ctrl+C卍
|
|
|
|
|
|
- printWelcome()
|
|
|
+ printWelcome(pingState)
|
|
|
|
|
|
line := liner.NewLiner()
|
|
|
defer line.Close()
|
|
|
@@ -252,7 +252,7 @@ func heartbeatLoop(pingState *atomic.Bool) {
|
|
|
}()
|
|
|
}
|
|
|
|
|
|
-func printWelcome() {
|
|
|
+func printWelcome(pingState *atomic.Bool) {
|
|
|
welcome := `
|
|
|
_ _ _ _ _ _ _ _
|
|
|
| \ | (_) | | | (_) | |
|
|
|
@@ -263,11 +263,18 @@ func printWelcome() {
|
|
|
|
|
|
══════════════════════════════════
|
|
|
云飞科技RTU远程运维终端
|
|
|
-══════════════════════════════════
|
|
|
提示: 输入'quit'命令, 退出终端
|
|
|
+══════════════════════════════════
|
|
|
`
|
|
|
fmt.Println(welcome)
|
|
|
- fmt.Println("id_", coupler.clientID)
|
|
|
+ fmt.Printf("客户端ID: %s\n", coupler.clientID)
|
|
|
+ state := ""
|
|
|
+ if pingState.Load() {
|
|
|
+ state = "已连接 ✅"
|
|
|
+ } else {
|
|
|
+ state = "未连接 ❌"
|
|
|
+ }
|
|
|
+ fmt.Printf("设备状态: %s\n\n", state)
|
|
|
}
|
|
|
|
|
|
func clearScreen() {
|