@@ -49,6 +49,14 @@ const ( | |||
ActionApprovePullRequest // 21 | |||
ActionRejectPullRequest // 22 | |||
ActionCommentPull // 23 | |||
ActionUploadAttachment //24 | |||
ActionCreateDebugGPUTask //25 | |||
ActionCreateDebugNPUTask //26 | |||
ActionCreateTrainTask //27 | |||
ActionCreateInferenceTask // 28 | |||
ActionCreateBenchMarkTask //29 | |||
ActionCreateNewModelTask //30 | |||
) | |||
// Action represents user operation type and other information to | |||
@@ -1,16 +1,17 @@ | |||
package cloudbrain | |||
import ( | |||
"code.gitea.io/gitea/modules/storage" | |||
"encoding/json" | |||
"errors" | |||
"strconv" | |||
"code.gitea.io/gitea/modules/setting" | |||
"code.gitea.io/gitea/modules/storage" | |||
"code.gitea.io/gitea/models" | |||
"code.gitea.io/gitea/modules/context" | |||
"code.gitea.io/gitea/modules/log" | |||
"code.gitea.io/gitea/modules/notification" | |||
"code.gitea.io/gitea/modules/setting" | |||
) | |||
const ( | |||
@@ -221,13 +222,19 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, | |||
ComputeResource: models.GPUResource, | |||
BenchmarkTypeID: benchmarkTypeID, | |||
BenchmarkChildTypeID: benchmarkChildTypeID, | |||
Description: description, | |||
Description: description, | |||
}) | |||
if err != nil { | |||
return err | |||
} | |||
if string(models.JobTypeBenchmark) == jobType { | |||
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobID, jobName, models.ActionCreateBenchMarkTask) | |||
} else { | |||
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobID, jobName, models.ActionCreateDebugGPUTask) | |||
} | |||
return nil | |||
} | |||
@@ -9,6 +9,7 @@ import ( | |||
"code.gitea.io/gitea/models" | |||
"code.gitea.io/gitea/modules/context" | |||
"code.gitea.io/gitea/modules/log" | |||
"code.gitea.io/gitea/modules/notification" | |||
"code.gitea.io/gitea/modules/setting" | |||
"code.gitea.io/gitea/modules/storage" | |||
) | |||
@@ -259,7 +260,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin | |||
if err != nil { | |||
return err | |||
} | |||
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobResult.ID, jobName, models.ActionCreateDebugNPUTask) | |||
return nil | |||
} | |||
@@ -335,12 +336,12 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error | |||
log.Error("GetAttachmentByUUID(%s) failed:%v", strconv.FormatInt(jobResult.JobID, 10), err.Error()) | |||
return err | |||
} | |||
jobId := strconv.FormatInt(jobResult.JobID, 10) | |||
err = models.CreateCloudbrain(&models.Cloudbrain{ | |||
Status: TransTrainJobStatus(jobResult.Status), | |||
UserID: ctx.User.ID, | |||
RepoID: ctx.Repo.Repository.ID, | |||
JobID: strconv.FormatInt(jobResult.JobID, 10), | |||
JobID: jobId, | |||
JobName: req.JobName, | |||
JobType: string(models.JobTypeTrain), | |||
Type: models.TypeCloudBrainTwo, | |||
@@ -371,7 +372,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error | |||
log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) | |||
return err | |||
} | |||
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobId, req.JobName, models.ActionCreateTrainTask) | |||
return nil | |||
} | |||
@@ -555,12 +556,12 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e | |||
log.Error("GetAttachmentByUUID(%s) failed:%v", strconv.FormatInt(jobResult.JobID, 10), err.Error()) | |||
return err | |||
} | |||
jobID := strconv.FormatInt(jobResult.JobID, 10) | |||
err = models.CreateCloudbrain(&models.Cloudbrain{ | |||
Status: TransTrainJobStatus(jobResult.Status), | |||
UserID: ctx.User.ID, | |||
RepoID: ctx.Repo.Repository.ID, | |||
JobID: strconv.FormatInt(jobResult.JobID, 10), | |||
JobID: jobID, | |||
JobName: req.JobName, | |||
JobType: string(models.JobTypeInference), | |||
Type: models.TypeCloudBrainTwo, | |||
@@ -595,6 +596,6 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e | |||
log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) | |||
return err | |||
} | |||
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobID, req.JobName, models.ActionCreateInferenceTask) | |||
return nil | |||
} |
@@ -330,3 +330,18 @@ func (a *actionNotifier) NotifySyncDeleteRef(doer *models.User, repo *models.Rep | |||
log.Error("notifyWatchers: %v", err) | |||
} | |||
} | |||
func (a *actionNotifier) NotifyOtherTask(doer *models.User, repo *models.Repository, id string, name string, optype models.ActionType) { | |||
if err := models.NotifyWatchers(&models.Action{ | |||
ActUserID: repo.OwnerID, | |||
ActUser: doer, | |||
OpType: optype, | |||
RepoID: repo.ID, | |||
Repo: repo, | |||
IsPrivate: repo.IsPrivate, | |||
RefName: name, | |||
Content: id, | |||
}); err != nil { | |||
log.Error("notifyWatchers: %v", err) | |||
} | |||
} |
@@ -54,4 +54,6 @@ type Notifier interface { | |||
NotifySyncPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *repository.PushCommits) | |||
NotifySyncCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string) | |||
NotifySyncDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string) | |||
NotifyOtherTask(doer *models.User, repo *models.Repository, id string, name string, optype models.ActionType) | |||
} |
@@ -154,3 +154,7 @@ func (*NullNotifier) NotifySyncCreateRef(doer *models.User, repo *models.Reposit | |||
// NotifySyncDeleteRef places a place holder function | |||
func (*NullNotifier) NotifySyncDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string) { | |||
} | |||
func (*NullNotifier) NotifyOtherTask(doer *models.User, repo *models.Repository, id string, name string, optype models.ActionType) { | |||
} |
@@ -37,6 +37,13 @@ func NewContext() { | |||
RegisterNotifier(action.NewNotifier()) | |||
} | |||
// NotifyUploadAttachment notifies attachment upload message to notifiers | |||
func NotifyOtherTask(doer *models.User, repo *models.Repository, id string, name string, optype models.ActionType) { | |||
for _, notifier := range notifiers { | |||
notifier.NotifyOtherTask(doer, repo, id, name, optype) | |||
} | |||
} | |||
// NotifyCreateIssueComment notifies issue comment related message to notifiers | |||
func NotifyCreateIssueComment(doer *models.User, repo *models.Repository, | |||
issue *models.Issue, comment *models.Comment) { | |||
@@ -2683,6 +2683,13 @@ 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">%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>` | |||
task_inferencejob=`created reasoning task <a href="%s/modelarts/inference-job/%s">%s</a>` | |||
task_benchmark=`created profiling task <a href="%s/cloudbrain/benchmark/%s">%s</a>` | |||
task_createmodel=`created new model <a href="%s/modelmanage/show_model_info?name=%s">%s</a>` | |||
[tool] | |||
ago = %s ago | |||
@@ -2693,6 +2693,13 @@ mirror_sync_create=从镜像同步了新的引用 <a href="%s/src/%s">%[2]s</a> | |||
mirror_sync_delete=从镜像同步并从 <a href="%[1]s">%[3]s</a> 删除了引用 <code>%[2]s</code> | |||
approve_pull_request=`同意了 <a href="%s/pulls/%s">%s#%[2]s</a>` | |||
reject_pull_request=`建议变更 <a href="%s/pulls/%s">%s#%[2]s</a>` | |||
upload_dataset=`上传了数据集文件 <a href="%s/datasets?type=%s">%s</a>` | |||
task_gpudebugjob=`创建了CPU/GPU类型调试任务 <a href="%s/cloudbrain/%s">%s</a>` | |||
task_npudebugjob=`创建了NPU类型调试任务 <a href="%s/modelarts/notebook/%s">%s</a>` | |||
task_trainjob=`创建了训练任务 <a href="%s/modelarts/train-job/%s">%s</a>` | |||
task_inferencejob=`创建了推理任务 <a href="%s/modelarts/inference-job/%s">%s</a>` | |||
task_benchmark=`创建了评测任务 <a href="%s/cloudbrain/benchmark/%s">%s</a>` | |||
task_createmodel=`导入了新模型 <a href="%s/modelmanage/show_model_info?name=%s">%s</a>` | |||
[tool] | |||
ago=%s前 | |||
@@ -125,12 +125,15 @@ socket.onmessage = function (e) { | |||
else if(record.OpType == "2"){ | |||
actionName = actionName.replace("{oldRepoName}",record.Content); | |||
html += recordPrefix + actionName; | |||
html += " <a href=\"" + getRepoLink(record) + "\" rel=\"nofollow\">" + getRepotext(record) + "</a>" | |||
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; | |||
@@ -138,13 +141,32 @@ socket.onmessage = function (e) { | |||
html += "</div>"; | |||
html += "</div>"; | |||
} | |||
} | |||
output.innerHTML = html; | |||
swiperNewMessage.updateSlides(); | |||
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.RefName; | |||
}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.RefName; | |||
}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\">"; | |||
@@ -276,7 +298,14 @@ var actionNameZH={ | |||
"15":"重新开启了合并请求", | |||
"17":"从 {repoName} 删除分支 {deleteBranchName}", | |||
"22":"建议变更", | |||
"23":"评论了合并请求" | |||
"23":"评论了合并请求", | |||
"24":"上传了数据集文件", | |||
"25":"创建了CPU/GPU类型调试任务", | |||
"26":"创建了NPU类型调试任务", | |||
"27":"创建了训练任务", | |||
"28":"创建了推理任务", | |||
"29":"创建了评测任务", | |||
"30":"导入了新模型" | |||
}; | |||
var actionNameEN={ | |||
@@ -294,7 +323,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={ | |||
@@ -12,6 +12,7 @@ import ( | |||
"code.gitea.io/gitea/models" | |||
"code.gitea.io/gitea/modules/context" | |||
"code.gitea.io/gitea/modules/log" | |||
"code.gitea.io/gitea/modules/notification" | |||
"code.gitea.io/gitea/modules/setting" | |||
"code.gitea.io/gitea/modules/storage" | |||
uuid "github.com/satori/go.uuid" | |||
@@ -113,7 +114,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio | |||
models.UpdateRepositoryUnits(ctx.Repo.Repository, units, deleteUnitTypes) | |||
log.Info("save model end.") | |||
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, id, name, models.ActionCreateNewModelTask) | |||
return nil | |||
} | |||
@@ -20,11 +20,11 @@ import ( | |||
"code.gitea.io/gitea/modules/labelmsg" | |||
"code.gitea.io/gitea/modules/log" | |||
"code.gitea.io/gitea/modules/minio_ext" | |||
"code.gitea.io/gitea/modules/notification" | |||
"code.gitea.io/gitea/modules/setting" | |||
"code.gitea.io/gitea/modules/storage" | |||
"code.gitea.io/gitea/modules/upload" | |||
"code.gitea.io/gitea/modules/worker" | |||
gouuid "github.com/satori/go.uuid" | |||
) | |||
@@ -845,6 +845,9 @@ func CompleteMultipart(ctx *context.Context) { | |||
ctx.Error(500, fmt.Sprintf("InsertAttachment: %v", err)) | |||
return | |||
} | |||
dataset, _ := models.GetDatasetByID(attachment.DatasetID) | |||
repository, _ := models.GetRepositoryByID(dataset.RepoID) | |||
notification.NotifyOtherTask(ctx.User, repository, fmt.Sprint(attachment.Type), attachment.Name, models.ActionUploadAttachment) | |||
if attachment.DatasetID != 0 { | |||
if isCanDecompress(attachment.Name) { | |||
@@ -865,7 +868,6 @@ func CompleteMultipart(ctx *context.Context) { | |||
labelmsg.SendDecompressAttachToLabelOBS(string(attachjson)) | |||
} | |||
} else { | |||
dataset, _ := models.GetDatasetByID(attachment.DatasetID) | |||
var labelMap map[string]string | |||
labelMap = make(map[string]string) | |||
labelMap["UUID"] = uuid | |||
@@ -350,18 +350,15 @@ func CloudBrainShow(ctx *context.Context) { | |||
func cloudBrainShow(ctx *context.Context, tpName base.TplName) { | |||
ctx.Data["PageIsCloudBrain"] = true | |||
var jobName = ctx.Params(":jobname") | |||
task, err := models.GetCloudbrainByName(jobName) | |||
if err != nil { | |||
ctx.Data["error"] = err.Error() | |||
} | |||
result, err := cloudbrain.GetJob(task.JobID) | |||
if err != nil { | |||
ctx.Data["error"] = err.Error() | |||
} | |||
if result != nil { | |||
jobRes, _ := models.ConvertToJobResultPayload(result.Payload) | |||
jobRes.Resource.Memory = strings.ReplaceAll(jobRes.Resource.Memory, "Mi", "MB") | |||
@@ -369,6 +366,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { | |||
ctx.Data["resource_spec"] = spec | |||
taskRoles := jobRes.TaskRoles | |||
if jobRes.JobStatus.State != string(models.JobFailed) { | |||
taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) | |||
ctx.Data["taskRes"] = taskRes | |||
task.Status = taskRes.TaskStatuses[0].State | |||
@@ -1099,6 +1097,9 @@ func GetChildTypes(ctx *context.Context) { | |||
} | |||
func CloudBrainBenchmarkNew(ctx *context.Context) { | |||
ctx.Data["description"] = "" | |||
ctx.Data["benchmarkTypeID"] = -1 | |||
ctx.Data["benchmark_child_types_id_hidden"] = -1 | |||
err := cloudBrainNewDataPrepare(ctx) | |||
if err != nil { | |||
ctx.ServerError("get new cloudbrain info failed", err) | |||
@@ -1201,6 +1202,9 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF | |||
benchmarkTypeID := form.BenchmarkTypeID | |||
benchmarkChildTypeID := form.BenchmarkChildTypeID | |||
ctx.Data["description"] = form.Description | |||
ctx.Data["benchmarkTypeID"] = benchmarkTypeID | |||
ctx.Data["benchmark_child_types_id_hidden"] = benchmarkChildTypeID | |||
if !jobNamePattern.MatchString(jobName) { | |||
cloudBrainNewDataPrepare(ctx) | |||
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplCloudBrainBenchmarkNew, &form) | |||
@@ -1453,6 +1453,7 @@ func TrainJobShow(ctx *context.Context) { | |||
ctx.Data["jobName"] = VersionListTasks[0].JobName | |||
ctx.Data["version_list_task"] = VersionListTasks | |||
ctx.Data["version_list_count"] = VersionListCount | |||
ctx.Data["canDownload"] = cloudbrain.CanDeleteJob(ctx, &VersionListTasks[0].Cloudbrain) | |||
ctx.HTML(http.StatusOK, tplModelArtsTrainJobShow) | |||
} | |||
@@ -2052,6 +2053,7 @@ func InferenceJobShow(ctx *context.Context) { | |||
ctx.Data["jobID"] = jobID | |||
ctx.Data["jobName"] = task.JobName | |||
ctx.Data["task"] = task | |||
ctx.Data["canDownload"] = cloudbrain.CanDeleteJob(ctx, task) | |||
tempUids := []int64{} | |||
tempUids = append(tempUids, task.UserID) | |||
@@ -996,7 +996,6 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
m.Get("", reqRepoCloudBrainReader, repo.CloudBrainBenchMarkShow) | |||
}) | |||
m.Group("/:jobid", func() { | |||
// m.Get("", reqRepoCloudBrainReader, repo.CloudBrainBenchMarkShow) | |||
m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainStop) | |||
m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.BenchmarkDel) | |||
m.Get("/rate", reqRepoCloudBrainReader, repo.GetRate) | |||
@@ -10,7 +10,7 @@ import ( | |||
"github.com/elliotchance/orderedmap" | |||
) | |||
var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23} | |||
var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30} | |||
type ClientsManager struct { | |||
Clients *orderedmap.OrderedMap | |||
@@ -100,7 +100,6 @@ | |||
<!-- 任务名 --> | |||
<div class="three wide column padding0"> | |||
<a class="title" href="{{$.Link}}/{{.JobName}}" title="{{.JobName}}" style="font-size: 14px;"> | |||
<span class="fitted" style="width: 90%;vertical-align: middle;">{{.JobName}}</span> | |||
</a> | |||
</div> | |||
@@ -83,7 +83,7 @@ | |||
</div> | |||
<div class="unite min_title inline field"> | |||
<label style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}} </label> | |||
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea> | |||
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="254" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)">{{.description}}</textarea> | |||
</div> | |||
<div class="required unite min_title inline field"> | |||
@@ -102,11 +102,16 @@ | |||
<span> </span> | |||
<select class="ui fluid selection search dropdown" id="benchmark_types_id" name="benchmark_types_id" > | |||
{{range .benchmark_types}} | |||
<option value="{{.Id}}">{{.First}}</option> | |||
{{if eq .Id $.benchmarkTypeID}} | |||
<option value="{{.Id}}" selected="true">{{.First}}</option> | |||
{{else}} | |||
<option value="{{.Id}}">{{.First}}</option> | |||
{{end}} | |||
{{end}} | |||
</select> | |||
</div> | |||
<div class="eight wide field" id="engine_name"> | |||
<input type="hidden" id="benchmark_child_types_id_hidden" name="benchmark_child_types_id_hidden" value="{{.benchmark_child_types_id_hidden}}"> | |||
<label style="font-weight: normal;white-space: nowrap;">{{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_child_type"}}</label> | |||
<select class="ui fluid selection dropdown nowrap" id="benchmark_child_types_id" style='width: 100%;' name="benchmark_child_types_id"> | |||
</select> | |||
@@ -182,12 +187,17 @@ | |||
function setChildType(){ | |||
let type_id = $('#benchmark_types_id').val(); | |||
let child_selected_id = $('#benchmark_child_types_id_hidden').val(); | |||
$.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => { | |||
console.log(JSON.stringify(data)) | |||
const n_length = data['child_types'].length | |||
let html='' | |||
for (let i=0;i<n_length;i++){ | |||
html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`; | |||
if(child_selected_id == data['child_types'][i].id){ | |||
html += `<option value="${data['child_types'][i].id}" selected="true">${data['child_types'][i].value}</option>`; | |||
}else{ | |||
html += `<option value="${data['child_types'][i].id}">${data['child_types'][i].value}</option>`; | |||
} | |||
} | |||
document.getElementById("benchmark_child_types_id").innerHTML=html; | |||
}) | |||
@@ -188,6 +188,7 @@ td, th { | |||
</h4> | |||
{{range $k ,$v := .version_list_task}} | |||
<div class="ui accordion border-according" id="accordion{{.VersionName}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}" data-version="{{.VersionName}}"> | |||
<input type="hidden" id="jobId_input" name="jobId_input" value="{{.JobID}}"> | |||
<div class="{{if eq $k 0}}active{{end}} title padding0"> | |||
<div class="according-panel-heading"> | |||
<div class="accordion-panel-title"> | |||
@@ -441,7 +442,6 @@ td, th { | |||
jobName = urlArr.slice(-1)[0] | |||
}) | |||
function loadLog(version_name){ | |||
document.getElementById("mask").style.display = "block" | |||
$.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobName}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { | |||
@@ -469,13 +469,13 @@ td, th { | |||
</div> | |||
{{template "base/footer" .}} | |||
<script> | |||
console.log({{.task}}) | |||
$(document).ready(function(){ | |||
$('.secondary.menu .item').tab(); | |||
}); | |||
let userName | |||
let repoPath | |||
let jobID | |||
let downlaodFlag = {{$.canDownload }} | |||
$(document).ready(function(){ | |||
let url = window.location.href; | |||
let urlArr = url.split('/') | |||
@@ -621,7 +621,12 @@ function renderDir(data,version_name){ | |||
html += `<a onclick="loadModelFile('${version_name}','${data.Dirs[i].ParenDir}','${data.Dirs[i].FileName}','folder')">` | |||
html += "<span class='fitted'><i class='folder icon' width='16' height='16' aria-hidden='true'></i>" + data.Dirs[i].FileName + "</span>" | |||
}else{ | |||
html += `<a href="${location.href}/result_download?version_name=${version_name}&file_name=${data.Dirs[i].FileName}&parent_dir=${data.Dirs[i].ParenDir}">` | |||
if(downlaodFlag){ | |||
html += `<a href="${location.href}/result_download?version_name=${version_name}&file_name=${data.Dirs[i].FileName}&parent_dir=${data.Dirs[i].ParenDir}">` | |||
} | |||
else{ | |||
html += `<a class="disabled">` | |||
} | |||
html += "<span class='fitted'><i class='file icon' width='16' height='16' aria-hidden='true'></i>" + data.Dirs[i].FileName + "</span>" | |||
} | |||
html += '</a>' | |||
@@ -532,6 +532,7 @@ td, th { | |||
let userName | |||
let repoPath | |||
let jobID | |||
let downlaodFlag = {{$.canDownload }} | |||
$(document).ready(function(){ | |||
let url = window.location.href; | |||
let urlArr = url.split('/') | |||
@@ -787,7 +788,12 @@ td, th { | |||
html += `<a onclick="loadModelFile('${version_name}','${data.Dirs[i].ParenDir}','${data.Dirs[i].FileName}','folder')">` | |||
html += "<span class='fitted'><i class='folder icon' width='16' height='16' aria-hidden='true'></i>" + data.Dirs[i].FileName + "</span>" | |||
}else{ | |||
html += `<a href="${location.href}/model_download?version_name=${version_name}&file_name=${data.Dirs[i].FileName}&parent_dir=${data.Dirs[i].ParenDir}">` | |||
if(downlaodFlag){ | |||
html += `<a href="${location.href}/model_download?version_name=${version_name}&file_name=${data.Dirs[i].FileName}&parent_dir=${data.Dirs[i].ParenDir}">` | |||
} | |||
else{ | |||
html += `<a class="disabled">` | |||
} | |||
html += "<span class='fitted'><i class='file icon' width='16' height='16' aria-hidden='true'></i>" + data.Dirs[i].FileName + "</span>" | |||
} | |||
html += '</a>' | |||
@@ -69,7 +69,21 @@ | |||
{{$.i18n.Tr "action.reject_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||
{{else if eq .GetOpType 23}} | |||
{{ $index := index .GetIssueInfos 0}} | |||
{{$.i18n.Tr "action.comment_pull" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||
{{$.i18n.Tr "action.comment_pull" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||
{{else if eq .GetOpType 24}} | |||
{{$.i18n.Tr "action.upload_dataset" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 25}} | |||
{{$.i18n.Tr "action.task_gpudebugjob" .GetRepoLink .RefName .RefName | Str2html}} | |||
{{else if eq .GetOpType 26}} | |||
{{$.i18n.Tr "action.task_npudebugjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 27}} | |||
{{$.i18n.Tr "action.task_trainjob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 28}} | |||
{{$.i18n.Tr "action.task_inferencejob" .GetRepoLink .Content .RefName | Str2html}} | |||
{{else if eq .GetOpType 29}} | |||
{{$.i18n.Tr "action.task_benchmark" .GetRepoLink .RefName .RefName | Str2html}} | |||
{{else if eq .GetOpType 30}} | |||
{{$.i18n.Tr "action.task_createmodel" .GetRepoLink .RefName .RefName | Str2html}} | |||
{{end}} | |||
</p> | |||
{{if or (eq .GetOpType 5) (eq .GetOpType 18)}} | |||
@@ -101,7 +115,23 @@ | |||
</div> | |||
</div> | |||
<div class="ui two wide right aligned column"> | |||
<span class="text grey">{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}}</span> | |||
{{if eq .GetOpType 24}} | |||
<span class="text grey"><i class="ri-uninstall-line icon big"></i></span> | |||
{{else if eq .GetOpType 25}} | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 26}} | |||
<span class="text grey"><i class="ri-voice-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 27}} | |||
<span class="text grey"><i class="ri-character-recognition-line icon big"></i></span> | |||
{{else if eq .GetOpType 28}} | |||
<span class="text grey"><i class="ri-haze-2-line icon big"></i></span> | |||
{{else if eq .GetOpType 29}} | |||
<span class="text grey"><i class="ri-vip-crown-line icon big"></i></span> | |||
{{else if eq .GetOpType 30}} | |||
<span class="text grey"><i class="ri-picture-in-picture-exit-line icon big"></i></span> | |||
{{else}} | |||
<span class="text grey">{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}}</span> | |||
{{end}} | |||
</div> | |||
</div> | |||
<div class="ui divider"></div> | |||