| @@ -260,6 +260,7 @@ func (a *Action) ToShow() *ActionShow { | |||||
| if a.Cloudbrain != nil { | if a.Cloudbrain != nil { | ||||
| c := &CloudbrainShow4Action{ | c := &CloudbrainShow4Action{ | ||||
| ID: a.Cloudbrain.ID, | ID: a.Cloudbrain.ID, | ||||
| JobId: a.Cloudbrain.JobID, | |||||
| Type: a.Cloudbrain.Type, | Type: a.Cloudbrain.Type, | ||||
| JobType: a.Cloudbrain.JobType, | JobType: a.Cloudbrain.JobType, | ||||
| DisplayJobName: a.Cloudbrain.DisplayJobName, | DisplayJobName: a.Cloudbrain.DisplayJobName, | ||||
| @@ -194,6 +194,7 @@ type CloudbrainShow struct { | |||||
| type CloudbrainShow4Action struct { | type CloudbrainShow4Action struct { | ||||
| ID int64 | ID int64 | ||||
| JobId string | |||||
| Type int | Type int | ||||
| JobType string | JobType string | ||||
| DisplayJobName string | DisplayJobName string | ||||
| @@ -29,7 +29,9 @@ type TaskConfigWithLimit struct { | |||||
| AwardType string | AwardType string | ||||
| AwardAmount int64 | AwardAmount int64 | ||||
| Creator string | Creator string | ||||
| IsDeleted bool | |||||
| CreatedUnix timeutil.TimeStamp | CreatedUnix timeutil.TimeStamp | ||||
| DeleteAt timeutil.TimeStamp | |||||
| Limiters []*LimitConfigVO | Limiters []*LimitConfigVO | ||||
| } | } | ||||
| type BatchLimitConfigVO struct { | type BatchLimitConfigVO struct { | ||||
| @@ -64,8 +66,11 @@ func GetTaskConfigList() ([]*TaskConfig, error) { | |||||
| return r, nil | return r, nil | ||||
| } | } | ||||
| func GetTaskConfigPageWithDeleted(opt ListOptions) ([]*TaskConfig, error) { | func GetTaskConfigPageWithDeleted(opt ListOptions) ([]*TaskConfig, error) { | ||||
| if opt.Page <= 0 { | |||||
| opt.Page = 1 | |||||
| } | |||||
| r := make([]*TaskConfig, 0) | r := make([]*TaskConfig, 0) | ||||
| err := x.Unscoped().Limit(opt.PageSize, (opt.Page-1)*opt.PageSize).OrderBy("deleted_at asc,id desc").Find(&r) | |||||
| err := x.Unscoped().Limit(opt.PageSize, (opt.Page-1)*opt.PageSize).OrderBy("deleted_at desc,id desc").Find(&r) | |||||
| if err != nil { | if err != nil { | ||||
| return nil, err | return nil, err | ||||
| } | } | ||||
| @@ -87,6 +87,8 @@ func GetTaskConfigWithLimitList(opt models.ListOptions) ([]*models.TaskConfigWit | |||||
| AwardAmount: li.AwardAmount, | AwardAmount: li.AwardAmount, | ||||
| Creator: li.CreatorName, | Creator: li.CreatorName, | ||||
| CreatedUnix: li.CreatedUnix, | CreatedUnix: li.CreatedUnix, | ||||
| IsDeleted: li.DeletedAt > 0, | |||||
| DeleteAt: li.DeletedAt, | |||||
| } | } | ||||
| lv := make([]*models.LimitConfigVO, 0) | lv := make([]*models.LimitConfigVO, 0) | ||||
| for j := 0; j < len(l); j++ { | for j := 0; j < len(l); j++ { | ||||