diff --git a/dashboard/ui/Dockerfile b/dashboard/ui/Dockerfile index 6b2b106..1042614 100644 --- a/dashboard/ui/Dockerfile +++ b/dashboard/ui/Dockerfile @@ -1,7 +1,7 @@ FROM node:20-alpine AS build WORKDIR /app -COPY package.json . -RUN npm install +COPY package.json package-lock.json . +RUN npm ci COPY . . RUN npm run build diff --git a/dashboard/ui/src/App.jsx b/dashboard/ui/src/App.jsx index 4bdac94..bad2b14 100644 --- a/dashboard/ui/src/App.jsx +++ b/dashboard/ui/src/App.jsx @@ -279,6 +279,7 @@ export default function App() { const [botStatus, setBotStatus] = useState({}); const [trades, setTrades] = useState([]); const [tradesTotal, setTradesTotal] = useState(0); + const [tradesPage, setTradesPage] = useState(0); const [daily, setDaily] = useState([]); const [candles, setCandles] = useState([]); @@ -291,7 +292,7 @@ export default function App() { api("/symbols"), api(`/stats${sym}`), api(`/position${sym}`), - api(`/trades${sym}${sym ? "&" : "?"}limit=50`), + api(`/trades${sym}${sym ? "&" : "?"}limit=50&offset=${tradesPage * 50}`), api(`/daily${sym}`), api(`/candles?symbol=${symRequired}&limit=96`), ]); @@ -315,7 +316,7 @@ export default function App() { } if (dRes?.daily) setDaily(dRes.daily); if (cRes?.candles) setCandles(cRes.candles); - }, [selectedSymbol]); + }, [selectedSymbol, tradesPage]); useEffect(() => { fetchAll(); @@ -460,7 +461,7 @@ export default function App() { padding: 4, width: "fit-content", }}> + + {tradesPage * 50 + 1}–{Math.min((tradesPage + 1) * 50, tradesTotal)} / {tradesTotal} + + + + )} )}