mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 解决计划任务编辑错误 (#1902)
This commit is contained in:
parent
1ff39d7b85
commit
b8480e4928
@ -5,7 +5,6 @@ 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"
|
||||||
@ -55,14 +54,6 @@ 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")
|
||||||
|
@ -374,6 +374,7 @@ import { Codemirror } from 'vue-codemirror';
|
|||||||
import { javascript } from '@codemirror/lang-javascript';
|
import { javascript } from '@codemirror/lang-javascript';
|
||||||
import { oneDark } from '@codemirror/theme-one-dark';
|
import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
import { MsgError, MsgInfo, MsgSuccess } from '@/utils/message';
|
import { MsgError, MsgInfo, MsgSuccess } from '@/utils/message';
|
||||||
|
import { loadDBOptions } from '@/api/modules/database';
|
||||||
|
|
||||||
const loading = ref();
|
const loading = ref();
|
||||||
const refresh = ref(false);
|
const refresh = ref(false);
|
||||||
@ -400,6 +401,20 @@ const cleanData = ref();
|
|||||||
const acceptParams = async (params: DialogProps): Promise<void> => {
|
const acceptParams = async (params: DialogProps): Promise<void> => {
|
||||||
recordShow.value = true;
|
recordShow.value = true;
|
||||||
dialogData.value = params;
|
dialogData.value = params;
|
||||||
|
if (dialogData.value.rowData.type === 'database') {
|
||||||
|
const data = await loadDBOptions();
|
||||||
|
let itemDBs = data.data || [];
|
||||||
|
for (const item of itemDBs) {
|
||||||
|
if (item.id == dialogData.value.rowData.dbName) {
|
||||||
|
if (item.from === 'local') {
|
||||||
|
dialogData.value.rowData.dbName = i18n.global.t('database.localDB') + ' [' + item.name + ']';
|
||||||
|
} else {
|
||||||
|
dialogData.value.rowData.dbName = item.from + ' [' + item.name + ']';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
search();
|
search();
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
search();
|
search();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user