Skip to content

Commit

Permalink
Merge pull request #327 from mantlenetworkio/bugfix/token-orderby
Browse files Browse the repository at this point in the history
#326 fix: count of transaction is wrong by websocket
  • Loading branch information
Jaycelv authored Jul 23, 2023
2 parents 885c8a7 + 50227da commit 1f36da9
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion apps/block_scout_web/assets/js/lib/history_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class MarketHistoryChart {
}

this.numTransactions = {
label: window.localized['Tx/day'],
label: window.localized['Tx/Day'],
yAxisID: 'numTransactions',
data: [],
cubicInterpolationMode: 'monotone',
Expand Down
6 changes: 5 additions & 1 deletion apps/block_scout_web/assets/js/pages/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,14 @@ const elements = {
JSON.stringify(state.transactionStats)
)
) {
let num = 0;
if(state.transactionStats && state.transactionStats.length > 1){
num = state.transactionStats[1].number_of_transactions
}
$el
.empty()
.append(
numeral(state.transactionStats[0].number_of_transactions).format(
numeral(num).format(
'0,0'
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ defmodule BlockScoutWeb.ChainController do

chart_config = Application.get_env(:block_scout_web, :chart_config, %{})

today = Date.utc_today()
latest = Date.add(today, -1)
x_days_back = Date.add(latest, 0)
Logger.info("------------")
Logger.info("#{inspect(latest)}")
Logger.info("#{inspect(x_days_back)}")

render(
conn,
"show.html",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,6 @@
<span class="dashboard-banner-chart-legend-value" data-selector="tx_per_day">
<% num_of_transactions = BlockScoutWeb.Cldr.Number.to_string!(Enum.at(@transaction_stats, 0).number_of_transactions, format: "#,###") %>
<%= num_of_transactions %>
<% gas_used = Enum.at(@transaction_stats, 0).gas_used %>
<%= if gas_used && gas_used > 0 do %>
<span
data-toggle="tooltip"
data-placement="top"
data-html="true"
data-template="<div class='tooltip tooltip-inversed-color tooltip-gas-usage' role='tooltip'><div class='arrow'></div><div class='tooltip-inner'></div></div>"
title="<div class='custom-tooltip-header'>Gas used</div><div class='custom-tooltip-description'><b><%= BlockScoutWeb.Cldr.Number.to_string!(gas_used, format: "#,###") %><b></div>">
<i style="color: #ffffff;" class="fa fa-info-circle ml-1"></i>
</span>
<% end %>
</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'Market Cap': '<%= gettext("Market Cap") %>',
'Price': '<%= gettext("Price") %>',
'Ether': '<%= Explorer.coin_name() %>',
'Tx/day': '<%= gettext("Tx/day") %>'
'Tx/Day': '<%= gettext("Tx/Day") %>'
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion apps/block_scout_web/priv/gettext/default.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3464,7 +3464,7 @@ msgstr ""

#: lib/block_scout_web/templates/layout/app.html.eex:50
#, elixir-autogen
msgid "Tx/day"
msgid "Tx/Day"
msgstr ""

#: lib/block_scout_web/templates/verified_contracts/index.html.eex:60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3468,7 +3468,7 @@ msgstr ""

#: lib/block_scout_web/templates/layout/app.html.eex:50
#, elixir-autogen
msgid "Tx/day"
msgid "Tx/Day"
msgstr ""

#: lib/block_scout_web/templates/verified_contracts/index.html.eex:60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3479,7 +3479,7 @@ msgstr "ツイッター"

#: lib/block_scout_web/templates/layout/app.html.eex:50
#, elixir-autogen
msgid "Tx/day"
msgid "Tx/Day"
msgstr "一日あたり Tx"

#: lib/block_scout_web/templates/verified_contracts/index.html.eex:60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3477,7 +3477,7 @@ msgstr "트위터"

#: lib/block_scout_web/templates/layout/app.html.eex:50
#, elixir-autogen
msgid "Tx/day"
msgid "Tx/Day"
msgstr "일일 Tx"

#: lib/block_scout_web/templates/verified_contracts/index.html.eex:60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3483,7 +3483,7 @@ msgstr "Твиттер"

#: lib/block_scout_web/templates/layout/app.html.eex:50
#, elixir-autogen
msgid "Tx/day"
msgid "Tx/Day"
msgstr "Тх / день"

#: lib/block_scout_web/templates/verified_contracts/index.html.eex:60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3479,7 +3479,7 @@ msgstr "推特"

#: lib/block_scout_web/templates/layout/app.html.eex:50
#, elixir-autogen
msgid "Tx/day"
msgid "Tx/Day"
msgstr "每日交易量"

#: lib/block_scout_web/templates/verified_contracts/index.html.eex:60
Expand Down

0 comments on commit 1f36da9

Please sign in to comment.