You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by kr...@apache.org on 2022/11/24 23:14:02 UTC

[incubator-streampark] branch dev updated: [Bug] fixed issue 2052 (#2089)

This is an automated email from the ASF dual-hosted git repository.

kriszu 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 491824c23 [Bug] fixed issue 2052 (#2089)
491824c23 is described below

commit 491824c2338e66ead9994c7ac2aacbddc4814d6e
Author: benjobs <be...@apache.org>
AuthorDate: Fri Nov 25 07:13:54 2022 +0800

    [Bug] fixed issue 2052 (#2089)
---
 .../src/api/flink/app/app.ts                       |  6 ++-
 .../src/locales/lang/en/flink/setting.ts           |  2 +-
 .../src/locales/lang/zh-CN/flink/setting.ts        |  2 +-
 .../src/views/base/login/LoginForm.vue             |  2 +-
 .../src/views/flink/app/EditStreamPark.vue         |  4 +-
 .../src/views/flink/app/components/CustomForm.tsx  |  5 ++-
 .../src/views/flink/app/components/Dependency.vue  |  8 ++--
 .../src/views/flink/app/hooks/useApp.tsx           | 13 +++++--
 .../src/views/flink/app/hooks/useAppTableAction.ts |  2 +
 .../src/views/flink/app/hooks/useFlinkRender.tsx   |  8 ++--
 .../flink/setting/components/AlertDetailModal.vue  | 42 ++++++++++++++++-----
 .../views/flink/setting/components/AlertModal.vue  | 43 ++++++++++++++++------
 .../views/flink/setting/components/alert.data.ts   | 20 ++++++++--
 13 files changed, 111 insertions(+), 46 deletions(-)

diff --git a/streampark-console/streampark-console-webapp/src/api/flink/app/app.ts b/streampark-console/streampark-console-webapp/src/api/flink/app/app.ts
index dd40bd8b5..958c2eb7a 100644
--- a/streampark-console/streampark-console-webapp/src/api/flink/app/app.ts
+++ b/streampark-console/streampark-console-webapp/src/api/flink/app/app.ts
@@ -196,14 +196,16 @@ export function fetchStartLog(data): Promise<AxiosResponse<any>> {
  * @param {Object} data app Id
  * @returns {Promise<AxiosResponse<Result>>}
  */
-export function fetchCheckSavepointPath(data: { id?: string, savePoint?: string }): Promise<AxiosResponse<Result>> {
+export function fetchCheckSavepointPath(data: {
+  id?: string;
+  savePoint?: string;
+}): Promise<AxiosResponse<Result>> {
   return defHttp.post(
     { url: APP_API.CHECK_SAVEPOINT_PATH, data },
     { isReturnNativeResponse: true },
   );
 }
 
-
 /**
  * Cancel
  * @param {CancelParam} data
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts
index 1555f5980..d6a23b994 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts
@@ -69,7 +69,7 @@ export default {
     alertDetail: 'Alert Detail',
     alertOperationMessage: {
       updateAlertConfigFailed: 'Update AlertConfig Failed!',
-      updateAlertConfigSuccessfull: 'Update AlertConfig successful!'
+      updateAlertConfigSuccessfull: 'Update AlertConfig successful!',
     },
     delete: 'Are you sure delete this alert conf ?',
   },
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts
index b81b29b52..be9d2e45a 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts
@@ -68,7 +68,7 @@ export default {
     alertDetail: '告警(配置)详情',
     alertOperationMessage: {
       updateAlertConfigFailed: '告警配置更新失败!',
-      updateAlertConfigSuccessfull: '告警配置更新成功!'
+      updateAlertConfigSuccessfull: '告警配置更新成功!',
     },
     delete: '是否确定删除此警报 ?',
   },
diff --git a/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue b/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue
index cd924b71d..47e71fa4b 100644
--- a/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue
+++ b/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue
@@ -17,7 +17,7 @@
 <template>
   <div class="enter-x mb-50px text-light-50">
     <div class="text-center enter-x">
-      <img class="logo w-160px mx-auto my-20px" src="/@/assets/images/logo.png" />
+      <img class="logo w-160px mx-auto my-20px" src="/@/assets/images/logo.svg" />
     </div>
   </div>
   <Form
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue
index 5d4970830..21571fb7b 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/EditStreamPark.vue
@@ -155,10 +155,10 @@
   async function handleAppUpdate(values) {
     try {
       submitLoading.value = true;
-      if (app.jobType == 1) {
+      if (app.jobType == JobTypeEnum.JAR) {
         handleSubmitCustomJob(values);
       } else {
-        if (app.jobType == 2) {
+        if (app.jobType == JobTypeEnum.SQL) {
           if (values.flinkSql == null || values.flinkSql.trim() === '') {
             createMessage.warning(t('flink.app.editStreamPark.flinkSqlRequired'));
           } else {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/components/CustomForm.tsx b/streampark-console/streampark-console-webapp/src/views/flink/app/components/CustomForm.tsx
index 056f49547..9d41b1195 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/components/CustomForm.tsx
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/components/CustomForm.tsx
@@ -103,8 +103,9 @@ export default defineComponent({
               <Tag color="#2db7f5" class="tag-note">
                 Note
               </Tag>
-              Operation after checkpoint failure, e.g: Within 5 minutes (checkpoint failure rate interval), if
-              the number of checkpoint failures reaches 10 (max failures per interval),action will be triggered(alert or restart job)
+              Operation after checkpoint failure, e.g: Within 5 minutes (checkpoint failure rate
+              interval), if the number of checkpoint failures reaches 10 (max failures per
+              interval),action will be triggered(alert or restart job)
             </span>
           </p>
         </div>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/components/Dependency.vue b/streampark-console/streampark-console-webapp/src/views/flink/app/components/Dependency.vue
index 9f91911fb..027b963a8 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/components/Dependency.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/components/Dependency.vue
@@ -293,10 +293,10 @@
   <div class="dependency-box" v-if="dependencyRecords.length > 0 || uploadJars.length > 0">
     <Alert
       class="dependency-item"
-      v-for="(value, index) in dependencyRecords"
+      v-for="(dept, index) in dependencyRecords"
       :key="`dependency_${index}`"
       type="info"
-      @click="handleEditPom(value)"
+      @click="handleEditPom(dept)"
     >
       <template #message>
         <Space @click="handleEditPom(value)" class="tag-dependency-pom">
@@ -313,8 +313,8 @@
     </Alert>
     <Alert
       class="dependency-item"
-      v-for="(value, index) in uploadJars"
-      :key="`upload_jars_${index}`"
+      v-for="jar in uploadJars"
+      :key="`upload_jars_${jar}`"
       type="info"
     >
       <template #message>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useApp.tsx b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useApp.tsx
index 53b199f8b..a4282feae 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useApp.tsx
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useApp.tsx
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 import { Alert, Form, Input, Tag } from 'ant-design-vue';
-import { h, onMounted, ref, reactive, VNode, unref } from 'vue';
+import { h, onMounted, reactive, ref, unref, VNode } from 'vue';
 import { handleAppBuildStatueText } from '../utils';
 import { fetchCopy, fetchForcedStop, fetchMapping } from '/@/api/flink/app/app';
 import { fetchBuild, fetchBuildDetail } from '/@/api/flink/app/flinkBuild';
@@ -159,9 +159,14 @@ export const useFlinkApplication = (openStartModal: Fn) => {
       const state = app['optionState'];
       if (state === OptionStateEnum.NONE) {
         return (
-          [AppStateEnum.STARTING, AppStateEnum.RESTARTING, AppStateEnum.CANCELLING].includes(
-            app.state,
-          ) || false
+          [
+            AppStateEnum.INITIALIZING,
+            AppStateEnum.STARTING,
+            AppStateEnum.RESTARTING,
+            AppStateEnum.CANCELLING,
+            AppStateEnum.RECONCILING,
+            AppStateEnum.MAPPING,
+          ].includes(app.state) || false
         );
       }
       return true;
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts
index 9119d2c7b..49a2c10d5 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useAppTableAction.ts
@@ -198,6 +198,8 @@ export const useAppTableAction = (
           AppStateEnum.LOST,
           AppStateEnum.TERMINATED,
           AppStateEnum.POS_TERMINATED,
+          AppStateEnum.SUCCEEDED,
+          AppStateEnum.KILLED,
         ].includes(record.state),
         auth: 'app:delete',
         icon: 'ant-design:delete-outlined',
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useFlinkRender.tsx b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useFlinkRender.tsx
index 903eba8af..1a23e7a0a 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useFlinkRender.tsx
+++ b/streampark-console/streampark-console-webapp/src/views/flink/app/hooks/useFlinkRender.tsx
@@ -174,10 +174,10 @@ export const renderTotalMemory = ({ model, field }: RenderCallbackParams) => {
           <Tag color="#2db7f5" class="tag-note">
             Note
           </Tag>
-          Explicitly configuring both "total process memory" and "total Flink memory" is not recommended. It may lead to
-          deployment failures due to potential memory configuration conflicts. Configuring other
-          memory components also requires caution as it can produce further configuration conflicts,
-          The easiest way is to set "total process memory"
+          Explicitly configuring both "total process memory" and "total Flink memory" is not
+          recommended. It may lead to deployment failures due to potential memory configuration
+          conflicts. Configuring other memory components also requires caution as it can produce
+          further configuration conflicts, The easiest way is to set "total process memory"
         </span>
       </p>
     </div>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertDetailModal.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertDetailModal.vue
index e4a470b2d..842afdfec 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertDetailModal.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertDetailModal.vue
@@ -68,15 +68,35 @@
     }
   });
   const dingTalkColumn: DescItem[] = [
-    { label: t('flink.setting.alert.dingTalkUrl'), field: 'alertDingURL', span: 2, labelMinWidth: 50 },
-    { label: t('flink.setting.alert.dingtalkAccessToken'), field: 'token', span: 2, render: renderTypl },
-    { label: t('flink.setting.alert.secretToken'), field: 'secretToken', span: 2, render: renderTypl },
+    {
+      label: t('flink.setting.alert.dingTalkUrl'),
+      field: 'alertDingURL',
+      span: 2,
+      labelMinWidth: 50,
+    },
+    {
+      label: t('flink.setting.alert.dingtalkAccessToken'),
+      field: 'token',
+      span: 2,
+      render: renderTypl,
+    },
+    {
+      label: t('flink.setting.alert.secretToken'),
+      field: 'secretToken',
+      span: 2,
+      render: renderTypl,
+    },
     { label: t('flink.setting.alert.dingTalkUser'), field: 'contacts' },
     { label: t('flink.setting.alert.dingtalkIsAtAll'), field: 'isAtAll', render: renderTag },
   ];
   const larkColumn: DescItem[] = [
     { label: t('flink.setting.alert.larkToken'), field: 'token', span: 2, render: renderTypl },
-    { label: t('flink.setting.alert.larkSecretToken'), field: 'secretToken', span: 2, render: renderTypl },
+    {
+      label: t('flink.setting.alert.larkSecretToken'),
+      field: 'secretToken',
+      span: 2,
+      render: renderTypl,
+    },
     { label: t('flink.setting.alert.larkIsAtAll'), field: 'isAtAll', render: renderTag },
   ];
   function renderTag(value: boolean) {
@@ -92,12 +112,12 @@
   <BasicModal :show-ok-btn="false" @register="registerModal" class="alert-detail">
     <template #title>
       <SvgIcon name="alarm" size="25" />
-      {{t('flink.setting.alert.alertDetail')}}
+      {{ t('flink.setting.alert.alertDetail') }}
     </template>
     <template v-if="alertTypeTags.includes('1')">
       <Divider>
         <SvgIcon name="mail" size="20" />
-        {{t('flink.setting.alert.email')}}
+        {{ t('flink.setting.alert.email') }}
       </Divider>
       <Description
         class="alert-detail"
@@ -109,23 +129,25 @@
     <template v-if="alertTypeTags.includes('2')">
       <Divider>
         <SvgIcon name="dingtalk" size="20" />
-        {{t('flink.setting.alert.dingTalk')}}
+        {{ t('flink.setting.alert.dingTalk') }}
       </Divider>
       <Description class="alert-detail" :column="2" :data="dingTalk" :schema="dingTalkColumn" />
     </template>
     <template v-if="alertTypeTags.includes('4')">
-      <Divider><SvgIcon name="wecom" size="20" /> {{t('flink.setting.alert.weChat')}} </Divider>
+      <Divider><SvgIcon name="wecom" size="20" /> {{ t('flink.setting.alert.weChat') }} </Divider>
       <Description
         class="alert-detail"
         :column="1"
         :data="weChat"
-        :schema="[{ label: t('flink.setting.alert.weChattoken'), field: 'token', render: renderTypl }]"
+        :schema="[
+          { label: t('flink.setting.alert.weChattoken'), field: 'token', render: renderTypl },
+        ]"
       />
     </template>
     <template v-if="alertTypeTags.includes('16')">
       <Divider>
         <SvgIcon name="dingtalk" size="20" />
-        {{t('flink.setting.alert.lark')}}
+        {{ t('flink.setting.alert.lark') }}
       </Divider>
       <Description :column="2" :data="lark" :schema="larkColumn" class="alert-detail" />
     </template>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertModal.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertModal.vue
index cb1f5dd1d..093447fcc 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertModal.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/AlertModal.vue
@@ -54,7 +54,10 @@
         field: 'alertName',
         label: t('flink.setting.alert.alertName'),
         component: 'Input',
-        componentProps: { allowClear: true, placeholder: t('flink.setting.alert.alertNamePlaceHolder') },
+        componentProps: {
+          allowClear: true,
+          placeholder: t('flink.setting.alert.alertNamePlaceHolder'),
+        },
         afterItem: () =>
           h('span', { class: 'conf-switch' }, t('flink.setting.alert.alertNameTips')),
         dynamicRules: () => {
@@ -62,7 +65,9 @@
             {
               validator: async (_, value) => {
                 if (value === null || value === undefined || value === '') {
-                  return Promise.reject(t('flink.setting.alert.alertNameErrorMessage.alertNameIsRequired'));
+                  return Promise.reject(
+                    t('flink.setting.alert.alertNameErrorMessage.alertNameIsRequired'),
+                  );
                 } else {
                   if (!alertId.value) {
                     try {
@@ -75,7 +80,9 @@
                         return Promise.resolve();
                       }
                     } catch (error) {
-                      return Promise.reject(t('flink.setting.alert.alertNameErrorMessage.alertConfigFailed') + error);
+                      return Promise.reject(
+                        t('flink.setting.alert.alertNameErrorMessage.alertConfigFailed') + error,
+                      );
                     }
                   }
                 }
@@ -195,7 +202,7 @@
   >
     <template #title>
       <SvgIcon name="alarm" size="25" />
-      {{t('flink.setting.alert.alertSetting')}}
+      {{ t('flink.setting.alert.alertSetting') }}
     </template>
     <BasicForm @register="registerForm" class="!mt-15px">
       <template #type="{ model, field }">
@@ -222,13 +229,21 @@
         <template v-if="(alertType || []).includes('1')">
           <Divider>
             <SvgIcon name="mail" size="20" />
-            {{t('flink.setting.alert.email')}}
+            {{ t('flink.setting.alert.email') }}
           </Divider>
           <FormItem
             :label="t('flink.setting.alert.alertEmail')"
             :rules="[
-              { required: true, message: t('flink.setting.alert.alertEmailAddressIsRequired'), trigger: 'blur' },
-              { type: 'email', message: t('flink.setting.alert.alertEmailFormatIsInvalid'), trigger: 'blur' },
+              {
+                required: true,
+                message: t('flink.setting.alert.alertEmailAddressIsRequired'),
+                trigger: 'blur',
+              },
+              {
+                type: 'email',
+                message: t('flink.setting.alert.alertEmailFormatIsInvalid'),
+                trigger: 'blur',
+              },
             ]"
             name="alertEmail"
           >
@@ -243,7 +258,7 @@
       <template #alertDingURL="{ model, field }" v-if="(alertType || []).includes('2')">
         <Divider>
           <SvgIcon name="dingtalk" size="20" />
-          {{t('flink.setting.alert.dingTalk')}}
+          {{ t('flink.setting.alert.dingTalk') }}
         </Divider>
         <FormItem
           :label="t('flink.setting.alert.dingTalkUrl')"
@@ -257,20 +272,24 @@
             },
           ]"
         >
-          <Input v-model:value="model[field]" :placeholder="t('flink.setting.alert.dingTalkPlaceholder')" allowClear />
+          <Input
+            v-model:value="model[field]"
+            :placeholder="t('flink.setting.alert.dingTalkPlaceholder')"
+            allowClear
+          />
         </FormItem>
       </template>
 
       <!-- WeChat -->
       <template #weToken="{ model, field, schema }" v-if="(alertType || []).includes('4')">
-        <Divider><SvgIcon name="wecom" size="20" /> {{t('flink.setting.alert.weChat')}} </Divider>
+        <Divider><SvgIcon name="wecom" size="20" /> {{ t('flink.setting.alert.weChat') }} </Divider>
         <FormItem :label="schema.label" :name="field" :rules="schema.rules">
           <InputTextArea v-model:value="model[field]" v-bind="schema.componentProps" />
         </FormItem>
       </template>
 
       <template #alertSms="{ model, field, schema }" v-if="(alertType || []).includes('8')">
-        <Divider><SvgIcon name="message" size="20" /> {{t('flink.setting.alert.sms')}} </Divider>
+        <Divider><SvgIcon name="message" size="20" /> {{ t('flink.setting.alert.sms') }} </Divider>
         <FormItem :label="schema.label" :name="field" :rules="schema.rules">
           <Input v-model:value="model[field]" v-bind="schema.componentProps" />
         </FormItem>
@@ -278,7 +297,7 @@
 
       <!-- lark -->
       <template #larkToken="{ model, field, schema }" v-if="(alertType || []).includes('16')">
-        <Divider><SvgIcon name="lark" size="20" /> {{t('flink.setting.alert.lark')}} </Divider>
+        <Divider><SvgIcon name="lark" size="20" /> {{ t('flink.setting.alert.lark') }} </Divider>
         <FormItem :label="schema.label" :name="field" :rules="schema.rules">
           <Input
             v-model:value="model[field]"
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/alert.data.ts b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/alert.data.ts
index 338fa2611..9e2a77597 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/alert.data.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/alert.data.ts
@@ -24,7 +24,9 @@ export const alertFormSchema: Array<FormSchema> = [
     label: t('flink.setting.alert.faultAlertType'),
     component: 'Select',
     slot: 'type',
-    dynamicRules: () => [{ required: true, message: t('flink.setting.alert.faultAlertTypeIsRequired') }],
+    dynamicRules: () => [
+      { required: true, message: t('flink.setting.alert.faultAlertTypeIsRequired') },
+    ],
   },
   {
     field: 'alertEmail',
@@ -67,7 +69,13 @@ export const alertFormSchema: Array<FormSchema> = [
       placeholder: t('flink.setting.alert.secretTokenPlaceholder'),
     },
     ifShow: ({ model }) => (model.alertType || []).includes('2') && model.dingtalkSecretEnable,
-    rules: [{ required: true, message: t('flink.setting.alert.dingTalkSecretTokenIsRequired'), trigger: 'blur' }],
+    rules: [
+      {
+        required: true,
+        message: t('flink.setting.alert.dingTalkSecretTokenIsRequired'),
+        trigger: 'blur',
+      },
+    ],
   },
   {
     field: 'alertDingUser',
@@ -159,7 +167,13 @@ export const alertFormSchema: Array<FormSchema> = [
       placeholder: t('flink.setting.alert.larkSecretTokenPlaceholder'),
     },
     ifShow: ({ model }) => (model.alertType || []).includes('16') && model.larkSecretEnable,
-    rules: [{ required: true, message: t('flink.setting.alert.larkSecretTokenIsRequired'), trigger: 'blur' }],
+    rules: [
+      {
+        required: true,
+        message: t('flink.setting.alert.larkSecretTokenIsRequired'),
+        trigger: 'blur',
+      },
+    ],
   },
 ];