Commit Graph

14 Commits

Author SHA1 Message Date
Akizon77
fefdcee60d refactor: 更新Client相关逻辑,迁移旧版ClientInfo数据并优化模型 2025-05-29 17:29:02 +08:00
Akizon77
a9f2c7658d fix: 修复Session表的索引冲突并优化数据库清理逻辑 2025-05-27 16:21:56 +08:00
Akizon77
fb80e48010 feat: 添加数据库配置,支持MySQL,修改uuid类型为varchar(36),移除默认时间字段 2025-05-25 18:50:33 +08:00
Akizon77
6e65706a23 fix: 统一Record结构体字段名称以提高一致性 2025-05-15 20:33:11 +08:00
Akizon77
07ff3c1cfe fix: 修改Config结构体中的字段名称以提高一致性 2025-05-12 16:57:47 +08:00
Akizon77
544aada3b9 fix: #28 修改Settings时如果不包含全部信息会导致丢失数据 2025-05-12 16:41:34 +08:00
Akizon77
97c1be7cb3 feat: 显示Agent版本号 2025-05-06 22:04:11 +08:00
Akizon77
d0b94abeb5 feat: #11 添加Geoip,Custom CSS、JS 合并为CustomHead 2025-05-03 20:41:04 +08:00
Akizon77
07d69a6423 feat: 添加CROS相关的配置 2025-04-29 14:00:24 +08:00
Akizon77
70a41b78cc fix: 修复基础信息上报、ws上报 2025-04-28 21:58:54 +08:00
Akizon77
cbabab1a20 新增 Dockerfile
新增 chpasswd 指令强制修改密码
修改 数据库init移入到server块
重命名 history 包至 records
2025-04-27 23:17:22 +08:00
Akizon77
2c2c81953e 移除 远程配置下发。
修改 客户端基本属性逻辑。
修改 最新上报key改为uuid
新增 客户端命名
新增 历史记录数据库压缩。
新增 在线节点信息。
新增 公开API /api/nodes 显示客户端基础属性
2025-04-27 18:57:37 +08:00
Akizon77
c3172059ef 添加对 komari_common 模块的支持,重构客户端管理功能
- 在 `go.mod` 中引入 `komari_common` 模块并进行路径替换。
- 更新 `GetMe` 函数以使用用户 UUID 获取用户名。
- 在 `AddClient` 和 `EditClient` 函数中重构客户端配置的处理逻辑,使用 `komari_common.ClientConfig`。
- 优化报告上传和获取功能,确保数据处理逻辑一致性。
- 增强错误处理,确保在数据库操作中更好地捕获和处理异常。
2025-04-18 00:41:00 +08:00
Akizon77
9f7758f1da Refactor database structure and session management
- Removed legacy session management code from `session.go` and `sqlite3.go`.
- Introduced new `accounts` package for user and session management.
- Implemented GORM for database interactions, replacing raw SQL queries.
- Created models for `User`, `Session`, `Client`, `History`, and other entities.
- Added functions for creating, retrieving, and deleting sessions.
- Implemented automatic cleanup of old history records.
- Updated `main.go` to initialize the database and create a default admin account.
- Enhanced error handling and logging throughout the database operations.
2025-04-15 21:14:55 +08:00