@@ -679,7 +679,7 @@ func (repo *Repository) getAssignees(e Engine) (_ []*User, err error) { | |||||
userIDs[i] = accesses[i].UserID | userIDs[i] = accesses[i].UserID | ||||
} | } | ||||
if err = e.In("id", userIDs).Find(&users); err != nil { | |||||
if err = e.In("id", userIDs).OrderBy("name asc").Find(&users); err != nil { | |||||
return nil, err | return nil, err | ||||
} | } | ||||
} | } | ||||
@@ -8,6 +8,7 @@ import ( | |||||
"fmt" | "fmt" | ||||
"os" | "os" | ||||
"strings" | "strings" | ||||
"text/template" | |||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
"code.gitea.io/gitea/modules/git" | "code.gitea.io/gitea/modules/git" | ||||
@@ -34,7 +35,7 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *m | |||||
Name: opts.Name, | Name: opts.Name, | ||||
Alias: opts.Alias, | Alias: opts.Alias, | ||||
LowerName: strings.ToLower(opts.Name), | LowerName: strings.ToLower(opts.Name), | ||||
Description: opts.Description, | |||||
Description: template.HTMLEscapeString(opts.Description), | |||||
OriginalURL: opts.OriginalURL, | OriginalURL: opts.OriginalURL, | ||||
OriginalServiceType: opts.GitServiceType, | OriginalServiceType: opts.GitServiceType, | ||||
IsPrivate: opts.IsPrivate, | IsPrivate: opts.IsPrivate, | ||||
@@ -394,7 +394,7 @@ var ( | |||||
DefaultGitTreesPerPage int | DefaultGitTreesPerPage int | ||||
DefaultMaxBlobSize int64 | DefaultMaxBlobSize int64 | ||||
}{ | }{ | ||||
EnableSwagger: true, | |||||
EnableSwagger: false, | |||||
SwaggerURL: "", | SwaggerURL: "", | ||||
MaxResponseItems: 50, | MaxResponseItems: 50, | ||||
DefaultPagingNum: 30, | DefaultPagingNum: 30, | ||||
@@ -3210,11 +3210,11 @@ wrong_specification=You cannot use this specification, please choose another ite | |||||
resource_use=Resource Occupancy | resource_use=Resource Occupancy | ||||
job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). | job_name_rule = Please enter letters, numbers, _ and - up to 64 characters and cannot end with a dash (-). | ||||
train_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, the pre-trained model is storaged in the environment <strong style="color:#010101">ckpt_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">train_url</strong>. | |||||
infer_dataset_path_rule = The dataset location is stored in the environment variable <strong style="color:#010101">data_url</strong>, and the output path is stored in the environment variable <strong style="color:#010101">result_url</strong>. | |||||
train_dataset_path_rule = The dataset location is stored in the run parameter <strong style="color:#010101">data_url</strong>, the pre-trained model is storaged in the run parameter <strong style="color:#010101">ckpt_url</strong>, and the output path is stored in the run parameter <strong style="color:#010101">train_url</strong>. | |||||
infer_dataset_path_rule = The dataset location is stored in the run parameter <strong style="color:#010101">data_url</strong>, and the output path is stored in the run parameter <strong style="color:#010101">result_url</strong>. | |||||
view_sample = View sample | view_sample = View sample | ||||
inference_output_path_rule = The inference output path is stored in the environment variable result_url. | |||||
model_file_path_rule=The model file location is stored in the environment variable ckpt_url | |||||
inference_output_path_rule = The inference output path is stored in the run parameter result_url. | |||||
model_file_path_rule=The model file location is stored in the run parameter ckpt_url | |||||
model_file_postfix_rule = The supported format of the model file is [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | model_file_postfix_rule = The supported format of the model file is [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | ||||
model_convert_postfix_rule = The supported format of the model file is [.pth, .pkl, .onnx, .mindir, .ckpt, .pb] | model_convert_postfix_rule = The supported format of the model file is [.pth, .pkl, .onnx, .mindir, .ckpt, .pb] | ||||
delete_task = Delete task | delete_task = Delete task | ||||
@@ -3248,8 +3248,8 @@ Stopped_success_update_status_fail=Succeed in stopping th job, but failed to upd | |||||
load_code_failed=Fail to load code, please check if the right branch is selected. | load_code_failed=Fail to load code, please check if the right branch is selected. | ||||
error.dataset_select = dataset select error:the count exceed the limit or has same name | error.dataset_select = dataset select error:the count exceed the limit or has same name | ||||
new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the environment <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online | |||||
new_train_npu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the environment <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online | |||||
new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the run parameter <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online | |||||
new_train_npu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the run parameter <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online | |||||
new_infer_gpu_tooltips = The dataset is stored in <strong style="color:#010101">%s</strong>, the model file is stored in <strong style="color:#010101">%s</strong>, please store the inference output in <strong style="color:#010101">%s</strong> for subsequent downloads. | new_infer_gpu_tooltips = The dataset is stored in <strong style="color:#010101">%s</strong>, the model file is stored in <strong style="color:#010101">%s</strong>, please store the inference output in <strong style="color:#010101">%s</strong> for subsequent downloads. | ||||
[points] | [points] | ||||
@@ -3228,11 +3228,11 @@ card_type = 卡类型 | |||||
wrong_specification=您目前不能使用这个资源规格,请选择其他资源规格。 | wrong_specification=您目前不能使用这个资源规格,请选择其他资源规格。 | ||||
job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 | job_name_rule = 请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。 | ||||
train_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,预训练模型存放在环境变量<strong style="color:#010101">ckpt_url</strong>中,训练输出路径存储在环境变量<strong style="color:#010101">train_url</strong>中。 | |||||
infer_dataset_path_rule = 数据集位置存储在环境变量<strong style="color:#010101">data_url</strong>中,推理输出路径存储在环境变量<strong style="color:#010101">result_url</strong>中。 | |||||
train_dataset_path_rule = 数据集位置存储在运行参数 <strong style="color:#010101">data_url</strong> 中,预训练模型存放在运行参数 <strong style="color:#010101">ckpt_url</strong> 中,训练输出路径存储在运行参数 <strong style="color:#010101">train_url</strong> 中。 | |||||
infer_dataset_path_rule = 数据集位置存储在运行参数 <strong style="color:#010101">data_url</strong> 中,推理输出路径存储在运行参数 <strong style="color:#010101">result_url</strong> 中。 | |||||
view_sample = 查看样例 | view_sample = 查看样例 | ||||
inference_output_path_rule = 推理输出路径存储在环境变量result_url中。 | |||||
model_file_path_rule = 模型文件位置存储在环境变量ckpt_url中。 | |||||
inference_output_path_rule = 推理输出路径存储在运行参数 result_url 中。 | |||||
model_file_path_rule = 模型文件位置存储在运行参数 ckpt_url 中。 | |||||
model_file_postfix_rule = 模型文件支持的格式为 [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | model_file_postfix_rule = 模型文件支持的格式为 [ckpt, pb, h5, json, pkl, pth, t7, pdparams, onnx, pbtxt, keras, mlmodel, cfg, pt] | ||||
model_convert_postfix_rule = 模型文件支持的格式为 [.pth, .pkl, .onnx, .mindir, .ckpt, .pb] | model_convert_postfix_rule = 模型文件支持的格式为 [.pth, .pkl, .onnx, .mindir, .ckpt, .pb] | ||||
delete_task = 删除任务 | delete_task = 删除任务 | ||||
@@ -3267,9 +3267,9 @@ load_code_failed=代码加载失败,请确认选择了正确的分支。 | |||||
error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集 | error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集 | ||||
new_train_gpu_tooltips =训练脚本存储在<strong style="color:#010101">%s</strong>中,数据集存储在<strong style="color:#010101">%s</strong>中,预训练模型存放在环境变量<strong style="color:#010101">%s</strong>中,训练输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 | |||||
new_train_npu_tooltips =训练脚本存储在<strong style="color:#010101">%s</strong>中,预训练模型存放在环境变量<strong style="color:#010101">%s</strong>中,训练输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 | |||||
new_infer_gpu_tooltips = 数据集存储在<strong style="color:#010101">%s</strong>中,模型文件存储在<strong style="color:#010101">%s</strong>中,推理输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 | |||||
new_train_gpu_tooltips = 训练脚本存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,预训练模型存放在运行参数 <strong style="color:#010101">%s</strong> 中,训练输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。 | |||||
new_train_npu_tooltips = 训练脚本存储在 <strong style="color:#010101">%s</strong> 中,预训练模型存放在运行参数 <strong style="color:#010101">%s</strong> 中,训练输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。 | |||||
new_infer_gpu_tooltips = 数据集存储在 <strong style="color:#010101">%s</strong> 中,模型文件存储在 <strong style="color:#010101">%s</strong> 中,推理输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。 | |||||
[points] | [points] | ||||
points = 积分 | points = 积分 | ||||
@@ -577,7 +577,6 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s | |||||
r := bufio.NewReader(reader) | r := bufio.NewReader(reader) | ||||
for i := 0; i < endLine; i++ { | for i := 0; i < endLine; i++ { | ||||
line, error := r.ReadString('\n') | line, error := r.ReadString('\n') | ||||
log.Info("line=" + line) | |||||
if error == io.EOF { | if error == io.EOF { | ||||
log.Info("read file completed.") | log.Info("read file completed.") | ||||
break | break | ||||
@@ -7,6 +7,7 @@ package repo | |||||
import ( | import ( | ||||
"fmt" | "fmt" | ||||
"html/template" | |||||
"net/http" | "net/http" | ||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
@@ -118,7 +119,7 @@ func CreateFork(ctx *context.APIContext, form api.CreateForkOption) { | |||||
forker = org | forker = org | ||||
} | } | ||||
fork, err := repo_service.ForkRepository(ctx.User, forker, repo, repo.Name, repo.Description, repo.Alias) | |||||
fork, err := repo_service.ForkRepository(ctx.User, forker, repo, repo.Name, template.HTMLEscapeString(repo.Description), repo.Alias) | |||||
if err != nil { | if err != nil { | ||||
ctx.Error(http.StatusInternalServerError, "ForkRepository", err) | ctx.Error(http.StatusInternalServerError, "ForkRepository", err) | ||||
return | return | ||||
@@ -8,6 +8,7 @@ import ( | |||||
"net/http" | "net/http" | ||||
"net/url" | "net/url" | ||||
"path" | "path" | ||||
"regexp" | |||||
"strings" | "strings" | ||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
@@ -85,6 +86,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio | |||||
accuracy["Precision"] = "" | accuracy["Precision"] = "" | ||||
accuracyJson, _ := json.Marshal(accuracy) | accuracyJson, _ := json.Marshal(accuracy) | ||||
log.Info("accuracyJson=" + string(accuracyJson)) | log.Info("accuracyJson=" + string(accuracyJson)) | ||||
aiTask.ContainerIp = "" | |||||
aiTaskJson, _ := json.Marshal(aiTask) | aiTaskJson, _ := json.Marshal(aiTask) | ||||
model := &models.AiModelManage{ | model := &models.AiModelManage{ | ||||
@@ -635,6 +637,7 @@ func ShowSingleModel(ctx *context.Context) { | |||||
userNameMap := queryUserName(userIds) | userNameMap := queryUserName(userIds) | ||||
for _, model := range models { | for _, model := range models { | ||||
removeIpInfo(model) | |||||
value := userNameMap[model.UserId] | value := userNameMap[model.UserId] | ||||
if value != nil { | if value != nil { | ||||
model.UserName = value.Name | model.UserName = value.Name | ||||
@@ -644,6 +647,13 @@ func ShowSingleModel(ctx *context.Context) { | |||||
ctx.JSON(http.StatusOK, models) | ctx.JSON(http.StatusOK, models) | ||||
} | } | ||||
func removeIpInfo(model *models.AiModelManage) { | |||||
reg, _ := regexp.Compile(`[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}`) | |||||
taskInfo := model.TrainTaskInfo | |||||
taskInfo = reg.ReplaceAllString(taskInfo, "") | |||||
model.TrainTaskInfo = taskInfo | |||||
} | |||||
func queryUserName(intSlice []int64) map[int64]*models.User { | func queryUserName(intSlice []int64) map[int64]*models.User { | ||||
keys := make(map[int64]string) | keys := make(map[int64]string) | ||||
uniqueElements := []int64{} | uniqueElements := []int64{} | ||||
@@ -677,6 +687,7 @@ func ShowOneVersionOtherModel(ctx *context.Context) { | |||||
userNameMap := queryUserName(userIds) | userNameMap := queryUserName(userIds) | ||||
for _, model := range aimodels { | for _, model := range aimodels { | ||||
removeIpInfo(model) | |||||
value := userNameMap[model.UserId] | value := userNameMap[model.UserId] | ||||
if value != nil { | if value != nil { | ||||
model.UserName = value.Name | model.UserName = value.Name | ||||
@@ -793,6 +804,7 @@ func ShowModelPageInfo(ctx *context.Context) { | |||||
userNameMap := queryUserName(userIds) | userNameMap := queryUserName(userIds) | ||||
for _, model := range modelResult { | for _, model := range modelResult { | ||||
removeIpInfo(model) | |||||
value := userNameMap[model.UserId] | value := userNameMap[model.UserId] | ||||
if value != nil { | if value != nil { | ||||
model.UserName = value.Name | model.UserName = value.Name | ||||
@@ -866,6 +878,7 @@ func QueryModelListForPredict(ctx *context.Context) { | |||||
nameMap := make(map[string][]*models.AiModelManage) | nameMap := make(map[string][]*models.AiModelManage) | ||||
for _, model := range modelResult { | for _, model := range modelResult { | ||||
removeIpInfo(model) | |||||
if _, value := nameMap[model.Name]; !value { | if _, value := nameMap[model.Name]; !value { | ||||
models := make([]*models.AiModelManage, 0) | models := make([]*models.AiModelManage, 0) | ||||
models = append(models, model) | models = append(models, model) | ||||
@@ -760,8 +760,8 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||||
ctx.Data["ExitDiagnostics"] = taskRes.TaskStatuses[0].ExitDiagnostics | ctx.Data["ExitDiagnostics"] = taskRes.TaskStatuses[0].ExitDiagnostics | ||||
oldStatus := task.Status | oldStatus := task.Status | ||||
task.Status = taskRes.TaskStatuses[0].State | task.Status = taskRes.TaskStatuses[0].State | ||||
task.ContainerIp = "" | |||||
task.ContainerID = taskRes.TaskStatuses[0].ContainerID | task.ContainerID = taskRes.TaskStatuses[0].ContainerID | ||||
task.ContainerIp = taskRes.TaskStatuses[0].ContainerIP | |||||
models.ParseAndSetDurationFromCloudBrainOne(jobRes, task) | models.ParseAndSetDurationFromCloudBrainOne(jobRes, task) | ||||
if task.DeletedAt.IsZero() { //normal record | if task.DeletedAt.IsZero() { //normal record | ||||
@@ -303,7 +303,7 @@ func editFilePost(ctx *context.Context, form auth.EditRepoFileForm, isNewFile bo | |||||
} | } | ||||
if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) { | if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) { | ||||
ctx.Redirect(ctx.Repo.RepoLink + "/compare/" + ctx.Repo.BranchName + "..." + form.NewBranchName) | |||||
ctx.Redirect(ctx.Repo.RepoLink + "/compare/" + util.PathEscapeSegments(ctx.Repo.BranchName) + "..." + util.PathEscapeSegments(form.NewBranchName)) | |||||
} else { | } else { | ||||
ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(branchName) + "/" + util.PathEscapeSegments(form.TreePath)) | ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(branchName) + "/" + util.PathEscapeSegments(form.TreePath)) | ||||
} | } | ||||
@@ -475,7 +475,7 @@ func DeleteFilePost(ctx *context.Context, form auth.DeleteRepoFileForm) { | |||||
ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", ctx.Repo.TreePath)) | ctx.Flash.Success(ctx.Tr("repo.editor.file_delete_success", ctx.Repo.TreePath)) | ||||
if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) { | if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) { | ||||
ctx.Redirect(ctx.Repo.RepoLink + "/compare/" + ctx.Repo.BranchName + "..." + form.NewBranchName) | |||||
ctx.Redirect(ctx.Repo.RepoLink + "/compare/" + util.PathEscapeSegments(ctx.Repo.BranchName) + "..." + util.PathEscapeSegments(form.NewBranchName)) | |||||
} else { | } else { | ||||
treePath := filepath.Dir(ctx.Repo.TreePath) | treePath := filepath.Dir(ctx.Repo.TreePath) | ||||
if treePath == "." { | if treePath == "." { | ||||
@@ -686,7 +686,7 @@ func UploadFilePost(ctx *context.Context, form auth.UploadRepoFileForm) { | |||||
} | } | ||||
if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) { | if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) { | ||||
ctx.Redirect(ctx.Repo.RepoLink + "/compare/" + ctx.Repo.BranchName + "..." + form.NewBranchName) | |||||
ctx.Redirect(ctx.Repo.RepoLink + "/compare/" + util.PathEscapeSegments(ctx.Repo.BranchName) + "..." + util.PathEscapeSegments(form.NewBranchName)) | |||||
} else { | } else { | ||||
ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(branchName) + "/" + util.PathEscapeSegments(form.TreePath)) | ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(branchName) + "/" + util.PathEscapeSegments(form.TreePath)) | ||||
} | } | ||||
@@ -837,6 +837,7 @@ func GrampusTrainJobShow(ctx *context.Context) { | |||||
ctx.NotFound(ctx.Req.URL.RequestURI(), nil) | ctx.NotFound(ctx.Req.URL.RequestURI(), nil) | ||||
return | return | ||||
} | } | ||||
task.ContainerIp = "" | |||||
if task.DeletedAt.IsZero() { //normal record | if task.DeletedAt.IsZero() { //normal record | ||||
result, err := grampus.GetJob(task.JobID) | result, err := grampus.GetJob(task.JobID) | ||||
@@ -985,7 +985,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||||
//isSaveParam := form.IsSaveParam | //isSaveParam := form.IsSaveParam | ||||
repo := ctx.Repo.Repository | repo := ctx.Repo.Repository | ||||
codeLocalPath := setting.JobPath + jobName + modelarts.CodePath | codeLocalPath := setting.JobPath + jobName + modelarts.CodePath | ||||
codeObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.CodePath | |||||
codeObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.CodePath + VersionOutputPath + "/" | |||||
outputObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.OutputPath + VersionOutputPath + "/" | outputObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.OutputPath + VersionOutputPath + "/" | ||||
logObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.LogPath + VersionOutputPath + "/" | logObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.LogPath + VersionOutputPath + "/" | ||||
// dataPath := "/" + setting.Bucket + "/" + setting.BasePath + path.Join(uuid[0:1], uuid[1:2]) + "/" + uuid + uuid + "/" | // dataPath := "/" + setting.Bucket + "/" + setting.BasePath + path.Join(uuid[0:1], uuid[1:2]) + "/" + uuid + uuid + "/" | ||||
@@ -1108,8 +1108,8 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||||
return | return | ||||
} | } | ||||
// parentDir := VersionOutputPath + "/" | |||||
if err := uploadCodeToObs(codeLocalPath, jobName, ""); err != nil { | |||||
parentDir := VersionOutputPath + "/" | |||||
if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil { | |||||
// if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil { | // if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil { | ||||
log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err) | log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err) | ||||
trainJobNewDataPrepare(ctx) | trainJobNewDataPrepare(ctx) | ||||
@@ -1795,7 +1795,7 @@ func TrainJobShow(ctx *context.Context) { | |||||
datasetList = append(datasetList, GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, false)) | datasetList = append(datasetList, GetCloudBrainDataSetInfo(task.Uuid, task.DatasetName, false)) | ||||
VersionListTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) | VersionListTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) | ||||
VersionListTasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) | VersionListTasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) | ||||
VersionListTasks[i].ContainerIp = "" | |||||
//add spec | //add spec | ||||
s, err := resource.GetCloudbrainSpec(task.Cloudbrain.ID) | s, err := resource.GetCloudbrainSpec(task.Cloudbrain.ID) | ||||
if err != nil { | if err != nil { | ||||
@@ -12,6 +12,7 @@ import ( | |||||
"path" | "path" | ||||
"regexp" | "regexp" | ||||
"strings" | "strings" | ||||
"text/template" | |||||
"unicode/utf8" | "unicode/utf8" | ||||
"code.gitea.io/gitea/modules/validation" | "code.gitea.io/gitea/modules/validation" | ||||
@@ -212,7 +213,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) { | |||||
opts := models.GenerateRepoOptions{ | opts := models.GenerateRepoOptions{ | ||||
Name: form.RepoName, | Name: form.RepoName, | ||||
Alias: form.Alias, | Alias: form.Alias, | ||||
Description: form.Description, | |||||
Description: template.HTMLEscapeString(form.Description), | |||||
Private: form.Private, | Private: form.Private, | ||||
GitContent: form.GitContent, | GitContent: form.GitContent, | ||||
Topics: form.Topics, | Topics: form.Topics, | ||||
@@ -8,6 +8,7 @@ package repo | |||||
import ( | import ( | ||||
"errors" | "errors" | ||||
"fmt" | "fmt" | ||||
"html/template" | |||||
"io/ioutil" | "io/ioutil" | ||||
"net/url" | "net/url" | ||||
"regexp" | "regexp" | ||||
@@ -129,7 +130,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
// In case it's just a case change. | // In case it's just a case change. | ||||
repo.Name = newRepoName | repo.Name = newRepoName | ||||
repo.LowerName = strings.ToLower(newRepoName) | repo.LowerName = strings.ToLower(newRepoName) | ||||
repo.Description = form.Description | |||||
repo.Description = template.HTMLEscapeString(form.Description) | |||||
repo.Website = form.Website | repo.Website = form.Website | ||||
repo.IsTemplate = form.Template | repo.IsTemplate = form.Template | ||||
repo.Alias = newAlias | repo.Alias = newAlias | ||||
@@ -5,6 +5,7 @@ | |||||
package repo | package repo | ||||
import ( | import ( | ||||
"code.gitea.io/gitea/modules/util" | |||||
"fmt" | "fmt" | ||||
"strings" | "strings" | ||||
"time" | "time" | ||||
@@ -192,7 +193,7 @@ func SettingsProtectedBranchPost(ctx *context.Context, f auth.ProtectBranchForm) | |||||
} | } | ||||
if f.RequiredApprovals < 0 { | if f.RequiredApprovals < 0 { | ||||
ctx.Flash.Error(ctx.Tr("repo.settings.protected_branch_required_approvals_min")) | ctx.Flash.Error(ctx.Tr("repo.settings.protected_branch_required_approvals_min")) | ||||
ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, branch)) | |||||
ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, util.PathEscapeSegments(branch))) | |||||
} | } | ||||
var whitelistUsers, whitelistTeams, mergeWhitelistUsers, mergeWhitelistTeams, approvalsWhitelistUsers, approvalsWhitelistTeams []int64 | var whitelistUsers, whitelistTeams, mergeWhitelistUsers, mergeWhitelistTeams, approvalsWhitelistUsers, approvalsWhitelistTeams []int64 | ||||
@@ -263,7 +264,7 @@ func SettingsProtectedBranchPost(ctx *context.Context, f auth.ProtectBranchForm) | |||||
return | return | ||||
} | } | ||||
ctx.Flash.Success(ctx.Tr("repo.settings.update_protect_branch_success", branch)) | ctx.Flash.Success(ctx.Tr("repo.settings.update_protect_branch_success", branch)) | ||||
ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, branch)) | |||||
ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, util.PathEscapeSegments(branch))) | |||||
} else { | } else { | ||||
if protectBranch != nil { | if protectBranch != nil { | ||||
if err := ctx.Repo.Repository.DeleteProtectedBranch(protectBranch.ID); err != nil { | if err := ctx.Repo.Repository.DeleteProtectedBranch(protectBranch.ID); err != nil { | ||||
@@ -253,7 +253,7 @@ | |||||
<div style="float: right;"> | <div style="float: right;"> | ||||
{{if and ($.canDownload) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }} | {{if and ($.canDownload) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }} | ||||
<a class="ti-action-menu-item" id="{{.VersionName}}-create-model" | <a class="ti-action-menu-item" id="{{.VersionName}}-create-model" | ||||
onclick="showcreate({{.}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | |||||
onclick="showcreate({DisplayJobName:{{.DisplayJobName}},JobName:{{.JobName}},JobID:{{.JobID}},VersionName:{{.VersionName}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | |||||
{{else}} | {{else}} | ||||
<a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | <a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | ||||
{{end}} | {{end}} | ||||
@@ -265,7 +265,7 @@ | |||||
<div style="float: right;"> | <div style="float: right;"> | ||||
{{if and ($.canDownload) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }} | {{if and ($.canDownload) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }} | ||||
<a class="ti-action-menu-item" id="{{.VersionName}}-create-model" | <a class="ti-action-menu-item" id="{{.VersionName}}-create-model" | ||||
onclick="showcreate({{.}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | |||||
onclick="showcreate({DisplayJobName:{{.DisplayJobName}},JobName:{{.JobName}},JobID:{{.JobID}},VersionName:{{.VersionName}},EngineName:{{.EngineName}},ComputeResource:{{.ComputeResource}},Type:{{.Type}}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | |||||
{{else}} | {{else}} | ||||
<a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | <a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | ||||
{{end}} | {{end}} | ||||
@@ -249,7 +249,7 @@ | |||||
{{$.CsrfTokenHtml}} | {{$.CsrfTokenHtml}} | ||||
{{if and (.CanModify) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }} | {{if and (.CanModify) (ne .Status "WAITING") ($.Permission.CanWrite $.UnitTypeModelManage) }} | ||||
<a class="ti-action-menu-item" id="{{.VersionName}}-create-model" | <a class="ti-action-menu-item" id="{{.VersionName}}-create-model" | ||||
onclick="showcreate({{.}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | |||||
onclick="showcreate({DisplayJobName:{{.DisplayJobName}},JobName:{{.JobName}},JobID:{{.JobID}},VersionName:{{.VersionName}},EngineID:{{.EngineID}}})">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | |||||
{{else}} | {{else}} | ||||
<a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | <a class="ti-action-menu-item disabled" id="{{.VersionName}}-create-model">{{$.i18n.Tr "repo.modelarts.create_model"}}</a> | ||||
{{end}} | {{end}} | ||||
@@ -783,7 +783,6 @@ | |||||
} | } | ||||
let dirKey="isOnlyDir--:&"; | let dirKey="isOnlyDir--:&"; | ||||
function loadSelectedModelFile(trainJob){ | function loadSelectedModelFile(trainJob){ | ||||
console.log("trainJob=" + trainJob); | |||||
$('#choice_file').dropdown('clear') | $('#choice_file').dropdown('clear') | ||||
$("#model-file").empty() | $("#model-file").empty() | ||||
if(trainJob ==null || trainJob ==""){ | if(trainJob ==null || trainJob ==""){ | ||||