|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path"
|
|
|
|
"path"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/dto"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/dto"
|
|
|
@ -54,6 +55,14 @@ func (u *CronjobService) SearchWithPage(search dto.SearchWithPage) (int64, inter
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
item.TargetDir = "-"
|
|
|
|
item.TargetDir = "-"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if item.Type == "database" && item.DBName != "all" {
|
|
|
|
|
|
|
|
itemID, _ := strconv.Atoi(item.DBName)
|
|
|
|
|
|
|
|
dbItem, err := mysqlRepo.Get(commonRepo.WithByID(uint(itemID)))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return 0, nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
item.DBName = dbItem.Name
|
|
|
|
|
|
|
|
}
|
|
|
|
record, _ := cronjobRepo.RecordFirst(cronjob.ID)
|
|
|
|
record, _ := cronjobRepo.RecordFirst(cronjob.ID)
|
|
|
|
if record.ID != 0 {
|
|
|
|
if record.ID != 0 {
|
|
|
|
item.LastRecordTime = record.StartTime.Format("2006-01-02 15:04:05")
|
|
|
|
item.LastRecordTime = record.StartTime.Format("2006-01-02 15:04:05")
|
|
|
|