Skip to content

Commit

Permalink
Pin a blockchain of interest on main page.
Browse files Browse the repository at this point in the history
  • Loading branch information
guydavis committed Jan 10, 2024
1 parent bbcc16f commit ed4ebcb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. The format
### Added
- Optionally launch `chia-exporter` [metrics endpoint](https://github.com/Chia-Network/chia-exporter) for Prometheus reporting if env var `chia_exporter=true` is set.
- Support for running Gigahorse containers on arm64 architectures such as Raspberry Pi.
- Main dashboard page can now be pinned (Pin Icon) to display only a blockchain of interest, rather than rotating through each in turn.
### Changed
- Optionally launch of Gigahorse recompute server when in harvester mode if env var `gigahorse_recompute_server=true` is set.
- Fix for Bladebit GPU plotting jobs taking a minute to display on Plotting page on job start. Should now be seconds only.
Expand Down
4 changes: 2 additions & 2 deletions scripts/forks/chia_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ else
echo "Installing Chia CUDA binaries on ${arch_name}..."
cd /tmp
if [[ "${arch_name}" == "x86_64" ]]; then
curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.4-rc2/chia-blockchain-cli_2.1.4rc2-1_amd64.deb
curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.4/chia-blockchain-cli_2.1.4-1_amd64.deb
apt-get install ./chia-blockchain-cli*.deb
else
curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.4-rc2/chia-blockchain-cli_2.1.4rc2-1_arm64.deb
curl -sLJO https://github.com/Chia-Network/chia-blockchain/releases/download/2.1.4/chia-blockchain-cli_2.1.4-1_arm64.deb
apt-get install ./chia-blockchain-cli*.deb
fi

Expand Down
11 changes: 9 additions & 2 deletions web/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,21 @@ def index():
workers = worker.load_worker_summary()
farm_summary = chia.load_farm_summary()
plotting = plotman.load_plotting_summary_by_blockchains(farm_summary.farms.keys())
selected_blockchain = farm_summary.selected_blockchain()
if request.args.get('selected_blockchain'):
# Check if user has pinned the view to a particular blockchain view on refresh, no rotate
selected_blockchain = request.args.get('selected_blockchain')
carousel_ride_enabled = False # Disable automatic carousel rotation on load
else: # Default is to rotate every 10 seconds
selected_blockchain = farm_summary.selected_blockchain()
carousel_ride_enabled = True # Enable automatic carousel rotation on load
chia.challenges_chart_data(farm_summary)
p.partials_chart_data(farm_summary)
stats.load_daily_diff(farm_summary)
stats.wallet_chart_data(farm_summary)
warnings.check_warnings(request.args)
return render_template('index.html', reload_seconds=120, farms=farm_summary.farms, \
plotting=plotting, workers=workers, global_config=gc, selected_blockchain=selected_blockchain)
plotting=plotting, workers=workers, global_config=gc, \
carousel_ride_enabled=carousel_ride_enabled, selected_blockchain=selected_blockchain)

@app.route('/chart')
def chart():
Expand Down
9 changes: 6 additions & 3 deletions web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% endwith %}
</div>

<div id="carouselExampleFade" class="carousel slide carousel-fade" data-bs-ride="carousel">
<div id="carouselExampleFade" class="carousel slide carousel-fade" {% if carousel_ride_enabled %} data-bs-ride="carousel" {% endif %}>
<div class="carousel-inner">
{% for blockchain in farms.keys()|sort(case_sensitive=False) %}
<div class="carousel-item {% if blockchain == selected_blockchain %} active {% endif %}" data-bs-interval="10000">
Expand All @@ -27,9 +27,12 @@
<div class="row align-items-md-stretch" style="margin-top:0px; margin-bottom:5px;">
<div class="col-md-12">
<div class="h-30 p-2 text-white bg-dark rounded-3">
<h4 class="text-center">{{ blockchain|capitalize }} - {{_('Expected Time to Win')}}:
<h2 class="text-center" style="margin-bottom: 0px">{{ blockchain|capitalize }} - {{_('Expected Time to Win')}}:
<span class="text-success">{{ farms[blockchain].expected_time_to_win }}</span>
</h4>
<a href="{{ url_for('index') }}?selected_blockchain={{blockchain}}" title="{{_('Pin Current Blockchain')}}">
<i class="fs-4 bi-pin"></i>
</a>
</h2>
</div>
</div>
</div>
Expand Down

0 comments on commit ed4ebcb

Please sign in to comment.