feat: improve UI/UX for exchange and model configuration

- Redesign ExchangeConfigModal with icon card selection grid
- Add step indicator for multi-step exchange configuration flow
- Redesign ModelConfigModal with icon card selection pattern
- Add KuCoin Futures exchange support with icon
- Fix IPv4 detection for IP whitelist display
This commit is contained in:
tinkle-community
2026-01-31 20:23:13 +08:00
parent e19e289c58
commit 40474d258c
4 changed files with 809 additions and 1248 deletions

View File

@@ -256,13 +256,14 @@ func (s *Server) handleGetServerIP(c *gin.Context) {
})
}
// getPublicIPFromAPI Get public IP via third-party API
// getPublicIPFromAPI Get public IP via third-party API (IPv4 only)
func getPublicIPFromAPI() string {
// Try multiple public IP query services
// Try multiple public IP query services (IPv4-only endpoints)
services := []string{
"https://api.ipify.org?format=text",
"https://icanhazip.com",
"https://ifconfig.me",
"https://api4.ipify.org?format=text", // IPv4 only
"https://ipv4.icanhazip.com", // IPv4 only
"https://v4.ident.me", // IPv4 only
"https://api.ipify.org?format=text", // May return IPv4 or IPv6
}
client := &http.Client{
@@ -284,8 +285,9 @@ func getPublicIPFromAPI() string {
}
ip := strings.TrimSpace(string(body[:n]))
// Verify if it's a valid IP address
if net.ParseIP(ip) != nil {
parsedIP := net.ParseIP(ip)
// Verify if it's a valid IPv4 address (not containing ":")
if parsedIP != nil && parsedIP.To4() != nil {
return ip
}
}