免费版:日志查询/部署管理/采集/用户管理/LDAP/设置;Pro(¥199 个人单实例永久 / ¥499 团队多实例永久): 日志分析、日志告警、智能运维(AI)、审计日志。 - 后端:HMAC-SHA256 离线许可码(签发 CLI / license --plan --edition --seats --customer --days; 永久=days 0),GET /system/license + POST activate;RequirePro 闸门挂 metrics/ai/audit; 过期自动回落免费;测试覆盖签发-校验/篡改/免费拒签 - 前端:菜单 Pro 项带锁标;四个 Pro 页面免费版渲染升级引导卡(功能清单+定价+页内激活); 设置页新增授权区(版本/席位/到期/激活入口);license 词典中英 - domains 注册提升到 main.tsx 全局(修复 license 命名空间在未引 domains 的页面显示裸键)
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// License Pro 授权(离线许可码激活;无许可 = 免费版)。
|
|
// Plan: free | pro;Edition: personal(单实例/社区) | team(多实例/商业)。
|
|
type License struct {
|
|
Plan string `json:"plan"` // free | pro
|
|
Edition string `json:"edition"` // personal | team
|
|
Seats int `json:"seats"` // 席位数(0 = 不限)
|
|
Instances int `json:"instances"` // 实例数上限(team 版;0 = 不限)
|
|
Customer string `json:"customer"` // 客户标识(发行时写入)
|
|
// ExpiresAt 0 = 永久;否则 Unix 秒
|
|
ExpiresAt int64 `json:"expiresAt"`
|
|
IssuedAt time.Time `json:"issuedAt"`
|
|
ActivatedAt time.Time `json:"activatedAt"`
|
|
}
|
|
|
|
func (l *License) Sanitized() map[string]interface{} {
|
|
if l == nil {
|
|
return map[string]interface{}{"plan": "free"}
|
|
}
|
|
expired := l.ExpiresAt > 0 && l.ExpiresAt < time.Now().Unix()
|
|
plan := l.Plan
|
|
if expired {
|
|
plan = "free"
|
|
}
|
|
return map[string]interface{}{
|
|
"plan": plan, "edition": l.Edition, "seats": l.Seats, "instances": l.Instances,
|
|
"customer": l.Customer, "expiresAt": l.ExpiresAt, "expired": expired,
|
|
}
|
|
}
|