Hide indexing alert env var

pull/7360/head
Viktor Baranov 2 years ago
parent cdd243929f
commit b9f6a29cc6
  1. 2
      CHANGELOG.md
  2. 29
      apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex
  3. 2
      apps/block_scout_web/priv/gettext/default.pot
  4. 2
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  5. 3
      config/runtime.exs

@ -8,6 +8,8 @@
### Chore ### Chore
- [#7360](https://github.com/blockscout/blockscout/pull/7360) - Manage visibility of indexing progress alert
## 5.1.4-beta ## 5.1.4-beta
### Features ### Features

@ -70,22 +70,25 @@
<!-- --> <!-- -->
<% show_maintenance_alert = Application.get_env(:block_scout_web, BlockScoutWeb.Chain)[:show_maintenance_alert] %> <% show_maintenance_alert = Application.get_env(:block_scout_web, BlockScoutWeb.Chain)[:show_maintenance_alert] %>
<%= if show_maintenance_alert do %> <%= if show_maintenance_alert do %>
<div class="alert alert-warning text-center mb-0 p-3" data-selector="indexed-status"> <div class="alert alert-warning text-center mb-0 p-3">
<%= raw(System.get_env("MAINTENANCE_ALERT_MESSAGE")) %> <%= raw(System.get_env("MAINTENANCE_ALERT_MESSAGE")) %>
</div> </div>
<% end %> <% end %>
<% indexed_ratio_blocks = Chain.indexed_ratio_blocks() %> <% hide_indexing_progress_alert = Application.get_env(:indexer, :hide_indexing_progress_alert) %>
<% indexed_ratio = <%= unless hide_indexing_progress_alert do %>
case Chain.finished_indexing_from_ratio?(indexed_ratio_blocks) do <% indexed_ratio_blocks = Chain.indexed_ratio_blocks() %>
false -> indexed_ratio_blocks <% indexed_ratio =
_ -> Chain.indexed_ratio_internal_transactions() case Chain.finished_indexing_from_ratio?(indexed_ratio_blocks) do
end %> false -> indexed_ratio_blocks
<%= if not Chain.finished_indexing_from_ratio?(indexed_ratio) do %> _ -> Chain.indexed_ratio_internal_transactions()
<div class="alert alert-warning text-center mb-0 p-3" data-seindexed_ratiolector="indexed-status"> end %>
<%= render BlockScoutWeb.CommonComponentsView, "_loading_spinner.html" %> <%= if not Chain.finished_indexing_from_ratio?(indexed_ratio) do %>
<span data-indexed-ratio-blocks="<%= indexed_ratio_blocks %>" data-indexed-ratio="<%= indexed_ratio %>"></span> <div class="alert alert-warning text-center mb-0 p-3" data-seindexed_ratiolector="indexed-status">
<%= gettext("- We're indexing this chain right now. Some of the counts may be inaccurate.") %> <%= render BlockScoutWeb.CommonComponentsView, "_loading_spinner.html" %>
</div> <span data-indexed-ratio-blocks="<%= indexed_ratio_blocks %>" data-indexed-ratio="<%= indexed_ratio %>"></span>
<%= gettext("- We're indexing this chain right now. Some of the counts may be inaccurate.") %>
</div>
<% end %>
<% end %> <% end %>
<%= render BlockScoutWeb.LayoutView, "_topnav.html", current_user: Conn.get_session(@conn, :current_user), conn: @conn %> <%= render BlockScoutWeb.LayoutView, "_topnav.html", current_user: Conn.get_session(@conn, :current_user), conn: @conn %>

@ -81,7 +81,7 @@ msgstr ""
msgid ") may be added for each contract. Click the Add Library button to add an additional one." msgid ") may be added for each contract. Click the Add Library button to add an additional one."
msgstr "" msgstr ""
#: lib/block_scout_web/templates/layout/app.html.eex:87 #: lib/block_scout_web/templates/layout/app.html.eex:89
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "- We're indexing this chain right now. Some of the counts may be inaccurate." msgid "- We're indexing this chain right now. Some of the counts may be inaccurate."
msgstr "" msgstr ""

@ -81,7 +81,7 @@ msgstr ""
msgid ") may be added for each contract. Click the Add Library button to add an additional one." msgid ") may be added for each contract. Click the Add Library button to add an additional one."
msgstr "" msgstr ""
#: lib/block_scout_web/templates/layout/app.html.eex:87 #: lib/block_scout_web/templates/layout/app.html.eex:89
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgid "- We're indexing this chain right now. Some of the counts may be inaccurate." msgid "- We're indexing this chain right now. Some of the counts may be inaccurate."
msgstr "" msgstr ""

@ -395,7 +395,8 @@ config :indexer,
fetch_rewards_way: System.get_env("FETCH_REWARDS_WAY", "trace_block"), fetch_rewards_way: System.get_env("FETCH_REWARDS_WAY", "trace_block"),
memory_limit: ConfigHelper.indexer_memory_limit(), memory_limit: ConfigHelper.indexer_memory_limit(),
receipts_batch_size: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_BATCH_SIZE", 250), receipts_batch_size: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_BATCH_SIZE", 250),
receipts_concurrency: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_CONCURRENCY", 10) receipts_concurrency: ConfigHelper.parse_integer_env_var("INDEXER_RECEIPTS_CONCURRENCY", 10),
hide_indexing_progress_alert: ConfigHelper.parse_bool_env_var("INDEXER_HIDE_INDEXING_PROGRESS_ALERT")
config :indexer, Indexer.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_INDEXER") config :indexer, Indexer.Supervisor, enabled: !ConfigHelper.parse_bool_env_var("DISABLE_INDEXER")

Loading…
Cancel
Save