! RFACTOR TEMPLATE2

This commit is contained in:
Mateusz Gruszczyński
2025-02-28 16:28:13 +01:00
parent d0f1d25063
commit 85a37e4a78
2 changed files with 24 additions and 13 deletions

13
app.py
View File

@@ -427,6 +427,19 @@ def format_version(value):
return result
@app.template_global()
def bootstrap_alert_category(cat):
mapping = {
'error': 'danger',
'fail': 'danger',
'warning': 'warning',
'warn': 'warning',
'ok': 'success',
'success': 'success',
'info': 'info'
}
return mapping.get(cat.lower(), 'info')
def fetch_changelogs(force=False):
changelog_url = "https://mikrotik.com/download/changelogs"
current_date = datetime.utcnow()