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/11/30 11:49:13 UTC

[incubator-streampark] 01/01: [improve] history upload-jars improvement

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

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

commit 27a3696d4c10e042aaaad30bfdc232c1b730da2b
Author: benjobs <be...@apache.org>
AuthorDate: Wed Nov 30 19:48:55 2022 +0800

    [improve] history upload-jars improvement
---
 .../controller/ApplicationHistoryController.java   | 16 ++++++------
 .../console/core/mapper/ApplicationMapper.java     | 12 ++++-----
 .../console/core/service/ApplicationService.java   | 12 +++++++++
 .../core/service/impl/ApplicationServiceImpl.java  | 30 ++++++++++++++++++++++
 .../streampark-console-webapp/index.html           | 15 ++++++-----
 5 files changed, 64 insertions(+), 21 deletions(-)

diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java
index 1bdb9a82e..2dc13d0a8 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationHistoryController.java
@@ -20,8 +20,8 @@ package org.apache.streampark.console.core.controller;
 import org.apache.streampark.common.enums.ExecutionMode;
 import org.apache.streampark.common.enums.StorageType;
 import org.apache.streampark.console.base.domain.RestResponse;
-import org.apache.streampark.console.core.mapper.ApplicationMapper;
 import org.apache.streampark.console.core.service.ApplicationHistoryService;
+import org.apache.streampark.console.core.service.ApplicationService;
 
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
@@ -50,7 +50,7 @@ public class ApplicationHistoryController {
     private ApplicationHistoryService applicationHistoryService;
 
     @Autowired
-    private ApplicationMapper applicationMapper;
+    private ApplicationService applicationService;
 
     @PostMapping("uploadJars")
     @RequiresPermissions("app:create")
@@ -62,7 +62,7 @@ public class ApplicationHistoryController {
     @PostMapping("k8sNamespaces")
     @RequiresPermissions("app:create")
     public RestResponse listK8sNamespace() {
-        List<String> namespaces = applicationMapper.getRecentK8sNamespace(DEFAULT_HISTORY_RECORD_LIMIT);
+        List<String> namespaces = applicationService.getRecentK8sNamespace(DEFAULT_HISTORY_RECORD_LIMIT);
         return RestResponse.success(namespaces);
     }
 
@@ -74,7 +74,7 @@ public class ApplicationHistoryController {
             case KUBERNETES_NATIVE_SESSION:
             case YARN_SESSION:
             case REMOTE:
-                clusterIds = applicationMapper.getRecentK8sClusterId(executionMode, DEFAULT_HISTORY_RECORD_LIMIT);
+                clusterIds = applicationService.getRecentK8sClusterId(executionMode, DEFAULT_HISTORY_RECORD_LIMIT);
                 break;
             default:
                 clusterIds = new ArrayList<>(0);
@@ -86,28 +86,28 @@ public class ApplicationHistoryController {
     @PostMapping("flinkBaseImages")
     @RequiresPermissions("app:create")
     public RestResponse listFlinkBaseImage() {
-        List<String> images = applicationMapper.getRecentFlinkBaseImage(DEFAULT_HISTORY_RECORD_LIMIT);
+        List<String> images = applicationService.getRecentFlinkBaseImage(DEFAULT_HISTORY_RECORD_LIMIT);
         return RestResponse.success(images);
     }
 
     @PostMapping("flinkPodTemplates")
     @RequiresPermissions("app:create")
     public RestResponse listPodTemplate() {
-        List<String> templates = applicationMapper.getRecentK8sPodTemplate(DEFAULT_HISTORY_POD_TMPL_RECORD_LIMIT);
+        List<String> templates = applicationService.getRecentK8sPodTemplate(DEFAULT_HISTORY_POD_TMPL_RECORD_LIMIT);
         return RestResponse.success(templates);
     }
 
     @PostMapping("flinkJmPodTemplates")
     @RequiresPermissions("app:create")
     public RestResponse listJmPodTemplate() {
-        List<String> templates = applicationMapper.getRecentK8sJmPodTemplate(DEFAULT_HISTORY_POD_TMPL_RECORD_LIMIT);
+        List<String> templates = applicationService.getRecentK8sJmPodTemplate(DEFAULT_HISTORY_POD_TMPL_RECORD_LIMIT);
         return RestResponse.success(templates);
     }
 
     @PostMapping("flinkTmPodTemplates")
     @RequiresPermissions("app:create")
     public RestResponse listTmPodTemplate() {
-        List<String> templates = applicationMapper.getRecentK8sTmPodTemplate(DEFAULT_HISTORY_POD_TMPL_RECORD_LIMIT);
+        List<String> templates = applicationService.getRecentK8sTmPodTemplate(DEFAULT_HISTORY_POD_TMPL_RECORD_LIMIT);
         return RestResponse.success(templates);
     }
 
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java
index e8ed4bed0..f6d94dc97 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/mapper/ApplicationMapper.java
@@ -38,17 +38,17 @@ public interface ApplicationMapper extends BaseMapper<Application> {
 
     boolean mapping(@Param("application") Application appParam);
 
-    List<String> getRecentK8sNamespace(@Param("limitSize") int limit);
+    List<String> getRecentK8sNamespace(@Param("limitSize") Integer limit);
 
-    List<String> getRecentK8sClusterId(@Param("executionMode") int executionMode, @Param("limitSize") int limit);
+    List<String> getRecentK8sClusterId(@Param("executionMode") Integer executionMode, @Param("limitSize") Integer limit);
 
-    List<String> getRecentFlinkBaseImage(@Param("limitSize") int limit);
+    List<String> getRecentFlinkBaseImage(@Param("limitSize") Integer limit);
 
-    List<String> getRecentK8sPodTemplate(@Param("limitSize") int limit);
+    List<String> getRecentK8sPodTemplate(@Param("limitSize") Integer limit);
 
-    List<String> getRecentK8sJmPodTemplate(@Param("limitSize") int limit);
+    List<String> getRecentK8sJmPodTemplate(@Param("limitSize") Integer limit);
 
-    List<String> getRecentK8sTmPodTemplate(@Param("limitSize") int limit);
+    List<String> getRecentK8sTmPodTemplate(@Param("limitSize") Integer limit);
 
     void resetOptionState();
 
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 274ab0d13..3f7b19200 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
@@ -101,4 +101,16 @@ public interface ApplicationService extends IService<Application> {
     boolean existsRunningJobByClusterId(Long clusterId);
 
     boolean existsJobByClusterId(Long id);
+
+    List<String> getRecentK8sNamespace(Integer defaultHistoryRecordLimit);
+
+    List<String> getRecentK8sClusterId(Integer executionMode, Integer defaultHistoryRecordLimit);
+
+    List<String> getRecentFlinkBaseImage(Integer defaultHistoryRecordLimit);
+
+    List<String> getRecentK8sPodTemplate(Integer defaultHistoryPodTmplRecordLimit);
+
+    List<String> getRecentK8sJmPodTemplate(Integer defaultHistoryPodTmplRecordLimit);
+
+    List<String> getRecentK8sTmPodTemplate(Integer defaultHistoryPodTmplRecordLimit);
 }
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 87e6601f1..66b8fe5e9 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
@@ -549,6 +549,36 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, Appli
         return baseMapper.existsJobByClusterId(clusterId);
     }
 
+    @Override
+    public List<String> getRecentK8sNamespace(Integer defaultHistoryRecordLimit) {
+        return baseMapper.getRecentK8sNamespace(defaultHistoryRecordLimit);
+    }
+
+    @Override
+    public List<String> getRecentK8sClusterId(Integer executionMode, Integer defaultHistoryRecordLimit) {
+        return baseMapper.getRecentK8sClusterId(executionMode, defaultHistoryRecordLimit);
+    }
+
+    @Override
+    public List<String> getRecentFlinkBaseImage(Integer defaultHistoryRecordLimit) {
+        return baseMapper.getRecentFlinkBaseImage(defaultHistoryRecordLimit);
+    }
+
+    @Override
+    public List<String> getRecentK8sPodTemplate(Integer defaultHistoryPodTmplRecordLimit) {
+        return baseMapper.getRecentK8sPodTemplate(defaultHistoryPodTmplRecordLimit);
+    }
+
+    @Override
+    public List<String> getRecentK8sJmPodTemplate(Integer defaultHistoryPodTmplRecordLimit) {
+        return baseMapper.getRecentK8sJmPodTemplate(defaultHistoryPodTmplRecordLimit);
+    }
+
+    @Override
+    public List<String> getRecentK8sTmPodTemplate(Integer defaultHistoryPodTmplRecordLimit) {
+        return baseMapper.getRecentK8sTmPodTemplate(defaultHistoryPodTmplRecordLimit);
+    }
+
     @Override
     public String getYarnName(Application appParam) {
         String[] args = new String[2];
diff --git a/streampark-console/streampark-console-webapp/index.html b/streampark-console/streampark-console-webapp/index.html
index 9e061e6ab..151c3bbc5 100644
--- a/streampark-console/streampark-console-webapp/index.html
+++ b/streampark-console/streampark-console-webapp/index.html
@@ -34,8 +34,8 @@
 <body>
   <script>
     (() => {
-      var htmlRoot = document.getElementById('htmlRoot');
-      var theme = window.localStorage.getItem('__APP__DARK__MODE__');
+      let htmlRoot = document.getElementById('htmlRoot');
+      let theme = window.localStorage.getItem('__APP__DARK__MODE__');
       if (htmlRoot && theme) {
         htmlRoot.setAttribute('data-theme', theme);
         theme = htmlRoot = null;
@@ -171,12 +171,13 @@
     </style>
     <div class="app-loading">
       <div class="app-loading-wrap">
-        <img src="/resource/img/logo.svg" class="app-loading-logo" alt="Logo" />
         <div class="app-loading-dots">
-          <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
-        </div>
-        <div class="app-loading-title">
-          <%= title %>
+          <span class="dot dot-spin">
+            <i></i>
+            <i></i>
+            <i></i>
+            <i></i>
+          </span>
         </div>
       </div>
     </div>