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:
+1
-1
@@ -95,7 +95,7 @@ footer{text-align:center;padding:24px;color:#475569;font-size:.75rem}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer>ntfy-bridge v0.1.0 · Homelab Notification Hub</footer>
|
||||
<footer>ntfy-bridge {{VERSION}} · Homelab Notification Hub</footer>
|
||||
|
||||
<script>
|
||||
function switchTab(name) {
|
||||
|
||||
@@ -85,10 +85,11 @@ pub fn new_app(cfg Config, config_path string, quiet bool) App {
|
||||
fn load_dashboard_html(logger Logger) string {
|
||||
// Try dashboard.html from current working directory
|
||||
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')
|
||||
return dashboard_fallback_html()
|
||||
}
|
||||
content = content.replace('{{VERSION}}', 'v${version}')
|
||||
logger.info('server', 'dashboard', 'loaded dashboard.html (${content.len} bytes)')
|
||||
return content
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user