-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robert Putt
authored and
Robert Putt
committed
Jul 2, 2024
1 parent
6d56740
commit 2edfd20
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% extends 'template_hyper.html' %} | ||
|
||
{% block title %}Wingbits{% endblock %} | ||
|
||
{% block body %} | ||
<div class="content"> | ||
<br/> | ||
<script src="https://unpkg.com/h3-js"></script> | ||
<h3 class="text-center mb-4">Wingbits Configuration</h3> | ||
|
||
<div class="row mb-4"> | ||
<div class="col-12 col-lg-6 mb-4 mb-lg-0"> | ||
<div class="card mb-0 h-100 table-responsive"> | ||
<table class="table dt-responsive nowrap m-md-2 w-auto"> | ||
<tr> | ||
<td><i class="uil uil-sign-alt"></i> Node Name</td> | ||
<td class="text-right">big-topaz-tuna</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<div class="col-12 col-lg-6 mb-4 mb-lg-0"> | ||
<div class="card mb-0 h-100 table-responsive"> | ||
<table class="table dt-responsive nowrap m-md-2 w-auto"> | ||
<tr> | ||
<td><span class="uil uil-wifi-router icon"></span> SDR Operational</td> | ||
<td class="text-right"><span class="uil uil-check-circle text-success"></span></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="text-center"> | ||
{% if diagnostics.last_updated %} | ||
<p>Last Updated: {{ diagnostics.last_updated }}</p> | ||
{% else %} | ||
<p>Last Updated: Never</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import logging | ||
import os | ||
import time | ||
|
||
from flask import Blueprint | ||
from flask import render_template | ||
|
||
from hm_pyhelper.logger import get_logger | ||
from hw_diag.utilities.auth import authenticate | ||
from hw_diag.utilities.auth import commercial_fleet_only | ||
from hw_diag.utilities.diagnostics import read_diagnostics_file | ||
from hw_diag.utilities.dashboard_registration import claim_miner_deeplink | ||
|
||
|
||
logging.basicConfig(level=os.environ.get("LOGLEVEL", "DEBUG")) | ||
|
||
LOGGER = get_logger(__name__) | ||
WINGBITS = Blueprint('WINGBITS', __name__) | ||
|
||
|
||
@WINGBITS.route('/wingbits') | ||
@authenticate | ||
@commercial_fleet_only | ||
def get_wingbits_dashboard(): | ||
diagnostics = read_diagnostics_file() | ||
claim_deeplink = claim_miner_deeplink() | ||
now = round(time.time()) | ||
|
||
return render_template( | ||
'wingbits.html', | ||
diagnostics=diagnostics, | ||
claim_deeplink=claim_deeplink, | ||
now=now | ||
) |