#4941 V20231120

Merged
ychao_1983 merged 106 commits from V20231120 into develop 5 months ago
  1. +136
    -32
      custom/public/img/logo-w.svg
  2. +2
    -2
      entity/ai_task.go
  3. +7
    -3
      entity/cluster.go
  4. +33
    -0
      manager/client/grampus/grampus.go
  5. +65
    -0
      models/cloudbrain.go
  6. +10
    -0
      models/cloudbrain_spec.go
  7. +33
    -12
      models/user.go
  8. +39
    -0
      modules/context/repo.go
  9. +27
    -0
      modules/setting/ratelimit.go
  10. +5
    -0
      modules/setting/setting.go
  11. +3
    -0
      options/locale/locale_en-US.ini
  12. +3
    -0
      options/locale/locale_zh-CN.ini
  13. +39
    -0
      public/robots.txt
  14. +0
    -1
      routers/ai_task/ai_task.go
  15. +8
    -33
      routers/api/v1/repo/cloudbrain_dashboard.go
  16. +3
    -0
      routers/org/setting.go
  17. +3
    -1
      routers/repo/attachment_dir.go
  18. +12
    -8
      routers/repo/cloudbrain.go
  19. +2
    -2
      routers/repo/view.go
  20. +11
    -6
      routers/routes/routes.go
  21. +59
    -11
      services/ai_task_service/cluster/c2net.go
  22. +1
    -1
      services/ai_task_service/schedule/model_schedule.go
  23. +5
    -3
      services/ai_task_service/task/grampus_online_infer_task.go
  24. +2
    -1
      services/ai_task_service/task/task_base.go
  25. +3
    -0
      services/ai_task_service/task/task_service.go
  26. +2
    -2
      templates/base/head_navbar.tmpl
  27. +2
    -2
      templates/base/head_navbar_fluid.tmpl
  28. +2
    -2
      templates/base/head_navbar_home.tmpl
  29. +2
    -2
      templates/base/head_navbar_pro.tmpl
  30. +13
    -0
      templates/status/429.tmpl
  31. +3
    -0
      web_src/vuepages/pages/cloudbrain/configs.js
  32. +1
    -1
      web_src/vuepages/pages/model/mind/index.vue

+ 136
- 32
custom/public/img/logo-w.svg View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- Generator: Adobe Illustrator 27.9.0, 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">
@@ -7,39 +7,143 @@
.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"/>
<path class="st0" d="M105.3,42H87.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,42,105.4,42,105.3,42z M104.6,52.6c-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.9h0.1h13.1c1.1,0,2,0.8,2.1,2L104.6,52.6z"/>
<path class="st0" d="M81,34v-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.6V24H80.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.2H81V34z"/>
<path class="st0" d="M116.2,39.1l4.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.2H121v-2h-4.6v5.1
h5.8c0,1.3-0.1,2.6-0.3,3.9h-6.7v3.3h5.8C120.4,36.2,118.6,38.1,116.2,39.1z"/>
<path class="st0" d="M126.5,35.4c1.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,42.2h-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
H117v1.3c0,1.9,1.6,3.5,3.5,3.6h25.1c2.6-0.1,4-1.3,4-3.5v-9C149.2,43.7,147.5,42.2,145.4,42.2z M145,48.6h-23.7v-1.1
c0-1,0.8-1.9,1.8-1.9h0.1H143c1.3,0,2.1,0.7,2.1,1.9L145,48.6z"/>
<path class="st0" d="M147.3,22.7h-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.9V25.7
C150.4,24.1,149.4,23,147.3,22.7z M146,34.9c0,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.9h0.1h2c1.1,0,2.1,0.8,2.1,1.9l0,0L146,34.9z"/>
</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.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0.7
c0.1-0.3,0.2-0.5,0.2-0.7c0.1-0.2,0.2-0.4,0.2-0.7c0.1-0.2,0.1-0.4,0.2-0.5c0.1-0.6,0.2-0.9,0.2-1.1c0-0.1-0.1-0.3-0.2-0.6
c-0.2-0.3-0.2-0.5-0.1-0.7C139.2,1.1,139.3,1.1,139.4,1.1z"/>
<path class="st0" d="M157.8,3.7c0.1,0,0.3,0,0.4,0.1c0,0,0,0,0.1,0c0,0,0.1,0,0.1,0.1c0,0,0,0.1,0,0.1c0,0.1,0,0.9,0,2.3
c-0.2,1.5-0.3,3-0.3,4.5c-0.1,1.7-0.1,2.6-0.2,2.7c-0.1,0.1-0.2,0.3-0.4,0.4c-0.2,0-0.3,0-0.4-0.2c-0.1-0.2-0.2-0.7-0.2-1.6
c0-0.6,0.1-2.1,0.3-4.7c0-0.3,0.1-0.7,0.1-1.1c0-0.4,0.1-0.7,0.1-1c0-0.3,0-0.6,0.1-0.8c0-0.2,0-0.5,0.1-0.6c0-0.1,0-0.2,0-0.3
C157.5,3.7,157.6,3.7,157.8,3.7z M157.7,15c0.3,0.2,0.5,0.4,0.5,0.5c0.1,0.1,0,0.3-0.1,0.6c-0.1,0.2-0.2,0.3-0.3,0.3
c0,0-0.2,0-0.5-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1-0.1-0.1-0.1c0,0,0-0.1,0-0.1c0,0,0-0.2,0-0.5c0.1-0.2,0.2-0.4,0.3-0.5
C157.3,14.9,157.5,14.9,157.7,15z"/>
</g>
</svg>

+ 2
- 2
entity/ai_task.go View File

@@ -167,8 +167,8 @@ func (a *AITaskDetailInfo) TryToRemovePretrainModelList(currentUser *models.User
func getAiCenterShow(aiCenter string, language string) string {
aiCenterInfo := strings.Split(aiCenter, "+")
if len(aiCenterInfo) == 2 {
if setting.AiCenterCodeAndNameMapInfo != nil {
if info, ok := setting.AiCenterCodeAndNameMapInfo[aiCenterInfo[0]]; ok {
if setting.AiCenterCodeAndNameAndLocMapInfo != nil {
if info, ok := setting.AiCenterCodeAndNameAndLocMapInfo[aiCenterInfo[0]]; ok {
if language == defaultLanguage {
return info.Content
} else {


+ 7
- 3
entity/cluster.go View File

@@ -2,14 +2,15 @@ package entity

import (
"archive/zip"
"encoding/json"
"fmt"
"strconv"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/cloudbrain"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/storage"
"code.gitea.io/gitea/modules/timeutil"
"encoding/json"
"fmt"
"strconv"
)

type CreateNoteBookTaskRequest struct {
@@ -292,6 +293,8 @@ func GetClusterTypeFromCloudbrainType(t int) ClusterType {

type ClusterLogOpts struct {
JobId string
JobType string
JobName string
BaseLine int64
Lines int64
Direction Direction
@@ -312,6 +315,7 @@ func (opts ClusterLogOpts) IsHeadRequest() bool {

type ClusterLogDownloadInfoOpts struct {
JobId string
JobType string
ObjectKeyPrefix string
StorageType StorageType
NodeId int


+ 33
- 0
manager/client/grampus/grampus.go View File

@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"github.com/go-resty/resty/v2"
"github.com/gorilla/websocket"
)

var (
@@ -597,3 +598,35 @@ sendjob:
log.Info("delete grampus task, re=" + result.Info + " grampus jobId=" + jobID)
return &result, nil
}

func ClickOnce(url string) {
client := getRestyClient()
log.Info("click url=" + url)
res, err := client.R().
SetHeader("Content-Type", "application/json").
Get(url)
if err != nil {
log.Info("error=" + err.Error())
} else {
if res != nil {
jsonstr, _ := json.Marshal(res)
log.Info("job resp:", jsonstr)
}
}
}

func SendMsgToWebsocket(wsurl string, msg string) {
//wsurl := strings.Replace(tmpurl, "http", "ws", 1)
log.Info("wsurl =" + wsurl)
conn, _, err := websocket.DefaultDialer.Dial(wsurl, nil)
if err == nil {
defer conn.Close()
err1 := conn.WriteJSON(msg)
//err1 := conn.WriteJSON("{\"msg\":\"send_hash\"}")
if err1 != nil {
log.Info("websocket send msg error=" + err1.Error())
}
} else {
log.Info("websocket error=" + err.Error())
}
}

+ 65
- 0
models/cloudbrain.go View File

@@ -3082,6 +3082,71 @@ func CloudbrainAll(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) {

return cloudbrains, count, nil
}

func CloudbrainTotalForDashBoard(opts *CloudbrainsOptions) (int64, error) {
sess := x.NewSession()
defer sess.Close()

var cond = builder.NewCond()

if opts.BeginTimeUnix > 0 && opts.EndTimeUnix > 0 {
cond = cond.And(
builder.And(builder.Gte{"cloudbrain.created_unix": opts.BeginTimeUnix}, builder.Lte{"cloudbrain.created_unix": opts.EndTimeUnix}),
)
}
var count int64
var err error
count, err = sess.Table(&Cloudbrain{}).Unscoped().Where(cond).
Count(new(CloudbrainInfo))

if err != nil {
return 0, fmt.Errorf("Count: %v", err)
}
return count, nil
}

func CloudbrainAllForDashBoard(opts *CloudbrainsOptions) ([]*CloudbrainInfo, error) {
sess := x.NewSession()
defer sess.Close()

var cond = builder.NewCond()

if opts.BeginTimeUnix > 0 && opts.EndTimeUnix > 0 {
cond = cond.And(
builder.And(builder.Gte{"cloudbrain.created_unix": opts.BeginTimeUnix}, builder.Lte{"cloudbrain.created_unix": opts.EndTimeUnix}),
)
}
if opts.Page >= 0 && opts.PageSize > 0 {
var start int
if opts.Page == 0 {
start = 0
} else {
start = (opts.Page - 1) * opts.PageSize
}
sess.Limit(opts.PageSize, start)
}
sess.OrderBy("cloudbrain.created_unix DESC")
cloudbrains := make([]*CloudbrainInfo, 0, setting.UI.IssuePagingNum)
if err := sess.Table(&Cloudbrain{}).Unscoped().Where(cond).
Find(&cloudbrains); err != nil {
return nil, fmt.Errorf("Find: %v", err)
}
if opts.NeedRepoInfo {
var ids []int64
for _, task := range cloudbrains {
ids = append(ids, task.RepoID)
}
repositoryMap, err := GetRepositoriesMapByIDs(ids)
if err == nil {
for _, task := range cloudbrains {
task.Repo = repositoryMap[task.RepoID]
}
}
}

return cloudbrains, nil
}

func CloudbrainAllStatic(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) {
sess := x.NewSession()
defer sess.Close()


+ 10
- 0
models/cloudbrain_spec.go View File

@@ -91,6 +91,16 @@ func GetCloudbrainSpecByID(cloudbrainId int64) (*CloudbrainSpec, error) {
return r, nil
}

func GetSpecAccCardsNumByID(cloudbrainId int64) (*CloudbrainSpec, error) {
r := &CloudbrainSpec{}
if has, err := x.Select("acc_cards_num").Where("cloudbrain_id = ?", cloudbrainId).Get(r); err != nil {
return nil, err
} else if !has {
return nil, nil
}
return r, nil
}

func FindCloudbrainTask(page, pageSize int) ([]*Cloudbrain, error) {
r := make([]*Cloudbrain, 0)
err := x.Unscoped().


+ 33
- 12
models/user.go View File

@@ -471,7 +471,6 @@ func (u *User) SizedRelAvatarLink(size int) string {
//
// This function make take time to return when federated avatars
// are in use, due to a DNS lookup need
//
func (u *User) RealSizedAvatarLink(size int) string {
if u.ID == -1 {
return base.DefaultAvatarLink()
@@ -954,50 +953,72 @@ var (
".",
"..",
".well-known",
"action",
"admin",
"all",
"api",
"assets",
"attachments",
"authentication",
"avatar",
"avatars",
"bindPhone",
"blockchain",
"cloudbrains",
"commits",
"course",
"css",
"dashboard",
"debug",
"docs",
"error",
"explore",
"extension",
"fomantic",
"ghost",
"help",
"home",
"ide",
"image",
"img",
"install",
"issues",
"js",
"kanban",
"less",
"login",
"manifest.json",
"metrics",
"milestones",
"modelsquare",
"new",
"notifications",
"operation",
"org",
"plugins",
"pulls",
"raw",
"recommend",
"repo",
"repo-avatars",
"resource_desc",
"resources",
"reward",
"robots.txt",
"search",
"secure",
"self",
"sendVerifyCode",
"serviceworker.js",
"show",
"slideImage",
"stars",
"swagger.v1.json",
"tech",
"template",
"user",
"vendor",
"dashboard",
"operation",
"blockchain",
"avatar",
"swagger.v1.json",
"secure",
"serviceworker.js",
"self",
"repo-avatars",
"verifySlideImage",
}
reservedUserPatterns = []string{"*.keys", "*.gpg", "*.png"}
)
@@ -1012,7 +1033,7 @@ func isUsableName(names, patterns []string, name string) error {
}

for i := range names {
if name == names[i] {
if name == strings.ToLower(names[i]) {
return ErrNameReserved{name}
}
}
@@ -2227,7 +2248,7 @@ func GetBlockChainUnSuccessUsers() ([]*User, error) {
return users, err
}

//GetUserIdsByUserNames Get userIDs in batches through username paging, this method will ignore errors
// GetUserIdsByUserNames Get userIDs in batches through username paging, this method will ignore errors
func GetUserIdsByUserNames(names []string) []int64 {
pageSize := 200
length := len(names)


+ 39
- 0
modules/context/repo.go View File

@@ -8,6 +8,7 @@ package context
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"path"
"strings"
@@ -22,6 +23,7 @@ import (
"gitea.com/macaron/macaron"
"github.com/editorconfig/editorconfig-core-go/v2"
"github.com/unknwon/com"
"golang.org/x/time/rate"
)

// PullRequest contains informations to make a pull request
@@ -371,6 +373,43 @@ func RepoIDAssignment() macaron.Handler {
}
}

func LowLimiter() macaron.Handler {
return limiterHandler(setting.RateLimitConfig.LowRate, setting.RateLimitConfig.LowBurst)
}

func limiterHandler(rateLimit int, burst int) macaron.Handler {
var limiter *rate.Limiter
if setting.RateLimitConfig.Enabled {
limiter = rate.NewLimiter(rate.Limit(rateLimit), burst)
}
return func(ctx *Context) {

if !ctx.IsSigned {
isInWhiteList := false
userName := ctx.Params(":username")
repoName := ctx.Params(":reponame")

if userName != "" && repoName != "" {
for _, v := range setting.RateLimitConfig.WhiteList {
if v == userName+"/"+repoName {
isInWhiteList = true
}
}
}

if !isInWhiteList && setting.RateLimitConfig.Enabled && limiter != nil && !limiter.Allow() {
ctx.HTML(http.StatusTooManyRequests, "status/429")
return
}
}
ctx.Next()
}
}

func HighLimiter() macaron.Handler {
return limiterHandler(setting.RateLimitConfig.HighRate, setting.RateLimitConfig.HighBurst)
}

// RepoAssignment returns a macaron to handle repository assignment
func RepoAssignment() macaron.Handler {
return func(ctx *Context) {


+ 27
- 0
modules/setting/ratelimit.go View File

@@ -0,0 +1,27 @@
package setting

import "strings"

var RateLimitConfig *RateLimit

type RateLimit struct {
Enabled bool
LowRate int
LowBurst int
HighRate int
HighBurst int
WhiteList []string
}

func initRateLimitConfig() {
sec := Cfg.Section("rate_limit")
RateLimitConfig = &RateLimit{
Enabled: sec.Key("Enabled").MustBool(true),
LowRate: sec.Key("LowRate").MustInt(10),
LowBurst: sec.Key("LowBurst").MustInt(20),
HighRate: sec.Key("HighRate").MustInt(20),
HighBurst: sec.Key("HighBurst").MustInt(30),
WhiteList: strings.Split(sec.Key("WhiteList").MustString(""), ","),
}

}

+ 5
- 0
modules/setting/setting.go View File

@@ -641,6 +641,8 @@ var (
GPUImageCommonName string
MultiNode string
MMLSparkMaxTime int64
NoteBookDomainURL string
NoteBookLocalURL string
}{}

ClearStrategy = struct {
@@ -1965,6 +1967,8 @@ func GetGrampusConfig() {

Grampus.MMLSparkMaxTime = sec.Key("MMLSparkMaxTime").MustInt64(8 * 3600)

Grampus.NoteBookDomainURL = sec.Key("NoteBookDomainURL").MustString("https://notebook.openi.org.cn")
Grampus.NoteBookLocalURL = sec.Key("NoteBookLocalURL").MustString("http://192.168.242.23")
}

func SetRadarMapConfig() {
@@ -2122,4 +2126,5 @@ func NewServices() {
newTaskService()
NewQueueService()
newPhoneService()
initRateLimitConfig()
}

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

@@ -99,8 +99,10 @@ loading = Loading…

error404_index = Request forbidden by administrative rules
error500_index = Internal Server Error
error429_index = Request forbidden by administrative rules!
error404 = The page you are trying to reach either <strong>does not exist</strong> or <strong>you are not authorized</strong> to view it.
error500= Sorry, the site has encountered some problems, we are trying to <strong>fix the page</strong>, please try again later.
error429 = Too many requests, please try again later.
[error]
occurred = An error has occurred
report_message = An error has occurred
@@ -283,6 +285,7 @@ search_finded=Find
search_related=related
search_maybe=maybe
search_ge=
refresh=Refresh

wecome_AI_plt = Welcome to OpenI AI Collaboration Platform!
explore_AI = Explore better AI, come here to find more interesting


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

@@ -99,8 +99,10 @@ loading=正在加载...

error404_index = 您的访问受限!
error500_index = 抱歉!您指定的网页无法访问。
error429_index = 您的访问受限!
error404=您正尝试访问的页面 <strong>不存在</strong> 或 <strong>您尚未被授权</strong> 查看该页面。
error500=抱歉,站点遇到一些问题,我们正尝试<strong>修复网页</strong>,请您稍后再试。
error429 = 您访问的接口访问量超过限制,请稍后再试。

[error]
occurred=发生错误
@@ -285,6 +287,7 @@ search_finded=找到
search_related=相关
search_maybe=约为
search_ge=个
refresh=刷新

wecome_AI_plt=欢迎来到启智AI协作平台!
explore_AI = 探索更好的AI,来这里发现更有意思的


+ 39
- 0
public/robots.txt View File

@@ -0,0 +1,39 @@
User-agent: *
Crawl-delay: 1
Disallow: /admin/
Disallow: /api/
Disallow: /*/*/commit/*
Disallow: /*/*/tree/*
Disallow: /*/*/blame/*
Disallow: /*/*/raw/*
Disallow: /*/branches
Disallow: /*/cloudbrain/
Disallow: /*/grampus/
Disallow: /*/supercompute/
Disallow: /*/modelmanage/
Disallow: /*/modelsafety/
Disallow: /*/debugjob
Disallow: /*/modelarts/
Disallow: /*/tree/
Disallow: /*/forks
Disallow: /*/stars
Disallow: *download*
Disallow: /*/revisions
Disallow: /*/issues/new
Disallow: /*/issues/search
Disallow: /*/commits/
Disallow: /*/tags
Disallow: /*/contributors/
Disallow: /*/comments
Disallow: /*/archive/
Disallow: /*/blame/
Disallow: /*/watchers
Disallow: /*/graphs
Disallow: /*/raw/
Disallow: /*/compare/
Disallow: /.git/
Disallow: */.git/
Disallow: /*.git$
Disallow: /search
Disallow: */search
Disallow: /*q=

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

@@ -363,7 +363,6 @@ func GetNotebookUrl(ctx *context.Context) {
ctx.JSON(http.StatusOK, response.OuterTrBizError(err, ctx))
return
}

m := map[string]interface{}{"url": url}
ctx.JSON(http.StatusOK, response.OuterSuccessWithData(m))
}


+ 8
- 33
routers/api/v1/repo/cloudbrain_dashboard.go View File

@@ -15,8 +15,6 @@ import (

"code.gitea.io/gitea/modules/setting"

"code.gitea.io/gitea/services/cloudbrain/resource"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
@@ -292,28 +290,6 @@ func getCenterCardTimeInfo(cloudbrainCardTimeAndCountArray []map[string]string)
return centerCardTimeMap, maxCardTime, minCardTime
}

func GetCloudbrainCardDuration(task models.Cloudbrain) string {
cardNum := int(0)
spec, err := resource.GetCloudbrainSpec(task.ID)
if err != nil {
log.Info("error:" + err.Error())
return ""
}
if spec != nil {
cardNum = spec.AccCardsNum
} else {
cardNum = 1
}
var workServerNumber int64
if task.WorkServerNumber >= 1 {
workServerNumber = int64(task.WorkServerNumber)
} else {
workServerNumber = 1
}
cardDuration := models.ConvertDurationToStr(workServerNumber * int64(cardNum) * task.Duration)
return cardDuration
}

func GetAllCloudbrainsTrend(ctx *context.Context) {

queryType := ctx.QueryTrim("type")
@@ -1472,7 +1448,7 @@ func DownloadCloudBrainBoard(ctx *context.Context) {
now := time.Now()
endTime := now

_, total, err := models.CloudbrainAll(&models.CloudbrainsOptions{
total, err := models.CloudbrainTotalForDashBoard(&models.CloudbrainsOptions{
ListOptions: models.ListOptions{
Page: page,
PageSize: pageSize,
@@ -1497,11 +1473,11 @@ func DownloadCloudBrainBoard(ctx *context.Context) {
for k, v := range allCloudbrainHeader(ctx) {
f.SetCellValue(cloudBrain, k, v)
}

var row = 2
userMap := models.GetAllUserName()
for i := 0; i < totalPage; i++ {
pageRecords, _, err := models.CloudbrainAll(&models.CloudbrainsOptions{
log.Info("DownloadCloudBrainBoard now=" + fmt.Sprint(i) + "/" + fmt.Sprint(totalPage))
pageRecords, err := models.CloudbrainAllForDashBoard(&models.CloudbrainsOptions{
ListOptions: models.ListOptions{
Page: page,
PageSize: pageSize,
@@ -1516,17 +1492,16 @@ func DownloadCloudBrainBoard(ctx *context.Context) {
log.Warn("Can not get cloud brain info", err)
continue
}

models.LoadSpecs4CloudbrainInfo(pageRecords)
for _, record := range pageRecords {
record = cloudbrainService.UpdateCloudbrainAiCenter(record)
record.Cloudbrain.AiCenter = repo.GetAiCenterNameByCode(record.Cloudbrain.AiCenter, ctx.Language())
for k, v := range allCloudbrainValues(row, record, ctx) {
for k, v := range allCloudbrainValues(row, record, ctx, userMap) {
f.SetCellValue(cloudBrain, k, v)
}
row++

}

page++
}
f.SetActiveSheet(index)
@@ -1552,14 +1527,14 @@ func allCloudbrainHeader(ctx *context.Context) map[string]string {
"O1": ctx.Tr("cloudbrain.resource_specification"), "P1": ctx.Tr("repo.cloudbrain_creator"), "Q1": ctx.Tr("repo.repo_name"),
"R1": ctx.Tr("repo.cloudbrain_task_name"), "S1": ctx.Tr("repo.modelarts.deletetime")}
}
func allCloudbrainValues(row int, rs *models.CloudbrainInfo, ctx *context.Context) map[string]string {
func allCloudbrainValues(row int, rs *models.CloudbrainInfo, ctx *context.Context, userMap map[int64]string) map[string]string {
return map[string]string{getCellName("A", row): rs.DisplayJobName, getCellName("B", row): getCloudbrainType(rs, ctx), getCellName("C", row): rs.Status, getCellName("D", row): rs.JobType,
getCellName("E", row): time.Unix(int64(rs.Cloudbrain.CreatedUnix), 0).Format(CREATE_TIME_FORMAT), getCellName("F", row): repo.GetCloudbrainWaitTime(rs.Cloudbrain),
getCellName("G", row): rs.TrainJobDuration, getCellName("H", row): repo.GetCloudbrainCardDuration(rs.Cloudbrain),
getCellName("I", row): getBrainStartTime(rs),
getCellName("J", row): getBrainEndTime(rs), getCellName("K", row): rs.ComputeResource, getCellName("L", row): getCloudbrainCardType(rs),
getCellName("M", row): getWorkServerNum(rs), getCellName("N", row): rs.Cloudbrain.AiCenter,
getCellName("O", row): getCloudbrainFlavorName(rs), getCellName("P", row): rs.Name,
getCellName("O", row): getCloudbrainFlavorName(rs), getCellName("P", row): userMap[rs.UserID],
getCellName("Q", row): getBrainRepo(rs), getCellName("R", row): rs.JobName, getCellName("S", row): getBrainDeleteTime(rs),
}
}


+ 3
- 0
routers/org/setting.go View File

@@ -64,6 +64,9 @@ func SettingsPost(ctx *context.Context, form auth.UpdateOrgSettingForm) {
if err == models.ErrUserNameIllegal {
ctx.Data["OrgName"] = true
ctx.RenderWithErr(ctx.Tr("form.illegal_username"), tplSettingsOptions, &form)
} else if models.IsErrNameReserved(err) {
ctx.Data["OrgName"] = true
ctx.RenderWithErr(ctx.Tr("org.form.name_reserved", form.Name), tplSettingsOptions, &form)
} else {
ctx.ServerError("ChangeUserName", err)
}


+ 3
- 1
routers/repo/attachment_dir.go View File

@@ -37,6 +37,8 @@ func GetDirSomeFiles(ctx *context.Context) {
cacheResult, err := getAttachmentDirFromCache(cacheKey)
if err == nil {
log.Info("load from cache.")
//update redis status
setAttachmentDirToCache(cacheKey, *cacheResult)
ctx.JSON(200, map[string]interface{}{
"result_code": "0",
"data": cacheResult.DirList,
@@ -338,7 +340,7 @@ func setAttachmentDirToCache(msgKey string, dirList DirRedisCache) {
msgMapJson, _ := json.Marshal(dirList)
redisValue := string(msgMapJson)
log.Info("set redis key=" + msgKey + " value=" + redisValue)
re, err := redis_client.Setex(msgKey, redisValue, 7*24*3600*time.Second)
re, err := redis_client.Setex(msgKey, redisValue, 30*24*3600*time.Second)
if err == nil {
log.Info("re =" + fmt.Sprint(re))
} else {


+ 12
- 8
routers/repo/cloudbrain.go View File

@@ -3163,15 +3163,19 @@ func GetCloudbrainCluster(task models.Cloudbrain, ctx *context.Context) string {
}
func GetCloudbrainCardDuration(task models.Cloudbrain) string {
cardNum := int(0)
spec, err := resource.GetCloudbrainSpec(task.ID)
if err != nil {
log.Info("error:" + err.Error())
return ""
}
if spec != nil {
cardNum = spec.AccCardsNum
spec := task.Spec
cardNum = 1
if spec == nil {
specdb, err := models.GetSpecAccCardsNumByID(task.ID)
if err != nil {
log.Info("error:" + err.Error())
return ""
}
if specdb != nil {
cardNum = specdb.AccCardsNum
}
} else {
cardNum = 1
cardNum = spec.AccCardsNum
}
var workServerNumber int64
if task.WorkServerNumber >= 1 {


+ 2
- 2
routers/repo/view.go View File

@@ -971,7 +971,7 @@ func ContributorsAPI(ctx *context.Context) {
} else {
// new committer info
var newContributor = &ContributorInfo{
user, user.RelAvatarLink(), user.Name, user.Email, c.CommitCnt,
nil, user.RelAvatarLink(), user.Name, "", c.CommitCnt,
}
count++
contributorInfos = append(contributorInfos, newContributor)
@@ -984,7 +984,7 @@ func ContributorsAPI(ctx *context.Context) {
existedContributorInfo.CommitCnt += c.CommitCnt
} else {
var newContributor = &ContributorInfo{
user, "", "", c.Email, c.CommitCnt,
nil, "", "", c.Email, c.CommitCnt,
}
count++
contributorInfos = append(contributorInfos, newContributor)


+ 11
- 6
routers/routes/routes.go View File

@@ -966,7 +966,7 @@ func RegisterRoutes(m *macaron.Macaron) {
}, reqSignIn)

// ***** Release Attachment Download without Signin
m.Get("/:username/:reponame/releases/download/:vTag/:fileName", ignSignIn, context.RepoAssignment(), repo.MustBeNotEmpty, repo.RedirectDownload)
m.Get("/:username/:reponame/releases/download/:vTag/:fileName", ignSignIn, context.LowLimiter(), context.RepoAssignment(), repo.MustBeNotEmpty, repo.RedirectDownload)

m.Group("/:username/:reponame", func() {
m.Group("/settings", func() {
@@ -1060,7 +1060,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Combo("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader, repo.SetEditorconfigIfExists).
Get(repo.SetDiffViewStyle, repo.CompareDiff).
Post(reqSignIn, context.RepoMustNotBeArchived(), reqRepoPullsReader, repo.MustAllowPulls, bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
}, context.RepoAssignment(), context.UnitTypes())
}, context.LowLimiter(), context.RepoAssignment(), context.UnitTypes())

// Grouping for those endpoints that do require authentication
m.Group("/:username/:reponame", func() {
@@ -1187,7 +1187,7 @@ func RegisterRoutes(m *macaron.Macaron) {
}
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
})
}, ignSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoReleaseReader)
}, ignSignIn, context.LowLimiter(), context.RepoAssignment(), context.UnitTypes(), reqRepoReleaseReader)

m.Group("/:username/:reponame", func() {
m.Post("/topics", repo.TopicsPost)
@@ -1253,6 +1253,9 @@ func RegisterRoutes(m *macaron.Macaron) {
})

}, context.RepoRef())
}, ignSignIn, context.LowLimiter(), context.RepoAssignment(), context.UnitTypes())

m.Group("/:username/:reponame", func() {

m.Group("/cloudbrain", func() {
m.Group("/:id", func() {
@@ -1472,7 +1475,9 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/blockchain", func() {
m.Get("", repo.BlockChainIndex)
}, context.RepoRef())
}, ignSignIn, context.LowLimiter(), context.RepoAssignment(), context.UnitTypes())

m.Group("/:username/:reponame", func() {
m.Group("/wiki", func() {
m.Get("/?:page", repo.Wiki)
m.Get("/_pages", repo.WikiPages)
@@ -1583,18 +1588,18 @@ func RegisterRoutes(m *macaron.Macaron) {
}, context.RepoRef(), reqRepoCodeReader)
m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)",
repo.MustBeNotEmpty, reqRepoCodeReader, repo.RawDiff)
}, ignSignIn, context.RepoAssignment(), context.UnitTypes())
}, ignSignIn, context.LowLimiter(), context.RepoAssignment(), context.UnitTypes())
m.Group("/:username/:reponame", func() {
m.Get("/stars", repo.Stars)
m.Get("/watchers", repo.Watchers)
m.Get("/search", reqRepoCodeReader, repo.Search)
}, ignSignIn, context.RepoAssignment(), context.RepoRef(), context.UnitTypes())
}, ignSignIn, context.LowLimiter(), context.RepoAssignment(), context.RepoRef(), context.UnitTypes())

m.Group("/:username", func() {
m.Group("/:reponame", func() {
m.Get("", repo.SetEditorconfigIfExists, repo.Home)
m.Get("\\.git$", repo.SetEditorconfigIfExists, repo.Home)
}, ignSignIn, context.RepoAssignment(), context.RepoRef(), context.UnitTypes())
}, ignSignIn, context.HighLimiter(), context.RepoAssignment(), context.RepoRef(), context.UnitTypes())

m.Group("/:reponame", func() {
m.Group("\\.git/info/lfs", func() {


+ 59
- 11
services/ai_task_service/cluster/c2net.go View File

@@ -180,7 +180,7 @@ func generateCommand(repoName, bootFile, datasetName string) string {
}
currentTimeNow := time.Now()
timePostfix := currentTimeNow.Format("20060102_150405")
command += "cd " + copyDatasetPath + ";echo " + timePostfix + " | tee /output/log_" + timePostfix + ".txt; uvicorn " + bootonlyfile + ":app --host 0.0.0.0 --port $OCTOPUS_NOTEBOOK_PORT 2>&1 | tee -a /output/log_" + timePostfix + ".txt;"
command += "cd " + copyDatasetPath + ";echo " + timePostfix + " | tee /output/log_" + timePostfix + ".txt; uvicorn " + bootonlyfile + ":app --log-level debug --host 0.0.0.0 --port $OCTOPUS_NOTEBOOK_PORT 2>&1 | tee -a /output/log_" + timePostfix + ".txt;"

log.Info("comand=" + command)
return command
@@ -351,8 +351,28 @@ func (c C2NetClusterAdapter) GetNoteBookUrl(jobId string) (string, error) {
if res.Url == "" {
return "", errors.New("notebook task error")
}
onlyForOnlineInference(res.Url, jobId)
return res.Url + "?token=" + res.Token, nil
}

func onlyForOnlineInference(url string, jobId string) {
cloudbrainTask, bizErr := models.GetCloudbrainByJobID(jobId)
if bizErr == nil {
if cloudbrainTask.JobType != string(models.JobTypeOnlineInference) {
return
}
} else {
return
}
if strings.HasPrefix(url, setting.Grampus.NoteBookDomainURL) {
tmpurl := strings.Replace(url, setting.Grampus.NoteBookDomainURL, setting.Grampus.NoteBookLocalURL, 1)
grampus.ClickOnce(tmpurl)
tmpurl += "/queue/join"
wsurl := strings.Replace(tmpurl, "http", "ws", 1)
grampus.SendMsgToWebsocket(wsurl, "{\"msg\":\"send_hash\"}")
}
}

func (c C2NetClusterAdapter) GetNoteBookOperationProfile(jobId string) (*entity.OperationProfile, error) {
if jobId == "" {
log.Error("jobid is empty")
@@ -694,23 +714,49 @@ func (c C2NetClusterAdapter) GetLog(opts entity.ClusterLogOpts) (*entity.Cluster
exitDiagnostics := getGrampusExitDiagnostics(opts.JobId)
var content string
var err error
if opts.WorkServerNum > 1 {
if opts.WorkServerNum < 1 || opts.NodeId > opts.WorkServerNum-1 {
return nil, errors.New("query parameter is wrong")
}
content, err = grampus.GetTrainJobLog(opts.JobId, opts.NodeId)
if opts.JobType == string(models.JobTypeOnlineInference) {
log.Info("return JobTypeOnlineInference log.")
exitDiagnostics = ""
content = getOnlineInferenceLog(opts)
} else {
content, err = grampus.GetTrainJobLog(opts.JobId)
}
if err != nil {
log.Error("GetLog err.opts=%+v,err=%v", opts, err)
content = ""
if opts.WorkServerNum > 1 {
if opts.WorkServerNum < 1 || opts.NodeId > opts.WorkServerNum-1 {
return nil, errors.New("query parameter is wrong")
}
content, err = grampus.GetTrainJobLog(opts.JobId, opts.NodeId)
} else {
content, err = grampus.GetTrainJobLog(opts.JobId)
}
if err != nil {
log.Error("GetLog err.opts=%+v,err=%v", opts, err)
content = ""
}
}
return &entity.ClusterLog{
Content: content + "\n" + exitDiagnostics,
}, nil
}

func getOnlineInferenceLog(opts entity.ClusterLogOpts) string {
helper := storage_helper.SelectUploaderFromStorageType(entity.MINIO)
//查找日志文件
files := getLogFilesInStorage(helper, helper.GetJobDefaultObjectKeyPrefix(opts.JobName)+"/model", ".txt")
if len(files) == 0 {
//此时未找符合条件的文件
log.Info("Not found file.")
return ""
}
//默认选择第一个文件
file := files[0]
opts.Direction = entity.UP
//计算开始行和结束行
_, endLine := findStartAndEnd(opts, file.RelativePath, helper)
//获取日志内容
result, _, _ := getLogInStorage(1, endLine, helper, file.RelativePath)

return result
}

func getGrampusExitDiagnostics(jobId string) string {
result, err := grampus.GetJob(jobId)
if err != nil {
@@ -725,6 +771,8 @@ func getGrampusExitDiagnostics(jobId string) string {

func (c C2NetClusterAdapter) GetLogDownloadInfo(opts entity.ClusterLogDownloadInfoOpts) (*entity.FileDownloadInfo, error) {
res, err := c.GetLog(entity.ClusterLogOpts{
JobType: opts.JobType,
JobName: opts.JobName,
JobId: opts.JobId,
NodeId: opts.NodeId,
WorkServerNum: opts.WorkServerNum,


+ 1
- 1
services/ai_task_service/schedule/model_schedule.go View File

@@ -206,7 +206,7 @@ func LocalMigrateOperate(jobName, computeSource string, r *models.ModelMigrateRe
if computeSource == models.NPUResource {
targetObjectPrefix := strings.TrimSuffix(r.DestObjectKey, models.ModelSuffix)
if err := MoveBucketInOpenIOBS(r.DestObjectKey, targetObjectPrefix, r.DestBucket, setting.Bucket); err != nil {
log.Error("MoveBucketInOpenIMinio err.%v", err)
log.Error("MoveBucketInOpenIObs err.%v", err)
if tmpErr := models.UpdateModelMigrateStatusByStep(r, models.BucketMoveFailed); tmpErr != nil {
log.Error("UpdateModelMigrateStatusByStep error. r.ID=%d step=%d err=%v", r.ID, models.BucketMoveFailed, tmpErr)
}


+ 5
- 3
services/ai_task_service/task/grampus_online_infer_task.go View File

@@ -5,6 +5,7 @@ import (

"code.gitea.io/gitea/entity"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/cloudbrain"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
@@ -56,9 +57,10 @@ func GetGrampusOnlineInferConfig(opts entity.AITaskConfigKey) *entity.AITaskBase
AcceptStorageType: []entity.StorageType{entity.MINIO, entity.OBS},
},
entity.ContainerOutPutPath: {
ContainerPath: outputPath,
AcceptStorageType: []entity.StorageType{entity.MINIO},
MKDIR: false,
ContainerPath: outputPath,
StorageRelativePath: cloudbrain.ModelMountPath,
AcceptStorageType: []entity.StorageType{entity.MINIO},
MKDIR: false,
},
},
}


+ 2
- 1
services/ai_task_service/task/task_base.go View File

@@ -6,6 +6,8 @@ import (

cloudbrainService "code.gitea.io/gitea/services/cloudbrain"

"strconv"

"code.gitea.io/gitea/entity"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/convert"
@@ -21,7 +23,6 @@ import (
"code.gitea.io/gitea/services/ai_task_service/container_builder"
"code.gitea.io/gitea/services/ai_task_service/context"
"code.gitea.io/gitea/services/cloudbrain/resource"
"strconv"
)

var taskMap = map[string]AITaskTemplate{}


+ 3
- 0
services/ai_task_service/task/task_service.go View File

@@ -407,6 +407,8 @@ func QueryTaskLog(opts entity.QueryLogOpts, getLogRemote GetLogFunc) (*entity.Cl
aiConfig := GetDetailConfigInfoByCloudbrain(cloudbrain)
return getLogRemote(entity.ClusterLogOpts{
JobId: cloudbrain.JobID,
JobType: cloudbrain.JobType,
JobName: cloudbrain.JobName,
BaseLine: opts.BaseLine,
Lines: opts.Lines,
Direction: opts.Order,
@@ -429,6 +431,7 @@ func GetLogDownloadInfo(opts entity.GetLogDownloadInfoReq, getLogDownloadInfo Ge
}
aiConfig := GetDetailConfigInfoByCloudbrain(cloudbrain)
return getLogDownloadInfo(entity.ClusterLogDownloadInfoOpts{
JobType: cloudbrain.JobType,
JobId: cloudbrain.JobID,
ObjectKeyPrefix: aiConfig.LogObjectPrefix,
StorageType: aiConfig.LogStorageType,


+ 2
- 2
templates/base/head_navbar.tmpl View File

@@ -61,7 +61,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>
@@ -110,7 +110,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>


+ 2
- 2
templates/base/head_navbar_fluid.tmpl View File

@@ -58,7 +58,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=08ed2763-e77b-4326-b06d-fab35338fe05&redirect_uri=https://bbs.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.forum"}}</span></a>
@@ -104,7 +104,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>


+ 2
- 2
templates/base/head_navbar_home.tmpl View File

@@ -50,7 +50,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>
@@ -98,7 +98,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>


+ 2
- 2
templates/base/head_navbar_pro.tmpl View File

@@ -60,7 +60,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>
@@ -108,7 +108,7 @@
{{end}}
<a class="item" target="_blank" href="https://openi.pcl.ac.cn/login/oauth/authorize?client_id=9c23803d-b190-4b33-a59a-01a65f439bce&redirect_uri=https://course.openi.org.cn/auth/openi/login&response_type=code&state=STATE"><span>{{.i18n.Tr "custom.head.course"}}</span></a>
<a class="item" href="{{AppSubUrl}}/OpenI">{{.i18n.Tr "custom.head.openi.repo"}}</a>
<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>
<!--<a class="item" href="{{AppSubUrl}}/tech/tech_view">科技2030项目</a>-->
</div>
</div>


+ 13
- 0
templates/status/429.tmpl View File

@@ -0,0 +1,13 @@
{{template "base/head" .}}
{{if .IsRepo}}<div class="repository">{{template "repo/header" .}}</div>{{end}}

<div class="ui container center" style="min-height: 70%;">
<div class="ui basic very padded segment">

<h2>{{.i18n.Tr "error429_index"}}</h2>
<p>{{.i18n.Tr "error429" | Safe}}</p>
<button class="center el-button el-button--success el-button--large" onclick="JavaScript:window.location.reload()"><i class="el-icon-refresh"></i><span>{{.i18n.Tr "home.refresh"}}</span></button>
</div>
</div>

{{template "base/footer" .}}

+ 3
- 0
web_src/vuepages/pages/cloudbrain/configs.js View File

@@ -1125,6 +1125,9 @@ export const DetailPageConfigs = {
}, {
name: 'operationProfile'
}, {
name: 'logs',
noScroll: true,
},{
name: 'resultDownload'
}],
}],


+ 1
- 1
web_src/vuepages/pages/model/mind/index.vue View File

@@ -108,7 +108,7 @@
<p v-for="(descr, descrIndex) in tabContent[activeTab].descr" :key="descrIndex">{{ descr }}</p>
</div>
<div class="life-stage">
<div class="title">成长生命期阶段版本</div>
<div class="title">成长生命期阶段版本<span v-if="activeTab == 0">(当前最新版本——进阶版1.5T Tokens)</span></div>
<div class="descr">您提交的申请体验通过审核后,我们将提供中间 checkpoints 供您研究使用;随着训练的推进,我们将提供对应阶段的 checkpoints 。</div>
<div class="stage-c">
<div class="stage" v-for="(item, index) in tabContent[activeTab].stage" :key="index">


Loading…
Cancel
Save