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 eeb0f1b35 [Improve] project page improvement (#3127)
eeb0f1b35 is described below

commit eeb0f1b35770d8cfd6ede6971587261f057bd4da
Author: benjobs <[email protected]>
AuthorDate: Sat Sep 16 05:23:19 2023 -0500

    [Improve] project page improvement (#3127)
---
 .../impl/ApplicationActionServiceImpl.java         | 10 ++++
 .../console/core/task/ProjectBuildTask.java        | 57 ++++++++++------------
 .../src/assets/icons/http.svg                      |  2 +-
 .../src/assets/icons/{http.svg => net.svg}         |  0
 .../src/assets/icons/ssh.svg                       |  1 +
 .../src/locales/lang/en/flink/project.ts           |  2 +
 .../src/locales/lang/zh-CN/flink/project.ts        |  2 +
 .../components/AppView/StopApplicationModal.vue    |  2 +-
 .../flink/project/components/RepositoryGroup.tsx   | 30 ++++++++++--
 9 files changed, 69 insertions(+), 37 deletions(-)

diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java
index 096339aac..451ffc453 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/application/impl/ApplicationActionServiceImpl.java
@@ -375,6 +375,7 @@ public class ApplicationActionServiceImpl extends 
ServiceImpl<ApplicationMapper,
   @Override
   @Transactional(rollbackFor = {Exception.class})
   public void start(Application appParam, boolean auto) throws Exception {
+    // 1) check application
     final Application application = getById(appParam.getId());
     Utils.notNull(application);
     if (!application.isCanBeStart()) {
@@ -400,6 +401,9 @@ public class ApplicationActionServiceImpl extends 
ServiceImpl<ApplicationMapper,
       application.setRestartCount(application.getRestartCount() + 1);
     }
 
+    // 2) update app state to starting...
+    starting(application);
+
     String jobId = new JobID().toHexString();
     ApplicationLog applicationLog = new ApplicationLog();
     applicationLog.setOptionName(Operation.START.getValue());
@@ -559,6 +563,12 @@ public class ApplicationActionServiceImpl extends 
ServiceImpl<ApplicationMapper,
             });
   }
 
+  private void starting(Application application) {
+    application.setState(FlinkAppState.STARTING.getValue());
+    application.setOptionTime(new Date());
+    updateById(application);
+  }
+
   private Tuple2<String, String> getUserJarAndAppConf(FlinkEnv flinkEnv, 
Application application) {
     ExecutionMode executionMode = application.getExecutionModeEnum();
     ApplicationConfig applicationConfig = 
configService.getEffective(application.getId());
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ProjectBuildTask.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ProjectBuildTask.java
index 2e4d1a3d1..b423b0527 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ProjectBuildTask.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/ProjectBuildTask.java
@@ -177,44 +177,41 @@ public class ProjectBuildTask extends AbstractLogFileTask 
{
   }
 
   private void findTarOrJar(List<File> list, File path) {
-    for (File file : Objects.requireNonNull(path.listFiles())) {
+    for (File file : path.listFiles()) {
       // navigate to the target directory:
-      if (file.isDirectory() && "target".equals(file.getName())) {
-        // find the tar.gz file or the jar file in the target path.
-        // note: only one of the two can be selected, which cannot be 
satisfied at the same time.
-        File tar = null;
-        File jar = null;
-        for (File targetFile : Objects.requireNonNull(file.listFiles())) {
-          // 1) exit once the tar.gz file is found.
-          if (targetFile.getName().endsWith("tar.gz")) {
-            tar = targetFile;
-            break;
-          }
-          // 2) try look for jar files, there may be multiple jars found.
-          if (!targetFile.getName().startsWith("original-")
-              && !targetFile.getName().endsWith("-sources.jar")
-              && targetFile.getName().endsWith(".jar")) {
-            if (jar == null) {
-              jar = targetFile;
-            } else {
-              // there may be multiple jars found, in this case, select the 
jar with the largest and
-              // return
-              if (targetFile.length() > jar.length()) {
+      if (file.isDirectory()) {
+        if ("target".equals(file.getName())) {
+          // find the tar.gz file or the jar file in the target path.
+          // note: only one of the two can be selected, which cannot be 
satisfied at the same time.
+          File tar = null;
+          File jar = null;
+          for (File targetFile : file.listFiles()) {
+            // 1) exit once the tar.gz file is found.
+            if (targetFile.getName().endsWith("tar.gz")) {
+              tar = targetFile;
+              break;
+            }
+            // 2) try look for jar files, there may be multiple jars found.
+            if (!targetFile.getName().startsWith("original-")
+                && !targetFile.getName().endsWith("-sources.jar")
+                && targetFile.getName().endsWith(".jar")) {
+              if (jar == null) {
                 jar = targetFile;
+              } else {
+                if (targetFile.length() > jar.length()) {
+                  jar = targetFile;
+                }
               }
             }
           }
-        }
-        File target = tar == null ? jar : tar;
-        if (target == null) {
-          fileLogger.warn("[StreamPark] can't find tar.gz or jar in {}", 
file.getAbsolutePath());
+          File target = tar == null ? jar : tar;
+          if (target != null) {
+            list.add(target);
+          }
         } else {
-          list.add(target);
+          findTarOrJar(list, file);
         }
       }
-      if (file.isDirectory()) {
-        findTarOrJar(list, file);
-      }
     }
   }
 }
diff --git 
a/streampark-console/streampark-console-webapp/src/assets/icons/http.svg 
b/streampark-console/streampark-console-webapp/src/assets/icons/http.svg
index 0eb64e475..f49cbd71c 100644
--- a/streampark-console/streampark-console-webapp/src/assets/icons/http.svg
+++ b/streampark-console/streampark-console-webapp/src/assets/icons/http.svg
@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";><svg 
t="1615703629730" class="icon" viewBox="0 0 1024 1024" version="1.1" 
xmlns="http://www.w3.org/2000/svg"; p-id="5964" 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="200" 
height="200"><defs><style type="text/css"></style></defs><path d="M684.672 
591.189333c3.157333-26.154667 5.546667-52.266667 
5.546667-79.189333s-2.389333-53.077333-5.546667-79.189333 [...]
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";><svg 
t="1694830808867" class="icon" viewBox="0 0 1024 1024" version="1.1" 
xmlns="http://www.w3.org/2000/svg"; p-id="9591" 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="200" height="200"><path 
d="M918.016 489.984l0-41.984-86.016 0 0 41.984 86.016 0zM918.016 384q25.984 0 
45.013333 18.986667t18.986667 45.013333l0 41.984q0 25.984-18.986667 
45.013333t-45.01 [...]
\ No newline at end of file
diff --git 
a/streampark-console/streampark-console-webapp/src/assets/icons/http.svg 
b/streampark-console/streampark-console-webapp/src/assets/icons/net.svg
similarity index 100%
copy from streampark-console/streampark-console-webapp/src/assets/icons/http.svg
copy to streampark-console/streampark-console-webapp/src/assets/icons/net.svg
diff --git 
a/streampark-console/streampark-console-webapp/src/assets/icons/ssh.svg 
b/streampark-console/streampark-console-webapp/src/assets/icons/ssh.svg
new file mode 100644
index 000000000..1e024d1c9
--- /dev/null
+++ b/streampark-console/streampark-console-webapp/src/assets/icons/ssh.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";><svg 
t="1694830905072" class="icon" viewBox="0 0 1024 1024" version="1.1" 
xmlns="http://www.w3.org/2000/svg"; p-id="22900" 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="200" height="200"><path 
d="M192 384c-25.6 0-42.666667 21.333333-42.666667 42.666667v74.666666c0 
21.333333 17.066667 42.666667 42.666667 
42.666667H298.666667v32H149.333333V640h170.666667 [...]
\ No newline at end of file
diff --git 
a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/project.ts
 
b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/project.ts
index 88fb824ee..4f569def3 100644
--- 
a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/project.ts
+++ 
b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/project.ts
@@ -81,5 +81,7 @@ export default {
     updateProject: 'Update Project',
     deleteProject: 'Delete Project',
     deleteProjectMessage: 'Are you sure delete this project ?',
+    httpsCredential: 'Use Git or checkout with SVN using the web URL.',
+    sshCredential: 'Use a password-protected SSH key.',
   },
 };
diff --git 
a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/project.ts
 
b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/project.ts
index 8c85a2987..572e153d3 100644
--- 
a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/project.ts
+++ 
b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/project.ts
@@ -78,5 +78,7 @@ export default {
     updateProject: '更新项目',
     deleteProject: '删除项目',
     deleteProjectMessage: '确定删除项目?',
+    httpsCredential: '通过WebURL方式进行Git连接',
+    sshCredential: '使用受密码保护的SSH密钥进行Git连接',
   },
 };
diff --git 
a/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StopApplicationModal.vue
 
b/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StopApplicationModal.vue
index bdecd2b4e..457cf22e4 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StopApplicationModal.vue
+++ 
b/streampark-console/streampark-console-webapp/src/views/flink/app/components/AppView/StopApplicationModal.vue
@@ -79,7 +79,7 @@
         afterItem: () =>
           h(
             'span',
-            { class: 'conf-switch' },
+            { class: 'tip-info' },
             'Note: native format savepoint is supported since flink 1.15',
           ),
         ifShow: ({ values }) => !!values.stopSavePointed,
diff --git 
a/streampark-console/streampark-console-webapp/src/views/flink/project/components/RepositoryGroup.tsx
 
b/streampark-console/streampark-console-webapp/src/views/flink/project/components/RepositoryGroup.tsx
index 8bef222ef..5f317752f 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/flink/project/components/RepositoryGroup.tsx
+++ 
b/streampark-console/streampark-console-webapp/src/views/flink/project/components/RepositoryGroup.tsx
@@ -14,15 +14,16 @@
   See the License for the specific language governing permissions and
   limitations under the License. 
 */
-import { defineComponent } from 'vue';
+import { defineComponent, h } from 'vue';
 import type { PropType } from 'vue';
-import { Form, Input, Select } from 'ant-design-vue';
+import { Form, Input, Select, Tag } from 'ant-design-vue';
 export interface RepositoryProps {
   gitCredential: string | number;
   url: string;
 }
 import { useI18n } from '/@/hooks/web/useI18n';
 import { GitCredentialEnum } from '/@/enums/projectEnum';
+import { SvgIcon } from '/@/components/Icon';
 export default defineComponent({
   name: 'RepositoryUrl',
   props: {
@@ -45,8 +46,14 @@ export default defineComponent({
     };
 
     const options = [
-      { label: 'http/https', value: GitCredentialEnum.HTTPS },
-      { label: 'ssh', value: GitCredentialEnum.SSH },
+      {
+        label: h('div', {}, [h(SvgIcon, { name: 'http', color: '#108ee9', 
size: '30' }, '')]),
+        value: GitCredentialEnum.HTTPS,
+      },
+      {
+        label: h('div', {}, [h(SvgIcon, { name: 'ssh', color: '#108ee9', size: 
'30' }, '')]),
+        value: GitCredentialEnum.SSH,
+      },
     ];
 
     return () => {
@@ -55,7 +62,7 @@ export default defineComponent({
           <Input.Group compact class="!flex custom-input-group">
             <Select
               name="gitCredential"
-              style="width: 120px"
+              style="width: 80px"
               placeholder={t('flink.project.form.gitCredentialPlaceholder')}
               value={props.value?.gitCredential}
               onChange={(e: any) => handleProtocolChange(e)}
@@ -70,6 +77,19 @@ export default defineComponent({
               onInput={(e: any) => handleUrlChange(e.target.value)}
             />
           </Input.Group>
+          <p class="conf-desc mt-10px">
+            <span class="note-info">
+              <Tag color="#2db7f5" class="tag-note">
+                {t('flink.app.noteInfo.note')}
+              </Tag>
+              {props.value?.gitCredential === 1 && (
+                <span>{t('flink.project.operationTips.httpsCredential')}</span>
+              )}
+              {props.value?.gitCredential === 2 && (
+                <span>{t('flink.project.operationTips.sshCredential')}</span>
+              )}
+            </span>
+          </p>
         </div>
       );
     };

Reply via email to