Browse Source

Merge remote-tracking branch 'origin/V20221228' into fix-3339

fix-3339
liuzx 2 years ago
parent
commit
66c4868e60
100 changed files with 1588 additions and 558 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -0
      custom/public/css/placeholder-home.css
  3. +1
    -0
      custom/public/css/placeholder.css
  4. BIN
      custom/public/img/home-banner-02-1.jpg
  5. BIN
      custom/public/img/home-banner-02-2.png
  6. +45
    -0
      custom/public/img/logo-w-origin.svg
  7. +1
    -45
      custom/public/img/logo-w.svg
  8. +1
    -0
      custom/public/js/placeholder-home.js
  9. +1
    -0
      custom/public/js/placeholder.js
  10. +3
    -1
      models/action.go
  11. +22
    -4
      models/cloudbrain.go
  12. +1
    -0
      models/task_config.go
  13. +24
    -0
      models/user_analysis_for_activity.go
  14. +92
    -9
      models/user_business_analysis.go
  15. +3
    -3
      models/user_business_struct.go
  16. +6
    -1
      modules/context/auth.go
  17. +65
    -10
      modules/grampus/grampus.go
  18. +16
    -0
      modules/storage/minio_ext.go
  19. +33
    -4
      modules/storage/obs.go
  20. +3
    -1
      modules/templates/helper.go
  21. +18
    -3
      options/locale/locale_en-US.ini
  22. +18
    -3
      options/locale/locale_zh-CN.ini
  23. +8
    -5
      public/home/home.js
  24. BIN
      public/img/login_bg_default.png
  25. +45
    -0
      routers/api/v1/repo/attachments.go
  26. +2
    -1
      routers/api/v1/repo/cloudbrain_dashboard.go
  27. +4
    -0
      routers/home.go
  28. +1
    -1
      routers/repo/ai_model_manage.go
  29. +38
    -6
      routers/repo/grampus.go
  30. +13
    -9
      routers/repo/modelarts.go
  31. +1
    -0
      routers/routes/routes.go
  32. +14
    -7
      routers/user/auth.go
  33. +30
    -0
      services/cloudbrain/cloudbrainTask/ai_model.go
  34. +5
    -0
      services/cloudbrain/cloudbrainTask/count.go
  35. +35
    -7
      services/cloudbrain/cloudbrainTask/notebook.go
  36. +1
    -1
      services/socketwrap/clientManager.go
  37. +8
    -8
      templates/admin/cloudbrain/list.tmpl
  38. +2
    -0
      templates/admin/cloudbrain/search.tmpl
  39. +1
    -0
      templates/admin/cloudbrain/search_dashboard.tmpl
  40. +35
    -0
      templates/annual_privacy.tmpl
  41. +9
    -9
      templates/base/footer.tmpl
  42. +10
    -0
      templates/base/footer_content.tmpl
  43. +7
    -7
      templates/base/footer_fluid.tmpl
  44. +10
    -10
      templates/base/head.tmpl
  45. +10
    -10
      templates/base/head_course.tmpl
  46. +10
    -10
      templates/base/head_fluid.tmpl
  47. +14
    -14
      templates/base/head_home.tmpl
  48. +10
    -10
      templates/base/head_pro.tmpl
  49. +2
    -0
      templates/custom/header.tmpl
  50. +39
    -1
      templates/custom/home/home_top.tmpl
  51. +1
    -0
      templates/explore/images.tmpl
  52. +4
    -4
      templates/explore/organizations.tmpl
  53. +2
    -2
      templates/explore/repo_orgtop.tmpl
  54. +1
    -1
      templates/explore/search_new.tmpl
  55. +3
    -1
      templates/home.tmpl
  56. +2
    -2
      templates/repo/cloudbrain/benchmark/new.tmpl
  57. +1
    -1
      templates/repo/cloudbrain/new.tmpl
  58. +3
    -0
      templates/repo/cloudbrain/show.tmpl
  59. +3
    -3
      templates/repo/cloudbrain/trainjob/show.tmpl
  60. +1
    -1
      templates/repo/datasets/dirs/dir_list.tmpl
  61. +1
    -1
      templates/repo/datasets/dirs/dir_preview.tmpl
  62. +1
    -1
      templates/repo/datasets/label/index.tmpl
  63. +1
    -0
      templates/repo/debugjob/index.tmpl
  64. +161
    -0
      templates/repo/grampus/notebook/gcu/new.tmpl
  65. +10
    -2
      templates/repo/grampus/notebook/gpu/new.tmpl
  66. +8
    -2
      templates/repo/grampus/notebook/npu/new.tmpl
  67. +3
    -3
      templates/repo/grampus/trainjob/show.tmpl
  68. +11
    -11
      templates/repo/header.tmpl
  69. +5
    -5
      templates/repo/home.tmpl
  70. +1
    -1
      templates/repo/issue/view_content/pull.tmpl
  71. +1
    -1
      templates/repo/modelarts/notebook/new.tmpl
  72. +2
    -1
      templates/repo/modelarts/trainjob/para_manage.tmpl
  73. +3
    -3
      templates/repo/modelarts/trainjob/show.tmpl
  74. +9
    -4
      templates/repo/modelmanage/convertshowinfo.tmpl
  75. +3
    -3
      templates/repo/modelmanage/create_online.tmpl
  76. +3
    -3
      templates/repo/modelmanage/index.tmpl
  77. +46
    -4
      templates/user/auth/signin.tmpl
  78. +43
    -4
      templates/user/auth/signin_cloud_brain.tmpl
  79. +1
    -1
      templates/user/auth/signin_navbar.tmpl
  80. +97
    -59
      templates/user/auth/signin_phone.tmpl
  81. +45
    -0
      templates/user/auth/signin_up_img_default.tmpl
  82. +141
    -102
      templates/user/auth/signup_inner.tmpl
  83. +5
    -5
      templates/user/dashboard/cloudbrains.tmpl
  84. +9
    -1
      templates/user/dashboard/feeds.tmpl
  85. +3
    -2
      web_src/js/components/Contributors.vue
  86. +8
    -7
      web_src/js/components/EditAboutInfo.vue
  87. +6
    -6
      web_src/js/components/EditTopics.vue
  88. +2
    -2
      web_src/js/components/Model.vue
  89. +3
    -2
      web_src/js/components/basic/editDialog.vue
  90. +61
    -60
      web_src/js/components/images/Images.vue
  91. +28
    -27
      web_src/js/components/images/adminImages.vue
  92. +10
    -10
      web_src/js/features/cloudbrainShow.js
  93. +1
    -1
      web_src/js/features/cloudrbanin.js
  94. +106
    -0
      web_src/js/features/i18nVue.js
  95. +1
    -1
      web_src/js/index.js
  96. +2
    -1
      web_src/js/standalone/cloudbrainNew.js
  97. +2
    -2
      web_src/js/standalone/specsuse.js
  98. +1
    -1
      web_src/less/openi.less
  99. +2
    -2
      web_src/vuepages/const/index.js
  100. +2
    -2
      web_src/vuepages/langs/config/en-US.js

+ 1
- 0
.gitignore View File

@@ -56,6 +56,7 @@ coverage.all
/custom/conf/app.ini
!/custom/conf/app.ini.sample
/custom/public/kanban
/custom/public/annual-report
/data
/indexers
/log


+ 1
- 0
custom/public/css/placeholder-home.css View File

@@ -0,0 +1 @@
/* placeholder-home.css */

+ 1
- 0
custom/public/css/placeholder.css View File

@@ -0,0 +1 @@
/* placeholder.css */

BIN
custom/public/img/home-banner-02-1.jpg View File

Before After
Width: 1920  |  Height: 548  |  Size: 156 kB

BIN
custom/public/img/home-banner-02-2.png View File

Before After
Width: 790  |  Height: 315  |  Size: 253 kB

+ 45
- 0
custom/public/img/logo-w-origin.svg View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 160 64" style="enable-background:new 0 0 160 64;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
.st1{display:none;fill:#FFFFFF;}
</style>
<g>
<path class="st0" d="M105.3,33.3H87.1c-2.6,0.1-4,1.3-4,3.8v8.3c0.1,2.2,1.5,3.3,4,3.5h18c2.5-0.1,3.8-1.3,3.9-3.6v-8.2
c0.1-2-1.4-3.6-3.4-3.8C105.6,33.3,105.4,33.3,105.3,33.3z M104.6,43.9c-0.1,1-0.7,1.5-1.9,1.7H89.3c-1.3-0.3-1.8-0.7-1.9-1.7v-5.4
c0-1,0.8-1.9,1.8-1.9c0,0,0.1,0,0.1,0h13.1c1.1,0,2,0.8,2.1,2L104.6,43.9z"/>
<path class="st0" d="M81,25.3v-4.7c0-1.1,0.9-2.1,2.1-2.1h19c1.4-0.1,2.1,0.5,2.1,1.8v3.3c0,1.1-0.7,1.7-1.9,1.7H82.8v3.2H105
c2.3,0,3.6-1.1,3.6-3.2v-6.4c0.2-1.8-1.1-3.4-2.8-3.6c-0.3,0-0.5,0-0.8,0h-9.7v-2.6h-4.6v2.6H80.3c-2.6,0-3.9,1.2-3.9,3.9v12.3
c0,5.8-0.9,11.6-2.6,17.1l4.3,0.8c1.8-5.5,2.7-11.3,2.8-17.1v-7.2H81z"/>
<path class="st0" d="M116.2,30.4l4.4,2.4c2.6-1.9,4.4-4.6,5.1-7.6h7.8v-3.2h-7.1c0.2-1.3,0.3-2.6,0.3-3.9h6.6v-3.2h-12.3v-2h-4.6
V18h5.8c0,1.3-0.1,2.6-0.3,3.9h-6.7v3.3h5.8C120.4,27.5,118.6,29.4,116.2,30.4z"/>
<path class="st0" d="M126.5,26.7c1.2,1.8,2.1,3.8,2.9,5.8h4.9c-0.8-2-1.8-4-2.9-5.8H126.5z"/>
<path class="st0" d="M145.4,33.5h-24.7c-2.4,0.3-3.8,1.4-3.9,3.5v6.2h28.4v1.3c0,1.1-0.7,1.7-2.1,1.7h-19.7c-1.3,0-1.9-0.5-1.9-1.5
h-4.5V46c0,1.9,1.6,3.5,3.5,3.6h25.1c2.6-0.1,4-1.3,4-3.5v-9C149.2,35,147.5,33.5,145.4,33.5z M145,39.9h-23.7v-1.1
c0-1,0.8-1.9,1.8-1.9c0,0,0.1,0,0.1,0H143c1.3,0,2.1,0.7,2.1,1.9L145,39.9z"/>
<path class="st0" d="M147.3,14h-8.2c-2.2,0.1-3.5,1.1-3.8,2.9v11.7c0.1,1.6,1.4,2.9,3.1,2.9h8.7c1.9-0.1,3.1-1.1,3.1-2.9V17
C150.4,15.4,149.4,14.3,147.3,14z M146,26.2c0,1.4-0.7,2.1-1.9,2.1h-2.4c-1,0-1.8-0.8-1.8-1.8c0-0.1,0-0.1,0-0.2v-7
c0-1,0.8-1.9,1.8-1.9c0,0,0.1,0,0.1,0h2c1.1,0,2.1,0.8,2.1,1.9l0,0L146,26.2z"/>
</g>
<path class="st1" d="M67.2,44.1V20c0-2.6-1.4-5.1-3.7-6.4l-20.9-12c-2.3-1.3-5.1-1.3-7.4,0l-20.9,12c-2.3,1.3-3.7,3.8-3.7,6.4v24.1
c0,2.6,1.4,5.1,3.7,6.4l20.9,12c2.3,1.3,5.1,1.3,7.4,0l20.9-12C65.8,49.2,67.2,46.7,67.2,44.1z"/>
<path class="st0" d="M61.9,15.4L42,3.9c-1.9-1.1-4.3-1.1-6.2,0L15.9,15.4c-1.9,1.1-3.1,3.2-3.1,5.4v22.9c0,2.2,1.2,4.3,3.1,5.4
l3.8,2c0.8,0.4,0.8,1,0.8,1.9c0,0,0,0.1,0,0.1c0.1,1.6,1.8,3.5,4.2,3.5c2.3,0,4.3-1.9,4.4-4.2c0-1.6-0.8-3.1-2.3-3.9
c-0.6-0.3-1.7-0.5-2.9-0.4c-0.9,0.1-1,0.6-2.8-0.5l-2.8-1.6c-0.8-0.5-1.7-1.3-1.6-2.3V22c0-1.8,0.8-2.8,2.1-3.5L37,7.8
C38.1,7,40.2,7.2,41.5,8l16.4,9.5c2.9,1.6,3,3,3,4v19.7c0,2.3-1.5,4-2.3,4.5l-15.1,8.5C42.8,54.5,42,54,42,53.3l0-2.5
c0-0.1,0-0.3,0-0.4v-2.5c0-0.8,0.4-1.6,1.1-2l8.8-5.7c1.4-0.9,2-1.7,2-3.8L53.7,28c0-1,0.4-1.9,1.2-2.5c1.5-1.3,2-3.7,0.8-5.6
c-0.8-1.4-2.4-2.2-4-2c-1.6,0.1-2.8,1-3.5,2.4c-0.5,1-0.6,2.2-0.3,3.3c0.2,0.8,0.7,1.4,1.3,2c0.7,0.6,1.2,1.5,1.2,2.5v7.2
c0,1.1-0.5,2.1-1.5,2.7l-5.5,2.8c-0.7,0.5-1.6,0-1.6-0.8l-0.2-17.1c0-1,0.5-1.9,1.2-2.5c0.4-0.3,0.7-0.8,1-1.3
c0.7-1.3,0.7-2.9-0.1-4.3c-0.8-1.4-2.5-2.2-4.1-2.1c-2.9,0.3-4.6,3.1-3.8,5.7c0.2,0.8,0.7,1.4,1.3,2c0.7,0.6,1.2,1.5,1.2,2.5v9.9
c0,0.8-0.8,1.3-1.5,0.9L34,32.5c-0.7-0.4-1.2-1.2-1.2-2.1v-2.2c0-1,0.4-1.9,1.2-2.5c1.5-1.3,2-3.7,0.8-5.6c-0.8-1.3-2.4-2.1-4-2
c-2.9,0.2-4.7,3.1-3.8,5.7c0.2,0.8,0.7,1.5,1.3,2c0.7,0.6,1.2,1.5,1.2,2.5l0,3.5c0,1,0,2,1.6,3.1l5.5,3c0.7,0.4,1.2,1.2,1.2,2.1v4.5
c0,0.8-0.8,1.3-1.5,0.9L26.6,41c-0.7-0.4-1.2-1.2-1.2-2.1l-0.2-6.1c0-1,0.4-1.8,1.1-2.5c1.4-1.3,1.9-3.4,0.9-5.3
c-0.8-1.4-2.4-2.3-4-2.2c-2.9,0.2-4.6,3-3.8,5.6c0.2,0.7,0.7,1.4,1.2,1.9c0.7,0.6,1.1,1.5,1.1,2.5l-0.5,6.8c0,1.9,0.3,2.8,1.8,3.5
l11.8,6.3c1,0.6,1.6,1.7,1.6,2.8l0,3.1c0,3.1,4.3,5.7,8.7,3.3l16.4-9.8c1.9-1,3.2-3,3.4-5.2V20.7C65,18.5,63.8,16.5,61.9,15.4z
M24.2,50.7c1.1,0,2,0.9,2,2c0,1.1-0.9,2-2,2c-1.1,0-2-0.9-2-2C22.2,51.7,23.1,50.7,24.2,50.7z M48.7,21.5c0-1.1,0.9-2,2-2
s2,0.9,2,2c0,1.1-0.9,2-2,2S48.7,22.6,48.7,21.5z M30.6,23.8c-1.1,0-2-0.9-2-2s0.9-2,2-2c1.1,0,2,0.9,2,2S31.8,23.8,30.6,23.8z
M22.2,26.4c0-1.1,0.9-2,2-2c1.1,0,2,0.9,2,2s-0.9,2-2,2C23.1,28.4,22.2,27.5,22.2,26.4z M40,17.9c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2
c1.1,0,2,0.9,2,2C42,17,41.1,17.9,40,17.9z"/>
</svg>

+ 1
- 45
custom/public/img/logo-w.svg
File diff suppressed because it is too large
View File


+ 1
- 0
custom/public/js/placeholder-home.js View File

@@ -0,0 +1 @@
/* placeholder-home.js */

+ 1
- 0
custom/public/js/placeholder.js View File

@@ -0,0 +1 @@
/* placeholder.js */

+ 3
- 1
models/action.go View File

@@ -67,6 +67,7 @@ const (
ActionChangeUserAvatar //38
ActionCreateGrampusNPUDebugTask //39
ActionCreateGrampusGPUDebugTask //40
ActionCreateGrampusGCUDebugTask //41
)

// Action represents user operation type and other information to
@@ -380,7 +381,8 @@ func (a *Action) IsCloudbrainAction() bool {
ActionCreateGrampusGPUDebugTask,
ActionCreateGrampusNPUDebugTask,
ActionCreateGrampusNPUTrainTask,
ActionCreateGrampusGPUTrainTask:
ActionCreateGrampusGPUTrainTask,
ActionCreateGrampusGCUDebugTask:
return true
}
return false


+ 22
- 4
models/cloudbrain.go View File

@@ -30,11 +30,13 @@ const (
TypeCDCenter //成都智算中心

TypeCloudBrainAll = -1
AccCardsNumAll = -1
)

const (
NPUResource = "NPU"
GPUResource = "CPU/GPU"
GCUResource = "GCU"
AllResource = "all"

//notebook storage category
@@ -135,6 +137,11 @@ const (
//ComputeResource
GPU = "GPU"
NPU = "NPU"
GCU = "GCU"
)

const (
AIModelPath = "aimodels/"
)

type Cloudbrain struct {
@@ -180,14 +187,14 @@ type Cloudbrain struct {
AiCenter string //grampus ai center: center_id+center_name

TrainUrl string //输出模型的obs路径
BranchName string //分支名称
BranchName string `xorm:"varchar(2550)"` //分支名称
Parameters string //传给modelarts的param参数
BootFile string //启动文件
BootFile string `xorm:"varchar(2550)"` //启动文件
DataUrl string `xorm:"varchar(3500)"` //数据集的obs路径
LogUrl string //日志输出的obs路径
PreVersionId int64 //父版本的版本id
FlavorCode string //modelarts上的规格id
Description string `xorm:"varchar(256)"` //描述
Description string `xorm:"varchar(2550)"` //描述
WorkServerNumber int //节点数
FlavorName string //规格名称
EngineName string //引擎名称
@@ -303,6 +310,9 @@ func (task *Cloudbrain) IsUserHasRight(user *User) bool {
func (task *Cloudbrain) IsGPUTask() bool {
return task.ComputeResource == GPUResource
}
func (task *Cloudbrain) IsGCUTask() bool {
return task.ComputeResource == GCUResource
}
func (task *Cloudbrain) IsNPUTask() bool {
return task.ComputeResource == NPUResource
}
@@ -2653,6 +2663,7 @@ type DatasetInfo struct {
DataLocalPath string
Name string
FullName string
Type int
Size int
}

@@ -2693,8 +2704,14 @@ func GetDatasetInfo(uuidStr string, grampusType ...string) (map[string]DatasetIn
if len(grampusType) > 0 {
if grampusType[0] == GPU {
dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID
} else {
} else if grampusType[0] == NPU {
dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/"
} else if grampusType[0] == GCU {
if attach.Type == TypeCloudBrainOne {
dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID
} else {
dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/"
}
}

} else {
@@ -2709,6 +2726,7 @@ func GetDatasetInfo(uuidStr string, grampusType ...string) (map[string]DatasetIn
DataLocalPath: dataLocalPath,
Name: fileName,
FullName: attach.Name,
Type: attach.Type,
Size: int(attach.Size),
}
if i == 0 {


+ 1
- 0
models/task_config.go View File

@@ -39,6 +39,7 @@ func GetTaskTypeFromAction(a ActionType) TaskType {
ActionCreateGrampusGPUDebugTask,
ActionCreateGrampusNPUDebugTask,
ActionCreateGrampusNPUTrainTask,
ActionCreateGrampusGCUDebugTask,
ActionCreateGrampusGPUTrainTask:
return TaskCreateCloudbrainTask
case ActionCreateRepo:


+ 24
- 0
models/user_analysis_for_activity.go View File

@@ -1,6 +1,7 @@
package models

import (
"encoding/json"
"fmt"
"time"

@@ -450,19 +451,42 @@ func QueryUserLoginInfo(userIds []int64) []*UserLoginLog {
return loginList
}

var WeekBonusData = make(map[int64][]int)

func QueryUserAnnualReport(userId int64) *UserSummaryCurrentYear {
statictisSess := xStatistic.NewSession()
defer statictisSess.Close()
log.Info("userId=" + fmt.Sprint(userId))
if len(WeekBonusData) == 0 {
WeekBonusData = getBonusWeekDataMap()
}

reList := make([]*UserSummaryCurrentYear, 0)
err := statictisSess.Select("*").Table(new(UserSummaryCurrentYear)).Where("id=" + fmt.Sprint(userId)).Find(&reList)
if err == nil {
if len(reList) > 0 {
record, ok := WeekBonusData[userId]
if ok {
bonusInfo := make(map[string]int)
bonusInfo["order"] = record[0]
bonusInfo["money"] = record[1]
bonusInfo["week"] = record[2]
bonusInfo["num"] = record[3]
bonusInfoJson, _ := json.Marshal(bonusInfo)
reList[0].WeekBonusData = string(bonusInfoJson)
}
return reList[0]
}
} else {
log.Info("error:=" + err.Error())
}
dbuser, err := GetUserByID(userId)
if err == nil {
return &UserSummaryCurrentYear{
ID: dbuser.ID,
Name: dbuser.Name,
RegistDate: dbuser.CreatedUnix,
}
}
return nil
}

+ 92
- 9
models/user_business_analysis.go View File

@@ -880,6 +880,76 @@ func isUserYearData(tableName string) bool {
return false
}

func getBonusWeekDataMap() map[int64][]int {
bonusMap := make(map[int64][]int)
url := setting.RecommentRepoAddr + "bonus/weekdata/record.txt"
content, err := GetContentFromPromote(url)
if err == nil {
filenames := strings.Split(content, "\n")
for i := 0; i < len(filenames); i++ {
if strings.HasSuffix(filenames[i], "\r") {
filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")]
}
url = setting.RecommentRepoAddr + "bonus/weekdata/" + filenames[i]
csvContent, err1 := GetContentFromPromote(url)
if err1 == nil {
//read csv
lines := strings.Split(csvContent, "\n")
for j := 1; j < len(lines); j++ {
if strings.HasSuffix(lines[j], "\r") {
lines[j] = lines[j][0 : len(lines[j])-len("\r")]
}
log.Info("aLine=" + lines[j])
aLine := strings.Split(lines[j], ",")
if len(aLine) < 4 {
continue
}
userId := getInt64Value(aLine[0])
order := getIntValue(aLine[2])
money := getIntValue(aLine[3])
week, num := getWeekAndNum(filenames[i])
//log.Info("userId=" + fmt.Sprint(userId) + " order=" + fmt.Sprint(order) + " money=" + fmt.Sprint(money) + " week=" + fmt.Sprint(week) + " num=" + fmt.Sprint(num))
//email := lines[2]
record, ok := bonusMap[userId]
if !ok {
record = make([]int, 4)
record[0] = order
record[1] = money
record[2] = week
record[3] = num
bonusMap[userId] = record
} else {
if record[0] > order {
record[0] = order
record[1] = money
record[2] = week
record[3] = num
} else {
if record[0] == order && record[1] < money {
record[1] = money
record[2] = week
record[3] = num
}
}
}
}
}
}
}
return bonusMap
}

func getWeekAndNum(name string) (int, int) {
name = name[0 : len(name)-4]
tmp := strings.Split(name, "_")
if len(tmp) == 2 {
week := getIntValue(tmp[0])
num := getIntValue(tmp[1])
return week, num
}
return 0, 0
}

func getBonusMap() map[string]map[string]int {
bonusMap := make(map[string]map[string]int)
url := setting.RecommentRepoAddr + "bonus/record.txt"
@@ -887,12 +957,18 @@ func getBonusMap() map[string]map[string]int {
if err == nil {
filenames := strings.Split(content, "\n")
for i := 0; i < len(filenames); i++ {
if strings.HasSuffix(filenames[i], "\r") {
filenames[i] = filenames[i][0 : len(filenames[i])-len("\r")]
}
url = setting.RecommentRepoAddr + "bonus/" + filenames[i]
csvContent, err1 := GetContentFromPromote(url)
if err1 == nil {
//read csv
lines := strings.Split(csvContent, "\n")
for j := 1; j < len(lines); j++ {
if strings.HasSuffix(lines[j], "\r") {
lines[j] = lines[j][0 : len(lines[j])-len("\r")]
}
aLine := strings.Split(lines[j], ",")
if len(aLine) < 7 {
continue
@@ -923,6 +999,14 @@ func getIntValue(val string) int {
return 0
}

func getInt64Value(val string) int64 {
i, err := strconv.ParseInt(val, 10, 64)
if err == nil {
return i
}
return 0
}

func getPlayARoll(bonusMap map[string]map[string]int, userName string, scoreMap map[string]float64) string {
bonusInfo := make(map[string]string)
record, ok := bonusMap[userName]
@@ -959,19 +1043,16 @@ func getCloudBrainInfo(dateRecordAll UserBusinessAnalysisAll, CloudBrainTaskItem
trainscore = float64(dateRecordAll.GpuTrainJob+dateRecordAll.NpuTrainJob) / float64(50)
}
cloudBrainInfo["inference_task_num"] = fmt.Sprint(dateRecordAll.NpuInferenceJob + CloudBrainTaskItemMap[fmt.Sprint(dateRecordAll.ID)+"_GpuInferenceJob"])
cloudBrainInfo["benchmark_task_num"] = fmt.Sprint(dateRecordAll.GpuBenchMarkJob)
cloudBrainInfo["card_runtime"] = fmt.Sprint(dateRecordAll.CloudBrainRunTime)
if dateRecordAll.CloudBrainRunTime >= 100 {
runtime = float64(dateRecordAll.CloudBrainRunTime) / float64(100)
}
cloudBrainInfo["card_runtime_money"] = fmt.Sprint(dateRecordAll.CloudBrainRunTime * 5)
cloudBrainInfo["CloudBrainOne"] = fmt.Sprint(CloudBrainTaskItemMap[fmt.Sprint(dateRecordAll.ID)+"_CloudBrainOne"])
cloudBrainInfo["CloudBrainTwo"] = fmt.Sprint(CloudBrainTaskItemMap[fmt.Sprint(dateRecordAll.ID)+"_CloudBrainTwo"])
cloudBrainInfo["C2Net"] = fmt.Sprint(CloudBrainTaskItemMap[fmt.Sprint(dateRecordAll.ID)+"_C2Net"])

cloudBrainInfoJson, _ := json.Marshal(cloudBrainInfo)
scoreMap["trainscore"] = trainscore
scoreMap["debugscore"] = debugscore
scoreMap["runtime"] = runtime
return string(cloudBrainInfoJson)
} else {
scoreMap["trainscore"] = trainscore
@@ -1311,7 +1392,7 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time,
useMetrics.TotalActivateRegistUser = getMapKeyStringValue("TotalActivateRegistUser", userMetrics)
useMetrics.TotalHasActivityUser = getMapKeyStringValue("TotalHasActivityUser", userMetrics)
useMetrics.CurrentDayRegistUser = getMapKeyStringValue("CurrentDayRegistUser", userMetrics)
count, err = sess.Where("type=0").Count(new(User))
count, err = sess.Where("type=0 and created_unix<=" + fmt.Sprint(end_unix)).Count(new(User))
if err != nil {
log.Info("query user error. return.")
}
@@ -2416,7 +2497,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s
var indexTotal int64
indexTotal = 0
for {
sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Unscoped().Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal))
sess.Select("id,job_type,user_id,duration,train_job_duration,type,compute_resource").Table("cloudbrain").Unscoped().Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal))
cloudTaskList := make([]*Cloudbrain, 0)
sess.Find(&cloudTaskList)
log.Info("query cloudbrain size=" + fmt.Sprint(len(cloudTaskList)))
@@ -2435,6 +2516,8 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s
setMapKey("NpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap)
} else if cloudTaskRecord.JobType == "INFERENCE" {
setMapKey("NpuInferenceJob", cloudTaskRecord.UserID, 1, resultItemMap)
} else if cloudTaskRecord.JobType == "BENCHMARK" || cloudTaskRecord.JobType == "MODELSAFETY" {
setMapKey("GpuBenchMarkJob", cloudTaskRecord.UserID, 1, resultItemMap)
} else {
setMapKey("NpuDebugJob", cloudTaskRecord.UserID, 1, resultItemMap)
}
@@ -2444,12 +2527,12 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s
setMapKey("GpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap)
} else if cloudTaskRecord.JobType == "INFERENCE" {
setMapKey("GpuInferenceJob", cloudTaskRecord.UserID, 1, resultItemMap)
} else if cloudTaskRecord.JobType == "BENCHMARK" {
} else if cloudTaskRecord.JobType == "BENCHMARK" || cloudTaskRecord.JobType == "MODELSAFETY" {
setMapKey("GpuBenchMarkJob", cloudTaskRecord.UserID, 1, resultItemMap)
} else {
setMapKey("GpuDebugJob", cloudTaskRecord.UserID, 1, resultItemMap)
}
} else if cloudTaskRecord.Type == 2 {
} else if cloudTaskRecord.Type == 2 || cloudTaskRecord.Type == 3 {
setMapKey("C2Net", cloudTaskRecord.UserID, 1, resultItemMap)
if cloudTaskRecord.ComputeResource == NPUResource {
if cloudTaskRecord.JobType == "TRAIN" {


+ 3
- 3
models/user_business_struct.go View File

@@ -18,9 +18,9 @@ type UserSummaryCurrentYear struct {
CodeInfo string `xorm:"varchar(500)"` //代码提交次数,提交总代码行数,最晚的提交时间
CloudBrainInfo string `xorm:"varchar(1000)"` //,创建了XX 个云脑任务,调试任务XX 个,训练任务XX 个,推理任务XX 个,累计运行了XXXX 卡时,累计节省xxxxx 元
//这些免费的算力资源分别有,XX% 来自鹏城云脑1,XX% 来自鹏城云脑2,XX% 来自智算网络
PlayARoll string `xorm:"varchar(500)"` //你参加了XX 次“我为开源打榜狂”活动,累计上榜XX 次,总共获得了社区XXX 元的激励
Label string `xorm:"varchar(500)"`
PlayARoll string `xorm:"varchar(500)"` //你参加了XX 次“我为开源打榜狂”活动,累计上榜XX 次,总共获得了社区XXX 元的激励
WeekBonusData string `xorm:"-"`
Label string `xorm:"varchar(500)"`
}

type UserBusinessAnalysisCurrentYear struct {


+ 6
- 1
modules/context/auth.go View File

@@ -81,7 +81,12 @@ func Toggle(options *ToggleOptions) macaron.Handler {

// Redirect to dashboard if user tries to visit any non-login page.
if options.SignOutRequired && ctx.IsSigned && ctx.Req.URL.RequestURI() != "/" {
ctx.Redirect(setting.AppSubURL + "/")
redirectTo := ctx.Query("redirect_to")
if len(redirectTo) > 0 {
ctx.Redirect(redirectTo)
} else {
ctx.Redirect(setting.AppSubURL + "/")
}
return
}



+ 65
- 10
modules/grampus/grampus.go View File

@@ -19,6 +19,7 @@ const (

ProcessorTypeNPU = "npu.huawei.com/NPU"
ProcessorTypeGPU = "nvidia.com/gpu"
ProcessorTypeGCU = "enflame-tech.com/gcu"

GpuWorkDir = "/tmp/"
NpuWorkDir = "/cache/"
@@ -108,6 +109,7 @@ type GenerateNotebookJobReq struct {
Spec *models.Specification
CodeName string
ModelPath string //参考启智GPU调试, 挂载/model目录用户的模型可以输出到这个目录
ModelStorageType int
}

func getEndPoint() string {
@@ -148,6 +150,36 @@ func getDatasetGPUGrampus(datasetInfos map[string]models.DatasetInfo) ([]models.
}
return datasetGrampus, command
}
func getDatasetGCUGrampus(datasetInfos map[string]models.DatasetInfo) ([]models.GrampusDataset, string) {
var datasetGrampus []models.GrampusDataset
var command = ""
obsEndPoint := getEndPoint()
for uuid, datasetInfo := range datasetInfos {
if datasetInfo.Type == models.TypeCloudBrainOne {
datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: datasetInfo.FullName,
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ObjectKey: datasetInfo.DataLocalPath,
ReadOnly: true,
ContainerPath: "/dataset1/" + datasetInfo.Name,
})

command += "cp /dataset1/'" + datasetInfo.Name + "'/" + uuid + " /dataset/'" + datasetInfo.FullName + "';"

} else {
datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: datasetInfo.FullName,
Bucket: setting.Bucket,
EndPoint: obsEndPoint,
ObjectKey: datasetInfo.DataLocalPath + datasetInfo.FullName,
ContainerPath: "/dataset/" + datasetInfo.Name,
})
}

}
return datasetGrampus, command
}

func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (jobId string, err error) {
createTime := timeutil.TimeStampNow()
@@ -178,25 +210,45 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job
imageUrl = ""
req.Command = ""
} else {
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos)
if ProcessorTypeGCU == req.ProcessType {
datasetGrampus, cpCommand = getDatasetGCUGrampus(req.DatasetInfos)
} else {
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos)
}
if len(req.ModelName) != 0 {
datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: req.ModelName,
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ObjectKey: req.PreTrainModelPath,
ReadOnly: true,
ContainerPath: cloudbrain.PretrainModelMountPath,
})
if req.ModelStorageType == models.TypeCloudBrainOne {
datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: req.ModelName,
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ObjectKey: req.PreTrainModelPath,
ReadOnly: true,
ContainerPath: cloudbrain.PretrainModelMountPath,
})
} else {
datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: req.ModelName,
Bucket: setting.Bucket,
EndPoint: getEndPoint(),
ReadOnly: true,
ObjectKey: req.PreTrainModelPath,
ContainerPath: cloudbrain.PretrainModelMountPath,
})
}

}
codeArchiveName := cloudbrain.DefaultBranchName + ".zip"
codeGrampus = models.GrampusDataset{
Name: req.CodeName,
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ObjectKey: req.CodeStoragePath + cloudbrain.DefaultBranchName + ".zip",
ObjectKey: req.CodeStoragePath + codeArchiveName,
ReadOnly: false,
ContainerPath: cloudbrain.CodeMountPath,
}
if ProcessorTypeGCU == req.ProcessType {
imageUrl = ""
}
req.Command = fmt.Sprintf(CommandGpuDebug, cpCommand, setting.CullIdleTimeout, setting.CullIdleTimeout, setting.CullInterval, setting.CullIdleTimeout, setting.CullInterval)
log.Info("debug command:" + req.Command)

@@ -215,6 +267,7 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job
AutoStopDuration: autoStopDurationMs,
Capacity: setting.Capacity,
Command: req.Command,
CenterID: req.Spec.GetAvailableCenterIds(ctx.User.ID),
},
},
})
@@ -263,6 +316,8 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job
actionType = models.ActionCreateGrampusNPUDebugTask
} else if req.ComputeResource == models.GPUResource {
actionType = models.ActionCreateGrampusGPUDebugTask
} else if req.ComputeResource == models.GCUResource {
actionType = models.ActionCreateGrampusGCUDebugTask
}
task, err := models.GetCloudbrainByJobID(jobID)
if err != nil {


+ 16
- 0
modules/storage/minio_ext.go View File

@@ -391,3 +391,19 @@ func GetPartInfos(objectName string, uploadID string) (string, error) {

return chunks, nil
}

func IsObjectExist4Minio(bucket, objectName string) (bool, error) {
_, core, err := getClients()
if err != nil {
log.Error("getClients failed:", err.Error())
return false, err
}

_, err = core.StatObject(bucket, objectName, miniov6.StatObjectOptions{})
if err != nil {
log.Error("GetObjectMetadata error.%v", err)
return false, err
}

return true, nil
}

+ 33
- 4
modules/storage/obs.go View File

@@ -614,7 +614,7 @@ func ObsCreateObject(path string) error {
return nil
}

func GetObsLogFileName(prefix string) (string, error) {
func GetObsLogFileName(prefix string) ([]FileInfo, error) {
input := &obs.ListObjectsInput{}
input.Bucket = setting.Bucket
input.Prefix = prefix
@@ -622,10 +622,39 @@ func GetObsLogFileName(prefix string) (string, error) {
output, err := ObsCli.ListObjects(input)
if err != nil {
log.Error("PutObject failed:", err.Error())
return "", err
return nil, err
}
if output == nil || len(output.Contents) == 0 {
return "", errors.New("obs log files not exist")
return nil, errors.New("obs log files not exist")
}
fileInfos := make([]FileInfo, 0)
for _, val := range output.Contents {
//result[num] = c.Key
if strings.HasSuffix(val.Key, ".log") {
log.Info("log fileName=" + val.Key)
fileInfo := FileInfo{
ModTime: val.LastModified.Local().Format("2006-01-02 15:04:05"),
FileName: val.Key[len(prefix)-3:], //加上 job
Size: val.Size,
IsDir: false,
ParenDir: prefix[0 : len(prefix)-3],
}
fileInfos = append(fileInfos, fileInfo)
}

}
return fileInfos, nil
}

func IsObjectExist4Obs(bucket, key string) (bool, error) {

_, err := ObsCli.GetObjectMetadata(&obs.GetObjectMetadataInput{
Bucket: bucket,
Key: key,
})
if err != nil {
log.Error("GetObjectMetadata error.%v", err)
return false, err
}
return output.Contents[0].Key, nil
return true, nil
}

+ 3
- 1
modules/templates/helper.go View File

@@ -106,7 +106,8 @@ func NewFuncMap() []template.FuncMap {
"SafeJS": SafeJS,
"Str2html": Str2html,
"subOne": subOne,
"addOne": addOne,
"addOne": addOne,
"TimeStampNow": timeutil.TimeStampNow,
"TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,
@@ -367,6 +368,7 @@ func NewTextFuncMap() []texttmpl.FuncMap {
"AppDomain": func() string {
return setting.Domain
},
"TimeStampNow": timeutil.TimeStampNow,
"TimeSince": timeutil.TimeSince,
"TimeSinceUnix": timeutil.TimeSinceUnix,
"TimeSinceUnix1": timeutil.TimeSinceUnix1,


+ 18
- 3
options/locale/locale_en-US.ini View File

@@ -406,6 +406,8 @@ sspi_auth_failed = SSPI authentication failed
change_email = Change email
change_email_address = Change email address
new_email_address = New email address
openi_community_really_awesome = OpenI, Really Awesome!

[phone]
format_err=The format of phone number is wrong.
query_err=Fail to query phone number, please try again later.
@@ -1061,6 +1063,8 @@ model_rename=Duplicate model name, please modify model name.

notebook_file_not_exist=Notebook file does not exist.
notebook_select_wrong=Please select a Notebook(.ipynb) file first.
notebook_path_too_long=The total length of selected file or files path exceed 255 characters, please select a shorter path file or change the file path.
notebook_branch_name_too_long=The total length of branch or branches name exceed 255 characters, please select a file in other branch.
notebook_file_no_right=You have no right to access the Notebook(.ipynb) file.
notebook_repo_conflict=The files in different branches of the same repository can not run together.
debug_again_fail=Fail to restart debug task, please try again later.
@@ -1095,8 +1099,8 @@ image_delete_fail=Failed to delete image, please try again later.
image_overwrite=You had submitted the same name image before, are you sure to overwrite the original image?
download=Download
score=Score
wait_count_start = Your current queue position is
wait_count_end =
wait_count_start = Your current queue position is
wait_count_end =
file_limit_100 = Display up to 100 files or folders in a single directory
images.name = Image Tag
images.name_placerholder = Please enter the image name
@@ -1261,6 +1265,13 @@ modelarts.fullscreen_log_file = View in full screen
modelarts.exit_full_screen = Exit fullscreen
modelarts.no_node_right = The value of 'Amount of Compute Node' is wrong, you have no right to use the current value of 'Amount of Compute Node'.

scrolled_logs_top = You have scrolled to the top of the log
scrolled_logs_top_pls_retry = You have scrolled to the top of the log, please try again later!
scrolled_logs_bottom = You have scrolled to the bottom of the log
scrolled_logs_bottom_pls_retry = You have scrolled to the bottom of the log, please try again later!

canceled_operation = You have canceled the operation
successfully_deleted = Successfully deleted

debug_task_not_created = Debug task has not been created
train_task_not_created = Train task has not been created
@@ -1349,6 +1360,7 @@ modelconvert.inputshapeerror=Format input error, please input such as: 1,1,32,32
modelconvert.manage.create_error1=A model transformation task with the same name already exists.
modelconvert.manage.create_error2=Only one running model transformation task can be created.
modelconvert.manage.model_not_exist=The model in the task does not exist or has been deleted.
modelconvert.manage.model_file_not_exist=The model file in the task does not exist or has been deleted.
modelconvert.manage.no_operate_right=You have no right to do the operation.

debug.manage.model_not_exist=The model in the task does not exist or has been deleted, please create a new debug job.
@@ -1474,7 +1486,7 @@ blame = Blame
normal_view = Normal View
line = line
lines = lines
notebook_open = Open in Notebook
notebook_open = Run Online

editor.new_file = New File
editor.upload_file = Upload File
@@ -3135,6 +3147,7 @@ task_gpudebugjob=`created CPU/GPU type debugging task <a href="%s/cloudbrain/%s"
task_npudebugjob=`created NPU type debugging task <a href="%s/modelarts/notebook/%s">%s</a>`
task_c2net_gpudebugjob=`created CPU/GPU type debugging task <a href="%s/grampus/notebook/%s">%s</a>`
task_c2net_npudebugjob=`created NPU type debugging task <a href="%s/grampus/notebook/%s">%s</a>`
task_c2ent_gcudebugjob=`created GCU type debugging task <a href="%s/grampus/notebook/%s">%s</a>`
task_nputrainjob=`created NPU training task <a href="%s/modelarts/train-job/%s">%s</a>`
task_inferencejob=`created reasoning task <a href="%s/modelarts/inference-job/%s">%s</a>`
task_benchmark=`created profiling task <a href="%s/cloudbrain/benchmark/%s">%s</a>`
@@ -3295,6 +3308,7 @@ point_hr = Point/hr
DEBUG = DEBUG
SNN4IMAGENET = BENCHMARK
BRAINSCORE = BENCHMARK
SNN4ECOSET = BENCHMARK
MODELSAFETY = BENCHMARK
TRAIN = TRAIN
INFERENCE = INFERENCE
@@ -3309,6 +3323,7 @@ Stopped_success_update_status_fail=Succeed in stopping th job, but failed to upd
load_code_failed=Fail to load code, please check if the right branch is selected.

error.dataset_select = dataset select error:the count exceed the limit or has same name
error.partial_datasets_not_available = There are non-existent or deleted files in the selected dataset file, please select again
new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the run parameter <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online
new_debug_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online
new_debug_gpu_tooltips1 = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the <strong style="color:#010101">%s</strong>.


+ 18
- 3
options/locale/locale_zh-CN.ini View File

@@ -73,7 +73,7 @@ your_starred=已点赞
your_settings=设置
invite_friends=邀请好友
your_friend=您的好友
invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources=邀请您加入启智社区AI协作平台,畅享充沛的免费算力资源!
invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources=邀请您加入启智社区AI协作平台,畅享充沛的普惠算力资源!
recommender=推荐人

all=所有
@@ -409,6 +409,8 @@ sspi_auth_failed=SSPI 认证失败
change_email=修改邮箱
change_email_address=修改邮箱地址
new_email_address=新邮箱地址
openi_community_really_awesome=启智社区 确实给力

[phone]
format_err=手机号格式错误。
query_err=查询手机号失败,请稍后再试。
@@ -1060,6 +1062,8 @@ model_rename=模型名称重复,请修改模型名称

notebook_file_not_exist=Notebook文件不存在。
notebook_select_wrong=请先选择Notebook(.ipynb)文件。
notebook_path_too_long=选择的一个或多个Notebook文件路径总长度超过255个字符,请选择路径较短的文件或调整文件路径。
notebook_branch_name_too_long=选择的一个或多个Notebook文件分支名总长度超过255个字符,请选择其他分支的文件。
notebook_file_no_right=您没有这个Notebook文件的读权限。
notebook_repo_conflict=同一个仓库的不同分支文件不能同时运行。
debug_again_fail=再次调试失败,请稍后再试。
@@ -1081,7 +1085,7 @@ delete=删除
more=更多
gpu_type_all=全部
model_download=结果下载
all_result_download=全部结果下载
all_result_download=全部结果下载
submit_image=提交镜像
modify_image=修改镜像
image_exist=镜像Tag已被使用,请修改镜像Tag。
@@ -1273,6 +1277,13 @@ modelarts.fullscreen_log_file=全屏查看
modelarts.exit_full_screen=退出全屏
modelarts.no_node_right = 计算节点数的值配置错误,您没有权限使用当前配置的计算节点数。

scrolled_logs_top = 您已翻阅至日志顶部
scrolled_logs_top_pls_retry = 您已翻阅至日志顶部,请稍后再试!
scrolled_logs_bottom = 您已翻阅至日志底部
scrolled_logs_bottom_pls_retry = 您已翻阅至日志底部,请稍后再试!

canceled_operation = 您已取消操作
successfully_deleted = 删除成功

debug_task_not_created = 未创建过调试任务
train_task_not_created = 未创建过训练任务
@@ -1363,6 +1374,7 @@ modelconvert.modelfileempty=请选择模型文件。
modelconvert.manage.create_error1=相同的名称模型转换任务已经存在。
modelconvert.manage.create_error2=只能创建一个正在运行的模型转换任务。
modelconvert.manage.model_not_exist=任务中选择的模型不存在或者已被删除。
modelconvert.manage.model_file_not_exist=任务中选择的模型文件不存在或者已被删除。
modelconvert.manage.no_operate_right=您没有操作权限。


@@ -1492,7 +1504,7 @@ normal_view=普通视图
line=行
lines=行

notebook_open = 在Notebook中打开
notebook_open = 在线运行

editor.new_file=新建文件
editor.upload_file=上传文件
@@ -3154,6 +3166,7 @@ task_gpudebugjob=`创建了CPU/GPU类型调试任务 <a href="%s/cloudbrain/%s">
task_npudebugjob=`创建了NPU类型调试任务 <a href="%s/modelarts/notebook/%s">%s</a>`
task_c2net_gpudebugjob=`创建了CPU/GPU类型调试任务 <a href="%s/grampus/notebook/%s">%s</a>`
task_c2net_npudebugjob=`创建了NPU类型调试任务 <a href="%s/grampus/notebook/%s">%s</a>`
task_c2ent_gcudebugjob=`创建了GCU类型调试任务 <a href="%s/grampus/notebook/%s">%s</a>`
task_nputrainjob=`创建了NPU类型训练任务 <a href="%s/modelarts/train-job/%s">%s</a>`
task_inferencejob=`创建了推理任务 <a href="%s/modelarts/inference-job/%s">%s</a>`
task_benchmark=`创建了评测任务 <a href="%s/cloudbrain/benchmark/%s">%s</a>`
@@ -3316,6 +3329,7 @@ point_hr = 积分/时
DEBUG = 调试任务
SNN4IMAGENET = 评测任务
BRAINSCORE = 评测任务
SNN4ECOSET = 评测任务
MODELSAFETY = 评测任务
TRAIN = 训练任务
INFERENCE = 推理任务
@@ -3331,6 +3345,7 @@ load_code_failed=代码加载失败,请确认选择了正确的分支。

error.debug_datasetsize = 数据集大小超过限制('%d'GB)
error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集
error.partial_datasets_not_available = 选择的数据集文件中有不存在或已删除的文件,请重新选择
new_train_gpu_tooltips = 训练脚本存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,预训练模型存放在运行参数 <strong style="color:#010101">%s</strong> 中,训练输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。
new_debug_gpu_tooltips = 项目代码存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,选择的模型存储在 <strong style="color:#010101">%s</strong> 中,调试输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。
new_debug_gpu_tooltips1 = 项目代码存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,选择的模型存储在 <strong style="color:#010101">%s</strong> 中。


+ 8
- 5
public/home/home.js View File

@@ -243,11 +243,12 @@ document.onreadystatechange = function () {
html += recordPrefix + actionName;
html += " <a href=\"" + getRepoLink(record) + "\" rel=\"nofollow\">" + getRepotext(record) + "</a>"
}
else if(record.OpType == "24" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "30" || record.OpType == "31" || record.OpType == "32" || record.OpType == "33"){
else if(record.OpType == "24" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "30"
|| record.OpType == "31" || record.OpType == "32" || record.OpType == "33"){
html += recordPrefix + actionName;
html += " <a href=\"" + getTaskLink(record) + "\" rel=\"nofollow\">" + record.RefName + "</a>"
}
else if(record.OpType == "25" || record.OpType == "29" || record.OpType == "39" || record.OpType == "40"){
else if(record.OpType == "25" || record.OpType == "29" || record.OpType == "39" || record.OpType == "40" || record.OpType == "41"){
html += recordPrefix + actionName;
html += " <a href=\"" + getTaskLink(record) + "\" rel=\"nofollow\">" + record.RefName + "</a>"
}
@@ -294,7 +295,7 @@ function getTaskLink(record){
re = re + "/cloudbrain/train-job/" + record.Content;
}else if(record.OpType == 32 || record.OpType == 33){
re = re + "/grampus/train-job/" + record.Content;
}else if(record.OpType == 39 || record.OpType == 40){
}else if(record.OpType == 39 || record.OpType == 40 || record.OpType == 41){
re = re + "/grampus/notebook/" + record.Content;
}
@@ -453,9 +454,10 @@ var actionNameZH={
"33":"创建了CPU/GPU类型训练任务",
"35":"创建的数据集 {dataset} 被设置为推荐数据集",
"36":"提交了镜像 {image}",
"37": "提交的镜像 {image} 被设置为推荐镜像",
"37":"提交的镜像 {image} 被设置为推荐镜像",
"39":"创建了CPU/GPU类型调试任务",
"40":"创建了NPU类型调试任务",
"41":"创建了GCU类型训练任务",
};

var actionNameEN={
@@ -486,9 +488,10 @@ var actionNameEN={
"33":" created CPU/GPU type training task",
"35":" created dataset {dataset} was set as recommended dataset",
"36":"committed image {image}",
"37": "committed image {image} was set as recommended image",
"37":"committed image {image} was set as recommended image",
"39":" created CPU/GPU type debugging task ",
"40":" created NPU type debugging task ",
"41":" created GCU type debugging task ",
};

var repoAndOrgZH={


BIN
public/img/login_bg_default.png View File

Before After
Width: 1200  |  Height: 938  |  Size: 142 kB

+ 45
- 0
routers/api/v1/repo/attachments.go View File

@@ -1,22 +1,67 @@
package repo

import (
"net/http"

"code.gitea.io/gitea/modules/log"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
routeRepo "code.gitea.io/gitea/routers/repo"
)

func GetSuccessChunks(ctx *context.APIContext) {
if errStr := checkDatasetPermission(ctx); errStr != "" {
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr))
}

routeRepo.GetSuccessChunks(ctx.Context)
}

func checkDatasetPermission(ctx *context.APIContext) string {
datasetId := ctx.QueryInt64("dataset_id")

dataset, err := models.GetDatasetByID(datasetId)
if err != nil {
log.Warn("can not find dataset", err)

return "dataset.query_dataset_fail"
}
repo, err := models.GetRepositoryByID(dataset.RepoID)
if err != nil {
log.Warn("can not find repo", err)
return "dataset.query_dataset_fail"
}

permission, err := models.GetUserRepoPermission(repo, ctx.User)
if err != nil {
log.Warn("can not find repo permission for user", err)
return "dataset.query_dataset_fail"
}
if !permission.CanWrite(models.UnitTypeDatasets) {

return "error.no_right"
}
return ""
}

func NewMultipart(ctx *context.APIContext) {
if errStr := checkDatasetPermission(ctx); errStr != "" {
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr))
}
routeRepo.NewMultipart(ctx.Context)
}
func GetMultipartUploadUrl(ctx *context.APIContext) {
if errStr := checkDatasetPermission(ctx); errStr != "" {
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr))
}
routeRepo.GetMultipartUploadUrl(ctx.Context)
}

func CompleteMultipart(ctx *context.APIContext) {
if errStr := checkDatasetPermission(ctx); errStr != "" {
ctx.JSON(http.StatusForbidden, ctx.Tr(errStr))
}
routeRepo.CompleteMultipart(ctx.Context)

}


+ 2
- 1
routers/api/v1/repo/cloudbrain_dashboard.go View File

@@ -1260,8 +1260,8 @@ func DownloadCloudBrainBoard(ctx *context.Context) {
Type: models.TypeCloudBrainAll,
BeginTimeUnix: int64(recordBeginTime),
EndTimeUnix: endTime.Unix(),
AccCardsNum: models.AccCardsNumAll,
})
log.Info("totalcountisis:", total)

if err != nil {
log.Warn("Can not get cloud brain info", err)
@@ -1290,6 +1290,7 @@ func DownloadCloudBrainBoard(ctx *context.Context) {
BeginTimeUnix: int64(recordBeginTime),
EndTimeUnix: endTime.Unix(),
NeedRepoInfo: true,
AccCardsNum: models.AccCardsNumAll,
})
if err != nil {
log.Warn("Can not get cloud brain info", err)


+ 4
- 0
routers/home.go View File

@@ -42,6 +42,7 @@ const (
tplExploreImages base.TplName = "explore/images"
tplExploreExploreDataAnalysis base.TplName = "explore/data_analysis"
tplHomeTerm base.TplName = "terms"
tplHomeAnnual base.TplName = "annual_privacy"
tplHomePrivacy base.TplName = "privacy"
tplResoruceDesc base.TplName = "resource_desc"
tplRepoSquare base.TplName = "explore/repos/square"
@@ -966,6 +967,9 @@ func RecommendHomeInfo(ctx *context.Context) {
func HomeTerm(ctx *context.Context) {
ctx.HTML(200, tplHomeTerm)
}
func HomeAnnual(ctx *context.Context) {
ctx.HTML(200, tplHomeAnnual)
}

func HomePrivacy(ctx *context.Context) {
ctx.HTML(200, tplHomePrivacy)


+ 1
- 1
routers/repo/ai_model_manage.go View File

@@ -76,7 +76,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio
cloudType := aiTask.Type
modelSelectedFile := ctx.Query("modelSelectedFile")
//download model zip //train type
if aiTask.ComputeResource == models.NPUResource {
if aiTask.ComputeResource == models.NPUResource || aiTask.ComputeResource == models.GCUResource {
cloudType = models.TypeCloudBrainTwo
} else if aiTask.ComputeResource == models.GPUResource {
cloudType = models.TypeCloudBrainOne


+ 38
- 6
routers/repo/grampus.go View File

@@ -53,6 +53,8 @@ const (
//NPU
tplGrampusNotebookNPUNew base.TplName = "repo/grampus/notebook/npu/new"
tplGrampusTrainJobNPUNew base.TplName = "repo/grampus/trainjob/npu/new"
//GCU
tplGrampusNotebookGCUNew base.TplName = "repo/grampus/notebook/gcu/new"
)

func GrampusNotebookNew(ctx *context.Context) {
@@ -61,6 +63,8 @@ func GrampusNotebookNew(ctx *context.Context) {
processType := grampus.ProcessorTypeGPU
if notebookType == 1 {
processType = grampus.ProcessorTypeNPU
} else if notebookType == 2 {
processType = grampus.ProcessorTypeGCU
}
err := grampusNotebookNewDataPrepare(ctx, processType)
if err != nil {
@@ -69,8 +73,10 @@ func GrampusNotebookNew(ctx *context.Context) {
}
if processType == grampus.ProcessorTypeGPU {
ctx.HTML(http.StatusOK, tplGrampusNotebookGPUNew)
} else {
} else if processType == grampus.ProcessorTypeNPU {
ctx.HTML(http.StatusOK, tplGrampusNotebookNPUNew)
} else if processType == grampus.ProcessorTypeGCU {
ctx.HTML(http.StatusOK, tplGrampusNotebookGCUNew)
}

}
@@ -117,6 +123,12 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook
computeSource = models.NPUResource
computeSourceSimple = models.NPU
codeStoragePath = grampus.JobPath + jobName + modelarts.CodePath
} else if form.Type == 2 {
tpl = tplGrampusNotebookGCUNew
processType = grampus.ProcessorTypeGCU
computeSource = models.GCUResource
computeSourceSimple = models.GCU
codeStoragePath = setting.CBCodePathPrefix + jobName + cloudbrain.CodeMountPath + "/"
}

lock := redis_lock.NewDistributeLock(redis_key.CloudbrainBindingJobNameKey(fmt.Sprint(repo.ID), string(models.JobTypeDebug), displayJobName))
@@ -199,6 +211,12 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.dataset_select"), tpl, &form)
return
}
uuidArray := strings.Split(uuid, ";")
if datasetInfos == nil || len(datasetInfos) < len(uuidArray) {
grampusNotebookNewDataPrepare(ctx, processType)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.partial_datasets_not_available"), tpl, &form)
return
}
}

//prepare code and out path
@@ -215,7 +233,7 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook
return
}

if processType == grampus.ProcessorTypeGPU {
if processType == grampus.ProcessorTypeGPU || processType == grampus.ProcessorTypeGCU {
if err := uploadCodeToMinio(codeLocalPath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil {
log.Error("Failed to uploadCodeToMinio: %s (%v)", repo.FullName(), err, ctx.Data["MsgID"])
grampusNotebookNewDataPrepare(ctx, processType)
@@ -255,20 +273,26 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook

if form.ModelName != "" { //使用预训练模型训练

_, err := models.QueryModelByPath(form.PreTrainModelUrl)
m, err := models.QueryModelByPath(form.PreTrainModelUrl)
if err != nil {
log.Error("Can not find model", err)
grampusNotebookNewDataPrepare(ctx, processType)
ctx.RenderWithErr(ctx.Tr("repo.modelconvert.manage.model_not_exist"), tpl, &form)
return
}
if !cloudbrainTask.IsModelFileExists(m, form.CkptName) {
log.Error("model file not exist.name = %s", form.CkptName)
grampusNotebookNewDataPrepare(ctx, processType)
ctx.RenderWithErr(ctx.Tr("repo.modelconvert.manage.model_file_not_exist"), tpl, &form)
return
}
req.ModelName = form.ModelName
req.LabelName = form.LabelName
req.CkptName = form.CkptName
req.ModelVersion = form.ModelVersion
req.PreTrainModelUrl = form.PreTrainModelUrl
req.PreTrainModelPath = getPreTrainModelPath(form.PreTrainModelUrl, form.CkptName)
req.ModelStorageType = m.Type
}

_, err = grampus.GenerateNotebookJob(ctx, req)
@@ -287,7 +311,7 @@ func grampusNotebookNewDataPrepare(ctx *context.Context, processType string) err
ctx.Data["display_job_name"] = displayJobName

//get valid images
if processType == grampus.ProcessorTypeNPU {
if processType == grampus.ProcessorTypeNPU || processType == grampus.ProcessorTypeGCU {
images, err := grampus.GetImages(processType, string(models.JobTypeDebug))
if err != nil {
log.Error("GetImages failed:", err.Error())
@@ -303,6 +327,10 @@ func grampusNotebookNewDataPrepare(ctx *context.Context, processType string) err
computeResourceSimple = models.NPU
datasetType = models.TypeCloudBrainTwo
computeResource = models.NPUResource
} else if processType == grampus.ProcessorTypeGCU {
computeResourceSimple = models.GCU
datasetType = models.TypeCloudBrainAll
computeResource = models.GCUResource
}

prepareGrampusSpecs(ctx, computeResourceSimple, models.JobTypeDebug)
@@ -1660,7 +1688,11 @@ func GrampusNotebookRestart(ctx *context.Context) {
if task.ComputeResource == models.NPUResource {
computeSourceSimple = models.NPU
action = models.ActionCreateGrampusNPUDebugTask
} else if task.ComputeResource == models.GCUResource {
computeSourceSimple = models.GCU
action = models.ActionCreateGrampusGCUDebugTask
}

spec, err = resource.GetAndCheckSpec(ctx.User.ID, oldSpec.ID, models.FindSpecsOptions{
JobType: models.JobType(task.JobType),
ComputeResource: computeSourceSimple,
@@ -1676,7 +1708,7 @@ func GrampusNotebookRestart(ctx *context.Context) {
errorMsg = ctx.Tr("points.insufficient_points_balance")
break
}
if task.IsGPUTask() {
if task.IsGPUTask() || task.IsGCUTask() {
if _, err := os.Stat(getOldJobPath(task)); err != nil {
log.Error("Can not find job minio path", err)
resultCode = "-1"


+ 13
- 9
routers/repo/modelarts.go View File

@@ -483,7 +483,7 @@ func getFileUrl(url string, filename string) string {
}
}

return url + middle + filename
return url + middle + filename + "?reset"
}

func NotebookRestart(ctx *context.Context) {
@@ -2893,15 +2893,19 @@ func TrainJobDownloadLogFile(ctx *context.Context) {
ctx.ServerError("GetObsLogFileName", err)
return
}

url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key)
if err != nil {
log.Error("GetObsCreateSignedUrlByBucketAndKey failed: %v", err.Error(), ctx.Data["msgID"])
ctx.ServerError("GetObsCreateSignedUrlByBucketAndKey", err)
return
if len(key) > 1 {
ObsDownloadManyFile(prefix[0:len(prefix)-3], ctx, task.DisplayJobName+".zip", key)
} else {
url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].ParenDir+key[0].FileName)
if err != nil {
log.Error("GetObsCreateSignedUrlByBucketAndKey failed: %v", err.Error(), ctx.Data["msgID"])
ctx.ServerError("GetObsCreateSignedUrlByBucketAndKey", err)
return
}
ctx.Resp.Header().Set("Cache-Control", "max-age=0")
http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusTemporaryRedirect)
}
ctx.Resp.Header().Set("Cache-Control", "max-age=0")
http.Redirect(ctx.Resp, ctx.Req.Request, url, http.StatusTemporaryRedirect)

}
func getDatasUrlListByUUIDS(uuidStr string) ([]models.Datasurl, string, string, bool, error) {
var isMultiDataset bool


+ 1
- 0
routers/routes/routes.go View File

@@ -359,6 +359,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/all/dosearch/", routers.SearchApi)
m.Post("/user/login/kanban", user.SignInPostAPI)
m.Get("/home/term", routers.HomeTerm)
m.Get("/home/annual_privacy", routers.HomeAnnual)
m.Get("/home/notice", routers.HomeNoticeTmpl)
m.Get("/home/privacy", routers.HomePrivacy)
m.Get("/extension/tuomin/upload", modelapp.ProcessImageUI)


+ 14
- 7
routers/user/auth.go View File

@@ -36,6 +36,7 @@ import (
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/externalaccount"
"code.gitea.io/gitea/services/mailer"
"code.gitea.io/gitea/services/repository"

"gitea.com/macaron/captcha"
"github.com/markbates/goth"
@@ -120,7 +121,6 @@ func checkAutoLogin(ctx *context.Context) bool {
ctx.ServerError("AutoSignIn", err)
return true
}

redirectTo := ctx.Query("redirect_to")
if len(redirectTo) > 0 {
ctx.SetCookie("redirect_to", redirectTo, 0, setting.AppSubURL, "", setting.SessionConfig.Secure, true)
@@ -129,7 +129,6 @@ func checkAutoLogin(ctx *context.Context) bool {
}

if isSucceed {

isCourse := ctx.QueryBool("course")
ctx.SetCookie("redirect_to", "", -1, setting.AppSubURL, "", setting.SessionConfig.Secure, true)
if redirectTo == "" && isCourse {
@@ -137,7 +136,6 @@ func checkAutoLogin(ctx *context.Context) bool {
ctx.RedirectToFirst(redirectToCourse)
} else {
ctx.RedirectToFirst(redirectTo, setting.AppSubURL+string(setting.LandingPageURL))

}
return true
}
@@ -145,10 +143,14 @@ func checkAutoLogin(ctx *context.Context) bool {
return false
}

func getActivityTpl() string {
result, _ := repository.RecommendContentFromPromote(setting.RecommentRepoAddr + "/signin/activity_tpl")
return result
}

// SignIn render sign in page
func SignIn(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("sign_in")

// Check auto-login.
if checkAutoLogin(ctx) {
return
@@ -168,6 +170,7 @@ func SignIn(ctx *context.Context) {
ctx.Data["PageIsLogin"] = true
ctx.Data["EnableSSPI"] = models.IsSSPIEnabled()
ctx.Data["EnableCloudBrain"] = true
ctx.Data["ActivityTpl"] = getActivityTpl()

ctx.HTML(200, tplSignIn)
}
@@ -185,6 +188,7 @@ func SignInCloudBrain(ctx *context.Context) {
ctx.Data["PageIsSignIn"] = true
ctx.Data["PageIsCloudBrainLogin"] = true
ctx.Data["EnableCloudBrain"] = true
ctx.Data["ActivityTpl"] = getActivityTpl()

ctx.HTML(200, tplSignInCloudBrain)
}
@@ -197,6 +201,7 @@ func SignInPhone(ctx *context.Context) {
}

ctx.Data["PageIsPhoneLogin"] = true
ctx.Data["ActivityTpl"] = getActivityTpl()

ctx.HTML(200, tplSignInPhone)
}
@@ -206,6 +211,7 @@ func SignInPhonePost(ctx *context.Context, form auth.PhoneNumberCodeForm) {
ctx.Data["PageIsPhoneLogin"] = true
ctx.Data["IsCourse"] = ctx.QueryBool("course")
ctx.Data["EnableCloudBrain"] = true
ctx.Data["ActivityTpl"] = getActivityTpl()

if ctx.HasError() {
ctx.HTML(200, tplSignInPhone)
@@ -270,7 +276,6 @@ func SignInPostAPI(ctx *context.Context) {

func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
ctx.Data["Title"] = ctx.Tr("sign_in")

orderedOAuth2Names, oauth2Providers, err := models.GetActiveOAuth2Providers()
if err != nil {
ctx.ServerError("UserSignIn", err)
@@ -285,7 +290,6 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
ctx.Data["IsCourse"] = ctx.QueryBool("course")
ctx.Data["EnableSSPI"] = models.IsSSPIEnabled()
ctx.Data["EnableCloudBrain"] = true

if ctx.HasError() {
ctx.HTML(200, tplSignIn)
return
@@ -356,6 +360,7 @@ func SignInPostCommon(ctx *context.Context, form auth.SignInForm) {
func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) {
ctx.Data["PageIsCloudBrainLogin"] = true
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login/cloud_brain"
ctx.Data["ActivityTpl"] = getActivityTpl()
SignInPostCommon(ctx, form)
}

@@ -363,6 +368,7 @@ func SignInCloudBrainPost(ctx *context.Context, form auth.SignInForm) {
func SignInPost(ctx *context.Context, form auth.SignInForm) {
ctx.Data["PageIsLogin"] = true
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login"
ctx.Data["ActivityTpl"] = getActivityTpl()
SignInPostCommon(ctx, form)
}

@@ -757,7 +763,6 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR
}
return redirectTo
}

if obeyRedirect {
ctx.Redirect(setting.AppSubURL + "/dashboard")
}
@@ -1257,6 +1262,7 @@ func SignUp(ctx *context.Context) {

//Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration
ctx.Data["ActivityTpl"] = getActivityTpl()

ctx.HTML(200, tplSignUp)
}
@@ -1272,6 +1278,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
ctx.Data["PageIsSignUp"] = true
ctx.Data["ActivityTpl"] = getActivityTpl()

//Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
if setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration {


+ 30
- 0
services/cloudbrain/cloudbrainTask/ai_model.go View File

@@ -0,0 +1,30 @@
package cloudbrainTask

import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/storage"
)

func IsModelFileExists(model *models.AiModelManage, fileName string) bool {
if model.Type == models.TypeCloudBrainTwo {
key := models.AIModelPath + models.AttachmentRelativePath(model.ID) + "/" + fileName
log.Info("IsModelFileExists TypeCloudBrainTwo key=%s", key)
isExist, err := storage.IsObjectExist4Obs(setting.Bucket, key)
if err != nil {
return false
}
return isExist
} else if model.Type == models.TypeCloudBrainOne {
prefix := models.AIModelPath + models.AttachmentRelativePath(model.ID) + "/"
objectName := prefix + fileName
log.Info("IsModelFileExists TypeCloudBrainOne objectName=%s", objectName)
isExist, err := storage.IsObjectExist4Minio(setting.Attachment.Minio.Bucket, objectName)
if err != nil {
return false
}
return isExist
}
return false
}

+ 5
- 0
services/cloudbrain/cloudbrainTask/count.go View File

@@ -72,6 +72,11 @@ var StatusInfoDict = map[string]StatusInfo{string(models.JobTypeDebug) + "-" + s
JobType: []models.JobType{models.JobTypeDebug},
NotFinalStatuses: GrampusNotFinalStatuses,
ComputeResource: models.NPUResource,
}, string(models.JobTypeDebug) + "-" + strconv.Itoa(models.TypeC2Net) + "-" + models.GCUResource: {
CloudBrainTypes: []int{models.TypeC2Net},
JobType: []models.JobType{models.JobTypeDebug},
NotFinalStatuses: GrampusNotFinalStatuses,
ComputeResource: models.GCUResource,
}}

func GetNotFinalStatusTaskCount(uid int64, cloudbrainType int, jobType string, computeResource ...string) (int, error) {


+ 35
- 7
services/cloudbrain/cloudbrainTask/notebook.go View File

@@ -35,6 +35,7 @@ const NoteBookExtension = ".ipynb"
const CPUType = 0
const GPUType = 1
const NPUType = 2
const CharacterLength = 2550

func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOption) {

@@ -46,6 +47,14 @@ func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOp
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_select_wrong")))
return
}
if len(getBootFile(option.File, option.OwnerName, option.ProjectName)) > CharacterLength {
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_path_too_long")))
return
}
if len(option.BranchName) > CharacterLength {
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_branch_name_too_long")))
return
}

isNotebookFileExist, _ := isNoteBookFileExist(ctx, option)
if !isNotebookFileExist {
@@ -105,14 +114,29 @@ func FileNotebookCreate(ctx *context.Context, option api.CreateFileNotebookJobOp
err = downloadCode(sourceRepo, getCodePath(noteBook.JobName, sourceRepo), option.BranchName)
if err != nil {
log.Error("download code failed", err)
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("cloudbrain.load_code_failed")))
return
if !strings.Contains(err.Error(), "already exists and is not an empty directory") {
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("cloudbrain.load_code_failed")))
return
}
}
}
if !isRepoFileMatch(option, noteBook) {
noteBook.BootFile += ";" + getBootFile(option.File, option.OwnerName, option.ProjectName)
noteBook.BranchName += ";" + option.BranchName
noteBook.Description += ";" + getDescription(option)
if len(noteBook.BootFile)+len(getBootFile(option.File, option.OwnerName, option.ProjectName))+1 <= CharacterLength {
noteBook.BootFile += ";" + getBootFile(option.File, option.OwnerName, option.ProjectName)
} else {
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_path_too_long")))
return
}
if len(noteBook.BranchName)+len(option.BranchName)+1 <= CharacterLength {
noteBook.BranchName += ";" + option.BranchName
} else {
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_branch_name_too_long")))
return
}

if len(noteBook.Description)+len(getDescription(option))+1 <= CharacterLength {
noteBook.Description += ";" + getDescription(option)
}

err := models.UpdateJob(noteBook)
if err != nil {
@@ -417,7 +441,7 @@ func cloudBrainFileNoteBookCreate(ctx *context.Context, option api.CreateFileNot
}

func getCloudbrainType(optionType int) int {
if optionType < 1 {
if optionType <= GPUType {
return models.TypeCloudBrainOne
}
if setting.ModelartsCD.Enabled {
@@ -431,7 +455,11 @@ func getCodePath(jobName string, repo *models.Repository) string {
}

func getDescription(option api.CreateFileNotebookJobOption) string {
return option.OwnerName + "/" + option.ProjectName + "/" + option.File
des := option.OwnerName + "/" + option.ProjectName + "/" + option.File
if len(des) <= CharacterLength {
return des
}
return ""
}

func modelartsFileNoteBookCreate(ctx *context.Context, option api.CreateFileNotebookJobOption, repo *models.Repository, sourceRepo *models.Repository) {


+ 1
- 1
services/socketwrap/clientManager.go View File

@@ -10,7 +10,7 @@ import (
"github.com/elliotchance/orderedmap"
)

var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 39, 40}
var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 39, 40, 41}

type ClientsManager struct {
Clients *orderedmap.OrderedMap


+ 8
- 8
templates/admin/cloudbrain/list.tmpl View File

@@ -89,21 +89,21 @@
<div class="row">
<!-- 任务名 -->
{{$JobID := '0'}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "MODELSAFETY"}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "MODELSAFETY" "SNN4ECOSET"}}
{{$JobID = .Cloudbrain.ID}}
{{else}}
{{$JobID = .JobID}}
{{end}}
<!-- {{$JobID}} -->
<div class="two wide column nowrap" style="width:10% !important;">
{{if eq .JobType "DEBUG"}}
{{if eq .JobType "DEBUG"}}
<a class="title"
href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{$JobID}}"
title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
<span class="fitted"
style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
</a>
{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}
{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE") (eq .JobType "SNN4ECOSET")}}
<a class="title"
href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}"
title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
@@ -233,7 +233,7 @@
{{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}}
<a style="margin: 0 1rem;" id="ai-debug-{{$JobID}}"
class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button'
data-jobid="{{$JobID}}"
data-jobid="{{$JobID}}"
data-repopath='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}/{{$JobID}}/'>
{{$.i18n.Tr "repo.debug"}}
</a>
@@ -263,7 +263,7 @@
</a>
</form>
{{else}}
{{if eq .JobType "DEBUG" "BENCHMARK" "SNN4IMAGENET" "BRAINSCORE"}}
{{if eq .JobType "DEBUG" "BENCHMARK" "SNN4IMAGENET" "BRAINSCORE" "SNN4ECOSET"}}
<form id="stopForm-{{$JobID}}" style="margin-left:-1px;">
{{$.CsrfTokenHtml}}
<a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}"
@@ -305,11 +305,11 @@
</form>
{{else}}
<form class="ui compact buttons" id="delForm-{{$JobID}}"
action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?ishomepage=true'
action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE") (eq .JobType "SNN4ECOSET")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?isadminpage=true'
method="post">
{{$.CsrfTokenHtml}}
<a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}"
data-repopath="{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}/del_version?ishomepage=true"
data-repopath="{{.Repo.OwnerName}}/{{.Repo.Name}}/modelarts/inference-job/{{$JobID}}/del_version?isadminpage=true"
data-version="{{.VersionName}}" class="ui basic ai_delete blue button"
style="border-radius: .28571429rem;">
{{$.i18n.Tr "repo.delete"}}
@@ -321,7 +321,7 @@
</div>
{{else}}
{{$JobID := '0'}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK"}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "SNN4ECOSET"}}
{{$JobID = .Cloudbrain.ID}}
{{else}}
{{$JobID = .JobID}}


+ 2
- 0
templates/admin/cloudbrain/search.tmpl View File

@@ -35,6 +35,7 @@
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType=SNN4IMAGENET&listType={{$.ListType}}&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="SNN4IMAGENET">SNN4IMAGENET</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType=BRAINSCORE&listType={{$.ListType}}&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="BRAINSCORE">BRAINSCORE</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType=MODELSAFETY&listType={{$.ListType}}&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="MODELSAFETY">MODELSAFETY</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType=SNN4ECOSET&listType={{$.ListType}}&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="MODELSAFETY">SNN4ECOSET</a>
</div>
</div>
<div class="ui selection dropdown" style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;">
@@ -44,6 +45,7 @@
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value='{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}'>{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=CPU/GPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="CPU/GPU">CPU/GPU</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=NPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="NPU">NPU</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=GCU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="GCU">GCU</a>
</div>
</div>
<div class="ui selection dropdown" style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;">


+ 1
- 0
templates/admin/cloudbrain/search_dashboard.tmpl View File

@@ -55,6 +55,7 @@
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value='{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}'>{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=CPU/GPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="CPU/GPU">CPU/GPU</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=NPU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="NPU">NPU</a>
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&jobType={{$.JobType}}&listType=GCU&jobStatus={{$.JobStatus}}&cluster={{$.cluster}}&aiCenter={{$.aiCenter}}" data-value="GCU">GCU</a>
</div>
</div>
<div class="ui selection dropdown" style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;">


+ 35
- 0
templates/annual_privacy.tmpl View File

@@ -0,0 +1,35 @@
{{template "base/head_home" .}}
<div class="ui container">
<h1 class="ui center am-pt-30 am-pb-20">OpenI启智社区2022年度报告授权协议</h1>
<div class="ui divider am-pb-10"></div>
<p>
感谢您阅读《OpenI启智社区2022年度报告授权协议》!在您正式使用OpenI启智社区2022年度报告之前应仔细阅读并充分理解本协议中的全部内容,如您不同意本协议中的任何条款,请立即停止使用OpenI启智社区2022年度报告。您使用OpenI启智社区2022年度报告的行为将被视为已经仔细阅读、充分理解并毫无保留地接受本协议所有条款。
</p>
<p>
<strong>1. 制作年度报告</strong>
</p>
<p>
OpenI启智社区2022年度报告将根据您在平台的历史信息,帮助您生成一份专属年度报告。为此,我们将使用2022自然年度您在OpenI启智社区产生的行为信息,包括但不限于用户名、注册时间、创建项目数、项目下载次数、commit次数、代码行数、创建数据集、上传数据集文件、数据集被收藏数、数据集下载数、云脑任务所有相关数据( GPU/NPU 调试任务、训练任务、运行卡时)。您理解并同意,上述信息是OpenI启智社区生成年度报告的必备信息,如您拒绝授权使用,OpenI启智社区将无法为您制作并提供专属年度报告。未经您的书面同意,我们保证不以超越本协议约定范围使用您的个人信息。
</p>
<p>
<strong>2. 使用年度报告</strong>
</p>
<p>
OpenI启智社区提供的年度报告仅限您个人使用,您可自行留存欣赏或无偿分享、公开。您理解并同意,如因您分享、公开年度报告而产生的任何损失(包括但不限于个人信息泄露等)应由您自行承担,请您在分享、公开年度报告前审慎考虑。
</p>
<p>
<strong>3. 知识产权</strong>
</p>
<p>
年度报告及其内容(包括但不限于软件、技术、程序、网页、文字、图片、音频、视频、页面设计、商标等)的知识产权由OpenI启智社区享有,您理解并同意,您不得超越本协议目的使用年度报告中的内容素材,如您希望以任何形式将年度报告中的内容素材用于本协议约定范围之外,应当经过所有实际权利人的书面许可。
</p>
<p>
<strong>4. 隐私政策</strong>
</p>
<p>
其他本隐私保护指引未有涉及的,将适用《OpenI启智社区AI协作平台使用协议》和《OpenI启智社区AI协作平台隐私协议》。
</p>

</div>
{{template "base/footer" .}}

+ 9
- 9
templates/base/footer.tmpl View File

@@ -17,9 +17,9 @@

{{if .RequireSimpleMDE}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js?v={{MD5 AppVer}}"></script>
<script>
CodeMirror.modeURL = "{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js";
</script>
@@ -27,10 +27,10 @@

<!-- Third-party libraries -->
{{if .RequireMinicolors}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js?v={{MD5 AppVer}}"></script>
{{end}}
{{if .RequireU2F}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js?v={{MD5 AppVer}}"></script>
{{end}}
{{if .EnableCaptcha}}
{{if eq .CaptchaType "recaptcha"}}
@@ -38,17 +38,17 @@
{{end}}
{{end}}
{{if .RequireTribute}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.min.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.min.js?v={{MD5 AppVer}}"></script>
{{end}}
{{if .PageIsHome}}
<script rel="stylesheet" src="{{StaticUrlPrefix}}/vendor/plugins/jquery.particleground/jquery.particleground.min.js"></script>
<script rel="stylesheet" src="{{StaticUrlPrefix}}/vendor/plugins/jquery.particleground/jquery.particleground.min.js?v={{MD5 AppVer}}"></script>
{{end}}
<script src="{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
{{template "custom/footer" .}}
{{if .PageIsHome}}
<!--script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script-->
<script src="/rotation3D/vue-2.6.10.min.js"></script>
<!--script src="https://www.jq22.com/jquery/jquery-1.10.2.js?v={{MD5 AppVer}}"></script-->
<script src="/rotation3D/vue-2.6.10.min.js?v={{MD5 AppVer}}"></script>
<script src="/rotation3D/rotation3D.js?v={{MD5 AppVer}}"></script>
<script>
var jobTask={};


+ 10
- 0
templates/base/footer_content.tmpl View File

@@ -1,3 +1,13 @@
<style>
@media only screen and (max-width: 767px) {
.mobile-text-align-center {
text-align: center !important;
}
.mobile-justify-content-center {
justify-content: center !important;
}
}
</style>
<footer style="border-top:none;">
<div class="ui container">
<div class="ui grid">


+ 7
- 7
templates/base/footer_fluid.tmpl View File

@@ -14,9 +14,9 @@
<script src="{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}"></script>
{{if .RequireSimpleMDE}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js?v={{MD5 AppVer}}"></script>
<script>
CodeMirror.modeURL = "{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js";
</script>
@@ -24,10 +24,10 @@
<!-- Third-party libraries -->
{{if .RequireMinicolors}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.min.js?v={{MD5 AppVer}}"></script>
{{end}}
{{if .RequireU2F}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js?v={{MD5 AppVer}}"></script>
{{end}}
{{if .EnableCaptcha}}
{{if eq .CaptchaType "recaptcha"}}
@@ -35,10 +35,10 @@
{{end}}
{{end}}
{{if .RequireTribute}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.min.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.min.js?v={{MD5 AppVer}}"></script>
{{end}}
{{if .PageIsHome}}
<script rel="stylesheet" src="{{StaticUrlPrefix}}/vendor/plugins/jquery.particleground/jquery.particleground.min.js"></script>
<script rel="stylesheet" src="{{StaticUrlPrefix}}/vendor/plugins/jquery.particleground/jquery.particleground.min.js?v={{MD5 AppVer}}"></script>
{{end}}
<script src="{{StaticUrlPrefix}}/fomantic/semantic.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>


+ 10
- 10
templates/base/head.tmpl View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials">
<link rel="manifest" href="{{AppSubUrl}}/manifest.json?v={{MD5 AppVer}}" crossorigin="use-credentials">
{{if UseServiceWorker}}
<script>
if ('serviceWorker' in navigator) {
@@ -115,18 +115,18 @@
window.sessionStorage.removeItem('_csrf');
{{end}}
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png?v={{MD5 AppVer}}">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg?v={{MD5 AppVer}}" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png?v={{MD5 AppVer}}" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css?v={{MD5 AppVer}}">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/outline-icons.woff2" type="font/woff2" crossorigin="anonymous">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css?v={{MD5 AppVer}}">
{{end}}

{{if .RequireTribute}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
@@ -137,7 +137,7 @@
</style>
</noscript>
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css?v={{MD5 AppVer}}">
{{end}}
<style class="list-search-style"></style>
{{if .PageIsUserProfile}}
@@ -179,7 +179,7 @@
{{else if ne DefaultTheme "gitea"}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css">
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css?v={{MD5 AppVer}}">
{{template "custom/header" .}}

<script>
@@ -191,7 +191,7 @@ var _hmt = _hmt || [];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="/self/func.js" type="text/javascript"></script>
<script src="/self/func.js?v={{MD5 AppVer}}" type="text/javascript"></script>
</head>
<body>
{{template "custom/body_outer_pre" .}}


+ 10
- 10
templates/base/head_course.tmpl View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials">
<link rel="manifest" href="{{AppSubUrl}}/manifest.json?v={{MD5 AppVer}}" crossorigin="use-credentials">
{{if UseServiceWorker}}
<script>
if ('serviceWorker' in navigator) {
@@ -115,18 +115,18 @@
window.sessionStorage.removeItem('_csrf');
{{end}}
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png?v={{MD5 AppVer}}">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg?v={{MD5 AppVer}}" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png?v={{MD5 AppVer}}" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css?v={{MD5 AppVer}}">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/outline-icons.woff2" type="font/woff2" crossorigin="anonymous">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css?v={{MD5 AppVer}}">
{{end}}

{{if .RequireTribute}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
@@ -137,7 +137,7 @@
</style>
</noscript>
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css?v={{MD5 AppVer}}">
{{end}}
<style class="list-search-style"></style>
{{if .PageIsUserProfile}}
@@ -179,7 +179,7 @@
{{else if ne DefaultTheme "gitea"}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css">
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css?v={{MD5 AppVer}}">
{{template "custom/header" .}}

<script>
@@ -191,7 +191,7 @@ var _hmt = _hmt || [];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="/self/func.js" type="text/javascript"></script>
<script src="/self/func.js?v={{MD5 AppVer}}" type="text/javascript"></script>
</head>
<body>
{{template "custom/body_outer_pre" .}}


+ 10
- 10
templates/base/head_fluid.tmpl View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials">
<link rel="manifest" href="{{AppSubUrl}}/manifest.json?v={{MD5 AppVer}}" crossorigin="use-credentials">
{{if UseServiceWorker}}
<script>
if ('serviceWorker' in navigator) {
@@ -115,18 +115,18 @@
window.sessionStorage.removeItem('_csrf');
{{end}}
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png?v={{MD5 AppVer}}">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg?v={{MD5 AppVer}}" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png?v={{MD5 AppVer}}" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css?v={{MD5 AppVer}}">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/outline-icons.woff2" type="font/woff2" crossorigin="anonymous">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css?v={{MD5 AppVer}}">
{{end}}

{{if .RequireTribute}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
@@ -137,7 +137,7 @@
</style>
</noscript>
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css?v={{MD5 AppVer}}">
{{end}}
<style class="list-search-style"></style>
{{if .PageIsUserProfile}}
@@ -179,7 +179,7 @@
{{else if ne DefaultTheme "gitea"}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css">
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css?v={{MD5 AppVer}}">
{{template "custom/header" .}}

<script>
@@ -191,7 +191,7 @@ var _hmt = _hmt || [];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="/self/func.js" type="text/javascript"></script>
<script src="/self/func.js?v={{MD5 AppVer}}" type="text/javascript"></script>

</head>
<body>


+ 14
- 14
templates/base/head_home.tmpl View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials">
<link rel="manifest" href="{{AppSubUrl}}/manifest.json?v={{MD5 AppVer}}" crossorigin="use-credentials">
{{if UseServiceWorker}}
<script>
if ('serviceWorker' in navigator) {
@@ -115,19 +115,19 @@
window.sessionStorage.removeItem('_csrf');
{{end}}
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png?v={{MD5 AppVer}}">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg?v={{MD5 AppVer}}" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png?v={{MD5 AppVer}}" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css?v={{MD5 AppVer}}">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/outline-icons.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="stylesheet" href="/css/git.openi.css">
<link rel="stylesheet" href="/css/git.openi.css?v={{MD5 AppVer}}">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css?v={{MD5 AppVer}}">
{{end}}

{{if .RequireTribute}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
@@ -138,7 +138,7 @@
</style>
</noscript>
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css?v={{MD5 AppVer}}">
{{end}}
<style class="list-search-style"></style>
{{if .PageIsUserProfile}}
@@ -191,14 +191,14 @@ var _hmt = _hmt || [];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="/self/func.js" type="text/javascript"></script>
<script src="/self/func.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<!--RemixIcon Fonts v2.5.0-->
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css">
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css?v={{MD5 AppVer}}">
<!-- Swiper -->
<link rel="stylesheet" href="/swiper/swiper-bundle.min.css">
<script src="/swiper/swiper-bundle.min.js"></script>
<link rel="stylesheet" href="/swiper/swiper-bundle.min.css?v={{MD5 AppVer}}">
<script src="/swiper/swiper-bundle.min.js?v={{MD5 AppVer}}"></script>
<!-- rotation3D -->
<link rel="stylesheet" href="/rotation3D/rotation3D.css">
<link rel="stylesheet" href="/rotation3D/rotation3D.css?v={{MD5 AppVer}}">
</head>
<body>
{{template "custom/body_outer_pre" .}}


+ 10
- 10
templates/base/head_pro.tmpl View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}} {{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json" crossorigin="use-credentials">
<link rel="manifest" href="{{AppSubUrl}}/manifest.json?v={{MD5 AppVer}}" crossorigin="use-credentials">
{{if UseServiceWorker}}
<script>
if ('serviceWorker' in navigator) {
@@ -115,18 +115,18 @@
window.sessionStorage.removeItem('_csrf');
{{end}}
</script>
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css">
<link rel="shortcut icon" href="{{StaticUrlPrefix}}/img/favicon.png?v={{MD5 AppVer}}">
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/openi-safari.svg?v={{MD5 AppVer}}" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png?v={{MD5 AppVer}}" title="{{AppName}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/assets/font-awesome/css/font-awesome.min.css?v={{MD5 AppVer}}">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/icons.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="preload" as="font" href="{{StaticUrlPrefix}}/fomantic/themes/default/assets/fonts/outline-icons.woff2" type="font/woff2" crossorigin="anonymous">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css?v={{MD5 AppVer}}">
{{end}}

{{if .RequireTribute}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/tribute/tribute.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/fomantic/semantic.min.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
@@ -137,7 +137,7 @@
</style>
</noscript>
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css?v={{MD5 AppVer}}">
{{end}}
<style class="list-search-style"></style>
{{if .PageIsUserProfile}}
@@ -179,7 +179,7 @@
{{else if ne DefaultTheme "gitea"}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css">
<link rel="stylesheet" href="/RemixIcon_Fonts_v2.5.0/fonts/remixicon.css?v={{MD5 AppVer}}">
{{template "custom/header" .}}

<script>
@@ -191,7 +191,7 @@ var _hmt = _hmt || [];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="/self/func.js" type="text/javascript"></script>
<script src="/self/func.js?v={{MD5 AppVer}}" type="text/javascript"></script>

</head>
<body>


+ 2
- 0
templates/custom/header.tmpl View File

@@ -0,0 +1,2 @@
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/placeholder.css?v={{TimeStampNow}}">
<script src="{{StaticUrlPrefix}}/js/placeholder.js?v={{TimeStampNow}}"></script>

+ 39
- 1
templates/custom/home/home_top.tmpl View File

@@ -1786,8 +1786,40 @@
background-repeat: no-repeat;
background-size: cover;
padding: 45% 0;
}
}
}

._hm-pg-bg-4 {
background: url(/img/home-banner-02-1.jpg);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
._hm-pg-bg-4-content {
position: absolute;
margin: auto;
left: 0;
top: -10%;
right: 0;
bottom: 0;
display: block;
width: 790px;
height: 315px;
background: url(/img/home-banner-02-2.png);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
@media only screen and (max-width: 767px) {
._hm-pg-bg-4 {
background-size: 200% 100%;
}
._hm-pg-bg-4-content {
top: -15%;
width: 90%;
height: 150px;
}
}
</style>
<div class="_hm-bg-container">
<div class="_hm-pg _hm-pg-static">
@@ -2029,12 +2061,18 @@
<div class="_hm-big-btn-c"></div>
</div>
</div>
<div class="_hm-pg _hm-pg-bg-4">
<a target="_blank;" href="https://openi.org.cn/index.php?m=content&c=index&a=lists&catid=225">
<div class="_hm-pg-bg-4-content" style="animation:_hm-slide-in-left-once 0.5s"></div>
</a>
</div>
</div>
<div class="_hm-slide-btn _hm-slide-btn-left"></div>
<div class="_hm-slide-btn _hm-slide-btn-right"></div>
<div class="_hm-slide-pagination-c">
<div class="_hm-slide-pagination-item _hm-slide-pagination-item-active"></div>
<div class="_hm-slide-pagination-item"></div>
<div class="_hm-slide-pagination-item"></div>
</div>
</div>
<div class="ui container _hm-container">


+ 1
- 0
templates/explore/images.tmpl View File

@@ -1,4 +1,5 @@
{{template "base/head" .}}
<div class="alert"></div>
<div id="images"></div>
<!-- 确认模态框 -->
<div id="deletemodel">


+ 4
- 4
templates/explore/organizations.tmpl View File

@@ -1,8 +1,8 @@

<link rel="stylesheet" href="/swiper/swiper-bundle.min.css">
<link rel="stylesheet" href="/css/git.openi.css">
<script src="/swiper/swiper-bundle.min.js"></script>
<script src="/self/js/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="/swiper/swiper-bundle.min.css?v={{MD5 AppVer}}">
<link rel="stylesheet" href="/css/git.openi.css?v={{MD5 AppVer}}">
<script src="/swiper/swiper-bundle.min.js?v={{MD5 AppVer}}"></script>
<script src="/self/js/jquery.min.js?v={{MD5 AppVer}}" type="text/javascript"></script>

{{template "base/head" .}}
<div class="explore users">


+ 2
- 2
templates/explore/repo_orgtop.tmpl View File

@@ -1,5 +1,5 @@
<script src="/swiper/swiper-bundle.min.js"></script>
<link href="/swiper/swiper-bundle.min.css" rel="stylesheet">
<script src="/swiper/swiper-bundle.min.js?v={{MD5 AppVer}}"></script>
<link href="/swiper/swiper-bundle.min.css?v={{MD5 AppVer}}" rel="stylesheet">

<style>
.explore .repos--seach{


+ 1
- 1
templates/explore/search_new.tmpl View File

@@ -86,7 +86,7 @@
</div>

</div>
<script src="/self/js/jquery.min.js" type="text/javascript"></script>
<script src="/self/js/jquery.min.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script src="/home/search.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<div class="am-mt-30"></div>



+ 3
- 1
templates/home.tmpl View File

@@ -1,4 +1,6 @@
{{template "base/head_home" .}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/placeholder-home.css?v={{TimeStampNow}}">
<script src="{{StaticUrlPrefix}}/js/placeholder-home.js?v={{TimeStampNow}}"></script>
<div class="ui vertical masthead secondary hometop segment" style="background:transparent;margin-bottom:0">
{{template "custom/home/home_top" .}}
</div>
@@ -160,7 +162,7 @@
-->

<!-- <div class="am-mt-30"></div> -->
<script src="/self/js/jquery.min.js" type="text/javascript"></script>
<script src="/self/js/jquery.min.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script src="/home/home.js?v={{MD5 AppVer}}" type="text/javascript"></script>




+ 2
- 2
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -26,7 +26,7 @@
<a class="active item model_benchmark"
href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
<a class="item aisafety_benchmark"
href="{{.RepoLink}}/modelsafety/create_gpu">模型安全评测</a>
href="{{.RepoLink}}/modelsafety/create_gpu">{{.i18n.Tr "modelsafety.model_security_evaluation"}}</a>
</div>
</div>
<div>
@@ -124,7 +124,7 @@
<a class="item model_benchmark"
href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
<a class="item aisafety_benchmark"
href="{{.RepoLink}}/modelsafety/create_gpu">模型安全评测</a>
href="{{.RepoLink}}/modelsafety/create_gpu">{{.i18n.Tr "modelsafety.model_security_evaluation"}}</a>
</div>
</div>



+ 1
- 1
templates/repo/cloudbrain/new.tmpl View File

@@ -185,7 +185,7 @@
<span><i class="question circle icon link"></i></span>
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
{{if .CloudBrainPaySwitch}}
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;">
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;">
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
<span style="float:right;">
<i class="question circle icon link" data-position="right center" data-variation="mini"></i>


+ 3
- 0
templates/repo/cloudbrain/show.tmpl View File

@@ -111,7 +111,9 @@
<td class="ti-text-form-content">
<div class="text-span text-span-w" id="{{.VersionName}}-code">
{{.BranchName}}
{{if not .BootFile}}
<span style="margin-left:1rem" class="ui label">{{SubStr .CommitID 0 10}}</span>
{{end}}
</div>
</td>
</tr>
@@ -376,6 +378,7 @@
{{template "base/footer" .}}
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script>
$('.menu .item').tab()
$(document).ready(function () {
$('.ui.accordion').accordion({ selector: { trigger: '.icon' } });


+ 3
- 3
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}}
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css?v={{MD5 AppVer}}" type="text/css">
<style>
.model_file_bread {
margin-bottom: -0.5rem !important;
@@ -514,8 +514,8 @@
</div>
</div>
{{template "base/footer" .}}
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js?v={{MD5 AppVer}}"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>

<script>


+ 1
- 1
templates/repo/datasets/dirs/dir_list.tmpl View File

@@ -27,7 +27,7 @@
<table id="dataset-files-table" class="ui single line table">
</table>
<script src="{{StaticUrlPrefix}}/self/test.js"></script>
<script src="{{StaticUrlPrefix}}/self/test.js?v={{MD5 AppVer}}"></script>


<script type="text/javascript">


+ 1
- 1
templates/repo/datasets/dirs/dir_preview.tmpl View File

@@ -208,5 +208,5 @@
}
}
</script>
<script src="{{StaticUrlPrefix}}/self/dataset_preview.js"></script>
<script src="{{StaticUrlPrefix}}/self/dataset_preview.js?v={{MD5 AppVer}}"></script>
{{end}}

+ 1
- 1
templates/repo/datasets/label/index.tmpl View File

@@ -215,7 +215,7 @@



<script src="/self/labelTaskPage.js"></script>
<script src="/self/labelTaskPage.js?v={{MD5 AppVer}}"></script>

{{template "base/footer" .}}

+ 1
- 0
templates/repo/debugjob/index.tmpl View File

@@ -152,6 +152,7 @@
<div class="item" data-value="all">{{$.i18n.Tr "repo.gpu_type_all"}}</div>
<div class="item" data-value="CPU/GPU">CPU/GPU</div>
<div class="item" data-value="NPU">NPU</div>
<div class="item" data-value="GCU">GCU</div>
</div>
</div>
{{if .Permission.CanWrite $.UnitTypeCloudBrain}}


+ 161
- 0
templates/repo/grampus/notebook/gcu/new.tmpl View File

@@ -0,0 +1,161 @@
{{template "base/head" .}}
{{template "custom/global_mask" .}}
<div class="repository">
{{template "repo/header" .}}
<div class="ui container">
<div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-flag-model="true"></div>
{{if eq .NotStopTaskCount 0}}
{{template "base/alert" .}}
{{end}}
<div class="ui negative message" id="messageInfo" style="display: none;">
<p></p>
</div>
<h4 class="ui top attached header">
{{.i18n.Tr "repo.modelarts.train_job.new_debug"}}
</h4>
{{template "custom/alert_cb" .}}
<div class="ui attached segment">
<form class="ui form" id="form_id" action="{{.Link}}" method="post">
<input type="hidden" name="type" value="2">
<input type="hidden" name="image" value="">
{{.CsrfTokenHtml}}
<h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4>
<div class="required min_title inline field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label>
<div class="ui blue mini menu compact selectcloudbrain">
<a class="item" href="{{.RepoLink}}/cloudbrain/create">
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
{{.i18n.Tr "cloudbrain.resource_cluster_openi"}}
</a>
<a class="active item" href="{{.RepoLink}}/grampus/notebook/create?type=1">
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg>
{{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta)
</a>
</div>
</div>
<div class="inline required field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label>
<div class="ui blue small menu compact selectcloudbrain">
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=0">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/>
</svg>
CPU/GPU</a>
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=1">
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/>
</svg>
Ascend NPU</a>
<a class="active item" href="{{.RepoLink}}/grampus/notebook/create?type=2">
<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>
GCU</a>
</div>
</div>
<div class="inline field">
<label class="label-fix-width" style="font-weight: normal;"></label>
{{template "custom/task_wait_count" .}}
<div style="display: flex;align-items: center;margin-left: 156px;margin-top: 0.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_debug_gpu_tooltips1" "/code" "/dataset" "/pretrainmodel" | Safe}}</span>
</div>
</div>
<div class="inline min_title required field" style="margin-bottom: 0rem !important;">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_name"}}</label>
<input name="display_job_name" id="cloudbrain_job_name" placeholder="任务名称" style="width: 60%;" value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="36" onkeyup="this.value=this.value.replace(/[, ]/g,'')">
</div>
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span>
<div class="inline min_title field">
<label class="label-fix-width" style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label>
{{if .description}}
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}>{{.description}}</textarea>
{{else}}
<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>
{{end}}
</div>
<div class="ui divider"></div>
<div class="inline min_title required field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label>
<select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version"
name="branch_name">
{{if .branch_name}}
<option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option>
{{range $k, $v :=.Branches}}
{{ 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>
{{template "custom/select_model" .}}
<div class="inline min_title required field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.mirror"}}</label>
<select class="ui search dropdown cloudbrain_image width48" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" style='width:385px' name="image_id">
{{range .images}}
<option name="image_id" value="{{.ID}}">{{.Name}}</option>
{{end}}
</select>
</div>
<div id="select-multi-dataset">

</div>
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span>
<div class="inline min_title required field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.specification"}}</label>
<select id="__specs__" class="ui search dropdown width48" ovalue="{{.spec_id}}"
{{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="spec_id"></select>
<span><i class="question circle icon link"></i></span>
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
{{if .CloudBrainPaySwitch}}
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;">
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
<span style="float:right;">
<i class="question circle icon link" data-position="right center" data-variation="mini"></i>
<a href="{{AppSubUrl}}/reward/point/rule" target="_blank">{{$.i18n.Tr "points.points_acquisition_instructions"}}</a>
</span>
</div>
{{end}}
</div>
<div class="inline field">
<label class="label-fix-width" style="font-weight: normal;"></label>
<button class="ui create_train_job green button {{if eq .NotStopTaskCount 1}}disabled{{end}}">
{{.i18n.Tr "repo.cloudbrain.new"}}
</button>
<a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a>
</div>
</form>
</div>
</div>
</div>
{{template "base/footer" .}}
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script>
;(function() {
var SPECS = {{ .Specs }};
var showPoint = {{ .CloudBrainPaySwitch }};
window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, {
gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}},
free: {{$.i18n.Tr "cloudbrain.free"}},
point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}},
memory: {{$.i18n.Tr "cloudbrain.memory"}},
shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
});
})();
</script>

+ 10
- 2
templates/repo/grampus/notebook/gpu/new.tmpl View File

@@ -54,6 +54,14 @@
d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z" />
</svg>
Ascend NPU</a>
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=2">
<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>
GCU</a>
</div>
</div>
<div class="min_title inline field">
@@ -119,7 +127,7 @@
<span><i class="question circle icon link"></i></span>
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
{{if .CloudBrainPaySwitch}}
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;">
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;">
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
<span style="float:right;">
<i class="question circle icon link" data-position="right center" data-variation="mini"></i>
@@ -147,7 +155,7 @@
{{template "base/footer" .}}
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script>
<script>
;(function() {
var SPECS = {{ .Specs }};
var showPoint = {{ .CloudBrainPaySwitch }};


+ 8
- 2
templates/repo/grampus/notebook/npu/new.tmpl View File

@@ -48,6 +48,12 @@
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/>
</svg>
Ascend NPU</a>
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=2">
<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>
GCU</a>
</div>
</div>
<div class="inline field">
@@ -124,7 +130,7 @@
<span><i class="question circle icon link"></i></span>
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
{{if .CloudBrainPaySwitch}}
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;">
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;">
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
<span style="float:right;">
<i class="question circle icon link" data-position="right center" data-variation="mini"></i>
@@ -149,7 +155,7 @@
{{template "base/footer" .}}
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script src="{{StaticUrlPrefix}}/js/cloudbrainNew.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script>
<script>
;(function() {
var SPECS = {{ .Specs }};
var showPoint = {{ .CloudBrainPaySwitch }};


+ 3
- 3
templates/repo/grampus/trainjob/show.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}}
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css?v={{MD5 AppVer}}" type="text/css">
<style>
.model_file_bread {
margin-bottom: -0.5rem !important;
@@ -553,8 +553,8 @@

</div>
{{template "base/footer" .}}
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js?v={{MD5 AppVer}}"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>
<script>
;(function() {


+ 11
- 11
templates/repo/header.tmpl View File

@@ -225,14 +225,14 @@


<script src="{{StaticUrlPrefix}}/js/jquery.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/es5-shim.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/marked.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/purify.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/ansi_up.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/prism.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/katex.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/katex-auto-render.min.js"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/notebook.min.js"></script>
<link rel="stylesheet" href="{{StaticUrlPrefix}}/self/css/notebook/katex.min.css" />
<link rel="stylesheet" href="{{StaticUrlPrefix}}/self/css/notebook/prism.css" />
<link rel="stylesheet" href="{{StaticUrlPrefix}}/self/css/notebook/notebook.css" />
<script src="{{StaticUrlPrefix}}/self/js/notebook/es5-shim.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/marked.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/purify.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/ansi_up.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/prism.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/katex.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/katex-auto-render.min.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/self/js/notebook/notebook.min.js?v={{MD5 AppVer}}"></script>
<link rel="stylesheet" href="{{StaticUrlPrefix}}/self/css/notebook/katex.min.css?v={{MD5 AppVer}}" />
<link rel="stylesheet" href="{{StaticUrlPrefix}}/self/css/notebook/prism.css?v={{MD5 AppVer}}" />
<link rel="stylesheet" href="{{StaticUrlPrefix}}/self/css/notebook/notebook.css?v={{MD5 AppVer}}" />

+ 5
- 5
templates/repo/home.tmpl View File

@@ -311,7 +311,7 @@
<div class="ui six wide tablet four wide computer column">
<div id="repo-desc" data-IsAdmin="{{.Permission.IsAdmin}}"
data-IsArchived="{{.Repository.IsArchived}}">
<h4 id="about-desc" class="ui header">简介</h4>
<h4 id="about-desc" class="ui header"></h4>
<input type="hidden" id="edit-alias" value="{{.Repository.Alias}}">
<p>
{{if .Repository.DescriptionHTML}}
@@ -363,15 +363,15 @@
<h4 class="ui header">
{{$lenCon := len .ContributorInfo}}
{{if lt $lenCon 25 }}
<strong>贡献者 ({{len .ContributorInfo}})</strong>
<strong>{{.i18n.Tr "home.contributors"}} ({{len .ContributorInfo}})</strong>
{{else}}
<strong>贡献者 ({{len .ContributorInfo}}+)</strong>
<strong>{{.i18n.Tr "home.contributors"}} ({{len .ContributorInfo}}+)</strong>
{{end}}

<div class="ui right">
<!-- <a class="membersmore text grey" href="{{.RepoLink}}/contributors">全部 {{svg "octicon-chevron-right" 16}}</a> -->
<!-- <a class="membersmore text grey" href="{{.RepoLink}}/contributors">{{.i18n.Tr "repo.computing.all"}} {{svg "octicon-chevron-right" 16}}</a> -->
<a class="membersmore text grey"
href="{{.RepoLink}}/contributors?type={{if .IsViewBranch}}branch{{else}}tag{{end}}&name={{.BranchName}}">全部
href="{{.RepoLink}}/contributors?type={{if .IsViewBranch}}branch{{else}}tag{{end}}&name={{.BranchName}}">{{.i18n.Tr "repo.computing.all"}}
{{svg "octicon-chevron-right" 16}}</a>
</div>
</h4>


+ 1
- 1
templates/repo/issue/view_content/pull.tmpl View File

@@ -448,7 +448,7 @@
</div>
</div>

<!-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script> -->
<!-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js?v={{MD5 AppVer}}"></script> -->
<!-- <script>

$(document)


+ 1
- 1
templates/repo/modelarts/notebook/new.tmpl View File

@@ -107,7 +107,7 @@
<span><i class="question circle icon link"></i></span>
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a>
{{if .CloudBrainPaySwitch}}
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:265px;font-size:12px;width: 50%!important;">
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;">
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span>
<span style="float:right;">
<i class="question circle icon link" data-position="right center" data-variation="mini"></i>


+ 2
- 1
templates/repo/modelarts/trainjob/para_manage.tmpl View File

@@ -107,6 +107,7 @@

<script>
// 删除时用户确认
var lang_canceled_operation = {{.i18n.Tr "repo.canceled_operation"}};
function assertDelete(obj) {
if (obj.style.color == "rgb(204, 204, 204)") {
return
@@ -124,7 +125,7 @@
},
onHidden: function() {
if (flag == false) {
$('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
$('.alert').html(lang_canceled_operation).removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
}
}
})


+ 3
- 3
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}}
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css?v={{MD5 AppVer}}" type="text/css">
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>

<style>
@@ -574,8 +574,8 @@
</div>
{{template "base/footer" .}}

<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js?v={{MD5 AppVer}}"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js?v={{MD5 AppVer}}"></script>
<script>
var setting = {
check: {


+ 9
- 4
templates/repo/modelmanage/convertshowinfo.tmpl View File

@@ -501,6 +501,11 @@ td, th {
let downlaodFlag = {{$.canDownload}}
let taskID = {{$.task.ID}}
let realJobName = {{$.task.ID}}
let lang_scrolled_logs_top = {{$.i18n.Tr "repo.scrolled_logs_top"}};
let lang_scrolled_logs_top_pls_retry = {{$.i18n.Tr "repo.scrolled_logs_top_pls_retry"}};
let lang_scrolled_logs_bottom = {{$.i18n.Tr "repo.scrolled_logs_bottom"}};
let lang_scrolled_logs_bottom_pls_retry = {{$.i18n.Tr "repo.scrolled_logs_bottom_pls_retry"}};

$(document).ready(function(){
let url = window.location.href;
let urlArr = url.split('/')
@@ -746,7 +751,7 @@ td, th {
let end_line = $(`#log_npu input[name=end_line]`).val()
$.get(`/api/v1/repos/${userName}/${repoPath}/modelmanage/${taskID}/modelartlog?version_name=V0001&base_line=${end_line}&lines=50&order=desc`, (data) => {
if (data.Lines == 0){
$(`#log_npu_header`).text('您已翻阅至日志底部')
$(`#log_npu_header`).text(lang_scrolled_logs_bottom)
$(`#log_npu_message`).css('display', 'block')
setTimeout(function(){
$(`#log_npu_message`).css('display', 'none')
@@ -769,7 +774,7 @@ td, th {
let start_line = $(`#log_npu input[name=start_line]`).val()
$.get(`/api/v1/repos/${userName}/${repoPath}/modelmanage/${taskID}/modelartlog?version_name=V0001&base_line=${start_line}&lines=50&order=asc`, (data) => {
if (data.Lines == 0){
$(`#log_npu_header`).text('您已翻阅至日志顶部')
$(`#log_npu_header`).text(lang_scrolled_logs_top)
$(`#log_npu_message`).css('display', 'block')
setTimeout(function(){
$(`#log_npu_message`).css('display', 'none')
@@ -812,7 +817,7 @@ td, th {
$(`#log_npu input[name=end_line]`).val(data.EndLine) //如果变动就改变所对应的值
$(`#log_npu input[name=start_line]`).val(data.StartLine)
$(`#log_npu`).prepend('<pre>' + data.Content)
$(`#log_npu_header`).text('您已翻阅至日志顶部')
$(`#log_npu_header`).text(lang_scrolled_logs_top)
$(`#log_npu_message`).css('display', 'block')
setTimeout(function(){
$(`#log_npu_message`).css('display', 'none')
@@ -832,7 +837,7 @@ td, th {
$(`#log_npu`).append('<pre>' + data.Content)
$.get(`/api/v1/repos/${userName}/${repoPath}/modelmanage/${taskID}/modelartlog?version_name=V0001&base_line=${data.EndLine}&lines=50&order=desc`, (data) => {
if (data.Lines == 0){
$(`#log_npu_header`).text('您已翻阅至日志底部')
$(`#log_npu_header`).text(lang_scrolled_logs_bottom)
$(`#log_npu_message`).css('display', 'block')
setTimeout(function(){
$(`#log_npu_message`).css('display', 'none')


+ 3
- 3
templates/repo/modelmanage/create_online.tmpl View File

@@ -1,5 +1,5 @@
{{template "base/head" .}}
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css?v={{MD5 AppVer}}" type="text/css">
<style>
#newmodel .header {
height: 45px;
@@ -180,8 +180,8 @@
</div>
</div>
{{template "base/footer" .}}
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js?v={{MD5 AppVer}}"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js?v={{MD5 AppVer}}"></script>
<script>
;(function() {
var setting = {


+ 3
- 3
templates/repo/modelmanage/index.tmpl View File

@@ -43,7 +43,7 @@
color: #fff;
}
</style>
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="/self/ztree/css/zTreeStyle/zTreeStyle.css?v={{MD5 AppVer}}" type="text/css">
<script>var REPO_IS_PRIVATE = {{.Repository.IsPrivate}};</script>

<!-- 弹窗 -->
@@ -266,8 +266,8 @@

{{template "base/footer" .}}

<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js?v={{MD5 AppVer}}"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js?v={{MD5 AppVer}}"></script>
<script type="text/javascript">
var setting = {


+ 46
- 4
templates/user/auth/signin.tmpl View File

@@ -1,9 +1,51 @@
{{template "base/head" .}}
<style>
@media only screen and (max-width: 1200px) {
._container {
display:block !important;
}
._left-img-area {
display: none;
}
._right_content_area {
}
._right_content_area .segment {
margin-left: auto !important;
border-top-left-radius: .28571429rem !important;
border-bottom-left-radius: .28571429rem !important;
border-left: border: 1px solid rgba(34,36,38,.15) !important;
}
}
</style>
<script>
var ActivityTpl = {{ .ActivityTpl }};
</script>
<div class="user signin{{if .LinkAccountMode}} icon{{end}}">
{{template "user/auth/signin_navbar" .}}
<div class="ui container">
<div class="ui raised very padded text container segment">
{{template "user/auth/signin_inner" .}}
<div class="ui container" style="margin-top:60px;">
<div class="_container" style="display:flex;justify-content:center;">
<div class="_left-img-area" style="padding-right:0;flex:2">
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0;
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden;
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);">
{{ if .ActivityTpl }}
{{ .ActivityTpl | Safe}}
{{ else }}
{{ template "user/auth/signin_up_img_default" .}}
{{ end }}
</div>
</div>
<div class="_right_content_area" style="padding-left:0;flex:3;">
<div class="ui raised very padded text container segment" style="margin-left:0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none !important;
">
{{template "user/auth/signin_navbar" .}}
{{template "user/auth/signin_inner" .}}
</div>
</div>
</div>
</div>
</div>


+ 43
- 4
templates/user/auth/signin_cloud_brain.tmpl View File

@@ -1,9 +1,48 @@
{{template "base/head" .}}
<style>
@media only screen and (max-width: 1200px) {
._container {
display:block !important;
}
._left-img-area {
display: none;
}
._right_content_area {
}
._right_content_area .segment {
margin-left: auto !important;
border-top-left-radius: .28571429rem !important;
border-bottom-left-radius: .28571429rem !important;
border-left: border: 1px solid rgba(34,36,38,.15) !important;
}
}
</style>
<div class="user signin">
{{template "user/auth/signin_navbar" .}}
<div class="ui container">
<div class="ui raised very padded text container segment">
{{template "user/auth/signin_cloudbrain" .}}
<div class="ui container" style="margin-top:60px;">
<div class="_container" style="display:flex;justify-content:center;">
<div class="_left-img-area" style="padding-right:0;flex:2">
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0;
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden;
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);">
{{ if .ActivityTpl }}
{{ .ActivityTpl | Safe}}
{{ else }}
{{ template "user/auth/signin_up_img_default" .}}
{{ end }}
</div>
</div>
<div class="_right_content_area" style="padding-left:0;flex:3;">
<div class="ui raised very padded text container segment" style="margin-left:0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none !important;
">
{{template "user/auth/signin_navbar" .}}
{{template "user/auth/signin_cloudbrain" .}}
</div>
</div>
</div>
</div>
</div>


+ 1
- 1
templates/user/auth/signin_navbar.tmpl View File

@@ -1,5 +1,5 @@
{{if or .EnablePhone .EnableOpenIDSignIn .EnableSSPI .EnableCloudBrain}}
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar" style="margin-bottom:45px !important;background-color:transparent !important;">
{{if .EnablePhone }}
<a class="{{if .PageIsPhoneLogin}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/login/phone">
{{.i18n.Tr "phone.mobile_login"}}


+ 97
- 59
templates/user/auth/signin_phone.tmpl View File

@@ -1,73 +1,111 @@
{{template "base/head" .}}
<style>
@media only screen and (max-width: 1200px) {
._container {
display:block !important;
}
._left-img-area {
display: none;
}
._right_content_area {
}
._right_content_area .segment {
margin-left: auto !important;
border-top-left-radius: .28571429rem !important;
border-bottom-left-radius: .28571429rem !important;
border-left: border: 1px solid rgba(34,36,38,.15) !important;
}
}
</style>
<div class="user signin">
{{template "user/auth/signin_navbar" .}}
<div class="ui container">
<div class="ui raised very padded text container segment">
<style>
.full.height{background-color: #F9F9F9;}
.ui.left:not(.action){ float:none;}
.ui.left{ float:none;}
.ui.secondary.pointing.menu{ border-bottom:none;}
</style>
{{template "base/alert" .}}
<div class="ui negative message" style="display:none;">
<p></p>
</div>
<div class="ui centered grid">
<div class="sixteen wide mobile ten wide tablet ten wide computer column">
<div class="ui bottom aligned two column grid">
<div class="column">
<h2 class="ui header">
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signin_title"}}
{{else}}
{{.i18n.Tr "auth.login_userpass"}}
{{end}}
</h2>
</div>
{{if .ShowRegistrationButton}}
<div class="ui right floated column">
<a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
</div>
{{end}}
<div class="ui container" style="margin-top:60px;">
<div class="_container" style="display:flex;justify-content:center;">
<div class="_left-img-area" style="padding-right:0;flex:2">
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0;
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden;
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);">
{{ if .ActivityTpl }}
{{ .ActivityTpl | Safe}}
{{ else }}
{{ template "user/auth/signin_up_img_default" .}}
{{ end }}
</div>
<div class="ui grid">
<div class="column">
<form class="ui form" action="/user/login/phone" method="post">
{{.CsrfTokenHtml}}

{{if .EnablePhone }}
<div class="use-type" usetype="1" autofocus="true">
{{template "user/auth/phone_verify" .}}
</div>
{{end}}

<div class="two fields inline">
<div class="field">
<div class="ui checkbox">
<label>{{.i18n.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
<div class="_right_content_area" style="padding-left:0;flex:3;">
<div class="ui raised very padded text container segment" style="margin-left:0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none !important;
">
<style>
.full.height{background-color: #F9F9F9;}
.ui.left:not(.action){ float:none;}
.ui.left{ float:none;}
.ui.secondary.pointing.menu{ border-bottom:none;}
</style>
{{template "user/auth/signin_navbar" .}}
{{template "base/alert" .}}
<div class="ui negative message" style="display:none;">
<p></p>
</div>
<div class="ui centered grid">
<div class="sixteen wide mobile ten wide tablet ten wide computer column">
<div class="ui bottom aligned two column grid">
<div class="column">
<h2 class="ui header">
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signin_title"}}
{{else}}
{{.i18n.Tr "auth.login_userpass"}}
{{end}}
</h2>
</div>
{{if .ShowRegistrationButton}}
<div class="ui right floated column">
<a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
</div>
{{end}}
</div>
<div class="field" style="padding-right: 0; text-align: right;">
<a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a>
</div>
</div>
<div class="ui grid">
<div class="column">
<form class="ui form" action="/user/login/phone" method="post">
{{.CsrfTokenHtml}}

{{if .EnablePhone }}
<div class="use-type" usetype="1" autofocus="true">
{{template "user/auth/phone_verify" .}}
</div>
{{end}}

<div class="ui hidden divider"></div>
<div class="two fields inline">
<div class="field">
<div class="ui checkbox">
<label>{{.i18n.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
</div>
<div class="field" style="padding-right: 0; text-align: right;">
<a href="{{AppSubUrl}}/user/forgot_password?type=phone">{{.i18n.Tr "auth.forgot_password"}}</a>
</div>
</div>

<div class="center aligned field">
<button class="fluid large ui blue button">
{{.i18n.Tr "sign_in"}}
</button>
<div class="ui hidden divider"></div>

<div class="center aligned field">
<button class="fluid large ui blue button">
{{.i18n.Tr "sign_in"}}
</button>
</div>
</form>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

</div>
</div>
</div>
</div>
{{template "base/footer" .}}

+ 45
- 0
templates/user/auth/signin_up_img_default.tmpl View File

@@ -0,0 +1,45 @@
<div style="width:100%;height:100%;
border-radius: 0.28571429rem;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 40px;
background: url('/img/login_bg_default.png') center center no-repeat;
background-size: cover;
border-right:none !important;
">
<div style="margin: 14px 0;">
<span style="font-weight:500;font-size:28px;color:rgb(0, 122, 255);">{{.i18n.Tr "auth.openi_community_really_awesome"}}</span>
</div>
<div style="margin: 14px 0;">
<span style="font-weight:300;font-size:14px;color:rgb(140, 162, 170);">{{.i18n.Tr "home.page_description"}}</span>
</div>
<div style="margin: 14px 0;">
<div style="width:111px">
<a href="https://openi.pcl.ac.cn/zeizei/OpenI_Learning">
<div style="
width: 111px;
height: 40px;
font-size: 14px;
border-color: rgb(0, 122, 255);
border-width: 1px;
border-style: solid;
color: rgb(0, 122, 255);
display:flex;
align-items: center;
justify-content: center;
">
<svg xmlns="http://www.w3.org/2000/svg" style="margin-right:8px;margin-top:-2px;" class="styles__StyledSVGIconPathComponent-sc-16fsqc8-0 fPsHiw svg-icon-path-icon fill" viewBox="0 0 32 32" width="16" height="16"><defs data-reactroot=""></defs><g><path fill="rgb(0, 122, 255)" d="M2.667 5.324c0.005-0.729 0.594-1.318 1.322-1.324h24.022c0.731 0 1.323 0.593 1.323 1.324v21.352c-0.005 0.729-0.594 1.318-1.322 1.324h-24.022c-0.731-0.001-1.323-0.593-1.323-1.324v0-21.352zM14.667 6.667h-9.333v18.667h9.333v-18.667zM17.333 6.667v18.667h9.333v-18.667h-9.333zM18.667 9.333h6.667v2.667h-6.667v-2.667zM18.667 13.333h6.667v2.667h-6.667v-2.667z"></path></g></svg>
<span>{{.i18n.Tr "custom.Platform_Tutorial"}}</span>
</div>
</a>
</div>
</div>
</div>



+ 141
- 102
templates/user/auth/signup_inner.tmpl View File

@@ -1,112 +1,151 @@
<style>
.full.height{background-color: #F9F9F9;}
</style>

<div class="ui container very padded {{if .LinkAccountMode}} icon{{end}}" style=" padding-top: 5.0rem; padding-bottom: 3.0rem;">
<div class="ui raised very padded text container segment">
<div class="ui centered grid">
<div class="sixteen wide mobile ten wide tablet ten wide computer column">
<div class="ui bottom aligned two column grid">
<div class="column">
<h2 class="ui header">
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signup_title"}}
{{else}}
{{.i18n.Tr "sign_up"}}
{{end}}
</h2>
</div>
{{if not .LinkAccountMode}}
<div class="ui right floated column">
<a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a>
</div>
{{end}}
</div>
<div class="ui grid">
<div class="column">
<form class="ui form" action="{{.SignUpLink}}" method="post">
{{.CsrfTokenHtml}}
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
{{template "base/alert" .}}
{{end}}
<div class="ui negative message" style="display:none;">
<p></p>
</div>
{{if .DisableRegistration}}
<p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
{{else}}
<div class="field invitation_tips" style="font-weight:400;font-size:14px;color:rgba(250,140,22,1);{{if not .invitationCode}}display:none;{{end}}">
<span>{{.i18n.Tr "your_friend"}} <span class="__invitation_code__">{{.invitationCode}}</span> {{.i18n.Tr "invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources"}}</span>
</div>
<div class="field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
<input id="user_name" name="user_name" value="{{.user_name}}" placeholder="{{.i18n.Tr "username"}}" autofocus required>
</div>
<div class="field {{if .Err_Email}}error{{end}}">
<input id="email" name="email" type="email" value="{{.email}}" placeholder="{{.i18n.Tr "email"}}" required>
</div>

{{if not .DisablePassword}}
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
<input id="password" name="password" type="password" value="{{.password}}" placeholder="{{.i18n.Tr "password"}}" autocomplete="off" required>
</div>
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
<input id="retype" name="retype" type="password" value="{{.retype}}" placeholder="{{.i18n.Tr "re_type"}}" autocomplete="off" required>
</div>
{{end}}
{{if and .EnableCaptcha (eq .CaptchaType "image")}}
<div class="field">
{{.Captcha.CreateHtml}}
</div>
<div class="field {{if .Err_Captcha}}error{{end}}">
<input id="captcha" name="captcha" value="{{.captcha}}" placeholder="{{.i18n.Tr "captcha"}}" autocomplete="off">
</div>
{{end}}
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
<div class="field required">
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div>
</div>
<style>
@media only screen and (max-width: 1200px) {
._container {
display:block !important;
}
._left-img-area {
display: none;
}
._right_content_area {
}
._right_content_area .segment {
margin-left: auto !important;
border-top-left-radius: .28571429rem !important;
border-bottom-left-radius: .28571429rem !important;
border-left: border: 1px solid rgba(34,36,38,.15) !important;
}
}
</style>
<div class="ui container very padded {{if .LinkAccountMode}} icon{{end}}" style=" padding-top: 5.0rem; padding-bottom: 3.0rem;">
<div class="_container" style="display:flex;justify-content:center;">
<div class="_left-img-area" style="padding-right:0;flex:2">
<div style="width:450px;height:100%;float:right;border-radius:0.28571429rem;border-top-right-radius: 0;
border-bottom-right-radius: 0;border-right:none !important;overflow: hidden;
-webkit-box-shadow: 0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);
box-shadow: 0 2px 4px 0rgba(34,36,38,.12),0 2px 10px 0rgba(34,36,38,.15);">
{{ if .ActivityTpl }}
{{ .ActivityTpl | Safe}}
{{ else }}
{{ template "user/auth/signin_up_img_default" .}}
{{ end }}
</div>
</div>
<div class="_right_content_area" style="padding-left:0;flex:3;">
<div class="ui raised very padded text container segment" style="margin-left:0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none !important;
">
<div class="ui centered grid">
<div class="sixteen wide mobile ten wide tablet ten wide computer column">
<div class="ui bottom aligned two column grid">
<div class="column">
<h2 class="ui header">
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signup_title"}}
{{else}}
{{.i18n.Tr "sign_up"}}
{{end}}
{{if .EnablePhone }}
<div class="use-type" usetype="0">
{{template "user/auth/phone_verify" .}}
</h2>
</div>
{{if not .LinkAccountMode}}
<div class="ui right floated column">
<a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a>
</div>
{{end}}
</div>
<div class="ui grid">
<div class="column">
<form class="ui form" action="{{.SignUpLink}}" method="post">
{{.CsrfTokenHtml}}
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
{{template "base/alert" .}}
{{end}}
<div class="ui negative message" style="display:none;">
<p></p>
</div>
{{end}}
<div class="field">
<div style="display:flex;">
<div style="display:flex;align-items:center;">
<span>{{.i18n.Tr "recommender"}}</span>
{{if .DisableRegistration}}
<p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
{{else}}
<div class="field invitation_tips" style="font-weight:400;font-size:14px;color:rgba(250,140,22,1);{{if not .invitationCode}}display:none;{{end}}">
<span>{{.i18n.Tr "your_friend"}} <span class="__invitation_code__">{{.invitationCode}}</span> {{.i18n.Tr "invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources"}}</span>
</div>
<div class="field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
<input id="user_name" name="user_name" value="{{.user_name}}" placeholder="{{.i18n.Tr "username"}}" autofocus required>
</div>
<div class="field {{if .Err_Email}}error{{end}}">
<input id="email" name="email" type="email" value="{{.email}}" placeholder="{{.i18n.Tr "email"}}" required>
</div>
<input style="flex:1;margin-left:12px;" id="invitation_code" name="invitation_code" value="{{.invitationCode}}" {{if .invitationCode}}readonly="true"{{end}} autocomplete="off" />
</div>
</div>

<div class="field">
<div class="ui checkbox">
<input name="agree" type="checkbox" tabindex="0" class="hidden" {{if .agree}}checked{{end}}><label>{{.i18n.Tr "use_and_privacy_agree" "/home/term" "/home/privacy" | Safe}}</label>
</div>
</div>
<div class="ui hidden divider"></div>
<div class="center aligned field">
<button class="fluid large ui blue button">
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signup_submit"}}
{{else}}
{{.i18n.Tr "auth.create_new_account"}}
{{if not .DisablePassword}}
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
<input id="password" name="password" type="password" value="{{.password}}" placeholder="{{.i18n.Tr "password"}}" autocomplete="off" required>
</div>
<div class="field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
<input id="retype" name="retype" type="password" value="{{.retype}}" placeholder="{{.i18n.Tr "re_type"}}" autocomplete="off" required>
</div>
{{end}}
</button>
</div>
{{end}}
</form>
</div>
{{if and .EnableCaptcha (eq .CaptchaType "image")}}
<div class="field">
{{.Captcha.CreateHtml}}
</div>
<div class="field {{if .Err_Captcha}}error{{end}}">
<input id="captcha" name="captcha" value="{{.captcha}}" placeholder="{{.i18n.Tr "captcha"}}" autocomplete="off">
</div>
{{end}}
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
<div class="field required">
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div>
</div>
{{end}}
{{if .EnablePhone }}
<div class="use-type" usetype="0">
{{template "user/auth/phone_verify" .}}
</div>
{{end}}
<div class="field">
<div style="display:flex;">
<div style="display:flex;align-items:center;">
<span>{{.i18n.Tr "recommender"}}</span>
</div>
<input style="flex:1;margin-left:12px;" id="invitation_code" name="invitation_code" value="{{.invitationCode}}" {{if .invitationCode}}readonly="true"{{end}} autocomplete="off" />
</div>
</div>

<div class="field">
<div class="ui checkbox">
<input name="agree" type="checkbox" tabindex="0" class="hidden" {{if .agree}}checked{{end}}><label>{{.i18n.Tr "use_and_privacy_agree" "/home/term" "/home/privacy" | Safe}}</label>
</div>
</div>
<div class="ui hidden divider"></div>
<div class="center aligned field">
<button class="fluid large ui blue button">
{{if .LinkAccountMode}}
{{.i18n.Tr "auth.oauth_signup_submit"}}
{{else}}
{{.i18n.Tr "auth.create_new_account"}}
{{end}}
</button>
</div>
{{end}}
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<script>
; (function() {
var getUrlParams = function() {
@@ -124,11 +163,11 @@
return obj;
};
var sharedUser = getUrlParams()['sharedUser'];
if (sharedUser) {
setTimeout(function() {
$('.invitation_tips').show().find('.__invitation_code__').text(sharedUser);
$('input#invitation_code').val(sharedUser).attr('readonly', true);
}, 20);
if (sharedUser) {
document.querySelector('.invitation_tips').style.display = "block";
document.querySelector('.__invitation_code__').innerText = sharedUser;
document.querySelector('#invitation_code').value = sharedUser;
document.querySelector('#invitation_code').setAttribute("readonly", "true");
}
})();
</script>

+ 5
- 5
templates/user/dashboard/cloudbrains.tmpl View File

@@ -71,7 +71,7 @@
<div class="row">
<!-- 任务名 -->
{{$JobID := '0'}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "MODELSAFETY"}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "MODELSAFETY" "SNN4ECOSET"}}
{{$JobID = .Cloudbrain.ID}}
{{else}}
{{$JobID = .JobID}}
@@ -85,7 +85,7 @@
<span class="fitted"
style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span>
</a>
{{else if (eq .JobType "SNN4IMAGENET" "BRAINSCORE")}}
{{else if (eq .JobType "SNN4IMAGENET" "BRAINSCORE" "SNN4ECOSET")}}
<a class="title"
href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/benchmark/{{$JobID}}"
title="{{.DisplayJobName}}" style="font-size: 14px;padding-right:0px">
@@ -224,7 +224,7 @@
</a>
</form>
{{else}}
{{if eq .JobType "DEBUG" "BENCHMARK" "SNN4IMAGENET" "BRAINSCORE"}}
{{if eq .JobType "DEBUG" "BENCHMARK" "SNN4IMAGENET" "BRAINSCORE" "SNN4ECOSET"}}
<form id="stopForm-{{$JobID}}" style="margin-left:-1px;">
{{$.CsrfTokenHtml}}
<a style="padding: 0.5rem 1rem;" id="ai-stop-{{$JobID}}"
@@ -274,7 +274,7 @@
</form>
{{else}}
<form class="ui compact buttons" id="delForm-{{$JobID}}"
action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?ishomepage=true'
action='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "BENCHMARK"}}/cloudbrain/benchmark{{else if or (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE") (eq .JobType "SNN4ECOSET")}}/cloudbrain{{else if eq .JobType "DEBUG"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "TRAIN"}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{end}}{{end}}/{{$JobID}}/del?ishomepage=true'
method="post">
{{$.CsrfTokenHtml}}
<a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{$JobID}}"
@@ -290,7 +290,7 @@
</div>
{{else}}
{{$JobID := '0'}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK"}}
{{if eq .JobType "DEBUG" "SNN4IMAGENET" "BRAINSCORE" "BENCHMARK" "SNN4ECOSET"}}
{{$JobID = .Cloudbrain.ID}}
{{else}}
{{$JobID = .JobID}}


+ 9
- 1
templates/user/dashboard/feeds.tmpl View File

@@ -75,7 +75,7 @@
{{else if eq .GetOpType 25}}
{{$.i18n.Tr "action.task_gpudebugjob" .GetRepoLink .Content .RefName | Str2html}}
{{else if eq .GetOpType 26}}
{{$.i18n.Tr "action.task_npudebugjob" .GetRepoLink .Content .RefName | Str2html}}
{{$.i18n.Tr "action.task_npudebugjob" .GetRepoLink .Content .RefName | Str2html}}
{{else if eq .GetOpType 27}}
{{$.i18n.Tr "action.task_nputrainjob" .GetRepoLink .Content .RefName | Str2html}}
{{else if eq .GetOpType 28}}
@@ -96,6 +96,8 @@
{{$.i18n.Tr "action.task_c2net_npudebugjob" .GetRepoLink .Content .RefName | Str2html}}
{{else if eq .GetOpType 40}}
{{$.i18n.Tr "action.task_c2net_gpudebugjob" .GetRepoLink .Content .RefName | Str2html}}
{{else if eq .GetOpType 41}}
{{$.i18n.Tr "action.task_c2ent_gcudebugjob" .GetRepoLink .Content .RefName | Str2html}}
{{end}}
</p>
{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}
@@ -133,6 +135,12 @@
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span>
{{else if eq .GetOpType 26}}
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span>
{{else if eq .GetOpType 39}}
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span>
{{else if eq .GetOpType 40}}
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span>
{{else if eq .GetOpType 41}}
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span>
{{else if eq .GetOpType 27}}
<span class="text grey"><i class="ri-character-recognition-line icon big"></i></span>
{{else if eq .GetOpType 28}}


+ 3
- 2
web_src/js/components/Contributors.vue View File

@@ -3,9 +3,9 @@
<div class="row git-user-content">
<h3 class="ui header">
<div class="ui breadcrumb">
<a class="section" :href="url_code">代码</a>
<a class="section" :href="url_code">{{$i18n['code']}}</a>
<div class="divider"> / </div>
<div class="active section" >贡献者&nbsp;({{totalNum}})</div>
<div class="active section" >{{$i18n['contributors']}}&nbsp;({{totalNum}})</div>
</div>
</h3>
<div class="ui horizontal relaxed list">
@@ -76,6 +76,7 @@ watch: {

},
created(){
this.$i18n = window.i18n;
const url = window.location.pathname;
this.url = url;
let strIndex = this.url.indexOf("contributors")


+ 8
- 7
web_src/js/components/EditAboutInfo.vue View File

@@ -1,13 +1,13 @@
<template>
<div>
<h4 id="about-desc" class="ui header desc-home">简介
<h4 id="about-desc" class="ui header desc-home">{{$i18n['introduction']}}
<a class="edit-icon" v-if="IsPermit" id ="editBtn" href="javascript:void(0)" @click="editClick" >
<i class="gray edit outline icon" style="margin-right: 0;"></i>
</a>
</h4>
<edit-dialog-cmpt
:vmContext="vmContext"
dialogTitle="编辑仓库信息"
:dialogTitle="$i18n['edit_repository_information']"
v-model="editDataDialog"
:deleteCallback="editDataFunc"
:deleteLoading ="editDataListLoading"
@@ -19,11 +19,11 @@
</div>
<div slot="content">
<el-form label-position="top" :model="info" :rules="rule" ref="ruleForm">
<el-form-item label="简介" prop="desc">
<el-input v-model="info.desc" type="textarea" placeholder="请输入内容" :autosize="{minRows:4,maxRows:6}" maxlength="255" show-word-limit></el-input>
<el-form-item :label="$i18n['introduction']" prop="desc">
<el-input v-model="info.desc" type="textarea" :placeholder="$i18n['please_enter_the_content']" :autosize="{minRows:4,maxRows:6}" maxlength="255" show-word-limit></el-input>
</el-form-item>
<el-form-item label="主页" prop="index_web" >
<el-input v-model="info.index_web" placeholder="主页(eg: https://openi.pcl.ac.cn)"></el-input>
<el-form-item :label="$i18n['homePage']" prop="index_web" >
<el-input v-model="info.index_web" :placeholder="`${$i18n['homePage']}(eg: https://openi.pcl.ac.cn)`"></el-input>
</el-form-item>
</el-form>
</div>
@@ -53,8 +53,8 @@ export default {
index_web: '',
repo_name_name: '',
alias:'',
IsPermit:false
},
IsPermit: false,
// rule1:[{min:3,max:5,message:'1',trigger:"blur"}],
rule: {
index_web: [
@@ -147,6 +147,7 @@ export default {
}
},
created() {
this.$i18n = window.i18n;
this.getIsSigned();
}



+ 6
- 6
web_src/js/components/EditTopics.vue View File

@@ -3,7 +3,7 @@
<div class="input-search">
<el-input v-model="input" clearable :autofocus="true" @input="changeValue" id="topics_input" @keyup.enter.native="postTopic" placeholder="搜索或创建标签">
<el-input v-model="input" clearable :autofocus="true" @input="changeValue" id="topics_input" @keyup.enter.native="postTopic" :placeholder="$i18n['searchOrCreateTopics']">

</el-input>
<div class="scrolling-menu">
@@ -14,7 +14,7 @@
<div class="text">{{arr.topic_name.toLowerCase()}} </div>
</div>
<div v-if="showInputValue" class="addition item-text" @click="postTopic">
点击或回车添加<b class="user-add-label-text">{{input.toLowerCase()}}</b>标签
{{$i18n['clickOrEnterToAdd']}}<b class="user-add-label-text">{{input.toLowerCase()}}</b>{{$i18n['topic']}}
</div>
<div v-if="showAddTopic" class="item-text" @click="addPostTopic">
<div class="icon-wrapper">
@@ -98,7 +98,7 @@ export default {
this.Post(data,topics)
this.$set(this.showInitTopic,item,false)
if(this.arrayTopics.length===0){
$('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>')
$('#repo-topics1').append(`<span class="no-description text-italic">${this.$i18n['noTopics']}</span>`)
}else{
$('#repo-topics1').children('span').remove()
}
@@ -264,7 +264,7 @@ export default {
if(this.arrayTopics.length===0){
$('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>')
$('#repo-topics1').append(`<span class="no-description text-italic">${this.$i18n['noTopics']}</span>`)
}else{
$('#repo-topics1').children('span').remove()
}
@@ -386,12 +386,12 @@ mounted() {
});
if(this.arrayTopics.length===0){
$('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>')
$('#repo-topics1').append(`<span class="no-description text-italic">${this.$i18n['noTopics']}</span>`)
}
this.changeValue()
} ,
created(){
this.$i18n = window.i18n;
this.initTopics();
this.input=''


+ 2
- 2
web_src/js/components/Model.vue View File

@@ -450,7 +450,7 @@ export default {
onHidden: function () {
if (flag == false) {
$(".alert")
.html("您已取消操作")
.html(_this.i18n['canceled_operation'])
.removeClass("alert-success")
.addClass("alert-danger")
.show()
@@ -458,7 +458,7 @@ export default {
.fadeOut();
} else {
$(".alert")
.html("删除成功")
.html(_this.i18n['successfully_deleted'])
.removeClass("alert-danger")
.addClass("alert-success")
.show()


+ 3
- 2
web_src/js/components/basic/editDialog.vue View File

@@ -15,8 +15,8 @@
<div slot="footer" class="dialog-footer">

<button class="ui button" @click="deleteDialog = false">{{"取消"}}</button>
<button class="ui green button" @click="deleteCallback.call(vmContext,deleteParam)">{{"确定"}}</button>
<button class="ui button" @click="deleteDialog = false">{{$i18n['cancel']}}</button>
<button class="ui green button" @click="deleteCallback.call(vmContext,deleteParam)">{{$i18n['confirm']}}</button>
<!-- <el-button size="small" style="font-size: 1rem;padding: .78571429em 1.5em .78571429em;border-radius: .28571429rem;" @click="deleteDialog = false">{{"取消"}}</el-button>
<el-button size="small" style="background-color: #21ba45;color: #fff;font-size: 1rem;padding: .78571429em 1.5em .78571429em;border-radius: .28571429rem;" @click="deleteCallback.call(vmContext,deleteParam)">{{"确定"}}</el-button> -->
</div>
@@ -71,6 +71,7 @@ export default {
},
},
created() {
this.$i18n = window.i18n;
this.deleteDialog = this.value;
}
};


+ 61
- 60
web_src/js/components/images/Images.vue View File

@@ -3,27 +3,27 @@
<div class="header-wrapper">
<div class="ui container">
<el-row class="image_text">
<h1>云脑镜像</h1>
<h1>{{$i18n['cloudeBrainMirror']['cloud_brain_mirror']}}</h1>
</el-row>
</div>
</div>
<div class="ui container" id="header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="公开镜像" name="first" v-loading="loadingPublic">
<el-tab-pane :label="$i18n['cloudeBrainMirror']['public_mirror']" name="first" v-loading="loadingPublic">
<template v-if="tableDataPublic.length !== 0">
<el-row style="align-items: center; display: flex">
<el-col :span="12">
<div>
<el-checkbox v-model="checked">仅显示平台推荐</el-checkbox>
<el-checkbox v-model="checked">{{$i18n['cloudeBrainMirror']['platform_recommendations']}}</el-checkbox>
</div>
</el-col>
<el-col :span="4"
><div style="visibility: hidden">TODO</div></el-col
><div style="visibility: hidden"></div></el-col
>
<el-col :span="8">
<div>
<el-input
placeholder="搜镜像Tag/描述/标签..."
:placeholder="$i18n['cloudeBrainMirror']['placeholder']"
v-model="search"
class="input-with-select"
@keyup.enter.native="searchName()"
@@ -33,7 +33,7 @@
slot="append"
icon="el-icon-search"
@click="searchName()"
>搜索</el-button
>{{$i18n['cloudeBrainMirror']['search']}}</el-button
>
</el-input>
</div>
@@ -46,7 +46,7 @@
:header-cell-style="tableHeaderStyle"
>
<el-table-column
label="镜像Tag"
:label="$i18n['cloudeBrainMirror']['mirror_tag']"
min-width="19%"
align="left"
prop="tag"
@@ -65,7 +65,7 @@
</template>
</el-table-column>
<el-table-column
label="镜像描述"
:label="$i18n['cloudeBrainMirror']['mirror_description']"
min-width="28%"
align="left"
prop="description"
@@ -86,7 +86,7 @@
</el-table-column>
<el-table-column
prop="cloudbrainType"
label="可用集群"
:label="$i18n['cloudeBrainMirror']['available_clusters']"
min-width="10%"
align="center"
>
@@ -96,7 +96,7 @@
</el-table-column>
<el-table-column
prop="creator"
label="创建者"
:label="$i18n['cloudeBrainMirror']['creator']"
min-width="8%"
align="center"
>
@@ -121,7 +121,7 @@
</el-table-column>
<el-table-column
prop="updatedUnix"
label="创建时间"
:label="$i18n['cloudeBrainMirror']['creation_time']"
align="center"
min-width="14%"
>
@@ -129,7 +129,7 @@
{{ scope.row.updatedUnix | transformTimestamp }}
</template>
</el-table-column>
<el-table-column align="center" min-width="21%" label="操作">
<el-table-column align="center" min-width="21%" :label="$i18n['cloudeBrainMirror']['operation']">
<template slot-scope="scope">
<div
style="
@@ -171,7 +171,7 @@
<span
style="padding: 0 1rem; color: #0366d6; cursor: pointer"
@click="copyUrl(scope.row.place)"
>复制地址</span
>{{$i18n['cloudeBrainMirror']['copy_address']}}</span
>
</div>
</template>
@@ -199,16 +199,16 @@
<el-row style="align-items: center; display: flex">
<el-col :span="12">
<div>
<el-checkbox v-model="checked">仅显示平台推荐</el-checkbox>
<el-checkbox v-model="checked">{{$i18n['cloudeBrainMirror']['platform_recommendations']}}</el-checkbox>
</div>
</el-col>
<el-col :span="4"
><div style="visibility: hidden">TODO</div></el-col
><div style="visibility: hidden"></div></el-col
>
<el-col :span="8">
<div>
<el-input
placeholder="搜镜像Tag/描述/标签..."
:placeholder="$i18n['cloudeBrainMirror']['placeholder']"
v-model="search"
class="input-with-select"
@keyup.enter.native="searchName()"
@@ -218,7 +218,7 @@
slot="append"
icon="el-icon-search"
@click="searchName()"
>搜索</el-button
>{{$i18n['cloudeBrainMirror']['search']}}</el-button
>
</el-input>
</div>
@@ -227,7 +227,7 @@
<el-empty :image-size="200"></el-empty>
</template>
</el-tab-pane>
<el-tab-pane label="我的镜像" name="second" v-loading="loadingCustom">
<el-tab-pane :label="$i18n['cloudeBrainMirror']['my_mirror']" name="second" v-loading="loadingCustom">
<template v-if="tableDataCustom.length !== 0">
<el-row style="align-items: center; display: flex">
<el-col :span="12">
@@ -239,7 +239,7 @@
<el-col :span="8">
<div>
<el-input
placeholder="搜镜像Tag/描述/标签..."
:placeholder="$i18n['cloudeBrainMirror']['placeholder']"
v-model="search"
class="input-with-select"
@keyup.enter.native="searchName()"
@@ -249,7 +249,7 @@
slot="append"
icon="el-icon-search"
@click="searchName()"
>搜索</el-button
>{{$i18n['cloudeBrainMirror']['search']}}</el-button
>
</el-input>
</div>
@@ -262,7 +262,7 @@
:header-cell-style="tableHeaderStyle"
>
<el-table-column
label="镜像Tag"
:label="$i18n['cloudeBrainMirror']['mirror_tag']"
min-width="19%"
align="left"
prop="tag"
@@ -287,7 +287,7 @@
</template>
</el-table-column>
<el-table-column
label="镜像描述"
:label="$i18n['cloudeBrainMirror']['mirror_description']"
min-width="27%"
align="left"
prop="description"
@@ -308,7 +308,7 @@
</el-table-column>
<el-table-column
prop="cloudbrainType"
label="可用集群"
:label="$i18n['cloudeBrainMirror']['available_clusters']"
min-width="9%"
align="center"
>
@@ -318,7 +318,7 @@
</el-table-column>
<el-table-column
prop="isPrivate"
label="状态"
:label="$i18n['cloudeBrainMirror']['state']"
min-width="10%"
align="center"
>
@@ -333,14 +333,14 @@
<span
v-if="scope.row.isPrivate"
style="color: rgb(250, 140, 22)"
>私有</span
>{{$i18n['cloudeBrainMirror']['private']}}</span
>
<span v-else style="color: rgb(19, 194, 141)">公开</span>
<span v-else style="color: rgb(19, 194, 141)">{{$i18n['cloudeBrainMirror']['public']}}</span>
<el-tooltip
v-if="scope.row.status === 0"
class="item"
effect="dark"
content="镜像提交中..."
:content="$i18n['cloudeBrainMirror']['mirror_committed']"
placement="top"
>
<i class="CREATING" style="margin-left: 0.3rem"></i>
@@ -350,7 +350,7 @@
v-if="scope.row.status === 2"
class="item"
effect="dark"
content="检测提交镜像是否大小超过20G!"
:content="$i18n['cloudeBrainMirror']['check_exceeds_20g']"
placement="top"
>
<i class="FAILED" style="margin-left: 0.3rem"></i>
@@ -360,7 +360,7 @@
v-if="scope.row.status === 1"
class="item"
effect="dark"
content="镜像提交成功"
:content="$i18n['cloudeBrainMirror']['mirror_submitted']"
placement="top"
>
<i class="SUCCEEDED" style="margin-left: 0.3rem"></i>
@@ -370,7 +370,7 @@
</el-table-column>
<el-table-column
prop="updatedUnix"
label="创建时间"
:label="$i18n['cloudeBrainMirror']['creation_time']"
align="center"
min-width="14%"
>
@@ -378,7 +378,7 @@
{{ scope.row.updatedUnix | transformTimestamp }}
</template>
</el-table-column>
<el-table-column align="center" min-width="21%" label="操作">
<el-table-column align="center" min-width="21%" :label="$i18n['cloudeBrainMirror']['operation']">
<template slot-scope="scope">
<div
style="
@@ -412,24 +412,24 @@
<span
style="padding: 0 1rem; color: #0366d6; cursor: pointer"
@click="copyUrl(scope.row.place)"
>复制地址</span
>{{$i18n['cloudeBrainMirror']['copy_address']}}</span
>
<div style="padding-left: 1rem; cursor: pointer">
<el-dropdown size="medium">
<span class="el-dropdown-link">
更多<i
{{$i18n['cloudeBrainMirror']['more']}}<i
class="el-icon-arrow-down el-icon--right"
></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@click.native="eidtImage(scope.row.id)"
>编辑</el-dropdown-item
>{{$i18n['cloudeBrainMirror']['edit']}}</el-dropdown-item
>
<el-dropdown-item
style="color: red"
@click.native="deleteImage(scope.row.id)"
>删除</el-dropdown-item
>{{$i18n['cloudeBrainMirror']['delete']}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
@@ -459,15 +459,15 @@
<template v-else>
<el-row style="align-items: center; display: flex">
<el-col :span="12">
<div style="visibility: hidden">TODO</div>
<div style="visibility: hidden"></div>
</el-col>
<el-col :span="4"
><div style="visibility: hidden">TODO</div></el-col
><div style="visibility: hidden"></div></el-col
>
<el-col :span="8">
<div>
<el-input
placeholder="搜镜像Tag/描述/标签..."
:placeholder="$i18n['cloudeBrainMirror']['placeholder']"
v-model="search"
class="input-with-select"
@keyup.enter.native="searchName()"
@@ -477,7 +477,7 @@
slot="append"
icon="el-icon-search"
@click="searchName()"
>搜索</el-button
>{{$i18n['cloudeBrainMirror']['search']}}</el-button
>
</el-input>
</div>
@@ -486,19 +486,19 @@
<el-empty :image-size="200"></el-empty>
</template>
</el-tab-pane>
<el-tab-pane label="我收藏的镜像" name="third">
<el-tab-pane :label="$i18n['cloudeBrainMirror']['my_favorite_mirror']" name="third">
<template v-if="tableDataStar.length !== 0">
<el-row style="align-items: center; display: flex">
<el-col :span="12">
<div style="visibility: hidden">TODO</div>
<div style="visibility: hidden"></div>
</el-col>
<el-col :span="4"
><div style="visibility: hidden">TODO</div></el-col
><div style="visibility: hidden"></div></el-col
>
<el-col :span="8">
<div>
<el-input
placeholder="搜镜像Tag/描述/标签..."
:placeholder="$i18n['cloudeBrainMirror']['placeholder']"
v-model="search"
class="input-with-select"
@keyup.enter.native="searchName()"
@@ -508,7 +508,7 @@
slot="append"
icon="el-icon-search"
@click="searchName()"
>搜索</el-button
>{{$i18n['cloudeBrainMirror']['search']}}</el-button
>
</el-input>
</div>
@@ -521,7 +521,7 @@
:header-cell-style="tableHeaderStyle"
>
<el-table-column
label="镜像Tag"
:label="$i18n['cloudeBrainMirror']['mirror_tag']"
min-width="19%"
align="left"
prop="tag"
@@ -540,7 +540,7 @@
</template>
</el-table-column>
<el-table-column
label="镜像描述"
:label="$i18n['cloudeBrainMirror']['mirror_description']"
min-width="28%"
align="left"
prop="description"
@@ -561,7 +561,7 @@
</el-table-column>
<el-table-column
prop="cloudbrainType"
label="可用集群"
:label="$i18n['cloudeBrainMirror']['available_clusters']"
min-width="10%"
align="center"
>
@@ -571,7 +571,7 @@
</el-table-column>
<el-table-column
prop="creator"
label="创建者"
:label="$i18n['cloudeBrainMirror']['creator']"
min-width="8%"
align="center"
>
@@ -596,7 +596,7 @@
</el-table-column>
<el-table-column
prop="updatedUnix"
label="创建时间"
:label="$i18n['cloudeBrainMirror']['creation_time']"
align="center"
min-width="14%"
>
@@ -604,7 +604,7 @@
{{ scope.row.updatedUnix | transformTimestamp }}
</template>
</el-table-column>
<el-table-column align="center" min-width="21%" label="操作">
<el-table-column align="center" min-width="21%" :label="$i18n['cloudeBrainMirror']['operation']">
<template slot-scope="scope">
<div
style="
@@ -639,7 +639,7 @@
<span
style="padding: 0 1rem; color: #0366d6; cursor: pointer"
@click="copyUrl(scope.row.place)"
>复制地址</span
>{{$i18n['cloudeBrainMirror']['copy_address']}}</span
>
</div>
</template>
@@ -667,15 +667,15 @@
<template v-else>
<el-row style="align-items: center; display: flex">
<el-col :span="12">
<div style="visibility: hidden">TODO</div>
<div style="visibility: hidden"></div>
</el-col>
<el-col :span="4"
><div style="visibility: hidden">TODO</div></el-col
><div style="visibility: hidden"></div></el-col
>
<el-col :span="8">
<div>
<el-input
placeholder="搜镜像Tag/描述/标签..."
:placeholder="$i18n['cloudeBrainMirror']['placeholder']"
v-model="search"
class="input-with-select"
@keyup.enter.native="searchName()"
@@ -685,7 +685,7 @@
slot="append"
icon="el-icon-search"
@click="searchName()"
>搜索</el-button
>{{$i18n['cloudeBrainMirror']['search']}}</el-button
>
</el-input>
</div>
@@ -859,7 +859,7 @@ export default {
onHidden: function () {
if (flag == false) {
$(".alert")
.html("您已取消操作")
.html(_this.$i18n['canceled_operation'])
.removeClass("alert-success")
.addClass("alert-danger")
.show()
@@ -867,7 +867,7 @@ export default {
.fadeOut();
} else {
$(".alert")
.html("删除成功")
.html(_this.$i18n['successfully_deleted'])
.removeClass("alert-danger")
.addClass("alert-success")
.show()
@@ -921,7 +921,7 @@ export default {
document.execCommand("Copy");
cInput.remove();
$("body").toast({
message: "复制成功!",
message: this.$i18n['cloudeBrainMirror']['copy_succeeded'],
showProgress: "bottom",
showIcon: "check circle",
class: "info",
@@ -954,9 +954,9 @@ export default {
},
transformPravite(val) {
if (val) {
return "私有";
return this.$i18n['cloudeBrainMirror']['private'];
} else {
return "公开";
return this.$i18n['cloudeBrainMirror']['public'];
}
},
transformTimestamp(timestamp) {
@@ -989,6 +989,7 @@ export default {
},
mounted() {},
created() {
this.$i18n = window.i18n;
const params = new URLSearchParams(location.search);
if (params.has("type") && params.get("type") == "myimage") {
this.activeName = "second";


+ 28
- 27
web_src/js/components/images/adminImages.vue View File

@@ -6,33 +6,33 @@
<div class="ui attached segment">
<div class="ui form ignore-dirty">
<div class="ui fluid action input">
<input type="text" placeholder="搜镜像Tag/描述/标签..." v-model="search"
<input type="text" :placeholder="$i18n['cloudeBrainMirror']['placeholder']" v-model="search"
@keyup.enter="searchName()">
<button class="ui blue button" @click="searchName()">搜索</button>
<button class="ui blue button" @click="searchName()">{{$i18n['cloudeBrainMirror']['search']}}</button>
</div>
</div>
</div>

<div class="ui ten wide column" style="margin: 1rem 0;">
<el-checkbox v-model="checked" style="padding: 0.5rem 1rem;">仅显示平台推荐</el-checkbox>
<el-checkbox v-model="checked" style="padding: 0.5rem 1rem;">{{$i18n['cloudeBrainMirror']['platform_recommendations']}}</el-checkbox>
<el-dropdown @command="handleCommand" trigger="click"
style="border: 1px solid rgba(34,36,38,.15);border-radius: 4px;padding: 0.5rem 1rem;">
<span class="el-dropdown-link">
{{dropdownPrivate}}<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{label:'全部',private:''}">全部</el-dropdown-item>
<el-dropdown-item :command="{label:'公开',private:false}">公开</el-dropdown-item>
<el-dropdown-item :command="{label:'私有',private:true}">私有</el-dropdown-item>
<el-dropdown-item :command="{label:$i18n['all'],private:''}">{{$i18n['all']}}</el-dropdown-item>
<el-dropdown-item :command="{label:$i18n['cloudeBrainMirror']['public'],private:false}">{{$i18n['cloudeBrainMirror']['public']}}</el-dropdown-item>
<el-dropdown-item :command="{label:$i18n['cloudeBrainMirror']['private'],private:true}">{{$i18n['cloudeBrainMirror']['private']}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="ui six wide column right aligned" style="margin: 1rem 0;">
<a class="ui blue small button" href="/admin/images/commit_image">创建云脑镜像</a>
<a class="ui blue small button" href="/admin/images/commit_image">{{$i18n['cloudeBrainMirror']['create_cloud_brain_mirror']}}</a>
</div>
<div class="ui sixteen wide column" style="padding: 0;overflow-x: auto;">
<el-table :data="tableDataCustom" style="width: 100%;min-width:1700px;" :header-cell-style="tableHeaderStyle">
<el-table-column label="镜像Tag" min-width="19%" align="left" prop="tag">
<el-table-column :label="$i18n['cloudeBrainMirror']['mirror_tag']" min-width="19%" align="left" prop="tag">
<template slot-scope="scope">
<div style="display: flex;align-items: center;">
<a class="text-over image_title" :title="scope.row.tag">{{ scope.row.tag }}</a>
@@ -42,7 +42,7 @@
</div>
</template>
</el-table-column>
<el-table-column label="镜像描述" min-width="28%" align="left" prop="description">
<el-table-column :label="$i18n['cloudeBrainMirror']['mirror_description']" min-width="28%" align="left" prop="description">
<template slot-scope="scope">
<div class="image_desc" :title="scope.row.description">{{ scope.row.description}}
</div>
@@ -53,18 +53,18 @@

</template>
</el-table-column>
<el-table-column prop="cloudbrainType" label="可用集群" min-width="10%" align="center">
<el-table-column prop="cloudbrainType" :label="$i18n['cloudeBrainMirror']['available_clusters']" min-width="10%" align="center">
<template slot-scope="scope">
{{scope.row.cloudbrainType | transformType}}
</template>
</el-table-column>
<el-table-column prop="isPrivate" label="状态" min-width="8%" align="center">
<el-table-column prop="isPrivate" :label="$i18n['cloudeBrainMirror']['state']" min-width="8%" align="center">
<template slot-scope="scope">
<span v-if="scope.row.isPrivate" style="color: rgb(250, 140, 22);">私有</span>
<span v-else style="color: rgb(19, 194, 141);">公开</span>
<span v-if="scope.row.isPrivate" style="color: rgb(250, 140, 22);">{{$i18n['cloudeBrainMirror']['private']}}</span>
<span v-else style="color: rgb(19, 194, 141);">{{$i18n['cloudeBrainMirror']['public']}}</span>
</template>
</el-table-column>
<el-table-column prop="creator" label="创建者" min-width="7%" align="center">
<el-table-column prop="creator" :label="$i18n['cloudeBrainMirror']['creator']" min-width="7%" align="center">
<template slot-scope="scope">
<a v-if="scope.row.userName||scope.row.relAvatarLink"
:href="'/' + scope.row.userName" :title="scope.row.userName">
@@ -75,12 +75,12 @@
</a>
</template>
</el-table-column>
<el-table-column prop="updatedUnix" label="创建时间" align="center" min-width="13%">
<el-table-column prop="updatedUnix" :label="$i18n['cloudeBrainMirror']['creation_time']" align="center" min-width="13%">
<template slot-scope="scope">
{{scope.row.updatedUnix | transformTimestamp}}
</template>
</el-table-column>
<el-table-column align="center" min-width="23%" label="操作">
<el-table-column align="center" min-width="23%" :label="$i18n['cloudeBrainMirror']['operation']">
<template slot-scope="scope">
<div style="display: flex;justify-content: flex-end;align-items: center;">
<div
@@ -95,22 +95,22 @@
</div>
<span style="padding: 0 1rem;color: rgb(250, 140, 22);cursor:pointer;"
v-if="scope.row.type==5"
@click="unSetRecommend(scope.$index,scope.row.id)">取消推荐</span>
@click="unSetRecommend(scope.$index,scope.row.id)">{{$i18n['cloudeBrainMirror']['cancel_recommendation']}}</span>
<span style="padding: 0 1rem;color: rgb(19, 194, 141);cursor:pointer;"
v-if="scope.row.type!==5 && !scope.row.isPrivate"
@click="setRecommend(scope.$index,scope.row.id)">设为推荐</span>
@click="setRecommend(scope.$index,scope.row.id)">{{$i18n['cloudeBrainMirror']['set_as_recommended']}}</span>
<span style="padding: 0 1rem;color:#0366d6;cursor:pointer;"
@click="copyUrl(scope.row.place)">复制地址</span>
@click="copyUrl(scope.row.place)">{{$i18n['cloudeBrainMirror']['copy_address']}}</span>
<div style="padding-left:1rem;cursor:pointer;">
<el-dropdown size="medium">
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right"></i>
{{$i18n['cloudeBrainMirror']['more']}}<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="eidtImage(scope.row.id)">编辑
<el-dropdown-item @click.native="eidtImage(scope.row.id)">{{$i18n['cloudeBrainMirror']['edit']}}
</el-dropdown-item>
<el-dropdown-item style="color: red;"
@click.native="deleteImage(scope.row.id)">删除</el-dropdown-item>
@click.native="deleteImage(scope.row.id)">{{$i18n['cloudeBrainMirror']['delete']}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@@ -205,9 +205,9 @@
},
onHidden: function () {
if (flag == false) {
$('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
$('.alert').html(_this.$i18n['canceled_operation']).removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut();
} else {
$('.alert').html('删除成功').removeClass('alert-danger').addClass('alert-success').show().delay(1500).fadeOut();
$('.alert').html(_this.$i18n['successfully_deleted']).removeClass('alert-danger').addClass('alert-success').show().delay(1500).fadeOut();
}
}
})
@@ -269,9 +269,9 @@
},
transformPravite(val) {
if (val) {
return "私有"
return this.$i18n['cloudeBrainMirror']['private'];
} else {
return "公开"
return this.$i18n['cloudeBrainMirror']['public'];
}
},
transformTimestamp(timestamp) {
@@ -298,7 +298,8 @@
this.getImageListCustom()
},
created() {

this.$i18n = window.i18n;
this.dropdownPrivate = this.$i18n['all'];
}

};


+ 10
- 10
web_src/js/features/cloudbrainShow.js View File

@@ -54,10 +54,10 @@ export default async function initCloudrainSow() {
if (max) {
$("body").toast({
class: "black",
message: `您已翻阅至日志底部,请稍后再试!`,
message: i18n.scrolled_logs_bottom_pls_retry,
});
} else {
$(`.message${version_name} #header`).text("您已翻阅至日志底部");
$(`.message${version_name} #header`).text(i18n.scrolled_logs_bottom);
$(`.message${version_name}`).css("display", "block");
setTimeout(function () {
$(`.message${version_name}`).css("display", "none");
@@ -101,10 +101,10 @@ export default async function initCloudrainSow() {
if (max) {
$("body").toast({
class: "black",
message: `您已翻阅至日志顶部,请稍后再试!`,
message: i18n.scrolled_logs_top_pls_retry,
});
} else {
$(`.message${version_name} #header`).text("您已翻阅至日志顶部");
$(`.message${version_name} #header`).text(i18n.scrolled_logs_top);
$(`.message${version_name}`).css("display", "block");
setTimeout(function () {
$(`.message${version_name}`).css("display", "none");
@@ -181,10 +181,10 @@ export default async function initCloudrainSow() {
if (max) {
$("body").toast({
class: "black",
message: `您已翻阅至日志顶部,请稍后再试!`,
message: i18n.scrolled_logs_top_pls_retry,
});
} else {
$(`.message${version_name} #header`).text("您已翻阅至日志顶部");
$(`.message${version_name} #header`).text(i18n.scrolled_logs_top);
$(`.message${version_name}`).css("display", "block");
setTimeout(function () {
$(`.message${version_name}`).css("display", "none");
@@ -202,10 +202,10 @@ export default async function initCloudrainSow() {
if (max) {
$("body").toast({
class: "black",
message: `您已翻阅至日志顶部,请稍后再试!`,
message: i18n.scrolled_logs_top_pls_retry,
});
} else {
$(`.message${version_name} #header`).text("您已翻阅至日志顶部");
$(`.message${version_name} #header`).text(i18n.scrolled_logs_top);
$(`.message${version_name}`).css("display", "block");
setTimeout(function () {
$(`.message${version_name}`).css("display", "none");
@@ -299,10 +299,10 @@ export default async function initCloudrainSow() {
if (max) {
$("body").toast({
class: "black",
message: `您已翻阅至日志底部,请稍后再试!`,
message: i18n.scrolled_logs_bottom_pls_retry,
});
} else {
$(`.message${version_name} #header`).text("您已翻阅至日志底部");
$(`.message${version_name} #header`).text(i18n.scrolled_logs_bottom);
$(`.message${version_name}`).css("display", "block");
setTimeout(function () {
$(`.message${version_name}`).css("display", "none");


+ 1
- 1
web_src/js/features/cloudrbanin.js View File

@@ -267,7 +267,7 @@ export default async function initCloudrain() {
onHidden: function () {
if (flag == false) {
$(".alert")
.html("您已取消操作")
.html(i18n.canceled_operation)
.removeClass("alert-success")
.addClass("alert-danger")
.show()


+ 106
- 0
web_src/js/features/i18nVue.js View File

@@ -116,6 +116,59 @@ export const i18nVue = {
modify:"修改",
about:"约",
count:"个",
all:"全部",

introduction: '简介',
edit_repository_information: '编辑仓库信息',
please_enter_the_content: '请输入内容',
homePage: '主页',
cancel: '取消',
confirm: '确定',
contributors: '贡献者',
code: '代码',
searchOrCreateTopics: '搜索或创建标签',
clickOrEnterToAdd: '点击或回车添加',
topic: '标签',
topics: '标签',
noTopics: '暂无标签',
createTopicsTips: '标签名必须以中文、字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符',
canceled_operation: '您已取消操作',
successfully_deleted: '删除成功',

scrolled_logs_top: '您已翻阅至日志顶部',
scrolled_logs_top_pls_retry: '您已翻阅至日志顶部,请稍后再试!',
scrolled_logs_bottom: '您已翻阅至日志底部',
scrolled_logs_bottom_pls_retry: '您已翻阅至日志底部,请稍后再试!',

cloudeBrainMirror: {
cloud_brain_mirror: '云脑镜像',
public_mirror: '公开镜像',
platform_recommendations:'仅显示平台推荐',
placeholder: '搜镜像Tag/描述/标签...',
search:'搜索',
mirror_tag:'镜像Tag',
mirror_description:'镜像描述',
available_clusters: '可用集群',
creator: '创建者',
creation_time: '创建时间',
operation: '操作',
copy_address: '复制地址',
my_mirror: '我的镜像',
state: '状态',
private: '私有',
public: '公开',
mirror_committed: '镜像提交中...',
check_exceeds_20g:'检测提交镜像是否大小超过20G!',
mirror_submitted:'镜像提交成功',
edit: '编辑',
delete: '删除',
my_favorite_mirror: '我收藏的镜像',
more:'更多',
copy_succeeded: '复制成功!',
cancel_recommendation: '取消推荐',
set_as_recommended: '设为推荐',
create_cloud_brain_mirror: '创建云脑镜像',
},
},
US: {
computer_vision: "computer vision",
@@ -238,5 +291,58 @@ export const i18nVue = {
modify:"Modify",
about:"About",
count:"",
all:"All",

introduction: 'Introduction',
edit_repository_information: 'Edit repository information',
please_enter_the_content: 'Please enter the content',
homePage: 'Home page',
cancel: 'Cancel',
confirm: 'Confirm',
contributors: 'Contributors',
code: 'Code',
searchOrCreateTopics: 'Search or create topics',
clickOrEnterToAdd: 'Click or enter to add',
topic: 'Topic',
topics: 'Topics',
noTopics: 'No topics',
createTopicsTips: 'The topic name must start with Chinese, letters or numbers, can contain hyphens (-), and cannot exceed 35 characters in length',
canceled_operation: 'You have canceled the operation',
successfully_deleted: 'Successfully deleted',

scrolled_logs_top: 'You have scrolled to the top of the log',
scrolled_logs_top_pls_retry: 'You have scrolled to the top of the log, please try again later!',
scrolled_logs_bottom: 'You have scrolled to the bottom of the log',
scrolled_logs_bottom_pls_retry: 'You have scrolled to the bottom of the log, please try again later!',

cloudeBrainMirror: {
cloud_brain_mirror: 'Cloud Brain Mirror',
public_mirror: 'Public Mirror',
platform_recommendations:'Show platform recommendations only',
placeholder: 'Search Mirror tag / description / tag ... ',
search:'Search',
mirror_tag:'Mirror Tag',
mirror_description:'mirror_description ',
available_clusters: 'Available clusters',
creator: 'Creator',
creation_time: 'Creation time',
operation: 'Operation',
copy_address: 'Copy address',
my_mirror: 'My Mirror',
state: 'State',
private: 'Private',
public: 'Public',
mirror_committed: 'Mirror Committed...',
check_exceeds_20g:'Check whether the size of the submitted image exceeds 20g!',
mirror_submitted:'Image submitted successfully',
edit: 'Edit',
delete: 'Delete',
my_favorite_mirror: 'My Favorite Mirror',
more:'More',
copy_succeeded: 'Copy succeeded!',
cancel_recommendation: 'Cancel recommendation',
set_as_recommended: 'Set as recommended',
create_cloud_brain_mirror: 'Create cloud brain mirror',
},
},
};

+ 1
- 1
web_src/js/index.js View File

@@ -5221,7 +5221,7 @@ function initTopToHome() {
}
});
topToHomeEl.on('click', function() {
$('html').animate({ scrollTop: 0 }, 'slow', 'swing');
$('html,body').animate({ scrollTop: 0 }, 'slow', 'swing');
});
}



+ 2
- 1
web_src/js/standalone/cloudbrainNew.js View File

@@ -398,7 +398,8 @@
html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`;
}
}
document.getElementById("benchmark_child_types_id").innerHTML = html;
let el = document.getElementById("benchmark_child_types_id");
el && (el.innerHTML = html);
})
}
$(document).ready(function () {


+ 2
- 2
web_src/js/standalone/specsuse.js View File

@@ -1,11 +1,11 @@
window.ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }];
window.ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }, { k: 'ENFLAME-T20', v: 'ENFLAME-T20' }];

window.getListValueWithKey = (list, key, k = 'k', v = 'v', defaultV = '') => {
for (let i = 0, iLen = list.length; i < iLen; i++) {
const listI = list[i];
if (listI[k] === key) return listI[v];
}
return defaultV;
return defaultV || key;
};

window.renderSpecStr = (spec, showPoint, langObj) => {


+ 1
- 1
web_src/less/openi.less View File

@@ -1455,7 +1455,7 @@ i.SUCCEEDED {
white-space: nowrap;
}
.text-span-new {
width: 800px;
overflow: hidden;
text-overflow: ellipsis;
height: 20%;


+ 2
- 2
web_src/vuepages/const/index.js View File

@@ -11,8 +11,8 @@ export const JOB_TYPE = [{ k: 'DEBUG', v: i18n.t('debugTask') }, { k: 'TRAIN', v
// 资源管理
export const CLUSTERS = [{ k: 'OpenI', v: i18n.t('resourcesManagement.OpenI') }, { k: 'C2Net', v: i18n.t('resourcesManagement.C2Net') }];
export const AI_CENTER = [{ k: 'OpenIOne', v: i18n.t('resourcesManagement.OpenIOne') }, { k: 'OpenITwo', v: i18n.t('resourcesManagement.OpenITwo') }, { k: 'OpenIChengdu', v: i18n.t('resourcesManagement.OpenIChengdu') }, { k: 'pclcci', v: i18n.t('resourcesManagement.pclcci') }, { k: 'hefei', v: i18n.t('resourcesManagement.hefeiCenter') }, { k: 'xuchang', v: i18n.t('resourcesManagement.xuchangCenter') }];
export const COMPUTER_RESOURCES = [{ k: 'GPU', v: 'GPU' }, { k: 'NPU', v: 'NPU' }, { k: 'MLU', v: 'MLU' }];
export const ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }];
export const COMPUTER_RESOURCES = [{ k: 'GPU', v: 'GPU' }, { k: 'NPU', v: 'NPU' }, { k: 'MLU', v: 'MLU' }, { k: 'GCU', v: 'GCU' }];
export const ACC_CARD_TYPE = [{ k: 'T4', v: 'T4' }, { k: 'A100', v: 'A100' }, { k: 'V100', v: 'V100' }, { k: 'ASCEND910', v: 'Ascend 910' }, { k: 'MLU270', v: 'MLU270' }, { k: 'RTX3080', v: 'RTX3080' }, { k: 'ENFLAME-T20', v: 'ENFLAME-T20' }];
export const SPECIFICATION_STATUS = [{ k: '1', v: i18n.t('resourcesManagement.willOnShelf') }, { k: '2', v: i18n.t('resourcesManagement.onShelf') }, { k: '3', v: i18n.t('resourcesManagement.offShelf') }];

// 模型


+ 2
- 2
web_src/vuepages/langs/config/en-US.js View File

@@ -207,8 +207,8 @@ const en = {
npuEnv: "NPU environment",
newTask: "Create new task",
noQuene: "The current resources are sufficient and no tasks are queued",
queneTips1: "There are currently",
queneTips2: "tasks queued",
queneTips1: "Your current queue position is",
queneTips2: "",
watiResource: "Waiting for resources to be allocated, please be patient",
debug: "Debug",
stop: "Stop",


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save