Add logging system #8
23
main.py
23
main.py
@@ -71,15 +71,6 @@ def index():
|
||||
if not os.path.exists(".git"):
|
||||
return render_template("index.html", account=account, plugins=plugins)
|
||||
|
||||
info = gitinfo.get_git_info()
|
||||
if info is None:
|
||||
return render_template("index.html", account=account, plugins=plugins)
|
||||
branch = info['refs']
|
||||
commit = info['commit']
|
||||
if commit != latestVersion(branch):
|
||||
logger.info("New version available")
|
||||
plugins += render_template('components/dashboard-alert.html', name='Update', output='A new version of FireWallet is available')
|
||||
|
||||
alerts = get_alerts(account)
|
||||
for alert in alerts:
|
||||
output_html = alert['output']
|
||||
@@ -1921,6 +1912,20 @@ def get_alerts(account:str) -> list:
|
||||
|
||||
alerts = []
|
||||
|
||||
info = gitinfo.get_git_info()
|
||||
if info is not None:
|
||||
branch = info['refs']
|
||||
commit = info['commit']
|
||||
if commit != latestVersion(branch):
|
||||
logger.info("New version available")
|
||||
alerts.append({
|
||||
"name": "Update Available",
|
||||
"output": f"A new version of FireWallet is available. <a href='https://git.woodburn.au/nathanwoodburn/firewalletbrowser/compare/{commit}...{branch}' target='_blank'>Changelog</a>."
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
# Check if the node is connected
|
||||
if not account_module.hsdConnected():
|
||||
alerts.append({
|
||||
|
||||
Reference in New Issue
Block a user