From 1fcabc4dbf4b2cc3c4bc1a986d2b0d74eb143e5b Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 14:24:31 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 47 +++++++++++++++++++++-------------------- public/home/home.js | 4 ++-- templates/base/head_navbar.tmpl | 2 +- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d07e048bf..527bf6615 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -224,39 +224,39 @@ page_title=Explore Better AI page_small_title=OpenI AI development cooperation platform page_description=The one-stop collaborative development environment for AI field provides AI development pipeline integrating code development, data management, model debugging, reasoning and evaluation page_use=Use Now -page_only_dynamic=Show only open source project dynamics -page_recommend_org=Recommended organization -page_recommend_org_desc=These excellent organizations are using Qizhi AI to develop collaboration platforms; Your organization also wants to show here, -page_recommend_org_commit=Click here to submit -page_recommend_org_more=More organizations -page_recommend_repo=Recommended projects -page_recommend_repo_desc=Excellent AI project recommendation; Your project also wants to show here, -page_recommend_repo_commit=Click here to submit +page_only_dynamic=Only show the dynamics of open source projects +page_recommend_org=Recommended Organization +page_recommend_org_desc=These excellent organizations are using the OpenI AI Collaboration Platform for collaborative development of projects. To show your organization here, +page_recommend_org_commit=Click here to submit. +page_recommend_org_more=More Organizations +page_recommend_repo=Recommended Projects +page_recommend_repo_desc=Excellent AI projects recommendation. To show your project here, +page_recommend_repo_commit=Click here to submit. page_recommend_repo_go=. Click here page_recommend_repo_more=Project Square -page_dev_env=Collaborative development environment -page_dev_env_desc=The biggest difference between Qizhi AI collaborative development platform and traditional git platform is that it provides a collaborative development environment for AI development -page_dev_env_desc_title=Unified management of development elements +page_dev_env=Collaborative Development Environment +page_dev_env_desc=Provide a collaborative development environment for AI development, which is the biggest highlight that distinguishes the OpenI AI Collaboration Platform from other traditional Git platforms. +page_dev_env_desc_title=Unified Management of Development Elements page_dev_env_desc_desc=The platform provides four elements of AI development: unified management of model code, data set, model and execution environment -page_dev_env_desc1_title=Data collaboration and sharing -page_dev_env_desc1_desc=By uploading data sets in the project, many project members cooperate to complete data preprocessing; You can also establish a better model with community developers by setting the data as a public dataset -page_dev_env_desc2_title=Model management and sharing -page_dev_env_desc2_desc=Associate the model with the code version, adjust the model in different ways based on the code history version, and save the results; The trained model can be open and shared, so that more people can use the model to test and give feedback -page_dev_env_desc3_title=One configuration, multiple use -page_dev_env_desc3_desc=Provide execution environment sharing, one-time configuration and multiple use, reduce the threshold of model development, and avoid spending repeated time configuring complex environments -page_dev_yunlao=PengCheng Cloudbrain open source collaboration +page_dev_env_desc1_title=Data Collaboration and Sharing +page_dev_env_desc1_desc=By uploading data sets in the project, many project members cooperate to complete data preprocessing. You can also establish a better model with community developers by setting the data as a public dataset +page_dev_env_desc2_title=Model Management and Sharing +page_dev_env_desc2_desc=Associate the model with the code version, you can adjust the model in different ways based on the historical version of the code and save the results. The trained model can be open and shared, so that more people can use the model to test and give feedback +page_dev_env_desc3_title=Once Configuration, Multiple Reuse +page_dev_env_desc3_desc=Provide execution environment sharing, Once Configuration, Multiple Reuse. Lower the threshold of model development, and avoid spending repetitive time configuring complex environments +page_dev_yunlao=PengCheng Cloudbrain Open Source Collaboration page_dev_yunlao_desc1=The platform has been connected with Pengcheng Cloudbrain and can use the rich computing resources of Pengcheng Cloudbrain to complete AI development tasks -page_dev_yunlao_desc2=Pengcheng Cloudbrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure is composed of GPU server equipped with NVIDIA Tesla V100 and Atlas 900 AI cluster equipped with Kunpeng and shengteng processors -page_dev_yunlao_desc3=Developers can freely choose the corresponding computing resources according to the use requirements, and can test the adaptability, performance and stability of the model in different hardware environments -page_dev_yunlao_desc4=If your model needs more computing resources, you can also apply separately -page_dev_yunlao_apply=Separate apply +page_dev_yunlao_desc2=Pengcheng Cloudbrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure is composed of GPU server equipped with NVIDIA Tesla V100 and Atlas 900 AI cluster equipped with Kunpeng and Ascend processors +page_dev_yunlao_desc3=Developers can freely choose the corresponding computing resources according to their needs, and can test the adaptability, performance, stability of the model in different hardware environments. +page_dev_yunlao_desc4=If your model requires more computing resources, you can also apply for it separately. +page_dev_yunlao_apply=Apply Separately [explore] repos = Repositories select_repos = Select the project users = Users organizations = Organizations -images = CloudImages +images = Cloudbrain Mirror search = Search code = Code repo_no_results = No matching repositories found. @@ -2687,6 +2687,7 @@ error.unit_not_allowed = You are not allowed to access this repository section. head.community = Community head.project = Repositories head.openi = OpenI +head.openi.repo = OpenI Projects head.dataset = Datasets foot.council = Council foot.technical_committee = Technical Committee diff --git a/public/home/home.js b/public/home/home.js index 92eb86c1d..8274c3ebd 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -34,12 +34,12 @@ var swiperRepo = new Swiper(".homepro-list", { var output = document.getElementById("newmessage"); var socket = new WebSocket("ws://" + document.location.host + "/action/notification"); - +var messageQueue = []; socket.onopen = function () { + messageQueue = []; console.log("message has connected."); }; -var messageQueue = []; var maxSize = 20; var html =document.documentElement; var lang = html.attributes["lang"] diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index d1d40d1d6..d8d9d50f2 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -43,7 +43,7 @@ {{if .IsOperator}} {{.i18n.Tr "explore.data_analysis"}} {{end}} - {{.i18n.Tr "custom.head.openi"}} + {{.i18n.Tr "custom.head.openi.repo"}} {{else if .IsLandingPageHome}} From bae8d0a7920ddfb18e924d2282e35022f9477c8c Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 14:43:09 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/home.js | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index 8274c3ebd..d3c89427e 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -159,12 +159,12 @@ function getTime(UpdatedUnix,currentTime){ var seconds= leave3; if(hours == 0 && minutes == 0){ - return seconds + getRepoOrOrg(6,isZh); + return seconds + getRepoOrOrg(6,isZh,seconds); }else{ if(hours > 0){ - return hours + getRepoOrOrg(4,isZh); + return hours + getRepoOrOrg(4,isZh,hours); }else{ - return minutes + getRepoOrOrg(5,isZh); + return minutes + getRepoOrOrg(5,isZh,minutes); } } } @@ -267,18 +267,30 @@ var repoAndOrgZH={ "1":"项目", "2":"成员", "3":"团队", + "11":"项目", + "21":"成员", + "31":"团队", "4":"小时前", "5":"分钟前", - "6":"秒前" + "6":"秒前", + "41":"小时前", + "51":"分钟前", + "61":"秒前" }; var repoAndOrgEN={ - "1":"repository", - "2":"Members ", - "3":"Teams", - "4":" hours ago", - "5":" minutes ago", - "6":" seconds ago" + "1":"Repository", + "2":"Member ", + "3":"Team", + "11":"Repository", + "22":"Member ", + "31":"Team", + "4":" hour ago", + "5":" minute ago", + "6":" second ago", + "41":" hours ago", + "51":" minutes ago", + "61":" seconds ago" }; @@ -409,7 +421,10 @@ function displayRepo(json){ //var repoAndOrgEN = new Map([['1', "Repository"], ['2', "Members"], ['3', "Teams"]]); -function getRepoOrOrg(key,isZhLang){ +function getRepoOrOrg(key,isZhLang,numbers=1){ + if(numbers > 1){ + key+="1"; + } if(isZhLang){ return repoAndOrgZH[key]; }else{ @@ -430,7 +445,7 @@ function displayOrg(json){ html += " "; html += "
"; html += " " + record["Name"] + " " + record["FullName"]; - html += "
" + record["NumRepos"] +" " + getRepoOrOrg(1,isZh) + " ・ " + record["NumMembers"] +" " + getRepoOrOrg(2,isZh) + " ・ " + record["NumTeams"] + " " + getRepoOrOrg(3,isZh) + "
"; + html += "
" + record["NumRepos"] +" " + getRepoOrOrg(1,isZh,record["NumRepos"]) + " ・ " + record["NumMembers"] +" " + getRepoOrOrg(2,isZh,record["NumMembers"]) + " ・ " + record["NumTeams"] + " " + getRepoOrOrg(3,isZh,record["NumTeams"]) + "
"; html += "
"; html += " "; html += " "; From fbd2d5e559eeebf8a2975113806fe9816eb775e7 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 15:00:21 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 2 +- public/home/home.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 527bf6615..17f52814e 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -221,7 +221,7 @@ issues.in_your_repos = In your repositories contributors = Contributors page_title=Explore Better AI -page_small_title=OpenI AI development cooperation platform +page_small_title=OpenI AI Development Cooperation Platform page_description=The one-stop collaborative development environment for AI field provides AI development pipeline integrating code development, data management, model debugging, reasoning and evaluation page_use=Use Now page_only_dynamic=Only show the dynamics of open source projects diff --git a/public/home/home.js b/public/home/home.js index d3c89427e..bef54bbd4 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -282,9 +282,9 @@ var repoAndOrgEN={ "1":"Repository", "2":"Member ", "3":"Team", - "11":"Repository", - "22":"Member ", - "31":"Team", + "11":"Repositorys", + "22":"Members ", + "31":"Teams", "4":" hour ago", "5":" minute ago", "6":" second ago", From 382fe00563b77b60474580dab1e06e0dd9257ba0 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 15:09:30 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 17f52814e..1701df598 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -232,21 +232,21 @@ page_recommend_org_more=More Organizations page_recommend_repo=Recommended Projects page_recommend_repo_desc=Excellent AI projects recommendation. To show your project here, page_recommend_repo_commit=Click here to submit. -page_recommend_repo_go=. Click here -page_recommend_repo_more=Project Square +page_recommend_repo_go= Click here to +page_recommend_repo_more= explore more projects. page_dev_env=Collaborative Development Environment page_dev_env_desc=Provide a collaborative development environment for AI development, which is the biggest highlight that distinguishes the OpenI AI Collaboration Platform from other traditional Git platforms. page_dev_env_desc_title=Unified Management of Development Elements -page_dev_env_desc_desc=The platform provides four elements of AI development: unified management of model code, data set, model and execution environment +page_dev_env_desc_desc=The platform provides four elements of AI development: unified management of model code, data set, model and execution environment. page_dev_env_desc1_title=Data Collaboration and Sharing -page_dev_env_desc1_desc=By uploading data sets in the project, many project members cooperate to complete data preprocessing. You can also establish a better model with community developers by setting the data as a public dataset +page_dev_env_desc1_desc=By uploading data sets in the project, many project members cooperate to complete data preprocessing. You can also establish a better model with community developers by setting the data as a public dataset. page_dev_env_desc2_title=Model Management and Sharing -page_dev_env_desc2_desc=Associate the model with the code version, you can adjust the model in different ways based on the historical version of the code and save the results. The trained model can be open and shared, so that more people can use the model to test and give feedback +page_dev_env_desc2_desc=Associate the model with the code version, you can adjust the model in different ways based on the historical version of the code and save the results. The trained model can be open and shared, so that more people can use the model to test and give feedback. page_dev_env_desc3_title=Once Configuration, Multiple Reuse -page_dev_env_desc3_desc=Provide execution environment sharing, Once Configuration, Multiple Reuse. Lower the threshold of model development, and avoid spending repetitive time configuring complex environments +page_dev_env_desc3_desc=Provide execution environment sharing, Once Configuration, Multiple Reuse. Lower the threshold of model development, and avoid spending repetitive time configuring complex environments. page_dev_yunlao=PengCheng Cloudbrain Open Source Collaboration -page_dev_yunlao_desc1=The platform has been connected with Pengcheng Cloudbrain and can use the rich computing resources of Pengcheng Cloudbrain to complete AI development tasks -page_dev_yunlao_desc2=Pengcheng Cloudbrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure is composed of GPU server equipped with NVIDIA Tesla V100 and Atlas 900 AI cluster equipped with Kunpeng and Ascend processors +page_dev_yunlao_desc1=The platform has been connected with Pengcheng Cloudbrain and can use the rich computing resources of Pengcheng Cloudbrain to complete AI development tasks. +page_dev_yunlao_desc2=Pengcheng Cloudbrain's existing AI computing power is 100p FLOPS@FP16 (billions of half precision floating-point calculations per second), the main hardware infrastructure is composed of GPU server equipped with NVIDIA Tesla V100 and Atlas 900 AI cluster equipped with Kunpeng and Ascend processors. page_dev_yunlao_desc3=Developers can freely choose the corresponding computing resources according to their needs, and can test the adaptability, performance, stability of the model in different hardware environments. page_dev_yunlao_desc4=If your model requires more computing resources, you can also apply for it separately. page_dev_yunlao_apply=Apply Separately From 63e7dea4d4d217c579f21a7e848a9fcce294ec77 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 15:11:03 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1701df598..4ba5923e0 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -232,7 +232,7 @@ page_recommend_org_more=More Organizations page_recommend_repo=Recommended Projects page_recommend_repo_desc=Excellent AI projects recommendation. To show your project here, page_recommend_repo_commit=Click here to submit. -page_recommend_repo_go= Click here to +page_recommend_repo_go= Click here to page_recommend_repo_more= explore more projects. page_dev_env=Collaborative Development Environment page_dev_env_desc=Provide a collaborative development environment for AI development, which is the biggest highlight that distinguishes the OpenI AI Collaboration Platform from other traditional Git platforms. From 0ae935c5e58cd221991c9d8312b8e5ca5bf71667 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 15:14:19 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 4ba5923e0..793005d1a 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -233,7 +233,7 @@ page_recommend_repo=Recommended Projects page_recommend_repo_desc=Excellent AI projects recommendation. To show your project here, page_recommend_repo_commit=Click here to submit. page_recommend_repo_go= Click here to -page_recommend_repo_more= explore more projects. +page_recommend_repo_more= explore more projects. page_dev_env=Collaborative Development Environment page_dev_env_desc=Provide a collaborative development environment for AI development, which is the biggest highlight that distinguishes the OpenI AI Collaboration Platform from other traditional Git platforms. page_dev_env_desc_title=Unified Management of Development Elements From dd0b486bcbabfcea58805de7127b86c938c3f6b6 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 10 Jan 2022 15:17:36 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 4 ++-- templates/home.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 793005d1a..21890babe 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -232,8 +232,8 @@ page_recommend_org_more=More Organizations page_recommend_repo=Recommended Projects page_recommend_repo_desc=Excellent AI projects recommendation. To show your project here, page_recommend_repo_commit=Click here to submit. -page_recommend_repo_go= Click here to -page_recommend_repo_more= explore more projects. +page_recommend_repo_go=Click here to +page_recommend_repo_more=explore more projects. page_dev_env=Collaborative Development Environment page_dev_env_desc=Provide a collaborative development environment for AI development, which is the biggest highlight that distinguishes the OpenI AI Collaboration Platform from other traditional Git platforms. page_dev_env_desc_title=Unified Management of Development Elements diff --git a/templates/home.tmpl b/templates/home.tmpl index 3a1cca49e..2737afd54 100755 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -57,7 +57,7 @@

{{.page_recommend_repo}}

-

{{.page_recommend_repo_desc}}{{.page_recommend_repo_commit}}{{.page_recommend_repo_go}}{{.page_recommend_repo_more}}

+

{{.page_recommend_repo_desc}}{{.page_recommend_repo_commit}}{{.page_recommend_repo_go}} {{.page_recommend_repo_more}}

From 51836a5ddc87fa3cd41ff69f20042fd8a3f29dbd Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 11 Jan 2022 15:12:12 +0800 Subject: [PATCH 08/14] fix-1311 --- models/action.go | 4 ++-- services/socketwrap/clientManager.go | 31 +++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/models/action.go b/models/action.go index e2958821c..b9a0a603c 100755 --- a/models/action.go +++ b/models/action.go @@ -346,11 +346,11 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { return actions, nil } -func GetLast20PublicFeeds() ([]*Action, error) { +func GetLast20PublicFeeds(opTypes []int) ([]*Action, error) { cond := builder.NewCond() cond = cond.And(builder.Eq{"is_private": false}) cond = cond.And(builder.Eq{"is_deleted": false}) - + cond = cond.And(builder.In("op_type", opTypes)) actions := make([]*Action, 0, 20) diff --git a/services/socketwrap/clientManager.go b/services/socketwrap/clientManager.go index eeb496108..c59936581 100644 --- a/services/socketwrap/clientManager.go +++ b/services/socketwrap/clientManager.go @@ -10,6 +10,8 @@ import ( "github.com/elliotchance/orderedmap" ) +var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23} + type ClientsManager struct { Clients *orderedmap.OrderedMap Register chan *Client @@ -47,13 +49,15 @@ func (h *ClientsManager) Run() { close(client.Send) } case message := <-models.ActionChan: - LastActionsQueue.Push(message) - for _, client := range h.Clients.Keys() { - select { - case client.(*Client).Send <- message: - default: - close(client.(*Client).Send) - h.Clients.Delete(client) + if isInOpTypes(opTypes, message.OpType) { + LastActionsQueue.Push(message) + for _, client := range h.Clients.Keys() { + select { + case client.(*Client).Send <- message: + default: + close(client.(*Client).Send) + h.Clients.Delete(client) + } } } case s := <-sig: @@ -71,8 +75,19 @@ func (h *ClientsManager) Run() { } } +func isInOpTypes(types []int, opType models.ActionType) bool { + isFound := false + for _, value := range types { + if value == int(opType) { + isFound = true + break + } + } + return isFound +} + func initActionQueue() { - actions, err := models.GetLast20PublicFeeds() + actions, err := models.GetLast20PublicFeeds(opTypes) if err == nil { for i := len(actions) - 1; i >= 0; i-- { From 34189256f0fa9df7f2dc6b25113a7988df209d2a Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 11 Jan 2022 15:27:23 +0800 Subject: [PATCH 09/14] fix-1309 --- routers/repo/repo_statistic.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/routers/repo/repo_statistic.go b/routers/repo/repo_statistic.go index 11b421659..dce183f49 100755 --- a/routers/repo/repo_statistic.go +++ b/routers/repo/repo_statistic.go @@ -51,12 +51,14 @@ func RepoStatisticDaily(date string) { isInitMinMaxRadar := false + var error_projects = make([]string, 0) for _, repo := range repos { - log.Info("start statistic: %s", getDistinctProjectName(repo)) + projectName := getDistinctProjectName(repo) + log.Info("start statistic: %s", projectName) var numDevMonths, numWikiViews, numContributor, numKeyContributor, numCommitsGrowth, numCommitLinesGrowth, numContributorsGrowth, numCommits int64 repoGitStat, err := models.GetRepoKPIStats(repo) if err != nil { - log.Error("GetRepoKPIStats failed: %s", getDistinctProjectName(repo)) + log.Error("GetRepoKPIStats failed: %s", projectName) } else { numDevMonths = repoGitStat.DevelopAge numKeyContributor = repoGitStat.KeyContributors @@ -79,26 +81,26 @@ func RepoStatisticDaily(date string) { var numVersions int64 numVersions, err = models.GetReleaseCountByRepoID(repo.ID, models.FindReleasesOptions{}) if err != nil { - log.Error("GetReleaseCountByRepoID failed(%s): %v", getDistinctProjectName(repo), err) + log.Error("GetReleaseCountByRepoID failed(%s): %v", projectName, err) } var datasetSize int64 datasetSize, err = getDatasetSize(repo) if err != nil { - log.Error("getDatasetSize failed(%s): %v", getDistinctProjectName(repo), err) + log.Error("getDatasetSize failed(%s): %v", projectName, err) } var numComments int64 numComments, err = models.GetCommentCountByRepoID(repo.ID) if err != nil { - log.Error("GetCommentCountByRepoID failed(%s): %v", getDistinctProjectName(repo), err) + log.Error("GetCommentCountByRepoID failed(%s): %v", projectName, err) } beginTime, endTime := getStatTime(date) var numVisits int numVisits, err = repository.AppointProjectView(repo.OwnerName, repo.Name, beginTime, endTime) if err != nil { - log.Error("AppointProjectView failed(%s): %v", getDistinctProjectName(repo), err) + log.Error("AppointProjectView failed(%s): %v", projectName, err) } repoStat := models.RepoStatistic{ @@ -162,9 +164,10 @@ func RepoStatisticDaily(date string) { } if _, err = models.InsertRepoStat(&repoStat); err != nil { - log.Error("InsertRepoStat failed(%s): %v", getDistinctProjectName(repo), err) - log.Error("failed statistic: %s", getDistinctProjectName(repo)) - mailer.SendWarnNotifyMail(setting.Warn_Notify_Mails, warnEmailMessage) + log.Error("InsertRepoStat failed(%s): %v", projectName, err) + log.Error("failed statistic: %s", projectName) + error_projects = append(error_projects, projectName) + continue } @@ -247,6 +250,10 @@ func RepoStatisticDaily(date string) { log.Info("finish statistic: %s", getDistinctProjectName(repo)) } + if len(error_projects) > 0 { + mailer.SendWarnNotifyMail(setting.Warn_Notify_Mails, warnEmailMessage) + } + //radar map log.Info("begin statistic radar") for _, radarInit := range reposRadar { From 6b3e8c554c8724aa9449d21236e3fa62cccf62d9 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 14 Jan 2022 11:03:33 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 2 +- routers/repo/user_data_analysis.go | 2 +- web_src/js/components/UserAnalysis.vue | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index d04e350c2..288762161 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -387,7 +387,7 @@ func refreshUserStaticTable(wikiCountMap map[string]int, CommitCodeSizeMap map[s OpenIIndexMap := queryUserRepoOpenIIndex(startTime.Unix(), end_unix) - DataDate := currentTimeNow.Format("2006-01-02") + DataDate := currentTimeNow.Format("2006-01-02") + " 00:01" cond := "type != 1 and is_active=true" count, err := sess.Where(cond).Count(new(User)) diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 7df384cc4..e2d44ab0a 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -88,7 +88,7 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac xlsx.SetCellValue(sheetName, "P"+rows, formatTime[0:len(formatTime)-3]) formatTime = userRecord.DataDate - xlsx.SetCellValue(sheetName, "Q"+rows, formatTime+" 00:01") + xlsx.SetCellValue(sheetName, "Q"+rows, formatTime) } //设置默认打开的表单 diff --git a/web_src/js/components/UserAnalysis.vue b/web_src/js/components/UserAnalysis.vue index c4c5608f1..5650e164f 100755 --- a/web_src/js/components/UserAnalysis.vue +++ b/web_src/js/components/UserAnalysis.vue @@ -135,13 +135,10 @@ -
From 4af1d5d66f2821cfe66c0857dcadb32d70932664 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Fri, 14 Jan 2022 12:33:58 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E8=A7=A3=E5=86=B3action=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/action.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/action.go b/models/action.go index b9a0a603c..003dc1b20 100755 --- a/models/action.go +++ b/models/action.go @@ -350,6 +350,7 @@ func GetLast20PublicFeeds(opTypes []int) ([]*Action, error) { cond := builder.NewCond() cond = cond.And(builder.Eq{"is_private": false}) cond = cond.And(builder.Eq{"is_deleted": false}) + cond = cond.And(builder.Expr("user_id=act_user_id")) cond = cond.And(builder.In("op_type", opTypes)) actions := make([]*Action, 0, 20) From 3fd596c3901b77ceb783f4a7fb720acfa9af18c2 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 17 Jan 2022 09:20:01 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E4=BF=AE=E6=AD=A3#1360?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/home.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index 5811b91c1..717d57682 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -239,7 +239,7 @@ var actionNameZH={ "5":"推送了 {branch} 分支的代码到", "6":"创建了任务", "7":"创建了合并请求", - "9":"推送了 {branch} 分支的代码到", + "9":"推送了标签 {branch} 到", "10":"评论了任务", "11":"合并了合并请求", "12":"关闭了任务", @@ -257,7 +257,7 @@ var actionNameEN={ "5":" pushed to {branch} at", "6":" opened issue", "7":" created pull request", - "9":" pushed to {branch} at", + "9":" pushed tag {branch} to ", "10":" commented on issue", "11":" merged pull request", "12":" closed issue", From 3f2c50e27156d754be2429816606c23f61173782 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 17 Jan 2022 16:36:28 +0800 Subject: [PATCH 13/14] fix issue --- options/locale/locale_en-US.ini | 2 + options/locale/locale_zh-CN.ini | 3 ++ templates/repo/createCourse.tmpl | 98 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 templates/repo/createCourse.tmpl diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1756b9533..17f639866 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -348,6 +348,8 @@ modify = Update [form] UserName = Username Alias = Repository name +courseAlias = Course Name +courseAdress = Course Path RepoPath = Repository path RepoAdress = Repository Adress Email = Email address diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index d034b1722..93afc66c4 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -353,6 +353,8 @@ modify=更新 UserName=用户名 RepoName=项目路径 Alias=项目名称 +courseAlias=课程名称 +courseAdress=课程地址 RepoPath=项目路径 RepoAdress=项目地址 Email=邮箱地址 @@ -802,6 +804,7 @@ generate_from=生成自 repo_desc=项目描述 repo_lang=项目语言 repo_gitignore_helper=选择 .gitignore 模板。 +repo_label_helpe=输入完成后回车键完成标签确定。 issue_labels=任务标签 issue_labels_helper=选择一个任务标签集 license=授权许可 diff --git a/templates/repo/createCourse.tmpl b/templates/repo/createCourse.tmpl new file mode 100644 index 000000000..5ce7d010b --- /dev/null +++ b/templates/repo/createCourse.tmpl @@ -0,0 +1,98 @@ +{{template "base/head" .}} +
+
+
+
+ {{.CsrfTokenHtml}} +

+ {{.i18n.Tr "new_course"}} +

+
+ {{template "base/alert" .}} +
+ + + {{.i18n.Tr "form.reponame_dash_dot_error"}} +
+ +
+ +
+ +
+
/
+
+ +
+
+ {{.i18n.Tr "form.repoadd_dash_dot_error"}} + + +
+ + +
+ +
+ + +
+
+ + + {{.i18n.Tr "cancel"}} +
+
+
+
+
+
+{{template "base/footer" .}} + + \ No newline at end of file From e3d6399311dfb712619ef0aad251143e439e21c7 Mon Sep 17 00:00:00 2001 From: wangjr Date: Mon, 17 Jan 2022 16:58:10 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=83=E6=A0=A1?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- options/locale/locale_zh-CN.ini | 4 + templates/org/course_list.tmpl | 334 +++++++++++++++++++++ templates/org/home_courses.tmpl | 479 +++++++++++++++++++++++++++++++ templates/org/member/course_members.tmpl | 0 templates/org/team/courseTeams.tmpl | 0 5 files changed, 817 insertions(+) create mode 100644 templates/org/course_list.tmpl create mode 100644 templates/org/home_courses.tmpl create mode 100644 templates/org/member/course_members.tmpl create mode 100644 templates/org/team/courseTeams.tmpl diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index d034b1722..5180eadaa 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -2050,6 +2050,7 @@ team_access_desc=项目权限 team_permission_desc=权限 team_unit_desc=允许访问项目单元 team_unit_disabled=(已禁用) +selected_couse=精选课程 form.name_reserved=组织名称 '%s' 是被保留的。 form.name_pattern_not_allowed=组织名称中不允许使用 "%s"。 @@ -2136,6 +2137,9 @@ teams.all_repositories_read_permission_desc=此团队授予读取修改所有项目的访问权限: 成员可以查看和推送至项目。 teams.all_repositories_admin_permission_desc=该团队拥有 管理 所有项目的权限:团队成员可以读取、克隆、推送以及添加其它项目协作者。 +teams.join_teams=加入该组织 + + [admin] dashboard=管理面板 users=帐户管理 diff --git a/templates/org/course_list.tmpl b/templates/org/course_list.tmpl new file mode 100644 index 000000000..a371ec4ff --- /dev/null +++ b/templates/org/course_list.tmpl @@ -0,0 +1,334 @@ + +
+ + +
+ +
+ {{range .Repos}} +
+ +
+
+ {{if .Topics }} +
+ {{range .Topics}} + {{if ne . "" }}{{.}}{{end}} + {{end}} + +
+ {{end}} + +
+ + + +
+ {{.Description}} + +
+ + + + +
+
+

+ {{$.i18n.Tr "org.repo_updated"}}{{.CreatedUnix.FormatShort}} {{TimeSinceUnix .UpdatedUnix $.i18n.Lang}} + +

+ +
+
+ {{end}} +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/templates/org/home_courses.tmpl b/templates/org/home_courses.tmpl new file mode 100644 index 000000000..0f9b70f67 --- /dev/null +++ b/templates/org/home_courses.tmpl @@ -0,0 +1,479 @@ + +{{template "base/head" .}} +
+ {{/* overflow: auto is the clearfix - this avoids the image going beyond + the container where it is supposed to stay inside. */}} + + +
+
+ +
+
+ {{.Org.DisplayName}} + +
+
+ {{if .Org.Description}}

{{.Org.Description}}

{{end}} +
+ +
+ {{if .Org.Location}}
{{svg "octicon-location" 16}} {{.Org.Location}}
{{end}} + {{if .Org.Website}}
{{svg "octicon-link" 16}} {{.Org.Website}}
{{end}} +
+
+
+ + +
+ + +
+ + +
+ +
+
+
+ 全部关键字 + {{range .CoursesKeywords}} + {{.}} + {{end}} +
+ + +
+
+
+ + + +
+ +
+
+
+ + {{template "org/course_list" .}} + {{template "base/paginate" .}} +
+ +
+ +

+ {{.i18n.Tr "org.selected_couse"}} + + + + +

+ +
+ {{range $i, $v := .RecommendCourses}} + + {{if gt $i 0}} +
+ {{end}} +
+ +
+ {{.Alias}} +

+ 贡献者:{{.Creator.Name}} +

+
+
+ + {{end}} + + +
+ + +

+ {{.i18n.Tr "org.people"}} + + + + +

+
+ {{$isMember := .IsOrganizationMember}} + {{range .Members}} + {{if or $isMember (.IsPublicMember $.Org.ID)}} + + {{end}} + {{end}} + + +
+ + {{if .IsOrganizationMember}} +
+ {{.i18n.Tr "org.teams"}} + +
+ + {{if .IsOrganizationOwner}} + + {{end}} + {{end}} +
+
+
+ +
+
+
+ + + +{{template "base/footer" .}} + \ No newline at end of file diff --git a/templates/org/member/course_members.tmpl b/templates/org/member/course_members.tmpl new file mode 100644 index 000000000..e69de29bb diff --git a/templates/org/team/courseTeams.tmpl b/templates/org/team/courseTeams.tmpl new file mode 100644 index 000000000..e69de29bb