Skip to content

Commit

Permalink
[Feature][web] Add resource management to the datastudio page (#3986)
Browse files Browse the repository at this point in the history
Co-authored-by: zackyoungh <zackyoungh@users.noreply.github.com>
  • Loading branch information
zackyoungh and zackyoungh authored Dec 1, 2024
1 parent 0ee8278 commit ccda836
Show file tree
Hide file tree
Showing 8 changed files with 464 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ export const SqlTask = memo((props: FlinkSqlProps & any) => {
if (taskDetail) {
const statement = params.statement ?? taskDetail.statement;
const newParams = { ...taskDetail, taskId: params.taskId, statement, mockSinkFunction: true };
// @ts-ignore
setCurrentState(newParams);
updateCenterTab({ ...props.tabData, params: newParams });

if (taskDetail.dialect.toLowerCase() === DIALECT.FLINKJAR) {
const sqlConvertForm = await flinkJarSqlConvertForm(taskDetail.statement);
setSqlForm({ enable: true, ...sqlConvertForm });
Expand All @@ -213,6 +209,9 @@ export const SqlTask = memo((props: FlinkSqlProps & any) => {
}
} else {
setOriginStatementValue(statement);
// @ts-ignore
setCurrentState(newParams);
updateCenterTab({ ...props.tabData, params: newParams });
if (params?.statement && params?.statement !== taskDetail.statement) {
setDiff([{ key: 'statement', server: taskDetail.statement, cache: params.statement }]);
setOpenDiffModal(true);
Expand Down Expand Up @@ -909,7 +908,10 @@ export const SqlTask = memo((props: FlinkSqlProps & any) => {
}));
}}
>
<ProFormCheckbox.Group name='manualInput' options={[l('datastudio.sqlTask.flinkJar.manualInput')]} />
<ProFormCheckbox.Group
name='manualInput'
options={[l('datastudio.sqlTask.flinkJar.manualInput')]}
/>

<ProFormDependency name={['manualInput']}>
{({ manualInput }) => {
Expand Down
5 changes: 5 additions & 0 deletions dinky-web/src/pages/DataStudio/DvaFunction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ export const mapDispatchToProps = (dispatch: Dispatch) => {
type: CONFIG_MODEL_ASYNC.queryDsConfig,
payload: params
}),
queryResourceConfig: (params: string) =>
dispatch({
type: CONFIG_MODEL_ASYNC.queryResourceConfig,
payload: params
}),
queryResource: () =>
dispatch({
type: STUDIO_MODEL_ASYNC.queryResource
Expand Down
Loading

0 comments on commit ccda836

Please sign in to comment.