| @@ -10,6 +10,7 @@ import ( | |||
| "strings" | |||
| "code.gitea.io/gitea/modules/log" | |||
| "code.gitea.io/gitea/modules/setting" | |||
| "github.com/go-resty/resty/v2" | |||
| ) | |||
| @@ -71,8 +72,8 @@ func checkSetting() { | |||
| } | |||
| func loginCloudbrain() error { | |||
| HOST = "http://221.122.70.196:8081/atp-api" | |||
| KEY = "1" | |||
| HOST = setting.ModelSafetyTest.HOST | |||
| KEY = setting.ModelSafetyTest.KEY | |||
| return nil | |||
| } | |||
| @@ -725,6 +725,9 @@ var ( | |||
| GPUBaseDataSetUUID string | |||
| GPUCombatDataSetName string | |||
| GPUCombatDataSetUUID string | |||
| HOST string | |||
| KEY string | |||
| }{} | |||
| ModelApp = struct { | |||
| @@ -1572,6 +1575,8 @@ func getModelSafetyConfig() { | |||
| ModelSafetyTest.NPUBaseDataSetUUID = sec.Key("NPUBaseDataSetUUID").MustString("") | |||
| ModelSafetyTest.NPUCombatDataSetName = sec.Key("NPUCombatDataSetName").MustString("") | |||
| ModelSafetyTest.NPUCombatDataSetUUID = sec.Key("NPUCombatDataSetUUID").MustString("") | |||
| ModelSafetyTest.HOST = sec.Key("HOST").MustString("") | |||
| ModelSafetyTest.KEY = sec.Key("KEY").MustString("") | |||
| } | |||
| func getModelConvertConfig() { | |||
| @@ -266,7 +266,7 @@ page_dev_yunlao_desc4=Developers can freely select the corresponding computing r | |||
| page_dev_yunlao_desc5=If your model requires more computing resources, you can also apply for it separately. | |||
| page_dev_yunlao_apply=Apply Separately | |||
| c2net_title=China Computing Network | |||
| c2net_desc=The artificial intelligence computing power network promotion alliance has access to 11 intelligent computing centers, with a total scale of 1924p. | |||
| c2net_desc=Extensive access to intelligent computing centers and supercomputing centers across the country to provide users with free computing resources. | |||
| c2net_center=Center | |||
| search=Search | |||
| search_repo=Repository | |||
| @@ -3179,7 +3179,7 @@ foot.help = help | |||
| foot.copyright= Copyright: New Generation Artificial Intelligence Open Source Open Platform (OpenI) | |||
| Platform_Tutorial = Tutorial | |||
| foot.advice_feedback = Feedback | |||
| resource_description = Resource Note | |||
| [cloudbrain] | |||
| all_resource_cluster=All Cluster | |||
| all_ai_center=All Computing NET | |||
| @@ -267,8 +267,8 @@ page_dev_yunlao_desc3=中国算力网(C²NET)一期可实现不同人工智 | |||
| page_dev_yunlao_desc4=开发者可以根据使用需求,自由选择相应计算资源,可以测试模型在不同硬件环境下的适配能力、性能、稳定性等。 | |||
| page_dev_yunlao_desc5=如果您的模型需要更多的计算资源,也可以单独申请。 | |||
| page_dev_yunlao_apply=单独申请 | |||
| c2net_title=智算网络 | |||
| c2net_desc=人工智能算力网络推进联盟已接入11家智算中心,算力总规模1924P | |||
| c2net_title=中国算力网 | |||
| c2net_desc=广泛接入全国各地智算中心、超算中心,为用户提供免费算力资源 | |||
| c2net_center=中心 | |||
| search=搜索 | |||
| search_repo=项目 | |||
| @@ -3196,6 +3196,7 @@ foot.help=帮助 | |||
| foot.copyright= 版权所有:新一代人工智能开源开放平台(OpenI) | |||
| Platform_Tutorial=新手指引 | |||
| foot.advice_feedback = 意见反馈 | |||
| resource_description = 资源说明 | |||
| [cloudbrain] | |||
| all_resource_cluster=全部集群 | |||
| @@ -41,6 +41,7 @@ const ( | |||
| tplExploreExploreDataAnalysis base.TplName = "explore/data_analysis" | |||
| tplHomeTerm base.TplName = "terms" | |||
| tplHomePrivacy base.TplName = "privacy" | |||
| tplResoruceDesc base.TplName = "resource_desc" | |||
| ) | |||
| // Home render home page | |||
| @@ -820,3 +821,7 @@ func HomeTerm(ctx *context.Context) { | |||
| func HomePrivacy(ctx *context.Context) { | |||
| ctx.HTML(200, tplHomePrivacy) | |||
| } | |||
| func HomeResoruceDesc(ctx *context.Context) { | |||
| ctx.HTML(200, tplResoruceDesc) | |||
| } | |||
| @@ -26,7 +26,6 @@ import ( | |||
| "code.gitea.io/gitea/modules/util" | |||
| "code.gitea.io/gitea/services/cloudbrain/resource" | |||
| "code.gitea.io/gitea/services/reward/point/account" | |||
| uuid "github.com/satori/go.uuid" | |||
| ) | |||
| const ( | |||
| @@ -37,39 +36,6 @@ const ( | |||
| tplModelSafetyTestShow = "repo/modelsafety/show" | |||
| ) | |||
| func CloudBrainAiSafetyCreateTest(ctx *context.Context) { | |||
| log.Info("start to create CloudBrainAiSafetyCreate") | |||
| uuid := uuid.NewV4() | |||
| id := uuid.String() | |||
| seriaNoParas := ctx.Query("serialNo") | |||
| fileName := ctx.Query("fileName") | |||
| //if jobType == string(models.JobTypeBenchmark) { | |||
| req := aisafety.TaskReq{ | |||
| UnionId: id, | |||
| EvalName: "test1", | |||
| EvalContent: "test1", | |||
| TLPath: "test1", | |||
| Indicators: []string{"ACC", "ASS"}, | |||
| CDName: "CIFAR10_1000_FGSM", | |||
| BDName: "CIFAR10_1000基础数据集", | |||
| } | |||
| aisafety.GetAlgorithmList() | |||
| if seriaNoParas != "" { | |||
| aisafety.GetTaskStatus(seriaNoParas) | |||
| } else { | |||
| jsonStr, err := getJsonContent("http://192.168.207.34:8065/Test_zap1234/openi_aisafety/raw/branch/master/result/" + fileName) | |||
| serialNo, err := aisafety.CreateSafetyTask(req, jsonStr) | |||
| if err == nil { | |||
| log.Info("serialNo=" + serialNo) | |||
| time.Sleep(time.Duration(2) * time.Second) | |||
| aisafety.GetTaskStatus(serialNo) | |||
| } else { | |||
| log.Info("CreateSafetyTask error," + err.Error()) | |||
| } | |||
| } | |||
| } | |||
| func GetAiSafetyTaskByJob(job *models.Cloudbrain) { | |||
| if job == nil { | |||
| log.Error("GetCloudbrainByJobID failed") | |||
| @@ -348,6 +348,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
| m.Get("/action/notification", routers.ActionNotification) | |||
| m.Get("/recommend/home", routers.RecommendHomeInfo) | |||
| m.Get("/dashboard/invitation", routers.GetMapInfo) | |||
| m.Get("/resource_desc", routers.HomeResoruceDesc) | |||
| //m.Get("/recommend/org", routers.RecommendOrgFromPromote) | |||
| //m.Get("/recommend/repo", routers.RecommendRepoFromPromote) | |||
| m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote) | |||
| @@ -36,7 +36,8 @@ | |||
| {{else}} | |||
| <a href="{{AppSubUrl}}/user/login" class="item"><i class="envelope icon"></i> {{.i18n.Tr "custom.foot.advice_feedback"}}</a> | |||
| {{end}} | |||
| <a href="{{AppSubUrl}}/resource_desc" class="item" target="_blank"><i class="server icon"></i> {{.i18n.Tr "custom.resource_description"}}</a> | |||
| {{template "custom/extra_links_footer" .}} | |||
| </div> | |||
| </div> | |||
| @@ -33,6 +33,7 @@ | |||
| {{else}} | |||
| <a href="{{AppSubUrl}}/user/login" class="item"><i class="envelope icon"></i> {{.i18n.Tr "custom.foot.advice_feedback"}}</a> | |||
| {{end}} | |||
| <a href="{{AppSubUrl}}/resource_desc" class="item" target="_blank"><i class="server icon"></i> {{.i18n.Tr "custom.resource_description"}}</a> | |||
| {{template "custom/extra_links_footer" .}} | |||
| </div> | |||
| </div> | |||
| @@ -137,6 +137,8 @@ | |||
| {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} | |||
| 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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -249,6 +251,8 @@ | |||
| {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} | |||
| 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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -335,6 +339,8 @@ | |||
| placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' ovalue="{{.spec_id}}" | |||
| 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> | |||
| </div> | |||
| <div class="inline min_title field required"> | |||
| @@ -257,6 +257,8 @@ | |||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_specification"}}</label> | |||
| <select id="__specs__" class="ui search dropdown width48" placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" ovalue="{{.spec_id}}" name="spec_id" {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}> | |||
| </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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -150,6 +150,8 @@ | |||
| {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} | |||
| 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:265px;font-size:12px;width: 50%!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> | |||
| @@ -217,6 +217,8 @@ | |||
| {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} | |||
| 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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -190,6 +190,8 @@ | |||
| <div class="required min_title inline field" id="flavor_name"> | |||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui dropdown width48" id="__specs__" style='width:385px' name="spec_id" ovalue="{{.spec_id}}" {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}></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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -200,6 +200,8 @@ | |||
| <div class="required min_title inline field" id="flavor_name"> | |||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui dropdown width48" id="__specs__" style='width:385px' name="spec_id" ovalue="{{.spec_id}}" {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}></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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -277,6 +277,8 @@ | |||
| <div class="required min_title inline field" id="flaver_name"> | |||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui dropdown width48" id="__specs__" name="spec_id" ovalue="{{.spec_id}}" {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}></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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -84,6 +84,8 @@ | |||
| <select id="__specs__" class="ui search dropdown" 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:265px;font-size:12px;width: 50%!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> | |||
| @@ -248,6 +248,8 @@ | |||
| <div class="required inline min_title field" id="flaver_name"> | |||
| <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select class="ui dropdown width48" id="__specs__" name="spec_id" ovalue="{{.spec_id}}" {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}></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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -236,6 +236,8 @@ | |||
| <div class="required unite min_title inline field" id="flaver_name"> | |||
| <label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label> | |||
| <select id="__specs__" class="ui dropdown width80" style='width:385px' name="spec_id" ovalue="{{.spec_id}}" {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}}></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 width80" style="padding:0 5px;margin:6px 0;margin-left:60px;font-size:12px;"> | |||
| <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> | |||
| @@ -300,6 +300,8 @@ | |||
| {{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} | |||
| 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 width48" style="padding:0 5px;margin:6px 0;margin-left:155px;font-size:12px;"> | |||
| <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> | |||
| @@ -0,0 +1,92 @@ | |||
| {{template "base/head_home" .}} | |||
| <style> | |||
| .resource-desc td ul { | |||
| margin: 0em; | |||
| padding-inline-start: 20px; | |||
| padding-right: 10px; | |||
| } | |||
| </style> | |||
| <div class="ui resource-desc" style="width: 90%; margin: 0 auto"> | |||
| <h1 class="ui center am-pt-30 am-pb-20">平台资源说明</h1> | |||
| <div class="ui divider am-pb-10"></div> | |||
| <table class="ui celled structured table"> | |||
| <thead> | |||
| <tr> | |||
| <th>集群</th> | |||
| <th>计算资源</th> | |||
| <th>任务类型</th> | |||
| <th>卡类型</th> | |||
| <th>可用镜像</th> | |||
| <th>网络类型</th> | |||
| <th>数据集处理方式</th> | |||
| <th>容器目录说明</th> | |||
| <th>示例代码仓</th> | |||
| <th>备注</th> | |||
| </tr> | |||
| </thead> | |||
| <tbody id="resource-desc"></tbody> | |||
| </table> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| (function () { | |||
| $.ajax({ | |||
| url: "/dashboard/invitation", | |||
| type: "get", | |||
| data: { filename: "resource/resource_desc.json" }, | |||
| contentType: "application/json; charset=utf-8", | |||
| success(res) { | |||
| const fragment = document.createDocumentFragment(); | |||
| const data = JSON.parse(res); | |||
| console.log("data", data); | |||
| let html = ""; | |||
| let reourceLength; | |||
| data.forEach((resource) => { | |||
| Object.keys(resource).forEach((cardType, index) => { | |||
| let reourceLength = 0; | |||
| let html1 = ""; | |||
| resource[cardType].forEach((card) => { | |||
| console.log("card", card); | |||
| Object.keys(card).forEach((item) => { | |||
| let html2 = ""; | |||
| reourceLength += card[item].length; | |||
| let cardLength = 0; | |||
| card[item].forEach((el) => { | |||
| cardLength += 1; | |||
| console.log("el", el, cardLength); | |||
| html2 += `<tr class="wrap"><td class="single line">${el.taskType}</td> | |||
| <td class="single line">${el.cardType}</td> | |||
| <td> | |||
| ${el.imageDesc} | |||
| </td> | |||
| <td class="single line">${el.net}</td> | |||
| <td >${el.dataset}</td> | |||
| <td> | |||
| ${el.dockerDir} | |||
| </td> | |||
| <td><a> ${el.example_repo}</a></td> | |||
| <td>${el.note}</td></tr>`; | |||
| }); | |||
| html2 = html2.replace( | |||
| /^<tr class="wrap">/, | |||
| `<tr class="wrap"><td class="single line" rowspan="${cardLength}">${item}</td>` | |||
| ); | |||
| html1 += html2; | |||
| }); | |||
| }); | |||
| html1 = html1.replace( | |||
| /^<tr class="wrap">/, | |||
| `<tr class="wrap"><td class="single line" rowspan="${reourceLength}">${cardType}</td>` | |||
| ); | |||
| html += html1; | |||
| }); | |||
| }); | |||
| document.querySelector("tbody#resource-desc").innerHTML = html; | |||
| }, | |||
| error(err) { | |||
| console.log(err); | |||
| }, | |||
| }); | |||
| })(); | |||
| </script> | |||