Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Optimize][Web]Click the Tasks tab to switch to Service Synchronization #3965

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dinky-web/src/pages/DataStudio/CenterTabContent/SqlTask/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ export const SqlTask = memo((props: FlinkSqlProps & any) => {
}
});
observer.observe(element);

const key = Number(id.replace('project_', ''));
updateAction({
actionType: DataStudioActionType.TASK_TAB_CHANGE,
params: {
taskId: params.taskId,
key: key
}
});

return () => {
observer.unobserve(element);
};
Expand Down
3 changes: 2 additions & 1 deletion dinky-web/src/pages/DataStudio/data.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ export enum DataStudioActionType {
TASK_RUN_SUBMIT = 'task-run-submit',
TASK_PREVIEW_RESULT = 'task-preview-result',
TASK_RUN_DEBUG = 'task-run-debug',
TASK_RUN_LOCATION = 'task-run-location'
TASK_RUN_LOCATION = 'task-run-location',
TASK_TAB_CHANGE = 'task-tab-change'
}
15 changes: 15 additions & 0 deletions dinky-web/src/pages/DataStudio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,21 @@ const DataStudio: React.FC = (props: any) => {
dropMode={'edge'}
style={{ position: 'absolute', left: 0, top: 0, right: 0, bottom: 0 }}
onLayoutChange={async (newLayout, currentTabId, direction) => {
if (currentTabId && direction == 'active') {
const tableData = (dataStudioState.centerContent.tabs as CenterTab[]).find(
(x) => x.id === currentTabId
);
if (tableData) {
const key = Number(currentTabId.replace('project_', ''));
updateAction({
actionType: DataStudioActionType.TASK_TAB_CHANGE,
params: {
taskId: tableData.params.taskId,
key: key
}
});
}
}
// todo 这里移到方向会导致布局和算法异常,先暂时规避掉
if (
direction === 'left' ||
Expand Down
Loading