Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.2.2^2
zouap 3 years ago
parent
commit
aac79cc0fd
2 changed files with 41 additions and 13 deletions
  1. +1
    -1
      options/locale/locale_en-US.ini
  2. +40
    -12
      public/home/home.js

+ 1
- 1
options/locale/locale_en-US.ini View File

@@ -2638,7 +2638,7 @@ mirror_sync_create = synced new reference <a href="%s/src/%s">%[2]s</a> to <a hr
mirror_sync_delete = synced and deleted reference <code>%[2]s</code> at <a href="%[1]s">%[3]s</a> from mirror
approve_pull_request = `approved <a href="%s/pulls/%s">%s#%[2]s</a>`
reject_pull_request = `suggested changes for <a href="%s/pulls/%s">%s#%[2]s</a>`
upload_dataset=`upload dataset <a href="%s/datasets?type=%s">%</a>`
upload_dataset=`upload dataset <a href="%s/datasets?type=%s">%s</a>`
task_gpudebugjob=`created CPU/GPU type debugging task<a href="%s/cloudbrain/%s">%s</a>`
task_npudebugjob=`created NPU type debugging task <a href="%s/modelarts/notebook/%s">%s</a>`
task_trainjob=`created training task<a href="%s/modelarts/train-job/%s">%s</a>`


+ 40
- 12
public/home/home.js View File

@@ -103,11 +103,14 @@ socket.onmessage = function (e) {
actionName = actionName.replace("{oldRepoName}",record.Content);
html += recordPrefix + actionName;
html += " <a href=\"" + getRepoLink(record) + "\" rel=\"nofollow\">" + getRepoLink(record) + "</a>"
}
else if(record.OpType == "24" || record.OpType == "25" || record.OpType == "26" || record.OpType == "27" || record.OpType == "28" || record.OpType == "29" || record.OpType == "30"){
html += recordPrefix + actionName;
html += " <a href=\"" + getTaskLink(record) + "\" rel=\"nofollow\">" + record.RefName + "</a>"
}
else{
continue;
}

if(record.Repo != null){
var time = getTime(record.CreatedUnix,currentTime);
html += " " + time;
@@ -115,15 +118,6 @@ socket.onmessage = function (e) {
html += "</div>";
html += "</div>";
}
/*
<div class="swiper-slide item">
<img class="ui avatar image" src="/user/avatar/zhoupzh/-1" alt="">
<div class="middle aligned content">
<a href="/zhoupzh" title="">zhoupzh</a> 合并了合并请求 <a href="/OpenI/aiforge/pulls/1168" rel="nofollow">OpenI/aiforge#1168</a><span class="time-since">22 分钟前</span>
</div>
</div>
*/

}
console.log("html=" + html)
output.innerHTML = html;
@@ -131,6 +125,26 @@ socket.onmessage = function (e) {
swiperNewMessage.updateProgress();
};

function getTaskLink(record){
var re = getRepoLink(record);
if(record.OpType == 24){
return re + "/datasets?type=" + record.Content;
}else if(record.OpType == 25){
return re + "/cloudbrain/" + record.Content;
}else if(record.OpType == 26){
return re + "/modelarts/notebook/" + record.Content;
}else if(record.OpType == 27){
return re + "/modelarts/train-job/" + record.Content;
}else if(record.OpType == 28){
return re + "/modelarts/inference-job/" + record.Content;
}else if(record.OpType == 29){
return re + "/cloudbrain/benchmark/" + record.Content;
}else if(record.OpType == 30){
return re + "/modelmanage/show_model_info?name=" + record.RefName;
}
return re;
}

function getMsg(record){
var html ="";
html += "<div class=\"swiper-slide item\">";
@@ -248,7 +262,14 @@ var actionNameZH={
"15":"重新开启了合并请求",
"17":"从 {repoName} 删除分支 {deleteBranchName}",
"22":"建议变更",
"23":"评论了合并请求"
"23":"评论了合并请求",
"24":"上传了数据集文件",
"25":"创建了CPU/GPU类型调试任务",
"26":"创建了NPU类型调试任务",
"27":"创建了训练任务",
"28":"创建了推理任务",
"29":"创建了评测任务",
"30":"导入了新模型"
};

var actionNameEN={
@@ -266,7 +287,14 @@ var actionNameEN={
"15":" reopened pull request",
"17":" deleted branch {deleteBranchName} from {repoName}",
"22":" proposed changes",
"23":" commented on pull request"
"23":" commented on pull request",
"24":" upload dataset ",
"25":" created CPU/GPU type debugging task ",
"26":" created NPU type debugging task ",
"27":" created training task",
"28":" created reasoning task",
"29":" created profiling task",
"30":" created new model"
};

var repoAndOrgZH={


Loading…
Cancel
Save