| @@ -466,11 +466,14 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e | |||||
| log.Error("no such resourceSpecId(%d)", task.ResourceSpecId, ctx.Data["MsgID"]) | log.Error("no such resourceSpecId(%d)", task.ResourceSpecId, ctx.Data["MsgID"]) | ||||
| return errors.New("no such resourceSpec") | return errors.New("no such resourceSpec") | ||||
| } | } | ||||
| datasetInfos, _, err := models.GetDatasetInfo(task.Uuid) | |||||
| if err != nil { | |||||
| log.Error("GetDatasetInfo failed:%v", err, ctx.Data["MsgID"]) | |||||
| return err | |||||
| var datasetInfos map[string]models.DatasetInfo | |||||
| if task.Uuid != "" { | |||||
| var err error | |||||
| datasetInfos, _, err = models.GetDatasetInfo(task.Uuid) | |||||
| if err != nil { | |||||
| log.Error("GetDatasetInfo failed:%v", err, ctx.Data["MsgID"]) | |||||
| return err | |||||
| } | |||||
| } | } | ||||
| volumes := []models.Volume{ | volumes := []models.Volume{ | ||||
| @@ -510,24 +513,25 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e | |||||
| }, | }, | ||||
| }, | }, | ||||
| } | } | ||||
| if len(datasetInfos) == 1 { | |||||
| volumes = append(volumes, models.Volume{ | |||||
| HostPath: models.StHostPath{ | |||||
| Path: datasetInfos[task.Uuid].DataLocalPath, | |||||
| MountPath: DataSetMountPath, | |||||
| ReadOnly: true, | |||||
| }, | |||||
| }) | |||||
| } else { | |||||
| for _, dataset := range datasetInfos { | |||||
| if datasetInfos != nil { | |||||
| if len(datasetInfos) == 1 { | |||||
| volumes = append(volumes, models.Volume{ | volumes = append(volumes, models.Volume{ | ||||
| HostPath: models.StHostPath{ | HostPath: models.StHostPath{ | ||||
| Path: dataset.DataLocalPath, | |||||
| MountPath: DataSetMountPath + "/" + dataset.Name, | |||||
| Path: datasetInfos[task.Uuid].DataLocalPath, | |||||
| MountPath: DataSetMountPath, | |||||
| ReadOnly: true, | ReadOnly: true, | ||||
| }, | }, | ||||
| }) | }) | ||||
| } else { | |||||
| for _, dataset := range datasetInfos { | |||||
| volumes = append(volumes, models.Volume{ | |||||
| HostPath: models.StHostPath{ | |||||
| Path: dataset.DataLocalPath, | |||||
| MountPath: DataSetMountPath + "/" + dataset.Name, | |||||
| ReadOnly: true, | |||||
| }, | |||||
| }) | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -896,7 +896,7 @@ func QueryUserLoginInfo(ctx *context.Context) { | |||||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userLogin.IpAddr) | xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userLogin.IpAddr) | ||||
| tmp = tmp + 1 | tmp = tmp + 1 | ||||
| formatTime := userLogin.CreatedUnix.Format("2006-01-02 15:04:05") | formatTime := userLogin.CreatedUnix.Format("2006-01-02 15:04:05") | ||||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime[0:len(formatTime)-3]) | |||||
| xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime) | |||||
| } | } | ||||
| //设置默认打开的表单 | //设置默认打开的表单 | ||||
| xlsx.SetActiveSheet(index) | xlsx.SetActiveSheet(index) | ||||
| @@ -1136,7 +1136,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
| }) | }) | ||||
| }, context.RepoRef()) | }, context.RepoRef()) | ||||
| m.Group("/modelmanage", func() { | m.Group("/modelmanage", func() { | ||||
| m.Post("/create_model", reqRepoModelManageWriter, repo.SaveModel) | |||||
| m.Post("/create_model", repo.SaveModel) | |||||
| m.Post("/create_model_convert", reqRepoModelManageWriter, repo.SaveModelConvert) | m.Post("/create_model_convert", reqRepoModelManageWriter, repo.SaveModelConvert) | ||||
| m.Post("/create_new_model", repo.SaveNewNameModel) | m.Post("/create_new_model", repo.SaveNewNameModel) | ||||
| m.Delete("/delete_model", repo.DeleteModel) | m.Delete("/delete_model", repo.DeleteModel) | ||||
| @@ -497,6 +497,7 @@ | |||||
| } | } | ||||
| validate(); | validate(); | ||||
| $('.ui.create_train_job.green.button').click(function(e) { | $('.ui.create_train_job.green.button').click(function(e) { | ||||
| send_run_para() | |||||
| send_run_para(); | |||||
| validate(); | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -499,6 +499,7 @@ | |||||
| } | } | ||||
| validate(); | validate(); | ||||
| $('.ui.create_train_job.green.button').click(function (e) { | $('.ui.create_train_job.green.button').click(function (e) { | ||||
| send_run_para() | |||||
| send_run_para(); | |||||
| validate(); | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -446,6 +446,7 @@ | |||||
| } | } | ||||
| validate(); | validate(); | ||||
| $('.ui.create_train_job.green.button').click(function(e) { | $('.ui.create_train_job.green.button').click(function(e) { | ||||
| send_run_para() | |||||
| send_run_para(); | |||||
| validate(); | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -478,6 +478,7 @@ | |||||
| validate(); | validate(); | ||||
| $('.ui.create_train_job.green.button').click(function(e) { | $('.ui.create_train_job.green.button').click(function(e) { | ||||
| get_name() | get_name() | ||||
| send_run_para() | |||||
| send_run_para(); | |||||
| validate(); | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -522,6 +522,7 @@ | |||||
| validate(); | validate(); | ||||
| $('.ui.create_train_job.green.button').click(function(e) { | $('.ui.create_train_job.green.button').click(function(e) { | ||||
| send_run_para() | send_run_para() | ||||
| get_name() | |||||
| get_name(); | |||||
| validate(); | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -531,6 +531,7 @@ | |||||
| validate(); | validate(); | ||||
| $('.ui.create_train_job.green.button').click(function (e) { | $('.ui.create_train_job.green.button').click(function (e) { | ||||
| get_name() | get_name() | ||||
| send_run_para() | |||||
| send_run_para(); | |||||
| validate(); | |||||
| }) | }) | ||||
| </script> | </script> | ||||
| @@ -956,7 +956,6 @@ export default { | |||||
| this.benchmarkNew = true; | this.benchmarkNew = true; | ||||
| } | } | ||||
| if (location.href.indexOf("modelarts/notebook/create") !== -1 || location.href.indexOf("/cloudbrain/create") !== -1) { | if (location.href.indexOf("modelarts/notebook/create") !== -1 || location.href.indexOf("/cloudbrain/create") !== -1) { | ||||
| console.log("required is false;"); | |||||
| this.required = false; | this.required = false; | ||||
| } | } | ||||
| window.onresize = () => { | window.onresize = () => { | ||||