diff --git a/backend/app/dto/cronjob.go b/backend/app/dto/cronjob.go index 11fb2b159..9b5182d9e 100644 --- a/backend/app/dto/cronjob.go +++ b/backend/app/dto/cronjob.go @@ -98,12 +98,12 @@ type SearchRecord struct { } type Record struct { - ID uint `json:"id"` - StartTime time.Time `json:"startTime"` - Records string `json:"records"` - Status string `json:"status"` - Message string `json:"message"` - TargetPath string `json:"targetPath"` - Interval int `json:"interval"` - File string `json:"file"` + ID uint `json:"id"` + StartTime string `json:"startTime"` + Records string `json:"records"` + Status string `json:"status"` + Message string `json:"message"` + TargetPath string `json:"targetPath"` + Interval int `json:"interval"` + File string `json:"file"` } diff --git a/backend/app/service/cornjob.go b/backend/app/service/cornjob.go index 1e09b6a8d..6ab42d8ba 100644 --- a/backend/app/service/cornjob.go +++ b/backend/app/service/cornjob.go @@ -71,6 +71,7 @@ func (u *CronjobService) SearchRecords(search dto.SearchRecord) (int64, interfac if err := copier.Copy(&item, &record); err != nil { return 0, nil, errors.WithMessage(constant.ErrStructTransform, err.Error()) } + item.StartTime = record.StartTime.Format("2006-01-02 15:04:05") dtoCronjobs = append(dtoCronjobs, item) } return total, dtoCronjobs, err diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 7cba0c304..46a83bd82 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -19488,6 +19488,9 @@ const docTemplate = `{ "pageSize": { "type": "integer" }, + "sync": { + "type": "boolean" + }, "tags": { "type": "array", "items": { diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 316edd325..6f7548fa4 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -19481,6 +19481,9 @@ "pageSize": { "type": "integer" }, + "sync": { + "type": "boolean" + }, "tags": { "type": "array", "items": { diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index f704ceb81..d81d2367c 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -3323,6 +3323,8 @@ definitions: type: integer pageSize: type: integer + sync: + type: boolean tags: items: type: string diff --git a/frontend/src/api/interface/cronjob.ts b/frontend/src/api/interface/cronjob.ts index 9ae970585..8b35dfa0b 100644 --- a/frontend/src/api/interface/cronjob.ts +++ b/frontend/src/api/interface/cronjob.ts @@ -90,8 +90,7 @@ export namespace Cronjob { export interface Record { id: number; file: string; - startTime: Date; - endTime: Date; + startTime: string; records: string; status: string; message: string; diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue index 66ebe1e0f..7bf7e28d9 100644 --- a/frontend/src/views/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/record/index.vue @@ -108,7 +108,7 @@ {{ $t('commons.status.failed') }} - {{ dateFormat(0, 0, row.startTime) }} + {{ row.startTime }}