Add real-time chart cards and explicit price labels with reload#12
Open
Add real-time chart cards and explicit price labels with reload#12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
BTCBRLwas showing a value in BRL but not indicating the unit).Description
templates/index.htmlwith a visiblecurrent-price-panel, a reload button and improved formatting of price labels using helpers likedetermineQuoteAssetFromSymbolandbuildCurrentPriceLabelso everyCurrent priceshows the quote asset (BRL, USDT, BTC, etc.).symbolDropdownAlpine component to exposecurrentPriceLabeland arefreshPrice()action, replacing the oldcurrentPriceTextbehavior and adding a small loading indicator.realTimeChartDashboardAlpine component intemplates/index.htmlthat provides a full-width “Add chart” card and allows creating multiple chart cards that poll every 5 seconds, maintain a sliding window of points (configurable window size), render a single highlighted latest point plus the history line, and let each card change period (1Y,3M,1M,1W,1D).internal/service/binance_historical_price_service.go, aBinanceHistoricalPriceServiceto fetch klines and computeminimum/maximumfor a period, exposed a new HTTP endpoint/binance/historyand extended server wiring (internal/httpserver/server.go,cmd/server/main.go) andNewServerto include and update the historical-price service.Testing
Current price (BRL)labels, the reload button, and add/remove real-time chart cards that update every 5 seconds.templates/index.html,internal/service/binance_historical_price_service.go,internal/httpserver/server.go, andcmd/server/main.gowere compiled into this change set.Codex Task