Add logging system #8

Merged
nathanwoodburn merged 4 commits from feat/logging into main 2025-09-11 15:19:26 +10:00
Showing only changes of commit eb6306bb83 - Show all commits

23
main.py
View File

@@ -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({