fix: dashboard affiche la version dynamique ({{VERSION}})
CI / test (push) Successful in 2m33s

dashboard.html utilise {{VERSION}}, remplacé par server.v au chargement
via const version de main.v. Plus besoin de maj manuelle du HTML.
This commit is contained in:
2026-08-03 17:24:14 -04:00
parent adcb1945b8
commit 5d0db9478c
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ footer{text-align:center;padding:24px;color:#475569;font-size:.75rem}
</div> </div>
</div> </div>
</div> </div>
<footer>ntfy-bridge v0.1.0 · Homelab Notification Hub</footer> <footer>ntfy-bridge {{VERSION}} · Homelab Notification Hub</footer>
<script> <script>
function switchTab(name) { function switchTab(name) {
+2 -1
View File
@@ -85,10 +85,11 @@ pub fn new_app(cfg Config, config_path string, quiet bool) App {
fn load_dashboard_html(logger Logger) string { fn load_dashboard_html(logger Logger) string {
// Try dashboard.html from current working directory // Try dashboard.html from current working directory
if os.exists('dashboard.html') { if os.exists('dashboard.html') {
content := os.read_file('dashboard.html') or { mut content := os.read_file('dashboard.html') or {
logger.warn('server', 'dashboard', 'failed to read dashboard.html, using fallback') logger.warn('server', 'dashboard', 'failed to read dashboard.html, using fallback')
return dashboard_fallback_html() return dashboard_fallback_html()
} }
content = content.replace('{{VERSION}}', 'v${version}')
logger.info('server', 'dashboard', 'loaded dashboard.html (${content.len} bytes)') logger.info('server', 'dashboard', 'loaded dashboard.html (${content.len} bytes)')
return content return content
} }