Skip to content

Commit

Permalink
[Improvement] The query module obtains the cluster name through deplo…
Browse files Browse the repository at this point in the history
…ymentMode (#482)
  • Loading branch information
s7monk authored Jul 10, 2024
1 parent 14b46b6 commit d049fd1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 12 additions & 1 deletion paimon-web-ui/src/api/models/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 => ({
Expand Down

0 comments on commit d049fd1

Please sign in to comment.