CloudHub Portal

Enter Admin Secret Key to access node command dashboard

{{ activeTab === 'positions' || activeTab === 'orders' ? 'TradePanel' : activeTab }}

Total Nodes
{{ snapshot.nodes ? snapshot.nodes.length : 0 }}
Accounts Linked
{{ snapshot.accounts ? snapshot.accounts.length : 0 }}
Active Bots
{{ snapshot.user_bots ? snapshot.user_bots.filter(b => b.status === 'active').length : 0 }}
Total Float
{{ totalFloatProfit >= 0 ? '+' : '' }}{{ Math.abs(totalFloatProfit).toFixed(1) }}$

VPS Fleet Summary

{{ node.node_name }}
{{ node.ip_address }}
{{ node.status }}

Latest Accounts

{{ acc.account_number }} ({{ acc.broker || 'Broker' }})
${{ Number(acc.balance || 0).toLocaleString() }}
{{ acc.status || 'Offline' }}
Account Trade: {{ snapshot.accounts ? snapshot.accounts.length : 0 }} Float: {{ totalFloatProfit.toFixed(1) }}$
Owner Balance Order Status ID Server Name DailyMax Actions
{{ acc.owner || acc.users_profiles?.username || 'trader' }}
Trader
Balance ${{ Number(acc.balance || 0).toLocaleString() }}
Float ({{ acc.balance ? (getFloatProfit(acc) / Number(acc.balance) * 100).toFixed(1) : '0.0' }}%) {{ getFloatProfit(acc).toFixed(1) }}$
Equity ${{ Number(acc.equity || 0).toLocaleString() }}
{{ acc.positions || 0 }} Pos {{ acc.pending_orders || 0 }} Ord
{{ acc.node_name }}
{{ acc.account_number }} {{ acc.mt5_server }}
{{ acc.role || 'Client' }} {{ acc.account_name || 'Trader MT5 Basic' }}
Profit: ${{ acc.daily_profit_limit || 500 }} Loss: ${{ acc.daily_loss_limit || 150 }}
No trading accounts linked yet

TradeCopy Configuration

Status Balance Order ID Server Owner Copy Mode Daily Limit Time Limit Filter Actions
CP:
BP:
Balance ${{ (snapshot.accounts.find(a => a.id === copy.client_account_id)?.balance || 0).toLocaleString() }}
Float {{ (snapshot.accounts.find(a => a.id === copy.client_account_id)?.floating_profit || 0) >= 0 ? '+' : '' }}${{ (snapshot.accounts.find(a => a.id === copy.client_account_id)?.floating_profit || 0).toLocaleString() }}
Equity ${{ (snapshot.accounts.find(a => a.id === copy.client_account_id)?.equity || 0).toLocaleString() }}
N/A
{{ getCopyPositionsCount(copy) }} Pos {{ getCopyOrdersCount(copy) }} Ord
N/A
M #{{ snapshot.accounts.find(a => a.id === copy.master_account_id)?.account_number || ('Account #' + copy.master_account_id) }}
C #{{ snapshot.accounts.find(a => a.id === copy.client_account_id)?.account_number || ('Account #' + copy.client_account_id) }}
M: {{ snapshot.accounts.find(a => a.id === copy.master_account_id)?.account_name || 'master' }}
C: {{ snapshot.accounts.find(a => a.id === copy.client_account_id)?.account_name || 'trader' }}
Multiplier Mode {{ copy.lot_ratio }}x Lot Ratio
Max Profit: {{ copy.max_profit_limit ? '+$' + copy.max_profit_limit : 'Unlimited' }}
Max Loss: {{ copy.max_loss_limit ? '-$' + copy.max_loss_limit : 'Unlimited' }}
T1: {{ copy.time_limit_start || '00:00' }} - {{ copy.time_limit_end || '23:59' }}
T2: {{ copy.time_limit_start_2 || '00:00' }} - {{ copy.time_limit_end_2 || '23:59' }}
Symbols: {{ copy.allowed_symbols || '*' }}
Magics: {{ copy.allowed_magics || '*' }}
No copy relationships configured
Total Position: {{ snapshot.positions ? snapshot.positions.length : 0 }} : {{ totalFloatProfit >= 0 ? '+' : '' }}${{ totalFloatProfit.toFixed(2) }}
Place Bulk Instant Position
Profit Type Symbol Volume Open SL TP Magic Comment Account ID Ticket Master Tkt Actions
${{ Number(pos.profit || 0).toFixed(2) }} {{ pos.type }} {{ pos.symbol }} {{ pos.volume }} {{ pos.open_price }} {{ pos.sl || '-' }} {{ pos.tp || '-' }} {{ pos.magic_number || '-' }} {{ pos.comment || '-' }} {{ pos.account_id }} #{{ pos.ticket }} {{ pos.master_ticket ? '#' + pos.master_ticket : '-' }}
No open positions detected in hot cache
Total Position: {{ snapshot.pending_orders ? snapshot.pending_orders.length : 0 }}
Place Bulk Grid Pending Order
Type Symbol Volume Open SL TP Life Magic Comment Account ID Ticket Master Tkt Actions
{{ ord.order_type || ord.type }} {{ ord.symbol }} {{ ord.volume }} {{ ord.price || ord.open_price }} {{ ord.sl || '-' }} {{ ord.tp || '-' }} {{ ord.life || '-' }} {{ ord.magic_number || ord.magic || '-' }} {{ ord.comment || '-' }} #{{ ord.account_id }} #{{ ord.ticket }} {{ ord.master_ticket ? '#' + ord.master_ticket : '-' }}
No pending orders detected in hot cache

EA Robot Repository (BotStore)

ID Name Platform Accounts Actions Description
#{{ bot.id }}
{{ bot.name }} v{{ bot.version }}
{{ bot.platform }} {{ snapshot.user_bots ? snapshot.user_bots.filter(ub => ub.bot_id === bot.id).length : 0 }}
{{ bot.description || 'No description provided' }}
No EA robots in store
Bots Control: {{ snapshot.user_bots ? snapshot.user_bots.length : 0 }} -$129.50
Action Balance Order Bot Name Account Magiclabel Daily Limit Time Limit Status
EA:
BP:
Balance ${{ (ub.accounts?.balance || 12000).toLocaleString() }}
Float {{ (ub.float_profit || 150) >= 0 ? '+' : '' }}${{ (ub.float_profit || 150).toLocaleString() }}
Equity ${{ (ub.accounts?.equity || 12050).toLocaleString() }}
{{ ub.accounts?.positions || 2 }} Pos {{ ub.accounts?.pending_orders || 1 }} Ord
{{ ub.ea_robots?.name || 'iZScalper Gold' }} VPS: {{ ub.accounts?.node_name || 'Node-A1' }}
#{{ ub.accounts?.account_number || 'MT5-Admin-2' }} User: {{ ub.users_profiles?.username || 'admin' }}
#{{ ub.magic_number || '10101' }} {{ ub.bot_comment || 'iZScalper Gold Ran' }}
Target: +${{ ub.daily_profit_limit || 500 }}
Max Loss: -${{ ub.daily_loss_limit || 300 }}
Slot 1: 08:00-12:00
Slot 2: 14:00-18:00
{{ ub.status || 'ACTIVE' }}
No active bot sessions running in hot cache

VPS Node Control

Total Nodes
{{ snapshot.nodes ? snapshot.nodes.length : 0 }}
Active Nodes
{{ snapshot.nodes ? snapshot.nodes.filter(n => n.status === 'approved').length : 0 }}
Accounts Online
22 / 25
Node Info Resource Allocation & Usage Active/Total Status & Network Actions
{{ node.node_name }} {{ node.ip_address || 'N/A' }}
{{ node.os_version || 'Ubuntu 22.04 LTS' }}
Hub: {{ node.tunnel_domain }}
{{ node.telegram_token.length > 12 ? node.telegram_token.slice(0, 6) + '...' + node.telegram_token.slice(-6) : node.telegram_token }}
CPU ({{ node.cpu_cores || 2 }} Cores) {{ node.cpu_usage_pct ? Math.round(node.cpu_usage_pct) : 28 }}%
RAM ({{ node.ram_gb || 4 }} GB) {{ node.ram_usage_pct ? Math.round(node.ram_usage_pct) : 65 }}%
Disk ({{ node.hdd_gb || 50 }} GB) {{ node.hdd_usage_pct ? Math.round(node.hdd_usage_pct) : 35 }}%
MT4: {{ node.mt4_active || 0 }} / {{ node.mt4_total || 0 }}
MT5: {{ node.mt5_active || 0 }} / {{ node.mt5_total || 0 }}
cTrader: {{ node.ctrader_active || 0 }} / {{ node.ctrader_total || 0 }}
{{ node.status === 'online' ? 'ONLINE' : node.status === 'pending' ? 'PENDING' : node.status === 'disconnected' ? 'DISCONNECTED' : 'OFFLINE' }}
8 ms
Ping: 2:36:39 PM
No VPS nodes connected

AI Agent Manager

ID Agent Name Provider Model Name Status Actions
#{{ agent.id }}
{{ agent.name }} {{ agent.system_prompt || 'No system prompt' }}
{{ agent.provider }} {{ agent.model_name || 'N/A' }} {{ agent.status }}
No AI Agents configured

cTrader Connections Manager

Quản lý tài khoản cTrader

Tổng: {{ ctManagedAccounts.length }} Master: {{ ctMasterCount }} Slave: {{ ctSlaveCount }}
Tài khoản Login / cTID Loại kết nối Node Người sở hữu Vai trò Daily P/L Limit Trạng thái Thao tác
{{ acc.account_name || ('cTrader ' + acc.account_number) }} {{ acc.account_number }}
cTID: {{ acc.ctid_account_id }} MCP: {{ acc.mcp_server_id.slice(0,8) }}…
{{ acc.connection_type || '—' }} {{ acc.node_id || '—' }} {{ acc.owner || '—' }} {{ acc.role || 'Client' }} {{ acc.daily_profit_limit || 0 }} / {{ acc.daily_loss_limit || 0 }} {{ acc.connection_status || '—' }}
{{ acc.deploy_status }}
Chưa có tài khoản cTrader nào. Dùng phần Quét tài khoản bên dưới để Import.

cTrader OpenAPI

App Name Client ID Actions
{{ app.app_name }} {{ app.client_id }}
No OpenAPI Apps configured.
Hướng dẫn liên kết tài khoản (OAuth Callback)

Sau khi cấu hình App, truy cập URL sau để ủy quyền cho tài khoản giao dịch cTrader của bạn:

https://id.ctrader.com/my/settings/openapi/grantingaccess?client_id=[YOUR_CLIENT_ID]&redirect_uri=https%3A%2F%2Fhub.iz.life%2Foauth%2Fcallback&scope=trading&product=web&state=web_admin_[YOUR_APP_ID]
Đồng bộ tài khoản cTrader
Tài khoản cTrader OpenAPI Quét được:
{{ acc.account_number }} ({{ acc.broker }})
ID: {{ acc.ctid_account_id }}

cTrader MCP Servers

Server Name Endpoint URL Status Actions
{{ mcp.name }} {{ mcp.endpoint_url }}
No MCP Servers configured.
Đồng bộ tài khoản MCP
Tài khoản MCP Quét được:
{{ acc.account_number }} ({{ acc.broker }})
Số dư: {{ acc.balance }} {{ acc.currency }}

AppSettings & AI Agent Config

AI Agent Configuration

Database Connection & Sync

Supabase URL: {{ dbStatus.url || 'Đang tải...' }} API Key: {{ dbStatus.keyMask || 'Đang tải...' }} Trạng thái kết nối: {{ dbStatus.connectionStatus || 'Đang tải...' }} ({{ dbStatus.pingMs }}ms) Lệnh chưa sync (D1): {{ dbStatus.unsyncedTrades }} lệnh

Công cụ đồng bộ chủ động hai chiều giữa hệ thống lưu trữ gốc Supabase (TradeHub) và bộ nhớ đệm D1 (CloudHub).

Sync Supabase ➔ D1 (Pull) {{ pullStatus.state === 'success' ? 'Đã Mirror' : pullStatus.state === 'error' ? 'Lỗi' : 'Đang đồng bộ...' }}
Tải toàn bộ cấu hình accounts, bots, agents từ TradeHub về D1.
{{ pullStatus.message }}
⚠️ Lỗi: {{ pullStatus.error }}
Last sync: {{ pullStatus.lastUpdated }}
Sync D1 ➔ Supabase (Push) {{ pushStatus.state === 'success' ? 'Đã Mirror' : pushStatus.state === 'error' ? 'Lỗi' : 'Đang đồng bộ...' }}
Đẩy toàn bộ thay đổi và lịch sử lệnh mới phát sinh lên database Supabase.
{{ pushStatus.message }}
⚠️ Lỗi: {{ pushStatus.error }}
Last sync: {{ pushStatus.lastUpdated }}

cTrader OpenAPI Apps

App Name Client ID Accounts Tools Action
{{ app.app_name }} {{ app.client_id }} {{ snapshot.accounts.filter(acc => acc.platform === 'cTrader').length }} accs {{ snapshot.user_bots.filter(ub => ub.accounts?.platform === 'cTrader').length }} tools

MCP Servers

Name Provider Endpoint URL Accounts Tools Status Action
{{ mcp.name }} {{ mcp.provider || 'custom' }} {{ mcp.endpoint_url }} {{ snapshot.accounts.filter(acc => acc.mcp_server_id === mcp.id).length }} accs {{ (() => { try { return JSON.parse(mcp.supported_tools).length; } catch(e) { return 0; } })() }} tools -
Supabase: {{ dbStatus.connectionStatus || 'Offline' }} ({{ dbStatus.pingMs }}ms)
WS Active: 3 Connections: 22 / 25

Add Trading Account

Deploy Trade Account

VPS Node Configuration

Edit SL/TP

Modify Stop Loss (SL) and Take Profit (TP) for Ticket #{{ editForm.ticket }}.

{{ copyForm.id ? 'Edit Copy Relationship' : 'Add Copy Relationship' }}

to
to

{{ botForm.id ? 'Edit EA Robot' : 'Add EA Robot' }}

Nếu để "Tự động": .ex4/.ex5ea-bots, .mq4/.mq5/.cbotcodebase, .zipterminals. Platform = Terminal/Codebase cũng tự chọn thư mục tương ứng.

{{ ctAppForm.id ? 'Edit cTrader App' : 'Add cTrader App' }}

{{ mcpServerForm.id ? 'Edit MCP Server' : 'Add MCP Server' }}

Connect cTrader via OpenAPI

Connect cTrader via MCP Server

Chỉnh sửa tài khoản cTrader

{{ ctEditForm.account_name || ('cTrader ' + ctEditForm.account_number) }}
Login: {{ ctEditForm.account_number }} · cTID: {{ ctEditForm.ctid_account_id }}
{{ ctEditForm.connection_type || '—' }}
Node hiện tại: #{{ ctEditForm.node_id }}

Add VPS Node

{{ selectedAgent ? 'Edit AI Agent' : 'Add AI Agent' }}