You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/12/19 08:45:20 UTC
[incubator-streampark] branch dev updated: [Fix]: lose the strategy variable when update app (#2181)
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new fac6b969f [Fix]: lose the strategy variable when update app (#2181)
fac6b969f is described below
commit fac6b969f156d08b08558db12c88ec63daf6a053
Author: WSZ <12...@qq.com>
AuthorDate: Mon Dec 19 16:45:14 2022 +0800
[Fix]: lose the strategy variable when update app (#2181)
---
.../src/views/flink/app/components/AppConf.tsx | 21 +++++++++++++++------
.../src/views/flink/app/hooks/useEditStreamPark.ts | 3 +++
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppConf.tsx b/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppConf.tsx
index b5dd0aa9f..778956738 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppConf.tsx
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppConf.tsx
@@ -43,7 +43,15 @@ export default defineComponent({
emit: ['openMergely'],
setup(props, { emit }) {
const { model } = toRefs(props);
- if (!model.value.strategy) model.value.strategy = '1';
+
+ if (!model.value.strategy) {
+ model.value.strategy = UseStrategyEnum.USE_EXIST;
+ }
+
+ async function handleChangeStrategy(strategy: number) {
+ model.value.strategy = strategy;
+ }
+
async function handleChangeConfig(v: string) {
const res = await fetchGetVer({ id: v });
model.value.configId = res.id;
@@ -51,14 +59,15 @@ export default defineComponent({
}
async function handleChangeNewConfig(confFile: string) {
- const res = await fetchName({
+ const appName = await fetchName({
config: confFile,
});
- const resp = await fetchAppConf({
+ const appConf = await fetchAppConf({
config: confFile,
});
- model.value.jobName = res;
- model.value.configOverride = decodeByBase64(resp);
+ model.value.config = confFile;
+ model.value.jobName = appName;
+ model.value.configOverride = decodeByBase64(appConf);
}
return () => {
return (
@@ -68,7 +77,7 @@ export default defineComponent({
class="mr-10px"
style="width: 25%"
value={unref(model).strategy}
- onChange={(value: any) => (model.value.strategy = value)}
+ onChange={(value: any) => handleChangeStrategy(value)}
>
<Select.Option value={UseStrategyEnum.USE_EXIST}>use existing</Select.Option>
<Select.Option value={UseStrategyEnum.RESELECT}>reselect</Select.Option>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useEditStreamPark.ts b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useEditStreamPark.ts
index 07b62e984..4820b2500 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useEditStreamPark.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useEditStreamPark.ts
@@ -149,6 +149,7 @@ export const useEditStreamParkSchema = (
ifShow: ({ model, values }) => values.jobType != JobTypeEnum.SQL && model.projectName,
},
{ field: 'project', label: 'ProjectId', component: 'Input', show: false },
+
{
field: 'module',
label: 'Application',
@@ -157,6 +158,8 @@ export const useEditStreamParkSchema = (
ifShow: ({ model, values }) => values.jobType != JobTypeEnum.SQL && model.module,
},
{ field: 'configId', label: 'configId', component: 'Input', show: false },
+ { field: 'config', label: '', component: 'Input', show: false },
+ { field: 'strategy', label: '', component: 'Input', show: false },
{
field: 'appConf',
label: 'Application conf',