diff --git a/doc/ui-mock.png b/doc/ui-mock.png index 6aac867..beeb651 100644 Binary files a/doc/ui-mock.png and b/doc/ui-mock.png differ diff --git a/src/GenTradeAgent/src/renderer/src/components/TradingDashboard.vue b/src/GenTradeAgent/src/renderer/src/components/TradingDashboard.vue index d0bf404..48ad9cd 100644 --- a/src/GenTradeAgent/src/renderer/src/components/TradingDashboard.vue +++ b/src/GenTradeAgent/src/renderer/src/components/TradingDashboard.vue @@ -69,10 +69,28 @@ const store = useStore() store.watch( (state) => state.currentOhlcv, (value) => { + console.log('change ohlcv') + console.log(value) candlestickSeries.setData(value) } ) +store.watch( + (state) => state.currentAsset, + () => { + console.log('change Asset') + candlestickSeries.setData(store.state.currentOhlcv) + } +) + +store.watch( + (state) => state.currentInterval, + () => { + console.log('change Interval') + candlestickSeries.setData(store.state.currentOhlcv) + } +) + const resizeHandler = () => { if (chartElement) { const dimensions = chartElement.getBoundingClientRect() diff --git a/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue b/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue index ca4237f..332d4a4 100644 --- a/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue +++ b/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue @@ -97,6 +97,7 @@ store.watch( ) const handleUpdateCurrentAsset = (value: string) => { + console.log('handleUpdateCurrentAsset:' + value) store.commit('updateCurrentAsset', value) } @@ -110,6 +111,31 @@ const handlerPingServer = () => { setTimeout(handlerPingServer, agentServer.pingInterval) } handlerPingServer() + +let isConnect = false +const onAssetFromServer = (retval) => { + optionsAsset.value.length = 0 + Object.keys(retval).forEach((item) => { + optionsAsset.value.push({ + label: item, + value: item + }) + }) +} + +store.watch( + (state) => state.serverLatency, + (value) => { + if (isConnect && value == -1) { + isConnect = false + } + + if (!isConnect && value != -1) { + isConnect = true + agentServer.get_assets(onAssetFromServer) + } + } +)