update
This commit is contained in:
@@ -99,7 +99,8 @@ export const findAllThemes = async (): Promise<TerminalTheme[]> => {
|
|||||||
try {
|
try {
|
||||||
const db = await getDbInstance();
|
const db = await getDbInstance();
|
||||||
// Specify the expected row type for allDb
|
// Specify the expected row type for allDb
|
||||||
const rows = await allDb<DbTerminalThemeRow>(db, 'SELECT * FROM terminal_themes ORDER BY is_preset DESC, name ASC');
|
// Correct the ORDER BY clause to use theme_type and sort presets first
|
||||||
|
const rows = await allDb<DbTerminalThemeRow>(db, 'SELECT * FROM terminal_themes ORDER BY CASE theme_type WHEN \'preset\' THEN 0 ELSE 1 END ASC, name ASC');
|
||||||
// Filter out potential errors during mapping
|
// Filter out potential errors during mapping
|
||||||
return rows.map(row => {
|
return rows.map(row => {
|
||||||
try {
|
try {
|
||||||
@@ -111,6 +112,8 @@ export const findAllThemes = async (): Promise<TerminalTheme[]> => {
|
|||||||
}).filter((theme): theme is TerminalTheme => theme !== null);
|
}).filter((theme): theme is TerminalTheme => theme !== null);
|
||||||
} catch (err: any) { // Add type annotation for err
|
} catch (err: any) { // Add type annotation for err
|
||||||
console.error('查询所有终端主题失败:', err.message);
|
console.error('查询所有终端主题失败:', err.message);
|
||||||
|
// 添加详细错误日志
|
||||||
|
console.error('详细错误:', err);
|
||||||
throw new Error('查询终端主题失败'); // Re-throw or handle error appropriately
|
throw new Error('查询终端主题失败'); // Re-throw or handle error appropriately
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -458,6 +458,8 @@ const handleNodeRemove = (payload: { parentNodeId: string | undefined; nodeIndex
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
|
||||||
|
min-width: 1072px;
|
||||||
|
min-height:748px;
|
||||||
/* width, height, top, left 由 dialogStyle 控制 */
|
/* width, height, top, left 由 dialogStyle 控制 */
|
||||||
/* 移除 max-width, max-height,由拖拽逻辑和 minSize 控制 */
|
/* 移除 max-width, max-height,由拖拽逻辑和 minSize 控制 */
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user