add wallet link

This commit is contained in:
aaron 2026-03-22 12:05:08 +08:00
parent 04783937df
commit 181e9500de

View File

@ -290,6 +290,27 @@
color: #ff4444;
}
/* 钱包地址 */
.wallet-link {
color: var(--accent);
text-decoration: none;
font-size: 14px;
font-weight: 500;
display: flex;
align-items: center;
gap: 6px;
transition: opacity 0.2s;
}
.wallet-link:hover {
opacity: 0.7;
text-decoration: underline;
}
.wallet-icon {
font-size: 16px;
}
/* 空状态 */
.empty-state {
padding: 60px 20px;
@ -458,6 +479,17 @@
<div class="stat-value">${{ formatNumber(account.total_margin_used) }}</div>
</div>
<div class="stat-card">
<div class="stat-label">钱包地址</div>
<div style="margin-top: 6px;">
<a :href="getHyperbotUrl(account.wallet_address)" target="_blank" class="wallet-link">
<span class="wallet-icon">🔗</span>
<span>{{ formatWalletAddress(account.wallet_address) }}</span>
</a>
</div>
<div class="stat-sub">Hyperliquid Bot</div>
</div>
<div class="stat-card">
<div class="stat-label">挂单数量</div>
<div class="stat-value">{{ orders.entry_orders + orders.tp_sl_orders }}</div>
@ -607,7 +639,8 @@
current_leverage: 0,
max_leverage: 10,
drawdown: 0,
circuit_breaker_threshold: 10
circuit_breaker_threshold: 10,
wallet_address: null
},
positions: [],
orders: {
@ -727,6 +760,17 @@
} catch (error) {
alert('取消失败: ' + error.message);
}
},
formatWalletAddress(address) {
if (!address) return 'N/A';
// 显示前6位和后4位中间用...省略
if (address.length <= 10) return address;
return `${address.substring(0, 6)}...${address.substring(address.length - 4)}`;
},
getHyperbotUrl(address) {
if (!address) return '#';
// Hyperliquid Bot 链接格式
return `https://hyperliquid.bot/hyperbot?address=${address}`;
}
},
async mounted() {