| @@ -12,67 +12,67 @@ import ( | |||||
| ) | ) | ||||
| type AiModelManage struct { | type AiModelManage struct { | ||||
| ID string `xorm:"pk"` | |||||
| Name string `xorm:"INDEX NOT NULL"` | |||||
| Version string `xorm:"NOT NULL"` | |||||
| VersionCount int `xorm:"NOT NULL DEFAULT 0"` | |||||
| New int `xorm:"NOT NULL"` | |||||
| Type int `xorm:"NOT NULL"` | |||||
| Size int64 `xorm:"NOT NULL"` | |||||
| Description string `xorm:"varchar(2000)"` | |||||
| Label string `xorm:"varchar(1000)"` | |||||
| Path string `xorm:"varchar(400) NOT NULL"` | |||||
| DownloadCount int `xorm:"NOT NULL DEFAULT 0"` | |||||
| Engine int64 `xorm:"NOT NULL DEFAULT 0"` | |||||
| Status int `xorm:"NOT NULL DEFAULT 0"` | |||||
| StatusDesc string `xorm:"varchar(500)"` | |||||
| Accuracy string `xorm:"varchar(1000)"` | |||||
| AttachmentId string `xorm:"NULL"` | |||||
| RepoId int64 `xorm:"INDEX NULL"` | |||||
| CodeBranch string `xorm:"varchar(400) NULL"` | |||||
| CodeCommitID string `xorm:"NULL"` | |||||
| UserId int64 `xorm:"NOT NULL"` | |||||
| UserName string | |||||
| UserRelAvatarLink string | |||||
| TrainTaskInfo string `xorm:"text NULL"` | |||||
| CreatedUnix timeutil.TimeStamp `xorm:"created"` | |||||
| UpdatedUnix timeutil.TimeStamp `xorm:"updated"` | |||||
| IsCanOper bool | |||||
| IsCanDelete bool | |||||
| ID string `xorm:"pk" json:"id"` | |||||
| Name string `xorm:"INDEX NOT NULL" json:"name"` | |||||
| Version string `xorm:"NOT NULL" json:"version"` | |||||
| VersionCount int `xorm:"NOT NULL DEFAULT 0" json:"versionCount"` | |||||
| New int `xorm:"NOT NULL" json:"new"` | |||||
| Type int `xorm:"NOT NULL" json:"type"` | |||||
| Size int64 `xorm:"NOT NULL" json:"size"` | |||||
| Description string `xorm:"varchar(2000)" json:"description"` | |||||
| Label string `xorm:"varchar(1000)" json:"label"` | |||||
| Path string `xorm:"varchar(400) NOT NULL" json:"path"` | |||||
| DownloadCount int `xorm:"NOT NULL DEFAULT 0" json:"downloadCount"` | |||||
| Engine int64 `xorm:"NOT NULL DEFAULT 0" json:"engine"` | |||||
| Status int `xorm:"NOT NULL DEFAULT 0" json:"status"` | |||||
| StatusDesc string `xorm:"varchar(500)" json:"statusDesc"` | |||||
| Accuracy string `xorm:"varchar(1000)" json:"accuracy"` | |||||
| AttachmentId string `xorm:"NULL" json:"attachmentId"` | |||||
| RepoId int64 `xorm:"INDEX NULL" json:"repoId"` | |||||
| CodeBranch string `xorm:"varchar(400) NULL" json:"codeBranch"` | |||||
| CodeCommitID string `xorm:"NULL" json:"codeCommitID"` | |||||
| UserId int64 `xorm:"NOT NULL" json:"userId"` | |||||
| UserName string `json:"userName"` | |||||
| UserRelAvatarLink string `json:"userRelAvatarLink"` | |||||
| TrainTaskInfo string `xorm:"text NULL" json:"trainTaskInfo"` | |||||
| CreatedUnix timeutil.TimeStamp `xorm:"created" json:"createdUnix"` | |||||
| UpdatedUnix timeutil.TimeStamp `xorm:"updated" json:"updatedUnix"` | |||||
| IsCanOper bool `json:"isCanOper"` | |||||
| IsCanDelete bool `json:"isCanDelete"` | |||||
| } | } | ||||
| type AiModelConvert struct { | type AiModelConvert struct { | ||||
| ID string `xorm:"pk"` | |||||
| Name string `xorm:"INDEX NOT NULL"` | |||||
| Status string `xorm:"NULL"` | |||||
| StatusResult string `xorm:"NULL"` | |||||
| SrcEngine int `xorm:"NOT NULL DEFAULT 0"` | |||||
| RepoId int64 `xorm:"INDEX NULL"` | |||||
| ModelId string `xorm:"NOT NULL"` | |||||
| ModelName string `xorm:"NULL"` | |||||
| ModelVersion string `xorm:"NOT NULL"` | |||||
| ModelPath string `xorm:"NULL"` | |||||
| DestFormat int `xorm:"NOT NULL DEFAULT 0"` | |||||
| NetOutputFormat int `xorm:"NULL"` | |||||
| UserId int64 `xorm:"NOT NULL"` | |||||
| CloudBrainTaskId string `xorm:"NULL"` | |||||
| ModelArtsVersionId string `xorm:"NULL"` | |||||
| ContainerID string | |||||
| ContainerIp string | |||||
| RunTime int64 `xorm:"NULL"` | |||||
| TrainJobDuration string | |||||
| InputShape string `xorm:"varchar(2000)"` | |||||
| InputDataFormat string `xorm:"NOT NULL"` | |||||
| Description string `xorm:"varchar(2000)"` | |||||
| Path string `xorm:"varchar(400) NOT NULL"` | |||||
| CreatedUnix timeutil.TimeStamp `xorm:"created"` | |||||
| UpdatedUnix timeutil.TimeStamp `xorm:"updated"` | |||||
| StartTime timeutil.TimeStamp | |||||
| EndTime timeutil.TimeStamp | |||||
| UserName string | |||||
| UserRelAvatarLink string | |||||
| IsCanOper bool | |||||
| IsCanDelete bool | |||||
| ID string `xorm:"pk" json:"id"` | |||||
| Name string `xorm:"INDEX NOT NULL" json:"name"` | |||||
| Status string `xorm:"NULL" json:"status"` | |||||
| StatusResult string `xorm:"NULL" json:"statusResult"` | |||||
| SrcEngine int `xorm:"NOT NULL DEFAULT 0" json:"srcEngine"` | |||||
| RepoId int64 `xorm:"INDEX NULL" json:"repoId"` | |||||
| ModelId string `xorm:"NOT NULL" json:"modelId"` | |||||
| ModelName string `xorm:"NULL" json:"modelName"` | |||||
| ModelVersion string `xorm:"NOT NULL" json:"modelVersion"` | |||||
| ModelPath string `xorm:"NULL" json:"modelPath"` | |||||
| DestFormat int `xorm:"NOT NULL DEFAULT 0" json:"destFormat"` | |||||
| NetOutputFormat int `xorm:"NULL" json:"netOutputFormat"` | |||||
| UserId int64 `xorm:"NOT NULL" json:"userId"` | |||||
| CloudBrainTaskId string `xorm:"NULL" json:"cloudBrainTaskId"` | |||||
| ModelArtsVersionId string `xorm:"NULL" json:"modelArtsVersionId"` | |||||
| ContainerID string `json:"containerID"` | |||||
| ContainerIp string `json:"containerIp"` | |||||
| RunTime int64 `xorm:"NULL" json:"runTime"` | |||||
| TrainJobDuration string `json:"trainJobDuration"` | |||||
| InputShape string `xorm:"varchar(2000)" json:"inputShape"` | |||||
| InputDataFormat string `xorm:"NOT NULL" json:"inputDataFormat"` | |||||
| Description string `xorm:"varchar(2000)" json:"description"` | |||||
| Path string `xorm:"varchar(400) NOT NULL" json:"path"` | |||||
| CreatedUnix timeutil.TimeStamp `xorm:"created" json:"createdUnix"` | |||||
| UpdatedUnix timeutil.TimeStamp `xorm:"updated" json:"updatedUnix"` | |||||
| StartTime timeutil.TimeStamp `json:"startTime"` | |||||
| EndTime timeutil.TimeStamp `json:"endTime"` | |||||
| UserName string `json:"userName"` | |||||
| UserRelAvatarLink string `json:"userRelAvatarLink"` | |||||
| IsCanOper bool `json:"isCanOper"` | |||||
| IsCanDelete bool `json:"isCanDelete"` | |||||
| } | } | ||||
| type AiModelQueryOptions struct { | type AiModelQueryOptions struct { | ||||
| @@ -947,6 +947,9 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
| }) | }) | ||||
| }, reqRepoReader(models.UnitTypeCloudBrain)) | }, reqRepoReader(models.UnitTypeCloudBrain)) | ||||
| m.Group("/modelmanage", func() { | m.Group("/modelmanage", func() { | ||||
| m.Post("/create_new_model", repo.CreateNewModel) | |||||
| m.Get("/show_model_api", repo.ShowModelManageApi) | |||||
| m.Delete("/delete_model", repo.DeleteModel) | |||||
| m.Get("/:id", repo.GetCloudbrainModelConvertTask) | m.Get("/:id", repo.GetCloudbrainModelConvertTask) | ||||
| m.Get("/:id/log", repo.CloudbrainForModelConvertGetLog) | m.Get("/:id/log", repo.CloudbrainForModelConvertGetLog) | ||||
| m.Get("/:id/modelartlog", repo.TrainJobForModelConvertGetLog) | m.Get("/:id/modelartlog", repo.TrainJobForModelConvertGetLog) | ||||
| @@ -0,0 +1,30 @@ | |||||
| package repo | |||||
| import ( | |||||
| "code.gitea.io/gitea/modules/context" | |||||
| "code.gitea.io/gitea/modules/log" | |||||
| routerRepo "code.gitea.io/gitea/routers/repo" | |||||
| ) | |||||
| func CreateNewModel(ctx *context.APIContext) { | |||||
| log.Info("create new model by api.") | |||||
| ctx.Context.SetParams("JobId", ctx.Query("jobId")) | |||||
| ctx.Context.SetParams("VersionName", ctx.Query("versionName")) | |||||
| ctx.Context.SetParams("Name", ctx.Query("name")) | |||||
| ctx.Context.SetParams("Version", ctx.Query("version")) | |||||
| ctx.Context.SetParams("Engine", ctx.Query("engine")) | |||||
| ctx.Context.SetParams("modelSelectedFile", ctx.Query("modelSelectedFile")) | |||||
| ctx.Context.SetParams("Label", ctx.Query("label")) | |||||
| ctx.Context.SetParams("Description", ctx.Query("description")) | |||||
| routerRepo.SaveModel(ctx.Context) | |||||
| } | |||||
| func ShowModelManageApi(ctx *context.APIContext) { | |||||
| routerRepo.ShowModelPageInfo(ctx.Context) | |||||
| } | |||||
| func DeleteModel(ctx *context.APIContext) { | |||||
| routerRepo.DeleteModel(ctx.Context) | |||||
| } | |||||
| @@ -72,27 +72,27 @@ func SaveModelConvert(ctx *context.Context) { | |||||
| log.Info("save model convert start.") | log.Info("save model convert start.") | ||||
| if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { | if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { | ||||
| ctx.JSON(200, map[string]string{ | ctx.JSON(200, map[string]string{ | ||||
| "result_code": "1", | |||||
| "message": ctx.Tr("repo.modelconvert.manage.no_operate_right"), | |||||
| "code": "1", | |||||
| "msg": ctx.Tr("repo.modelconvert.manage.no_operate_right"), | |||||
| }) | }) | ||||
| return | return | ||||
| } | } | ||||
| name := ctx.Query("name") | name := ctx.Query("name") | ||||
| desc := ctx.Query("desc") | desc := ctx.Query("desc") | ||||
| modelId := ctx.Query("modelId") | modelId := ctx.Query("modelId") | ||||
| modelPath := ctx.Query("ModelFile") | |||||
| SrcEngine := ctx.QueryInt("SrcEngine") | |||||
| modelPath := ctx.Query("modelFile") | |||||
| SrcEngine := ctx.QueryInt("srcEngine") | |||||
| InputShape := ctx.Query("inputshape") | InputShape := ctx.Query("inputshape") | ||||
| InputDataFormat := ctx.Query("inputdataformat") | InputDataFormat := ctx.Query("inputdataformat") | ||||
| DestFormat := ctx.QueryInt("DestFormat") | |||||
| NetOutputFormat := ctx.QueryInt("NetOutputFormat") | |||||
| DestFormat := ctx.QueryInt("destFormat") | |||||
| NetOutputFormat := ctx.QueryInt("netOutputFormat") | |||||
| task, err := models.QueryModelById(modelId) | task, err := models.QueryModelById(modelId) | ||||
| if err != nil { | if err != nil { | ||||
| log.Error("no such model!", err.Error()) | log.Error("no such model!", err.Error()) | ||||
| ctx.JSON(200, map[string]string{ | ctx.JSON(200, map[string]string{ | ||||
| "result_code": "1", | |||||
| "message": ctx.Tr("repo.modelconvert.manage.model_not_exist"), | |||||
| "code": "1", | |||||
| "msg": ctx.Tr("repo.modelconvert.manage.model_not_exist"), | |||||
| }) | }) | ||||
| return | return | ||||
| } | } | ||||
| @@ -103,8 +103,8 @@ func SaveModelConvert(ctx *context.Context) { | |||||
| if convert.Name == name { | if convert.Name == name { | ||||
| log.Info("convert.Name=" + name + " convert.id=" + convert.ID) | log.Info("convert.Name=" + name + " convert.id=" + convert.ID) | ||||
| ctx.JSON(200, map[string]string{ | ctx.JSON(200, map[string]string{ | ||||
| "result_code": "1", | |||||
| "message": ctx.Tr("repo.modelconvert.manage.create_error1"), | |||||
| "code": "1", | |||||
| "msg": ctx.Tr("repo.modelconvert.manage.create_error1"), | |||||
| }) | }) | ||||
| return | return | ||||
| } | } | ||||
| @@ -117,8 +117,8 @@ func SaveModelConvert(ctx *context.Context) { | |||||
| if isRunningTask(convert.Status) { | if isRunningTask(convert.Status) { | ||||
| log.Info("convert.Status=" + convert.Status + " convert.id=" + convert.ID) | log.Info("convert.Status=" + convert.Status + " convert.id=" + convert.ID) | ||||
| ctx.JSON(200, map[string]string{ | ctx.JSON(200, map[string]string{ | ||||
| "result_code": "1", | |||||
| "message": ctx.Tr("repo.modelconvert.manage.create_error2"), | |||||
| "code": "1", | |||||
| "msg": ctx.Tr("repo.modelconvert.manage.create_error2"), | |||||
| }) | }) | ||||
| return | return | ||||
| } | } | ||||
| @@ -148,7 +148,7 @@ func SaveModelConvert(ctx *context.Context) { | |||||
| go goCreateTask(modelConvert, ctx, task) | go goCreateTask(modelConvert, ctx, task) | ||||
| ctx.JSON(200, map[string]string{ | ctx.JSON(200, map[string]string{ | ||||
| "result_code": "0", | |||||
| "code": "0", | |||||
| }) | }) | ||||
| } | } | ||||
| @@ -588,11 +588,11 @@ func StopModelConvert(ctx *context.Context) { | |||||
| } | } | ||||
| func ShowModelConvertInfo(ctx *context.Context) { | func ShowModelConvertInfo(ctx *context.Context) { | ||||
| ctx.Data["ID"] = ctx.Query("ID") | |||||
| ctx.Data["ID"] = ctx.Query("id") | |||||
| ctx.Data["isModelManage"] = true | ctx.Data["isModelManage"] = true | ||||
| ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) | ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) | ||||
| job, err := models.QueryModelConvertById(ctx.Query("ID")) | |||||
| job, err := models.QueryModelConvertById(ctx.Query("id")) | |||||
| if err == nil { | if err == nil { | ||||
| if job.TrainJobDuration == "" { | if job.TrainJobDuration == "" { | ||||
| job.TrainJobDuration = "00:00:00" | job.TrainJobDuration = "00:00:00" | ||||
| @@ -741,7 +741,7 @@ func ModelConvertDownloadModel(ctx *context.Context) { | |||||
| ctx.ServerError("Not found task.", err) | ctx.ServerError("Not found task.", err) | ||||
| return | return | ||||
| } | } | ||||
| AllDownload := ctx.QueryBool("AllDownload") | |||||
| AllDownload := ctx.QueryBool("allDownload") | |||||
| if AllDownload { | if AllDownload { | ||||
| if job.IsGpuTrainTask() { | if job.IsGpuTrainTask() { | ||||
| path := setting.CBCodePathPrefix + job.ID + "/model/" | path := setting.CBCodePathPrefix + job.ID + "/model/" | ||||
| @@ -175,7 +175,7 @@ func SaveNewNameModel(ctx *context.Context) { | |||||
| ctx.Error(403, ctx.Tr("repo.model_noright")) | ctx.Error(403, ctx.Tr("repo.model_noright")) | ||||
| return | return | ||||
| } | } | ||||
| name := ctx.Query("Name") | |||||
| name := ctx.Query("name") | |||||
| if name == "" { | if name == "" { | ||||
| ctx.Error(500, fmt.Sprintf("name or version is null.")) | ctx.Error(500, fmt.Sprintf("name or version is null.")) | ||||
| return | return | ||||
| @@ -197,13 +197,13 @@ func SaveModel(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| log.Info("save model start.") | log.Info("save model start.") | ||||
| JobId := ctx.Query("JobId") | |||||
| VersionName := ctx.Query("VersionName") | |||||
| name := ctx.Query("Name") | |||||
| version := ctx.Query("Version") | |||||
| label := ctx.Query("Label") | |||||
| description := ctx.Query("Description") | |||||
| engine := ctx.QueryInt("Engine") | |||||
| JobId := ctx.Query("jobId") | |||||
| VersionName := ctx.Query("versionName") | |||||
| name := ctx.Query("name") | |||||
| version := ctx.Query("version") | |||||
| label := ctx.Query("label") | |||||
| description := ctx.Query("description") | |||||
| engine := ctx.QueryInt("engine") | |||||
| modelSelectedFile := ctx.Query("modelSelectedFile") | modelSelectedFile := ctx.Query("modelSelectedFile") | ||||
| log.Info("engine=" + fmt.Sprint(engine) + " modelSelectedFile=" + modelSelectedFile) | log.Info("engine=" + fmt.Sprint(engine) + " modelSelectedFile=" + modelSelectedFile) | ||||
| @@ -293,13 +293,17 @@ func downloadModelFromCloudBrainOne(modelUUID string, jobName string, parentDir | |||||
| func DeleteModel(ctx *context.Context) { | func DeleteModel(ctx *context.Context) { | ||||
| log.Info("delete model start.") | log.Info("delete model start.") | ||||
| id := ctx.Query("ID") | |||||
| id := ctx.Query("id") | |||||
| err := deleteModelByID(ctx, id) | err := deleteModelByID(ctx, id) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.JSON(500, err.Error()) | |||||
| re := map[string]string{ | |||||
| "code": "-1", | |||||
| } | |||||
| re["msg"] = err.Error() | |||||
| ctx.JSON(200, re) | |||||
| } else { | } else { | ||||
| ctx.JSON(200, map[string]string{ | ctx.JSON(200, map[string]string{ | ||||
| "result_code": "0", | |||||
| "code": "0", | |||||
| }) | }) | ||||
| } | } | ||||
| } | } | ||||
| @@ -356,7 +360,7 @@ func QueryModelByParameters(repoId int64, page int) ([]*models.AiModelManage, in | |||||
| func DownloadMultiModelFile(ctx *context.Context) { | func DownloadMultiModelFile(ctx *context.Context) { | ||||
| log.Info("DownloadMultiModelFile start.") | log.Info("DownloadMultiModelFile start.") | ||||
| id := ctx.Query("ID") | |||||
| id := ctx.Query("id") | |||||
| log.Info("id=" + id) | log.Info("id=" + id) | ||||
| task, err := models.QueryModelById(id) | task, err := models.QueryModelById(id) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -489,7 +493,10 @@ func downloadFromCloudBrainTwo(path string, task *models.AiModelManage, ctx *con | |||||
| func QueryTrainJobVersionList(ctx *context.Context) { | func QueryTrainJobVersionList(ctx *context.Context) { | ||||
| log.Info("query train job version list. start.") | log.Info("query train job version list. start.") | ||||
| JobID := ctx.Query("JobID") | |||||
| JobID := ctx.Query("jobId") | |||||
| if JobID == "" { | |||||
| JobID = ctx.Query("JobId") | |||||
| } | |||||
| VersionListTasks, count, err := models.QueryModelTrainJobVersionList(JobID) | VersionListTasks, count, err := models.QueryModelTrainJobVersionList(JobID) | ||||
| @@ -521,7 +528,10 @@ func QueryTrainModelList(ctx *context.Context) { | |||||
| log.Info("query train job list. start.") | log.Info("query train job list. start.") | ||||
| jobName := ctx.Query("jobName") | jobName := ctx.Query("jobName") | ||||
| taskType := ctx.QueryInt("type") | taskType := ctx.QueryInt("type") | ||||
| VersionName := ctx.Query("VersionName") | |||||
| VersionName := ctx.Query("versionName") | |||||
| if VersionName == "" { | |||||
| VersionName = ctx.Query("VersionName") | |||||
| } | |||||
| if taskType == models.TypeCloudBrainTwo { | if taskType == models.TypeCloudBrainTwo { | ||||
| objectkey := path.Join(setting.TrainJobModelPath, jobName, setting.OutPutPath, VersionName) + "/" | objectkey := path.Join(setting.TrainJobModelPath, jobName, setting.OutPutPath, VersionName) + "/" | ||||
| modelDbResult, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, objectkey) | modelDbResult, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, objectkey) | ||||
| @@ -614,7 +624,7 @@ func DownloadSingleModelFile(ctx *context.Context) { | |||||
| } | } | ||||
| func ShowModelInfo(ctx *context.Context) { | func ShowModelInfo(ctx *context.Context) { | ||||
| ctx.Data["ID"] = ctx.Query("ID") | |||||
| ctx.Data["ID"] = ctx.Query("id") | |||||
| ctx.Data["name"] = ctx.Query("name") | ctx.Data["name"] = ctx.Query("name") | ||||
| ctx.Data["isModelManage"] = true | ctx.Data["isModelManage"] = true | ||||
| ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) | ctx.Data["ModelManageAccess"] = ctx.Repo.CanWrite(models.UnitTypeModelManage) | ||||
| @@ -830,8 +840,8 @@ func ModifyModel(id string, description string) error { | |||||
| func ModifyModelInfo(ctx *context.Context) { | func ModifyModelInfo(ctx *context.Context) { | ||||
| log.Info("modify model start.") | log.Info("modify model start.") | ||||
| id := ctx.Query("ID") | |||||
| description := ctx.Query("Description") | |||||
| id := ctx.Query("id") | |||||
| description := ctx.Query("description") | |||||
| task, err := models.QueryModelById(id) | task, err := models.QueryModelById(id) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -896,7 +906,10 @@ func QueryModelListForPredict(ctx *context.Context) { | |||||
| } | } | ||||
| func QueryModelFileForPredict(ctx *context.Context) { | func QueryModelFileForPredict(ctx *context.Context) { | ||||
| id := ctx.Query("ID") | |||||
| id := ctx.Query("id") | |||||
| if id == "" { | |||||
| id = ctx.Query("ID") | |||||
| } | |||||
| model, err := models.QueryModelById(id) | model, err := models.QueryModelById(id) | ||||
| if err == nil { | if err == nil { | ||||
| if model.Type == models.TypeCloudBrainTwo { | if model.Type == models.TypeCloudBrainTwo { | ||||
| @@ -917,7 +930,10 @@ func QueryModelFileForPredict(ctx *context.Context) { | |||||
| } | } | ||||
| func QueryOneLevelModelFile(ctx *context.Context) { | func QueryOneLevelModelFile(ctx *context.Context) { | ||||
| id := ctx.Query("ID") | |||||
| id := ctx.Query("id") | |||||
| if id == "" { | |||||
| id = ctx.Query("ID") | |||||
| } | |||||
| parentDir := ctx.Query("parentDir") | parentDir := ctx.Query("parentDir") | ||||
| model, err := models.QueryModelById(id) | model, err := models.QueryModelById(id) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -366,7 +366,7 @@ | |||||
| data['desc']= $('#Description').val() | data['desc']= $('#Description').val() | ||||
| data['modelId'] = $('#ModelVersion').val() | data['modelId'] = $('#ModelVersion').val() | ||||
| data['SrcEngine'] = $('#SrcEngine').val(); | |||||
| data['srcEngine'] = $('#SrcEngine').val(); | |||||
| data['inputshape']= $('#inputshape').val(); | data['inputshape']= $('#inputshape').val(); | ||||
| if(inputshapeNotValid(data['inputshape'])){ | if(inputshapeNotValid(data['inputshape'])){ | ||||
| @@ -379,10 +379,10 @@ | |||||
| } | } | ||||
| data['inputdataformat']= $('#inputdataformat').val(); | data['inputdataformat']= $('#inputdataformat').val(); | ||||
| data['DestFormat'] = $('#DestFormat').val(); | |||||
| data['NetOutputFormat']= $('#NetOutputFormat').val(); | |||||
| data['ModelFile'] = $('#ModelFile').val(); | |||||
| if(data['ModelFile']==""){ | |||||
| data['destFormat'] = $('#DestFormat').val(); | |||||
| data['netOutputFormat']= $('#NetOutputFormat').val(); | |||||
| data['modelFile'] = $('#ModelFile').val(); | |||||
| if(data['modelFile']==""){ | |||||
| $('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.modelfileempty"}}") | $('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.modelfileempty"}}") | ||||
| $('.ui.error.message').css('display','block') | $('.ui.error.message').css('display','block') | ||||
| $("#ModelFile_Div").addClass("error") | $("#ModelFile_Div").addClass("error") | ||||
| @@ -392,11 +392,11 @@ | |||||
| } | } | ||||
| $.post(`${repolink}/modelmanage/create_model_convert`,data,(result) => { | $.post(`${repolink}/modelmanage/create_model_convert`,data,(result) => { | ||||
| console.log("result=" + result); | console.log("result=" + result); | ||||
| if(result.result_code ==0){ | |||||
| if(result.code ==0){ | |||||
| $('.ui.modal.second').modal('hide'); | $('.ui.modal.second').modal('hide'); | ||||
| window.location.reload(); | window.location.reload(); | ||||
| }else{ | }else{ | ||||
| $('.ui.error.message').text(result.message) | |||||
| $('.ui.error.message').text(result.msg) | |||||
| $('.ui.error.message').css('display','block') | $('.ui.error.message').css('display','block') | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -509,7 +509,7 @@ | |||||
| if(modelId ==null || modelId ==""){ | if(modelId ==null || modelId ==""){ | ||||
| console.log("modelId is null"); | console.log("modelId is null"); | ||||
| }else{ | }else{ | ||||
| $.get(`${repolink}/modelmanage/query_modelfile_for_predict?ID=${modelId}`, (data) => { | |||||
| $.get(`${repolink}/modelmanage/query_modelfile_for_predict?id=${modelId}`, (data) => { | |||||
| const n_length = data.length | const n_length = data.length | ||||
| let file_html='' | let file_html='' | ||||
| let firstFileName ='' | let firstFileName ='' | ||||
| @@ -578,13 +578,13 @@ | |||||
| let nameMap = modelData.nameMap | let nameMap = modelData.nameMap | ||||
| let versionList = nameMap[modelName] | let versionList = nameMap[modelName] | ||||
| if(versionList != null && versionList.length >0){ | if(versionList != null && versionList.length >0){ | ||||
| if(versionList[0].Engine == engineOption){ | |||||
| if(versionList[0].engine == engineOption){ | |||||
| return "selected=\"selected\""; | return "selected=\"selected\""; | ||||
| }else{ | }else{ | ||||
| if((versionList[0].Engine==122 || versionList[0].Engine==37) && engineOption==2){ | |||||
| if((versionList[0].engine==122 || versionList[0].engine==37) && engineOption==2){ | |||||
| return "selected=\"selected\""; | return "selected=\"selected\""; | ||||
| } | } | ||||
| if((versionList[0].Engine==121 || versionList[0].Engine==38) && engineOption==1){ | |||||
| if((versionList[0].engine==121 || versionList[0].engine==38) && engineOption==1){ | |||||
| return "selected=\"selected\""; | return "selected=\"selected\""; | ||||
| } | } | ||||
| } | } | ||||
| @@ -138,20 +138,20 @@ | |||||
| <input type="hidden" name="_csrf" value=""> | <input type="hidden" name="_csrf" value=""> | ||||
| <div class="inline fields"> | <div class="inline fields"> | ||||
| <div class="required two wide field right aligned"> | <div class="required two wide field right aligned"> | ||||
| <label for="JobId">{{.i18n.Tr "repo.model.manage.select.trainjob"}}</label> | |||||
| <label for="jobId">{{.i18n.Tr "repo.model.manage.select.trainjob"}}</label> | |||||
| </div> | </div> | ||||
| <div class="required thirteen wide inline field"> | <div class="required thirteen wide inline field"> | ||||
| <div class="ui dropdown selection search loading" id="choice_model"> | <div class="ui dropdown selection search loading" id="choice_model"> | ||||
| <input type="hidden" id="JobId" name="JobId" required> | |||||
| <input type="hidden" id="jobId" name="jobId" required> | |||||
| <div class="default text">{{.i18n.Tr "repo.model.manage.select.trainjob"}}</div> | <div class="default text">{{.i18n.Tr "repo.model.manage.select.trainjob"}}</div> | ||||
| <i class="dropdown icon"></i> | <i class="dropdown icon"></i> | ||||
| <div class="menu" id="job-name"> | <div class="menu" id="job-name"> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <label for="VersionName">{{.i18n.Tr "repo.model.manage.version"}}</label> | |||||
| <label for="versionName">{{.i18n.Tr "repo.model.manage.version"}}</label> | |||||
| <span> </span> | <span> </span> | ||||
| <div class="ui dropdown selection search" id="choice_version"> | <div class="ui dropdown selection search" id="choice_version"> | ||||
| <input type="hidden" id="VersionName" name="VersionName" required> | |||||
| <input type="hidden" id="versionName" name="versionName" required> | |||||
| <div class="default text">{{.i18n.Tr "repo.model.manage.select.version"}}</div> | <div class="default text">{{.i18n.Tr "repo.model.manage.select.version"}}</div> | ||||
| <i class="dropdown icon"></i> | <i class="dropdown icon"></i> | ||||
| <div class="menu" id="job-version"> | <div class="menu" id="job-version"> | ||||
| @@ -162,18 +162,18 @@ | |||||
| </div> | </div> | ||||
| <div class="required inline fields" id="modelname"> | <div class="required inline fields" id="modelname"> | ||||
| <div class="two wide field right aligned"> | <div class="two wide field right aligned"> | ||||
| <label for="Name">{{.i18n.Tr "repo.model.manage.model_name"}}</label> | |||||
| <label for="name">{{.i18n.Tr "repo.model.manage.model_name"}}</label> | |||||
| </div> | </div> | ||||
| <div class="eight wide field"> | <div class="eight wide field"> | ||||
| <input id="name" name="Name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')"> | |||||
| <input id="name" name="name" required maxlength="25" onkeyup="this.value=this.value.replace(/[, ]/g,'')"> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="required inline fields" id="verionname"> | |||||
| <div class="required inline fields" id="verionName"> | |||||
| <div class="two wide field right aligned"> | <div class="two wide field right aligned"> | ||||
| <label for="Version">{{.i18n.Tr "repo.model.manage.version"}}</label> | |||||
| <label for="version">{{.i18n.Tr "repo.model.manage.version"}}</label> | |||||
| </div> | </div> | ||||
| <div class="eight wide field"> | <div class="eight wide field"> | ||||
| <input id="version" name="Version" value="" readonly required maxlength="255"> | |||||
| <input id="version" name="version" value="" readonly required maxlength="255"> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -182,7 +182,7 @@ | |||||
| <label for="Engine">{{.i18n.Tr "repo.model.manage.engine"}}</label> | <label for="Engine">{{.i18n.Tr "repo.model.manage.engine"}}</label> | ||||
| </div> | </div> | ||||
| <div class="ui ten wide field dropdown selection search" id="choice_Engine"> | <div class="ui ten wide field dropdown selection search" id="choice_Engine"> | ||||
| <input type="hidden" id="Engine" name="Engine" required> | |||||
| <input type="hidden" id="engine" name="engine" required> | |||||
| <div class="default text newtext">{{.i18n.Tr "repo.model.manage.select.engine"}}</div> | <div class="default text newtext">{{.i18n.Tr "repo.model.manage.select.engine"}}</div> | ||||
| <i class="dropdown icon"></i> | <i class="dropdown icon"></i> | ||||
| <div class="menu" id="job-Engine"> | <div class="menu" id="job-Engine"> | ||||
| @@ -209,7 +209,7 @@ | |||||
| <label for="Label">{{.i18n.Tr "repo.model.manage.modellabel"}}  </label> | <label for="Label">{{.i18n.Tr "repo.model.manage.modellabel"}}  </label> | ||||
| </div> | </div> | ||||
| <div class="thirteen wide field"> | <div class="thirteen wide field"> | ||||
| <input id="label" name="Label" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> | |||||
| <input id="label" name="label" maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.label_place"}}'> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="inline fields"> | <div class="inline fields"> | ||||
| @@ -217,7 +217,7 @@ | |||||
| <label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}  </label> | <label for="description">{{.i18n.Tr "repo.model.manage.modeldesc"}}  </label> | ||||
| </div> | </div> | ||||
| <div class="thirteen wide field"> | <div class="thirteen wide field"> | ||||
| <textarea id="Description" name="Description" rows="3" | |||||
| <textarea id="description" name="description" rows="3" | |||||
| maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' | maxlength="255" placeholder='{{.i18n.Tr "repo.modelarts.train_job.new_place"}}' | ||||
| onchange="this.value=this.value.substring(0, 255)" | onchange="this.value=this.value.substring(0, 255)" | ||||
| onkeydown="this.value=this.value.substring(0, 255)" | onkeydown="this.value=this.value.substring(0, 255)" | ||||
| @@ -331,7 +331,7 @@ | |||||
| centered: false, | centered: false, | ||||
| onShow: function () { | onShow: function () { | ||||
| $('#model_header').text({{.i18n.Tr "repo.model.manage.import_new_model"}}) | $('#model_header').text({{.i18n.Tr "repo.model.manage.import_new_model"}}) | ||||
| $('input[name="Version"]').addClass('model_disabled') | |||||
| $('input[name="version"]').addClass('model_disabled') | |||||
| $('.ui.dimmer').css({ "background-color": "rgb(136, 136, 136,0.7)" }) | $('.ui.dimmer').css({ "background-color": "rgb(136, 136, 136,0.7)" }) | ||||
| $("#job-name").empty() | $("#job-name").empty() | ||||
| createModelName() | createModelName() | ||||
| @@ -368,7 +368,7 @@ | |||||
| console.log("model version:" + value); | console.log("model version:" + value); | ||||
| if (modelData != null) { | if (modelData != null) { | ||||
| for (var i = 0; i < modelData.length; i++) { | for (var i = 0; i < modelData.length; i++) { | ||||
| if (modelData[i].VersionName == value) { | |||||
| if (modelData[i].versionName == value) { | |||||
| setEngine(modelData[i]) | setEngine(modelData[i]) | ||||
| loadModelFile(modelData[i]) | loadModelFile(modelData[i]) | ||||
| break; | break; | ||||
| @@ -400,13 +400,13 @@ | |||||
| if(n_length > 0){ | if(n_length > 0){ | ||||
| let train_html = '' | let train_html = '' | ||||
| for (let i = 0; i < n_length; i++) { | for (let i = 0; i < n_length; i++) { | ||||
| train_html += `<div class="item" data-value="${data[i].JobID}">${data[i].DisplayJobName}</div>` | |||||
| train_html += `<div class="item" data-value="${data[i].jobId}">${data[i].displayJobName}</div>` | |||||
| train_html += '</div>' | train_html += '</div>' | ||||
| } | } | ||||
| $("#job-name").append(train_html) | $("#job-name").append(train_html) | ||||
| $("#choice_model").removeClass("loading") | $("#choice_model").removeClass("loading") | ||||
| $('#choice_model .default.text').text(data[0].DisplayJobName) | |||||
| $('#choice_model input[name="JobId"]').val(data[0].JobID) | |||||
| $('#choice_model .default.text').text(data[0].displayJobName) | |||||
| $('#choice_model input[name="jobId"]').val(data[0].jobId) | |||||
| loadTrainVersion() | loadTrainVersion() | ||||
| }else{ | }else{ | ||||
| $("#choice_model").removeClass("loading") | $("#choice_model").removeClass("loading") | ||||
| @@ -414,24 +414,24 @@ | |||||
| }) | }) | ||||
| } | } | ||||
| function loadTrainVersion(value) { | function loadTrainVersion(value) { | ||||
| let JobID = !value ? $('#choice_model input[name="JobId"]').val() : value | |||||
| $.get(`${repolink}/modelmanage/query_train_job_version?JobID=${JobID}`, (data) => { | |||||
| let jobId = !value ? $('#choice_model input[name="jobId"]').val() : value | |||||
| $.get(`${repolink}/modelmanage/query_train_job_version?jobId=${jobId}`, (data) => { | |||||
| const n_length = data.length | const n_length = data.length | ||||
| let train_html = ''; | let train_html = ''; | ||||
| modelData = data; | modelData = data; | ||||
| for (let i = 0; i < n_length; i++) { | for (let i = 0; i < n_length; i++) { | ||||
| train_html += `<div class="item" data-value="${data[i].VersionName}">${data[i].VersionName}</div>` | |||||
| train_html += `<div class="item" data-value="${data[i].versionName}">${data[i].versionName}</div>` | |||||
| train_html += '</div>' | train_html += '</div>' | ||||
| } | } | ||||
| if (data.length) { | if (data.length) { | ||||
| $("#job-version").append(train_html) | $("#job-version").append(train_html) | ||||
| $("#choice_version").removeClass("loading") | $("#choice_version").removeClass("loading") | ||||
| var versionName = data[0].VersionName; | |||||
| var versionName = data[0].versionName; | |||||
| if (versionName == null || versionName == "") { | if (versionName == null || versionName == "") { | ||||
| versionName = "V0001"; | versionName = "V0001"; | ||||
| } | } | ||||
| $('#choice_version .default.text').text(versionName) | $('#choice_version .default.text').text(versionName) | ||||
| $('#choice_version input[name="VersionName"]').val(versionName) | |||||
| $('#choice_version input[name="versionName"]').val(versionName) | |||||
| setEngine(data[0]) | setEngine(data[0]) | ||||
| loadModelFile(data[0]) | loadModelFile(data[0]) | ||||
| } | } | ||||
| @@ -453,7 +453,7 @@ | |||||
| type=0; | type=0; | ||||
| } | } | ||||
| } | } | ||||
| $.get(`${repolink}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${type}&VersionName=${trainJob.VersionName}`, (data) => { | |||||
| $.get(`${repolink}/modelmanage/query_train_model?jobName=${trainJob.JobName}&type=${type}&versionName=${trainJob.versionName}`, (data) => { | |||||
| const n_length = data.length | const n_length = data.length | ||||
| let file_html='' | let file_html='' | ||||
| let firstFileName ='' | let firstFileName ='' | ||||
| @@ -522,8 +522,8 @@ | |||||
| console.log("modelVersion=" + modelVersion); | console.log("modelVersion=" + modelVersion); | ||||
| $('#choice_Engine').dropdown('clear') | $('#choice_Engine').dropdown('clear') | ||||
| $("#job-Engine").empty() | $("#job-Engine").empty() | ||||
| if (modelVersion.EngineName != null && modelVersion.EngineName != "") { | |||||
| srcEngine = modelVersion.EngineName.split('-')[0] | |||||
| if (modelVersion.engineName != null && modelVersion.engineName != "") { | |||||
| srcEngine = modelVersion.engineName.split('-')[0] | |||||
| srcEngine = srcEngine.trim().toLowerCase(); | srcEngine = srcEngine.trim().toLowerCase(); | ||||
| let selectedText = "PyTorch"; | let selectedText = "PyTorch"; | ||||
| let selectedValue = 0; | let selectedValue = 0; | ||||
| @@ -548,7 +548,7 @@ | |||||
| itemHtml += "<option class=\"item\" data-value=\"3\">Other</option>" | itemHtml += "<option class=\"item\" data-value=\"3\">Other</option>" | ||||
| $('#choice_Engine .default.text').text(selectedText) | $('#choice_Engine .default.text').text(selectedText) | ||||
| $('#choice_Engine input[name="Engine"]').val(selectedValue) | |||||
| $('#choice_Engine input[name="engine"]').val(selectedValue) | |||||
| $("#job-Engine").append(itemHtml); | $("#job-Engine").append(itemHtml); | ||||
| $("#choice_Engine").removeClass('disabled'); | $("#choice_Engine").removeClass('disabled'); | ||||
| } else { | } else { | ||||
| @@ -560,7 +560,7 @@ | |||||
| itemHtml += "<option class=\"item\" data-value=\"6\">MXNet</option>" | itemHtml += "<option class=\"item\" data-value=\"6\">MXNet</option>" | ||||
| itemHtml += "<option class=\"item\" data-value=\"3\">Other</option>" | itemHtml += "<option class=\"item\" data-value=\"3\">Other</option>" | ||||
| $('#choice_Engine .default.text').text("PyTorch"); | $('#choice_Engine .default.text').text("PyTorch"); | ||||
| $('#choice_Engine input[name="Engine"]').val(0) | |||||
| $('#choice_Engine input[name="engine"]').val(0) | |||||
| $("#job-Engine").append(itemHtml); | $("#job-Engine").append(itemHtml); | ||||
| $("#choice_Engine").removeClass('disabled'); | $("#choice_Engine").removeClass('disabled'); | ||||
| } | } | ||||
| @@ -221,40 +221,40 @@ function changeInfo(version){ | |||||
| let [initObj,initModelAcc,id] = returnArray | let [initObj,initModelAcc,id] = returnArray | ||||
| editorCancel('','') | editorCancel('','') | ||||
| renderInfo(initObj,initModelAcc,id) | renderInfo(initObj,initModelAcc,id) | ||||
| loadModelFile(versionData[0].ID,versionData[0].Version,'','','init') | |||||
| loadModelFile(versionData[0].id,versionData[0].version,'','','init') | |||||
| }) | }) | ||||
| } | } | ||||
| function loadInfo(){ | function loadInfo(){ | ||||
| $.get(`${url}show_model_info_api?name=${ID}`,(data)=>{ | $.get(`${url}show_model_info_api?name=${ID}`,(data)=>{ | ||||
| let html = '' | let html = '' | ||||
| for (let i=0;i<data.length;i++){ | for (let i=0;i<data.length;i++){ | ||||
| if(!data[i].IsCanOper){ | |||||
| if(!data[i].isCanOper){ | |||||
| $("#edit-pencil").css("display","none") | $("#edit-pencil").css("display","none") | ||||
| } | } | ||||
| html += `<option value="${data[i].Version}">${data[i].Version}</option>` | |||||
| html += `<option value="${data[i].version}">${data[i].version}</option>` | |||||
| } | } | ||||
| $('#dropdown').append(html) | $('#dropdown').append(html) | ||||
| let returnArray = [] | let returnArray = [] | ||||
| returnArray = transObj(data) | returnArray = transObj(data) | ||||
| let [initObj,initModelAcc,id] = returnArray | let [initObj,initModelAcc,id] = returnArray | ||||
| renderInfo(initObj,initModelAcc,id) | renderInfo(initObj,initModelAcc,id) | ||||
| loadModelFile(data[0].ID,data[0].Version,'','','init') | |||||
| loadModelFile(data[0].id,data[0].version,'','','init') | |||||
| }) | }) | ||||
| } | } | ||||
| function getEngineName(model){ | function getEngineName(model){ | ||||
| if(model.Engine == 0){ | |||||
| if(model.engine == 0){ | |||||
| return "PyTorch"; | return "PyTorch"; | ||||
| }else if(model.Engine == 1 || model.Engine == 121 || model.Engine == 38){ | |||||
| }else if(model.engine == 1 || model.engine == 121 || model.engine == 38){ | |||||
| return "TensorFlow"; | return "TensorFlow"; | ||||
| }else if(model.Engine == 2 || model.Engine == 122 || model.Engine == 35 || model.Engine == 37){ | |||||
| }else if(model.engine == 2 || model.engine == 122 || model.engine == 35 || model.engine == 37){ | |||||
| return "MindSpore"; | return "MindSpore"; | ||||
| }else if(model.Engine == 3){ | |||||
| }else if(model.engine == 3){ | |||||
| return "Other"; | return "Other"; | ||||
| }else if(model.Engine == 4){ | |||||
| }else if(model.engine == 4){ | |||||
| return "PaddlePaddle"; | return "PaddlePaddle"; | ||||
| }else if(model.Engine == 5){ | |||||
| }else if(model.engine == 5){ | |||||
| return "OneFlow"; | return "OneFlow"; | ||||
| }else if(model.Engine == 6){ | |||||
| }else if(model.engine == 6){ | |||||
| return "MXNet"; | return "MXNet"; | ||||
| } | } | ||||
| else{ | else{ | ||||
| @@ -262,36 +262,36 @@ function loadInfo(){ | |||||
| } | } | ||||
| } | } | ||||
| function transObj(data){ | function transObj(data){ | ||||
| let {ID,Name,Version,Label,Size,Description,CreatedUnix,Accuracy,CodeBranch,CodeCommitID,TrainTaskInfo} = data[0] | |||||
| let modelAcc = JSON.parse(Accuracy) | |||||
| TrainTaskInfo = JSON.parse(TrainTaskInfo) | |||||
| let {id,name,version,label,size,description,createdUnix,accuracy,codeBranch,codeCommitID,trainTaskInfo} = data[0] | |||||
| let modelAcc = JSON.parse(accuracy) | |||||
| trainTaskInfo = JSON.parse(trainTaskInfo) | |||||
| // Parameters = JSON.parse(Parameters) | // Parameters = JSON.parse(Parameters) | ||||
| let {Parameters} = TrainTaskInfo | |||||
| let EngineName = getEngineName(data[0]) | |||||
| Parameters = JSON.parse(Parameters) | |||||
| Parameters = Parameters.parameter.length === 0 ? '--':Parameters.parameter | |||||
| let size = tranSize(Size) | |||||
| let time = transTime(CreatedUnix) | |||||
| let {parameters} = trainTaskInfo | |||||
| let engineName = getEngineName(data[0]) | |||||
| parameters = JSON.parse(parameters) | |||||
| parameters = parameters.parameter.length === 0 ? '--':parameters.parameter | |||||
| size = tranSize(size) | |||||
| let time = transTime(createdUnix) | |||||
| let initObj = { | let initObj = { | ||||
| ModelName:Name || '--', | |||||
| Version:Version, | |||||
| Label:Label || '--', | |||||
| Size:size, | |||||
| CreateTime:time, | |||||
| Description:Description || '--', | |||||
| CodeBranch:CodeBranch || '--', | |||||
| CodeCommitID:CodeCommitID || '--', | |||||
| BootFile:TrainTaskInfo.BootFile || '--', | |||||
| DatasetName:TrainTaskInfo.DatasetName || '--', | |||||
| Parameters:TrainTaskInfo.Parameters || '--', | |||||
| FlavorName:TrainTaskInfo.FlavorName || '--', | |||||
| WorkServerNumber:TrainTaskInfo.WorkServerNumber || '--', | |||||
| Parameters:Parameters, | |||||
| EngineName:EngineName, | |||||
| DisplayJobName:TrainTaskInfo.DisplayJobName || '--', | |||||
| TrainJobVersionName:TrainTaskInfo.VersionName || '', | |||||
| CloudBrainJobID:TrainTaskInfo.JobID|| '', | |||||
| CloudBrainType:TrainTaskInfo.Type, | |||||
| modelName:name || '--', | |||||
| version:version, | |||||
| label:label || '--', | |||||
| size:size, | |||||
| createTime:time, | |||||
| description:description || '--', | |||||
| codeBranch:codeBranch || '--', | |||||
| codeCommitID:codeCommitID || '--', | |||||
| bootFile:trainTaskInfo.BootFile || '--', | |||||
| datasetName:trainTaskInfo.DatasetName || '--', | |||||
| parameters:trainTaskInfo.Parameters || '--', | |||||
| flavorName:trainTaskInfo.FlavorName || '--', | |||||
| workServerNumber:trainTaskInfo.WorkServerNumber || '--', | |||||
| parameters:parameters, | |||||
| engineName:engineName, | |||||
| displayJobName:trainTaskInfo.DisplayJobName || '--', | |||||
| trainJobVersionName:trainTaskInfo.VersionName || '', | |||||
| cloudBrainJobID:trainTaskInfo.JobID|| '', | |||||
| cloudBrainType:trainTaskInfo.Type, | |||||
| } | } | ||||
| let initModelAcc = { | let initModelAcc = { | ||||
| Accuracy: modelAcc.Accuracy || '--', | Accuracy: modelAcc.Accuracy || '--', | ||||
| @@ -338,8 +338,8 @@ function editorSure(text,id){ | |||||
| let description=$('#textarea-value').val() | let description=$('#textarea-value').val() | ||||
| let sourcetext = $('#textarea-value').val().replace(/\n/g,'enter;') | let sourcetext = $('#textarea-value').val().replace(/\n/g,'enter;') | ||||
| let data = { | let data = { | ||||
| ID:id, | |||||
| Description:description | |||||
| id:id, | |||||
| description:description | |||||
| } | } | ||||
| $.ajax({ | $.ajax({ | ||||
| url:`${url}modify_model`, | url:`${url}modify_model`, | ||||
| @@ -351,14 +351,14 @@ function editorSure(text,id){ | |||||
| } | } | ||||
| function renderInfo(obj,accObj,id){ | function renderInfo(obj,accObj,id){ | ||||
| for(let key in obj){ | for(let key in obj){ | ||||
| if(key==="Description"){ | |||||
| if(key==="description"){ | |||||
| let descriptionText=obj[key].replace(/\r\n|\n/g,'enter;') | let descriptionText=obj[key].replace(/\r\n|\n/g,'enter;') | ||||
| $(`#${key}`).text(obj[key]) | $(`#${key}`).text(obj[key]) | ||||
| $(`#${key}`).attr("title",obj[key]) | $(`#${key}`).attr("title",obj[key]) | ||||
| $('#edit-pencil').attr("data-id",id) | $('#edit-pencil').attr("data-id",id) | ||||
| $('#edit-pencil').attr("data-desc",descriptionText) | $('#edit-pencil').attr("data-desc",descriptionText) | ||||
| } | } | ||||
| else if(key==="Label"){ | |||||
| else if(key==="label"){ | |||||
| $('#Label').empty() | $('#Label').empty() | ||||
| if(obj[key]==='--'){ | if(obj[key]==='--'){ | ||||
| $('#Label').text(obj[key]) | $('#Label').text(obj[key]) | ||||
| @@ -372,33 +372,33 @@ function renderInfo(obj,accObj,id){ | |||||
| $('#Label').append(html) | $('#Label').append(html) | ||||
| } | } | ||||
| } | } | ||||
| else if(key==="CodeCommitID"){ | |||||
| else if(key==="codeCommitID"){ | |||||
| let codeCommit = obj[key].slice(0,10) | let codeCommit = obj[key].slice(0,10) | ||||
| let html = `<a style="margin-left:1rem" class="ui label" title="${codeCommit}">${codeCommit}</a>` | let html = `<a style="margin-left:1rem" class="ui label" title="${codeCommit}">${codeCommit}</a>` | ||||
| $('#CodeBranch').append(html) | $('#CodeBranch').append(html) | ||||
| } | } | ||||
| else if(key==="DisplayJobName"){ | |||||
| let type=obj["CloudBrainType"] | |||||
| else if(key==="displayJobName"){ | |||||
| let type=obj["cloudBrainType"] | |||||
| let href="" | let href="" | ||||
| if(type==1){ | if(type==1){ | ||||
| href=trainJobUrl + "modelarts/train-job/" + obj["CloudBrainJobID"] | |||||
| href=trainJobUrl + "modelarts/train-job/" + obj["cloudBrainJobID"] | |||||
| }else if(type==0){ | }else if(type==0){ | ||||
| href=trainJobUrl + "cloudbrain/train-job/" + obj["CloudBrainJobID"] | |||||
| href=trainJobUrl + "cloudbrain/train-job/" + obj["cloudBrainJobID"] | |||||
| }else if(type==2){ | }else if(type==2){ | ||||
| href=trainJobUrl + "grampus/train-job/" + obj["CloudBrainJobID"] | href=trainJobUrl + "grampus/train-job/" + obj["CloudBrainJobID"] | ||||
| } | } | ||||
| $(`#DisplayJobNameHref`).attr("href",href) | |||||
| $(`#DisplayJobNameHref`).attr("title",obj[key]) | |||||
| $(`#displayJobNameHref`).attr("href",href) | |||||
| $(`#displayJobNameHref`).attr("title",obj[key]) | |||||
| $(`#${key}`).text(obj[key]) | $(`#${key}`).text(obj[key]) | ||||
| let versionName = obj["TrainJobVersionName"] | |||||
| let versionName = obj["trainJobVersionName"] | |||||
| if(versionName!=""){ | if(versionName!=""){ | ||||
| let html = `<span style="margin-left:1rem" class="ui label">${versionName}</span>` | let html = `<span style="margin-left:1rem" class="ui label">${versionName}</span>` | ||||
| $('#DisplayJobName').append(html) | |||||
| $('#displayJobName').append(html) | |||||
| } | } | ||||
| } | } | ||||
| else if(key==="Parameters"){ | |||||
| else if(key==="parameters"){ | |||||
| if(obj[key]==='--'){ | if(obj[key]==='--'){ | ||||
| $(`#${key}`).text(obj[key]) | $(`#${key}`).text(obj[key]) | ||||
| }else{ | }else{ | ||||
| @@ -13,7 +13,7 @@ | |||||
| :header-cell-style="tableHeaderStyle" | :header-cell-style="tableHeaderStyle" | ||||
| > | > | ||||
| <el-table-column | <el-table-column | ||||
| prop="Name" | |||||
| prop="name" | |||||
| :label="i18n.model_name" | :label="i18n.model_name" | ||||
| align="left" | align="left" | ||||
| min-width="17%" | min-width="17%" | ||||
| @@ -25,105 +25,105 @@ | |||||
| <!-- <i class="el-icon-time"></i> --> | <!-- <i class="el-icon-time"></i> --> | ||||
| <a | <a | ||||
| class="text-over" | class="text-over" | ||||
| :href="showinfoHref + scope.row.Name" | |||||
| :title="scope.row.Name" | |||||
| >{{ scope.row.Name }}</a | |||||
| :href="showinfoHref + scope.row.name" | |||||
| :title="scope.row.name" | |||||
| >{{ scope.row.name }}</a | |||||
| > | > | ||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="Status" | |||||
| prop="status" | |||||
| :label="i18n.model_status" | :label="i18n.model_status" | ||||
| align="center" | align="center" | ||||
| min-width="6.5%" | min-width="6.5%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <span class="text-over" :title="scope.row.Status_title"> | |||||
| <i style="vertical-align: middle" :class="scope.row.Status"></i | |||||
| <span class="text-over" :title="scope.row.status_title"> | |||||
| <i style="vertical-align: middle" :class="scope.row.status"></i | |||||
| ></span> | ></span> | ||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="Version" | |||||
| prop="version" | |||||
| :label="i18n.model_version" | :label="i18n.model_version" | ||||
| align="center" | align="center" | ||||
| min-width="6%" | min-width="6%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <span class="text-over" :title="scope.row.Version">{{ | |||||
| scope.row.Version | |||||
| <span class="text-over" :title="scope.row.version">{{ | |||||
| scope.row.version | |||||
| }}</span> | }}</span> | ||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="VersionCount" | |||||
| prop="versionCount" | |||||
| :label="i18n.model_version_num" | :label="i18n.model_version_num" | ||||
| align="center" | align="center" | ||||
| min-width="7%" | min-width="7%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <span class="text-over" :title="scope.row.VersionCount">{{ | |||||
| scope.row.VersionCount | |||||
| <span class="text-over" :title="scope.row.versionCount">{{ | |||||
| scope.row.versionCount | |||||
| }}</span> | }}</span> | ||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="Size" | |||||
| prop="size" | |||||
| :label="i18n.model_size" | :label="i18n.model_size" | ||||
| align="center" | align="center" | ||||
| min-width="10%" | min-width="10%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <span class="text-over">{{ renderSize(scope.row.Size) }}</span> | |||||
| <span class="text-over">{{ renderSize(scope.row.size) }}</span> | |||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="EngineName" | |||||
| prop="engineName" | |||||
| :label="i18n.model_egine" | :label="i18n.model_egine" | ||||
| align="center" | align="center" | ||||
| min-width="8%" | min-width="8%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <span class="text-over" :title="scope.row.EngineName">{{ | |||||
| scope.row.EngineName | |||||
| <span class="text-over" :title="scope.row.engineName">{{ | |||||
| scope.row.engineName | |||||
| }}</span> | }}</span> | ||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="ComputeResource" | |||||
| prop="computeResource" | |||||
| :label="i18n.model_compute_resource" | :label="i18n.model_compute_resource" | ||||
| align="center" | align="center" | ||||
| min-width="8%" | min-width="8%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <span class="text-over">{{ scope.row.ComputeResource }}</span> | |||||
| <span class="text-over">{{ scope.row.computeResource }}</span> | |||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="CreatedUnix" | |||||
| prop="createdUnix" | |||||
| :label="i18n.model_create_time" | :label="i18n.model_create_time" | ||||
| align="center" | align="center" | ||||
| min-width="13.75%" | min-width="13.75%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| {{ transTime(scope.row.CreatedUnix) }} | |||||
| {{ transTime(scope.row.createdUnix) }} | |||||
| </template> | </template> | ||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="UserName" | |||||
| prop="userName" | |||||
| :label="i18n.model_creator" | :label="i18n.model_creator" | ||||
| align="center" | align="center" | ||||
| min-width="6.75%" | min-width="6.75%" | ||||
| > | > | ||||
| <template slot-scope="scope"> | <template slot-scope="scope"> | ||||
| <a | <a | ||||
| :href="!scope.row.UserName ? '#' : '/' + scope.row.UserName" | |||||
| :title="scope.row.UserName || defaultAvatarName" | |||||
| :href="!scope.row.userName ? '#' : '/' + scope.row.userName" | |||||
| :title="scope.row.userName || defaultAvatarName" | |||||
| > | > | ||||
| <img | <img | ||||
| class="ui avatar image" | class="ui avatar image" | ||||
| :src="scope.row.UserRelAvatarLink || defaultAvatar" | |||||
| :src="scope.row.userRelAvatarLink || defaultAvatar" | |||||
| /> | /> | ||||
| </a> | </a> | ||||
| </template> | </template> | ||||
| @@ -140,25 +140,25 @@ | |||||
| :style="{ | :style="{ | ||||
| visibility: !scope.row.Children ? 'visible' : 'hidden', | visibility: !scope.row.Children ? 'visible' : 'hidden', | ||||
| }" | }" | ||||
| :class="{ disabled: !scope.row.IsCanOper }" | |||||
| :class="{ disabled: !scope.row.isCanOper }" | |||||
| @click=" | @click=" | ||||
| showcreateVue( | showcreateVue( | ||||
| scope.row.Name, | |||||
| scope.row.Version, | |||||
| scope.row.Label | |||||
| scope.row.name, | |||||
| scope.row.version, | |||||
| scope.row.label | |||||
| ) | ) | ||||
| " | " | ||||
| >{{ i18n.model_create_new_ver }}</a | >{{ i18n.model_create_new_ver }}</a | ||||
| > | > | ||||
| <a | <a | ||||
| :href="loadhref + scope.row.ID" | |||||
| :class="{ disabled: !scope.row.IsCanOper }" | |||||
| :href="loadhref + scope.row.id" | |||||
| :class="{ disabled: !scope.row.isCanOper }" | |||||
| >{{ i18n.model_download }}</a | >{{ i18n.model_download }}</a | ||||
| > | > | ||||
| <a | <a | ||||
| :class="{ disabled: !scope.row.IsCanDelete }" | |||||
| :class="{ disabled: !scope.row.isCanDelete }" | |||||
| @click=" | @click=" | ||||
| deleteModel(scope.row.ID, scope.row.cName, scope.row.rowKey) | |||||
| deleteModel(scope.row.id, scope.row.cName, scope.row.rowKey) | |||||
| " | " | ||||
| >{{ i18n.model_delete }}</a | >{{ i18n.model_delete }}</a | ||||
| > | > | ||||
| @@ -219,17 +219,17 @@ export default { | |||||
| }, | }, | ||||
| }) | }) | ||||
| .then((res) => { | .then((res) => { | ||||
| let TrainTaskInfo; | |||||
| let trainTaskInfo; | |||||
| let tableData; | let tableData; | ||||
| tableData = res.data; | tableData = res.data; | ||||
| for (let i = 0; i < tableData.length; i++) { | for (let i = 0; i < tableData.length; i++) { | ||||
| TrainTaskInfo = JSON.parse(tableData[i].TrainTaskInfo); | |||||
| tableData[i].EngineName = this.getEngineName(tableData[i]); | |||||
| tableData[i].ComputeResource = TrainTaskInfo.ComputeResource; | |||||
| tableData[i].cName = tableData[i].Name; | |||||
| tableData[i].rowKey = tableData[i].ID + Math.random(); | |||||
| tableData[i].Name = ""; | |||||
| tableData[i].VersionCount = ""; | |||||
| trainTaskInfo = JSON.parse(tableData[i].trainTaskInfo); | |||||
| tableData[i].engineName = this.getEngineName(tableData[i]); | |||||
| tableData[i].computeResource = trainTaskInfo.ComputeResource; | |||||
| tableData[i].cName = tableData[i].name; | |||||
| tableData[i].rowKey = tableData[i].id + Math.random(); | |||||
| tableData[i].name = ""; | |||||
| tableData[i].versionCount = ""; | |||||
| tableData[i].Children = true; | tableData[i].Children = true; | ||||
| } | } | ||||
| resolve(tableData || []); | resolve(tableData || []); | ||||
| @@ -258,10 +258,10 @@ export default { | |||||
| centered: false, | centered: false, | ||||
| onShow: function () { | onShow: function () { | ||||
| $("#model_header").text(title); | $("#model_header").text(title); | ||||
| $('input[name="Name"]').addClass("model_disabled"); | |||||
| $('input[name="Name"]').attr("readonly", "readonly"); | |||||
| $('input[name="name"]').addClass("model_disabled"); | |||||
| $('input[name="name"]').attr("readonly", "readonly"); | |||||
| $('input[name="modelSelectedFile"]').attr("readonly", "readonly"); | $('input[name="modelSelectedFile"]').attr("readonly", "readonly"); | ||||
| $('input[name="Version"]').addClass("model_disabled"); | |||||
| $('input[name="version"]').addClass("model_disabled"); | |||||
| $(".ui.dimmer").css({ | $(".ui.dimmer").css({ | ||||
| "background-color": "rgb(136, 136, 136,0.7)", | "background-color": "rgb(136, 136, 136,0.7)", | ||||
| }); | }); | ||||
| @@ -274,8 +274,8 @@ export default { | |||||
| }, | }, | ||||
| onHide: function () { | onHide: function () { | ||||
| document.getElementById("formId").reset(); | document.getElementById("formId").reset(); | ||||
| $('input[name="Name"]').removeClass("model_disabled"); | |||||
| $('input[name="Name"]').removeAttr("readonly"); | |||||
| $('input[name="name"]').removeClass("model_disabled"); | |||||
| $('input[name="name"]').removeAttr("readonly"); | |||||
| $('input[name="modelSelectedFile"]').removeAttr("readonly"); | $('input[name="modelSelectedFile"]').removeAttr("readonly"); | ||||
| var cityObj = $("#modelSelectedFile"); | var cityObj = $("#modelSelectedFile"); | ||||
| cityObj.attr("value", ""); | cityObj.attr("value", ""); | ||||
| @@ -290,8 +290,8 @@ export default { | |||||
| .modal("show"); | .modal("show"); | ||||
| }, | }, | ||||
| check() { | check() { | ||||
| let jobid = document.getElementById("JobId").value; | |||||
| let versionname = document.getElementById("VersionName").value; | |||||
| let jobid = document.getElementById("jobId").value; | |||||
| let versionname = document.getElementById("versionName").value; | |||||
| let name = document.getElementById("name").value; | let name = document.getElementById("name").value; | ||||
| let version = document.getElementById("version").value; | let version = document.getElementById("version").value; | ||||
| let modelSelectedFile = | let modelSelectedFile = | ||||
| @@ -333,8 +333,8 @@ export default { | |||||
| let context = this; | let context = this; | ||||
| let flag = this.check(); | let flag = this.check(); | ||||
| if (flag) { | if (flag) { | ||||
| let cName = $("input[name='Name']").val(); | |||||
| let version = $("input[name='Version']").val(); | |||||
| let cName = $("input[name='name']").val(); | |||||
| let version = $("input[name='version']").val(); | |||||
| let data = $("#formId").serialize(); | let data = $("#formId").serialize(); | ||||
| const initModel = $("input[name='initModel']").val(); | const initModel = $("input[name='initModel']").val(); | ||||
| let url_href = | let url_href = | ||||
| @@ -387,7 +387,7 @@ export default { | |||||
| let childrenIndex = store.states.lazyTreeNodeMap[ | let childrenIndex = store.states.lazyTreeNodeMap[ | ||||
| parentRow.rowKey | parentRow.rowKey | ||||
| ].findIndex((child) => child.rowKey == row.rowKey); | ].findIndex((child) => child.rowKey == row.rowKey); | ||||
| parentRow.VersionCount = parentRow.VersionCount - 1; | |||||
| parentRow.versionCount = parentRow.versionCount - 1; | |||||
| const parent = store.states.lazyTreeNodeMap[parentRow.rowKey]; | const parent = store.states.lazyTreeNodeMap[parentRow.rowKey]; | ||||
| if (parent.length === 1) { | if (parent.length === 1) { | ||||
| this.getModelList(); | this.getModelList(); | ||||
| @@ -398,7 +398,7 @@ export default { | |||||
| } | } | ||||
| }, | }, | ||||
| deleteModel(id, name, rowKey) { | deleteModel(id, name, rowKey) { | ||||
| let row = { cName: name, ID: id, rowKey: rowKey }; | |||||
| let row = { cName: name, id: id, rowKey: rowKey }; | |||||
| let _this = this; | let _this = this; | ||||
| let flag = 1; | let flag = 1; | ||||
| $(".ui.basic.modal.first") | $(".ui.basic.modal.first") | ||||
| @@ -410,7 +410,7 @@ export default { | |||||
| _this.$axios | _this.$axios | ||||
| .delete(_this.url + "delete_model", { | .delete(_this.url + "delete_model", { | ||||
| params: { | params: { | ||||
| ID: id, | |||||
| id: id, | |||||
| }, | }, | ||||
| }) | }) | ||||
| .then((res) => { | .then((res) => { | ||||
| @@ -442,21 +442,21 @@ export default { | |||||
| .modal("show"); | .modal("show"); | ||||
| }, | }, | ||||
| getEngineName(model) { | getEngineName(model) { | ||||
| if (model.Engine == 0) { | |||||
| if (model.engine == 0) { | |||||
| return "PyTorch"; | return "PyTorch"; | ||||
| } else if (model.Engine == 1 || model.Engine == 121) { | |||||
| } else if (model.engine == 1 || model.engine == 121) { | |||||
| return "TensorFlow"; | return "TensorFlow"; | ||||
| } else if ( | } else if ( | ||||
| model.Engine == 2 || | |||||
| model.Engine == 122 || | |||||
| model.Engine == 35 | |||||
| model.engine == 2 || | |||||
| model.engine == 122 || | |||||
| model.engine == 35 | |||||
| ) { | ) { | ||||
| return "MindSpore"; | return "MindSpore"; | ||||
| } else if (model.Engine == 4) { | |||||
| } else if (model.engine == 4) { | |||||
| return "PaddlePaddle"; | return "PaddlePaddle"; | ||||
| } else if (model.Engine == 5) { | |||||
| } else if (model.engine == 5) { | |||||
| return "OneFlow"; | return "OneFlow"; | ||||
| } else if (model.Engine == 6) { | |||||
| } else if (model.engine == 6) { | |||||
| return "MXNet"; | return "MXNet"; | ||||
| } else { | } else { | ||||
| return "Other"; | return "Other"; | ||||
| @@ -480,34 +480,34 @@ export default { | |||||
| .then((res) => { | .then((res) => { | ||||
| $(".ui.grid").removeAttr("style"); | $(".ui.grid").removeAttr("style"); | ||||
| $("#loadContainer").removeClass("loader"); | $("#loadContainer").removeClass("loader"); | ||||
| let TrainTaskInfo; | |||||
| let trainTaskInfo; | |||||
| this.tableData = res.data.data; | this.tableData = res.data.data; | ||||
| for (let i = 0; i < this.tableData.length; i++) { | for (let i = 0; i < this.tableData.length; i++) { | ||||
| TrainTaskInfo = JSON.parse(this.tableData[i].TrainTaskInfo); | |||||
| this.tableData[i].cName = this.tableData[i].Name; | |||||
| this.tableData[i].rowKey = this.tableData[i].ID + Math.random(); | |||||
| this.tableData[i].EngineName = this.getEngineName( | |||||
| trainTaskInfo = JSON.parse(this.tableData[i].trainTaskInfo); | |||||
| this.tableData[i].cName = this.tableData[i].name; | |||||
| this.tableData[i].rowKey = this.tableData[i].id + Math.random(); | |||||
| this.tableData[i].engineName = this.getEngineName( | |||||
| this.tableData[i] | this.tableData[i] | ||||
| ); | ); | ||||
| this.tableData[i].ComputeResource = TrainTaskInfo.ComputeResource; | |||||
| this.tableData[i].computeResource = trainTaskInfo.ComputeResource; | |||||
| this.tableData[i].hasChildren = | this.tableData[i].hasChildren = | ||||
| res.data.data[i].VersionCount === 1 ? false : true; | |||||
| if (this.tableData[i].Status !== 1) { | |||||
| res.data.data[i].versionCount === 1 ? false : true; | |||||
| if (this.tableData[i].status !== 1) { | |||||
| countStatus++; | countStatus++; | ||||
| } | } | ||||
| switch (this.tableData[i].Status) { | |||||
| switch (this.tableData[i].status) { | |||||
| case 1: | case 1: | ||||
| this.tableData[i].Status = "WAITING"; | |||||
| this.tableData[i].Status_title = this.i18n.model_wait; | |||||
| this.tableData[i].status = "WAITING"; | |||||
| this.tableData[i].status_title = this.i18n.model_wait; | |||||
| break; | break; | ||||
| case 2: | case 2: | ||||
| this.tableData[i].Status = "FAILED"; | |||||
| this.tableData[i].Status_title = this.tableData[i].StatusDesc; | |||||
| this.tableData[i].status = "FAILED"; | |||||
| this.tableData[i].status_title = this.tableData[i].statusDesc; | |||||
| break; | break; | ||||
| default: | default: | ||||
| this.tableData[i].Status = "SUCCEEDED"; | |||||
| this.tableData[i].Status_title = this.i18n.model_success; | |||||
| this.tableData[i].status = "SUCCEEDED"; | |||||
| this.tableData[i].status_title = this.i18n.model_success; | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -531,7 +531,7 @@ export default { | |||||
| }, | }, | ||||
| computed: { | computed: { | ||||
| loadhref() { | loadhref() { | ||||
| return this.url + "downloadall?ID="; | |||||
| return this.url + "downloadall?id="; | |||||
| }, | }, | ||||
| showinfoHref() { | showinfoHref() { | ||||
| return this.url + "show_model_info?name="; | return this.url + "show_model_info?name="; | ||||