mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-26 16:29:42 +08:00
🐛 fix(sql-log): 统一 V2 SQL 日志入口
- V2 左侧入口改为打开当前工作区内嵌 SQL 日志,legacy 继续使用底部全局面板 - 表数据页新增 sqlLog 视图并复用嵌入式 LogPanel,避免无 SQL 编辑器时无法查看日志 - 移除 V2 侧栏底部重复 SQL 日志按钮,保留慢查询入口并补充回归测试
This commit is contained in:
@@ -385,11 +385,11 @@ const QueryEditor: React.FC<{ tab: TabData; isActive?: boolean }> = ({ tab, isAc
|
||||
return nextVisible;
|
||||
});
|
||||
}, [tab.id, updateQueryTabDraft]);
|
||||
const handleShowSqlExecutionLog = useCallback(() => {
|
||||
const handleShowSqlExecutionLog = useCallback((mode: 'open' | 'toggle' = 'toggle') => {
|
||||
if (!isActive) {
|
||||
return;
|
||||
}
|
||||
if (isResultPanelVisible && activeResultKey === QUERY_EDITOR_SQL_LOG_TAB_KEY) {
|
||||
if (mode !== 'open' && isResultPanelVisible && activeResultKey === QUERY_EDITOR_SQL_LOG_TAB_KEY) {
|
||||
updateResultPanelVisibility(false);
|
||||
return;
|
||||
}
|
||||
@@ -4467,8 +4467,9 @@ const QueryEditor: React.FC<{ tab: TabData; isActive?: boolean }> = ({ tab, isAc
|
||||
}, [isActive, handleQuickSave]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleOpenSqlExecutionLog = () => {
|
||||
handleShowSqlExecutionLog();
|
||||
const handleOpenSqlExecutionLog = (event: Event) => {
|
||||
const mode = event instanceof CustomEvent && event.detail?.mode === 'open' ? 'open' : 'toggle';
|
||||
handleShowSqlExecutionLog(mode);
|
||||
};
|
||||
|
||||
window.addEventListener('gonavi:show-sql-execution-log', handleOpenSqlExecutionLog as EventListener);
|
||||
|
||||
Reference in New Issue
Block a user