From c1be811954b65350fc4319fc7f537ce4ed60980f Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 2 Nov 2021 16:52:32 +0800 Subject: [PATCH 001/272] fix issue #497 --- templates/repo/view_file.tmpl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 1216b5f40..7c98420d9 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -34,6 +34,21 @@ {{end}} + + {{if .ReadmeInList}} +
+
+ {{if .Repository.CanEnableEditor}} + {{if .CanEditFile}} + {{svg "octicon-pencil" 16}} + {{else}} + {{svg "octicon-pencil" 16}} + {{end}} + {{end}} +
+
+ {{end}} + {{if not .ReadmeInList}}
From ad2831e81a653e3cc554281eb45d5569262adc05 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 2 Nov 2021 17:45:29 +0800 Subject: [PATCH 002/272] fix issue --- templates/repo/view_file.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 7c98420d9..60777b5dd 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -63,7 +63,7 @@ {{.i18n.Tr "repo.file_history"}}
{{if .Repository.CanEnableEditor}} - {{if .CanEditFile}} + {{.CanEditFile}}{{if .CanEditFile}} {{svg "octicon-pencil" 16}} {{else}} {{svg "octicon-pencil" 16}} From 99f4bc4958733cbaaca20c548760f66fbf9f509f Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 3 Nov 2021 11:21:22 +0800 Subject: [PATCH 003/272] fix issue --- public/img/git-logo.svg | 33 +++++++++++++++++++++++++++++++++ templates/base/head_navbar.tmpl | 8 ++++++++ 2 files changed, 41 insertions(+) create mode 100644 public/img/git-logo.svg diff --git a/public/img/git-logo.svg b/public/img/git-logo.svg new file mode 100644 index 000000000..c006bc090 --- /dev/null +++ b/public/img/git-logo.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index c22cb9fa7..57df408c9 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -7,6 +7,14 @@
+
+
+ + + +
+ + {{if .IsSigned}} {{.i18n.Tr "index"}} From 9538871d6e1bab29f4789fd0d2b14a5eda3a94df Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 3 Nov 2021 17:45:51 +0800 Subject: [PATCH 004/272] change logo.svg --- public/img/git-logo.svg | 60 +++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/public/img/git-logo.svg b/public/img/git-logo.svg index c006bc090..70e6ab484 100644 --- a/public/img/git-logo.svg +++ b/public/img/git-logo.svg @@ -1,33 +1,41 @@ + viewBox="0 0 96 17.3" style="enable-background:new 0 0 96 17.3;" xml:space="preserve"> - - - - - - - - - - - + + + + + + + From 0137f56d9920b91554801bbce7d6beb5d2e26418 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 4 Nov 2021 11:00:10 +0800 Subject: [PATCH 005/272] fix issue #596 --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 1 + templates/repo/header.tmpl | 95 +++++++++++++++++++++++---------- 3 files changed, 70 insertions(+), 27 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 7fa8c7a4f..da43279f8 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -755,6 +755,7 @@ unit_disabled = The site administrator has disabled this repository section. language_other = Other datasets = Datasets datasets.desc = Enable Dataset +cloudbrain_helper=Use GPU/NPU resources to open notebooks, model training tasks, etc. debug=Debug stop=Stop diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 81b4a8459..fffee7af8 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -757,6 +757,7 @@ unit_disabled=站点管理员已禁用此项目单元。 language_other=其它 datasets=数据集 datasets.desc=数据集功能 +cloudbrain_helper=使用GPU/NPU资源,开启Notebook、模型训练任务等 debug=调试 stop=停止 diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index c290de552..747857ce3 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -88,20 +88,69 @@ {{end}} +
{{if not .Repository.IsBeingCreated}} {{end}} -
{{if not .Repository.IsBeingCreated}} From 9fcf389165dd1d11c41ac2b4cff822feb3226e12 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Thu, 11 Nov 2021 10:58:55 +0800 Subject: [PATCH 055/272] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E5=92=8C=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E4=BB=A3=E7=A0=81bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/api/v1/repo/repo_dashbord.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/api/v1/repo/repo_dashbord.go b/routers/api/v1/repo/repo_dashbord.go index 4555d8a5c..975c3aa00 100644 --- a/routers/api/v1/repo/repo_dashbord.go +++ b/routers/api/v1/repo/repo_dashbord.go @@ -198,7 +198,7 @@ func getFileName(ctx *context.Context, beginTime time.Time, endTime time.Time) s if ctx.QueryTrim("q") != "" { baseName = baseName + ctx.QueryTrim("q") + "_" } - baseName = baseName + beginTime.Format(DATE_FORMAT) + "_to_" + endTime.Format(DATE_FORMAT) + "_" + strconv.FormatInt(time.Now().Unix(), 10) + ".csv" + baseName = baseName + beginTime.AddDate(0, 0, -1).Format(DATE_FORMAT) + "_to_" + endTime.AddDate(0, 0, -1).Format(DATE_FORMAT) + "_" + strconv.FormatInt(time.Now().Unix(), 10) + ".csv" return baseName } @@ -424,7 +424,7 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time, endTimeStr := ctx.QueryTrim("endTime") var beginTime time.Time var endTime time.Time - + var err error if queryType != "" { if queryType == "all" { @@ -469,12 +469,12 @@ func getTimePeroid(ctx *context.Context, recordBeginTime time.Time) (time.Time, } else { - beginTime, err := time.Parse("2006-01-02", beginTimeStr) + beginTime, err = time.Parse("2006-01-02", beginTimeStr) if err != nil { return now, now, err } - endTime, err := time.Parse("2006-01-02", endTimeStr) + endTime, err = time.Parse("2006-01-02", endTimeStr) if err != nil { return now, now, err } From 57b1a05ab5e953e8623ddf43ca443017803022a7 Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 11 Nov 2021 11:01:40 +0800 Subject: [PATCH 056/272] =?UTF-8?q?=E5=88=B7=E6=96=B0=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E7=8A=B6=E6=80=81=E5=92=8C=E6=97=B6?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/cloudbrain.go | 5 +++ routers/api/v1/api.go | 3 ++ routers/api/v1/repo/modelarts.go | 62 +++++++++++++++++++++++++------- 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index a061857c4..366ba74e4 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1066,6 +1066,11 @@ func GetRepoCloudBrainByJobID(repoID int64, jobID string) (*Cloudbrain, error) { return getRepoCloudBrain(cb) } +func GetRepoCloudBrainByJobIDAndVersionName(repoID int64, jobID string, versionName string) (*Cloudbrain, error) { + cb := &Cloudbrain{JobID: jobID, RepoID: repoID, VersionName: versionName} + return getRepoCloudBrain(cb) +} + func GetCloudbrainByJobID(jobID string) (*Cloudbrain, error) { cb := &Cloudbrain{JobID: jobID} return getRepoCloudBrain(cb) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 8b068d612..3842907cf 100755 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -875,6 +875,9 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/:jobid", func() { m.Get("", repo.GetModelArtsTrainJob) m.Get("/log", repo.TrainJobGetLog) + m.Group("/:version-name", func() { + m.Get("", repo.GetModelArtsTrainJobVersion) + }) }) }) }, reqRepoReader(models.UnitTypeCloudBrain)) diff --git a/routers/api/v1/repo/modelarts.go b/routers/api/v1/repo/modelarts.go index 2e825d8cc..6d9bba64b 100755 --- a/routers/api/v1/repo/modelarts.go +++ b/routers/api/v1/repo/modelarts.go @@ -6,12 +6,13 @@ package repo import ( + "net/http" + "strconv" + "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/modelarts" - "net/http" - "strconv" ) func GetModelArtsNotebook(ctx *context.APIContext) { @@ -72,9 +73,44 @@ func GetModelArtsTrainJob(ctx *context.APIContext) { } ctx.JSON(http.StatusOK, map[string]interface{}{ - "JobID": jobID, - "JobStatus": job.Status, - "JobDuration": job.Duration, + "JobID": jobID, + "JobStatus": job.Status, + "JobDuration": job.Duration, + }) + +} + +func GetModelArtsTrainJobVersion(ctx *context.APIContext) { + var ( + err error + ) + + jobID := ctx.Params(":jobid") + versionName := ctx.Params(":version-name") + repoID := ctx.Repo.Repository.ID + job, err := models.GetRepoCloudBrainByJobIDAndVersionName(repoID, jobID, versionName) + if err != nil { + ctx.NotFound(err) + return + } + result, err := modelarts.GetTrainJob(jobID, strconv.FormatInt(job.VersionID, 10)) + if err != nil { + ctx.NotFound(err) + return + } + + job.Status = modelarts.TransTrainJobStatus(result.IntStatus) + job.Duration = result.Duration + job.TrainJobDuration = result.TrainJobDuration + err = models.UpdateJob(job) + if err != nil { + log.Error("UpdateJob failed:", err) + } + + ctx.JSON(http.StatusOK, map[string]interface{}{ + "JobID": jobID, + "JobStatus": job.Status, + "JobDuration": job.Duration, }) } @@ -94,7 +130,7 @@ func TrainJobGetLog(ctx *context.APIContext) { if order != modelarts.OrderDesc && order != modelarts.OrderAsc { log.Error("order(%s) check failed", order) ctx.JSON(http.StatusBadRequest, map[string]interface{}{ - "err_msg": "order check failed", + "err_msg": "order check failed", }) return } @@ -103,7 +139,7 @@ func TrainJobGetLog(ctx *context.APIContext) { if err != nil { log.Error("GetCloudbrainByJobID(%s) failed:%v", jobID, err.Error()) ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ - "err_msg": "GetCloudbrainByJobID failed", + "err_msg": "GetCloudbrainByJobID failed", }) return } @@ -112,16 +148,16 @@ func TrainJobGetLog(ctx *context.APIContext) { if err != nil { log.Error("GetTrainJobLog(%s) failed:%v", jobID, err.Error()) ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ - "err_msg": "GetTrainJobLog failed", + "err_msg": "GetTrainJobLog failed", }) return } ctx.JSON(http.StatusOK, map[string]interface{}{ - "JobID": jobID, - "StartLine": result.StartLine, - "EndLine": result.EndLine, - "Content": result.Content, - "Lines": result.Lines, + "JobID": jobID, + "StartLine": result.StartLine, + "EndLine": result.EndLine, + "Content": result.Content, + "Lines": result.Lines, }) } From f233b56683d676705a873196e6b8d2378ddefdf3 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 11 Nov 2021 11:06:44 +0800 Subject: [PATCH 057/272] fix issue --- web_src/js/components/basic/editDialog.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web_src/js/components/basic/editDialog.vue b/web_src/js/components/basic/editDialog.vue index 28e18a91a..19a68166f 100644 --- a/web_src/js/components/basic/editDialog.vue +++ b/web_src/js/components/basic/editDialog.vue @@ -14,8 +14,11 @@ From e2740b5148553ce82baf6d1ebd5a6918a161f71c Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 11 Nov 2021 11:30:58 +0800 Subject: [PATCH 058/272] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=95=B0=E5=88=9D=E5=A7=8B=E5=8C=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/cloudbrain.go | 8 ++++---- modules/modelarts/modelarts.go | 3 +++ routers/repo/modelarts.go | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 366ba74e4..f653f6e1e 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -73,7 +73,7 @@ type Cloudbrain struct { VersionName string `xorm:"INDEX"` Uuid string DatasetName string - VersionCount int64 `xorm:"INDEX DEFAULT 1"` + VersionCount int `xorm:"INDEX DEFAULT 1"` IsLatestVersion string CommitID string FatherVersionName string @@ -971,7 +971,7 @@ func Cloudbrains(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { return cloudbrains, count, nil } -func CloudbrainsVersionList(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { +func CloudbrainsVersionList(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int, error) { sess := x.NewSession() defer sess.Close() @@ -1034,7 +1034,7 @@ func CloudbrainsVersionList(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, } sess.Close() - return cloudbrains, count, nil + return cloudbrains, int(count), nil } func CreateCloudbrain(cloudbrain *Cloudbrain) (err error) { @@ -1110,7 +1110,7 @@ func SetTrainJobStatusByJobID(jobID string, status string, duration int64, train return } -func SetVersionCountAndLatestVersionByJobIDAndVersionName(jobID string, versionName string, versionCount int64, isLatestVersion string) (err error) { +func SetVersionCountAndLatestVersionByJobIDAndVersionName(jobID string, versionName string, versionCount int, isLatestVersion string) (err error) { cb := &Cloudbrain{JobID: jobID, VersionName: versionName, VersionCount: versionCount, IsLatestVersion: isLatestVersion} _, err = x.Cols("version_Count", "is_latest_version").Where("cloudbrain.job_id=? AND cloudbrain.version_name=?", jobID, versionName).Update(cb) return diff --git a/modules/modelarts/modelarts.go b/modules/modelarts/modelarts.go index 88378ab10..39601a600 100755 --- a/modules/modelarts/modelarts.go +++ b/modules/modelarts/modelarts.go @@ -49,6 +49,7 @@ const ( NotLatestVersion = "0" ComputeResource = "NPU" InitFatherVersionName = "V0001" + VersionCount = 1 SortByCreateTime = "create_time" ConfigTypeCustom = "custom" @@ -79,6 +80,7 @@ type GenerateTrainJobReq struct { BranchName string FatherVersionName string FlavorName string + VersionCount int } type GenerateTrainJobVersionReq struct { @@ -259,6 +261,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error Description: req.Description, WorkServerNumber: req.WorkServerNumber, FlavorName: req.FlavorName, + VersionCount: req.VersionCount, }) if err != nil { diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 8e75c58a9..bf4a1f31f 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -715,6 +715,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) branch_name := form.BranchName isLatestVersion := modelarts.IsLatestVersion FlavorName := form.FlavorName + VersionCount := modelarts.VersionCount if err := paramCheckCreateTrainJob(form); err != nil { log.Error("paramCheckCreateTrainJob failed:(%v)", err) @@ -862,6 +863,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) Params: form.Params, FatherVersionName: modelarts.InitFatherVersionName, FlavorName: FlavorName, + VersionCount: VersionCount, } err = modelarts.GenerateTrainJob(ctx, req) From 4b970a1bddb3ecd9c990cb6d660d7592a31e6764 Mon Sep 17 00:00:00 2001 From: liuzx Date: Thu, 11 Nov 2021 15:40:54 +0800 Subject: [PATCH 059/272] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E5=90=AF=E5=8A=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/modelarts/modelarts.go | 6 ++++-- routers/repo/modelarts.go | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/modelarts/modelarts.go b/modules/modelarts/modelarts.go index 39601a600..8db1c11bf 100755 --- a/modules/modelarts/modelarts.go +++ b/modules/modelarts/modelarts.go @@ -66,6 +66,7 @@ type GenerateTrainJobReq struct { Description string CodeObsPath string BootFile string + BootFileUrl string DataUrl string TrainUrl string FlavorCode string @@ -89,6 +90,7 @@ type GenerateTrainJobVersionReq struct { Description string CodeObsPath string BootFile string + BootFileUrl string DataUrl string TrainUrl string FlavorCode string @@ -210,7 +212,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error Config: models.Config{ WorkServerNum: req.WorkServerNumber, AppUrl: req.CodeObsPath, - BootFileUrl: req.BootFile, + BootFileUrl: req.BootFileUrl, DataUrl: req.DataUrl, EngineID: req.EngineID, TrainUrl: req.TrainUrl, @@ -278,7 +280,7 @@ func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobVersionR Config: models.TrainJobVersionConfig{ WorkServerNum: req.WorkServerNumber, AppUrl: req.CodeObsPath, - BootFileUrl: req.BootFile, + BootFileUrl: req.BootFileUrl, DataUrl: req.DataUrl, EngineID: req.EngineID, TrainUrl: req.TrainUrl, diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index bf4a1f31f..5ca28515e 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -848,7 +848,8 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) DataUrl: dataPath, Description: description, CodeObsPath: codeObsPath, - BootFile: codeObsPath + bootFile, + BootFileUrl: codeObsPath + bootFile, + BootFile: bootFile, TrainUrl: outputObsPath, FlavorCode: flavorCode, WorkServerNumber: workServerNumber, @@ -912,9 +913,6 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) { ctx.Data["PageIsTrainJob"] = true var jobID = ctx.Params(":jobid") - // var fatherVersionName = ctx.Query("versionName") - // jobID = "19373" - // versionName = "V0009" jobName := form.JobName uuid := form.Attachment @@ -1072,7 +1070,8 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ DataUrl: dataPath, Description: description, CodeObsPath: codeObsPath, - BootFile: codeObsPath + bootFile, + BootFileUrl: codeObsPath + bootFile, + BootFile: bootFile, TrainUrl: outputObsPath, FlavorCode: flavorCode, WorkServerNumber: workServerNumber, From 3b301fdd95aeccbf6c84e22bd6d217a407259746 Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 11 Nov 2021 15:55:51 +0800 Subject: [PATCH 060/272] modify code --- options/locale/locale_zh-CN.ini | 14 +- public/img/name.png | Bin 0 -> 5107 bytes public/img/overview.png | Bin 0 -> 1523 bytes public/img/pro.png | Bin 0 -> 1960 bytes public/img/pro.svg | 1 + routers/home.go | 9 +- routers/routes/routes.go | 1 + templates/base/head_navbar.tmpl | 1 + templates/base/head_navbar_home.tmpl | 1 + templates/explore/data_analysis.tmpl | 14 + web_src/js/components/DataAnalysis.vue | 123 ++++ web_src/js/components/ProAnalysis.vue | 923 +++++++++++++++++++++++++ web_src/js/components/UserAnalysis.vue | 415 +++++++++++ web_src/js/excel/Blob.js | 179 +++++ web_src/js/excel/Export2Excel.js | 141 ++++ web_src/js/excel/util.js | 17 + web_src/js/index.js | 25 +- 17 files changed, 1846 insertions(+), 18 deletions(-) create mode 100755 public/img/name.png create mode 100755 public/img/overview.png create mode 100755 public/img/pro.png create mode 100755 public/img/pro.svg create mode 100755 templates/explore/data_analysis.tmpl create mode 100755 web_src/js/components/DataAnalysis.vue create mode 100755 web_src/js/components/ProAnalysis.vue create mode 100755 web_src/js/components/UserAnalysis.vue create mode 100755 web_src/js/excel/Blob.js create mode 100755 web_src/js/excel/Export2Excel.js create mode 100755 web_src/js/excel/util.js diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index a6d40355b..035c40d92 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -229,6 +229,7 @@ organizations=组织 images = 云脑镜像 search=搜索 code=代码 +data_analysis=数字看板 repo_no_results=未找到匹配的项目。 dataset_no_results = 未找到匹配的数据集。 user_no_results=未找到匹配的用户。 @@ -2162,19 +2163,6 @@ repos.stars=点赞数 repos.forks=派生数 repos.issues=任务数 repos.size=大小 -repos.id=ID -repos.projectName=项目名称 -repos.isPrivate=私有 -repos.openi=OpenI指数 -repos.visit=浏览量 -repos.download=代码下载量 -repos.pr=PR数 -repos.commit=Commit数 -repos.closedIssues=已解决任务数 -repos.contributor=贡献者数 -repos.yes=是 -repos.no=否 - datasets.dataset_manage_panel=数据集管理 datasets.owner=所有者 diff --git a/public/img/name.png b/public/img/name.png new file mode 100755 index 0000000000000000000000000000000000000000..11a5c8751e587b6816c14477b49db11c66a07dfa GIT binary patch literal 5107 zcmZWtcQo7o`=$0?Ra(2Ph`m=;5i54B7^O63VpdS2ReSGUrCPIQ1)1>8P(!6A=;7=|DA1h=_>Y`?#Mnr^8p*ej(2K2-z6Kx1l?Fi?0A|eu^yZUCD00|s#Z*OyRb1yG1 z01ysFB?tfvkO015fY#aBnP4G|0F9@o zCtw6*7kYnxe?lNofe}GTa1nR{Mj#MC>+bGOkRg#s0#B$wEC7HJ;Q$y|gK))#^8be3 zz*YdhSOCBT`$ZsO^#3yfC1H6$321=!ZwtY7!TcQytPSu0LpTHsR5v#_fFW4^9sySq z_>1~CLr?;hu*`*q!2jnWLim4nBandog1^YWumixy#|OwHXaE7AC&&N>-~mh!pirm_ z*MD{(TtukAh#(`_2}(lvg$sxRVgVW9<9A^s2ng2^$p1tU+KcB5v=>Vf^gzPjcTEaK zF9BbGKfWf0rbNVyBJiBp$`t8IW_;pMA z=Nv)7bSu~@)~F(H z6;R%`HuqnY;I5E-Ic+ey+qS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 z%RZT;*P5~;=Gfh)f_+cPAxj_n?DpD^*k3=v#J%HFtIo`h*Js1vXvXD3*>cFfZ2oIj zC8xIg6YoG#jNct9cBAmt@4IES<7F>13mfLdNqyZv9qwUVo)Uf8VJFHdi1%G)ihwRF zfpokF0yNkwX&P~9@IVeD+n<`RW--dsG_?CpwpZ{9@{)Rb^L)lRWZ%-4SY6^VvpcvF z?q9HPk~g3z^_-}dtn>KCF7bZM>>FZhfB!K4zH1j&Au;UPwO#h_-*Y;eh8ndH`|$q( Dc9WZU literal 0 HcmV?d00001 diff --git a/public/img/overview.png b/public/img/overview.png new file mode 100755 index 0000000000000000000000000000000000000000..b704ead840b2cb65ac7a375194cd30ff7fc345ed GIT binary patch literal 1523 zcmVPx)tw}^dRCr$PTWe@tMG&6Zq(l^@0aNh_f>5kT!TQI?j|ggwCHL;!k}4>el0NJM z(}=}_VxuTntdFX#G*ya-pba^*NeZ!2N`F`s!D5vvf>0H#f?|WBRFa;NEloT*-E+^L zdv9*j^vu6xXLr8&c4l|Z?p}loT<`+-A94cn2&gjyrBdn2Fbr2CVjBS5aK`-iA~K?s z+8G4FFZF~}*AyV4l>pES09PeAdEB-$^R9Z4P&WdI=p_Jn!qc&>%)HT4w<@)1C!nLF zQ5U1MD!Q{Y;yoPj);#3LGWR;jfkECfaeo{cQf<`0m{m{^mO^upJ%?Qw1Yo*jS5xLHRY&|n?_eI>> z+pCToIr1t1*fg3Vi1othDBcbmm zX5LcCxY0gU5zyM&+SuIO+y?;59YFRV;)ZG~yHcrimx#Op05>^o>^^bg#Hxb_4~|z# zM8yOYi^ZFjQf~pk9gbY>HOAO&t|ns3XA!YGN{3^>Ltz-M85|t^x)Ng*5kN#1h|TGi zn9)&0d^EnrRRYY_M{B(q5p5|Qm)`(j9W(c5wUwCwB6TOX`m`-B3$Sv!M6?h9Z2H~i z(EDI~e7tLTc=#V5dtL-+trsDpUF>dg3_5L9S~&;W+S;0$nwo6EWy|Qe92SvP#+WbC zNJu4sh#nG=orrizbTC9bCL${;-Qv=K`L+{L4*@YSMP#X?;}&M#lm@Ea?Zsm8 zT14E1h>PR45pf_4!xhGu(X-m({~#i}uvj)1#M=H9k(I`n_v-Cj7JEcw)4`@iT)qJS zo3fuyN#*DtL}V*E>%4NXxF`sM!&$(bD_yO17b03e;u4-AVfRGCWC{?GJ+89HR!(8& z)CKcgIqb4aL{bLNMrPh>+oJ@O>j1NifJuL%1nfzuwNDc{%LwRa=4DeNptG~{qS4XO zmz7eDBC;O8ScM-lDO)wickoqBh0aL|6XRxQ30 zSl2Z`Yi&!=o`e%!5RpIa@m4MF6lNR&TI+ieai7oBipXMP%*Q^u)vjT6ivS|}#C405 z;J_hfzH_z_U~g|OpKwYX`ylPMqSUsV`t(B7Dco38;1zt<{Y9&RDJNO^lOAKpp{g`W8qF@w9f|(4Wxr9WPIT zJOz?d;OFSGb`iPN=fOdxg!+c8Pbw4&g)15w8h(xF9%tsOU40W%pj0XiiAeN?_g?_8 z%RX5%#{A#|B&w6t Z@E@88)nDGXoUs4^002ovPDHLkV1jH+%oYFu literal 0 HcmV?d00001 diff --git a/public/img/pro.png b/public/img/pro.png new file mode 100755 index 0000000000000000000000000000000000000000..7d44e180e543762d81bc9d96696ee2ed4d8c2f70 GIT binary patch literal 1960 zcmV;Z2UqxsP)Px+Vo5|nRCr$Pn|+8>RTRL_c{6LfU=q|uiBR;9S`tAdMG0CIY=wL8o5si@p%3Xx zGe6c{cURZ1w6HI?4^jH3G>u{A-C37b{J=0Mv9c{Fq$H`Vq^~7G*P5Ak;tco6ZQR*; zGxKJ4m3jZon|sea=lAYA=iYPALl^~@5aJ<3oCg3?iKsgi3U$Zh@$agk8dhVFd}Bx{ z?*#xh{H~lfe<5Nw!*Cqu&r0ezA^@b6w`s#?8OH4ZfIR^40svgb_Yv`^hR_WFR0$AO z1t6uI!c(1y<{HNA$z(E1dwP1l@a{<|muL{4euo%@Qfh0^5UK*ew(SY7>&`>O7Q=wU zmSruC$K!j4GODYq%j)m%UzgK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bQGX4WYLkf;t9!vZH0000 \ No newline at end of file diff --git a/routers/home.go b/routers/home.go index dfdb030e4..d2c93c771 100755 --- a/routers/home.go +++ b/routers/home.go @@ -33,8 +33,9 @@ const ( // tplExploreOrganizations explore organizations page template tplExploreOrganizations base.TplName = "explore/organizations" // tplExploreCode explore code page template - tplExploreCode base.TplName = "explore/code" - tplExploreImages base.TplName = "explore/images" + tplExploreCode base.TplName = "explore/code" + tplExploreImages base.TplName = "explore/images" + tplExploreExploreDataAnalysis base.TplName = "explore/data_analysis" ) // Home render home page @@ -501,6 +502,10 @@ func ExploreImages(ctx *context.Context) { ctx.HTML(200, tplExploreImages) } +func ExploreDataAnalysis(ctx *context.Context) { + ctx.HTML(200, tplExploreExploreDataAnalysis) +} + // NotFound render 404 page func NotFound(ctx *context.Context) { ctx.Data["Title"] = "Page Not Found" diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 383a308b6..a3de68373 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -325,6 +325,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/organizations", routers.ExploreOrganizations) m.Get("/code", routers.ExploreCode) m.Get("/images", routers.ExploreImages) + m.Get("/data_analysis", routers.ExploreDataAnalysis) }, ignSignIn) m.Combo("/install", routers.InstallInit).Get(routers.Install). Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost) diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 57df408c9..67d8fc1b7 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -37,6 +37,7 @@ {{.i18n.Tr "explore.users"}} {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} + {{.i18n.Tr "explore.data_analysis"}}
{{else if .IsLandingPageHome}} diff --git a/templates/base/head_navbar_home.tmpl b/templates/base/head_navbar_home.tmpl index e6729da62..e334efba8 100644 --- a/templates/base/head_navbar_home.tmpl +++ b/templates/base/head_navbar_home.tmpl @@ -29,6 +29,7 @@ {{.i18n.Tr "explore.users"}} {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} + {{.i18n.Tr "explore.data_analysis"}} {{else if .IsLandingPageHome}} diff --git a/templates/explore/data_analysis.tmpl b/templates/explore/data_analysis.tmpl new file mode 100755 index 000000000..8277dc902 --- /dev/null +++ b/templates/explore/data_analysis.tmpl @@ -0,0 +1,14 @@ +{{template "base/head" .}} +
+ + +
+ +{{template "base/footer" .}} + + diff --git a/web_src/js/components/DataAnalysis.vue b/web_src/js/components/DataAnalysis.vue new file mode 100755 index 000000000..8c632bccb --- /dev/null +++ b/web_src/js/components/DataAnalysis.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/web_src/js/components/ProAnalysis.vue b/web_src/js/components/ProAnalysis.vue new file mode 100755 index 000000000..7df0854e5 --- /dev/null +++ b/web_src/js/components/ProAnalysis.vue @@ -0,0 +1,923 @@ + + + + + \ No newline at end of file diff --git a/web_src/js/components/UserAnalysis.vue b/web_src/js/components/UserAnalysis.vue new file mode 100755 index 000000000..547a077f4 --- /dev/null +++ b/web_src/js/components/UserAnalysis.vue @@ -0,0 +1,415 @@ + + + + + \ No newline at end of file diff --git a/web_src/js/excel/Blob.js b/web_src/js/excel/Blob.js new file mode 100755 index 000000000..c43291d34 --- /dev/null +++ b/web_src/js/excel/Blob.js @@ -0,0 +1,179 @@ +/* eslint-disable */ +/* Blob.js + * A Blob implementation. + * 2014-05-27 + * + * By Eli Grey, http://eligrey.com + * By Devin Samarin, https://github.com/eboyjr + * License: X11/MIT + * See LICENSE.md + */ + +/*global self, unescape */ +/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, + plusplus: true */ + +/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */ + +(function (view) { + "use strict"; + + view.URL = view.URL || view.webkitURL; + + if (view.Blob && view.URL) { + try { + new Blob; + return; + } catch (e) {} + } + + // Internally we use a BlobBuilder implementation to base Blob off of + // in order to support older browsers that only have BlobBuilder + var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) { + var + get_class = function(object) { + return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]; + } + , FakeBlobBuilder = function BlobBuilder() { + this.data = []; + } + , FakeBlob = function Blob(data, type, encoding) { + this.data = data; + this.size = data.length; + this.type = type; + this.encoding = encoding; + } + , FBB_proto = FakeBlobBuilder.prototype + , FB_proto = FakeBlob.prototype + , FileReaderSync = view.FileReaderSync + , FileException = function(type) { + this.code = this[this.name = type]; + } + , file_ex_codes = ( + "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " + + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR" + ).split(" ") + , file_ex_code = file_ex_codes.length + , real_URL = view.URL || view.webkitURL || view + , real_create_object_URL = real_URL.createObjectURL + , real_revoke_object_URL = real_URL.revokeObjectURL + , URL = real_URL + , btoa = view.btoa + , atob = view.atob + + , ArrayBuffer = view.ArrayBuffer + , Uint8Array = view.Uint8Array + ; + FakeBlob.fake = FB_proto.fake = true; + while (file_ex_code--) { + FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; + } + if (!real_URL.createObjectURL) { + URL = view.URL = {}; + } + URL.createObjectURL = function(blob) { + var + type = blob.type + , data_URI_header + ; + if (type === null) { + type = "application/octet-stream"; + } + if (blob instanceof FakeBlob) { + data_URI_header = "data:" + type; + if (blob.encoding === "base64") { + return data_URI_header + ";base64," + blob.data; + } else if (blob.encoding === "URI") { + return data_URI_header + "," + decodeURIComponent(blob.data); + } if (btoa) { + return data_URI_header + ";base64," + btoa(blob.data); + } else { + return data_URI_header + "," + encodeURIComponent(blob.data); + } + } else if (real_create_object_URL) { + return real_create_object_URL.call(real_URL, blob); + } + }; + URL.revokeObjectURL = function(object_URL) { + if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) { + real_revoke_object_URL.call(real_URL, object_URL); + } + }; + FBB_proto.append = function(data/*, endings*/) { + var bb = this.data; + // decode data to a binary string + if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) { + var + str = "" + , buf = new Uint8Array(data) + , i = 0 + , buf_len = buf.length + ; + for (; i < buf_len; i++) { + str += String.fromCharCode(buf[i]); + } + bb.push(str); + } else if (get_class(data) === "Blob" || get_class(data) === "File") { + if (FileReaderSync) { + var fr = new FileReaderSync; + bb.push(fr.readAsBinaryString(data)); + } else { + // async FileReader won't work as BlobBuilder is sync + throw new FileException("NOT_READABLE_ERR"); + } + } else if (data instanceof FakeBlob) { + if (data.encoding === "base64" && atob) { + bb.push(atob(data.data)); + } else if (data.encoding === "URI") { + bb.push(decodeURIComponent(data.data)); + } else if (data.encoding === "raw") { + bb.push(data.data); + } + } else { + if (typeof data !== "string") { + data += ""; // convert unsupported types to strings + } + // decode UTF-16 to binary string + bb.push(unescape(encodeURIComponent(data))); + } + }; + FBB_proto.getBlob = function(type) { + if (!arguments.length) { + type = null; + } + return new FakeBlob(this.data.join(""), type, "raw"); + }; + FBB_proto.toString = function() { + return "[object BlobBuilder]"; + }; + FB_proto.slice = function(start, end, type) { + var args = arguments.length; + if (args < 3) { + type = null; + } + return new FakeBlob( + this.data.slice(start, args > 1 ? end : this.data.length) + , type + , this.encoding + ); + }; + FB_proto.toString = function() { + return "[object Blob]"; + }; + FB_proto.close = function() { + this.size = this.data.length = 0; + }; + return FakeBlobBuilder; + }(view)); + + view.Blob = function Blob(blobParts, options) { + var type = options ? (options.type || "") : ""; + var builder = new BlobBuilder(); + if (blobParts) { + for (var i = 0, len = blobParts.length; i < len; i++) { + builder.append(blobParts[i]); + } + } + return builder.getBlob(type); + }; +}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this)); \ No newline at end of file diff --git a/web_src/js/excel/Export2Excel.js b/web_src/js/excel/Export2Excel.js new file mode 100755 index 000000000..3c6d022af --- /dev/null +++ b/web_src/js/excel/Export2Excel.js @@ -0,0 +1,141 @@ +/* eslint-disable */ +require('script-loader!file-saver'); +require('./Blob'); +require('script-loader!xlsx/dist/xlsx.core.min'); +function generateArray(table) { + var out = []; + var rows = table.querySelectorAll('tr'); + var ranges = []; + for (var R = 0; R < rows.length; ++R) { + var outRow = []; + var row = rows[R]; + var columns = row.querySelectorAll('td'); + for (var C = 0; C < columns.length; ++C) { + var cell = columns[C]; + var colspan = cell.getAttribute('colspan'); + var rowspan = cell.getAttribute('rowspan'); + var cellValue = cell.innerText; + if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue; + + //Skip ranges + ranges.forEach(function (range) { + if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) { + for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null); + } + }); + + //Handle Row Span + if (rowspan || colspan) { + rowspan = rowspan || 1; + colspan = colspan || 1; + ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}}); + } + ; + + //Handle Value + outRow.push(cellValue !== "" ? cellValue : null); + + //Handle Colspan + if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null); + } + out.push(outRow); + } + return [out, ranges]; +}; + +function datenum(v, date1904) { + if (date1904) v += 1462; + var epoch = Date.parse(v); + return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000); +} + +function sheet_from_array_of_arrays(data, opts) { + var ws = {}; + var range = {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}}; + for (var R = 0; R != data.length; ++R) { + for (var C = 0; C != data[R].length; ++C) { + if (range.s.r > R) range.s.r = R; + if (range.s.c > C) range.s.c = C; + if (range.e.r < R) range.e.r = R; + if (range.e.c < C) range.e.c = C; + var cell = {v: data[R][C]}; + if (cell.v == null) continue; + var cell_ref = XLSX.utils.encode_cell({c: C, r: R}); + + if (typeof cell.v === 'number') cell.t = 'n'; + else if (typeof cell.v === 'boolean') cell.t = 'b'; + else if (cell.v instanceof Date) { + cell.t = 'n'; + cell.z = XLSX.SSF._table[14]; + cell.v = datenum(cell.v); + } + else cell.t = 's'; + + ws[cell_ref] = cell; + } + } + if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range); + return ws; +} + +function Workbook() { + if (!(this instanceof Workbook)) return new Workbook(); + this.SheetNames = []; + this.Sheets = {}; +} + +function s2ab(s) { + var buf = new ArrayBuffer(s.length); + var view = new Uint8Array(buf); + for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; + return buf; +} + +export function export_table_to_excel(id) { + var theTable = document.getElementById(id); + console.log('a') + var oo = generateArray(theTable); + var ranges = oo[1]; + + /* original data */ + var data = oo[0]; + var ws_name = "SheetJS"; + console.log(data); + + var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); + + /* add ranges to worksheet */ + // ws['!cols'] = ['apple', 'banan']; + ws['!merges'] = ranges; + + /* add worksheet to workbook */ + wb.SheetNames.push(ws_name); + wb.Sheets[ws_name] = ws; + + var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'}); + + saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), "test.xlsx") +} + +function formatJson(jsonData) { + console.log(jsonData) +} +export function export_json_to_excel(th, jsonData, defaultTitle) { + + /* original data */ + + var data = jsonData; + data.unshift(th); + var ws_name = "SheetJS"; + + var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); + + + /* add worksheet to workbook */ + wb.SheetNames.push(ws_name); + wb.Sheets[ws_name] = ws; + + var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'}); + var title = defaultTitle || '列表' + saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx") +} \ No newline at end of file diff --git a/web_src/js/excel/util.js b/web_src/js/excel/util.js new file mode 100755 index 000000000..b600e5e37 --- /dev/null +++ b/web_src/js/excel/util.js @@ -0,0 +1,17 @@ +export function export2Excel(columns,list,filename){ + require.ensure([], () => { + const { export_json_to_excel } = require('./Export2Excel'); + let tHeader = [] + let filterVal = [] + console.log(columns) + if(!columns){ + return; + } + columns.forEach(item =>{ + tHeader.push(item.title) + filterVal.push(item.key) + }) + const data = list.map(v => filterVal.map(j => v[j])) + export_json_to_excel(tHeader, data, filename); + }) +} \ No newline at end of file diff --git a/web_src/js/index.js b/web_src/js/index.js index 560683b7e..a6d07d0bc 100755 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -13,7 +13,7 @@ import qs from 'qs'; import 'jquery.are-you-sure'; import './vendor/semanticdropdown.js'; import {svg} from './utils.js'; - +import echarts from 'echarts' import initContextPopups from './features/contextpopup.js'; import initGitGraph from './features/gitgraph.js'; import initClipboard from './features/clipboard.js'; @@ -35,8 +35,9 @@ import {createCodeEditor} from './features/codeeditor.js'; import MinioUploader from './components/MinioUploader.vue'; import ObsUploader from './components/ObsUploader.vue'; import EditAboutInfo from './components/EditAboutInfo.vue'; -import Images from './components/Images.vue' -import EditTopics from './components/EditTopics.vue' +import Images from './components/Images.vue'; +import EditTopics from './components/EditTopics.vue'; +import DataAnalysis from './components/DataAnalysis.vue' import Contributors from './components/Contributors.vue' Vue.use(ElementUI); @@ -44,6 +45,10 @@ Vue.prototype.$axios = axios; Vue.prototype.qs = qs; const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; +Object.defineProperty(Vue.prototype, '$echarts', { + value: echarts +}) + function htmlEncode(text) { return jQuery('
') .text(text) @@ -2972,6 +2977,7 @@ $(document).ready(async () => { initVueEditTopic(); initVueContributors(); initVueImages(); + initVueDataAnalysis(); initTeamSettings(); initCtrlEnterSubmit(); initNavbarContentToggle(); @@ -3713,7 +3719,20 @@ function initVueImages() { render: h => h(Images) }); } +function initVueDataAnalysis() { + const el = document.getElementById('data_analysis'); + console.log("el",el) + + if (!el) { + return; + } + new Vue({ + el: '#data_analysis', + + render: h => h(DataAnalysis) + }); +} // 新增 function initObsUploader() { const el = document.getElementById('obsUploader'); From 03903b2fc0a4ac944aaa8d91fe3f4ca824f34bf1 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 11 Nov 2021 16:33:29 +0800 Subject: [PATCH 061/272] show right flavor --- models/cloudbrain.go | 1 + modules/auth/modelarts.go | 1 + modules/modelarts/modelarts.go | 4 +- routers/repo/cloudbrain.go | 2 +- routers/repo/modelarts.go | 231 +-------------------- templates/repo/modelarts/new.tmpl | 2 +- templates/repo/modelarts/notebook/new.tmpl | 2 +- 7 files changed, 9 insertions(+), 234 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index af5e9f169..a106d7433 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -353,6 +353,7 @@ type FlavorInfos struct { type FlavorInfo struct { Id int `json:"id"` Value string `json:"value"` + Desc string `json:"desc"` } type PoolInfos struct { diff --git a/modules/auth/modelarts.go b/modules/auth/modelarts.go index f2e5aeed5..e9e101523 100755 --- a/modules/auth/modelarts.go +++ b/modules/auth/modelarts.go @@ -19,6 +19,7 @@ type CreateModelArtsNotebookForm struct { JobName string `form:"job_name" binding:"Required"` Attachment string `form:"attachment"` Description string `form:"description"` + Flavor string `form:"flavor"` } func (f *CreateModelArtsNotebookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { diff --git a/modules/modelarts/modelarts.go b/modules/modelarts/modelarts.go index e1dbe9f5a..3153fbc52 100755 --- a/modules/modelarts/modelarts.go +++ b/modules/modelarts/modelarts.go @@ -99,7 +99,7 @@ type ResourcePool struct { } `json:"resource_pool"` } -func GenerateTask(ctx *context.Context, jobName, uuid, description string) error { +func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor string) error { var dataActualPath string if uuid != "" { dataActualPath = setting.Bucket + "/" + setting.BasePath + path.Join(uuid[0:1], uuid[1:2]) + "/" + uuid + "/" @@ -128,7 +128,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description string) error JobName: jobName, Description: description, ProfileID: setting.ProfileID, - Flavor: setting.Flavor, + Flavor: flavor, Pool: models.Pool{ ID: poolInfos.PoolInfo[0].PoolId, Name: poolInfos.PoolInfo[0].PoolName, diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 03fba6cd1..529d576bc 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -204,7 +204,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { resourceSpecId := form.ResourceSpecId if !jobNamePattern.MatchString(jobName) { - ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplModelArtsNew, &form) + ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplCloudBrainNew, &form) return } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index f33d345cd..aec6a024f 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -27,15 +27,10 @@ import ( ) const ( - // tplModelArtsNotebookIndex base.TplName = "repo/modelarts/notebook/index" tplModelArtsNotebookIndex base.TplName = "repo/modelarts/notebook/index" tplModelArtsNotebookNew base.TplName = "repo/modelarts/notebook/new" tplModelArtsNotebookShow base.TplName = "repo/modelarts/notebook/show" - tplModelArtsIndex base.TplName = "repo/modelarts/index" - tplModelArtsNew base.TplName = "repo/modelarts/new" - tplModelArtsShow base.TplName = "repo/modelarts/show" - tplModelArtsTrainJobIndex base.TplName = "repo/modelarts/trainjob/index" tplModelArtsTrainJobNew base.TplName = "repo/modelarts/trainjob/new" tplModelArtsTrainJobShow base.TplName = "repo/modelarts/trainjob/show" @@ -50,229 +45,6 @@ func MustEnableModelArts(ctx *context.Context) { } } -func ModelArtsIndex(ctx *context.Context) { - MustEnableModelArts(ctx) - repo := ctx.Repo.Repository - page := ctx.QueryInt("page") - if page <= 0 { - page = 1 - } - - ciTasks, count, err := models.Cloudbrains(&models.CloudbrainsOptions{ - ListOptions: models.ListOptions{ - Page: page, - PageSize: setting.UI.IssuePagingNum, - }, - RepoID: repo.ID, - Type: models.TypeCloudBrainTwo, - }) - if err != nil { - ctx.ServerError("Cloudbrain", err) - return - } - - for i, task := range ciTasks { - if task.Status == string(models.JobRunning) { - ciTasks[i].CanDebug = true - } else { - ciTasks[i].CanDebug = false - } - - ciTasks[i].CanDel = models.CanDelJob(ctx.IsSigned, ctx.User, task) - } - - pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) - pager.SetDefaultParams(ctx) - ctx.Data["Page"] = pager - - ctx.Data["PageIsCloudBrain"] = true - ctx.Data["Tasks"] = ciTasks - ctx.HTML(200, tplModelArtsIndex) -} - -func ModelArtsNew(ctx *context.Context) { - ctx.Data["PageIsCloudBrain"] = true - - t := time.Now() - var jobName = jobNamePrefixValid(cutString(ctx.User.Name, 5)) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] - ctx.Data["job_name"] = jobName - - attachs, err := models.GetModelArtsUserAttachments(ctx.User.ID) - if err != nil { - ctx.ServerError("GetAllUserAttachments failed:", err) - return - } - - ctx.Data["attachments"] = attachs - ctx.Data["dataset_path"] = modelarts.DataSetMountPath - ctx.Data["env"] = modelarts.NotebookEnv - ctx.Data["notebook_type"] = modelarts.NotebookType - if modelarts.FlavorInfos == nil { - json.Unmarshal([]byte(setting.FlavorInfos), &modelarts.FlavorInfos) - } - ctx.Data["flavors"] = modelarts.FlavorInfos.FlavorInfo - ctx.HTML(200, tplModelArtsNew) -} - -func ModelArtsCreate(ctx *context.Context, form auth.CreateModelArtsForm) { - ctx.Data["PageIsCloudBrain"] = true - jobName := form.JobName - uuid := form.Attachment - description := form.Description - //repo := ctx.Repo.Repository - if !jobNamePattern.MatchString(jobName) { - ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplModelArtsNew, &form) - return - } - err := modelarts.GenerateTask(ctx, jobName, uuid, description) - if err != nil { - ctx.RenderWithErr(err.Error(), tplModelArtsNew, &form) - return - } - - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") -} - -func ModelArtsShow(ctx *context.Context) { - ctx.Data["PageIsCloudBrain"] = true - - var jobID = ctx.Params(":jobid") - task, err := models.GetCloudbrainByJobID(jobID) - if err != nil { - ctx.Data["error"] = err.Error() - ctx.RenderWithErr(err.Error(), tplModelArtsIndex, nil) - return - } - - result, err := modelarts.GetJob(jobID) - if err != nil { - ctx.Data["error"] = err.Error() - ctx.RenderWithErr(err.Error(), tplModelArtsIndex, nil) - return - } - - if result != nil { - task.Status = result.Status - err = models.UpdateJob(task) - if err != nil { - ctx.Data["error"] = err.Error() - ctx.RenderWithErr(err.Error(), tplModelArtsIndex, nil) - return - } - - createTime, _ := com.StrTo(result.CreationTimestamp).Int64() - result.CreateTime = time.Unix(int64(createTime/1000), 0).Format("2006-01-02 15:04:05") - endTime, _ := com.StrTo(result.LatestUpdateTimestamp).Int64() - result.LatestUpdateTime = time.Unix(int64(endTime/1000), 0).Format("2006-01-02 15:04:05") - result.QueuingInfo.BeginTime = time.Unix(int64(result.QueuingInfo.BeginTimestamp/1000), 0).Format("2006-01-02 15:04:05") - result.QueuingInfo.EndTime = time.Unix(int64(result.QueuingInfo.EndTimestamp/1000), 0).Format("2006-01-02 15:04:05") - } - - ctx.Data["task"] = task - ctx.Data["jobID"] = jobID - ctx.Data["result"] = result - ctx.HTML(200, tplModelArtsShow) -} - -func ModelArtsDebug(ctx *context.Context) { - var jobID = ctx.Params(":jobid") - _, err := models.GetCloudbrainByJobID(jobID) - if err != nil { - ctx.ServerError("GetCloudbrainByJobID failed", err) - return - } - - result, err := modelarts.GetJob(jobID) - if err != nil { - ctx.RenderWithErr(err.Error(), tplModelArtsIndex, nil) - return - } - - res, err := modelarts.GetJobToken(jobID) - if err != nil { - ctx.RenderWithErr(err.Error(), tplModelArtsIndex, nil) - return - } - - urls := strings.Split(result.Spec.Annotations.Url, "/") - urlPrefix := result.Spec.Annotations.TargetDomain - for i, url := range urls { - if i > 2 { - urlPrefix += "/" + url - } - } - - //urlPrefix := result.Spec.Annotations.TargetDomain + "/modelarts/internal/hub/notebook/user/" + task.JobID - log.Info(urlPrefix) - debugUrl := urlPrefix + "?token=" + res.Token - ctx.Redirect(debugUrl) -} - -func ModelArtsStop(ctx *context.Context) { - var jobID = ctx.Params(":jobid") - log.Info(jobID) - task, err := models.GetCloudbrainByJobID(jobID) - if err != nil { - ctx.ServerError("GetCloudbrainByJobID failed", err) - return - } - - if task.Status != string(models.JobRunning) { - log.Error("the job(%s) is not running", task.JobName) - ctx.ServerError("the job is not running", errors.New("the job is not running")) - return - } - - param := models.NotebookAction{ - Action: models.ActionStop, - } - res, err := modelarts.StopJob(jobID, param) - if err != nil { - log.Error("StopJob(%s) failed:%v", task.JobName, err.Error()) - ctx.ServerError("StopJob failed", err) - return - } - - task.Status = res.CurrentStatus - err = models.UpdateJob(task) - if err != nil { - ctx.ServerError("UpdateJob failed", err) - return - } - - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") -} - -func ModelArtsDel(ctx *context.Context) { - var jobID = ctx.Params(":jobid") - task, err := models.GetCloudbrainByJobID(jobID) - if err != nil { - ctx.ServerError("GetCloudbrainByJobID failed", err) - return - } - - if task.Status != string(models.ModelArtsCreateFailed) && task.Status != string(models.ModelArtsStartFailed) && task.Status != string(models.ModelArtsStopped) { - log.Error("the job(%s) has not been stopped", task.JobName) - ctx.ServerError("the job has not been stopped", errors.New("the job has not been stopped")) - return - } - - _, err = modelarts.DelJob(jobID) - if err != nil { - log.Error("DelJob(%s) failed:%v", task.JobName, err.Error()) - ctx.ServerError("DelJob failed", err) - return - } - - err = models.DeleteJob(task) - if err != nil { - ctx.ServerError("DeleteJob failed", err) - return - } - - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts") -} - func NotebookIndex(ctx *context.Context) { MustEnableModelArts(ctx) repo := ctx.Repo.Repository @@ -342,8 +114,9 @@ func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm) jobName := form.JobName uuid := form.Attachment description := form.Description + flavor := form.Flavor - err := modelarts.GenerateTask(ctx, jobName, uuid, description) + err := modelarts.GenerateTask(ctx, jobName, uuid, description, flavor) if err != nil { ctx.RenderWithErr(err.Error(), tplModelArtsNotebookNew, &form) return diff --git a/templates/repo/modelarts/new.tmpl b/templates/repo/modelarts/new.tmpl index 79a31286f..7ee499d91 100755 --- a/templates/repo/modelarts/new.tmpl +++ b/templates/repo/modelarts/new.tmpl @@ -138,7 +138,7 @@ diff --git a/templates/repo/modelarts/notebook/new.tmpl b/templates/repo/modelarts/notebook/new.tmpl index 8cfa680f7..284d6d6c7 100755 --- a/templates/repo/modelarts/notebook/new.tmpl +++ b/templates/repo/modelarts/notebook/new.tmpl @@ -138,7 +138,7 @@ From 7062ef2c4f3b7cdb9cfd8137454d5b9e8adf8643 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 11 Nov 2021 16:35:26 +0800 Subject: [PATCH 062/272] del code --- templates/repo/modelarts/index.tmpl | 485 ---------------------------- templates/repo/modelarts/new.tmpl | 240 -------------- templates/repo/modelarts/show.tmpl | 122 ------- 3 files changed, 847 deletions(-) delete mode 100755 templates/repo/modelarts/index.tmpl delete mode 100755 templates/repo/modelarts/new.tmpl delete mode 100755 templates/repo/modelarts/show.tmpl diff --git a/templates/repo/modelarts/index.tmpl b/templates/repo/modelarts/index.tmpl deleted file mode 100755 index 5ceccdd9a..000000000 --- a/templates/repo/modelarts/index.tmpl +++ /dev/null @@ -1,485 +0,0 @@ - -{{template "base/head" .}} - - - - -
-
-
-
-
-
-
-
-
- - -
- -
- {{template "repo/header" .}} - -
- - - -
- - -
- - - - 新建调试任务 -
-
- - -
-
-
- - - - - -
- - -
-
-
- {{$.i18n.Tr "repo.cloudbrain_task"}} -
-
- {{$.i18n.Tr "repo.cloudbrain_status_createtime"}} -
-
- {{$.i18n.Tr "repo.cloudbrain_creator"}} -
-
- {{$.i18n.Tr "repo.cloudbrain_operate"}} -
- -
- -
- - - - {{range .Tasks}} -
-
- - - - -
- - - - {{.Status}} - - - {{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}} -
- -
- {{if .User.Name}} - - {{else}} - - {{end}} -
- -
-
- - 查看 - - - 调试 - -
- {{$.CsrfTokenHtml}} - - 停止 - -
-
- - -
- {{$.CsrfTokenHtml}} - - 删除 - -
-
- - - - -
-
- {{end}} {{template "base/paginate" .}} -
- -
-
-
- -
- -
-
- - - - -
- -
- - -{{template "base/footer" .}} - - \ No newline at end of file diff --git a/templates/repo/modelarts/new.tmpl b/templates/repo/modelarts/new.tmpl deleted file mode 100755 index 7ee499d91..000000000 --- a/templates/repo/modelarts/new.tmpl +++ /dev/null @@ -1,240 +0,0 @@ -{{template "base/head" .}} - - -
-
-
-
-
-
-
-
-
-
- {{template "repo/header" .}} -
-
- {{template "base/alert" .}} -
-

-
-
- {{.CsrfTokenHtml}} -

- {{.i18n.Tr "repo.cloudbrain.new"}} -

-
- -
- - -
- -
- - - - {{range .attachments}} - - {{end}} - - -
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - {{.i18n.Tr "repo.cloudbrain.cancel"}} -
-
-
-
-
-
-{{template "base/footer" .}} - - \ No newline at end of file diff --git a/templates/repo/modelarts/show.tmpl b/templates/repo/modelarts/show.tmpl deleted file mode 100755 index 3f914b56d..000000000 --- a/templates/repo/modelarts/show.tmpl +++ /dev/null @@ -1,122 +0,0 @@ -{{template "base/head" .}} -
-{{template "repo/header" .}} -
-
- {{template "base/alert" .}} - -

- 返回 -

-
-
- {{with .task}} -

任务名称: {{.JobName}}

- {{end}} -
-
-

任务结果:

- {{with .result}} - - - - - - - - - - - - - - - -
状态 {{.Status}}
开始时间 {{.CreateTime}}
最后更新时间 {{.LatestUpdateTime}}
- {{end}} -
-
- {{with .result}} - - - - - - - - - - - - - - -
配置信息
开发环境类型 {{.Profile.DeType}}
硬件类型 {{.Profile.FlavorType}}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
机器规格详情
机器规格 {{.Flavor}}
规格名称 {{.FlavorDetails.Name}}
规格销售状态 {{.FlavorDetails.Status}}
排队个数 {{.FlavorDetails.QueuingNum}}
排到队的剩余时间(秒) {{.FlavorDetails.QueueLeftTime}}
自动停止时间(秒) {{.FlavorDetails.Duration}}
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
排队信息
实例状态 {{.QueuingInfo.Status}}
实例排队的开始时间 {{.QueuingInfo.BeginTime}}
排到队的剩余时间(秒) {{.QueuingInfo.RemainTime}}
实例排队的预计停止时间 {{.QueuingInfo.EndTime}}
实例在队列中的排位 {{.QueuingInfo.Rank}}
- {{end}} -
-
- -
-
-
-{{template "base/footer" .}} From d3e26430a8b083bb82f9372710af2589fde4a096 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 11 Nov 2021 17:03:48 +0800 Subject: [PATCH 063/272] fix issue --- templates/repo/modelarts/trainjob/show.tmpl | 379 +++++++++++++------- 1 file changed, 258 insertions(+), 121 deletions(-) diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 58a639ff5..08dce8c61 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -1,139 +1,269 @@ {{template "base/head" .}} +
{{template "repo/header" .}} -
-
- {{template "base/alert" .}} -

-
-
- {{$.i18n.Tr "repo.modelarts.version_manage"}} +
+

+ 返回 +

+
+
+
+
+ + + +
+ + + + +
+
+ 2021/11/08 19:35:19 + 当前版本:V0073 + 父版本:V0070 + 状态 + 运行成功 + + 运行时间: + 01:09:50 + + +
+
+
- +
+

+
+
+
+
+
+ + + + -
- -
-
- - {{$.i18n.Tr "repo.modelarts.train_job.version"}} -
-
+ 作业名称 +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}
{{.i18n.Tr "repo.modelarts.train_job.job_name"}} {{.result.JobName}}
{{.i18n.Tr "repo.modelarts.train_job.job_status"}} {{.result.Status}}
{{.i18n.Tr "repo.modelarts.train_job.version"}} {{.result.VersionName}}
{{.i18n.Tr "repo.modelarts.train_job.start_time"}} {{.result.CreateTime}}
{{.i18n.Tr "repo.modelarts.train_job.dura_time"}} {{.result.TrainJobDuration}}
{{.i18n.Tr "repo.modelarts.train_job.description"}} {{.result.Description}}
-
-
- - - - - - - - - - - - - - - - - - - - - - -
{{.i18n.Tr "repo.modelarts.train_job.parameter_setting_info"}}
{{.i18n.Tr "repo.modelarts.train_job.AI_driver"}} {{.result.EngineName}} | {{.result.EngineVersion}}
{{.i18n.Tr "repo.modelarts.train_job.start_file"}}{{.result.BootFileUrl}}
{{.i18n.Tr "repo.modelarts.train_job.dataset"}} {{.result.DatasetName}}
{{.i18n.Tr "repo.modelarts.train_job.run_parameter"}} {{.result.Parameter}}
-
-
- - - - - - - - + + + + + + + + + + + + + +
{{.i18n.Tr "repo.modelarts.train_job.resource_setting_info"}}
{{.i18n.Tr "repo.modelarts.train_job.resource_pool"}} {{.result.PoolName}} +
+ trainjob-d672 | job15b681bc +
+
+ 作业名称 + +
+ trainjob-d672 | job15b681bc +
+
+ 作业名称 + +
+ trainjob-d672 | job15b681bc +
+
+
+
+ + + + + + - - - + + + + - - - + + + +
+ 作业名称 + +
+ trainjob-d672 | job15b681bc +
+
{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}{{.result.WorkServerNum}}
+ 作业名称 + +
+ trainjob-d672 | job15b681bc +
+
{{.i18n.Tr "repo.modelarts.train_job.NAS_mount_path"}} {{.result.NasMountPath}}
+ 作业名称 + +
+ trainjob-d672 | job15b681bc +
+
-
-
- -
-
- - {{.log_file_name}} - - - -
-
-
-
{{.log.Content}}
-
- -
+
+ +
+
+
+
+ +
+
+ + {{.log_file_name}} + + +
+
+
+
{{.log.Content}}
+
+
+
+
+
+ asdasd +
+
+
@@ -143,8 +273,15 @@ \ No newline at end of file From 51b18b1be5ef2775098d93f2d40e65f2af64b4b9 Mon Sep 17 00:00:00 2001 From: liuzx Date: Fri, 12 Nov 2021 11:20:59 +0800 Subject: [PATCH 076/272] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/modelarts.go | 6 ++++-- routers/routes/routes.go | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 4da5d1d1c..83f070d92 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -620,7 +620,8 @@ func TrainJobNewVersion(ctx *context.Context) { func trainJobNewVersionDataPrepare(ctx *context.Context) error { ctx.Data["PageIsCloudBrain"] = true var jobID = ctx.Params(":jobid") - var versionName = ctx.Query("version_name") + var versionName = ctx.Params(":version-name") + // var versionName = ctx.Query("version_name") task, err := models.GetCloudbrainByJobIDAndVersionName(jobID, versionName) if err != nil { @@ -923,6 +924,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) { ctx.Data["PageIsTrainJob"] = true var jobID = ctx.Params(":jobid") + var versionName = ctx.Params(":version-name") jobName := form.JobName uuid := form.Attachment @@ -941,7 +943,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ logObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.LogPath dataPath := "/" + setting.Bucket + "/" + setting.BasePath + path.Join(uuid[0:1], uuid[1:2]) + "/" + uuid + uuid + "/" branch_name := form.BranchName - fatherVersionName := form.VersionName + fatherVersionName := versionName FlavorName := form.FlavorName if err := paramCheckCreateTrainJob(form); err != nil { diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 579137d1e..1b94c6dd6 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -989,8 +989,10 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/models", reqRepoCloudBrainReader, repo.TrainJobShowModels) m.Get("/download_model", reqRepoCloudBrainReader, repo.TrainJobDownloadModel) m.Get("/version_models", reqRepoCloudBrainReader, repo.TrainJobVersionShowModels) - m.Get("/create_version", reqRepoCloudBrainReader, repo.TrainJobNewVersion) - m.Post("/create_version", reqRepoCloudBrainWriter, bindIgnErr(auth.CreateModelArtsTrainJobForm{}), repo.TrainJobCreateVersion) + m.Group("/:version-name", func() { + m.Get("/create_version", reqRepoCloudBrainReader, repo.TrainJobNewVersion) + m.Post("/create_version", reqRepoCloudBrainWriter, bindIgnErr(auth.CreateModelArtsTrainJobForm{}), repo.TrainJobCreateVersion) + }) m.Post("/stop_version", reqRepoCloudBrainWriter, repo.TrainJobVersionStop) m.Post("/del_version", reqRepoCloudBrainWriter, repo.TrainJobVersionDel) }) From ba817105d8f619215c10add2c38020193d6896f2 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 12 Nov 2021 11:30:12 +0800 Subject: [PATCH 077/272] update --- templates/repo/modelarts/trainjob/show.tmpl | 2 +- .../repo/modelarts/trainjob/version_new.tmpl | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index dc290dec6..97788b9ff 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -123,7 +123,7 @@ td, th {
- 修改 + 修改
diff --git a/templates/repo/modelarts/trainjob/version_new.tmpl b/templates/repo/modelarts/trainjob/version_new.tmpl index 2e9b01f21..f5e748410 100644 --- a/templates/repo/modelarts/trainjob/version_new.tmpl +++ b/templates/repo/modelarts/trainjob/version_new.tmpl @@ -103,6 +103,9 @@ -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } + .left2{ + margin-left: -2px; + } @-webkit-keyframes sk-stretchdelay { 0%, @@ -159,7 +162,7 @@ - +
@@ -171,12 +174,14 @@
- {{if .branch_name}} {{end}} {{range $k, $v :=.branches}} + {{if ne $.branch_name $v}} + {{end}} {{end}} @@ -197,10 +202,12 @@
@@ -227,7 +234,9 @@ {{end}} {{range .attachments}} + {{if ne $.uuid .UUID}} + {{end}} {{end}}
@@ -272,7 +281,9 @@ {{end}} {{range .flavor_infos}} + {{if ne $.flavor_code .Code}} + {{end}} {{end}}
From 0c6a091c77a2e978c011d978b62dedd642f60d6d Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 12 Nov 2021 11:36:13 +0800 Subject: [PATCH 078/272] fix issue --- templates/repo/header.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 6dc4d8ee5..d5b911a79 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -93,7 +93,7 @@