You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by ni...@apache.org on 2024/07/12 07:45:36 UTC

(paimon-webui) 09/19: [Improvement] The query module obtains the cluster name through deploymentMode (#482)

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

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git

commit 5b600bc278e17dfba502143ab95fd877315b8a2f
Author: s7monk <34...@users.noreply.github.com>
AuthorDate: Wed Jul 10 19:18:12 2024 +0800

    [Improvement] The query module obtains the cluster name through deploymentMode (#482)
---
 paimon-web-ui/src/api/models/cluster/index.ts               | 13 ++++++++++++-
 .../components/query/components/debugger/index.tsx          |  5 +++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/paimon-web-ui/src/api/models/cluster/index.ts b/paimon-web-ui/src/api/models/cluster/index.ts
index c6445196..880380e4 100644
--- a/paimon-web-ui/src/api/models/cluster/index.ts
+++ b/paimon-web-ui/src/api/models/cluster/index.ts
@@ -30,7 +30,18 @@ export function getClusterList() {
 }
 
 /**
- * # List Cluster by ClusterType
+ * # List Cluster by Deployment Mode
+ */
+export function getClusterListByDeploymentMode(deploymentMode: string, pageNum: number, pageSize: number) {
+  return httpRequest.get('/cluster/list', {
+    deploymentMode,
+    pageNum,
+    pageSize,
+  })
+}
+
+/**
+ * # List Cluster by Type
  */
 export function getClusterListByType(type: string, pageNum: number, pageSize: number) {
   return httpRequest.get('/cluster/list', {
diff --git a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
index 8d8da56f..3a5e5794 100644
--- a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
+++ b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
@@ -20,7 +20,7 @@ import { FormatAlignLeftOutlined } from '@vicons/material'
 import { NInput, useMessage } from 'naive-ui'
 
 import styles from './index.module.scss'
-import { getClusterListByType } from '@/api/models/cluster'
+import { getClusterListByDeploymentMode } from '@/api/models/cluster'
 import type { Cluster } from '@/api/models/cluster/types'
 import type { JobSubmitDTO } from '@/api/models/job/types/job'
 import { createRecord, stopJob, submitJob } from '@/api/models/job'
@@ -153,7 +153,8 @@ export default defineComponent({
     }
 
     function getClusterData() {
-      getClusterListByType(debuggerVariables.conditionValue, 1, Number.MAX_SAFE_INTEGER).then((response) => {
+      const deploymentMode = debuggerVariables.conditionValue === 'Flink' ? 'flink-sql-gateway' : debuggerVariables.conditionValue
+      getClusterListByDeploymentMode(deploymentMode, 1, Number.MAX_SAFE_INTEGER).then((response) => {
         if (response && response.data) {
           const clusterList = response.data as Cluster[]
           debuggerVariables.clusterOptions = clusterList.map(cluster => ({