feat: implement core backend for team owner management with SQLite, auto-add APIs, and a frontend owner list component.

This commit is contained in:
2026-01-30 20:20:35 +08:00
parent 3c5bb04d82
commit 10cda012af
6 changed files with 125 additions and 14 deletions

View File

@@ -119,19 +119,27 @@ func log(level, message, email, module string) {
color := ""
switch level {
case "info":
prefix = "INFO"
prefix = "INFO "
color = colorCyan
case "success":
prefix = "SUCCESS"
color = colorGreen
case "error":
prefix = "ERROR"
prefix = "ERROR "
color = colorRed
case "warning":
prefix = "WARN"
prefix = "WARN "
color = colorYellow
}
// 模块名固定宽度8字符
moduleStr := module
if len(moduleStr) < 8 {
moduleStr = moduleStr + strings.Repeat(" ", 8-len(moduleStr))
} else if len(moduleStr) > 8 {
moduleStr = moduleStr[:8]
}
// 如果是 Team 相关日志,消息使用 Team 颜色
msgColor := colorReset
if teamColor != "" {
@@ -139,15 +147,20 @@ func log(level, message, email, module string) {
}
if email != "" {
fmt.Printf("%s%s%s %s[%s]%s [%s] %s - %s%s%s\n",
// 截断长邮箱,保持对齐
emailDisplay := email
if len(emailDisplay) > 35 {
emailDisplay = emailDisplay[:32] + "..."
}
fmt.Printf("%s%s%s %s[%s]%s [%s] %s%s%s\n",
colorGray, timestamp, colorReset,
color, prefix, colorReset,
module, email, msgColor, message, colorReset)
moduleStr, msgColor, message, colorReset)
} else {
fmt.Printf("%s%s%s %s[%s]%s [%s] %s%s%s\n",
colorGray, timestamp, colorReset,
color, prefix, colorReset,
module, msgColor, message, colorReset)
moduleStr, msgColor, message, colorReset)
}
}