mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 00:07:01 +08:00
feat(api): add server IP display for exchange whitelist configuration (#520)
Added functionality to display server public IP address for users to configure exchange API whitelists, specifically for Binance integration. Backend changes (api/server.go): - Add GET /api/server-ip endpoint requiring authentication - Implement getPublicIPFromAPI() with fallback to multiple IP services - Implement getPublicIPFromInterface() for local network interface detection - Add isPrivateIP() helper to filter private IP addresses - Import net package for IP address handling Frontend changes (web/): - Add getServerIP() API method in api.ts - Display server IP in ExchangeConfigModal for Binance - Add IP copy-to-clipboard functionality - Load and display server IP when Binance exchange is selected - Add i18n translations (en/zh) for whitelist IP messages: - whitelistIP, whitelistIPDesc, serverIPAddresses - copyIP, ipCopied, loadingServerIP User benefits: - Simplifies Binance API whitelist configuration - Shows exact server IP to add to exchange whitelist - One-click IP copy for convenience 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -291,6 +291,12 @@ export const translations = {
|
||||
viewGuide: 'View Guide',
|
||||
binanceSetupGuide: 'Binance Setup Guide',
|
||||
closeGuide: 'Close',
|
||||
whitelistIP: 'Whitelist IP',
|
||||
whitelistIPDesc: 'Binance requires adding server IP to API whitelist',
|
||||
serverIPAddresses: 'Server IP Addresses',
|
||||
copyIP: 'Copy',
|
||||
ipCopied: 'IP Copied',
|
||||
loadingServerIP: 'Loading server IP...',
|
||||
|
||||
// Error Messages
|
||||
createTraderFailed: 'Failed to create trader',
|
||||
@@ -758,6 +764,12 @@ export const translations = {
|
||||
viewGuide: '查看教程',
|
||||
binanceSetupGuide: '币安配置教程',
|
||||
closeGuide: '关闭',
|
||||
whitelistIP: '白名单IP',
|
||||
whitelistIPDesc: '币安交易所需要填写白名单IP',
|
||||
serverIPAddresses: '服务器IP地址',
|
||||
copyIP: '复制',
|
||||
ipCopied: 'IP已复制',
|
||||
loadingServerIP: '正在加载服务器IP...',
|
||||
|
||||
// Error Messages
|
||||
createTraderFailed: '创建交易员失败',
|
||||
|
||||
Reference in New Issue
Block a user