diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 9e9bf7f3a..99a05c031 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -199,17 +199,16 @@ func QueryUserStaticDataPage(opts *UserBusinessAnalysisQueryOptions) ([]*UserBus } statictisSess.Limit(opts.PageSize, start) } - statictisSess.OrderBy("count_date desc") userBusinessAnalysisList := make([]*UserBusinessAnalysis, 0) - if err := statictisSess.Table("user_business_analysis").Where(cond). + if err := statictisSess.Table("user_business_analysis").Where(cond).OrderBy("count_date desc"). Find(&userBusinessAnalysisList); err != nil { return nil, 0 } resultMap := make(map[int64]*UserBusinessAnalysis) - if opts.Page >= 0 && opts.PageSize > 0 && len(userBusinessAnalysisList) > 0 { + if len(userBusinessAnalysisList) > 0 { var newAndCond = builder.NewCond() var newOrCond = builder.NewCond() for _, userRecord := range userBusinessAnalysisList { @@ -228,9 +227,8 @@ func QueryUserStaticDataPage(opts *UserBusinessAnalysisQueryOptions) ([]*UserBus builder.Lte{"count_date": opts.EndTime}, ) } - userBusinessAnalysisList = make([]*UserBusinessAnalysis, 0) - if err := statictisSess.Table("user_business_analysis").Where(newAndCond). + if err := statictisSess.Table("user_business_analysis").Where(newAndCond).OrderBy("count_date desc"). Find(&userBusinessAnalysisList); err != nil { return nil, 0 } diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index 60f3620ed..519077af2 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -314,6 +314,7 @@ func GetProjectLatestStatistics(ctx *context.Context) { Mode: mode, PR: pr, RelAvatarLink: contributor.RelAvatarLink, + Email: contributor.Email, } users = append(users, userInfo) diff --git a/routers/private/internal.go b/routers/private/internal.go index a3ea1c6cd..b029eedf9 100755 --- a/routers/private/internal.go +++ b/routers/private/internal.go @@ -44,9 +44,5 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/manager/flush-queues", bind(private.FlushOptions{}), FlushQueues) m.Post("/tool/update_all_repo_commit_cnt", UpdateAllRepoCommitCnt) m.Post("/tool/repo_stat", RepoStatisticManually) - m.Post("/tool/create_model", CreateModel) - m.Delete("/tool/delete_model", DeleteModel) - m.Get("/tool/show_model", ShowModel) - m.Put("/tool/modify_model", ModifyModel) }, CheckInternalToken) } diff --git a/routers/private/tool.go b/routers/private/tool.go index ef96c1d98..d05cd4c44 100755 --- a/routers/private/tool.go +++ b/routers/private/tool.go @@ -5,7 +5,6 @@ package private import ( - "fmt" "net/http" "code.gitea.io/gitea/models" @@ -46,6 +45,7 @@ func RepoStatisticManually(ctx *macaron.Context) { repo.TimingCountDataByDate(date) } +/* func CreateModel(ctx *macaron.Context) { JobId := ctx.Query("JobId") VersionName := ctx.Query("VersionName") @@ -88,3 +88,4 @@ func ModifyModel(ctx *macaron.Context) { ctx.JSON(500, "Failed.") } } +*/ diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 1143c01bc..556da9010 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -25,7 +25,7 @@ const ( MODEL_NOT_LATEST = 0 ) -func SaveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, userId int64) error { +func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, userId int64) error { aiTask, err := models.GetCloudbrainByJobIDAndVersionName(jobId, versionName) //aiTask, err := models.GetCloudbrainByJobID(jobId) if err != nil { @@ -110,7 +110,7 @@ func SaveModel(ctx *context.Context) { label := ctx.Query("Label") description := ctx.Query("Description") - err := SaveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID) + err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID) if err != nil { log.Info("save model error." + err.Error()) diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 5c701eadb..530d4dc94 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -49,13 +49,13 @@ func QueryUserStaticDataPage(ctx *context.Context) { startTime = time.Now() endTime = time.Now() } else { - startTime, _ = time.Parse("2006-01-02", startDate) + startTime, _ = time.ParseInLocation("2006-01-02", startDate, time.Local) settingStartTime, _ := time.Parse("2006-01-02", setting.RadarMap.RecordBeginTime) if startTime.Unix() < settingStartTime.Unix() { startTime = settingStartTime startDate = settingStartTime.Format("2006-01-02") } - endTime, _ = time.Parse("2006-01-02", endDate) + endTime, _ = time.ParseInLocation("2006-01-02", endDate, time.Local) endTime = endTime.AddDate(0, 0, 1) isAll = false log.Info("startTime=" + fmt.Sprint(startTime.Unix()) + " endDate=" + fmt.Sprint(endTime.Unix())) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 2c16c1eb5..d5eede393 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -970,7 +970,10 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/create", reqRepoCloudBrainWriter, bindIgnErr(auth.CreateCloudBrainForm{}), repo.CloudBrainCreate) }, context.RepoRef()) m.Group("/modelmanage", func() { - m.Get("", reqRepoCloudBrainReader, repo.ShowModelPageInfo) + m.Post("/create_model", repo.SaveModel) + m.Delete("/delete_model", repo.DeleteModel) + m.Put("/modify_model", repo.ModifyModelInfo) + m.Get("/show_model", reqRepoCloudBrainReader, repo.ShowModelPageInfo) m.Group("/:ID", func() { m.Get("", reqRepoCloudBrainReader, repo.ShowSingleModel) m.Get("/downloadsingle", reqRepoCloudBrainReader, repo.DownloadSingleModelFile) diff --git a/web_src/js/components/DataAnalysis.vue b/web_src/js/components/DataAnalysis.vue index 4d771dbb1..931f10e36 100755 --- a/web_src/js/components/DataAnalysis.vue +++ b/web_src/js/components/DataAnalysis.vue @@ -7,10 +7,8 @@ 概览 -
概览.......
-
概览.......
-
概览.......
概览.......
-
概览.......
+
暂无内容.......
+ @@ -20,13 +18,13 @@ 项目分析 - + 用户分析 - + @@ -48,6 +46,7 @@ loading:true, loading1:true, isRouterAlive: true, + isRouterAlive1: true, isSecond:true, isThird:false, @@ -57,24 +56,20 @@ handleClick(tab, event){ if(tab.name=="second"){ this.reload() - //document.getElementById('usr').style.display="none" - //document.getElementById("pro").style.display='block' - - //this.$refs.ProAnalysis.getAllProList("all",7) this.isSecond = true this.isThird = false this.$refs.ProAnalysis.getAllProList("all",7) } if(tab.name=="third"){ - // document.getElementById('usr').style.display="block" - // document.getElementById("pro").style.display='none' - this.reload() + + this.reload1() this.isSecond = false this.isThird = true - this.$refs.UserAnalysis.resetPage() + this.$refs.UserAnalysis.getUpdateTime() this.$refs.UserAnalysis.getUserList("all_usr",7) + } @@ -84,6 +79,10 @@ reload () { this.isRouterAlive = false this.$nextTick(() => (this.isRouterAlive = true)) + }, + reload1 () { + this.isRouterAlive1 = false + this.$nextTick(() => (this.isRouterAlive1 = true)) } }, diff --git a/web_src/js/components/ProAnalysis.vue b/web_src/js/components/ProAnalysis.vue index 882f610a4..6371fa884 100755 --- a/web_src/js/components/ProAnalysis.vue +++ b/web_src/js/components/ProAnalysis.vue @@ -29,8 +29,13 @@
- - 下载报告 + + + + + 下载报告 + 下载报告 +
@@ -142,10 +147,12 @@
@@ -153,7 +160,7 @@