feat: 完善后端并新增 Vue3 WebUI

后端:
- 修复登录校验、DB 并发(单例+WAL+纯Go sqlite)、会话密钥持久化等核心缺陷
- 新增 Timer CRUD/签到/手动触发、执行日志、仪表盘、驱动元数据等 API
- 统一驱动接口: 带 context 的执行器、真实错误返回、敏感字段掩码、连通性测试
- 补全钉钉执行器; Timer 触发/提醒去重; 配置支持默认值与环境变量覆盖

前端:
- Vite+Vue3+TS+Pinia+Element Plus, 由驱动元数据动态渲染配置表单
- 登录/仪表盘(倒计时环)/定时器/规则/账号/日志/设置页面, 支持暗色模式
- 主题色 #66ccff, 信号波纹 logo, go:embed 单二进制部署

构建: Dockerfile 增加前端构建阶段; 补充各驱动配置文档

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
mei
2026-07-26 22:19:41 +08:00
co-authored by Claude Fable 5
parent 89e8b7fd66
commit 79774070fc
110 changed files with 8936 additions and 849 deletions
+12 -31
View File
@@ -3,55 +3,36 @@ package github
import (
"context"
"encoding/json"
"log"
"fmt"
"github.com/google/go-github/v84/github"
"github.com/ssdomei232/goodBaby/handler/db"
"github.com/ssdomei232/goodBaby/model"
)
// 从 rule 中获取 GithubReposConfig 和 GithubAccount
func GetGithubReposAndAccountFromRule(rule *model.Rule) (*GithubReposConfig, *GithubAccount) {
// GetGithubReposAndAccountFromRule 从 rule 中获取 GithubReposConfig 和 GithubAccount
func GetGithubReposAndAccountFromRule(rule *model.Rule) (*GithubReposConfig, *GithubAccount, error) {
var githubReposConfig GithubReposConfig
if err := json.Unmarshal([]byte(rule.ConfigJson), &githubReposConfig); err != nil {
return nil, nil, fmt.Errorf("解析 GitHub 规则配置失败: %w", err)
}
var githubAccount GithubAccount
// 获取 GithubReposConfig
err := json.Unmarshal([]byte(rule.ConfigJson), &githubReposConfig)
if err != nil {
log.Printf("获取 GitHub 配置失败: %v", err)
return nil, nil
if err := db.LoadAccountConfig(rule.AccountID, &githubAccount); err != nil {
return nil, nil, err
}
// 获取 GithubAccount
gormDB, err := db.GetGormDB()
if err != nil {
log.Printf("获取 Gorm DB 失败: %v", err)
return nil, nil
}
err = gormDB.Where("id = ?", rule.AccountID).First(&githubAccount).Error
if err != nil {
log.Printf("获取 GitHub 账户失败: %v", err)
return nil, nil
}
return &githubReposConfig, &githubAccount
return &githubReposConfig, &githubAccount, nil
}
// 将仓库设置为 public
func SetRepositoryPublic(token, owner, repo string) error {
ctx := context.Background()
// 1. 初始化客户端
// SetRepositoryPublic 将仓库设置为 public
func SetRepositoryPublic(ctx context.Context, token, owner, repo string) error {
client := github.NewClient(nil).WithAuthToken(token)
// 2. 准备修改的参数
opts := &github.Repository{
Visibility: github.Ptr("public"),
}
// 3. 执行更新操作
_, _, err := client.Repositories.Edit(ctx, owner, repo, opts)
return err
}