| @@ -51,7 +51,7 @@ const ( | |||
| type LimitConfig struct { | |||
| ID int64 `xorm:"pk autoincr"` | |||
| Tittle string | |||
| Title string | |||
| RefreshRate string `xorm:"NOT NULL"` | |||
| Scope string `xorm:"NOT NULL"` | |||
| LimitNum int64 `xorm:"NOT NULL"` | |||
| @@ -75,7 +75,7 @@ type LimitConfigQueryOpts struct { | |||
| type LimitConfigVO struct { | |||
| ID int64 | |||
| Tittle string | |||
| Title string | |||
| RefreshRate string | |||
| Scope string | |||
| LimitNum int64 | |||
| @@ -88,7 +88,7 @@ type LimitConfigVO struct { | |||
| func (l *LimitConfig) ToLimitConfigVO() *LimitConfigVO { | |||
| return &LimitConfigVO{ | |||
| ID: l.ID, | |||
| Tittle: l.Tittle, | |||
| Title: l.Title, | |||
| RefreshRate: l.RefreshRate, | |||
| Scope: l.Scope, | |||
| LimitNum: l.LimitNum, | |||
| @@ -215,7 +215,7 @@ type RewardOperateRecord struct { | |||
| UserId int64 `xorm:"INDEX NOT NULL"` | |||
| Amount int64 `xorm:"NOT NULL"` | |||
| LossAmount int64 | |||
| Tittle string | |||
| Title string | |||
| RewardType string `xorm:"NOT NULL"` | |||
| SourceType string `xorm:"NOT NULL"` | |||
| SourceId string `xorm:"INDEX NOT NULL"` | |||
| @@ -312,7 +312,7 @@ type RewardOperateContext struct { | |||
| SourceType SourceType | |||
| SourceId string | |||
| SourceTemplateId string | |||
| Tittle string | |||
| Title string | |||
| Remark string | |||
| Reward Reward | |||
| TargetUserId int64 | |||
| @@ -45,7 +45,7 @@ type StartPeriodicTaskOpts struct { | |||
| SourceType SourceType | |||
| SourceId string | |||
| Remark string | |||
| Tittle string | |||
| Title string | |||
| TargetUserId int64 | |||
| RequestId string | |||
| OperateType RewardOperateType | |||
| @@ -16,7 +16,7 @@ const ( | |||
| type TaskConfig struct { | |||
| ID int64 `xorm:"pk autoincr"` | |||
| TaskCode string `xorm:"NOT NULL"` | |||
| Tittle string | |||
| Title string | |||
| AwardType string `xorm:"NOT NULL"` | |||
| AwardAmount int64 `xorm:"NOT NULL"` | |||
| CreatorId int64 `xorm:"NOT NULL"` | |||
| @@ -30,7 +30,7 @@ type TaskConfig struct { | |||
| type TaskConfigWithLimit struct { | |||
| ID int64 | |||
| TaskCode string | |||
| Tittle string | |||
| Title string | |||
| AwardType string | |||
| AwardAmount int64 | |||
| Creator string | |||
| @@ -170,7 +170,7 @@ func EditTaskConfig(config TaskConfigWithLimit, doer *User) error { | |||
| //add new config | |||
| t := &TaskConfig{ | |||
| TaskCode: config.TaskCode, | |||
| Tittle: config.Tittle, | |||
| Title: config.Title, | |||
| AwardType: config.AwardType, | |||
| AwardAmount: config.AwardAmount, | |||
| CreatorId: doer.ID, | |||
| @@ -201,7 +201,7 @@ func EditTaskConfig(config TaskConfigWithLimit, doer *User) error { | |||
| for _, v := range config.Limiters { | |||
| //add new config | |||
| l := &LimitConfig{ | |||
| Tittle: v.Tittle, | |||
| Title: v.Title, | |||
| RefreshRate: v.RefreshRate, | |||
| Scope: v.Scope, | |||
| LimitNum: v.LimitNum, | |||
| @@ -229,7 +229,7 @@ func NewTaskConfig(config TaskConfigWithLimit, doer *User) error { | |||
| //add new config | |||
| t := &TaskConfig{ | |||
| TaskCode: config.TaskCode, | |||
| Tittle: config.Tittle, | |||
| Title: config.Title, | |||
| AwardType: config.AwardType, | |||
| AwardAmount: config.AwardAmount, | |||
| CreatorId: doer.ID, | |||
| @@ -247,7 +247,7 @@ func NewTaskConfig(config TaskConfigWithLimit, doer *User) error { | |||
| //add new config | |||
| l := &LimitConfig{ | |||
| RelatedId: t.ID, | |||
| Tittle: v.Tittle, | |||
| Title: v.Title, | |||
| RefreshRate: v.RefreshRate, | |||
| Scope: v.Scope, | |||
| LimitNum: v.LimitNum, | |||
| @@ -3130,5 +3130,6 @@ free = Free | |||
| points_hour = Points/hour | |||
| balance_of_points = Balance of Points: | |||
| hours = Hours | |||
| expected_time = , expected to be available for | |||
| expected_time = , expected to be available for | |||
| points_acquisition_instructions = Points Acquisition Instructions | |||
| insufficient_points_balance = Insufficient points balance | |||
| @@ -3144,5 +3144,6 @@ free = 免费 | |||
| points_hour = 积分/每小时 | |||
| balance_of_points = 积分余额: | |||
| hours = 小时 | |||
| expected_time = ,预计可用 | |||
| expected_time = ,预计可用 | |||
| points_acquisition_instructions = 积分获取说明 | |||
| insufficient_points_balance = 积分余额不足 | |||
| @@ -263,7 +263,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, jobType, models.TypeCloudBrainOne, resourceSpecId, "") { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s resourceSpecId=%d", ctx.User.ID, jobType, resourceSpecId) | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(models.ErrInsufficientPointsBalance{}.Error(), tpl, &form) | |||
| ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tpl, &form) | |||
| return | |||
| } | |||
| @@ -442,7 +442,7 @@ func CloudBrainRestart(ctx *context.Context) { | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, task.JobType, models.TypeCloudBrainOne, task.ResourceSpecId, "") { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s resourceSpecId=%d", ctx.User.ID, task.JobType, task.ResourceSpecId) | |||
| resultCode = "-1" | |||
| errorMsg = models.ErrInsufficientPointsBalance{}.Error() | |||
| errorMsg = ctx.Tr("points.insufficient_points_balance") | |||
| break | |||
| } | |||
| @@ -2017,7 +2017,7 @@ func BenchMarkAlgorithmCreate(ctx *context.Context, form auth.CreateCloudBrainFo | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, string(models.JobTypeBenchmark), models.TypeCloudBrainOne, cloudbrain.BenchMarkResourceID, "") { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s resourceSpecId=%d", ctx.User.ID, string(models.JobTypeBenchmark), resourceSpecId) | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(models.ErrInsufficientPointsBalance{}.Error(), tplCloudBrainBenchmarkNew, &form) | |||
| ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplCloudBrainBenchmarkNew, &form) | |||
| return | |||
| } | |||
| @@ -2210,7 +2210,7 @@ func ModelBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, jobType, models.TypeCloudBrainOne, resourceSpecId, "") { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s resourceSpecId=%d", ctx.User.ID, jobType, resourceSpecId) | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(models.ErrInsufficientPointsBalance{}.Error(), tpl, &form) | |||
| ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tpl, &form) | |||
| return | |||
| } | |||
| @@ -209,7 +209,7 @@ func Notebook2Create(ctx *context.Context, form auth.CreateModelArtsNotebookForm | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, string(models.JobTypeDebug), models.TypeCloudBrainTwo, 0, flavor) { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s ", ctx.User.ID, string(models.JobTypeBenchmark)) | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(models.ErrInsufficientPointsBalance{}.Error(), tplModelArtsNotebookNew, &form) | |||
| ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplModelArtsNotebookNew, &form) | |||
| return | |||
| } | |||
| count, err := models.GetCloudbrainNotebookCountByUserID(ctx.User.ID) | |||
| @@ -451,7 +451,7 @@ func NotebookManage(ctx *context.Context) { | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, task.JobType, task.Type, task.ResourceSpecId, task.FlavorCode) { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s resourceSpecId=%d", ctx.User.ID, task.JobType, task.ResourceSpecId) | |||
| resultCode = "-1" | |||
| errorMsg = models.ErrInsufficientPointsBalance{}.Error() | |||
| errorMsg = ctx.Tr("points.insufficient_points_balance") | |||
| break | |||
| return | |||
| } | |||
| @@ -1009,7 +1009,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, string(models.JobTypeTrain), models.TypeCloudBrainTwo, 0, flavorCode) { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s", ctx.User.ID, string(models.JobTypeBenchmark)) | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(models.ErrInsufficientPointsBalance{}.Error(), tplModelArtsTrainJobNew, &form) | |||
| ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplModelArtsTrainJobNew, &form) | |||
| return | |||
| } | |||
| count, err := models.GetCloudbrainTrainJobCountByUserID(ctx.User.ID) | |||
| @@ -1901,7 +1901,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference | |||
| if !account.IsPointBalanceEnough(ctx.User.ID, string(models.JobTypeInference), models.TypeCloudBrainTwo, 0, flavorCode) { | |||
| log.Error("point balance is not enough,userId=%d jobType=%s ", ctx.User.ID, string(models.JobTypeBenchmark)) | |||
| inferenceJobErrorNewDataPrepare(ctx, form) | |||
| ctx.RenderWithErr(models.ErrInsufficientPointsBalance{}.Error(), tplModelArtsInferenceJobNew, &form) | |||
| ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplModelArtsInferenceJobNew, &form) | |||
| return | |||
| } | |||
| count, err := models.GetCloudbrainInferenceJobCountByUserID(ctx.User.ID) | |||
| @@ -27,7 +27,7 @@ func AdminBalanceOperate(req models.AdminRewardOperateReq, doer *models.User) er | |||
| err = Operate(&models.RewardOperateContext{ | |||
| SourceType: models.SourceTypeAdminOperate, | |||
| SourceId: logId, | |||
| Tittle: "管理员操作", | |||
| Title: "管理员操作", | |||
| Reward: models.Reward{ | |||
| Amount: req.Amount, | |||
| Type: req.RewardType, | |||
| @@ -37,7 +37,7 @@ func StartAndGetCloudBrainPointDeductTask(task models.Cloudbrain) (*models.Rewar | |||
| UnitAmount: unitPrice, | |||
| RewardType: models.RewardTypePoint, | |||
| StartTime: time.Unix(int64(task.StartTime), 0), | |||
| Tittle: RUN_CLOUDBRAIN_TASK_TITTLE, | |||
| Title: RUN_CLOUDBRAIN_TASK_TITTLE, | |||
| }) | |||
| } | |||
| @@ -64,7 +64,7 @@ func GetLimitConfigById(id int64) (*models.LimitConfig, error) { | |||
| func AddLimitConfig(config *models.LimitConfigVO, doer *models.User) error { | |||
| r := &models.LimitConfig{ | |||
| Tittle: config.Tittle, | |||
| Title: config.Title, | |||
| RefreshRate: config.RefreshRate, | |||
| Scope: config.Scope, | |||
| LimitNum: config.LimitNum, | |||
| @@ -133,7 +133,7 @@ func initRewardOperateRecord(ctx *models.RewardOperateContext) (string, error) { | |||
| OperateType: ctx.OperateType.Name(), | |||
| Status: models.OperateStatusOperating, | |||
| Remark: ctx.Remark, | |||
| Tittle: ctx.Tittle, | |||
| Title: ctx.Title, | |||
| SerialNo: sn, | |||
| } | |||
| _, err = models.InsertRewardOperateRecord(record) | |||
| @@ -160,7 +160,7 @@ func createPeriodicRewardOperateRecord(ctx *models.StartPeriodicTaskOpts) (strin | |||
| OperateType: ctx.OperateType.Name(), | |||
| Status: models.OperateStatusOperating, | |||
| Remark: ctx.Remark, | |||
| Tittle: ctx.Tittle, | |||
| Title: ctx.Title, | |||
| SerialNo: sn, | |||
| } | |||
| _, err = models.InsertRewardOperateRecord(record) | |||
| @@ -87,7 +87,7 @@ func accomplish(action models.Action) error { | |||
| SourceType: models.SourceTypeAccomplishTask, | |||
| SourceId: fmt.Sprint(action.ID), | |||
| SourceTemplateId: fmt.Sprint(action.OpType), | |||
| Tittle: config.Tittle, | |||
| Title: config.Title, | |||
| Reward: models.Reward{ | |||
| Amount: config.AwardAmount, | |||
| Type: models.GetRewardTypeInstance(config.AwardType), | |||