在页面底部增加Version,精简内容

This commit is contained in:
dushixiang committed 2025-12-30 22:42:15 +08:00
1 parent b984ff4dbb
commit f9e559be30
5 files changed
+7 -2

No files matched your search

+1
View File
@@ -62,6 +62,7 @@ type SystemConfig struct {
DefaultView string `json:"defaultView"` // 默认视图 grid | list
CustomCSS string `json:"customCSS"` // 自定义 CSS
CustomJS string `json:"customJS"` // 自定义 JS
Version string `json:"-"` // 系统版本
}
// AlertConfig 全局告警配置
+3
View File
@@ -8,6 +8,7 @@ import (
"github.com/dushixiang/pika/internal/models"
"github.com/dushixiang/pika/internal/repo"
"github.com/dushixiang/pika/pkg/version"
"github.com/dushixiang/pika/web"
"github.com/go-orz/cache"
"go.uber.org/zap"
@@ -117,6 +118,8 @@ func (s *PropertyService) GetSystemConfig(ctx context.Context) (*models.SystemCo
if err != nil {
return nil, fmt.Errorf("获取系统配置失败: %w", err)
}
// 设置系统版本
systemConfig.Version = version.Version
return &systemConfig, nil
}
+1
View File
@@ -12,6 +12,7 @@
SystemNameEn: "{{.SystemNameEn}}",
ICPCode: "{{.ICPCode}}",
DefaultView: "{{.DefaultView}}",
Version: "{{.Version}}",
};
</script>
</head>
+1 -2
View File
@@ -23,8 +23,7 @@ const PublicFooter = () => {
<Github className="h-3 w-3 group-hover:scale-110 transition-transform"/>
<span className="underline decoration-slate-400 dark:decoration-cyan-700 underline-offset-2">Pika Monitor</span>
</a>
<span className="text-slate-300 dark:text-cyan-900">|</span>
<span className="text-slate-500 dark:text-cyan-500/80 tracking-wider">保持洞察 · 稳定运行</span>
<span className="text-slate-500 dark:text-cyan-500/80 tracking-wider">{window.SystemConfig.Version}</span>
{/* ICP 备案号 */}
{icpCode && (
<>
+1
View File
@@ -7,6 +7,7 @@ declare global {
SystemNameEn: string;
ICPCode: string;
DefaultView: string;
Version: string;
};
}
}