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

benjobs pushed a commit to branch dev-2.1.5
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev-2.1.5 by this push:
     new 28ffc24e1 [Improve] h2 dialect improvement (#3759)
28ffc24e1 is described below

commit 28ffc24e1a603f57e374c91a64808449f5f99df8
Author: benjobs <[email protected]>
AuthorDate: Sun Jun 16 17:50:28 2024 +0800

    [Improve] h2 dialect improvement (#3759)
    
    * [Improve] flink job restore state from checkpoint bug fixed. #3749
    
    * [Improve] h2 dialect improvement
    
    * [Improve] user.home minor improvement
    
    * [Improve] h2-data-dir default value improvement
    
    * [Improve] variable name improvement
    
    * [Improve] Clean up code not related to this PR
    
    ---------
    
    Co-authored-by: benjobs <[email protected]>
---
 .../src/main/assembly/conf/config.yaml             |  5 ++--
 .../console/base/config/SpringProperties.java      | 32 ++++++++++++++++++----
 .../core/controller/ApplicationController.java     |  6 ++--
 .../console/core/service/ApplicationService.java   |  2 +-
 .../core/service/impl/ApplicationServiceImpl.java  | 22 +++++++++------
 .../console/core/task/CheckpointProcessor.java     |  4 +--
 .../console/system/authentication/ShiroConfig.java |  1 +
 .../system/controller/PassportController.java      |  2 +-
 .../console/system/service/UserService.java        |  2 +-
 .../system/service/impl/UserServiceImpl.java       |  5 +++-
 .../src/main/resources/db/data-h2.sql              | 21 +++++++-------
 .../src/api/base/system.ts                         |  2 --
 .../src/api/flink/app/app.ts                       |  6 ++--
 .../src/locales/lang/en/flink/app.ts               |  2 +-
 .../src/store/modules/user.ts                      |  1 -
 .../src/views/flink/app/Detail.vue                 |  4 +--
 .../components/AppView/StartApplicationModal.vue   |  4 +--
 .../src/views/flink/app/hooks/useApp.tsx           | 16 +++++------
 .../src/views/flink/app/hooks/useAppTableAction.ts |  4 +--
 .../views/setting/FlinkHome/components/Modal.vue   | 11 ++++++--
 20 files changed, 91 insertions(+), 61 deletions(-)

diff --git 
a/streampark-console/streampark-console-service/src/main/assembly/conf/config.yaml
 
b/streampark-console/streampark-console-service/src/main/assembly/conf/config.yaml
index c6845eaad..b51ce4db6 100644
--- 
a/streampark-console/streampark-console-service/src/main/assembly/conf/config.yaml
+++ 
b/streampark-console/streampark-console-service/src/main/assembly/conf/config.yaml
@@ -35,10 +35,11 @@ server:
 # system database, default h2, mysql|pgsql|h2
 datasource:
   dialect: h2  #h2, mysql, pgsql
+  h2-data-dir: ~/streampark/h2-data # if datasource.dialect is h2, you can 
configure the data dir
   # if datasource.dialect is mysql or pgsql, you need to configure the 
following connection information
-  # mysql/postgresql connect user
+  # mysql/postgresql/h2 connect user
   username:
-  # mysql/postgresql connect password
+  # mysql/postgresql/h2 connect password
   password:
   # mysql/postgresql connect jdbcURL
   # mysql example: datasource.url: 
jdbc:mysql://localhost:3306/streampark?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/SpringProperties.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/SpringProperties.java
index 1d755f668..82c3e877d 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/SpringProperties.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/SpringProperties.java
@@ -87,17 +87,37 @@ public class SpringProperties {
         springConfig.put("spring.datasource.driver-class-name", 
"org.postgresql.Driver");
         break;
       case "h2":
-        springConfig.put("spring.datasource.driver-class-name", 
"org.h2.Driver");
-        springConfig.put("spring.datasource.username", "sa");
-        springConfig.put("spring.datasource.password", "sa");
+        String h2DataDir = userConfig.getProperty("datasource.h2-data-dir", 
null);
+        if (StringUtils.isBlank(h2DataDir)) {
+          h2DataDir = System.getProperty("user.home", "~") + 
"/streampark/h2-data/metadata";
+        } else {
+          h2DataDir += h2DataDir.endsWith("/") ? "metadata" : "/metadata";
+        }
+
         springConfig.put(
             "spring.datasource.url",
-            
"jdbc:h2:mem:streampark;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true;INIT=runscript
 from 'classpath:db/schema-h2.sql'");
+            String.format(
+                
"jdbc:h2:file:%s;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true;INIT=runscript
 from 'classpath:db/schema-h2.sql'",
+                h2DataDir));
+
+        String userName = userConfig.getProperty("spring.datasource.username", 
"admin");
+        String password = userConfig.getProperty("spring.datasource.password", 
"streampark");
+
+        springConfig.put("spring.jpa.database-platform", 
"org.hibernate.dialect.H2Dialect");
+        springConfig.put("spring.datasource.driver-class-name", 
"org.h2.Driver");
+        springConfig.put("spring.datasource.username", userName);
+        springConfig.put("spring.datasource.password", password);
         springConfig.put("spring.sql.init.data-locations", 
"classpath:db/data-h2.sql");
         springConfig.put("spring.sql.init.continue-on-error", "true");
-        springConfig.put("spring.sql.init.username", "sa");
-        springConfig.put("spring.sql.init.password", "sa");
+        springConfig.put("spring.sql.init.username", userName);
+        springConfig.put("spring.sql.init.password", password);
         springConfig.put("spring.sql.init.mode", "always");
+
+        // h2
+        springConfig.put("spring.h2.console.path", "/h2-console");
+        springConfig.put("spring.h2.console.enabled", true);
+        springConfig.put("spring.h2.console.settings.web-allow-others", true);
+        springConfig.put("spring.h2.console.settings.trace", true);
         break;
       default:
         throw new UnsupportedOperationException("Unsupported datasource 
dialect: " + dialect);
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
index 97e507492..60beea7ac 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java
@@ -257,10 +257,10 @@ public class ApplicationController {
 
   /** force stop(stop normal start or in progress) */
   @PermissionScope(app = "#app.id")
-  @PostMapping("forcedStop")
+  @PostMapping("abort")
   @RequiresPermissions("app:cancel")
-  public RestResponse forcedStop(Application app) {
-    applicationService.forcedStop(app);
+  public RestResponse abort(Application app) {
+    applicationService.abort(app);
     return RestResponse.success();
   }
 
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationService.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationService.java
index 4d37ce836..952728973 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationService.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/ApplicationService.java
@@ -102,7 +102,7 @@ public interface ApplicationService extends 
IService<Application> {
 
   boolean checkBuildAndUpdate(Application app);
 
-  void forcedStop(Application app);
+  void abort(Application app);
 
   boolean existsRunningJobByClusterId(Long clusterId);
 
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
index 6e4f6e7ad..9fedb6083 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java
@@ -80,6 +80,7 @@ import 
org.apache.streampark.console.core.service.ServiceHelper;
 import org.apache.streampark.console.core.service.SettingService;
 import org.apache.streampark.console.core.service.VariableService;
 import org.apache.streampark.console.core.service.YarnQueueService;
+import org.apache.streampark.console.core.task.CheckpointProcessor;
 import org.apache.streampark.console.core.task.FlinkAppHttpWatcher;
 import org.apache.streampark.console.core.task.FlinkK8sWatcherWrapper;
 import org.apache.streampark.flink.client.FlinkClient;
@@ -215,6 +216,8 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
 
   @Autowired private FlinkK8sWatcherWrapper k8sWatcherWrapper;
 
+  @Autowired private CheckpointProcessor checkpointProcessor;
+
   private static final int CPU_NUM = Math.max(2, 
Runtime.getRuntime().availableProcessors() * 4);
 
   private final ExecutorService bootstrapExecutor =
@@ -1190,7 +1193,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
   }
 
   @Override
-  public void forcedStop(Application app) {
+  public void abort(Application app) {
     CompletableFuture<SubmitResponse> startFuture = 
startFutureMap.remove(app.getId());
     CompletableFuture<CancelResponse> cancelFuture = 
cancelFutureMap.remove(app.getId());
     Application application = this.baseMapper.getApp(app);
@@ -1205,7 +1208,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
       cancelFuture.cancel(true);
     }
     if (startFuture == null && cancelFuture == null) {
-      this.doStopped(app);
+      this.doAbort(app);
     }
   }
 
@@ -1372,7 +1375,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
     TrackId trackId =
         application.isKubernetesModeJob() ? 
k8sWatcherWrapper.toTrackId(application) : null;
 
-    cancelFuture.whenComplete(
+    cancelFuture.whenCompleteAsync(
         (cancelResponse, throwable) -> {
           cancelFutureMap.remove(application.getId());
 
@@ -1383,9 +1386,9 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
             applicationLogService.save(applicationLog);
 
             if (throwable instanceof CancellationException) {
-              doStopped(application);
+              doAbort(application);
             } else {
-              log.error("stop flink job failed.", throwable);
+              log.error("abort flink job failed.", throwable);
               application.setOptionState(OptionState.NONE.getValue());
               application.setState(FlinkAppState.FAILED.getValue());
               updateById(application);
@@ -1660,7 +1663,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
 
     startFutureMap.put(application.getId(), future);
 
-    future.whenComplete(
+    future.whenCompleteAsync(
         (response, throwable) -> {
           // 1) remove Future
           startFutureMap.remove(application.getId());
@@ -1673,7 +1676,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
             applicationLog.setSuccess(false);
             applicationLogService.save(applicationLog);
             if (throwable instanceof CancellationException) {
-              doStopped(application);
+              doAbort(application);
             } else {
               Application app = getById(appParam.getId());
               app.setState(FlinkAppState.FAILED.getValue());
@@ -1691,6 +1694,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
 
           // 3) success
           applicationLog.setSuccess(true);
+
           if (response.flinkConfig() != null) {
             String jmMemory = 
response.flinkConfig().get(ConfigConst.KEY_FLINK_JM_PROCESS_MEMORY());
             if (jmMemory != null) {
@@ -1824,7 +1828,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
     return properties;
   }
 
-  private void doStopped(Application appParam) {
+  private void doAbort(Application appParam) {
     Application application = getById(appParam);
     application.setOptionState(OptionState.NONE.getValue());
     application.setState(FlinkAppState.CANCELED.getValue());
@@ -1847,7 +1851,7 @@ public class ApplicationServiceImpl extends 
ServiceImpl<ApplicationMapper, Appli
           yarnClient.killApplication(applications.get(0).getApplicationId());
         }
       } catch (Exception e) {
-        log.error("Stopped failed!", e);
+        log.error("job abort failed!", e);
       }
     }
   }
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/CheckpointProcessor.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/CheckpointProcessor.java
index 8fc19a78b..96f4c2cfa 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/CheckpointProcessor.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/CheckpointProcessor.java
@@ -90,7 +90,7 @@ public class CheckpointProcessor {
         return;
       }
 
-      Long latestChkId = getLatestCheckpointedId(appId, 
checkPointKey.getCheckPointId());
+      Long latestChkId = getLatestCheckpointId(appId, 
checkPointKey.getCheckPointId());
       if (checkSaveAsCheckpoint(checkPoint, latestChkId)) {
         checkPointCache.put(checkPointKey.getCheckPointId(), 
checkPoint.getId());
         saveSavepoint(checkPoint, application.getId());
@@ -148,7 +148,7 @@ public class CheckpointProcessor {
   }
 
   @Nullable
-  private Long getLatestCheckpointedId(Long appId, String cacheId) {
+  private Long getLatestCheckpointId(Long appId, String cacheId) {
     return checkPointCache.get(
         cacheId,
         key -> {
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/authentication/ShiroConfig.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/authentication/ShiroConfig.java
index 3384723ae..2b14903c3 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/authentication/ShiroConfig.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/authentication/ShiroConfig.java
@@ -43,6 +43,7 @@ public class ShiroConfig {
 
     LinkedHashMap<String, String> filterChainDefinitionMap = new 
LinkedHashMap<>();
     filterChainDefinitionMap.put("/actuator/**", "anon");
+    filterChainDefinitionMap.put("/h2-console/**", "anon");
 
     filterChainDefinitionMap.put("/doc.html", "anon");
     filterChainDefinitionMap.put("/swagger-ui.html", "anon");
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java
index 401198143..5736a7cdd 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java
@@ -79,7 +79,7 @@ public class PassportController {
     }
 
     // set team
-    userService.fillInTeam(user);
+    userService.setDefaultTeam(user);
 
     // no team.
     if (user.getLastTeamId() == null) {
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/UserService.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/UserService.java
index c744cb806..0e88b4db2 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/UserService.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/UserService.java
@@ -111,7 +111,7 @@ public interface UserService extends IService<User> {
 
   void clearLastTeam(Long teamId);
 
-  void fillInTeam(User user);
+  void setDefaultTeam(User user);
 
   List<User> findByAppOwner(Long teamId);
 
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
index 1a5d126a6..a20e91d82 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
@@ -28,6 +28,7 @@ import org.apache.streampark.console.system.entity.User;
 import org.apache.streampark.console.system.mapper.UserMapper;
 import org.apache.streampark.console.system.service.MemberService;
 import org.apache.streampark.console.system.service.MenuService;
+import org.apache.streampark.console.system.service.TeamService;
 import org.apache.streampark.console.system.service.UserService;
 
 import org.apache.commons.collections.CollectionUtils;
@@ -62,6 +63,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, 
User> implements Us
 
   @Autowired private MenuService menuService;
 
+  @Autowired private TeamService teamService;
+
   @Override
   public User findByName(String username) {
     LambdaQueryWrapper<User> queryWrapper =
@@ -201,7 +204,7 @@ public class UserServiceImpl extends 
ServiceImpl<UserMapper, User> implements Us
   }
 
   @Override
-  public void fillInTeam(User user) {
+  public void setDefaultTeam(User user) {
     if (user.getLastTeamId() == null) {
       List<Team> teams = memberService.findUserTeams(user.getUserId());
       if (CollectionUtils.isEmpty(teams)) {
diff --git 
a/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
 
b/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
index a247d61e6..c6882b768 100644
--- 
a/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
+++ 
b/streampark-console/streampark-console-service/src/main/resources/db/data-h2.sql
@@ -15,13 +15,6 @@
  * limitations under the License.
  */
 
--- ----------------------------
--- Records of t_team
--- ----------------------------
-insert into `t_team` values (100000, 'default', 'The default team', now(), 
now());
-insert into `t_team` values (100001, 'test', 'The test team', now(), now());
-
-
 -- ----------------------------
 -- Records of t_flink_app
 -- ----------------------------
@@ -245,10 +238,16 @@ insert into `t_setting` values (15, 
'ingress.mode.default', null, 'Ingress domai
 -- ----------------------------
 -- Records of t_user
 -- ----------------------------
-insert into `t_user` values (100000, 'admin', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 1, 0, 
null, '1', now(), now(),null,'0',null,null);
-insert into `t_user` values (100001, 'test1', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 2, 0, 
null, '1', now(), now(),null,'0',null,null);
-insert into `t_user` values (100002, 'test2', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 2, 0, 
null, '1', now(), now(),null,'0',null,null);
-insert into `t_user` values (100003, 'test3', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 2, 0, 
null, '1', now(), now(),null,'0',null,null);
+insert into `t_user` values (100000, 'admin', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 1, 0, 
100000, '1', now(), now(),null,'0',null,null);
+insert into `t_user` values (100001, 'test1', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 2, 0, 
100000, '1', now(), now(),null,'0',null,null);
+insert into `t_user` values (100002, 'test2', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 2, 0, 
100000, '1', now(), now(),null,'0',null,null);
+insert into `t_user` values (100003, 'test3', '', 
'rh8b1ojwog777yrg0daesf04gk', 
'2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f', null, 2, 0, 
100001, '1', now(), now(),null,'0',null,null);
+
+-- ----------------------------
+-- Records of t_team
+-- ----------------------------
+insert into `t_team` values (100000, 'default', 'The default team', now(), 
now());
+insert into `t_team` values (100001, 'test', 'The test team', now(), now());
 
 -- ----------------------------
 -- Records of t_member
diff --git 
a/streampark-console/streampark-console-webapp/src/api/base/system.ts 
b/streampark-console/streampark-console-webapp/src/api/base/system.ts
index d117f7b57..9a517fddd 100644
--- a/streampark-console/streampark-console-webapp/src/api/base/system.ts
+++ b/streampark-console/streampark-console-webapp/src/api/base/system.ts
@@ -19,10 +19,8 @@ import {
   RolePageParams,
   RolePageListGetResultModel,
   MenuListModel,
-  UserListGetResultModel,
 } from './model/systemModel';
 import { defHttp } from '/@/utils/http/axios';
-import { BasicPageParams } from '/@/api/model/baseModel';
 
 enum Api {
   MenuList = '/menu/list',
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 1633c03ba..f84bece2d 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
@@ -36,7 +36,7 @@ enum APP_API {
   NAME = '/flink/app/name',
   CHECK_NAME = '/flink/app/checkName',
   CANCEL = '/flink/app/cancel',
-  FORCED_STOP = '/flink/app/forcedStop',
+  ABORT = '/flink/app/abort',
   DELETE = '/flink/app/delete',
   DELETE_BAK = '/flink/app/deletebak',
   CREATE = '/flink/app/create',
@@ -170,8 +170,8 @@ export function fetchDeleteOperationLog(id: string) {
  * @param params id:string
  * @returns
  */
-export function fetchForcedStop(data: { id: string }): Promise<boolean> {
-  return defHttp.post({ url: APP_API.FORCED_STOP, data });
+export function fetchAbort(data: { id: string }): Promise<boolean> {
+  return defHttp.post({ url: APP_API.ABORT, data });
 }
 
 export function fetchCheckStart(data): Promise<AxiosResponse<number>> {
diff --git 
a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts 
b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts
index 919d15b54..a294ec2b6 100644
--- 
a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts
+++ 
b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/app.ts
@@ -212,7 +212,7 @@ export default {
     savepoint: 'Trigger Savepoint',
     detail: 'View Detail',
     startLog: 'See Flink Start log',
-    force: 'Forced Stop Job',
+    force: 'Abort Job',
     copy: 'Copy Job',
     remapping: 'Remapping Job',
     deleteTip: 'Are you sure delete this job ?',
diff --git 
a/streampark-console/streampark-console-webapp/src/store/modules/user.ts 
b/streampark-console/streampark-console-webapp/src/store/modules/user.ts
index ece86f9f4..ccfe25f30 100644
--- a/streampark-console/streampark-console-webapp/src/store/modules/user.ts
+++ b/streampark-console/streampark-console-webapp/src/store/modules/user.ts
@@ -134,7 +134,6 @@ export const useUserStore = defineStore({
     async setTeamId(data: { teamId: string; userId?: string | number }): 
Promise<boolean> {
       try {
         const { refreshMenu } = usePermission();
-
         // The userId passed in is the binding operation at login
         if (data.userId) {
           await fetchInitUserTeam(data as { teamId: string; userId: string });
diff --git 
a/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue 
b/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue
index bdf731c80..b949cc1b7 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue
+++ 
b/streampark-console/streampark-console-webapp/src/views/flink/app/Detail.vue
@@ -29,7 +29,7 @@
   import { Description, useDescription } from '/@/components/Description';
   import { Icon } from '/@/components/Icon';
   import { useRoute, useRouter } from 'vue-router';
-  import { fetchBackUps, fetchGet, fetchOptionLog, fetchYarn } from 
'/@/api/flink/app/app';
+  import { fetchGet, fetchOptionLog, fetchYarn } from '/@/api/flink/app/app';
   import { onUnmounted, reactive, h, unref, ref, onMounted, computed } from 
'vue';
   import { useIntervalFn, useClipboard } from '@vueuse/core';
   import { AppListRecord } from '/@/api/flink/app/app.type';
@@ -178,8 +178,6 @@
     if (confList.records.length > 0) detailTabs.showConf = true;
     if (pointHistory.records.length > 0) detailTabs.showSaveOption = true;
     if (optionList.records.length > 0) detailTabs.showOptionLog = true;
-    //const backupList = await fetchBackUps(commonParams);
-    //if (backupList.records.length > 0) detailTabs.showBackup = true;
   }
 
   /* Get yarn data */
diff --git 
a/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StartApplicationModal.vue
 
b/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StartApplicationModal.vue
index 91a8af01a..1e9e30a6a 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StartApplicationModal.vue
+++ 
b/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StartApplicationModal.vue
@@ -31,7 +31,7 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useRouter } from 'vue-router';
-  import { fetchCheckStart, fetchForcedStop, fetchStart } from 
'/@/api/flink/app/app';
+  import { fetchCheckStart, fetchStart, fetchAbort } from 
'/@/api/flink/app/app';
   import { AppExistsEnum } from '/@/enums/flinkEnum';
 
   const SelectOption = Select.Option;
@@ -116,7 +116,7 @@
       id: receiveData.application.id,
     });
     if (resp.data.data === AppExistsEnum.IN_YARN) {
-      await fetchForcedStop({
+      await fetchAbort({
         id: receiveData.application.id,
       });
     }
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 e457c2b52..4827a020e 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
@@ -17,7 +17,7 @@
 import { Alert, Form, Input, Tag } from 'ant-design-vue';
 import { h, onMounted, reactive, ref, unref, VNode } from 'vue';
 import { handleAppBuildStatueText } from '../utils';
-import { fetchCheckName, fetchCopy, fetchForcedStop, fetchMapping } from 
'/@/api/flink/app/app';
+import { fetchCheckName, fetchCopy, fetchAbort, fetchMapping } from 
'/@/api/flink/app/app';
 import { fetchBuild, fetchBuildDetail } from '/@/api/flink/app/flinkBuild';
 import { fetchSavePonitHistory } from '/@/api/flink/app/savepoint';
 import { fetchAppOwners } from '/@/api/system/user';
@@ -168,7 +168,7 @@ export const useFlinkApplication = (openStartModal: Fn) => {
     }
     return false;
   }
-  function handleForcedStop(app: Recordable) {
+  function handleAbort(app: Recordable) {
     let option = 'starting';
     const optionState = app['optionState'];
     const stateMap = {
@@ -189,21 +189,21 @@ export const useFlinkApplication = (openStartModal: Fn) 
=> {
     }
     Swal.fire({
       title: 'Are you sure?',
-      text: `current job is ${option}, are you sure forced stop?`,
+      text: `current job is ${option}, are you sure abort it?`,
       icon: 'warning',
       showCancelButton: true,
-      confirmButtonText: 'Yes, forced stop!',
+      confirmButtonText: 'Yes, abort!',
       denyButtonText: `No, cancel`,
       confirmButtonColor: '#d33',
       cancelButtonColor: '#3085d6',
     }).then(async (result) => {
       if (result.isConfirmed) {
-        Swal.fire('forced stopping', '', 'success');
-        const res = await fetchForcedStop({
+        Swal.fire('abort job', '', 'success');
+        const res = await fetchAbort({
           id: app.id,
         });
         if (res) {
-          createMessage.success('forced stopping');
+          createMessage.success('abort job');
         }
         return Promise.resolve();
       }
@@ -387,7 +387,7 @@ export const useFlinkApplication = (openStartModal: Fn) => {
     handleCheckReleaseApp,
     handleAppCheckStart,
     handleCanStop,
-    handleForcedStop,
+    handleAbort,
     handleCopy,
     handleMapping,
     users,
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 b17acc940..2caa96703 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
@@ -56,7 +56,7 @@ export const useAppTableAction = (
     handleCheckReleaseApp,
     handleAppCheckStart,
     handleCanStop,
-    handleForcedStop,
+    handleAbort,
     handleCopy,
     handleMapping,
     users,
@@ -134,7 +134,7 @@ export const useAppTableAction = (
         ifShow: handleCanStop(record),
         auth: 'app:cancel',
         icon: 'ant-design:pause-circle-outlined',
-        onClick: handleForcedStop.bind(null, record),
+        onClick: handleAbort.bind(null, record),
       },
       {
         label: t('flink.app.operation.copy'),
diff --git 
a/streampark-console/streampark-console-webapp/src/views/setting/FlinkHome/components/Modal.vue
 
b/streampark-console/streampark-console-webapp/src/views/setting/FlinkHome/components/Modal.vue
index de0ee072d..7e3c501c7 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/setting/FlinkHome/components/Modal.vue
+++ 
b/streampark-console/streampark-console-webapp/src/views/setting/FlinkHome/components/Modal.vue
@@ -91,8 +91,15 @@
 
   /* form submit */
   async function handleSubmit() {
-    changeOkLoading(true);
-    const formValue = await validate();
+    let formValue;
+    try {
+      formValue = await validate();
+    } catch (error) {
+      console.warn('validate error:', error);
+      return;
+    } finally {
+      changeOkLoading(false);
+    }
     // Detection environment
     const { data: resp } = await fetchCheckEnv({
       id: versionId.value,

Reply via email to