| @@ -891,9 +891,9 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time, | |||||
| //insert userMetrics table | //insert userMetrics table | ||||
| var useMetrics UserMetrics | var useMetrics UserMetrics | ||||
| useMetrics.CountDate = CountDate.Unix() | useMetrics.CountDate = CountDate.Unix() | ||||
| useMetrics.DataDate = DataDate | |||||
| statictisSess.Delete(&useMetrics) | statictisSess.Delete(&useMetrics) | ||||
| useMetrics.DataDate = DataDate | |||||
| useMetrics.ActivateRegistUser = getMapKeyStringValue("ActivateRegistUser", userMetrics) | useMetrics.ActivateRegistUser = getMapKeyStringValue("ActivateRegistUser", userMetrics) | ||||
| useMetrics.HasActivityUser = getMapKeyStringValue("HasActivityUser", userMetrics) | useMetrics.HasActivityUser = getMapKeyStringValue("HasActivityUser", userMetrics) | ||||
| useMetrics.RegistActivityUser = 0 | useMetrics.RegistActivityUser = 0 | ||||
| @@ -6,9 +6,10 @@ | |||||
| package private | package private | ||||
| import ( | import ( | ||||
| "code.gitea.io/gitea/routers/repo" | |||||
| "strings" | "strings" | ||||
| "code.gitea.io/gitea/routers/repo" | |||||
| "code.gitea.io/gitea/modules/log" | "code.gitea.io/gitea/modules/log" | ||||
| "code.gitea.io/gitea/modules/private" | "code.gitea.io/gitea/modules/private" | ||||
| "code.gitea.io/gitea/modules/setting" | "code.gitea.io/gitea/modules/setting" | ||||
| @@ -46,7 +47,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
| m.Post("/manager/flush-queues", bind(private.FlushOptions{}), FlushQueues) | m.Post("/manager/flush-queues", bind(private.FlushOptions{}), FlushQueues) | ||||
| m.Post("/tool/update_all_repo_commit_cnt", UpdateAllRepoCommitCnt) | m.Post("/tool/update_all_repo_commit_cnt", UpdateAllRepoCommitCnt) | ||||
| m.Post("/tool/repo_stat/:date", RepoStatisticManually) | m.Post("/tool/repo_stat/:date", RepoStatisticManually) | ||||
| m.Post("/tool/user_stat/:date", UserStatisticManually) | |||||
| m.Get("/tool/org_stat", OrgStatisticManually) | m.Get("/tool/org_stat", OrgStatisticManually) | ||||
| m.Post("/tool/update_repo_visit/:date", UpdateRepoVisit) | m.Post("/tool/update_repo_visit/:date", UpdateRepoVisit) | ||||
| m.Post("/task/history_handle/duration", repo.HandleTaskWithNoDuration) | m.Post("/task/history_handle/duration", repo.HandleTaskWithNoDuration) | ||||
| @@ -45,6 +45,11 @@ func RepoStatisticManually(ctx *macaron.Context) { | |||||
| repo.TimingCountDataByDate(date) | repo.TimingCountDataByDate(date) | ||||
| } | } | ||||
| func UserStatisticManually(ctx *macaron.Context) { | |||||
| date := ctx.Params("date") | |||||
| repo.TimingCountDataByDate(date) | |||||
| } | |||||
| func OrgStatisticManually() { | func OrgStatisticManually() { | ||||
| models.UpdateOrgStatistics() | models.UpdateOrgStatistics() | ||||
| } | } | ||||
| @@ -247,6 +247,7 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac | |||||
| mapInterface := make(map[string]interface{}) | mapInterface := make(map[string]interface{}) | ||||
| mapInterface["data"] = re | mapInterface["data"] = re | ||||
| mapInterface["count"] = count | mapInterface["count"] = count | ||||
| ctx.JSON(http.StatusOK, mapInterface) | ctx.JSON(http.StatusOK, mapInterface) | ||||
| } | } | ||||
| } | } | ||||
| @@ -303,6 +304,15 @@ func queryMetrics(ctx *context.Context, tableName string, startTime time.Time, e | |||||
| mapInterface := make(map[string]interface{}) | mapInterface := make(map[string]interface{}) | ||||
| mapInterface["data"] = result | mapInterface["data"] = result | ||||
| mapInterface["count"] = count | mapInterface["count"] = count | ||||
| if tableName == "public.user_business_analysis_yesterday" { | |||||
| mapInterface["datarecordbegintime"] = setting.RadarMap.RecordBeginTime | |||||
| if len(result) > 0 { | |||||
| dateTime := time.Unix(result[0].CountDate, 0) | |||||
| mapInterface["lastUpdatedTime"] = dateTime.Format("2006-01-02 15:04:05") | |||||
| } else { | |||||
| mapInterface["lastUpdatedTime"] = "" | |||||
| } | |||||
| } | |||||
| ctx.JSON(http.StatusOK, mapInterface) | ctx.JSON(http.StatusOK, mapInterface) | ||||
| } | } | ||||
| @@ -257,11 +257,11 @@ | |||||
| return days; | return days; | ||||
| }, | }, | ||||
| getUpdateTime(){ | getUpdateTime(){ | ||||
| this.$axios.get('../../api/v1/projectboard/project',{ | |||||
| this.$axios.get('../../api/v1//query_metrics_yesterday',{ | |||||
| params:this.params_pro | params:this.params_pro | ||||
| }).then((res)=>{ | }).then((res)=>{ | ||||
| this.recordBeginTime=res.data.recordBeginTime | |||||
| this.lastUpdatedTime=res.data.lastUpdatedTime | |||||
| this.recordBeginTime=res.datarecordbegintime | |||||
| this.lastUpdatedTime=res.lastUpdatedTime | |||||
| }) | }) | ||||
| }, | }, | ||||
| getUserList(type_val,index){ | getUserList(type_val,index){ | ||||