From ecba8adbf1cf5bd598e20a9ff461159d86eea809 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 15 Feb 2025 09:49:23 +0800 Subject: [PATCH] refactor(templates): Update template definition names for admin pages - Change template definition names from "Content" to specific page names - Modify layout.html to conditionally render templates based on page name - Ensure consistent template naming across admin page templates --- web/templates/admin/config.html | 2 +- web/templates/admin/layout.html | 8 +++++++- web/templates/admin/login.html | 2 +- web/templates/admin/metrics.html | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/web/templates/admin/config.html b/web/templates/admin/config.html index 7e2045e..7c60539 100644 --- a/web/templates/admin/config.html +++ b/web/templates/admin/config.html @@ -1,4 +1,4 @@ -{{define "Content"}} +{{define "config.html"}}

配置管理

diff --git a/web/templates/admin/layout.html b/web/templates/admin/layout.html index ddbff28..cde7a1e 100644 --- a/web/templates/admin/layout.html +++ b/web/templates/admin/layout.html @@ -22,7 +22,13 @@
- {{template .Content .}} + {{if eq .Content "login.html"}} + {{template "login.html" .}} + {{else if eq .Content "metrics.html"}} + {{template "metrics.html" .}} + {{else if eq .Content "config.html"}} + {{template "config.html" .}} + {{end}}
diff --git a/web/templates/admin/login.html b/web/templates/admin/login.html index c733211..d368823 100644 --- a/web/templates/admin/login.html +++ b/web/templates/admin/login.html @@ -1,4 +1,4 @@ -{{define "Content"}} +{{define "login.html"}}
diff --git a/web/templates/admin/metrics.html b/web/templates/admin/metrics.html index 6be15c0..76eaa56 100644 --- a/web/templates/admin/metrics.html +++ b/web/templates/admin/metrics.html @@ -1,4 +1,4 @@ -{{define "Content"}} +{{define "metrics.html"}}