Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2212tags/v1.22.5.2
| @@ -1566,6 +1566,14 @@ func GetCloudbrainCountByUserID(userID int64, jobType string) (int, error) { | |||
| return int(count), err | |||
| } | |||
| func GetCloudbrainRunCountByRepoID(repoID int64) (int, error) { | |||
| count, err := x.In("status", JobWaiting, JobRunning, ModelArtsCreateQueue, ModelArtsCreating, ModelArtsStarting, | |||
| ModelArtsReadyToStart, ModelArtsResizing, ModelArtsStartQueuing, ModelArtsRunning, ModelArtsRestarting, ModelArtsTrainJobInit, | |||
| ModelArtsTrainJobImageCreating, ModelArtsTrainJobSubmitTrying, ModelArtsTrainJobWaiting, ModelArtsTrainJobRunning, | |||
| ModelArtsTrainJobScaling, ModelArtsTrainJobCheckInit, ModelArtsTrainJobCheckRunning, ModelArtsTrainJobCheckRunningCompleted).And("repo_id = ?", repoID).Count(new(Cloudbrain)) | |||
| return int(count), err | |||
| } | |||
| func GetBenchmarkCountByUserID(userID int64) (int, error) { | |||
| count, err := x.In("status", JobWaiting, JobRunning).And("(job_type = ? or job_type = ? or job_type = ?) and user_id = ? and type = ?", string(JobTypeBenchmark), string(JobTypeBrainScore), string(JobTypeSnn4imagenet), userID, TypeCloudBrainOne).Count(new(Cloudbrain)) | |||
| return int(count), err | |||
| @@ -1,10 +1,12 @@ | |||
| package models | |||
| import ( | |||
| "code.gitea.io/gitea/modules/log" | |||
| "errors" | |||
| "fmt" | |||
| "sort" | |||
| "strings" | |||
| "code.gitea.io/gitea/modules/log" | |||
| "code.gitea.io/gitea/modules/timeutil" | |||
| "xorm.io/builder" | |||
| @@ -179,7 +181,7 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { | |||
| func generateFilterCond(opts *SearchDatasetOptions, cond builder.Cond) builder.Cond { | |||
| if len(opts.Keyword) > 0 { | |||
| cond = cond.And(builder.Or(builder.Like{"dataset.title", opts.Keyword}, builder.Like{"dataset.description", opts.Keyword})) | |||
| cond = cond.And(builder.Or(builder.Like{"LOWER(dataset.title)", strings.ToLower(opts.Keyword)}, builder.Like{"LOWER(dataset.description)", strings.ToLower(opts.Keyword)})) | |||
| } | |||
| if len(opts.Category) > 0 { | |||
| @@ -160,7 +160,11 @@ func UpdateOrgStatistics() { | |||
| has, _ := x.Get(orgStat) | |||
| orgStat.NumScore = numScore | |||
| if has { | |||
| count, err := GetPublicRepositoryCount(&org) | |||
| if err != nil || count == 0 { | |||
| x.ID(orgStat.ID).Delete(new(OrgStatistic)) | |||
| } else if has { | |||
| x.ID(orgStat.ID).Cols("num_score").Update(&orgStat) | |||
| } else { | |||
| x.Insert(orgStat) | |||
| @@ -477,6 +477,7 @@ func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wi | |||
| dateRecord.Email = userRecord.Email | |||
| dateRecord.RegistDate = userRecord.CreatedUnix | |||
| dateRecord.Name = userRecord.Name | |||
| dateRecord.UserLocation = userRecord.Location | |||
| dateRecord.GiteaAgeMonth = subMonth(currentTimeNow, userRecord.CreatedUnix.AsTime()) | |||
| dateRecord.CodeMergeCount = getMapValue(dateRecord.ID, CodeMergeCountMap) | |||
| @@ -534,7 +535,7 @@ func QueryUserStaticDataForUserDefine(opts *UserBusinessAnalysisQueryOptions, wi | |||
| break | |||
| } | |||
| } | |||
| log.Info("query user define,count=" + fmt.Sprint((ResultList))) | |||
| log.Info("query user define,count=" + fmt.Sprint(len(ResultList))) | |||
| return ResultList, int64(len(ResultList)) | |||
| } | |||
| @@ -926,7 +927,7 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time, | |||
| if err != nil { | |||
| log.Info("query commit code errr.") | |||
| } else { | |||
| log.Info("query commit code size, len=" + fmt.Sprint(len(CommitCodeSizeMap))) | |||
| //log.Info("query commit code size, len=" + fmt.Sprint(len(CommitCodeSizeMap))) | |||
| CommitCodeSizeMapJson, _ := json.Marshal(CommitCodeSizeMap) | |||
| log.Info("CommitCodeSizeMapJson=" + string(CommitCodeSizeMapJson)) | |||
| } | |||
| @@ -973,7 +974,7 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time, | |||
| dateRecord.Name = userRecord.Name | |||
| dateRecord.GiteaAgeMonth = subMonth(currentTimeNow, userRecord.CreatedUnix.AsTime()) | |||
| dateRecord.DataDate = DataDate | |||
| dateRecord.UserLocation = userRecord.Location | |||
| dateRecord.CodeMergeCount = getMapValue(dateRecord.ID, CodeMergeCountMap) | |||
| dateRecord.CommitCount = getMapValue(dateRecord.ID, CommitCountMap) | |||
| dateRecord.IssueCount = getMapValue(dateRecord.ID, IssueCountMap) | |||
| @@ -1026,20 +1027,7 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time, | |||
| log.Info("has activity." + userRecord.Name) | |||
| addUserToMap(userNewAddActivity, userRecord.CreatedUnix, dateRecord.ID) | |||
| } | |||
| if !userRecord.IsActive { | |||
| continue | |||
| } | |||
| var deleteDateRecord UserBusinessAnalysis | |||
| deleteDateRecord.ID = userRecord.ID | |||
| deleteDateRecord.CountDate = CountDate.Unix() | |||
| statictisSess.Delete(&deleteDateRecord) | |||
| _, err = statictisSess.Insert(&dateRecord) | |||
| if err != nil { | |||
| log.Info("insert daterecord failed." + err.Error()) | |||
| return err | |||
| } | |||
| } | |||
| indexTotal += PAGE_SIZE | |||
| @@ -1124,7 +1112,7 @@ func setUserMetrics(userMetrics map[string]int, user *User, start_time int64, en | |||
| //HasActivityUser int `xorm:"NOT NULL DEFAULT 0"` | |||
| //TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"` | |||
| //TotalHasActivityUser | |||
| regist_time := user.CreatedUnix.AsTime().Unix() | |||
| regist_time := int64(user.CreatedUnix) | |||
| if regist_time >= start_time && regist_time <= end_time { | |||
| if user.IsActive { | |||
| userMetrics["ActivateRegistUser"] = getMapKeyStringValue("ActivateRegistUser", userMetrics) + 1 | |||
| @@ -1166,7 +1154,6 @@ func getUserIndexFromAnalysisAll(dateRecord UserBusinessAnalysisAll, ParaWeight | |||
| // 登录次数 0.10 | |||
| result = float64(dateRecord.CodeMergeCount) * getParaWeightValue("CodeMergeCount", ParaWeight, 0.2) | |||
| result += float64(dateRecord.CommitCount) * getParaWeightValue("CommitCount", ParaWeight, 0.2) | |||
| log.Info("1 result=" + fmt.Sprint(result)) | |||
| result += float64(dateRecord.IssueCount) * getParaWeightValue("IssueCount", ParaWeight, 0.2) | |||
| result += float64(dateRecord.CommentCount) * getParaWeightValue("CommentCount", ParaWeight, 0.2) | |||
| result += float64(dateRecord.FocusRepoCount) * getParaWeightValue("FocusRepoCount", ParaWeight, 0.1) | |||
| @@ -1249,7 +1236,6 @@ func getUserIndex(dateRecord UserBusinessAnalysis, ParaWeight map[string]float64 | |||
| // 登录次数 0.10 | |||
| result = float64(dateRecord.CodeMergeCount) * getParaWeightValue("CodeMergeCount", ParaWeight, 0.2) | |||
| result += float64(dateRecord.CommitCount) * getParaWeightValue("CommitCount", ParaWeight, 0.2) | |||
| log.Info("2 result=" + fmt.Sprint(result)) | |||
| result += float64(dateRecord.IssueCount) * getParaWeightValue("IssueCount", ParaWeight, 0.2) | |||
| result += float64(dateRecord.CommentCount) * getParaWeightValue("CommentCount", ParaWeight, 0.2) | |||
| result += float64(dateRecord.FocusRepoCount) * getParaWeightValue("FocusRepoCount", ParaWeight, 0.1) | |||
| @@ -2061,7 +2047,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s | |||
| var indexTotal int64 | |||
| indexTotal = 0 | |||
| for { | |||
| sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) | |||
| sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Unscoped().Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) | |||
| cloudTaskList := make([]*Cloudbrain, 0) | |||
| sess.Find(&cloudTaskList) | |||
| log.Info("query cloudbrain size=" + fmt.Sprint(len(cloudTaskList))) | |||
| @@ -9,7 +9,7 @@ import ( | |||
| const EMPTY_REDIS_VAL = "Nil" | |||
| var accessTokenLock = redis_lock.NewDistributeLock() | |||
| var accessTokenLock = redis_lock.NewDistributeLock(redis_key.AccessTokenLockKey()) | |||
| func GetWechatAccessToken() string { | |||
| token, _ := redis_client.Get(redis_key.WechatAccessTokenKey()) | |||
| @@ -28,15 +28,15 @@ func GetWechatAccessToken() string { | |||
| } | |||
| func refreshAccessToken() { | |||
| if ok := accessTokenLock.Lock(redis_key.AccessTokenLockKey(), 3*time.Second); ok { | |||
| defer accessTokenLock.UnLock(redis_key.AccessTokenLockKey()) | |||
| if ok := accessTokenLock.Lock(3 * time.Second); ok { | |||
| defer accessTokenLock.UnLock() | |||
| callAccessTokenAndUpdateCache() | |||
| } | |||
| } | |||
| func refreshAndGetAccessToken() string { | |||
| if ok := accessTokenLock.LockWithWait(redis_key.AccessTokenLockKey(), 3*time.Second, 3*time.Second); ok { | |||
| defer accessTokenLock.UnLock(redis_key.AccessTokenLockKey()) | |||
| if ok := accessTokenLock.LockWithWait(3*time.Second, 3*time.Second); ok { | |||
| defer accessTokenLock.UnLock() | |||
| token, _ := redis_client.Get(redis_key.WechatAccessTokenKey()) | |||
| if token != "" { | |||
| if token == EMPTY_REDIS_VAL { | |||
| @@ -6,22 +6,23 @@ import ( | |||
| ) | |||
| type DistributeLock struct { | |||
| lockKey string | |||
| } | |||
| func NewDistributeLock() *DistributeLock { | |||
| return &DistributeLock{} | |||
| func NewDistributeLock(lockKey string) *DistributeLock { | |||
| return &DistributeLock{lockKey: lockKey} | |||
| } | |||
| func (lock *DistributeLock) Lock(lockKey string, expireTime time.Duration) bool { | |||
| isOk, _ := redis_client.Setnx(lockKey, "", expireTime) | |||
| func (lock *DistributeLock) Lock(expireTime time.Duration) bool { | |||
| isOk, _ := redis_client.Setnx(lock.lockKey, "", expireTime) | |||
| return isOk | |||
| } | |||
| func (lock *DistributeLock) LockWithWait(lockKey string, expireTime time.Duration, waitTime time.Duration) bool { | |||
| func (lock *DistributeLock) LockWithWait(expireTime time.Duration, waitTime time.Duration) bool { | |||
| start := time.Now().Unix() * 1000 | |||
| duration := waitTime.Milliseconds() | |||
| for { | |||
| isOk, _ := redis_client.Setnx(lockKey, "", expireTime) | |||
| isOk, _ := redis_client.Setnx(lock.lockKey, "", expireTime) | |||
| if isOk { | |||
| return true | |||
| } | |||
| @@ -34,7 +35,7 @@ func (lock *DistributeLock) LockWithWait(lockKey string, expireTime time.Duratio | |||
| return false | |||
| } | |||
| func (lock *DistributeLock) UnLock(lockKey string) error { | |||
| _, err := redis_client.Del(lockKey) | |||
| func (lock *DistributeLock) UnLock() error { | |||
| _, err := redis_client.Del(lock.lockKey) | |||
| return err | |||
| } | |||
| @@ -783,6 +783,7 @@ func RenameRepoFile(repo *models.Repository, doer *models.User, opts *RenameRepo | |||
| // Check that the path given in opts.treePath is valid (not a git path) | |||
| treePath := CleanUploadFileName(opts.TreePath) | |||
| treePath = strings.ReplaceAll(treePath, " ", "") | |||
| if treePath == "" { | |||
| return models.ErrFilenameInvalid{ | |||
| Path: opts.TreePath, | |||
| @@ -942,16 +943,16 @@ func moveAndAddFiles(oldTreePath, newTreePath string, t *TemporaryUploadReposito | |||
| } | |||
| //example for v(mode SHA-1 stage file) | |||
| //100755 d294c88235ac05d3dece028d8a65590f28ec46ac 0 custom/conf/app.ini | |||
| v = strings.ReplaceAll(v, "0\t", "") | |||
| tmpArray := strings.Split(v, " ") | |||
| oldPath := tmpArray[2] | |||
| tempArray := strings.Split(v, "0\t") | |||
| leftArray := strings.Split(tempArray[0], " ") | |||
| oldPath := tempArray[1] | |||
| newPath := newTreePath + strings.TrimPrefix(oldPath, oldTreePath) | |||
| // mode 0 means remove file | |||
| stdIn.WriteString("0 0000000000000000000000000000000000000000\t") | |||
| stdIn.WriteString(oldPath) | |||
| stdIn.WriteByte('\000') | |||
| stdIn.WriteString(tmpArray[0] + " ") | |||
| stdIn.WriteString(tmpArray[1] + "\t") | |||
| stdIn.WriteString(leftArray[0] + " ") | |||
| stdIn.WriteString(leftArray[1] + "\t") | |||
| stdIn.WriteString(newPath) | |||
| stdIn.WriteByte('\000') | |||
| } | |||
| @@ -519,6 +519,8 @@ static.RecommendDataset=Recommended Dataset Count | |||
| static.CollectImage=Collect Image Count | |||
| static.CollectedImage=Collected Image Count | |||
| static.RecommendImage=Recommended Image Count | |||
| static.email=Email | |||
| static.location=Location | |||
| static.all=All | |||
| static.public.user_business_analysis_current_month=Current_Month | |||
| static.public.user_business_analysis_current_week=Current_Week | |||
| @@ -528,7 +530,7 @@ static.public.user_business_analysis_last30_day=Last_30_day | |||
| static.public.user_business_analysis_last_month=Last_Month | |||
| static.public.user_business_analysis_yesterday=Yesterday | |||
| static.public.user_business_analysis_all=All | |||
| static.downloadinfo=Due to the large amount of data generated in the customized time period and long calculation time, please download and export the data from the following address and export the data download address: | |||
| metrics.sheetname=User Trend Analysis | |||
| metrics.date=Count Date | |||
| metrics.newregistuser=New registered user | |||
| @@ -537,6 +539,7 @@ metrics.hasactivateuser=New contributing activities | |||
| metrics.newregistnotactiveuser=New inactive | |||
| metrics.averageuser=Average new users | |||
| metrics.newuseractiveindex=Activation rate of new users | |||
| metrics.currentdayactivity=Current day contributing activities | |||
| metrics.totalregistuser=Cumulative registered users | |||
| metrics.totalactiveduser=Cumulative activated users | |||
| metrics.totalhasactivityuser=Cumulative active users | |||
| @@ -814,6 +817,7 @@ settings.delete_notices_1= - This operation <strong>CANNOT</strong> be undone. | |||
| settings.delete_notices_2= - This operation will permanently delete the <strong>%s</strong> dataset. | |||
| settings.delete_notices_fork_1= - Forks of this dataset will become independent after deletion. | |||
| settings.deletion_success= The dataset has been deleted. | |||
| settings.deletion_notice_cloudbrain = you need to stop the cloudbrain task under the project before remove the project! | |||
| task.machine_translation= machine translation | |||
| task.question_answering_system= question answering system | |||
| task.information_retrieval= information retrieval | |||
| @@ -2946,6 +2950,7 @@ raw_minutes = minutes | |||
| [dropzone] | |||
| default_message = Drop files or click here to upload. | |||
| default_dataset_message = Click to add files or directly drag and drop files here | |||
| invalid_input_type = You can not upload files of this type. | |||
| file_too_big = File size ({{filesize}} MB) exceeds the maximum size of ({{maxFilesize}} MB). | |||
| remove_file = Remove file | |||
| @@ -524,6 +524,8 @@ static.RecommendDataset=被推荐数据集数 | |||
| static.CollectImage=收藏镜像数 | |||
| static.CollectedImage=被收藏镜像数 | |||
| static.RecommendImage=被推荐镜像数 | |||
| static.email=Email | |||
| static.location=所在地区 | |||
| static.all=所有 | |||
| static.public.user_business_analysis_current_month=本月 | |||
| static.public.user_business_analysis_current_week=本周 | |||
| @@ -533,7 +535,7 @@ static.public.user_business_analysis_last30_day=近30天 | |||
| static.public.user_business_analysis_last_month=上月 | |||
| static.public.user_business_analysis_yesterday=昨天 | |||
| static.public.user_business_analysis_all=所有 | |||
| static.downloadinfo=因自定义时间段产生的数据量比较大,计算时间比较长,请您从如下地址下载导出数据,导出数据下载地址: | |||
| metrics.sheetname=用户趋势分析 | |||
| metrics.date=日期 | |||
| metrics.newregistuser=新增注册用户 | |||
| @@ -542,6 +544,7 @@ metrics.hasactivateuser=新增有贡献活动 | |||
| metrics.newregistnotactiveuser=新增未激活 | |||
| metrics.averageuser=平均新增用户 | |||
| metrics.newuseractiveindex=新增用户激活率 | |||
| metrics.currentdayactivity=当日有贡献活动 | |||
| metrics.totalregistuser=累计注册用户 | |||
| metrics.totalactiveduser=累计已激活 | |||
| metrics.totalhasactivityuser=累计有贡献活动 | |||
| @@ -1928,6 +1931,7 @@ settings.delete_notices_1=- 此操作 <strong>不可以</strong> 被回滚。 | |||
| settings.delete_notices_2=- 此操作将永久删除项目 <strong>%s</strong>,包括 Git 数据、 任务、评论、百科和协作者的操作权限。 | |||
| settings.delete_notices_fork_1=- 在此项目删除后,它的派生项目将变成独立项目。 | |||
| settings.deletion_success=项目已被删除。 | |||
| settings.deletion_notice_cloudbrain=请先停止项目内正在运行的云脑任务,然后再删除项目。 | |||
| settings.update_settings_success=项目设置已更新。 | |||
| settings.transfer_owner=新拥有者 | |||
| settings.make_transfer=开始转移 | |||
| @@ -2956,6 +2960,7 @@ raw_minutes=分钟 | |||
| [dropzone] | |||
| default_message=拖动文件或者点击此处上传。 | |||
| default_dataset_message=点击添加文件或直接拖拽文件到此处。 | |||
| invalid_input_type=您不能上传该类型的文件 | |||
| file_too_big=文件体积({{filesize}} MB)超过了最大允许体积({{maxFilesize}} MB) | |||
| remove_file=移除文件 | |||
| @@ -418,44 +418,16 @@ queryRecommendData(); | |||
| function queryRecommendData(){ | |||
| $.ajax({ | |||
| type:"GET", | |||
| url:"/recommend/org", | |||
| url:"/recommend/home", | |||
| headers: { | |||
| authorization:token, | |||
| }, | |||
| dataType:"json", | |||
| async:false, | |||
| success:function(json){ | |||
| displayOrg(json); | |||
| }, | |||
| error:function(response) { | |||
| } | |||
| }); | |||
| $.ajax({ | |||
| type:"GET", | |||
| url:"/recommend/repo", | |||
| headers: { | |||
| authorization:token, | |||
| }, | |||
| dataType:"json", | |||
| async:false, | |||
| success:function(json){ | |||
| displayRepo(json); | |||
| }, | |||
| error:function(response) { | |||
| } | |||
| }); | |||
| $.ajax({ | |||
| type:"GET", | |||
| url:"/recommend/imageinfo", | |||
| headers: { | |||
| authorization:token, | |||
| }, | |||
| dataType:"json", | |||
| async:false, | |||
| success:function(json){ | |||
| displayActivity(json); | |||
| displayOrg(json.org); | |||
| displayRepo(json.repo); | |||
| displayActivity(json.image) | |||
| }, | |||
| error:function(response) { | |||
| } | |||
| @@ -99,6 +99,12 @@ func setRecommendURL(ctx *context.Context) { | |||
| func Dashboard(ctx *context.Context) { | |||
| if ctx.IsSigned { | |||
| pictureInfo, err := getImageInfo("dashboard-picture") | |||
| if err == nil && len(pictureInfo) > 0 { | |||
| log.Info("set image info=" + pictureInfo[0]["url"]) | |||
| ctx.Data["image_url"] = pictureInfo[0]["url"] | |||
| ctx.Data["image_link"] = pictureInfo[0]["image_link"] | |||
| } | |||
| if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { | |||
| ctx.Data["Title"] = ctx.Tr("auth.active_your_account") | |||
| ctx.HTML(200, user.TplActivate) | |||
| @@ -259,7 +265,11 @@ func ExploreRepos(ctx *context.Context) { | |||
| ctx.Data["PageIsExplore"] = true | |||
| ctx.Data["PageIsExploreRepositories"] = true | |||
| ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled | |||
| pictureInfo, err := getImageInfo("explore-user-picture") | |||
| if err == nil && len(pictureInfo) > 0 { | |||
| ctx.Data["image_url"] = pictureInfo[0]["url"] | |||
| ctx.Data["image_link"] = pictureInfo[0]["image_link"] | |||
| } | |||
| var ownerID int64 | |||
| if ctx.User != nil && !ctx.User.IsAdmin { | |||
| ownerID = ctx.User.ID | |||
| @@ -434,7 +444,11 @@ func ExploreUsers(ctx *context.Context) { | |||
| ctx.Data["PageIsExplore"] = true | |||
| ctx.Data["PageIsExploreUsers"] = true | |||
| ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled | |||
| pictureInfo, err := getImageInfo("explore-user-picture") | |||
| if err == nil && len(pictureInfo) > 0 { | |||
| ctx.Data["image_url"] = pictureInfo[0]["url"] | |||
| ctx.Data["image_link"] = pictureInfo[0]["image_link"] | |||
| } | |||
| RenderUserSearch(ctx, &models.SearchUserOptions{ | |||
| Actor: ctx.User, | |||
| Type: models.UserTypeIndividual, | |||
| @@ -471,7 +485,7 @@ func ExploreOrganizations(ctx *context.Context) { | |||
| return | |||
| } | |||
| recommendOrgs, err := GetRecommendOrg() | |||
| recommendOrgs, err := getRecommendOrg() | |||
| if err != nil { | |||
| log.Error("GetRecommendOrgInfos failed:%v", err.Error(), ctx.Data["MsgID"]) | |||
| ctx.ServerError("GetRecommendOrgInfos", err) | |||
| @@ -606,31 +620,31 @@ func ExploreImages(ctx *context.Context) { | |||
| } | |||
| func ExploreDataAnalysisUserTrend(ctx *context.Context) { | |||
| ctx.Data["url_params"]="UserTrend" | |||
| ctx.Data["url_params"] = "UserTrend" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| func ExploreDataAnalysisUserAnalysis(ctx *context.Context) { | |||
| ctx.Data["url_params"]="UserAnalysis" | |||
| ctx.Data["url_params"] = "UserAnalysis" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| func ExploreDataAnalysisProTrend(ctx *context.Context) { | |||
| ctx.Data["url_params"]="ProTrend" | |||
| ctx.Data["url_params"] = "ProTrend" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| func ExploreDataAnalysisProAnalysis(ctx *context.Context) { | |||
| ctx.Data["url_params"]="ProAnalysis" | |||
| ctx.Data["url_params"] = "ProAnalysis" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| func ExploreDataAnalysisOverview(ctx *context.Context) { | |||
| ctx.Data["url_params"]="Overview" | |||
| ctx.Data["url_params"] = "Overview" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| func ExploreDataAnalysisBrainAnalysis(ctx *context.Context) { | |||
| ctx.Data["url_params"]="BrainAnalysis" | |||
| ctx.Data["url_params"] = "BrainAnalysis" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| func ExploreDataAnalysis(ctx *context.Context) { | |||
| ctx.Data["url_params"]="" | |||
| ctx.Data["url_params"] = "" | |||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | |||
| } | |||
| @@ -640,7 +654,7 @@ func NotFound(ctx *context.Context) { | |||
| ctx.NotFound("home.NotFound", nil) | |||
| } | |||
| func GetRecommendOrg() ([]map[string]interface{}, error) { | |||
| func getRecommendOrg() ([]map[string]interface{}, error) { | |||
| url := setting.RecommentRepoAddr + "organizations" | |||
| result, err := repository.RecommendFromPromote(url) | |||
| @@ -668,17 +682,18 @@ func GetRecommendOrg() ([]map[string]interface{}, error) { | |||
| } | |||
| return resultOrg, nil | |||
| } | |||
| func GetImageInfo() ([]map[string]interface{}, error) { | |||
| url := setting.RecommentRepoAddr + "picture_info" | |||
| func getImageInfo(filename string) ([]map[string]string, error) { | |||
| url := setting.RecommentRepoAddr + filename | |||
| result, err := repository.RecommendFromPromote(url) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| imageInfo := make([]map[string]interface{}, 0) | |||
| imageInfo := make([]map[string]string, 0) | |||
| for i := 0; i < (len(result) - 1); i++ { | |||
| line := result[i] | |||
| imageMap := make(map[string]interface{}) | |||
| imageMap := make(map[string]string) | |||
| if line[0:4] == "url=" { | |||
| url := line[4:] | |||
| imageMap["url"] = url | |||
| @@ -731,15 +746,6 @@ func GetRankUser(index string) ([]map[string]interface{}, error) { | |||
| return resultOrg, nil | |||
| } | |||
| func GetImageInfoFromPromote(ctx *context.Context) { | |||
| imageInfo, err := GetImageInfo() | |||
| if err != nil { | |||
| ctx.ServerError("500", err) | |||
| return | |||
| } | |||
| ctx.JSON(200, imageInfo) | |||
| } | |||
| func GetUserRankFromPromote(ctx *context.Context) { | |||
| index := ctx.Params("index") | |||
| resultUserRank, err := GetRankUser(index) | |||
| @@ -750,13 +756,24 @@ func GetUserRankFromPromote(ctx *context.Context) { | |||
| ctx.JSON(200, resultUserRank) | |||
| } | |||
| func RecommendOrgFromPromote(ctx *context.Context) { | |||
| resultOrg, err := GetRecommendOrg() | |||
| func RecommendHomeInfo(ctx *context.Context) { | |||
| resultOrg, err := getRecommendOrg() | |||
| if err != nil { | |||
| ctx.ServerError("500", err) | |||
| return | |||
| log.Info("error." + err.Error()) | |||
| } | |||
| resultRepo, err := repository.GetRecommendRepoFromPromote("projects") | |||
| if err != nil { | |||
| log.Info("error." + err.Error()) | |||
| } | |||
| resultImage, err := getImageInfo("picture_info") | |||
| if err != nil { | |||
| log.Info("error." + err.Error()) | |||
| } | |||
| ctx.JSON(200, resultOrg) | |||
| mapInterface := make(map[string]interface{}) | |||
| mapInterface["org"] = resultOrg | |||
| mapInterface["repo"] = resultRepo | |||
| mapInterface["image"] = resultImage | |||
| ctx.JSON(http.StatusOK, mapInterface) | |||
| } | |||
| func RecommendRepoFromPromote(ctx *context.Context) { | |||
| @@ -902,16 +902,17 @@ func CompleteMultipart(ctx *context.Context) { | |||
| if err != nil { | |||
| log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) | |||
| } else { | |||
| attachment.DecompressState = models.DecompressStateIng | |||
| err = models.UpdateAttachment(attachment) | |||
| if err != nil { | |||
| log.Error("UpdateAttachment state(%s) failed:%s", uuid, err.Error()) | |||
| } | |||
| updateAttachmentDecompressStateIng(attachment) | |||
| } | |||
| } | |||
| if typeCloudBrain == models.TypeCloudBrainTwo { | |||
| attachjson, _ := json.Marshal(attachment) | |||
| labelmsg.SendDecompressAttachToLabelOBS(string(attachjson)) | |||
| err = labelmsg.SendDecompressAttachToLabelOBS(string(attachjson)) | |||
| if err != nil { | |||
| log.Error("SendDecompressTask to labelsystem (%s) failed:%s", attachment.UUID, err.Error()) | |||
| } else { | |||
| updateAttachmentDecompressStateIng(attachment) | |||
| } | |||
| } | |||
| } else { | |||
| var labelMap map[string]string | |||
| @@ -206,7 +206,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| displayJobName := form.DisplayJobName | |||
| jobName := util.ConvertDisplayJobNameToJobName(displayJobName) | |||
| image := form.Image | |||
| image := strings.TrimSpace(form.Image) | |||
| uuid := form.Attachment | |||
| jobType := form.JobType | |||
| gpuQueue := form.GpuType | |||
| @@ -283,30 +283,6 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { | |||
| mkModelPath(modelPath) | |||
| uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath+"/") | |||
| benchmarkPath := setting.JobPath + jobName + cloudbrain.BenchMarkMountPath | |||
| if setting.IsBenchmarkEnabled && jobType == string(models.JobTypeBenchmark) { | |||
| var gpuType string | |||
| for _, gpuInfo := range gpuInfos.GpuInfo { | |||
| if gpuInfo.Queue == gpuQueue { | |||
| gpuType = gpuInfo.Value | |||
| } | |||
| } | |||
| downloadRateCode(repo, jobName, setting.BenchmarkOwner, setting.BenchmarkName, benchmarkPath, form.BenchmarkCategory, gpuType) | |||
| uploadCodeToMinio(benchmarkPath+"/", jobName, cloudbrain.BenchMarkMountPath+"/") | |||
| } | |||
| snn4imagenetPath := setting.JobPath + jobName + cloudbrain.Snn4imagenetMountPath | |||
| if setting.IsSnn4imagenetEnabled && jobType == string(models.JobTypeSnn4imagenet) { | |||
| downloadRateCode(repo, jobName, setting.Snn4imagenetOwner, setting.Snn4imagenetName, snn4imagenetPath, "", "") | |||
| uploadCodeToMinio(snn4imagenetPath+"/", jobName, cloudbrain.Snn4imagenetMountPath+"/") | |||
| } | |||
| brainScorePath := setting.JobPath + jobName + cloudbrain.BrainScoreMountPath | |||
| if setting.IsBrainScoreEnabled && jobType == string(models.JobTypeBrainScore) { | |||
| downloadRateCode(repo, jobName, setting.BrainScoreOwner, setting.BrainScoreName, brainScorePath, "", "") | |||
| uploadCodeToMinio(brainScorePath+"/", jobName, cloudbrain.BrainScoreMountPath+"/") | |||
| } | |||
| err = cloudbrain.GenerateTask(ctx, displayJobName, jobName, image, command, uuid, storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), | |||
| @@ -482,6 +458,17 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||
| ctx.Data["resource_type"] = resourceType.Value | |||
| } | |||
| } | |||
| } else if cloudbrain.IsBenchmarkJob(task.JobType) { | |||
| if benchmarkGpuInfos == nil { | |||
| json.Unmarshal([]byte(setting.BenchmarkGpuTypes), &benchmarkGpuInfos) | |||
| } | |||
| for _, resourceType := range benchmarkGpuInfos.GpuInfo { | |||
| if resourceType.Queue == jobRes.Config.GpuType { | |||
| ctx.Data["resource_type"] = resourceType.Value | |||
| } | |||
| } | |||
| } else { | |||
| if gpuInfos == nil { | |||
| json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos) | |||
| @@ -1241,7 +1228,7 @@ func downloadCode(repo *models.Repository, codePath, branchName string) error { | |||
| return nil | |||
| } | |||
| func downloadRateCode(repo *models.Repository, taskName, rateOwnerName, rateRepoName, codePath, benchmarkCategory, gpuType string) error { | |||
| func downloadRateCode(repo *models.Repository, taskName, rateOwnerName, rateRepoName, codePath, benchmarkCategory, gpuType, userName string) error { | |||
| err := os.MkdirAll(codePath, os.ModePerm) | |||
| if err != nil { | |||
| log.Error("mkdir codePath failed", err.Error()) | |||
| @@ -1269,7 +1256,7 @@ func downloadRateCode(repo *models.Repository, taskName, rateOwnerName, rateRepo | |||
| defer f.Close() | |||
| data, err := json.Marshal(models.TaskInfo{ | |||
| Username: repo.Owner.Name, | |||
| Username: userName, | |||
| TaskName: taskName, | |||
| CodeName: repo.Name, | |||
| BenchmarkCategory: strings.Split(benchmarkCategory, ","), | |||
| @@ -1845,7 +1832,7 @@ func BenchMarkAlgorithmCreate(ctx *context.Context, form auth.CreateCloudBrainFo | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| displayJobName := form.DisplayJobName | |||
| jobName := util.ConvertDisplayJobNameToJobName(displayJobName) | |||
| image := form.Image | |||
| image := strings.TrimSpace(form.Image) | |||
| gpuQueue := form.GpuType | |||
| command := cloudbrain.CommandBenchmark | |||
| codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath | |||
| @@ -1970,7 +1957,7 @@ func BenchMarkAlgorithmCreate(ctx *context.Context, form auth.CreateCloudBrainFo | |||
| } | |||
| } | |||
| if err := downloadRateCode(repo, jobName, childInfo.Owner, childInfo.RepoName, benchmarkPath, form.BenchmarkCategory, gpuType); err != nil { | |||
| if err := downloadRateCode(repo, jobName, childInfo.Owner, childInfo.RepoName, benchmarkPath, form.BenchmarkCategory, gpuType, ctx.User.Name); err != nil { | |||
| log.Error("downloadRateCode failed, %v", err, ctx.Data["MsgID"]) | |||
| //cloudBrainNewDataPrepare(ctx) | |||
| //ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) | |||
| @@ -2068,7 +2055,7 @@ func ModelBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) | |||
| snn4imagenetPath := setting.JobPath + jobName + cloudbrain.Snn4imagenetMountPath | |||
| if setting.IsSnn4imagenetEnabled && jobType == string(models.JobTypeSnn4imagenet) { | |||
| downloadRateCode(repo, jobName, setting.Snn4imagenetOwner, setting.Snn4imagenetName, snn4imagenetPath, "", "") | |||
| downloadRateCode(repo, jobName, setting.Snn4imagenetOwner, setting.Snn4imagenetName, snn4imagenetPath, "", "", ctx.User.Name) | |||
| uploadCodeToMinio(snn4imagenetPath+"/", jobName, cloudbrain.Snn4imagenetMountPath+"/") | |||
| command = fmt.Sprintf(cloudbrain.Snn4imagenetCommand, displayJobName, trimSpaceNewlineInString(form.Description)) | |||
| @@ -2076,7 +2063,7 @@ func ModelBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) | |||
| benchmarkChildTypeID := 0 | |||
| brainScorePath := setting.JobPath + jobName + cloudbrain.BrainScoreMountPath | |||
| if setting.IsBrainScoreEnabled && jobType == string(models.JobTypeBrainScore) { | |||
| downloadRateCode(repo, jobName, setting.BrainScoreOwner, setting.BrainScoreName, brainScorePath, "", "") | |||
| downloadRateCode(repo, jobName, setting.BrainScoreOwner, setting.BrainScoreName, brainScorePath, "", "", ctx.User.Name) | |||
| uploadCodeToMinio(brainScorePath+"/", jobName, cloudbrain.BrainScoreMountPath+"/") | |||
| benchmarkChildTypeID = form.BenchmarkChildTypeID | |||
| command = fmt.Sprintf(cloudbrain.BrainScoreCommand, getBrainRegion(benchmarkChildTypeID), displayJobName, trimSpaceNewlineInString(form.Description)) | |||
| @@ -2136,7 +2123,7 @@ func CloudBrainTrainJobNew(ctx *context.Context) { | |||
| func getTrainJobCommand(form auth.CreateCloudBrainForm) (string, error) { | |||
| var command string | |||
| bootFile := form.BootFile | |||
| bootFile := strings.TrimSpace(form.BootFile) | |||
| params := form.Params | |||
| if !strings.HasSuffix(bootFile, ".py") { | |||
| @@ -106,6 +106,8 @@ func DatasetIndex(ctx *context.Context) { | |||
| MustEnableDataset(ctx) | |||
| ctx.Data["PageIsDataset"] = true | |||
| ctx.Data["SortType"] = ctx.Query("sort") | |||
| repo := ctx.Repo.Repository | |||
| dataset, err := models.GetDatasetByRepo(repo) | |||
| @@ -128,9 +130,31 @@ func DatasetIndex(ctx *context.Context) { | |||
| attachments := newFilterPrivateAttachments(ctx, dataset.Attachments, repo) | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return attachments[i].CreatedUnix > attachments[j].CreatedUnix | |||
| }) | |||
| if ctx.Data["SortType"] == "nameAsc" { | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return strings.ToLower(attachments[i].Name) < strings.ToLower(attachments[j].Name) | |||
| }) | |||
| } else if ctx.Data["SortType"] == "nameDesc" { | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return strings.ToLower(attachments[i].Name) > strings.ToLower(attachments[j].Name) | |||
| }) | |||
| } else if ctx.Data["SortType"] == "sizeAsc" { | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return attachments[i].Size < attachments[j].Size | |||
| }) | |||
| } else if ctx.Data["SortType"] == "sizeDesc" { | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return attachments[i].Size > attachments[j].Size | |||
| }) | |||
| } else if ctx.Data["SortType"] == "timeAsc" { | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return attachments[i].CreatedUnix < attachments[j].CreatedUnix | |||
| }) | |||
| } else { | |||
| sort.Slice(attachments, func(i, j int) bool { | |||
| return attachments[i].CreatedUnix > attachments[j].CreatedUnix | |||
| }) | |||
| } | |||
| page := ctx.QueryInt("page") | |||
| if page <= 0 { | |||
| @@ -764,6 +764,7 @@ func trainJobErrorNewDataPrepare(ctx *context.Context, form auth.CreateModelArts | |||
| ctx.Data["bootFile"] = form.BootFile | |||
| ctx.Data["uuid"] = form.Attachment | |||
| ctx.Data["branch_name"] = form.BranchName | |||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||
| return nil | |||
| } | |||
| @@ -954,6 +955,7 @@ func versionErrorDataPrepare(ctx *context.Context, form auth.CreateModelArtsTrai | |||
| return err | |||
| } | |||
| ctx.Data["config_list"] = configList.ParaConfigs | |||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||
| return nil | |||
| } | |||
| @@ -967,7 +969,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| description := form.Description | |||
| workServerNumber := form.WorkServerNumber | |||
| engineID := form.EngineID | |||
| bootFile := form.BootFile | |||
| bootFile := strings.TrimSpace(form.BootFile) | |||
| flavorCode := form.Flavor | |||
| params := form.Params | |||
| poolID := form.PoolID | |||
| @@ -1210,7 +1212,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| description := form.Description | |||
| workServerNumber := form.WorkServerNumber | |||
| engineID := form.EngineID | |||
| bootFile := form.BootFile | |||
| bootFile := strings.TrimSpace(form.BootFile) | |||
| flavorCode := form.Flavor | |||
| params := form.Params | |||
| poolID := form.PoolID | |||
| @@ -1284,7 +1286,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| var parameters models.Parameters | |||
| param := make([]models.Parameter, 0) | |||
| existDeviceTarget := true | |||
| existDeviceTarget := false | |||
| if len(params) != 0 { | |||
| err := json.Unmarshal([]byte(params), ¶meters) | |||
| if err != nil { | |||
| @@ -1471,8 +1473,8 @@ func obsMkdir(dir string) error { | |||
| } | |||
| func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error { | |||
| if !strings.HasSuffix(form.BootFile, ".py") { | |||
| log.Error("the boot file(%s) must be a python file", form.BootFile) | |||
| if !strings.HasSuffix(strings.TrimSpace(form.BootFile), ".py") { | |||
| log.Error("the boot file(%s) must be a python file", strings.TrimSpace(form.BootFile)) | |||
| return errors.New("启动文件必须是python文件") | |||
| } | |||
| @@ -1489,8 +1491,8 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error { | |||
| } | |||
| func paramCheckCreateInferenceJob(form auth.CreateModelArtsInferenceJobForm) error { | |||
| if !strings.HasSuffix(form.BootFile, ".py") { | |||
| log.Error("the boot file(%s) must be a python file", form.BootFile) | |||
| if !strings.HasSuffix(strings.TrimSpace(form.BootFile), ".py") { | |||
| log.Error("the boot file(%s) must be a python file", strings.TrimSpace(form.BootFile)) | |||
| return errors.New("启动文件必须是python文件") | |||
| } | |||
| @@ -1803,7 +1805,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference | |||
| description := form.Description | |||
| workServerNumber := form.WorkServerNumber | |||
| engineID := form.EngineID | |||
| bootFile := form.BootFile | |||
| bootFile := strings.TrimSpace(form.BootFile) | |||
| flavorCode := form.Flavor | |||
| params := form.Params | |||
| poolID := form.PoolID | |||
| @@ -2175,6 +2177,7 @@ func inferenceJobErrorNewDataPrepare(ctx *context.Context, form auth.CreateModel | |||
| ctx.Data["model_version"] = form.ModelVersion | |||
| ctx.Data["ckpt_name"] = form.CkptName | |||
| ctx.Data["train_url"] = form.TrainUrl | |||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||
| return nil | |||
| } | |||
| @@ -6,7 +6,6 @@ | |||
| package repo | |||
| import ( | |||
| "code.gitea.io/gitea/modules/notification" | |||
| "errors" | |||
| "fmt" | |||
| "io/ioutil" | |||
| @@ -15,6 +14,8 @@ import ( | |||
| "strings" | |||
| "time" | |||
| "code.gitea.io/gitea/modules/notification" | |||
| "code.gitea.io/gitea/models" | |||
| "code.gitea.io/gitea/modules/auth" | |||
| "code.gitea.io/gitea/modules/base" | |||
| @@ -477,16 +478,27 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||
| ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | |||
| return | |||
| } | |||
| if err := repo_service.DeleteRepository(ctx.User, ctx.Repo.Repository); err != nil { | |||
| ctx.ServerError("DeleteRepository", err) | |||
| count, err := models.GetCloudbrainRunCountByRepoID(repo.ID) | |||
| if err != nil { | |||
| ctx.ServerError("GetCloudbrainCountByRepoID failed", err) | |||
| return | |||
| } | |||
| log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name) | |||
| go StopJobsByRepoID(repo.ID) | |||
| } else { | |||
| if count >= 1 { | |||
| ctx.Data["Err_RepoName"] = nil | |||
| ctx.Flash.Error(ctx.Tr("repo.settings.deletion_notice_cloudbrain")) | |||
| ctx.Redirect(ctx.Repo.RepoLink + "/settings") | |||
| return | |||
| } | |||
| if err := repo_service.DeleteRepository(ctx.User, ctx.Repo.Repository); err != nil { | |||
| ctx.ServerError("DeleteRepository", err) | |||
| return | |||
| } | |||
| log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name) | |||
| go StopJobsByRepoID(repo.ID) | |||
| ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success")) | |||
| ctx.Redirect(ctx.Repo.Owner.DashboardLink()) | |||
| ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success")) | |||
| ctx.Redirect(ctx.Repo.Owner.DashboardLink()) | |||
| } | |||
| case "delete-wiki": | |||
| if !ctx.Repo.IsOwner() { | |||
| @@ -29,6 +29,7 @@ func getUserMetricsExcelHeader(ctx *context.Context) map[string]string { | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.hasactivateuser")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.newregistnotactiveuser")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.newuseractiveindex")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.currentdayactivity")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.totalregistuser")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.totalactiveduser")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.metrics.totalhasactivityuser")) | |||
| @@ -67,6 +68,10 @@ func writeUserMetricsExcel(row int, xlsx *excelize.File, sheetName string, userM | |||
| } | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, value) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userMetrics.HasActivityUser) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userMetrics.TotalUser) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userMetrics.TotalActivateRegistUser) | |||
| @@ -106,6 +111,9 @@ func getExcelHeader(ctx *context.Context) map[string]string { | |||
| excelHeader = append(excelHeader, ctx.Tr("user.static.CollectedImage")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.static.RecommendImage")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.static.email")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.static.location")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.static.registdate")) | |||
| excelHeader = append(excelHeader, ctx.Tr("user.static.countdate")) | |||
| @@ -181,6 +189,13 @@ func writeExcel(row int, xlsx *excelize.File, sheetName string, userRecord *mode | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.RecommendImage) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.Email) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.UserLocation) | |||
| tmp = tmp + 1 | |||
| formatTime := userRecord.RegistDate.Format("2006-01-02 15:04:05") | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime[0:len(formatTime)-3]) | |||
| tmp = tmp + 1 | |||
| @@ -249,6 +264,13 @@ func writeExcelPage(row int, xlsx *excelize.File, sheetName string, userRecord * | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.RecommendImage) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.Email) | |||
| tmp = tmp + 1 | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.UserLocation) | |||
| tmp = tmp + 1 | |||
| formatTime := userRecord.RegistDate.Format("2006-01-02 15:04:05") | |||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime[0:len(formatTime)-3]) | |||
| tmp = tmp + 1 | |||
| @@ -414,9 +436,7 @@ func DownloadUserDefineFile(ctx *context.Context) { | |||
| log.Info("file not exist.") | |||
| ctx.JSON(http.StatusOK, "File Not Exist.") | |||
| } else { | |||
| ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+filename) | |||
| ctx.Resp.Header().Set("Content-Type", "application/octet-stream") | |||
| ctx.ServeFile(allFilename, filename) | |||
| ctx.ServeFile(allFilename, url.QueryEscape(filename)) | |||
| } | |||
| } | |||
| @@ -544,14 +564,13 @@ func QueryUserStaticDataPage(ctx *context.Context) { | |||
| endTime = time.Now() | |||
| } else { | |||
| startTime, _ = time.ParseInLocation("2006-01-02", startDate, time.Local) | |||
| startTime = time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 12, 0, 0, 0, startTime.Location()) | |||
| startTime = time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, startTime.Location()) | |||
| settingStartTime, _ := time.Parse("2006-01-02", setting.RadarMap.RecordBeginTime) | |||
| if startTime.Unix() < settingStartTime.Unix() { | |||
| startTime = settingStartTime | |||
| startDate = settingStartTime.Format("2006-01-02") | |||
| } | |||
| endTime, _ = time.ParseInLocation("2006-01-02", endDate, time.Local) | |||
| //endTime = endTime.AddDate(0, 0, 1) | |||
| endTime = time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 23, 59, 59, 0, startTime.Location()) | |||
| isAll = false | |||
| @@ -582,7 +601,7 @@ func QueryUserStaticDataPage(ctx *context.Context) { | |||
| filename := sheetName + "_" + startDate + "_" + endDate + ".xlsx" | |||
| os.Remove(setting.AppDataPath + Excel_File_Path + filename) | |||
| go writeFileToDisk(ctx, count, re, filename) | |||
| ctx.JSON(http.StatusOK, setting.AppURL+"api/v1/download_user_define_file?filename="+filename) | |||
| ctx.JSON(http.StatusOK, ctx.Tr("user.static.downloadinfo")+setting.AppURL+"api/v1/download_user_define_file?filename="+filename) | |||
| } else { | |||
| mapInterface := make(map[string]interface{}) | |||
| re, count := models.QueryUserStaticDataPage(pageOpts) | |||
| @@ -672,8 +691,11 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { | |||
| t, _ := time.Parse("2006-01-02", date) | |||
| startTime := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()) | |||
| startTime = startTime.UTC() | |||
| endTime := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 0, t.Location()) | |||
| endTime = endTime.UTC() | |||
| log.Info("startTime time:" + startTime.Format("2006-01-02 15:04:05")) | |||
| log.Info("endTime time:" + endTime.Format("2006-01-02 15:04:05")) | |||
| warnEmailMessage := "用户统计信息入库失败,请尽快定位。" | |||
| //query wiki data | |||
| log.Info("start to time count data") | |||
| @@ -323,10 +323,8 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
| m.Get("/dashboard", routers.Dashboard) | |||
| go routers.SocketManager.Run() | |||
| m.Get("/action/notification", routers.ActionNotification) | |||
| m.Get("/recommend/org", routers.RecommendOrgFromPromote) | |||
| m.Get("/recommend/repo", routers.RecommendRepoFromPromote) | |||
| m.Get("/recommend/home", routers.RecommendHomeInfo) | |||
| m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote) | |||
| m.Get("/recommend/imageinfo", routers.GetImageInfoFromPromote) | |||
| m.Post("/all/search/", routers.Search) | |||
| m.Get("/all/search/", routers.EmptySearch) | |||
| m.Get("/all/dosearch/", routers.SearchApi) | |||
| @@ -154,6 +154,12 @@ func GetRecommendRepoFromPromote(filename string) ([]map[string]interface{}, err | |||
| } | |||
| func RecommendFromPromote(url string) ([]string, error) { | |||
| defer func() { | |||
| if err := recover(); err != nil { | |||
| log.Info("not error.", err) | |||
| return | |||
| } | |||
| }() | |||
| resp, err := http.Get(url) | |||
| if err != nil || resp.StatusCode != 200 { | |||
| log.Info("Get organizations url error=" + err.Error()) | |||
| @@ -1,138 +1,171 @@ | |||
| <div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" data-cloudranin-type="{{.cloudbraintype}}"></div> | |||
| <div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" | |||
| data-cloudranin-type="{{.cloudbraintype}}"></div> | |||
| <div class="inline {{if eq .cloudbraintype 0}} required {{end}} field" id="dataset-base"> | |||
| <label>{{.i18n.Tr "dataset.dataset"}}</label> | |||
| <input type="hidden" name="attachment" :value="dataset_uuid"> | |||
| {{if eq .cloudbraintype 0}} | |||
| <input class="disabled" type="text" :value="dataset_name" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}" required onfocus="this.blur();"> | |||
| <input class="disabled" type="text" :value="dataset_name" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}" | |||
| required onfocus="this.blur();"> | |||
| {{else}} | |||
| <input class="disabled" type="text" :value="dataset_name" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}"> | |||
| {{end}} | |||
| <el-button type="text" @click="dialogVisible = true" icon="el-icon-plus" style="color: #0366d6;"> {{.i18n.Tr "dataset.select_dataset"}}</el-button> | |||
| <el-dialog | |||
| title="{{.i18n.Tr "dataset.select_dataset"}}" | |||
| :visible.sync="dialogVisible" | |||
| width="50%" | |||
| > | |||
| <div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;"> | |||
| <i class="search icon"></i> | |||
| <input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem"> | |||
| </div> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name} </span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| <el-button type="text" @click="dialogVisible = true" icon="el-icon-plus" style="color: #0366d6;"> | |||
| {{.i18n.Tr "dataset.select_dataset"}}</el-button> | |||
| <el-dialog title="{{.i18n.Tr "dataset.select_dataset"}}" :visible.sync="dialogVisible" width="50%"> | |||
| <div v-loading="loadingDataIndex" style="position: relative;"> | |||
| <div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;"> | |||
| <i class="search icon"></i> | |||
| <input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem"> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.owner_dataset"}}" name="second"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in myDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name} </span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.owner_dataset"}}" name="second"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in myDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.public_dataset"}}" name="third"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in publicDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.public_dataset"}}" name="third"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in publicDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.I_liked"}}" name="fourth"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in myFavoriteDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.I_liked"}}" name="fourth"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in myFavoriteDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| </el-tabs> | |||
| <div class="center"> | |||
| <el-pagination | |||
| background | |||
| @current-change="handleCurrentChange" | |||
| :current-page="page" | |||
| :page-size="5" | |||
| layout="total,prev, pager, next" | |||
| :total="totalnums"> | |||
| </el-pagination> | |||
| </div> | |||
| </el-tab-pane> | |||
| </el-tabs> | |||
| <div class="center"> | |||
| <el-pagination background @current-change="handleCurrentChange" :current-page="page" :page-size="5" | |||
| layout="total,prev, pager, next" :total="totalnums"> | |||
| </el-pagination> | |||
| </div> | |||
| </div> | |||
| </el-dialog> | |||
| </div> | |||
| </div> | |||
| @@ -1,142 +1,179 @@ | |||
| <div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" data-cloudranin-type="{{.cloudbraintype}}"></div> | |||
| <div class="dataset-repolink" id="dataset-repolink-init" style="display: none;" data-repolink="{{.RepoLink}}" | |||
| data-cloudranin-type="{{.cloudbraintype}}"></div> | |||
| <div class="inline required unite min_title field" id="dataset-base" style="margin-bottom: 0 !important;"> | |||
| {{if or (.benchmarkMode) (.newInference)}} | |||
| <label style="font-weight: normal;">{{if .benchmarkMode}}{{.i18n.Tr "repo.model_manager"}}</label><span> </span>{{else}}{{.i18n.Tr "dataset.dataset"}}</label> {{end}} | |||
| <label | |||
| style="font-weight: normal;">{{if .benchmarkMode}}{{.i18n.Tr "repo.model_manager"}}</label><span> </span>{{else}}{{.i18n.Tr "dataset.dataset"}}</label> {{end}} | |||
| {{else}} | |||
| <label style="font-weight: normal;">{{.i18n.Tr "dataset.dataset"}}</label> | |||
| {{end}} | |||
| <input type="hidden" name="attachment" :value="dataset_uuid"> | |||
| <input class="disabled" type="text" :value="dataset_name" required onfocus="this.blur();" style="width: 48.5%;"> | |||
| <el-button type="text" @click="dialogVisible = true" icon="el-icon-plus" style="color: #0366d6;"> {{if .benchmarkMode}}{{.i18n.Tr "repo.modelarts.infer_job.select_model"}}{{else}}{{.i18n.Tr "dataset.select_dataset"}}{{end}}</el-button> | |||
| <el-button type="text" @click="dialogVisible = true" icon="el-icon-plus" style="color: #0366d6;"> | |||
| {{if .benchmarkMode}}{{.i18n.Tr "repo.modelarts.infer_job.select_model"}}{{else}}{{.i18n.Tr "dataset.select_dataset"}}{{end}} | |||
| </el-button> | |||
| {{if .benchmarkMode}} | |||
| <span class="tooltips" style="display: block;padding-left: 0.5rem;">说明:先使用数据集功能上传模型,然后从数据集列表选模型。</span> | |||
| {{end}} | |||
| <el-dialog | |||
| title="{{.i18n.Tr "dataset.select_dataset"}}" | |||
| :visible.sync="dialogVisible" | |||
| width="50%" | |||
| > | |||
| <div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;"> | |||
| <i class="search icon"></i> | |||
| <input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem"> | |||
| </div> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias} </span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name} </span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| <el-dialog title="{{.i18n.Tr "dataset.select_dataset"}}" :visible.sync="dialogVisible" width="50%"> | |||
| <div v-loading="loadingDataIndex" style="position: relative;"> | |||
| <div class="ui icon input" style="z-index: 9999;position: absolute;right: 50px;height:30px;"> | |||
| <i class="search icon"></i> | |||
| <input type="text" placeholder="{{.i18n.Tr "dataset.search_dataset"}}" v-model="searchDataItem"> | |||
| </div> | |||
| {{if not .benchmarkMode}} | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.owner_dataset"}}" name="second"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in myDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| <el-tabs v-model="activeName" @tab-click="handleClick('{{.RepoLink}}',activeName,{{.cloudbraintype}})"> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.current_project"}}" name="first" v-loading="loadingDataIndex"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in currentRepoDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias} | |||
| </span><img v-if="dataset.Recommend" src="/img/jian.svg" | |||
| style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name} | |||
| </span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.public_dataset"}}" name="third"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in publicDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| {{if not .benchmarkMode}} | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.owner_dataset"}}" name="second" v-loading="loadingDataIndex"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in myDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.I_liked"}}" name="fourth"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" v-for="(dataset,index) in myFavoriteDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.public_dataset"}}" name="third" v-loading="loadingDataIndex"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in publicDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| <el-tab-pane label="{{.i18n.Tr "dataset.I_liked"}}" name="fourth" v-loading="loadingDataIndex"> | |||
| <div style="display: flex;align-items: center;justify-content: space-between;padding: 1rem 0;border-bottom:1px solid #F5F5F5" | |||
| v-for="(dataset,index) in myFavoriteDataset" :key="index"> | |||
| <div style="width: 90%;"> | |||
| <div style="display: flex;align-items: center;"><span | |||
| class="panel_creator_reponam">${dataset.Repo.OwnerName}/${dataset.Repo.Alias}</span><img | |||
| v-if="dataset.Recommend" src="/img/jian.svg" style="margin-left: 0.5rem;"><span | |||
| class="panel_dataset_name">${dataset.Name}</span></div> | |||
| <div style="margin-top: 8px;display: flex;"> | |||
| <a :title="dataset.UserName" style="cursor: default;"> | |||
| <img class="ui avatar mini image" style="width: 20px;height: 20px;" | |||
| :src="dataset.RelAvatarLink"> | |||
| </a> | |||
| <span class="panel_datset_desc">${dataset.Description}</span> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" | |||
| @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" | |||
| data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" | |||
| data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div> | |||
| <button v-if="dataset.DecompressState===1" class="ui primary basic button mini" @click.stop.prevent="selectDataset(dataset.UUID,dataset.Name)">{{.i18n.Tr "dataset.use"}}</button> | |||
| <span v-if="dataset.DecompressState===2" style="display: flex;align-items: center;"> | |||
| <i class="CREATING"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color: #5A5A5A;" data-tooltip="{{$.i18n.Tr "dataset.unzip_tooltips"}}" data-inverted="" data-variation="mini" data-position="left center">解压中</span> | |||
| </span> | |||
| <span v-if="dataset.DecompressState===3" style="display: flex;align-items: center;"> | |||
| <i class="FAILED"></i> | |||
| <span style="margin-left: 0.4em;font-size: 12px;color:red;" data-tooltip="{{$.i18n.Tr "dataset.zip_failed"}}" data-inverted="" data-variation="mini" data-position="left center">解压失败</span> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </el-tab-pane> | |||
| {{end}} | |||
| </el-tabs> | |||
| <div class="center"> | |||
| <el-pagination | |||
| background | |||
| @current-change="handleCurrentChange" | |||
| :current-page="page" | |||
| :page-size="5" | |||
| layout="total,prev, pager, next" | |||
| :total="totalnums"> | |||
| </el-pagination> | |||
| </div> | |||
| </el-tab-pane> | |||
| {{end}} | |||
| </el-tabs> | |||
| <div class="center"> | |||
| <el-pagination background @current-change="handleCurrentChange" :current-page="page" :page-size="5" | |||
| layout="total,prev, pager, next" :total="totalnums"> | |||
| </el-pagination> | |||
| </div> | |||
| </div> | |||
| </el-dialog> | |||
| </div> | |||
| </div> | |||
| @@ -1,4 +1,4 @@ | |||
| <a href="https://openi.org.cn/index.php?m=content&c=index&a=lists&catid=208" target="_blank"><img class="ui mini image" src="https://openi.org.cn/uploadfile/2022/0507/e8bdd42ed598f12.jpg" style="width:100%;"></a> | |||
| <a href="{{.image_link}}" target="_blank"><img class="ui mini image" src="{{.image_url}}" style="width:100%;"></a> | |||
| <div class="ui secondary pointing menu"> | |||
| <div class="active item"> | |||
| @@ -9,14 +9,14 @@ | |||
| <div class="ui sixteen wide computer column list"> | |||
| {{ range .Members}} | |||
| <div class="item ui grid"> | |||
| <div class="three wide mobile two wide tablet two wide computer column"> | |||
| <div class="three wide mobile two wide tablet one wide computer column"> | |||
| <img class="ui avatar" src="{{.SizedRelAvatarLink 48}}"> | |||
| </div> | |||
| <div class="seven wide mobile three wide tablet three wide computer column"> | |||
| <div class="meta"><a href="{{.HomeLink}}">{{.Name}}</a></div> | |||
| <div class="meta">{{.FullName}}</div> | |||
| </div> | |||
| <div class="ui four wide column center tablet only computer only"> | |||
| <div class="ui three wide tablet four wide computer column center tablet only computer only"> | |||
| <div class="meta"> | |||
| {{$.i18n.Tr "org.members.membership_visibility"}} | |||
| </div> | |||
| @@ -48,7 +48,7 @@ | |||
| </style> | |||
| <div class="row"> | |||
| <div class="ui secondary tiny pointing borderless menu center aligned grid mbom"> | |||
| <div class="ui secondary pointing borderless menu center aligned grid mbom"> | |||
| {{with .Org}} | |||
| <a class="{{if $.PageIsOrgHome}}active{{end}} item" href="{{.HomeLink}}"> | |||
| {{svg "octicon-home" 16}} {{$.i18n.Tr "org.home"}} | |||
| @@ -1,60 +1,58 @@ | |||
| {{template "base/head" .}} | |||
| <div class="repository"> | |||
| {{template "repo/header" .}} | |||
| {{template "repo/header" .}} | |||
| <div class="ui container"> | |||
| <input type="hidden" id="postPath" value="{{.Link}}"> | |||
| <div style="width: 80%;margin: auto;"> | |||
| <h4 class="ui top attached header"> | |||
| {{$.i18n.Tr "dataset.upload_dataset_file"}} | |||
| </h4> | |||
| <div class="ui attached segment" style="padding: 2em 3em;"> | |||
| <div class="ui form" id="dataset-base"> | |||
| <el-form label-width="140px"> | |||
| {{.CsrfTokenHtml}} | |||
| <el-form-item label='{{$.i18n.Tr "dataset.dataset_available_clusters"}}:' prop="title"> | |||
| <el-button :class="{active:type==0}" :disabled="clusterFlag" size="small" style="margin: 0;border-radius: 0.28571429rem 0 0 0.28571429rem;" @click="uploadGpu">CPU/GPU</el-button> | |||
| <el-button :class="{active:type==1}" :disabled="clusterFlag" size="small" style="margin: 0 0 0 -4px;border-radius: 0 0.28571429rem 0.28571429rem 0;" @click="uploadNpu">NPU</el-button> | |||
| </el-form-item> | |||
| <el-form-item label='{{$.i18n.Tr "dataset.file_description"}}:' prop="description"> | |||
| <el-input type="textarea" :rows="3" maxlength="255" placeholder="{{$.i18n.Tr "repo.modelarts.train_job.new_place"}}" v-model="desc"></el-input> | |||
| </el-form-item> | |||
| <el-form-item label='{{$.i18n.Tr "dataset.data_upload"}}:' prop="category"> | |||
| <h4 class="ui top attached header"> | |||
| {{$.i18n.Tr "dataset.upload_dataset_file"}} | |||
| </h4> | |||
| <div class="ui attached segment" style="padding: 2em 3em;"> | |||
| <div class="ui form" id="dataset-base"> | |||
| <el-form label-width="140px"> | |||
| {{.CsrfTokenHtml}} | |||
| <el-form-item label='{{$.i18n.Tr "dataset.dataset_available_clusters"}}:' prop="title"> | |||
| <el-button :class="{active:type==0}" :disabled="clusterFlag" size="small" | |||
| style="margin: 0;border-radius: 0.28571429rem 0 0 0.28571429rem;" @click="uploadGpu"> | |||
| CPU/GPU</el-button> | |||
| <el-button :class="{active:type==1}" :disabled="clusterFlag" size="small" | |||
| style="margin: 0 0 0 -4px;border-radius: 0 0.28571429rem 0.28571429rem 0;" | |||
| @click="uploadNpu">NPU</el-button> | |||
| </el-form-item> | |||
| <el-form-item label='{{$.i18n.Tr "dataset.file_description"}}:' prop="description"> | |||
| <el-input type="textarea" :rows="3" maxlength="255" | |||
| placeholder="{{$.i18n.Tr "repo.modelarts.train_job.new_place"}}" v-model="desc"> | |||
| </el-input> | |||
| </el-form-item> | |||
| <el-form-item label='{{$.i18n.Tr "dataset.data_upload"}}:' prop="category"> | |||
| <minio-uploader :uploadtype="type" :desc="desc" @setcluster="setcluster"></minio-uploader> | |||
| </el-form-item> | |||
| <div style='display:none;' | |||
| id="minioUploader-params" | |||
| data-uuid="{{.uuid}}" | |||
| data-add-url="{{.Repository.OwnerName}}/attachments/add" | |||
| data-accepts="{{.AttachmentAllowedTypes}}" | |||
| data-remove-url="{{AppSubUrl}}/attachments/delete" | |||
| data-csrf="{{.CsrfToken}}" | |||
| dataset-id={{.dataset.ID}} | |||
| data-max-file="100" | |||
| data-dataset-id="{{.dataset.ID}}" | |||
| data-max-size="{{.AttachmentMaxSize}}" | |||
| data-default-message="{{.i18n.Tr "dropzone.default_message"}}" | |||
| data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" | |||
| data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" | |||
| data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}" | |||
| data-file-status='{{.i18n.Tr "dropzone.file_status"}}' | |||
| data-file-init-status='{{.i18n.Tr "dropzone.file_init_status"}}' | |||
| data-waitting-uploading='{{.i18n.Tr "dropzone.waitting_uploading"}}' | |||
| data-md5-computing='{{.i18n.Tr "dropzone.md5_computing"}}' | |||
| data-obs-connecting='{{.i18n.Tr "dropzone.obs-connecting"}}' | |||
| data-loading-file='{{.i18n.Tr "dropzone.loading_file"}}' | |||
| data-upload-complete='{{.i18n.Tr "dropzone.upload_complete"}}' | |||
| data-uploading='{{.i18n.Tr "dropzone.uploading"}}' | |||
| data-failed='{{.i18n.Tr "dropzone.failed"}}' | |||
| data-repopath='{{AppSubUrl}}{{$.RepoLink}}/datasets' | |||
| data-cancel='{{.i18n.Tr "cancel"}}' | |||
| data-upload='{{.i18n.Tr "dataset.dataset_upload"}}' | |||
| > | |||
| </el-form-item> | |||
| <div style='display:none;' id="minioUploader-params" data-uuid="{{.uuid}}" | |||
| data-add-url="{{.Repository.OwnerName}}/attachments/add" | |||
| data-accepts="{{.AttachmentAllowedTypes}}" | |||
| data-remove-url="{{AppSubUrl}}/attachments/delete" data-csrf="{{.CsrfToken}}" | |||
| dataset-id={{.dataset.ID}} data-max-file="100" data-dataset-id="{{.dataset.ID}}" | |||
| data-max-size="{{.AttachmentMaxSize}}" | |||
| data-default-message="{{.i18n.Tr "dropzone.default_dataset_message"}}" | |||
| data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" | |||
| data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" | |||
| data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}" | |||
| data-file-status='{{.i18n.Tr "dropzone.file_status"}}' | |||
| data-file-init-status='{{.i18n.Tr "dropzone.file_init_status"}}' | |||
| data-waitting-uploading='{{.i18n.Tr "dropzone.waitting_uploading"}}' | |||
| data-md5-computing='{{.i18n.Tr "dropzone.md5_computing"}}' | |||
| data-obs-connecting='{{.i18n.Tr "dropzone.obs-connecting"}}' | |||
| data-loading-file='{{.i18n.Tr "dropzone.loading_file"}}' | |||
| data-upload-complete='{{.i18n.Tr "dropzone.upload_complete"}}' | |||
| data-uploading='{{.i18n.Tr "dropzone.uploading"}}' | |||
| data-failed='{{.i18n.Tr "dropzone.failed"}}' | |||
| data-repopath='{{AppSubUrl}}{{$.RepoLink}}/datasets' data-cancel='{{.i18n.Tr "cancel"}}' | |||
| data-upload='{{.i18n.Tr "dataset.dataset_upload"}}'> | |||
| </div> | |||
| <div id="datasetId" datasetId="{{.datasetId}}"></div> | |||
| </el-form> | |||
| </div> | |||
| </div> | |||
| </el-form> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div style="width: 80%;margin: auto;padding-top: 2em;"> | |||
| <!-- <p>说明:<br> | |||
| @@ -62,10 +60,11 @@ | |||
| - 云脑1提供 <span class="text blue">CPU / GPU</span> 资源,云脑2提供 <span class="text blue">Ascend NPU</span> 资源;调试使用的数据集也需要上传到对应的环境。 | |||
| </p> --> | |||
| <p style="color: 505559;">{{$.i18n.Tr "dataset.illustrate"}}:</p> | |||
| <p style="line-height: 1.5;color: #101010;">{{$.i18n.Tr "dataset.illustrate.only"}}<span class="text red"> {{$.i18n.Tr "dataset.illustrate.zip"}} </span>{{$.i18n.Tr "dataset.illustrate.fisrt_end"}};</br> | |||
| <p style="line-height: 1.5;color: #101010;">{{$.i18n.Tr "dataset.illustrate.only"}}<span | |||
| class="text red"> {{$.i18n.Tr "dataset.illustrate.zip"}} </span>{{$.i18n.Tr "dataset.illustrate.fisrt_end"}};</br> | |||
| {{$.i18n.Tr "dataset.dataset_explain"}}</p> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| {{template "base/footer" .}} | |||
| @@ -127,6 +127,7 @@ | |||
| </div> | |||
| <form id="form_id" class="ui form" action="{{.Link}}" method="post"> | |||
| {{.CsrfTokenHtml}} | |||
| <input type="hidden" name='isBranches' value="{{.Branches}}"> | |||
| <h3 class="ui top attached header"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| </h3> | |||
| @@ -185,7 +186,8 @@ | |||
| <input id="store_category" type="hidden" name="get_benchmark_category"> | |||
| <div class="inline required field"> | |||
| <label>{{.i18n.Tr "repo.modelarts.code_version"}}</label> | |||
| <select class="ui dropdown width80 left2" id="code_version" name="branch_name"> | |||
| <select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version" | |||
| name="branch_name"> | |||
| {{if .branch_name}} | |||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | |||
| {{range $k, $v :=.Branches}} | |||
| @@ -213,19 +215,6 @@ | |||
| </select> | |||
| </div> | |||
| <!-- <div class="inline required field" style="position: relative;"> | |||
| <label>{{.i18n.Tr "cloudbrain.mirror"}}</label> | |||
| <input type="text" list="cloudbrain_image" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" name="image" required autofocus maxlength="255"> | |||
| <i class="times circle outline icon icons" style="visibility: hidden;" onclick="clearValue()"></i> | |||
| <datalist class="ui search" id="cloudbrain_image" style='width:385px;' name="image"> | |||
| {{range .images}} | |||
| <option name="image" value="{{.Place}}">{{.PlaceView}}</option> | |||
| {{end}} | |||
| {{range .public_images}} | |||
| <option name="image" value="{{.Place}}">{{.PlaceView}}</option> | |||
| {{end}} | |||
| </datalist> | |||
| </div> --> | |||
| <div id="images-new-cb"> | |||
| </div> | |||
| @@ -298,10 +287,6 @@ | |||
| <script> | |||
| let form = document.getElementById('form_id'); | |||
| // let inputs = document.querySelectorAll('input[list]'); | |||
| // inputs[0].addEventListener('change', function() { | |||
| // $(".icon.icons").css("visibility","visible") | |||
| // }); | |||
| $('#messageInfo').css('display', 'none') | |||
| function clearValue() { | |||
| @@ -381,6 +366,9 @@ | |||
| }) | |||
| $('.ui.green.button').click(function () { | |||
| if (!$('input[name="isBranches"]').val()) { | |||
| return false | |||
| } | |||
| selected_value = $("#cloudbrain_benchmark_category").val() | |||
| $('#store_category').attr("value", selected_value) | |||
| }) | |||
| @@ -1,71 +1,77 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .unite { | |||
| font-family: SourceHanSansSC-medium !important; | |||
| color: rgba(16, 16, 16, 100) !important; | |||
| } | |||
| .title { | |||
| font-size: 16px !important; | |||
| padding-left: 3rem !important; | |||
| } | |||
| .min_title { | |||
| font-size: 14px !important; | |||
| padding-left: 6rem !important; | |||
| margin-bottom: 2rem !important; | |||
| } | |||
| .width { | |||
| width: 100% !important; | |||
| } | |||
| .width80 { | |||
| width: 80.7% !important; | |||
| margin-left: 10px; | |||
| } | |||
| .width806 { | |||
| width: 80.6% !important; | |||
| margin-left: -2px; | |||
| } | |||
| .width85 { | |||
| width: 85% !important; | |||
| margin-left: 4.5rem !important; | |||
| } | |||
| .unite{ | |||
| font-family: SourceHanSansSC-medium !important; | |||
| color: rgba(16, 16, 16, 100) !important; | |||
| } | |||
| .title{ | |||
| font-size: 16px !important; | |||
| padding-left: 3rem !important; | |||
| } | |||
| .min_title{ | |||
| font-size: 14px !important; | |||
| padding-left: 6rem !important; | |||
| margin-bottom: 2rem !important; | |||
| } | |||
| .width{ | |||
| width:100% !important; | |||
| } | |||
| .width80{ | |||
| width: 80.7% !important; | |||
| margin-left: 10px; | |||
| } | |||
| .width806{ | |||
| width: 80.6% !important; | |||
| margin-left: -2px; | |||
| } | |||
| .width85{ | |||
| width: 85% !important; | |||
| margin-left: 4.5rem !important; | |||
| } | |||
| .width81{ | |||
| margin-left: 1.5rem !important; | |||
| width: 81% !important; | |||
| } | |||
| .add{font-size: 18px; | |||
| padding: 0.5rem; | |||
| border: 1px solid rgba(187, 187, 187, 100); | |||
| border-radius: 0px 5px 5px 0px; | |||
| line-height: 21px; | |||
| text-align: center; | |||
| color: #C2C7CC; | |||
| } | |||
| .min{ | |||
| font-size: 18px; | |||
| padding: 0.5rem; | |||
| border: 1px solid rgba(187, 187, 187, 100); | |||
| border-radius: 5px 0px 0px 5px; | |||
| line-height: 21px; | |||
| text-align: center; | |||
| color: #C2C7CC; | |||
| } | |||
| .width81 { | |||
| margin-left: 1.5rem !important; | |||
| width: 81% !important; | |||
| } | |||
| .add { | |||
| font-size: 18px; | |||
| padding: 0.5rem; | |||
| border: 1px solid rgba(187, 187, 187, 100); | |||
| border-radius: 0px 5px 5px 0px; | |||
| line-height: 21px; | |||
| text-align: center; | |||
| color: #C2C7CC; | |||
| } | |||
| .min { | |||
| font-size: 18px; | |||
| padding: 0.5rem; | |||
| border: 1px solid rgba(187, 187, 187, 100); | |||
| border-radius: 5px 0px 0px 5px; | |||
| line-height: 21px; | |||
| text-align: center; | |||
| color: #C2C7CC; | |||
| } | |||
| </style> | |||
| <!-- <div class="ui page dimmer"> | |||
| <div class="ui text loader">{{.i18n.Tr "loading"}}</div> | |||
| </div> --> | |||
| <div id="mask"> | |||
| <div id="loadingPage"> | |||
| <div class="rect1"></div> | |||
| <div class="rect2"></div> | |||
| <div class="rect3"></div> | |||
| <div class="rect4"></div> | |||
| <div class="rect5"></div> | |||
| </div> | |||
| <div id="loadingPage"> | |||
| <div class="rect1"></div> | |||
| <div class="rect2"></div> | |||
| <div class="rect3"></div> | |||
| <div class="rect4"></div> | |||
| <div class="rect5"></div> | |||
| </div> | |||
| </div> | |||
| <div class="repository"> | |||
| {{template "repo/header" .}} | |||
| @@ -86,68 +92,82 @@ | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label> | |||
| <div class="ui blue mini menu compact selectcloudbrain"> | |||
| <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create"> | |||
| <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> | |||
| <path fill="none" d="M0 0h24v24H0z"/> | |||
| <path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
| <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" | |||
| height="16"> | |||
| <path fill="none" d="M0 0h24v24H0z" /> | |||
| <path | |||
| d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" /> | |||
| </svg> | |||
| CPU/GPU | |||
| </a> | |||
| <a class="item" href="{{.RepoLink}}/modelarts/train-job/create"> | |||
| <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> | |||
| <path fill="none" d="M0 0h24v24H0z"/> | |||
| <path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> | |||
| <svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" | |||
| height="16"> | |||
| <path fill="none" d="M0 0h24v24H0z" /> | |||
| <path | |||
| d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" /> | |||
| </svg> | |||
| Ascend NPU</a> | |||
| </div> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | |||
| <input style="width: 60%;" name="display_job_name" id="display_job_name" placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required maxlength="64"> | |||
| <input style="width: 60%;" name="display_job_name" id="display_job_name" | |||
| placeholder={{.i18n.Tr "repo.modelarts.train_job.job_name"}} value="{{.display_job_name}}" | |||
| tabindex="3" onkeyup="this.value=this.value.replace(/[, ]/g,'')" autofocus required | |||
| maxlength="64"> | |||
| <span class="tooltips" style="display: block;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span> | |||
| </div> | |||
| <div class="unite min_title inline field"> | |||
| <label style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> | |||
| <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea> | |||
| <label style="font-weight: normal;" | |||
| for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> | |||
| <textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" | |||
| placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} | |||
| onchange="this.value=this.value.substring(0, 255)" | |||
| onkeydown="this.value=this.value.substring(0, 255)" | |||
| onkeyup="this.value=this.value.substring(0, 255)"></textarea> | |||
| </div> | |||
| <div class="ui divider"></div> | |||
| <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | |||
| <select class="ui dropdown width80 left2" id="code_version" name="branch_name"> | |||
| {{if .branch_name}} | |||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | |||
| {{range $k, $v :=.Branches}} | |||
| {{ if ne $v $.branch_name }} | |||
| <option name="branch_name" value="{{$v}}">{{$v}}</option> | |||
| {{end}} | |||
| {{end}} | |||
| {{else}} | |||
| <option name="branch_name" value="{{.branchName}}">{{.branchName}}</option> | |||
| {{range $k, $v :=.Branches}} | |||
| {{ if ne $v $.branchName }} | |||
| <option name="branch_name" value="{{$v}}">{{$v}}</option> | |||
| {{end}} | |||
| {{end}} | |||
| {{end}} | |||
| </select> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> | |||
| <select class="ui dropdown width80 left2" id="code_version" name="branch_name"> | |||
| {{if .branch_name}} | |||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | |||
| {{range $k, $v :=.Branches}} | |||
| {{ if ne $v $.branch_name }} | |||
| <option name="branch_name" value="{{$v}}">{{$v}}</option> | |||
| {{end}} | |||
| {{end}} | |||
| {{else}} | |||
| <option name="branch_name" value="{{.branchName}}">{{.branchName}}</option> | |||
| {{range $k, $v :=.Branches}} | |||
| {{ if ne $v $.branchName }} | |||
| <option name="branch_name" value="{{$v}}">{{$v}}</option> | |||
| {{end}} | |||
| {{end}} | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline required field" style="display: none;"> | |||
| <label>{{.i18n.Tr "cloudbrain.task_type"}}</label> | |||
| <select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' name="job_type"> | |||
| <select id="cloudbrain_job_type" class="ui search dropdown" placeholder="选择任务类型" style='width:385px' | |||
| name="job_type"> | |||
| <option name="job_type" value="TRAIN">TRAIN</option> | |||
| </select> | |||
| </div> | |||
| <div class="required unite min_title inline field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label> | |||
| <select id="cloudbrain_gpu_type" class="ui search width806 dropdown" placeholder="选择GPU类型" style='width:385px' name="gpu_type"> | |||
| <select id="cloudbrain_gpu_type" class="ui search width806 dropdown" placeholder="选择GPU类型" | |||
| style='width:385px' name="gpu_type"> | |||
| {{range .train_gpu_types}} | |||
| <option value="{{.Queue}}">{{.Value}}</option> | |||
| <option value="{{.Queue}}">{{.Value}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| @@ -171,65 +191,75 @@ | |||
| </div> | |||
| <div class="inline unite min_title field required"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | |||
| {{if .bootFile}} | |||
| <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" tabindex="3" autofocus required maxlength="255" > | |||
| {{else}} | |||
| <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" autofocus required maxlength="255" > | |||
| {{end}} | |||
| <span> | |||
| <i class="question circle icon link" data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} data-position="right center" data-variation="mini"></i> | |||
| </span> | |||
| <a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.start_file"}}</label> | |||
| {{if .bootFile}} | |||
| <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="{{.bootFile}}" | |||
| tabindex="3" autofocus required maxlength="255"> | |||
| {{else}} | |||
| <input style="width: 48.5%;" name="boot_file" id="trainjob_boot_file" value="" tabindex="3" | |||
| autofocus required maxlength="255"> | |||
| {{end}} | |||
| <span> | |||
| <i class="question circle icon link" | |||
| data-content={{.i18n.Tr "repo.modelarts.train_job.boot_file_helper"}} | |||
| data-position="right center" data-variation="mini"></i> | |||
| </span> | |||
| <a href="https://git.openi.org.cn/OpenIOSSG/MNIST_PytorchExample_GPU" target="_blank">查看样例</a> | |||
| </div> | |||
| {{template "custom/select_dataset_train" .}} | |||
| <span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> | |||
| <span class="tooltips" | |||
| style="margin-left: 11.5rem;margin-bottom: 2rem;">训练脚本存储在/code中,数据集存储在/dataset中,训练输出请存储在/model中以供后续下载。</span> | |||
| <div class="inline unite min_title field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | |||
| <span id="add_run_para" style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | |||
| <input id="store_run_para" type="hidden" name="run_para_list"> | |||
| <span id="add_run_para" | |||
| style="margin-left: 0.5rem;cursor:pointer;color: rgba(3, 102, 214, 100);font-size: 14px;line-height: 26px;font-family: SourceHanSansSC-medium;"><i | |||
| class="plus square outline icon"></i>{{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}}</span> | |||
| <input id="store_run_para" type="hidden" name="run_para_list"> | |||
| <div class="dynamic field" style="margin-top: 1rem;"> | |||
| {{if .params}} | |||
| {{if .params}} | |||
| {{if ne 0 (len .params)}} | |||
| {{range $k ,$v := .params}} | |||
| <div class="two fields width85" id="para{{$k}}"> | |||
| <div class="field"> | |||
| <input type="text" name="shipping_first-name" value={{$v.Label}} required> | |||
| </div> | |||
| <div class="field"> | |||
| <input type="text" name="shipping_last-name" value={{$v.Value}} required> | |||
| </div> | |||
| <span> | |||
| <i class="trash icon"></i> | |||
| </span> | |||
| </div> | |||
| {{end}} | |||
| {{range $k ,$v := .params}} | |||
| <div class="two fields width85" id="para{{$k}}"> | |||
| <div class="field"> | |||
| <input type="text" name="shipping_first-name" value={{$v.Label}} required> | |||
| </div> | |||
| <div class="field"> | |||
| <input type="text" name="shipping_last-name" value={{$v.Value}} required> | |||
| </div> | |||
| <span> | |||
| <i class="trash icon"></i> | |||
| </span> | |||
| </div> | |||
| {{end}} | |||
| {{end}} | |||
| {{end}} | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| <div class="required inline unite min_title field"> | |||
| <div class="required inline unite min_title field"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
| <select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格" style='width:385px' name="resource_spec_id"> | |||
| <select id="cloudbrain_resource_spec" class="ui search dropdown" placeholder="选择资源规格" | |||
| style='width:385px' name="resource_spec_id"> | |||
| {{range .train_resource_specs}} | |||
| <option name="resource_spec_id" value="{{.Id}}">GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option> | |||
| <option name="resource_spec_id" value="{{.Id}}"> | |||
| GPU数:{{.GpuNum}},CPU数:{{.CpuNum}},内存(MB):{{.MemMiB}},共享内存(MB):{{.ShareMemMiB}}</option> | |||
| {{end}} | |||
| </select> | |||
| </div> | |||
| <div class="inline unite min_title field"> | |||
| <button class="ui create_train_job green button"> | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||
| </button> | |||
| <a class="ui button" href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||
| <a class="ui button" | |||
| href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||
| </div> | |||
| <!-- 模态框 --> | |||
| </form> | |||
| </div> | |||
| </div> | |||
| @@ -246,202 +276,210 @@ | |||
| .tab(); | |||
| let sever_num = $('#trainjob_work_server_num') | |||
| $('.add').click(function(){ | |||
| sever_num.val(parseInt(sever_num.val())+1) | |||
| if(sever_num.val()>=26){ | |||
| sever_num.val(parseInt(sever_num.val())-1) | |||
| $('.add').click(function () { | |||
| sever_num.val(parseInt(sever_num.val()) + 1) | |||
| if (sever_num.val() >= 26) { | |||
| sever_num.val(parseInt(sever_num.val()) - 1) | |||
| } | |||
| }) | |||
| $('.min').click(function(){ | |||
| sever_num.val(parseInt(sever_num.val())-1) | |||
| if(sever_num.val()<=0){ | |||
| sever_num.val(parseInt(sever_num.val())+1) | |||
| $('.min').click(function () { | |||
| sever_num.val(parseInt(sever_num.val()) - 1) | |||
| if (sever_num.val() <= 0) { | |||
| sever_num.val(parseInt(sever_num.val()) + 1) | |||
| } | |||
| }) | |||
| // 参数增加、删除、修改、保存 | |||
| function Add_parameter(i){ | |||
| value = '<div class="two fields width85" id= "para'+ i +'">' + | |||
| '<div class="field">' + | |||
| '<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' + | |||
| '</div> ' + | |||
| '<div class="field"> ' + | |||
| '<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' + | |||
| '</div>'+ | |||
| '<span>' + | |||
| '<i class="trash icon">' + | |||
| '</i>' + | |||
| '</span>' + | |||
| '</div>' | |||
| function Add_parameter(i) { | |||
| value = '<div class="two fields width85" id= "para' + i + '">' + | |||
| '<div class="field">' + | |||
| '<input type="text" name="shipping_first-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_name"}}> ' + | |||
| '</div> ' + | |||
| '<div class="field"> ' + | |||
| '<input type="text" name="shipping_last-name" required placeholder={{.i18n.Tr "repo.modelarts.train_job.parameter_value"}}>' + | |||
| '</div>' + | |||
| '<span>' + | |||
| '<i class="trash icon">' + | |||
| '</i>' + | |||
| '</span>' + | |||
| '</div>' | |||
| $(".dynamic.field").append(value) | |||
| } | |||
| } | |||
| $('#add_run_para').click(function(){ | |||
| $('#add_run_para').click(function () { | |||
| var len = $(".dynamic.field .two.fields").length | |||
| Add_parameter(len) | |||
| }); | |||
| $(".dynamic.field").on("click",".trash.icon", function() { | |||
| $(".dynamic.field").on("click", ".trash.icon", function () { | |||
| var index = $(this).parent().parent().index() | |||
| $(this).parent().parent().remove() | |||
| var len = $(".dynamic.field .two.fields").length | |||
| $(".dynamic.field .two.fields").each(function(){ | |||
| $(".dynamic.field .two.fields").each(function () { | |||
| var cur_index = $(this).index() | |||
| $(this).attr('id', 'para' + cur_index) | |||
| }) | |||
| }); | |||
| $('.ui.parameter.green.button').click(function(){ | |||
| $('.ui.parameter.green.button').click(function () { | |||
| var parameters = []; | |||
| $('table tr').each(function() { | |||
| $(this).find('td:eq(1)').each(function(){ | |||
| $('table tr').each(function () { | |||
| $(this).find('td:eq(1)').each(function () { | |||
| parameters.push($(this).text()); | |||
| }) | |||
| $(this).find('input').each(function(){ | |||
| $(this).find('input').each(function () { | |||
| parameters.push($(this).text()) | |||
| }) | |||
| }); | |||
| $('.ui.parameter.modal') | |||
| .modal('hide'); | |||
| for(var i = 2; i < parameters.length; i++){ | |||
| switch(i) { | |||
| // 数据集uuid待完成 | |||
| // case (2): | |||
| // console.log(1) | |||
| // break; | |||
| // $("#trainjob_datasets").val(parameters[i]); | |||
| // console.log($("#trainjob_datasets").val()) | |||
| case (3): | |||
| $("input[name='boot_file']").val(parameters[i]); | |||
| break; | |||
| case (4): | |||
| var para = parameters[i].split(" ") | |||
| for(var j = 0; j < para.length; j++){ | |||
| var para_name = para[j].split('=')[0] | |||
| var para_value = para[j].split('=')[1] | |||
| var len = $(".dynamic.field .two.fields").length | |||
| Add_parameter(len) | |||
| var pid = 'para' + len | |||
| $(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_first-name]").val(para_name) | |||
| $(".dynamic.field"+ " #" + pid + "").find("input[name=shipping_last-name]").val(para_value) | |||
| } | |||
| break; | |||
| // 数据集pool_id待完成 | |||
| // case (5): | |||
| // $("select[name='pool_id']").val(parameters[i]); | |||
| // break; | |||
| case (6): | |||
| $("input[name='work_server_number']").val(parameters[i]); | |||
| break; | |||
| } | |||
| for (var i = 2; i < parameters.length; i++) { | |||
| switch (i) { | |||
| // 数据集uuid待完成 | |||
| // case (2): | |||
| // console.log(1) | |||
| // break; | |||
| // $("#trainjob_datasets").val(parameters[i]); | |||
| // console.log($("#trainjob_datasets").val()) | |||
| case (3): | |||
| $("input[name='boot_file']").val(parameters[i]); | |||
| break; | |||
| case (4): | |||
| var para = parameters[i].split(" ") | |||
| for (var j = 0; j < para.length; j++) { | |||
| var para_name = para[j].split('=')[0] | |||
| var para_value = para[j].split('=')[1] | |||
| var len = $(".dynamic.field .two.fields").length | |||
| Add_parameter(len) | |||
| var pid = 'para' + len | |||
| $(".dynamic.field" + " #" + pid + "").find("input[name=shipping_first-name]").val(para_name) | |||
| $(".dynamic.field" + " #" + pid + "").find("input[name=shipping_last-name]").val(para_value) | |||
| } | |||
| break; | |||
| // 数据集pool_id待完成 | |||
| // case (5): | |||
| // $("select[name='pool_id']").val(parameters[i]); | |||
| // break; | |||
| case (6): | |||
| $("input[name='work_server_number']").val(parameters[i]); | |||
| break; | |||
| } | |||
| } | |||
| }) | |||
| $('.ui.save.checkbox').click(function(){ | |||
| $('.ui.save.checkbox').click(function () { | |||
| $(this).checkbox({ | |||
| onChange: function(){ | |||
| if ($('.ui.save.checkbox').checkbox('is checked')){ | |||
| onChange: function () { | |||
| if ($('.ui.save.checkbox').checkbox('is checked')) { | |||
| $('#save_para').removeClass("disabled") | |||
| }else{ | |||
| $('#save_para').addClass("disabled") | |||
| } else { | |||
| $('#save_para').addClass("disabled") | |||
| } | |||
| } | |||
| }); | |||
| }) | |||
| $('.question.circle.icon').hover(function(){ | |||
| $('.question.circle.icon').hover(function () { | |||
| $(this).popup('show') | |||
| }); | |||
| $(".item.active.parameter_config").click(function(){ | |||
| $(".item.active.parameter_config").click(function () { | |||
| $('.ui.parameter.modal') | |||
| .modal('setting', 'closable', false) | |||
| .modal('show'); | |||
| }) | |||
| $('.ui.deny.button').click(function(){ | |||
| $('.ui.deny.button').click(function () { | |||
| $('.ui.parameter.modal') | |||
| .modal('hide'); | |||
| }) | |||
| $('select.dropdown') | |||
| .dropdown(); | |||
| function validate(){ | |||
| function validate() { | |||
| $('.ui.form') | |||
| .form({ | |||
| on: 'blur', | |||
| fields: { | |||
| boot_file: { | |||
| identifier : 'boot_file', | |||
| rules: [ | |||
| { | |||
| type: 'regExp[/.+\.py$/g]', | |||
| .form({ | |||
| on: 'blur', | |||
| fields: { | |||
| boot_file: { | |||
| identifier: 'boot_file', | |||
| rules: [ | |||
| { | |||
| type: 'regExp[/.+\.py$/g]', | |||
| } | |||
| ] | |||
| }, | |||
| display_job_name: { | |||
| identifier: 'display_job_name', | |||
| rules: [ | |||
| { | |||
| type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]', | |||
| } | |||
| ] | |||
| }, | |||
| attachment: { | |||
| identifier: 'attachment', | |||
| rules: [ | |||
| { | |||
| type: 'empty', | |||
| } | |||
| ] | |||
| }, | |||
| work_server_number: { | |||
| identifier: 'work_server_number', | |||
| rules: [ | |||
| { | |||
| type: 'integer[1..25]', | |||
| } | |||
| ] | |||
| }, | |||
| branch_name: { | |||
| identifier: 'branch_name', | |||
| rules: [ | |||
| { | |||
| type: 'empty', | |||
| } | |||
| ] | |||
| } | |||
| ] | |||
| }, | |||
| display_job_name:{ | |||
| identifier : 'display_job_name', | |||
| rules: [ | |||
| { | |||
| type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]', | |||
| } | |||
| ] | |||
| onSuccess: function () { | |||
| // $('.ui.page.dimmer').dimmer('show') | |||
| document.getElementById("mask").style.display = "block" | |||
| }, | |||
| attachment:{ | |||
| identifier : 'attachment', | |||
| rules: [ | |||
| { | |||
| type: 'empty', | |||
| } | |||
| ] | |||
| }, | |||
| work_server_number: { | |||
| identifier : 'work_server_number', | |||
| rules: [ | |||
| { | |||
| type : 'integer[1..25]', | |||
| } | |||
| ] | |||
| onFailure: function (e) { | |||
| return false; | |||
| } | |||
| }, | |||
| onSuccess: function(){ | |||
| // $('.ui.page.dimmer').dimmer('show') | |||
| document.getElementById("mask").style.display = "block" | |||
| }, | |||
| onFailure: function(e){ | |||
| return false; | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| document.onreadystatechange = function() { | |||
| document.onreadystatechange = function () { | |||
| if (document.readyState === "complete") { | |||
| document.getElementById("mask").style.display = "none" | |||
| } | |||
| } | |||
| function send_run_para(){ | |||
| function send_run_para() { | |||
| var run_parameters = [] | |||
| var msg = {} | |||
| $(".dynamic.field .two.fields").each(function(){ | |||
| $(".dynamic.field .two.fields").each(function () { | |||
| var para_name = $(this).find('input[name=shipping_first-name]').val() | |||
| var para_value = $(this).find('input[name=shipping_last-name]').val() | |||
| run_parameters.push({"label": para_name, "value": para_value}) | |||
| run_parameters.push({ "label": para_name, "value": para_value }) | |||
| }) | |||
| msg["parameter"] = run_parameters | |||
| msg = JSON.stringify(msg) | |||
| $('#store_run_para').val(msg) | |||
| } | |||
| function get_name(){ | |||
| let name1=$("#engine_name .text").text() | |||
| let name2=$("#flaver_name .text").text() | |||
| function get_name() { | |||
| let name1 = $("#engine_name .text").text() | |||
| let name2 = $("#flaver_name .text").text() | |||
| $("input#ai_engine_name").val(name1) | |||
| $("input#ai_flaver_name").val(name2) | |||
| } | |||
| $('.ui.create_train_job.green.button').click(function(e) { | |||
| $('.ui.create_train_job.green.button').click(function (e) { | |||
| get_name() | |||
| send_run_para() | |||
| validate() | |||
| validate() | |||
| }) | |||
| </script> | |||
| @@ -7,6 +7,8 @@ | |||
| background: #FFF !important; | |||
| } | |||
| .dataset_title { | |||
| font-size: 14px; | |||
| max-width: 80%; | |||
| @@ -116,6 +118,20 @@ | |||
| .diy-popper { | |||
| max-width: 400px; | |||
| } | |||
| .ascending { | |||
| width: 0; | |||
| height: 0; | |||
| border: 5px solid transparent; | |||
| border-bottom-color: #c0c4cc; | |||
| } | |||
| .descending { | |||
| width: 0; | |||
| height: 0; | |||
| border: 5px solid transparent; | |||
| border-top-color: #c0c4cc; | |||
| } | |||
| </style> | |||
| <div class="repository"> | |||
| {{template "repo/header" .}} | |||
| @@ -211,11 +227,25 @@ | |||
| <div class="ui grid stackable" style="background: #f0f0f0;;"> | |||
| <div class="row"> | |||
| <!-- 数据集名称 --> | |||
| <div class="four wide column" style="width: 24% !important;"> | |||
| <span style="margin:0 6px">{{$.i18n.Tr "dataset.dataset_file_name"}}</span> | |||
| <div class="four wide column name_sort" @click="sortAble('name')" | |||
| style="width: 24% !important;cursor: pointer;"> | |||
| {{$.i18n.Tr "dataset.dataset_file_name"}} | |||
| <span class="caret-wrapper"> | |||
| <i class='ascending sort-caret-up {{if eq .SortType "nameAsc"}} active-up-sort {{end}}' | |||
| @click.stop="sortIcon('name','up')"></i> | |||
| <i class='descending sort-caret-down {{if eq .SortType "nameDesc"}} active-down-sort {{end}}' | |||
| @click.stop="sortIcon('name','down')"></i> | |||
| </span> | |||
| </div> | |||
| <div class="one wide column text center" style="width: 7.25% !important;"> | |||
| <div class="one wide column text center size_sort" @click="sortAble('size')" | |||
| style="width: 7.25% !important;cursor: pointer;"> | |||
| {{$.i18n.Tr "repo.model.manage.size"}} | |||
| <span class="caret-wrapper"> | |||
| <i class='ascending sort-caret-up {{if eq .SortType "sizeAsc"}} active-up-sort {{end}}' | |||
| @click.stop="sortIcon('size','up')"></i> | |||
| <i class='descending sort-caret-down {{if eq .SortType "sizeDesc"}} active-down-sort {{end}}' | |||
| @click.stop="sortIcon('size','down')"></i> | |||
| </span> | |||
| </div> | |||
| <div class="two wide column text center"> | |||
| {{$.i18n.Tr "dataset.dataset_available_clusters"}} | |||
| @@ -226,8 +256,14 @@ | |||
| <div class="one wide column text center"> | |||
| {{$.i18n.Tr "repo.cloudbrain_creator"}} | |||
| </div> | |||
| <div class="three wide column text center"> | |||
| <div class="three wide column text center" @click="sortAble('time')" style="cursor: pointer;"> | |||
| {{$.i18n.Tr "dataset.dataset_upload_time"}} | |||
| <span class="caret-wrapper"> | |||
| <i class='ascending sort-caret-up {{if eq .SortType "timeAsc"}} active-up-sort {{end}}' | |||
| @click.stop="sortIcon('time','up')"></i> | |||
| <i class='descending sort-caret-down {{if eq .SortType "timeDesc"}} active-down-sort {{end}}' | |||
| @click.stop="sortIcon('time','down')"></i> | |||
| </span> | |||
| </div> | |||
| <div class="four wide column text center"> | |||
| {{$.i18n.Tr "repo.cloudbrain_operate"}} | |||
| @@ -163,4 +163,10 @@ | |||
| </div> | |||
| </div> | |||
| </repo-search> | |||
| <div class="ui hidden divider"></div> | |||
| <div> | |||
| <a href="{{.image_link}}" target="_blank"> | |||
| <img src="{{.image_url}}" class="ui fluid image" alt=""> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| @@ -1,86 +1,93 @@ | |||
| <template> | |||
| <div style="width: 100%;"> | |||
| <div id = "pro_main"> | |||
| <div id="pro_main"> | |||
| <div style="margin-top: 10px;"> | |||
| <b class="pro_item">云脑分析</b> <span class="update_time">数据更新时间:</span> <span style="font-size: 12px;">{{lastUpdatedTime}} / 从有记录起开始统计</span> | |||
| <b class="pro_item">云脑分析</b> <span class="update_time">数据更新时间:</span> <span | |||
| style="font-size: 12px;">{{lastUpdatedTime}} / 从有记录起开始统计</span> | |||
| </div> | |||
| <bar-label :width="'95%'" :height="'500px'"></bar-label> | |||
| <div style="margin-top: 20px;"> | |||
| <span class="sta_iterm">统计周期:</span> | |||
| <button type="button" class='btnLast' id = "all" v-bind:class="{colorChange:7==dynamic}" @click="resetPage(),getAllProList('all',7)">所有</button> | |||
| <span class="sta_iterm">统计周期:</span> | |||
| <button type="button" class='btnLast' id="all" v-bind:class="{colorChange:7==dynamic}" | |||
| @click="resetPage(),getAllProList('all',7)">所有</button> | |||
| <span style="float:right; margin-right: 20px;"> | |||
| <div style="display:inline-block;margin-left: 40px; "> | |||
| <a class="el-icon-download" v-if="tableData!=''" :href= "'../api/v1/cloudbrainboard/downloadAll'"></a> | |||
| <i class="el-icon-download" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i> | |||
| <a class="el-icon-download" v-if="tableData!=''" | |||
| :href="'/api/v1/cloudbrainboard/downloadAll'"></a> | |||
| <i class="el-icon-download" v-else="tableData=''" href="#" | |||
| style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i> | |||
| <!-- <span ><a id = "download_file" :href= "'../api/v1/projectboard/downloadAll'" >下载报告</a> </span> --> | |||
| <span > | |||
| <a id = "download_file" v-if="tableData!=''" :href= "'../api/v1/cloudbrainboard/downloadAll'">下载报告</a> | |||
| <a id = "download_file" v-else="tableData=''" href= "#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'>下载报告</a> | |||
| <span> | |||
| <a id="download_file" v-if="tableData!=''" | |||
| :href="'/api/v1/cloudbrainboard/downloadAll'">下载报告</a> | |||
| <a id="download_file" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" | |||
| @click='popMark()'>下载报告</a> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| // import barLabel from './basic/barLabel.vue'; | |||
| const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | |||
| </template> | |||
| <script> | |||
| // import barLabel from './basic/barLabel.vue'; | |||
| const { AppSubUrl, StaticUrlPrefix, csrf } = window.config; | |||
| import { export2Excel } from '../excel/util.js' | |||
| export default{ | |||
| name:'ProAnalysis', | |||
| components: { | |||
| // barLabel, | |||
| import { export2Excel } from '../excel/util.js' | |||
| export default { | |||
| name: 'ProAnalysis', | |||
| components: { | |||
| // barLabel, | |||
| }, | |||
| methods: { | |||
| popMark() { | |||
| alert("数据为空时,不能下载!") | |||
| }, | |||
| methods: { | |||
| popMark(){ | |||
| exportData() { | |||
| // this.getOneProList(this.pro_id,'all',true,7) | |||
| // this.getOneProList(this.pro_id,'all',false,7) | |||
| // this.fileName() | |||
| if (this.tableDataID != '') { | |||
| this.currentPage = 1 | |||
| var saveFileName = this.getFileName() | |||
| export2Excel(this.columns, this.tableDataID, saveFileName) | |||
| } else { | |||
| alert("数据为空时,不能下载!") | |||
| }, | |||
| exportData(){ | |||
| // this.getOneProList(this.pro_id,'all',true,7) | |||
| // this.getOneProList(this.pro_id,'all',false,7) | |||
| // this.fileName() | |||
| if (this.tableDataID!=''){ | |||
| this.currentPage=1 | |||
| var saveFileName = this.getFileName() | |||
| export2Excel(this.columns,this.tableDataID,saveFileName) | |||
| }else{ | |||
| alert("数据为空时,不能下载!") | |||
| } | |||
| }, | |||
| } | |||
| }, | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| .pro_item{ | |||
| font-size: 16px; | |||
| color: rgba(16, 16, 16, 100); | |||
| font-family: SourceHanSansSC-bold; | |||
| } | |||
| .update_time{ | |||
| line-height: 17px; | |||
| font-size: 12px; | |||
| color:rgba(187, 187, 187, 100); | |||
| margin-left: 10px; | |||
| } | |||
| .btnLast{ | |||
| line-height: 1.5; | |||
| margin: -3.5px; | |||
| border: 1px solid rgba(22, 132, 252, 100); | |||
| /* border-right: none; */ | |||
| background: #FFFF; | |||
| color: #1684FC; | |||
| width: 60px; | |||
| height: 30px; | |||
| border-radius:0px 4px 4px 0px; | |||
| } | |||
| }, | |||
| } | |||
| </script> | |||
| <style scoped> | |||
| .pro_item { | |||
| font-size: 16px; | |||
| color: rgba(16, 16, 16, 100); | |||
| font-family: SourceHanSansSC-bold; | |||
| } | |||
| .update_time { | |||
| line-height: 17px; | |||
| font-size: 12px; | |||
| color: rgba(187, 187, 187, 100); | |||
| margin-left: 10px; | |||
| } | |||
| </style> | |||
| .btnLast { | |||
| line-height: 1.5; | |||
| margin: -3.5px; | |||
| border: 1px solid rgba(22, 132, 252, 100); | |||
| /* border-right: none; */ | |||
| background: #FFFF; | |||
| color: #1684FC; | |||
| width: 60px; | |||
| height: 30px; | |||
| border-radius: 0px 4px 4px 0px; | |||
| } | |||
| </style> | |||
| @@ -213,6 +213,18 @@ | |||
| label="被推荐镜像数" | |||
| width="120px" | |||
| align="center"> | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="Email" | |||
| label="Email" | |||
| width="120px" | |||
| align="center"> | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="UserLocation" | |||
| label="用户所在地址" | |||
| width="120px" | |||
| align="center"> | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="RegistDate" | |||
| @@ -267,7 +279,7 @@ | |||
| value_time: '', | |||
| search:'', | |||
| data:'', | |||
| columns: [{title: 'ID',key: 'ID'},{title: '用户名',key: 'Name'},{title: 'PR数',key: 'CodeMergeCount'},{title: 'commit数',key:'CommitCount'},{title: '提出任务数',key: 'IssueCount'},{title: '评论数',key: 'CommentCount'},{title: '关注项目数',key: 'FocusRepoCount'},{title: '点赞项目数',key: 'StarRepoCount'},{title: '登录次数',key: 'LoginCount'},{title:'关注者数',key:'WatchedCount'},{title:'commit代码行数',key:'CommitCodeSize'},{title:'已解决任务数',key:'SolveIssueCount'},{title:'百科页面贡献次数',key:'EncyclopediasCount'},{title:'创建项目',key:'CreateRepoCount'},{title:'用户注册时间',key:'RegistDate'},{title:'云脑任务数',key:'CloudBrainTaskNum'},{title:'云脑运行时间(小时)',key:'CloudBrainRunTime'},{title:'上传(提交)数据集文件数',key:'CommitDatasetNum'},{title:'提交模型数',key:'CommitModelCount'},{title:'归一化用户指数',key:'UserIndex'},{title:'用户指数',key:'UserIndexPrimitive'},{title:'关注他人数',key:'FocusOtherUser'},{title:'收藏数据集',key:'CollectDataset'},{title:'被收藏数据集',key:'CollectedDataset'},{title:'被推荐数据集数',key:'RecommendDataset'},{title:'收藏镜像数',key:'CollectImage'},{title:'被收藏镜像数',key:'CollectedImage'},{title:'被推荐镜像数',key:'RecommendImage'},{title:'系统统计时间',key:'CountDate'}], | |||
| columns: [{title: 'ID',key: 'ID'},{title: '用户名',key: 'Name'},{title: 'PR数',key: 'CodeMergeCount'},{title: 'commit数',key:'CommitCount'},{title: '提出任务数',key: 'IssueCount'},{title: '评论数',key: 'CommentCount'},{title: '关注项目数',key: 'FocusRepoCount'},{title: '点赞项目数',key: 'StarRepoCount'},{title: '登录次数',key: 'LoginCount'},{title:'关注者数',key:'WatchedCount'},{title:'commit代码行数',key:'CommitCodeSize'},{title:'已解决任务数',key:'SolveIssueCount'},{title:'百科页面贡献次数',key:'EncyclopediasCount'},{title:'创建项目',key:'CreateRepoCount'},{title:'用户注册时间',key:'RegistDate'},{title:'云脑任务数',key:'CloudBrainTaskNum'},{title:'云脑运行时间(小时)',key:'CloudBrainRunTime'},{title:'上传(提交)数据集文件数',key:'CommitDatasetNum'},{title:'提交模型数',key:'CommitModelCount'},{title:'归一化用户指数',key:'UserIndex'},{title:'用户指数',key:'UserIndexPrimitive'},{title:'关注他人数',key:'FocusOtherUser'},{title:'收藏数据集',key:'CollectDataset'},{title:'被收藏数据集',key:'CollectedDataset'},{title:'被推荐数据集数',key:'RecommendDataset'},{title:'收藏镜像数',key:'CollectImage'},{title:'被收藏镜像数',key:'CollectedImage'},{title:'被推荐镜像数',key:'RecommendImage'},{title:'Email',key:'Email'},{title:'用户所在地址',key:'UserLocation'},{title:'系统统计时间',key:'CountDate'}], | |||
| blob:'', | |||
| fileName:'', | |||
| dynamic:7, | |||
| @@ -13,7 +13,7 @@ | |||
| <span class="yesterday_blk yesterday_title" >昨日新增注册用户数 </span> | |||
| <span class="yesterday_blk yesterday_color1 yesterday_pdrt yesterday_text">未激活:<span class="bold_num">{{ tableDataYesterday.NotActivateRegistUser }}</span> 人 </span> | |||
| <span class="yesterday_blk yesterday_color2 yesterday_pdrt yesterday_text">已激活: <span class="bold_num">{{ tableDataYesterday.ActivateRegistUser }} </span>人</span> | |||
| <span class="yesterday_blk yesterday_pdrt yesterday_text">有贡献活动: <span class="bold_num">{{ tableDataYesterday.HasActivityUser }} </span>人</span> | |||
| <span class="yesterday_blk yesterday_pdrt yesterday_text">有贡献活动: <span class="bold_num">{{ tableDataYesterday.RegistActivityUser }} </span>人</span> | |||
| </el-col> | |||
| @@ -114,7 +114,7 @@ | |||
| align="center"> | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="HasActivityUser" | |||
| prop="RegistActivityUser" | |||
| label="新增有贡献活动" | |||
| align="center"> | |||
| </el-table-column> | |||
| @@ -131,6 +131,11 @@ | |||
| {{scope.row.ActivateIndex | rounding}} | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="HasActivityUser" | |||
| label="当日有贡献活动" | |||
| align="center"> | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="TotalUser" | |||
| label="累计注册用户" | |||
| @@ -517,7 +522,7 @@ | |||
| xdata.push(this.tableData[this.tableData.length-1-i].DisplayDate); | |||
| ydata_TotalRegistUser.push(this.tableData[this.tableData.length-1-i].TotalRegistUser) | |||
| ydata_ActivateRegistUser.push(this.tableData[this.tableData.length-1-i].ActivateRegistUser) | |||
| ydata_RegistActivityUser.push(this.tableData[this.tableData.length-1-i].HasActivityUser) | |||
| ydata_RegistActivityUser.push(this.tableData[this.tableData.length-1-i].RegistActivityUser) | |||
| ydata_NotActivateRegistUser.push(this.tableData[this.tableData.length-1-i].NotActivateRegistUser) | |||
| ydata_TotalUser.push(this.tableData[this.tableData.length-1-i].TotalUser) | |||
| ydata_TotalActivateRegistUser.push(this.tableData[this.tableData.length-1-i].TotalActivateRegistUser) | |||
| @@ -1225,10 +1225,7 @@ async function initRepository() { | |||
| const $content = $segment.parent(); | |||
| if (!$content.find('.ui.small.images').length) { | |||
| if (data.attachments !== '') { | |||
| $content.append( | |||
| '<div class="ui bottom attached segment"><div class="ui small images"></div></div>' | |||
| ); | |||
| $content.find('.ui.small.images').html(data.attachments); | |||
| } | |||
| } else if (data.attachments === '') { | |||
| $content | |||
| @@ -3870,7 +3867,7 @@ function initVueDataset() { | |||
| cloudbrainType: 0, | |||
| dataset_uuid: '', | |||
| dataset_name: '', | |||
| loadingDataIndex: true, | |||
| loadingDataIndex: false, | |||
| timer: null, | |||
| ruleForm: { | |||
| title: '', | |||
| @@ -3923,19 +3920,10 @@ function initVueDataset() { | |||
| MinioUploader | |||
| }, | |||
| mounted() { | |||
| // if(document.getElementById('postPath')){ | |||
| // this.url = document.getElementById('postPath').value | |||
| // } | |||
| // this.privates = items | |||
| // this.num_stars = num_stars | |||
| // this.star_active = star_active | |||
| // this.ruleForm1 = ruleForm | |||
| // // this.getEditInit() | |||
| // this.getTypeList() | |||
| this.getTypeList() | |||
| if (!!document.getElementById('dataset-repolink-init')) { | |||
| this.cloudbrainType = location.href.indexOf('cloudbrain') !== -1 ? 0 : 1 | |||
| this.getCurrentRepoDataset(this.repolink, this.cloudbrainType) | |||
| } | |||
| @@ -4083,6 +4071,62 @@ function initVueDataset() { | |||
| uploadNpu() { | |||
| this.type = 1 | |||
| }, | |||
| sortAble(dom) { | |||
| const params = new URLSearchParams(location.search) | |||
| if (params.toString() === '') { | |||
| location.href = `${location.href}?sort=${dom}Asc` | |||
| } | |||
| else if (!params.get('sort')) { | |||
| location.href = `${location.href}&sort=${dom}Asc` | |||
| } | |||
| else if (params.get('sort') === `${dom}Desc` || params.get('sort').indexOf(`${dom}`) === -1) { | |||
| params.set("sort", `${dom}Asc`) | |||
| let asc = params.toString() | |||
| location.search = asc | |||
| } | |||
| else { | |||
| params.set("sort", `${dom}Desc`) | |||
| let desc = params.toString() | |||
| location.search = desc | |||
| } | |||
| }, | |||
| sortIcon(dom, sort) { | |||
| const params = new URLSearchParams(location.search) | |||
| if (sort === "up") { | |||
| if (params.toString() === '') { | |||
| location.href = `${location.href}?sort=${dom}Asc` | |||
| } | |||
| else if (!params.get('sort')) { | |||
| location.href = `${location.href}&sort=${dom}Asc` | |||
| } else if (params.get('sort') && params.get('sort').indexOf(`${dom}Asc`) !== -1) { | |||
| params.delete('sort') | |||
| location.search = params.toString() | |||
| } else { | |||
| params.set("sort", `${dom}Asc`) | |||
| let asc = params.toString() | |||
| location.search = asc | |||
| } | |||
| } | |||
| else if (sort === "down") { | |||
| if (params.toString() === '') { | |||
| location.href = `${location.href}?sort=${dom}Desc` | |||
| } | |||
| else if (!params.get('sort')) { | |||
| location.href = `${location.href}&sort=${dom}Desc` | |||
| } | |||
| else if (params.get('sort') && params.get('sort').indexOf(`${dom}Desc`) !== -1) { | |||
| params.delete('sort') | |||
| location.search = params.toString() | |||
| } else { | |||
| params.set("sort", `${dom}Desc`) | |||
| let asc = params.toString() | |||
| location.search = asc | |||
| } | |||
| } | |||
| }, | |||
| setPrivate(uuid, privateFlag, index) { | |||
| const params = { _csrf: csrf, file: uuid, is_private: privateFlag } | |||
| this.$axios.post('/attachments/private', this.qs.stringify(params)).then((res) => { | |||
| @@ -4294,6 +4338,7 @@ function initVueDataset() { | |||
| } | |||
| }, | |||
| getCurrentRepoDataset(repoLink, type) { | |||
| clearInterval(this.timer) | |||
| this.loadingDataIndex = true | |||
| let url = repoLink + '/datasets/current_repo' | |||
| @@ -4304,12 +4349,17 @@ function initVueDataset() { | |||
| q: this.searchDataItem | |||
| } | |||
| }).then((res) => { | |||
| this.currentRepoDataset = JSON.parse(res.data.data) | |||
| const checkStatuDataset = this.currentRepoDataset.filter(item => item.DecompressState === 2) | |||
| if (checkStatuDataset.length > 0) { | |||
| this.polling(checkStatuDataset, repoLink) | |||
| if (res.data.result_code == '0') { | |||
| this.currentRepoDataset = JSON.parse(res.data.data) | |||
| const checkStatuDataset = this.currentRepoDataset.filter(item => item.DecompressState === 2) | |||
| if (checkStatuDataset.length > 0) { | |||
| this.polling(checkStatuDataset, repoLink) | |||
| } | |||
| this.totalnums = parseInt(res.data.count) | |||
| } else { | |||
| this.totalnums = 0 | |||
| } | |||
| this.totalnums = parseInt(res.data.count) | |||
| this.loadingDataIndex = false | |||
| }) | |||
| }, | |||
| @@ -82,9 +82,14 @@ footer { | |||
| } | |||
| /*PC*/ | |||
| @media only screen and (min-width: 1200px){ | |||
| .following.bar #navbar, footer .container { | |||
| padding: 0; | |||
| .following.bar #navbar, footer .container { | |||
| padding: 0; | |||
| } | |||
| } | |||
| @media only screen and (min-width: 1600px){ | |||
| .ui.ui.ui.container:not(.fluid) { | |||
| width: 1200px; | |||
| } | |||
| } | |||
| /*start page*/ | |||
| @@ -655,7 +660,10 @@ display: block; | |||
| } | |||
| /*pages*/ | |||
| .ui.borderless.pagination {border:none} | |||
| .ui.borderless.pagination { | |||
| border:none; | |||
| margin-top: .5rem; | |||
| } | |||
| .ui.pagination.menu .item { | |||
| min-width: 32px; | |||
| text-align: center; | |||
| @@ -1055,3 +1063,35 @@ display: block; | |||
| float: left !important; | |||
| margin: 0px 5px 0px 0px !important; | |||
| } | |||
| .row .caret-wrapper { | |||
| display: inline-flex; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| height: 34px; | |||
| width: 24px; | |||
| vertical-align: middle; | |||
| cursor: pointer; | |||
| position: relative; | |||
| } | |||
| .row .sort-caret-up { | |||
| position: absolute; | |||
| top: 5px; | |||
| } | |||
| .row .sort-caret-down { | |||
| position: absolute; | |||
| bottom: 5px; | |||
| } | |||
| .row .active-up-sort { | |||
| border-bottom-color: #409eff; | |||
| } | |||
| .row .active-down-sort { | |||
| border-top-color: #409eff; | |||
| } | |||