From 94282132eafa537008cde6ee151399f8f6beaceb Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 7 Jul 2022 18:15:26 +0800 Subject: [PATCH 01/18] interface --- models/cloudbrain.go | 26 ++++++++++++++ routers/api/v1/api.go | 1 + routers/api/v1/repo/cloudbrain.go | 60 +++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 8e1b94a97..9fad6252e 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -2018,3 +2018,29 @@ 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!=''", TypeC2Net). + GroupBy("ai_center"). + Table(Cloudbrain{}). + Find(ids) +} + +func GetNewestJobsByType() ([]*Cloudbrain, error) { + cloudbrains := make([]*Cloudbrain, 0) + return cloudbrains, x. + Select("type,max(id) as id"). + In("type", TypeCloudBrainOne, TypeCloudBrainTwo). + GroupBy("type"). + Find(&cloudbrains) +} + +func GetCloudbrainByIDs(ids []int64) ([]*Cloudbrain, error) { + cloudbrains := make([]*Cloudbrain, 0) + return cloudbrains, x. + In("id", ids). + Find(&cloudbrains) +} diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index e6c572e73..222ca71c8 100755 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1056,6 +1056,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/prd/event", authentication.AcceptWechatEvent) }) m.Get("/wechat/material", authentication.GetMaterial) + m.Get("/cloudbrain/get_newest_job", repo.GetNewestJobs) }, securityHeaders(), context.APIContexter(), sudo()) } diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index a81263823..54c070f5e 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -207,3 +207,63 @@ func CloudBrainModelList(ctx *context.APIContext) { "PageIsCloudBrain": true, }) } + +type JobInfo struct { + JobName string `json:"job_name"` + AiCenterId int `json:"ai_center_id"` +} + +func GetNewestJobs(ctx *context.APIContext) { + idsC2Net, err := models.GetNewestJobsByAiCenter() + if err != nil { + log.Error("GetNewestJobsByAiCenter(%s) failed:%v", err.Error()) + return + } + + jobsCloudbrain, err := models.GetNewestJobsByType() + if err != nil { + log.Error("GetNewestJobsByType(%s) failed:%v", err.Error()) + return + } + + var ids []int64 + + for _, id := range idsC2Net { + log.Info("%d", id) + } + + copy(ids, idsC2Net) + for _, job := range jobsCloudbrain { + log.Info("%d, %d", job.Type, job.ID) + ids = append(ids, job.ID) + } + + jobs, err := models.GetCloudbrainByIDs(ids) + if err != nil { + log.Error("GetCloudbrainByIDs(%s) failed:%v", err.Error()) + return + } + + jobInfos := make([]JobInfo, 0) + for _, job := range jobs { + switch job.Type { + case models.TypeCloudBrainOne: + jobInfos = append(jobInfos, JobInfo{ + JobName: job.DisplayJobName, + AiCenterId: 0, + }) + case models.TypeCloudBrainTwo: + jobInfos = append(jobInfos, JobInfo{ + JobName: job.DisplayJobName, + AiCenterId: 1, + }) + case models.TypeC2Net: + jobInfos = append(jobInfos, JobInfo{ + JobName: job.DisplayJobName, + AiCenterId: 3, + }) + } + } + + ctx.JSON(http.StatusOK, jobInfos) +} From 81a32ac2d41cf3aeee99a10d01df8a777997e37a Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 8 Jul 2022 10:38:30 +0800 Subject: [PATCH 02/18] debug --- models/cloudbrain.go | 13 +++++++------ routers/api/v1/repo/cloudbrain.go | 14 +++----------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 9fad6252e..00b52f763 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -2026,16 +2026,17 @@ func GetNewestJobsByAiCenter() ([]int64, error) { Where("type=? and ai_center!=''", TypeC2Net). GroupBy("ai_center"). Table(Cloudbrain{}). - Find(ids) + Find(&ids) } -func GetNewestJobsByType() ([]*Cloudbrain, error) { - cloudbrains := make([]*Cloudbrain, 0) - return cloudbrains, x. - Select("type,max(id) as id"). +func GetNewestJobsByType() ([]int64, error) { + ids := make([]int64, 0) + return ids, x. + Select("max(id) as id"). In("type", TypeCloudBrainOne, TypeCloudBrainTwo). GroupBy("type"). - Find(&cloudbrains) + Table(Cloudbrain{}). + Find(&ids) } func GetCloudbrainByIDs(ids []int64) ([]*Cloudbrain, error) { diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 54c070f5e..40f4c5721 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -220,23 +220,15 @@ func GetNewestJobs(ctx *context.APIContext) { return } - jobsCloudbrain, err := models.GetNewestJobsByType() + idsCloudbrain, err := models.GetNewestJobsByType() if err != nil { log.Error("GetNewestJobsByType(%s) failed:%v", err.Error()) return } - var ids []int64 - - for _, id := range idsC2Net { - log.Info("%d", id) - } - + ids := make([]int64, len(idsC2Net), cap(idsC2Net)*2) copy(ids, idsC2Net) - for _, job := range jobsCloudbrain { - log.Info("%d, %d", job.Type, job.ID) - ids = append(ids, job.ID) - } + copy(ids, idsCloudbrain) jobs, err := models.GetCloudbrainByIDs(ids) if err != nil { From 00044fbc21ca3db93265e0d19ddd32b9bca0d389 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 8 Jul 2022 11:48:42 +0800 Subject: [PATCH 03/18] add interface --- modules/setting/setting.go | 32 ++++++++++++---- routers/api/v1/api.go | 1 + routers/api/v1/repo/cloudbrain.go | 62 +++++++++++++++++++++++++------ 3 files changed, 76 insertions(+), 19 deletions(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 2058c51a8..012a2918b 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 @@ -531,13 +541,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 @@ -1416,7 +1429,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/routers/api/v1/api.go b/routers/api/v1/api.go index 222ca71c8..21da4ace6 100755 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1057,6 +1057,7 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/wechat/material", authentication.GetMaterial) m.Get("/cloudbrain/get_newest_job", repo.GetNewestJobs) + m.Get("/cloudbrain/get_center_info", repo.GetAICenterInfo) }, securityHeaders(), context.APIContexter(), sudo()) } diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 40f4c5721..301d4de13 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -6,6 +6,7 @@ package repo import ( + "code.gitea.io/gitea/modules/setting" "encoding/json" "net/http" "sort" @@ -238,24 +239,61 @@ func GetNewestJobs(ctx *context.APIContext) { jobInfos := make([]JobInfo, 0) for _, job := range jobs { + var id int + var content string switch job.Type { case models.TypeCloudBrainOne: - jobInfos = append(jobInfos, JobInfo{ - JobName: job.DisplayJobName, - AiCenterId: 0, - }) + id, content = getAICenterID("cloudbrain_one") + if content == "" { + log.Error("job(%s) has no match config info", job.DisplayJobName) + continue + } case models.TypeCloudBrainTwo: - jobInfos = append(jobInfos, JobInfo{ - JobName: job.DisplayJobName, - AiCenterId: 1, - }) + id, content = getAICenterID("cloudbrain_two") + if content == "" { + log.Error("job(%s) has no match config info", job.DisplayJobName) + continue + } case models.TypeC2Net: - jobInfos = append(jobInfos, JobInfo{ - JobName: job.DisplayJobName, - AiCenterId: 3, - }) + centerInfo := strings.Split(job.AiCenter, "+") + if len(centerInfo) != 2 { + log.Error("job(%s):ai_center(%s) is wrong", job.DisplayJobName, job.AiCenter) + continue + } + id, content = getAICenterID(centerInfo[0]) + if content == "" { + log.Error("job(%s) has no match config info", job.DisplayJobName) + continue + } + default: + log.Error("no match info") + continue } + + jobInfos = append(jobInfos, JobInfo{ + JobName: content, + AiCenterId: id, + }) } ctx.JSON(http.StatusOK, jobInfos) } + +func GetAICenterInfo(ctx *context.APIContext) { + if setting.C2NetInfos == nil { + log.Error("C2NET_SEQUENCE is incorrect") + return + } + + ctx.JSON(http.StatusOK, setting.C2NetInfos.C2NetSqInfo) +} + +func getAICenterID(name string) (int, string) { + for _, info := range setting.C2NetInfos.C2NetSqInfo { + if name == info.Name { + return info.ID, info.Content + } + } + + return 0, "" +} From 707ea6f3ba77213bb21c239936d39acf6cc337ef Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 8 Jul 2022 16:57:09 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/base/footer.tmpl | 34 ++++++++++++++++++++++++++++++++++ templates/home.tmpl | 6 ------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 802854716..375e63aa5 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -51,10 +51,40 @@ {{end}} diff --git a/templates/home.tmpl b/templates/home.tmpl index 36210d336..c1f563d27 100755 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -94,12 +94,6 @@
-
From f794775e440500243ae04e315b7b4fc40dbacf46 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 09:18:29 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- custom/public/rotation3D/rotation3D.css | 3 ++- templates/base/footer.tmpl | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/custom/public/rotation3D/rotation3D.css b/custom/public/rotation3D/rotation3D.css index 032096b48..9590cb45f 100755 --- a/custom/public/rotation3D/rotation3D.css +++ b/custom/public/rotation3D/rotation3D.css @@ -40,6 +40,7 @@ margin-top: 60px; color: #101010; } +/* .itemList .rotation3D__item:nth-child(1) .cont p::after{ content: "鹏城云脑一号"; } @@ -73,7 +74,7 @@ .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; } diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 375e63aa5..b33fd1cb8 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -115,9 +115,15 @@ }, methods: {}, }); - var pArrays = $('.itemList').find("p"); - console.log(pArrays.length); + $(document).ready(function(){ + var pArrays = $('.itemList').find("p"); + console.log(pArrays.length); + for(var i=0;i {{end}} From 58a939313a869a13fe5d7e1b02ddab2485f20b8b Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 09:29:57 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/home.js | 8 +++++--- templates/base/footer.tmpl | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index 95ea3da4c..74cfde9c8 100755 --- a/public/home/home.js +++ b/public/home/home.js @@ -211,16 +211,18 @@ function getTaskLink(record){ function refresh3DInfo(record){ if(record.OpType == "25" || record.OpType == "29" || record.OpType == "31"){ //cloudbrain one - var lines = $('.rotation3D__line'); + //var lines = $('.rotation3D__line'); var span = $('.rotation3D__line').find("span")[0]; //console.log(span); - span.innerText =record.RefName; + if(span != null){ + 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'); + //var lines = $('.rotation3D__line'); //console.log("cloudbrain two line length=" + lines.length); var span = $('.rotation3D__line').find("span")[1]; //console.log(span); diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index b33fd1cb8..eb46db12b 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -121,7 +121,7 @@ for(var i=0;i From a4cdbabf49859c8b22d45945c643226c860d99d9 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 09:40:12 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/base/footer.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index eb46db12b..a15a2a766 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -121,7 +121,7 @@ for(var i=0;i From 54f58ca237605f854c333ad157103c607528d188 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 09:51:45 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/base/footer.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index a15a2a766..333f87471 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -73,6 +73,7 @@ tmp["name"]=json[i].name; tmp["type"]="green"; tmp["icon"]=""; + tmp["content"]=json[i].content; serverItemList.push(tmp); } } From 3623badba1f848da22f84bea9f3bc407956bc938 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 10:11:14 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- custom/public/rotation3D/rotation3D.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/public/rotation3D/rotation3D.css b/custom/public/rotation3D/rotation3D.css index 9590cb45f..0628691e9 100755 --- a/custom/public/rotation3D/rotation3D.css +++ b/custom/public/rotation3D/rotation3D.css @@ -29,7 +29,7 @@ } .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; From 640e2b568ddd4dcbdcbdb2e6bb35531c5d55023f Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 10:46:00 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/home.js | 2 +- templates/base/footer.tmpl | 39 +++++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index 74cfde9c8..d1733208b 100755 --- a/public/home/home.js +++ b/public/home/home.js @@ -119,7 +119,7 @@ document.onreadystatechange = function () { continue; } } - refresh3DInfo(record); + //refresh3DInfo(record); var recordPrefix = getMsg(record); if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ html += recordPrefix + actionName; diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 333f87471..721743f46 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -51,7 +51,27 @@ {{end}} From a877b00e4ac6f43462f36653ffa85d5f66536858 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 11:00:24 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- custom/public/rotation3D/rotation3D.css | 1 + 1 file changed, 1 insertion(+) diff --git a/custom/public/rotation3D/rotation3D.css b/custom/public/rotation3D/rotation3D.css index 0628691e9..b161708a1 100755 --- a/custom/public/rotation3D/rotation3D.css +++ b/custom/public/rotation3D/rotation3D.css @@ -140,6 +140,7 @@ position: absolute; font-size: 12px; color: #888; + white-space: nowrap; transform: rotate(180deg)scale(0.80); } From 8354fc5cf613e41382838410a533b221279be4ea Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 11:15:19 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/base/footer.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 721743f46..dd3fee8e5 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -149,7 +149,7 @@ p.innerText=serverItemList[i].content; } - var lines=$('.rotation3D__line').find("span"); + var lines=$('.lineList').find("span"); console.log("lines length=" + lines.length); for(var i=0; i< lines.length;i++){ From ef4d379ba4216ed2541d057007045c743fe9fa07 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 11:27:13 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0span=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/home.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/home.tmpl b/templates/home.tmpl index c1f563d27..b90b20a28 100755 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -123,13 +123,13 @@ -
+
-
+
From cb7c1c01d7f998c21e56000c6bb22e9ddfdf79a2 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Mon, 11 Jul 2022 11:27:30 +0800 Subject: [PATCH 14/18] debug --- routers/api/v1/repo/cloudbrain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 301d4de13..3a41a5464 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -271,7 +271,7 @@ func GetNewestJobs(ctx *context.APIContext) { } jobInfos = append(jobInfos, JobInfo{ - JobName: content, + JobName: job.DisplayJobName, AiCenterId: id, }) } From fe78badfc5094ecf9f3871290452c47bf5177350 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 11 Jul 2022 14:29:20 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/base/footer.tmpl | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index dd3fee8e5..53f78dc1a 100755 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -62,7 +62,6 @@ dataType:"json", async:false, success:function(json){ - console.log("cloudbrain task info=" + json); for(var i=0;i < json.length;i++){ jobTask[json[i].ai_center_id] =json[i].job_name; } @@ -109,21 +108,6 @@ //数据 blue, green, yellow data: { itemList:serverItemList, - /* - itemList: [ - { name:'鹏城云脑一号', type:'blue', icon:'', }, - { name:'鹏城云脑二号', type:'blue', icon:'', }, - { name:'北大人工智能集群系统', type:'green', icon:'', }, - { name:'合肥类脑智能开放平台', type:'green', icon:'', }, - { name:'武汉人工智能计算中心', type:'green', icon:'', }, - { name:'西安未来人工智能计算中心', type:'green', icon:'', }, - { name:'……', type:'yellow', icon:'', }, - { name:'中原人工智能计算中心', type:'green', icon:'', }, - { name:'成都人工智能计算中心', type:'green', icon:'', }, - { name:'横琴先进智能计算中心', type:'green', icon:'', }, - { name:'国家超级计算济南中心', type:'green', icon:'', }, - ], - */ }, mounted: function () { new Rotation3D({ @@ -142,16 +126,11 @@ }); $(document).ready(function(){ var pArrays=$('.itemList').find("p"); - console.log("center length=" + pArrays.length); - for(var i=0;i"; From 13abb9c0c82a3a52f71c1069d21f0c560371135c Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Mon, 11 Jul 2022 15:11:14 +0800 Subject: [PATCH 17/18] add index --- models/cloudbrain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 00b52f763..ae7e9e6b0 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 @@ -2023,7 +2023,7 @@ func GetNewestJobsByAiCenter() ([]int64, error) { ids := make([]int64, 0) return ids, x. Select("max(id) as id"). - Where("type=? and ai_center!=''", TypeC2Net). + Where("type=? and ai_center!='' and ai_center is not null", TypeC2Net). GroupBy("ai_center"). Table(Cloudbrain{}). Find(&ids) From be102baa7706f038ff5a801eb60cc04d1de5d416 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 12 Jul 2022 11:37:10 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- custom/public/rotation3D/rotation3D.css | 62 +++++++------------------ 1 file changed, 18 insertions(+), 44 deletions(-) diff --git a/custom/public/rotation3D/rotation3D.css b/custom/public/rotation3D/rotation3D.css index b161708a1..4fd12283c 100755 --- a/custom/public/rotation3D/rotation3D.css +++ b/custom/public/rotation3D/rotation3D.css @@ -31,50 +31,20 @@ .rotation3D__item .cont{ position: relative; z-index: 2; } .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; } @@ -91,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; @@ -140,9 +113,10 @@ position: absolute; font-size: 12px; color: #888; + transform:scale(0.80); + transform-origin:left; white-space: nowrap; - transform: rotate(180deg)scale(0.80); -} + } /*颜色*/ .rotation3D__line.blue { color: #07b2f9; }