diff --git a/custom/public/rotation3D/rotation3D.css b/custom/public/rotation3D/rotation3D.css index 032096b48..4fd12283c 100755 --- a/custom/public/rotation3D/rotation3D.css +++ b/custom/public/rotation3D/rotation3D.css @@ -29,51 +29,22 @@ } .rotation3D__item .scale{ position: absolute; top: 0; width: 100%; height: 100%; } .rotation3D__item .cont{ position: relative; z-index: 2; } -.rotation3D__item .cont .iconfont { font-size: 28px; margin-top: 30px; margin-bottom: 96px; display: block; } +.rotation3D__item .cont .iconfont { font-size: 28px; margin-top: 30px; margin-bottom: 96px; display: block; height: 35px;} .rotation3D__item .cont p{ color: #101010; } -.itemList .rotation3D__item .cont p::after{ - font-size: 12px; - content: ''; - position: absolute; - left: 0; - right: 0; - margin-top: 60px; - color: #101010; -} -.itemList .rotation3D__item:nth-child(1) .cont p::after{ - content: "鹏城云脑一号"; -} -.itemList .rotation3D__item:nth-child(2) .cont p::after{ - content: "鹏城云脑二号"; -} -.itemList .rotation3D__item:nth-child(3) .cont p::after{ - content: "北大人工智能集群系统"; -} -.itemList .rotation3D__item:nth-child(4) .cont p::after{ - content: "合肥类脑智能开放平台"; +.lineList .rotation3D__line:nth-child(5n+0) .dot{ } -.itemList .rotation3D__item:nth-child(5) .cont p::after{ - content: "武汉人工智能计算中心"; +.lineList .rotation3D__line:nth-child(5n+1) .dot{ + animation-delay: 1s; } -.itemList .rotation3D__item:nth-child(6) .cont p::after{ - content: "西安未来人工智能计算中心"; +.lineList .rotation3D__line:nth-child(5n+2) .dot{ + animation-delay: 3s; } -.itemList .rotation3D__item:nth-child(7) .cont p::after{ - content: "更多接入中…"; +.lineList .rotation3D__line:nth-child(5n+3) .dot{ + animation-delay: 2s; } -.itemList .rotation3D__item:nth-child(8) .cont p::after{ - content: "中原人工智能计算中心"; +.lineList .rotation3D__line:nth-child(5n+3) .dot{ + animation-delay: 4s; } -.itemList .rotation3D__item:nth-child(9) .cont p::after{ - content: "成都人工智能计算中心"; -} -.itemList .rotation3D__item:nth-child(10) .cont p::after{ - content: "横琴先进智能计算中心"; -} -.itemList .rotation3D__item:nth-child(11) .cont p::after{ - content: "国家超级计算济南中心"; -} - .rotation3D__item.blue{ color: #01e9fc; } .rotation3D__item.green{ color: #b4b3ca; } .rotation3D__item.yellow{ color: #ffd200; } @@ -90,14 +61,17 @@ ---------------------------*/ .rotation3D__line{ position: absolute; left: 50%; top: 50%; - display: block; width: 1px; height: 50%; + display: block; + width: 30px; + height: 50%; padding-top: 60px; color: #fff; font-size: 50px; /*background: #fff;*/ /*原点设置在中间*/ transform-origin: 50% 0; transform-style: preserve-3d; -} -.rotation3D__line .pos{ position: absolute; top: 0; } + overflow: hidden; + } +.rotation3D__line .pos{ position: absolute; top: 0; left: 15px;} .rotation3D__line svg { position: absolute; top: 0; } .rotation3D__line svg path { stroke: #fff; fill: none; @@ -139,8 +113,10 @@ position: absolute; font-size: 12px; color: #888; - transform: rotate(180deg)scale(0.80); -} + transform:scale(0.80); + transform-origin:left; + white-space: nowrap; + } /*颜色*/ .rotation3D__line.blue { color: #07b2f9; } diff --git a/models/cloudbrain.go b/models/cloudbrain.go index b308beab1..2cfae1787 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -134,7 +134,7 @@ type Cloudbrain struct { CanDebug bool `xorm:"-"` CanDel bool `xorm:"-"` CanModify bool `xorm:"-"` - Type int + Type int `xorm:"INDEX"` BenchmarkTypeID int BenchmarkChildTypeID int @@ -2046,3 +2046,30 @@ func GetDatasetInfo(uuidStr string) (map[string]DatasetInfo, string, error) { return datasetInfos, datasetNames, nil } + +func GetNewestJobsByAiCenter() ([]int64, error) { + ids := make([]int64, 0) + return ids, x. + Select("max(id) as id"). + Where("type=? and ai_center!='' and ai_center is not null", TypeC2Net). + GroupBy("ai_center"). + Table(Cloudbrain{}). + Find(&ids) +} + +func GetNewestJobsByType() ([]int64, error) { + ids := make([]int64, 0) + return ids, x. + Select("max(id) as id"). + In("type", TypeCloudBrainOne, TypeCloudBrainTwo). + GroupBy("type"). + Table(Cloudbrain{}). + Find(&ids) +} + +func GetCloudbrainByIDs(ids []int64) ([]*Cloudbrain, error) { + cloudbrains := make([]*Cloudbrain, 0) + return cloudbrains, x. + In("id", ids). + Find(&cloudbrains) +} diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 74a93e6f4..0e9e1d4f1 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -7,6 +7,7 @@ package setting import ( "encoding/base64" + "encoding/json" "fmt" "io" "io/ioutil" @@ -64,7 +65,16 @@ const ( ReCaptcha = "recaptcha" ) -// settings +type C2NetSequenceInfo struct { + ID int `json:"id"` + Name string `json:"name"` + Content string `json:"content"` +} + +type C2NetSqInfos struct { + C2NetSqInfo []*C2NetSequenceInfo `json:"sequence"` +} + var ( // AppVer settings AppVer string @@ -537,13 +547,16 @@ var ( //grampus config Grampus = struct { - Env string - Host string - UserName string - Password string - SpecialPools string + Env string + Host string + UserName string + Password string + SpecialPools string + C2NetSequence string }{} + C2NetInfos *C2NetSqInfos + //elk config ElkUrl string ElkUser string @@ -1428,7 +1441,12 @@ func GetGrampusConfig() { Grampus.UserName = sec.Key("USERNAME").MustString("") Grampus.Password = sec.Key("PASSWORD").MustString("") Grampus.SpecialPools = sec.Key("SPECIAL_POOL").MustString("") - + Grampus.C2NetSequence = sec.Key("C2NET_SEQUENCE").MustString("{\"sequence\":[{\"id\":1,\"name\":\"cloudbrain_one\",\"content\":\"鹏城云脑一号\"},{\"id\":2,\"name\":\"cloudbrain_two\",\"content\":\"鹏城云脑二号\"},{\"id\":3,\"name\":\"beida\",\"content\":\"北大人工智能集群系统\"},{\"id\":4,\"name\":\"hefei\",\"content\":\"合肥类脑智能开放平台\"},{\"id\":5,\"name\":\"wuhan\",\"content\":\"武汉人工智能计算中心\"},{\"id\":6,\"name\":\"xian\",\"content\":\"西安未来人工智能计算中心\"},{\"id\":7,\"pclcci\":\"more\",\"content\":\"鹏城云计算所\"},{\"id\":8,\"name\":\"xuchang\",\"content\":\"中原人工智能计算中心\"},{\"id\":9,\"name\":\"chengdu\",\"content\":\"成都人工智能计算中心\"},{\"id\":10,\"name\":\"more\",\"content\":\"横琴先进智能计算中心\"},{\"id\":11,\"name\":\"more\",\"content\":\"国家超级计算济南中心\"}]}") + if Grampus.C2NetSequence != "" { + if err := json.Unmarshal([]byte(Grampus.C2NetSequence), &C2NetInfos); err != nil { + log.Error("Unmarshal(C2NetSequence) failed:%v", err) + } + } } func SetRadarMapConfig() { diff --git a/modules/storage/obs.go b/modules/storage/obs.go index 33730b72c..ab978b084 100755 --- a/modules/storage/obs.go +++ b/modules/storage/obs.go @@ -575,6 +575,8 @@ func GetObsLogFileName(prefix string) (string, error) { log.Error("PutObject failed:", err.Error()) return "", err } - + if output == nil || len(output.Contents) == 0 { + return "", errors.New("obs log files not exist") + } return output.Contents[0].Key, nil } diff --git a/public/home/home.js b/public/home/home.js index 95ea3da4c..70b9d7253 100755 --- a/public/home/home.js +++ b/public/home/home.js @@ -119,7 +119,6 @@ document.onreadystatechange = function () { continue; } } - refresh3DInfo(record); var recordPrefix = getMsg(record); if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ html += recordPrefix + actionName; @@ -208,29 +207,6 @@ function getTaskLink(record){ return re; } -function refresh3DInfo(record){ - if(record.OpType == "25" || record.OpType == "29" || record.OpType == "31"){ - //cloudbrain one - var lines = $('.rotation3D__line'); - var span = $('.rotation3D__line').find("span")[0]; - //console.log(span); - span.innerText =record.RefName; - //$('.rotation3D__line').find("span").eq(0).text(record.RefName) - //console.log("cloudbrain one line length=" + lines.length); - //lines[0].find("span").text(record.RefName); - }else if(record.OpType == "26" || record.OpType == "27" || record.OpType == "28"){ - //cloudbrain two - var lines = $('.rotation3D__line'); - //console.log("cloudbrain two line length=" + lines.length); - var span = $('.rotation3D__line').find("span")[1]; - //console.log(span); - if(span != null){ - span.innerText =record.RefName; - } - } - -} - function getMsg(record){ var html =""; html += "