From b80266274bfa9cc74ea64c830403f59837fffa18 Mon Sep 17 00:00:00 2001
From: benjobs <benjobs@qq.com>
Date: Thu, 24 Jun 2021 15:42:29 +0800
Subject: [PATCH 1/2] [BugFix] checkpoint path prefix bug fixed

---
 streamx-console/streamx-console-service/pom.xml              | 5 -----
 .../streamx/console/core/metrics/flink/CheckPoints.java      | 2 +-
 .../console/core/service/impl/FlinkSqlServiceImpl.java       | 2 ++
 .../streamx/console/core/task/FlinkTrackingTask.java         | 2 +-
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/streamx-console/streamx-console-service/pom.xml b/streamx-console/streamx-console-service/pom.xml
index f96b6a3ef8..f9649c97f7 100644
--- a/streamx-console/streamx-console-service/pom.xml
+++ b/streamx-console/streamx-console-service/pom.xml
@@ -121,11 +121,6 @@
             <scope>provided</scope>
         </dependency>
 
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/metrics/flink/CheckPoints.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/metrics/flink/CheckPoints.java
index d945ef8eeb..d5e192894a 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/metrics/flink/CheckPoints.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/metrics/flink/CheckPoints.java
@@ -82,7 +82,7 @@ public CheckPointType getCheckPointType() {
         }
 
         public String getPath() {
-            return this.getExternalPath().replaceFirst("^hdfs:", "hdfs://");
+            return this.getExternalPath().replaceFirst("^hdfs:/[^/]", "hdfs:///");
         }
     }
 
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/FlinkSqlServiceImpl.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/FlinkSqlServiceImpl.java
index 5316155ed2..5c4937a4ba 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/FlinkSqlServiceImpl.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/service/impl/FlinkSqlServiceImpl.java
@@ -25,6 +25,7 @@
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.streamxhub.streamx.common.util.ClassLoaderUtils;
 import com.streamxhub.streamx.common.util.DeflaterUtils;
 import com.streamxhub.streamx.console.base.utils.WebUtil;
 import com.streamxhub.streamx.console.core.dao.FlinkSqlMapper;
@@ -51,6 +52,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Supplier;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/task/FlinkTrackingTask.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/task/FlinkTrackingTask.java
index 6b41dff31e..8fb1adde16 100644
--- a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/task/FlinkTrackingTask.java
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/task/FlinkTrackingTask.java
@@ -341,7 +341,7 @@ private void handleCheckPoints(Application application) throws Exception {
                             savePoint.setAppId(application.getId());
                             savePoint.setLatest(true);
                             savePoint.setType(checkPoint.getCheckPointType().get());
-                            savePoint.setPath(checkPoint.getPath());
+                            savePoint.setPath(checkPoint.getExternalPath());
                             savePoint.setTriggerTime(new Date(checkPoint.getTriggerTimestamp()));
                             savePoint.setCreateTime(new Date());
                             savePointService.save(savePoint);

From f0a4237f51020fc09eddad8459dc466ea3bcc8d0 Mon Sep 17 00:00:00 2001
From: benjobs <benjobs@qq.com>
Date: Fri, 25 Jun 2021 12:40:39 +0800
Subject: [PATCH 2/2] [Feature] add default welcome page.

---
 .../core/controller/IndexController.java      | 34 +++++++++++++++++++
 .../src/main/resources/application-prod.yml   |  8 +++--
 .../src/views/flink/app/Detail.vue            |  8 +++++
 .../src/views/flink/app/Monaco.log.js         |  2 +-
 streamx-parent/pom.xml                        | 12 -------
 5 files changed, 49 insertions(+), 15 deletions(-)
 create mode 100644 streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/IndexController.java

diff --git a/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/IndexController.java b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/IndexController.java
new file mode 100644
index 0000000000..b8b97f8f51
--- /dev/null
+++ b/streamx-console/streamx-console-service/src/main/java/com/streamxhub/streamx/console/core/controller/IndexController.java
@@ -0,0 +1,34 @@
+/*
+ *  Copyright (c) 2019 The StreamX Project
+ *
+ * <p>Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * <p>http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * <p>Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.streamxhub.streamx.console.core.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * @author benjobs
+ */
+@RequestMapping
+@Controller
+public class IndexController {
+
+    @RequestMapping("/")
+    public ModelAndView index() {
+        return new ModelAndView("/index.html");
+    }
+}
diff --git a/streamx-console/streamx-console-service/src/main/resources/application-prod.yml b/streamx-console/streamx-console-service/src/main/resources/application-prod.yml
index 304bbe9112..de7db74b59 100644
--- a/streamx-console/streamx-console-service/src/main/resources/application-prod.yml
+++ b/streamx-console/streamx-console-service/src/main/resources/application-prod.yml
@@ -7,6 +7,9 @@ server:
       io: 4
       worker: 20
 
+logging:
+  level: debug
+
 spring:
   application.name: streamx
   devtools:
@@ -34,7 +37,7 @@ spring:
         # 数据源-1,名称为 primary
         primary:
           username: root
-          password: 123322242
+          password: 123456
           driver-class-name: com.mysql.cj.jdbc.Driver
           url: jdbc:mysql://localhost:3306/streamx?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
   aop.proxy-target-class: true
@@ -85,5 +88,6 @@ streamx:
       /*.js,
       /*.png,
       /*.jpg,
-      /*.less
+      /*.less,
+      /
 
diff --git a/streamx-console/streamx-console-webapp/src/views/flink/app/Detail.vue b/streamx-console/streamx-console-webapp/src/views/flink/app/Detail.vue
index 69a7003cef..03694e58a3 100644
--- a/streamx-console/streamx-console-webapp/src/views/flink/app/Detail.vue
+++ b/streamx-console/streamx-console-webapp/src/views/flink/app/Detail.vue
@@ -516,6 +516,7 @@
       <div
         id="startExp"
         class="startExp"
+        ref="startExp"
         style="height: 100%"/>
     </a-modal>
 
@@ -1197,6 +1198,8 @@ export default {
           theme: 'log',
           value: this.execOption.content,
           language: 'log',
+          readOnly: true,
+          inherit: true,
           scrollBeyondLastLine: false,
           overviewRulerBorder: false, // 不要滚动条边框
           autoClosingBrackets: true,
@@ -1267,6 +1270,11 @@ export default {
     myTheme() {
       this.$refs.confEdit.theme()
       this.$refs.different.theme()
+      if(this.editor.exception !== null) {
+        this.editor.exception.updateOptions({
+          theme: this.ideTheme()
+        })
+      }
     }
   },
 }
diff --git a/streamx-console/streamx-console-webapp/src/views/flink/app/Monaco.log.js b/streamx-console/streamx-console-webapp/src/views/flink/app/Monaco.log.js
index 9a792ce812..6954891d12 100644
--- a/streamx-console/streamx-console-webapp/src/views/flink/app/Monaco.log.js
+++ b/streamx-console/streamx-console-webapp/src/views/flink/app/Monaco.log.js
@@ -31,7 +31,7 @@ monaco.languages.setMonarchTokensProvider('log', {
       [/.*Exception.*/,'log-error'],
       [/.*Caused\s+by:.*/,'log-error'],
       [/\s+at\s+.*/, 'log-info'],
-      [/\[[a-zA-Z 0-9:]+\]/, 'log-date'],
+      [/\[[a-zA-Z 0-9:]+]/, 'log-date'],
     ]
   }
 })
diff --git a/streamx-parent/pom.xml b/streamx-parent/pom.xml
index 39f8e457d0..9c64905d26 100644
--- a/streamx-parent/pom.xml
+++ b/streamx-parent/pom.xml
@@ -106,12 +106,6 @@
                 <artifactId>vertx-core</artifactId>
                 <version>${vertx.version}</version>
             </dependency>
-
-            <dependency>
-                <groupId>io.vertx</groupId>
-                <artifactId>vertx-lang-scala_2.12</artifactId>
-                <version>${vertx.version}</version>
-            </dependency>
             <!--mysql async end-->
 
             <dependency>
@@ -256,12 +250,6 @@
                 <version>${flink.version}</version>
             </dependency>
 
-            <dependency>
-                <groupId>org.apache.flink</groupId>
-                <artifactId>flink-connector-filesystem_${scala.binary.version}</artifactId>
-                <version>1.11.3</version>
-            </dependency>
-
             <dependency>
                 <groupId>org.apache.flink</groupId>
                 <artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>