From 0be6746794fe6c35bfd93d4451cbd07d269833b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Sun, 8 Feb 2026 21:28:20 +0800 Subject: [PATCH] Add files via upload --- internal/app/app.go | 6 +++++- internal/config/config.go | 1 + web/static/css/style.css | 11 +++++++++++ web/templates/index.html | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/internal/app/app.go b/internal/app/app.go index cbabb619..34caccff 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -746,7 +746,11 @@ func setupRoutes( // 前端页面 router.GET("/", func(c *gin.Context) { - c.HTML(http.StatusOK, "index.html", nil) + version := app.config.Version + if version == "" { + version = "v1.0.0" + } + c.HTML(http.StatusOK, "index.html", gin.H{"Version": version}) }) } diff --git a/internal/config/config.go b/internal/config/config.go index 8d37e9eb..4ecbcd9a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -13,6 +13,7 @@ import ( ) type Config struct { + Version string `yaml:"version,omitempty" json:"version,omitempty"` // 前端显示的版本号,如 v1.3.3 Server ServerConfig `yaml:"server"` Log LogConfig `yaml:"log"` MCP MCPConfig `yaml:"mcp"` diff --git a/web/static/css/style.css b/web/static/css/style.css index 728aed57..f433429b 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -499,6 +499,17 @@ header { opacity: 0.85; } +.version-badge { + display: inline-block; + margin-left: 6px; + font-size: 0.6875rem; + font-weight: 400; + color: var(--text-muted); + letter-spacing: 0.02em; + vertical-align: 0.35em; + user-select: none; +} + .header-right { display: flex; align-items: center; diff --git a/web/templates/index.html b/web/templates/index.html index 61d5d383..77e4bc7a 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -32,9 +32,9 @@
AI 驱动的自动化安全测试平台