1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 00:09:16 +08:00

fix: 解决计划任务时区显示不一致的问题 (#5230)

Refs  #5211
This commit is contained in:
ssongliu 2024-05-31 13:47:19 +08:00 committed by GitHub
parent ea40e32991
commit bf7a4f3254
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 19 additions and 11 deletions

View File

@ -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"`
}

View File

@ -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

View File

@ -19488,6 +19488,9 @@ const docTemplate = `{
"pageSize": {
"type": "integer"
},
"sync": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {

View File

@ -19481,6 +19481,9 @@
"pageSize": {
"type": "integer"
},
"sync": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {

View File

@ -3323,6 +3323,8 @@ definitions:
type: integer
pageSize:
type: integer
sync:
type: boolean
tags:
items:
type: string

View File

@ -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;

View File

@ -108,7 +108,7 @@
{{ $t('commons.status.failed') }}
</el-tag>
<span>
{{ dateFormat(0, 0, row.startTime) }}
{{ row.startTime }}
</span>
</template>
</el-table-column>