| @@ -1566,6 +1566,14 @@ func GetCloudbrainCountByUserID(userID int64, jobType string) (int, error) { | |||||
| return int(count), err | 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) { | 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)) | 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 | return int(count), err | ||||
| @@ -927,7 +927,7 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time, | |||||
| if err != nil { | if err != nil { | ||||
| log.Info("query commit code errr.") | log.Info("query commit code errr.") | ||||
| } else { | } 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) | CommitCodeSizeMapJson, _ := json.Marshal(CommitCodeSizeMap) | ||||
| log.Info("CommitCodeSizeMapJson=" + string(CommitCodeSizeMapJson)) | log.Info("CommitCodeSizeMapJson=" + string(CommitCodeSizeMapJson)) | ||||
| } | } | ||||
| @@ -1154,7 +1154,6 @@ func getUserIndexFromAnalysisAll(dateRecord UserBusinessAnalysisAll, ParaWeight | |||||
| // 登录次数 0.10 | // 登录次数 0.10 | ||||
| result = float64(dateRecord.CodeMergeCount) * getParaWeightValue("CodeMergeCount", ParaWeight, 0.2) | result = float64(dateRecord.CodeMergeCount) * getParaWeightValue("CodeMergeCount", ParaWeight, 0.2) | ||||
| result += float64(dateRecord.CommitCount) * getParaWeightValue("CommitCount", 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.IssueCount) * getParaWeightValue("IssueCount", ParaWeight, 0.2) | ||||
| result += float64(dateRecord.CommentCount) * getParaWeightValue("CommentCount", ParaWeight, 0.2) | result += float64(dateRecord.CommentCount) * getParaWeightValue("CommentCount", ParaWeight, 0.2) | ||||
| result += float64(dateRecord.FocusRepoCount) * getParaWeightValue("FocusRepoCount", ParaWeight, 0.1) | result += float64(dateRecord.FocusRepoCount) * getParaWeightValue("FocusRepoCount", ParaWeight, 0.1) | ||||
| @@ -1237,7 +1236,6 @@ func getUserIndex(dateRecord UserBusinessAnalysis, ParaWeight map[string]float64 | |||||
| // 登录次数 0.10 | // 登录次数 0.10 | ||||
| result = float64(dateRecord.CodeMergeCount) * getParaWeightValue("CodeMergeCount", ParaWeight, 0.2) | result = float64(dateRecord.CodeMergeCount) * getParaWeightValue("CodeMergeCount", ParaWeight, 0.2) | ||||
| result += float64(dateRecord.CommitCount) * getParaWeightValue("CommitCount", 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.IssueCount) * getParaWeightValue("IssueCount", ParaWeight, 0.2) | ||||
| result += float64(dateRecord.CommentCount) * getParaWeightValue("CommentCount", ParaWeight, 0.2) | result += float64(dateRecord.CommentCount) * getParaWeightValue("CommentCount", ParaWeight, 0.2) | ||||
| result += float64(dateRecord.FocusRepoCount) * getParaWeightValue("FocusRepoCount", ParaWeight, 0.1) | result += float64(dateRecord.FocusRepoCount) * getParaWeightValue("FocusRepoCount", ParaWeight, 0.1) | ||||
| @@ -9,7 +9,7 @@ import ( | |||||
| const EMPTY_REDIS_VAL = "Nil" | const EMPTY_REDIS_VAL = "Nil" | ||||
| var accessTokenLock = redis_lock.NewDistributeLock() | |||||
| var accessTokenLock = redis_lock.NewDistributeLock(redis_key.AccessTokenLockKey()) | |||||
| func GetWechatAccessToken() string { | func GetWechatAccessToken() string { | ||||
| token, _ := redis_client.Get(redis_key.WechatAccessTokenKey()) | token, _ := redis_client.Get(redis_key.WechatAccessTokenKey()) | ||||
| @@ -28,15 +28,15 @@ func GetWechatAccessToken() string { | |||||
| } | } | ||||
| func refreshAccessToken() { | 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() | callAccessTokenAndUpdateCache() | ||||
| } | } | ||||
| } | } | ||||
| func refreshAndGetAccessToken() string { | 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()) | token, _ := redis_client.Get(redis_key.WechatAccessTokenKey()) | ||||
| if token != "" { | if token != "" { | ||||
| if token == EMPTY_REDIS_VAL { | if token == EMPTY_REDIS_VAL { | ||||
| @@ -6,22 +6,23 @@ import ( | |||||
| ) | ) | ||||
| type DistributeLock struct { | 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 | 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 | start := time.Now().Unix() * 1000 | ||||
| duration := waitTime.Milliseconds() | duration := waitTime.Milliseconds() | ||||
| for { | for { | ||||
| isOk, _ := redis_client.Setnx(lockKey, "", expireTime) | |||||
| isOk, _ := redis_client.Setnx(lock.lockKey, "", expireTime) | |||||
| if isOk { | if isOk { | ||||
| return true | return true | ||||
| } | } | ||||
| @@ -34,7 +35,7 @@ func (lock *DistributeLock) LockWithWait(lockKey string, expireTime time.Duratio | |||||
| return false | 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 | return err | ||||
| } | } | ||||
| @@ -817,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_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.delete_notices_fork_1= - Forks of this dataset will become independent after deletion. | ||||
| settings.deletion_success= The dataset has been deleted. | 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.machine_translation= machine translation | ||||
| task.question_answering_system= question answering system | task.question_answering_system= question answering system | ||||
| task.information_retrieval= information retrieval | task.information_retrieval= information retrieval | ||||
| @@ -1931,6 +1931,7 @@ settings.delete_notices_1=- 此操作 <strong>不可以</strong> 被回滚。 | |||||
| settings.delete_notices_2=- 此操作将永久删除项目 <strong>%s</strong>,包括 Git 数据、 任务、评论、百科和协作者的操作权限。 | settings.delete_notices_2=- 此操作将永久删除项目 <strong>%s</strong>,包括 Git 数据、 任务、评论、百科和协作者的操作权限。 | ||||
| settings.delete_notices_fork_1=- 在此项目删除后,它的派生项目将变成独立项目。 | settings.delete_notices_fork_1=- 在此项目删除后,它的派生项目将变成独立项目。 | ||||
| settings.deletion_success=项目已被删除。 | settings.deletion_success=项目已被删除。 | ||||
| settings.deletion_notice_cloudbrain=请先停止项目内正在运行的云脑任务,然后再删除项目。 | |||||
| settings.update_settings_success=项目设置已更新。 | settings.update_settings_success=项目设置已更新。 | ||||
| settings.transfer_owner=新拥有者 | settings.transfer_owner=新拥有者 | ||||
| settings.make_transfer=开始转移 | settings.make_transfer=开始转移 | ||||
| @@ -418,44 +418,16 @@ queryRecommendData(); | |||||
| function queryRecommendData(){ | function queryRecommendData(){ | ||||
| $.ajax({ | $.ajax({ | ||||
| type:"GET", | type:"GET", | ||||
| url:"/recommend/org", | |||||
| url:"/recommend/home", | |||||
| headers: { | headers: { | ||||
| authorization:token, | authorization:token, | ||||
| }, | }, | ||||
| dataType:"json", | dataType:"json", | ||||
| async:false, | async:false, | ||||
| success:function(json){ | 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) { | error:function(response) { | ||||
| } | } | ||||
| @@ -99,6 +99,12 @@ func setRecommendURL(ctx *context.Context) { | |||||
| func Dashboard(ctx *context.Context) { | func Dashboard(ctx *context.Context) { | ||||
| if ctx.IsSigned { | 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 { | if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { | ||||
| ctx.Data["Title"] = ctx.Tr("auth.active_your_account") | ctx.Data["Title"] = ctx.Tr("auth.active_your_account") | ||||
| ctx.HTML(200, user.TplActivate) | ctx.HTML(200, user.TplActivate) | ||||
| @@ -259,7 +265,11 @@ func ExploreRepos(ctx *context.Context) { | |||||
| ctx.Data["PageIsExplore"] = true | ctx.Data["PageIsExplore"] = true | ||||
| ctx.Data["PageIsExploreRepositories"] = true | ctx.Data["PageIsExploreRepositories"] = true | ||||
| ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled | 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 | var ownerID int64 | ||||
| if ctx.User != nil && !ctx.User.IsAdmin { | if ctx.User != nil && !ctx.User.IsAdmin { | ||||
| ownerID = ctx.User.ID | ownerID = ctx.User.ID | ||||
| @@ -434,7 +444,11 @@ func ExploreUsers(ctx *context.Context) { | |||||
| ctx.Data["PageIsExplore"] = true | ctx.Data["PageIsExplore"] = true | ||||
| ctx.Data["PageIsExploreUsers"] = true | ctx.Data["PageIsExploreUsers"] = true | ||||
| ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled | 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{ | RenderUserSearch(ctx, &models.SearchUserOptions{ | ||||
| Actor: ctx.User, | Actor: ctx.User, | ||||
| Type: models.UserTypeIndividual, | Type: models.UserTypeIndividual, | ||||
| @@ -471,7 +485,7 @@ func ExploreOrganizations(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| recommendOrgs, err := GetRecommendOrg() | |||||
| recommendOrgs, err := getRecommendOrg() | |||||
| if err != nil { | if err != nil { | ||||
| log.Error("GetRecommendOrgInfos failed:%v", err.Error(), ctx.Data["MsgID"]) | log.Error("GetRecommendOrgInfos failed:%v", err.Error(), ctx.Data["MsgID"]) | ||||
| ctx.ServerError("GetRecommendOrgInfos", err) | ctx.ServerError("GetRecommendOrgInfos", err) | ||||
| @@ -606,31 +620,31 @@ func ExploreImages(ctx *context.Context) { | |||||
| } | } | ||||
| func ExploreDataAnalysisUserTrend(ctx *context.Context) { | func ExploreDataAnalysisUserTrend(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="UserTrend" | |||||
| ctx.Data["url_params"] = "UserTrend" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| func ExploreDataAnalysisUserAnalysis(ctx *context.Context) { | func ExploreDataAnalysisUserAnalysis(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="UserAnalysis" | |||||
| ctx.Data["url_params"] = "UserAnalysis" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| func ExploreDataAnalysisProTrend(ctx *context.Context) { | func ExploreDataAnalysisProTrend(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="ProTrend" | |||||
| ctx.Data["url_params"] = "ProTrend" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| func ExploreDataAnalysisProAnalysis(ctx *context.Context) { | func ExploreDataAnalysisProAnalysis(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="ProAnalysis" | |||||
| ctx.Data["url_params"] = "ProAnalysis" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| func ExploreDataAnalysisOverview(ctx *context.Context) { | func ExploreDataAnalysisOverview(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="Overview" | |||||
| ctx.Data["url_params"] = "Overview" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| func ExploreDataAnalysisBrainAnalysis(ctx *context.Context) { | func ExploreDataAnalysisBrainAnalysis(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="BrainAnalysis" | |||||
| ctx.Data["url_params"] = "BrainAnalysis" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| func ExploreDataAnalysis(ctx *context.Context) { | func ExploreDataAnalysis(ctx *context.Context) { | ||||
| ctx.Data["url_params"]="" | |||||
| ctx.Data["url_params"] = "" | |||||
| ctx.HTML(200, tplExploreExploreDataAnalysis) | ctx.HTML(200, tplExploreExploreDataAnalysis) | ||||
| } | } | ||||
| @@ -640,7 +654,7 @@ func NotFound(ctx *context.Context) { | |||||
| ctx.NotFound("home.NotFound", nil) | ctx.NotFound("home.NotFound", nil) | ||||
| } | } | ||||
| func GetRecommendOrg() ([]map[string]interface{}, error) { | |||||
| func getRecommendOrg() ([]map[string]interface{}, error) { | |||||
| url := setting.RecommentRepoAddr + "organizations" | url := setting.RecommentRepoAddr + "organizations" | ||||
| result, err := repository.RecommendFromPromote(url) | result, err := repository.RecommendFromPromote(url) | ||||
| @@ -668,17 +682,18 @@ func GetRecommendOrg() ([]map[string]interface{}, error) { | |||||
| } | } | ||||
| return resultOrg, nil | 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) | result, err := repository.RecommendFromPromote(url) | ||||
| if err != nil { | if err != nil { | ||||
| return nil, err | return nil, err | ||||
| } | } | ||||
| imageInfo := make([]map[string]interface{}, 0) | |||||
| imageInfo := make([]map[string]string, 0) | |||||
| for i := 0; i < (len(result) - 1); i++ { | for i := 0; i < (len(result) - 1); i++ { | ||||
| line := result[i] | line := result[i] | ||||
| imageMap := make(map[string]interface{}) | |||||
| imageMap := make(map[string]string) | |||||
| if line[0:4] == "url=" { | if line[0:4] == "url=" { | ||||
| url := line[4:] | url := line[4:] | ||||
| imageMap["url"] = url | imageMap["url"] = url | ||||
| @@ -731,15 +746,6 @@ func GetRankUser(index string) ([]map[string]interface{}, error) { | |||||
| return resultOrg, nil | 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) { | func GetUserRankFromPromote(ctx *context.Context) { | ||||
| index := ctx.Params("index") | index := ctx.Params("index") | ||||
| resultUserRank, err := GetRankUser(index) | resultUserRank, err := GetRankUser(index) | ||||
| @@ -750,13 +756,24 @@ func GetUserRankFromPromote(ctx *context.Context) { | |||||
| ctx.JSON(200, resultUserRank) | ctx.JSON(200, resultUserRank) | ||||
| } | } | ||||
| func RecommendOrgFromPromote(ctx *context.Context) { | |||||
| resultOrg, err := GetRecommendOrg() | |||||
| func RecommendHomeInfo(ctx *context.Context) { | |||||
| resultOrg, err := getRecommendOrg() | |||||
| if err != nil { | 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) { | func RecommendRepoFromPromote(ctx *context.Context) { | ||||
| @@ -764,6 +764,7 @@ func trainJobErrorNewDataPrepare(ctx *context.Context, form auth.CreateModelArts | |||||
| ctx.Data["bootFile"] = form.BootFile | ctx.Data["bootFile"] = form.BootFile | ||||
| ctx.Data["uuid"] = form.Attachment | ctx.Data["uuid"] = form.Attachment | ||||
| ctx.Data["branch_name"] = form.BranchName | ctx.Data["branch_name"] = form.BranchName | ||||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||||
| return nil | return nil | ||||
| } | } | ||||
| @@ -954,6 +955,7 @@ func versionErrorDataPrepare(ctx *context.Context, form auth.CreateModelArtsTrai | |||||
| return err | return err | ||||
| } | } | ||||
| ctx.Data["config_list"] = configList.ParaConfigs | ctx.Data["config_list"] = configList.ParaConfigs | ||||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||||
| return nil | return nil | ||||
| } | } | ||||
| @@ -2175,6 +2177,7 @@ func inferenceJobErrorNewDataPrepare(ctx *context.Context, form auth.CreateModel | |||||
| ctx.Data["model_version"] = form.ModelVersion | ctx.Data["model_version"] = form.ModelVersion | ||||
| ctx.Data["ckpt_name"] = form.CkptName | ctx.Data["ckpt_name"] = form.CkptName | ||||
| ctx.Data["train_url"] = form.TrainUrl | ctx.Data["train_url"] = form.TrainUrl | ||||
| ctx.Data["cloudbraintype"] = models.TypeCloudBrainTwo | |||||
| return nil | return nil | ||||
| } | } | ||||
| @@ -6,7 +6,6 @@ | |||||
| package repo | package repo | ||||
| import ( | import ( | ||||
| "code.gitea.io/gitea/modules/notification" | |||||
| "errors" | "errors" | ||||
| "fmt" | "fmt" | ||||
| "io/ioutil" | "io/ioutil" | ||||
| @@ -15,6 +14,8 @@ import ( | |||||
| "strings" | "strings" | ||||
| "time" | "time" | ||||
| "code.gitea.io/gitea/modules/notification" | |||||
| "code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
| "code.gitea.io/gitea/modules/auth" | "code.gitea.io/gitea/modules/auth" | ||||
| "code.gitea.io/gitea/modules/base" | "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) | ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ||||
| return | 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 | 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": | case "delete-wiki": | ||||
| if !ctx.Repo.IsOwner() { | if !ctx.Repo.IsOwner() { | ||||
| @@ -323,10 +323,8 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
| m.Get("/dashboard", routers.Dashboard) | m.Get("/dashboard", routers.Dashboard) | ||||
| go routers.SocketManager.Run() | go routers.SocketManager.Run() | ||||
| m.Get("/action/notification", routers.ActionNotification) | 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/userrank/:index", routers.GetUserRankFromPromote) | ||||
| m.Get("/recommend/imageinfo", routers.GetImageInfoFromPromote) | |||||
| m.Post("/all/search/", routers.Search) | m.Post("/all/search/", routers.Search) | ||||
| m.Get("/all/search/", routers.EmptySearch) | m.Get("/all/search/", routers.EmptySearch) | ||||
| m.Get("/all/dosearch/", routers.SearchApi) | m.Get("/all/dosearch/", routers.SearchApi) | ||||
| @@ -154,6 +154,12 @@ func GetRecommendRepoFromPromote(filename string) ([]map[string]interface{}, err | |||||
| } | } | ||||
| func RecommendFromPromote(url string) ([]string, error) { | func RecommendFromPromote(url string) ([]string, error) { | ||||
| defer func() { | |||||
| if err := recover(); err != nil { | |||||
| log.Info("not error.", err) | |||||
| return | |||||
| } | |||||
| }() | |||||
| resp, err := http.Get(url) | resp, err := http.Get(url) | ||||
| if err != nil || resp.StatusCode != 200 { | if err != nil || resp.StatusCode != 200 { | ||||
| log.Info("Get organizations url error=" + err.Error()) | 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"> | <div class="inline {{if eq .cloudbraintype 0}} required {{end}} field" id="dataset-base"> | ||||
| <label>{{.i18n.Tr "dataset.dataset"}}</label> | <label>{{.i18n.Tr "dataset.dataset"}}</label> | ||||
| <input type="hidden" name="attachment" :value="dataset_uuid"> | <input type="hidden" name="attachment" :value="dataset_uuid"> | ||||
| {{if eq .cloudbraintype 0}} | {{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}} | {{else}} | ||||
| <input class="disabled" type="text" :value="dataset_name" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}"> | <input class="disabled" type="text" :value="dataset_name" placeholder="{{.i18n.Tr "cloudbrain.select_dataset"}}"> | ||||
| {{end}} | {{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> | </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> | |||||
| <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> | |||||
| <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> | |||||
| <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> | </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;"> | <div class="inline required unite min_title field" id="dataset-base" style="margin-bottom: 0 !important;"> | ||||
| {{if or (.benchmarkMode) (.newInference)}} | {{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}} | {{else}} | ||||
| <label style="font-weight: normal;">{{.i18n.Tr "dataset.dataset"}}</label> | <label style="font-weight: normal;">{{.i18n.Tr "dataset.dataset"}}</label> | ||||
| {{end}} | {{end}} | ||||
| <input type="hidden" name="attachment" :value="dataset_uuid"> | <input type="hidden" name="attachment" :value="dataset_uuid"> | ||||
| <input class="disabled" type="text" :value="dataset_name" required onfocus="this.blur();" style="width: 48.5%;"> | <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}} | {{if .benchmarkMode}} | ||||
| <span class="tooltips" style="display: block;padding-left: 0.5rem;">说明:先使用数据集功能上传模型,然后从数据集列表选模型。</span> | <span class="tooltips" style="display: block;padding-left: 0.5rem;">说明:先使用数据集功能上传模型,然后从数据集列表选模型。</span> | ||||
| {{end}} | {{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> | </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> | |||||
| <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> | |||||
| <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> | |||||
| <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> | </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="ui secondary pointing menu"> | ||||
| <div class="active item"> | <div class="active item"> | ||||
| @@ -127,6 +127,7 @@ | |||||
| </div> | </div> | ||||
| <form id="form_id" class="ui form" action="{{.Link}}" method="post"> | <form id="form_id" class="ui form" action="{{.Link}}" method="post"> | ||||
| {{.CsrfTokenHtml}} | {{.CsrfTokenHtml}} | ||||
| <input type="hidden" name='isBranches' value="{{.Branches}}"> | |||||
| <h3 class="ui top attached header"> | <h3 class="ui top attached header"> | ||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | {{.i18n.Tr "repo.cloudbrain.new"}} | ||||
| </h3> | </h3> | ||||
| @@ -185,7 +186,8 @@ | |||||
| <input id="store_category" type="hidden" name="get_benchmark_category"> | <input id="store_category" type="hidden" name="get_benchmark_category"> | ||||
| <div class="inline required field"> | <div class="inline required field"> | ||||
| <label>{{.i18n.Tr "repo.modelarts.code_version"}}</label> | <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}} | {{if .branch_name}} | ||||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | ||||
| {{range $k, $v :=.Branches}} | {{range $k, $v :=.Branches}} | ||||
| @@ -213,19 +215,6 @@ | |||||
| </select> | </select> | ||||
| </div> | </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 id="images-new-cb"> | ||||
| </div> | </div> | ||||
| @@ -298,10 +287,6 @@ | |||||
| <script> | <script> | ||||
| let form = document.getElementById('form_id'); | 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') | $('#messageInfo').css('display', 'none') | ||||
| function clearValue() { | function clearValue() { | ||||
| @@ -381,6 +366,9 @@ | |||||
| }) | }) | ||||
| $('.ui.green.button').click(function () { | $('.ui.green.button').click(function () { | ||||
| if (!$('input[name="isBranches"]').val()) { | |||||
| return false | |||||
| } | |||||
| selected_value = $("#cloudbrain_benchmark_category").val() | selected_value = $("#cloudbrain_benchmark_category").val() | ||||
| $('#store_category').attr("value", selected_value) | $('#store_category').attr("value", selected_value) | ||||
| }) | }) | ||||
| @@ -1,71 +1,77 @@ | |||||
| {{template "base/head" .}} | {{template "base/head" .}} | ||||
| <style> | <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> | </style> | ||||
| <!-- <div class="ui page dimmer"> | <!-- <div class="ui page dimmer"> | ||||
| <div class="ui text loader">{{.i18n.Tr "loading"}}</div> | <div class="ui text loader">{{.i18n.Tr "loading"}}</div> | ||||
| </div> --> | </div> --> | ||||
| <div id="mask"> | <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> | ||||
| <div class="repository"> | <div class="repository"> | ||||
| {{template "repo/header" .}} | {{template "repo/header" .}} | ||||
| @@ -86,68 +92,82 @@ | |||||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label> | <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label> | ||||
| <div class="ui blue mini menu compact selectcloudbrain"> | <div class="ui blue mini menu compact selectcloudbrain"> | ||||
| <a class="active item" href="{{.RepoLink}}/cloudbrain/train-job/create"> | <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> | </svg> | ||||
| CPU/GPU | CPU/GPU | ||||
| </a> | </a> | ||||
| <a class="item" href="{{.RepoLink}}/modelarts/train-job/create"> | <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> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="required unite min_title inline field"> | <div class="required unite min_title inline field"> | ||||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | <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> | <span class="tooltips" style="display: block;">{{.i18n.Tr "cloudbrain.job_name_rule"}}</span> | ||||
| </div> | </div> | ||||
| <div class="unite min_title inline field"> | <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> | ||||
| <div class="ui divider"></div> | <div class="ui divider"></div> | ||||
| <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4> | <h4 class="unite title ui header ">{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:</h4> | ||||
| <div class="required unite min_title inline field"> | <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> | ||||
| <div class="inline required field" style="display: none;"> | <div class="inline required field" style="display: none;"> | ||||
| <label>{{.i18n.Tr "cloudbrain.task_type"}}</label> | <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> | <option name="job_type" value="TRAIN">TRAIN</option> | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| <div class="required unite min_title inline field"> | <div class="required unite min_title inline field"> | ||||
| <label style="font-weight: normal;">{{.i18n.Tr "cloudbrain.gpu_type"}}</label> | <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}} | {{range .train_gpu_types}} | ||||
| <option value="{{.Queue}}">{{.Value}}</option> | |||||
| <option value="{{.Queue}}">{{.Value}}</option> | |||||
| {{end}} | {{end}} | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| @@ -171,65 +191,75 @@ | |||||
| </div> | </div> | ||||
| <div class="inline unite min_title field required"> | <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> | </div> | ||||
| {{template "custom/select_dataset_train" .}} | {{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"> | <div class="inline unite min_title field"> | ||||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}}</label> | <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;"> | <div class="dynamic field" style="margin-top: 1rem;"> | ||||
| {{if .params}} | |||||
| {{if .params}} | |||||
| {{if ne 0 (len .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}} | ||||
| {{end}} | |||||
| </div> | </div> | ||||
| </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> | <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}} | {{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}} | {{end}} | ||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| <div class="inline unite min_title field"> | <div class="inline unite min_title field"> | ||||
| <button class="ui create_train_job green button"> | <button class="ui create_train_job green button"> | ||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | |||||
| </button> | </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> | </div> | ||||
| <!-- 模态框 --> | <!-- 模态框 --> | ||||
| </form> | </form> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -246,202 +276,210 @@ | |||||
| .tab(); | .tab(); | ||||
| let sever_num = $('#trainjob_work_server_num') | 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) | $(".dynamic.field").append(value) | ||||
| } | |||||
| } | |||||
| $('#add_run_para').click(function(){ | |||||
| $('#add_run_para').click(function () { | |||||
| var len = $(".dynamic.field .two.fields").length | var len = $(".dynamic.field .two.fields").length | ||||
| Add_parameter(len) | Add_parameter(len) | ||||
| }); | }); | ||||
| $(".dynamic.field").on("click",".trash.icon", function() { | |||||
| $(".dynamic.field").on("click", ".trash.icon", function () { | |||||
| var index = $(this).parent().parent().index() | var index = $(this).parent().parent().index() | ||||
| $(this).parent().parent().remove() | $(this).parent().parent().remove() | ||||
| var len = $(".dynamic.field .two.fields").length | var len = $(".dynamic.field .two.fields").length | ||||
| $(".dynamic.field .two.fields").each(function(){ | |||||
| $(".dynamic.field .two.fields").each(function () { | |||||
| var cur_index = $(this).index() | var cur_index = $(this).index() | ||||
| $(this).attr('id', 'para' + cur_index) | $(this).attr('id', 'para' + cur_index) | ||||
| }) | }) | ||||
| }); | }); | ||||
| $('.ui.parameter.green.button').click(function(){ | |||||
| $('.ui.parameter.green.button').click(function () { | |||||
| var parameters = []; | 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()); | parameters.push($(this).text()); | ||||
| }) | }) | ||||
| $(this).find('input').each(function(){ | |||||
| $(this).find('input').each(function () { | |||||
| parameters.push($(this).text()) | parameters.push($(this).text()) | ||||
| }) | }) | ||||
| }); | }); | ||||
| $('.ui.parameter.modal') | $('.ui.parameter.modal') | ||||
| .modal('hide'); | .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({ | $(this).checkbox({ | ||||
| onChange: function(){ | |||||
| if ($('.ui.save.checkbox').checkbox('is checked')){ | |||||
| onChange: function () { | |||||
| if ($('.ui.save.checkbox').checkbox('is checked')) { | |||||
| $('#save_para').removeClass("disabled") | $('#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') | $(this).popup('show') | ||||
| }); | }); | ||||
| $(".item.active.parameter_config").click(function(){ | |||||
| $(".item.active.parameter_config").click(function () { | |||||
| $('.ui.parameter.modal') | $('.ui.parameter.modal') | ||||
| .modal('setting', 'closable', false) | .modal('setting', 'closable', false) | ||||
| .modal('show'); | .modal('show'); | ||||
| }) | }) | ||||
| $('.ui.deny.button').click(function(){ | |||||
| $('.ui.deny.button').click(function () { | |||||
| $('.ui.parameter.modal') | $('.ui.parameter.modal') | ||||
| .modal('hide'); | .modal('hide'); | ||||
| }) | }) | ||||
| $('select.dropdown') | $('select.dropdown') | ||||
| .dropdown(); | .dropdown(); | ||||
| function validate(){ | |||||
| function validate() { | |||||
| $('.ui.form') | $('.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") { | if (document.readyState === "complete") { | ||||
| document.getElementById("mask").style.display = "none" | document.getElementById("mask").style.display = "none" | ||||
| } | } | ||||
| } | } | ||||
| function send_run_para(){ | |||||
| function send_run_para() { | |||||
| var run_parameters = [] | var run_parameters = [] | ||||
| var msg = {} | 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_name = $(this).find('input[name=shipping_first-name]').val() | ||||
| var para_value = $(this).find('input[name=shipping_last-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["parameter"] = run_parameters | ||||
| msg = JSON.stringify(msg) | msg = JSON.stringify(msg) | ||||
| $('#store_run_para').val(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_engine_name").val(name1) | ||||
| $("input#ai_flaver_name").val(name2) | $("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() | get_name() | ||||
| send_run_para() | send_run_para() | ||||
| validate() | |||||
| validate() | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -118,6 +118,20 @@ | |||||
| .diy-popper { | .diy-popper { | ||||
| max-width: 400px; | 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> | </style> | ||||
| <div class="repository"> | <div class="repository"> | ||||
| {{template "repo/header" .}} | {{template "repo/header" .}} | ||||
| @@ -213,21 +227,24 @@ | |||||
| <div class="ui grid stackable" style="background: #f0f0f0;;"> | <div class="ui grid stackable" style="background: #f0f0f0;;"> | ||||
| <div class="row"> | <div class="row"> | ||||
| <!-- 数据集名称 --> | <!-- 数据集名称 --> | ||||
| <div class="four wide column name_sort" @click="sortAble('name')" style="width: 24% !important;"> | |||||
| <div class="four wide column name_sort" @click="sortAble('name')" | |||||
| style="width: 24% !important;cursor: pointer;"> | |||||
| {{$.i18n.Tr "dataset.dataset_file_name"}} | {{$.i18n.Tr "dataset.dataset_file_name"}} | ||||
| <span class="caret-wrapper"> | <span class="caret-wrapper"> | ||||
| <i class='ri-arrow-up-s-fill sort-caret-up {{if eq .SortType "nameAsc"}} active-sort {{end}}'></i> | |||||
| <i | |||||
| class='ri-arrow-down-s-fill sort-caret-down {{if eq .SortType "nameDesc"}} active-sort {{end}}'></i> | |||||
| <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> | </span> | ||||
| </div> | </div> | ||||
| <div class="one wide column text center size_sort" @click="sortAble('size')" | <div class="one wide column text center size_sort" @click="sortAble('size')" | ||||
| style="width: 7.25% !important;"> | |||||
| style="width: 7.25% !important;cursor: pointer;"> | |||||
| {{$.i18n.Tr "repo.model.manage.size"}} | {{$.i18n.Tr "repo.model.manage.size"}} | ||||
| <span class="caret-wrapper"> | <span class="caret-wrapper"> | ||||
| <i class='ri-arrow-up-s-fill sort-caret-up {{if eq .SortType "sizeAsc"}} active-sort {{end}}'></i> | |||||
| <i | |||||
| class='ri-arrow-down-s-fill sort-caret-down {{if eq .SortType "sizeDesc"}} active-sort {{end}}'></i> | |||||
| <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> | </span> | ||||
| </div> | </div> | ||||
| <div class="two wide column text center"> | <div class="two wide column text center"> | ||||
| @@ -239,12 +256,13 @@ | |||||
| <div class="one wide column text center"> | <div class="one wide column text center"> | ||||
| {{$.i18n.Tr "repo.cloudbrain_creator"}} | {{$.i18n.Tr "repo.cloudbrain_creator"}} | ||||
| </div> | </div> | ||||
| <div class="three wide column text center" @click="sortAble('time')"> | |||||
| <div class="three wide column text center" @click="sortAble('time')" style="cursor: pointer;"> | |||||
| {{$.i18n.Tr "dataset.dataset_upload_time"}} | {{$.i18n.Tr "dataset.dataset_upload_time"}} | ||||
| <span class="caret-wrapper"> | <span class="caret-wrapper"> | ||||
| <i class='ri-arrow-up-s-fill sort-caret-up {{if eq .SortType "timeAsc"}} active-sort {{end}}'></i> | |||||
| <i | |||||
| class='ri-arrow-down-s-fill sort-caret-down {{if eq .SortType "timeDesc"}} active-sort {{end}}'></i> | |||||
| <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> | </span> | ||||
| </div> | </div> | ||||
| <div class="four wide column text center"> | <div class="four wide column text center"> | ||||
| @@ -162,12 +162,11 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </repo-search> | |||||
| <div class="ui hidden divider"></div> | |||||
| </repo-search> | |||||
| <div class="ui hidden divider"></div> | |||||
| <div> | <div> | ||||
| <a href="https://openi.org.cn/index.php?m=content&c=index&a=show&catid=202&id=221" target="_blank"> | |||||
| <img src="https://openi.org.cn/uploadfile/2022/0427/c45291e24e30f54.jpg" class="ui fluid image" alt=""> | |||||
| <a href="{{.image_link}}" target="_blank"> | |||||
| <img src="{{.image_url}}" class="ui fluid image" alt=""> | |||||
| </a> | </a> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -1,86 +1,93 @@ | |||||
| <template> | <template> | ||||
| <div style="width: 100%;"> | <div style="width: 100%;"> | ||||
| <div id = "pro_main"> | |||||
| <div id="pro_main"> | |||||
| <div style="margin-top: 10px;"> | <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> | </div> | ||||
| <bar-label :width="'95%'" :height="'500px'"></bar-label> | <bar-label :width="'95%'" :height="'500px'"></bar-label> | ||||
| <div style="margin-top: 20px;"> | <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;"> | <span style="float:right; margin-right: 20px;"> | ||||
| <div style="display:inline-block;margin-left: 40px; "> | <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" :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> | </span> | ||||
| </div> | |||||
| </div> | |||||
| </span> | </span> | ||||
| </div> | </div> | ||||
| </div> | </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("数据为空时,不能下载!") | 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> | |||||
| @@ -3867,7 +3867,7 @@ function initVueDataset() { | |||||
| cloudbrainType: 0, | cloudbrainType: 0, | ||||
| dataset_uuid: '', | dataset_uuid: '', | ||||
| dataset_name: '', | dataset_name: '', | ||||
| loadingDataIndex: true, | |||||
| loadingDataIndex: false, | |||||
| timer: null, | timer: null, | ||||
| ruleForm: { | ruleForm: { | ||||
| title: '', | title: '', | ||||
| @@ -4080,16 +4080,53 @@ function initVueDataset() { | |||||
| location.href = `${location.href}&sort=${dom}Asc` | location.href = `${location.href}&sort=${dom}Asc` | ||||
| } | } | ||||
| else if (params.get('sort') === `${dom}Desc` || params.get('sort').indexOf(`${dom}`) === -1) { | else if (params.get('sort') === `${dom}Desc` || params.get('sort').indexOf(`${dom}`) === -1) { | ||||
| params.delete('sort') | |||||
| let asc = params.toString() + `&sort=${dom}Asc` | |||||
| params.set("sort", `${dom}Asc`) | |||||
| let asc = params.toString() | |||||
| location.search = asc | location.search = asc | ||||
| } | } | ||||
| else { | else { | ||||
| params.delete('sort') | |||||
| let desc = params.toString() + `&sort=${dom}Desc` | |||||
| params.set("sort", `${dom}Desc`) | |||||
| let desc = params.toString() | |||||
| location.search = desc | 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) { | setPrivate(uuid, privateFlag, index) { | ||||
| const params = { _csrf: csrf, file: uuid, is_private: privateFlag } | const params = { _csrf: csrf, file: uuid, is_private: privateFlag } | ||||
| this.$axios.post('/attachments/private', this.qs.stringify(params)).then((res) => { | this.$axios.post('/attachments/private', this.qs.stringify(params)).then((res) => { | ||||
| @@ -4301,6 +4338,7 @@ function initVueDataset() { | |||||
| } | } | ||||
| }, | }, | ||||
| getCurrentRepoDataset(repoLink, type) { | getCurrentRepoDataset(repoLink, type) { | ||||
| clearInterval(this.timer) | clearInterval(this.timer) | ||||
| this.loadingDataIndex = true | this.loadingDataIndex = true | ||||
| let url = repoLink + '/datasets/current_repo' | let url = repoLink + '/datasets/current_repo' | ||||
| @@ -4311,12 +4349,17 @@ function initVueDataset() { | |||||
| q: this.searchDataItem | q: this.searchDataItem | ||||
| } | } | ||||
| }).then((res) => { | }).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 | this.loadingDataIndex = false | ||||
| }) | }) | ||||
| }, | }, | ||||
| @@ -1079,17 +1079,19 @@ display: block; | |||||
| .row .sort-caret-up { | .row .sort-caret-up { | ||||
| position: absolute; | position: absolute; | ||||
| top: 5px; | top: 5px; | ||||
| color: #c0c4cc; | |||||
| font-size: 18px; | |||||
| } | } | ||||
| .row .sort-caret-down { | .row .sort-caret-down { | ||||
| position: absolute; | position: absolute; | ||||
| bottom: 3px; | |||||
| color: #c0c4cc; | |||||
| font-size: 18px; | |||||
| bottom: 5px; | |||||
| } | |||||
| .row .active-up-sort { | |||||
| border-bottom-color: #409eff; | |||||
| } | } | ||||
| .row .active-sort { | |||||
| color: #409eff !important; | |||||
| .row .active-down-sort { | |||||
| border-top-color: #409eff; | |||||
| } | } | ||||