fix: 解决计划任务编辑报错的问题 (#3556)

This commit is contained in:
ssongliu 2024-01-10 15:02:24 +08:00 committed by GitHub
parent 1c1bc872a8
commit 009919f927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View file

@ -171,7 +171,7 @@ const checkDBName = (rule: any, value: any, callback: any) => {
if (value === '' || typeof value === 'undefined' || value == null) {
callback(new Error(i18n.global.t('commons.rule.dbName')));
} else {
const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,64}$/;
const reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{1}[a-zA-Z0-9_.\u4e00-\u9fa5-]{0,63}$/;
if (!reg.test(value) && value !== '') {
callback(new Error(i18n.global.t('commons.rule.dbName')));
} else {

View file

@ -815,7 +815,7 @@ const message = {
target: 'Target',
targetHelper: 'Third-party backup accounts are maintained in panel settings.',
retainCopies: 'Retain copies',
retainCopiesHelper: 'Number of copies of execution records, log files, and backup files',
retainCopiesHelper: 'Retention of Execution Records',
cronSpecRule: 'Please enter a correct lifecycle',
perMonth: 'Every monthly',
perWeek: 'Every week',

View file

@ -776,7 +776,7 @@ const message = {
target: '備份到',
targetHelper: '第三方備份賬號在面板設置中維護',
retainCopies: '保留份數',
retainCopiesHelper: '執行記錄日誌文件備份文件保留份數',
retainCopiesHelper: '執行記錄保留份數',
cronSpecRule: '請輸入正確的執行周期',
perMonth: '每月',
perWeek: '每周',

View file

@ -777,7 +777,7 @@ const message = {
target: '备份到',
targetHelper: '第三方备份账号在面板设置中维护',
retainCopies: '保留份数',
retainCopiesHelper: '执行记录日志文件备份文件保留份数',
retainCopiesHelper: '执行记录保留份数',
cronSpecRule: '请输入正确的执行周期',
perMonth: '每月',
perWeek: '每周',

View file

@ -332,7 +332,11 @@ const acceptParams = (params: DialogProps): void => {
loadAppInstalls();
loadWebsites();
loadContainers();
loadDatabases();
if (dialogData.value.rowData?.dbType) {
loadDatabases(dialogData.value.rowData.dbType);
} else {
loadDatabases('mysql');
}
};
const emit = defineEmits<{ (e: 'search'): void }>();
@ -477,8 +481,8 @@ const hasHour = () => {
);
};
const loadDatabases = async () => {
const data = await listDbItems(dialogData.value.rowData.dbType);
const loadDatabases = async (dbType: string) => {
const data = await listDbItems(dbType);
dbInfo.dbs = data.data || [];
};