| @@ -11,29 +11,30 @@ import ( | |||
| ) | |||
| type AiModelManage struct { | |||
| ID string `xorm:"pk"` | |||
| Name string `xorm:"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"` | |||
| Accuracy string `xorm:"varchar(1000)"` | |||
| AttachmentId string `xorm:"NULL"` | |||
| RepoId int64 `xorm:"NULL"` | |||
| CodeBranch string `xorm:"varchar(400) NULL"` | |||
| CodeCommitID string `xorm:"NULL"` | |||
| UserId int64 `xorm:"NOT NULL"` | |||
| UserName string `xorm:"NULL"` | |||
| TrainTaskInfo string `xorm:"text NULL"` | |||
| CreatedUnix timeutil.TimeStamp `xorm:"created"` | |||
| UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` | |||
| ID string `xorm:"pk"` | |||
| Name string `xorm:"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"` | |||
| Accuracy string `xorm:"varchar(1000)"` | |||
| AttachmentId string `xorm:"NULL"` | |||
| RepoId int64 `xorm:"NULL"` | |||
| CodeBranch string `xorm:"varchar(400) NULL"` | |||
| CodeCommitID string `xorm:"NULL"` | |||
| UserId int64 `xorm:"NOT NULL"` | |||
| UserName string `xorm:"NULL"` | |||
| UserRelAvatarLink string `xorm:"NULL"` | |||
| TrainTaskInfo string `xorm:"text NULL"` | |||
| CreatedUnix timeutil.TimeStamp `xorm:"created"` | |||
| UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` | |||
| } | |||
| type AiModelQueryOptions struct { | |||
| @@ -145,6 +145,7 @@ type User struct { | |||
| AllowImportLocal bool // Allow migrate repository by local path | |||
| AllowCreateOrganization bool `xorm:"DEFAULT true"` | |||
| ProhibitLogin bool `xorm:"NOT NULL DEFAULT false"` | |||
| IsOperator bool `xorm:"NOT NULL DEFAULT false"` //运营人员 | |||
| // Avatar | |||
| Avatar string `xorm:"VARCHAR(2048) NOT NULL"` | |||
| @@ -145,8 +145,7 @@ func Toggle(options *ToggleOptions) macaron.Handler { | |||
| } | |||
| if options.OperationRequired { | |||
| //todo: add isOperator judgement | |||
| if !ctx.User.IsAdmin { | |||
| if !ctx.User.IsOperator { | |||
| ctx.Error(403) | |||
| return | |||
| } | |||
| @@ -310,6 +310,7 @@ func Contexter() macaron.Handler { | |||
| ctx.Data["SignedUserID"] = ctx.User.ID | |||
| ctx.Data["SignedUserName"] = ctx.User.Name | |||
| ctx.Data["IsAdmin"] = ctx.User.IsAdmin | |||
| ctx.Data["IsOperator"] = ctx.User.IsOperator | |||
| c.Data["SignedUserName"] = ctx.User.Name | |||
| } else { | |||
| ctx.Data["SignedUserID"] = int64(0) | |||
| @@ -75,6 +75,7 @@ import ( | |||
| "code.gitea.io/gitea/routers/api/v1/repo" | |||
| _ "code.gitea.io/gitea/routers/api/v1/swagger" // for swagger generation | |||
| "code.gitea.io/gitea/routers/api/v1/user" | |||
| repo_ext "code.gitea.io/gitea/routers/repo" | |||
| "gitea.com/macaron/binding" | |||
| "gitea.com/macaron/macaron" | |||
| @@ -523,23 +524,26 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
| Get(notify.GetThread). | |||
| Patch(notify.ReadThread) | |||
| }, reqToken()) | |||
| adminReq := context.Toggle(&context.ToggleOptions{SignInRequired: true, AdminRequired: true}) | |||
| operationReq := context.Toggle(&context.ToggleOptions{SignInRequired: true, OperationRequired: true}) | |||
| //Project board | |||
| m.Group("/projectboard", func() { | |||
| m.Get("/restoreFork", adminReq, repo.RestoreForkNumber) | |||
| m.Get("/downloadAll", adminReq, repo.ServeAllProjectsPeriodStatisticsFile) | |||
| m.Get("/downloadAllOpenI", adminReq, repo.ServeAllProjectsOpenIStatisticsFile) | |||
| m.Get("/restoreFork", repo.RestoreForkNumber) | |||
| m.Get("/downloadAll", repo.ServeAllProjectsPeriodStatisticsFile) | |||
| m.Get("/downloadAllOpenI", repo.ServeAllProjectsOpenIStatisticsFile) | |||
| m.Group("/project", func() { | |||
| m.Get("", adminReq, repo.GetAllProjectsPeriodStatistics) | |||
| m.Get("", repo.GetAllProjectsPeriodStatistics) | |||
| m.Group("/:id", func() { | |||
| m.Get("", adminReq, repo.GetProjectLatestStatistics) | |||
| m.Get("/period", adminReq, repo.GetProjectPeriodStatistics) | |||
| m.Get("", repo.GetProjectLatestStatistics) | |||
| m.Get("/period", repo.GetProjectPeriodStatistics) | |||
| }) | |||
| }) | |||
| }) | |||
| }, operationReq) | |||
| m.Get("/query_user_static_page", operationReq, repo_ext.QueryUserStaticDataPage) | |||
| // Users | |||
| m.Group("/users", func() { | |||
| @@ -25,7 +25,7 @@ const ( | |||
| MODEL_NOT_LATEST = 0 | |||
| ) | |||
| func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, userId int64, userName string) error { | |||
| func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, userId int64, userName string, userHeadUrl string) error { | |||
| aiTask, err := models.GetCloudbrainByJobIDAndVersionName(jobId, versionName) | |||
| //aiTask, err := models.GetCloudbrainByJobID(jobId) | |||
| if err != nil { | |||
| @@ -69,25 +69,26 @@ func saveModelByParameters(jobId string, versionName string, name string, versio | |||
| //taskConfigInfo,err := models.GetCloudbrainByJobIDAndVersionName(jobId,aiTask.VersionName) | |||
| model := &models.AiModelManage{ | |||
| ID: id, | |||
| Version: version, | |||
| VersionCount: len(aimodels) + 1, | |||
| Label: label, | |||
| Name: name, | |||
| Description: description, | |||
| New: MODEL_LATEST, | |||
| Type: cloudType, | |||
| Path: modelPath, | |||
| Size: modelSize, | |||
| AttachmentId: aiTask.Uuid, | |||
| RepoId: aiTask.RepoID, | |||
| UserId: userId, | |||
| UserName: userName, | |||
| CodeBranch: aiTask.BranchName, | |||
| CodeCommitID: aiTask.CommitID, | |||
| Engine: aiTask.EngineID, | |||
| TrainTaskInfo: string(aiTaskJson), | |||
| Accuracy: string(accuracyJson), | |||
| ID: id, | |||
| Version: version, | |||
| VersionCount: len(aimodels) + 1, | |||
| Label: label, | |||
| Name: name, | |||
| Description: description, | |||
| New: MODEL_LATEST, | |||
| Type: cloudType, | |||
| Path: modelPath, | |||
| Size: modelSize, | |||
| AttachmentId: aiTask.Uuid, | |||
| RepoId: aiTask.RepoID, | |||
| UserId: userId, | |||
| UserName: userName, | |||
| UserRelAvatarLink: userHeadUrl, | |||
| CodeBranch: aiTask.BranchName, | |||
| CodeCommitID: aiTask.CommitID, | |||
| Engine: aiTask.EngineID, | |||
| TrainTaskInfo: string(aiTaskJson), | |||
| Accuracy: string(accuracyJson), | |||
| } | |||
| err = models.SaveModelToDb(model) | |||
| @@ -123,7 +124,7 @@ func SaveModel(ctx *context.Context) { | |||
| return | |||
| } | |||
| err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID, ctx.User.Name) | |||
| err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID, ctx.User.Name, ctx.User.RelAvatarLink()) | |||
| if err != nil { | |||
| log.Info("save model error." + err.Error()) | |||
| @@ -4,7 +4,6 @@ import ( | |||
| "encoding/json" | |||
| "errors" | |||
| "io" | |||
| "io/ioutil" | |||
| "net/http" | |||
| "os" | |||
| "path" | |||
| @@ -386,7 +385,7 @@ func trainJobNewDataPrepare(ctx *context.Context) error { | |||
| return nil | |||
| } | |||
| func ErrorNewDataPrepare(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) error { | |||
| func trainJobErrorNewDataPrepare(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) error { | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| //can, err := canUserCreateTrainJob(ctx.User.ID) | |||
| @@ -574,7 +573,7 @@ func trainJobNewVersionDataPrepare(ctx *context.Context) error { | |||
| return nil | |||
| } | |||
| func VersionErrorDataPrepare(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) error { | |||
| func versionErrorDataPrepare(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) error { | |||
| ctx.Data["PageIsCloudBrain"] = true | |||
| var jobID = ctx.Params(":jobid") | |||
| // var versionName = ctx.Params(":version-name") | |||
| @@ -690,22 +689,23 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| if err := paramCheckCreateTrainJob(form); err != nil { | |||
| log.Error("paramCheckCreateTrainJob failed:(%v)", err) | |||
| ErrorNewDataPrepare(ctx, form) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| attach, err := models.GetAttachmentByUUID(uuid) | |||
| if err != nil { | |||
| log.Error("GetAttachmentByUUID(%s) failed:%v", uuid, err.Error()) | |||
| return | |||
| } | |||
| // attach, err := models.GetAttachmentByUUID(uuid) | |||
| // if err != nil { | |||
| // log.Error("GetAttachmentByUUID(%s) failed:%v", uuid, err.Error()) | |||
| // return | |||
| // } | |||
| //todo: del the codeLocalPath | |||
| _, err = ioutil.ReadDir(codeLocalPath) | |||
| if err == nil { | |||
| os.RemoveAll(codeLocalPath) | |||
| } | |||
| // _, err := ioutil.ReadDir(codeLocalPath) | |||
| // if err == nil { | |||
| // os.RemoveAll(codeLocalPath) | |||
| // } | |||
| os.RemoveAll(codeLocalPath) | |||
| gitRepo, _ := git.OpenRepository(repo.RepoPath()) | |||
| commitID, _ := gitRepo.GetBranchCommitID(branch_name) | |||
| @@ -714,7 +714,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| Branch: branch_name, | |||
| }); err != nil { | |||
| log.Error("创建任务失败,服务器超时!: %s (%v)", repo.FullName(), err) | |||
| trainJobNewDataPrepare(ctx) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("创建任务失败,服务器超时!", tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| @@ -722,14 +722,14 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| //todo: upload code (send to file_server todo this work?) | |||
| if err := obsMkdir(setting.CodePathPrefix + jobName + modelarts.OutputPath + VersionOutputPath + "/"); err != nil { | |||
| log.Error("Failed to obsMkdir_output: %s (%v)", repo.FullName(), err) | |||
| trainJobNewDataPrepare(ctx) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("Failed to obsMkdir_output", tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| if err := obsMkdir(setting.CodePathPrefix + jobName + modelarts.LogPath + VersionOutputPath + "/"); err != nil { | |||
| log.Error("Failed to obsMkdir_log: %s (%v)", repo.FullName(), err) | |||
| trainJobNewDataPrepare(ctx) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("Failed to obsMkdir_log", tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| @@ -738,7 +738,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| if err := uploadCodeToObs(codeLocalPath, jobName, ""); err != nil { | |||
| // if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil { | |||
| log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err) | |||
| trainJobNewDataPrepare(ctx) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("Failed to uploadCodeToObs", tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| @@ -758,7 +758,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| err := json.Unmarshal([]byte(params), ¶meters) | |||
| if err != nil { | |||
| log.Error("Failed to Unmarshal params: %s (%v)", params, err) | |||
| trainJobNewDataPrepare(ctx) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("运行参数错误", tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| @@ -801,7 +801,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| if err != nil { | |||
| log.Error("Failed to CreateTrainJobConfig: %v", err) | |||
| trainJobNewDataPrepare(ctx) | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("保存作业参数失败:"+err.Error(), tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| @@ -839,15 +839,10 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| return | |||
| } | |||
| err = modelarts.GenerateTrainJob(ctx, req) | |||
| err := modelarts.GenerateTrainJob(ctx, req) | |||
| if err != nil { | |||
| log.Error("GenerateTrainJob failed:%v", err.Error()) | |||
| trainJobNewDataPrepare(ctx) | |||
| ctx.Data["bootFile"] = form.BootFile | |||
| ctx.Data["uuid"] = form.Attachment | |||
| ctx.Data["datasetName"] = attach.Name | |||
| ctx.Data["params"] = Parameters.Parameter | |||
| ctx.Data["branch_name"] = branch_name | |||
| trainJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| @@ -896,7 +891,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| if err := paramCheckCreateTrainJob(form); err != nil { | |||
| log.Error("paramCheckCreateTrainJob failed:(%v)", err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -920,7 +915,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| Branch: branch_name, | |||
| }); err != nil { | |||
| log.Error("创建任务失败,任务名称已存在!: %s (%v)", repo.FullName(), err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("创建任务失败,任务名称已存在!", tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -928,14 +923,14 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| //todo: upload code (send to file_server todo this work?) | |||
| if err := obsMkdir(setting.CodePathPrefix + jobName + modelarts.OutputPath + VersionOutputPath + "/"); err != nil { | |||
| log.Error("Failed to obsMkdir_output: %s (%v)", repo.FullName(), err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("Failed to obsMkdir_output", tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| if err := obsMkdir(setting.CodePathPrefix + jobName + modelarts.LogPath + VersionOutputPath + "/"); err != nil { | |||
| log.Error("Failed to obsMkdir_log: %s (%v)", repo.FullName(), err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("Failed to obsMkdir_log", tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -945,7 +940,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| // if err := uploadCodeToObs(codeLocalPath, jobName, ""); err != nil { | |||
| if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil { | |||
| log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("Failed to uploadCodeToObs", tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -965,7 +960,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| err := json.Unmarshal([]byte(params), ¶meters) | |||
| if err != nil { | |||
| log.Error("Failed to Unmarshal params: %s (%v)", params, err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("运行参数错误", tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -984,7 +979,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| if isSaveParam == "on" { | |||
| if form.ParameterTemplateName == "" { | |||
| log.Error("ParameterTemplateName is empty") | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("保存作业参数时,作业参数名称不能为空", tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -1008,7 +1003,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| if err != nil { | |||
| log.Error("Failed to CreateTrainJobConfig: %v", err) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr("保存作业参数失败:"+err.Error(), tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -1055,7 +1050,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||
| err = modelarts.GenerateTrainJobVersion(ctx, req, jobID) | |||
| if err != nil { | |||
| log.Error("GenerateTrainJob failed:%v", err.Error()) | |||
| VersionErrorDataPrepare(ctx, form) | |||
| versionErrorDataPrepare(ctx, form) | |||
| ctx.RenderWithErr(err.Error(), tplModelArtsTrainJobVersionNew, &form) | |||
| return | |||
| } | |||
| @@ -792,7 +792,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
| }, reqSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoAdmin, context.RepoRef()) | |||
| m.Post("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), context.UnitTypes(), repo.Action) | |||
| m.Get("/tool/query_user_static_page", adminReq, repo.QueryUserStaticDataPage) | |||
| // Grouping for those endpoints not requiring authentication | |||
| m.Group("/:username/:reponame", func() { | |||
| m.Get("/contributors", repo.Contributors) | |||
| @@ -37,7 +37,7 @@ | |||
| <a class="item" href="{{AppSubUrl}}/explore/users">{{.i18n.Tr "explore.users"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "explore.organizations"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/images">{{.i18n.Tr "explore.images"}}</a> | |||
| {{if .IsAdmin}} | |||
| {{if .IsOperator}} | |||
| <a class="item" href="{{AppSubUrl}}/explore/data_analysis">{{.i18n.Tr "explore.data_analysis"}}</a> | |||
| {{end}} | |||
| </div> | |||
| @@ -55,7 +55,7 @@ | |||
| <a class="item" href="{{AppSubUrl}}/explore/users">{{.i18n.Tr "explore.users"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "explore.organizations"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/images">{{.i18n.Tr "explore.images"}}</a> | |||
| {{if .IsAdmin}} | |||
| {{if .IsOperator}} | |||
| <a class="item" href="{{AppSubUrl}}/explore/data_analysis">{{.i18n.Tr "explore.data_analysis"}}</a> | |||
| {{end}} | |||
| </div> | |||
| @@ -37,7 +37,7 @@ | |||
| <a class="item" href="{{AppSubUrl}}/explore/users">{{.i18n.Tr "explore.users"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "explore.organizations"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/images">{{.i18n.Tr "explore.images"}}</a> | |||
| {{if .IsAdmin}} | |||
| {{if .IsOperator}} | |||
| <a class="item" href="{{AppSubUrl}}/explore/data_analysis">{{.i18n.Tr "explore.data_analysis"}}</a> | |||
| {{end}} | |||
| </div> | |||
| @@ -55,7 +55,7 @@ | |||
| <a class="item" href="{{AppSubUrl}}/explore/users">{{.i18n.Tr "explore.users"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "explore.organizations"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/images">{{.i18n.Tr "explore.images"}}</a> | |||
| {{if .IsAdmin}} | |||
| {{if .IsOperator}} | |||
| <a class="item" href="{{AppSubUrl}}/explore/data_analysis">{{.i18n.Tr "explore.data_analysis"}}</a> | |||
| {{end}} | |||
| </div> | |||
| @@ -29,7 +29,7 @@ | |||
| <a class="item" href="{{AppSubUrl}}/explore/users">{{.i18n.Tr "explore.users"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "explore.organizations"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/images">{{.i18n.Tr "explore.images"}}</a> | |||
| {{if .IsAdmin}} | |||
| {{if .IsOperator}} | |||
| <a class="item" href="{{AppSubUrl}}/explore/data_analysis">{{.i18n.Tr "explore.data_analysis"}}</a> | |||
| {{end}} | |||
| </div> | |||
| @@ -47,7 +47,7 @@ | |||
| <a class="item" href="{{AppSubUrl}}/explore/users">{{.i18n.Tr "explore.users"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "explore.organizations"}}</a> | |||
| <a class="item" href="{{AppSubUrl}}/explore/images">{{.i18n.Tr "explore.images"}}</a> | |||
| {{if .IsAdmin}} | |||
| {{if .IsOperator}} | |||
| <a class="item" href="{{AppSubUrl}}/explore/data_analysis">{{.i18n.Tr "explore.data_analysis"}}</a> | |||
| {{end}} | |||
| </div> | |||
| @@ -27,10 +27,10 @@ | |||
| </span> | |||
| <span style="float:right; margin-right: 20px;" > | |||
| <a style="display:inline-block;margin-left: 20px; " id = 'download'> | |||
| <a class="el-icon-download" v-if="tableData!=''" :href= "'../tool/query_user_static_page/?startDate='+this.params.startDate+'&endDate='+this.params.endDate+'&IsReturnFile=true'+'&userName='+this.params.userName" ></a> | |||
| <a class="el-icon-download" v-if="tableData!=''" :href= "'../api/v1/query_user_static_page/?startDate='+this.params.startDate+'&endDate='+this.params.endDate+'&IsReturnFile=true'+'&userName='+this.params.userName" ></a> | |||
| <i class="el-icon-download" v-else="tableData=''" href="#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'></i> | |||
| <span > | |||
| <a v-if="tableData!=''" :href= "'../tool/query_user_static_page/?startDate='+this.params.startDate+'&endDate='+this.params.endDate+'&IsReturnFile=true'+'&userName='+this.params.userName" >下载报告</a> | |||
| <a v-if="tableData!=''" :href= "'../api/v1/query_user_static_page/?startDate='+this.params.startDate+'&endDate='+this.params.endDate+'&IsReturnFile=true'+'&userName='+this.params.userName" >下载报告</a> | |||
| <a v-else="tableData=''" href= "#" style="color:rgba(187, 187, 187, 100);" @click='popMark()'>下载报告</a> | |||
| </span> | |||
| </a> | |||
| @@ -335,7 +335,7 @@ | |||
| } | |||
| }; | |||
| this.$axios.get('../tool/query_user_static_page',{ | |||
| this.$axios.get('../api/v1/query_user_static_page',{ | |||
| params:this.params | |||
| }).then((res)=>{ | |||
| this.tableData = res.data.data | |||