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
The following commit(s) were added to refs/heads/main by this push:
new e25fc45c [Improvement] Support selecting a session cluster when
submitting CDC jobs (#291)
e25fc45c is described below
commit e25fc45cf5233d211a6fa3508206ae7966fb0038
Author: yangyang zhong <[email protected]>
AuthorDate: Thu Jun 6 16:23:51 2024 +0800
[Improvement] Support selecting a session cluster when submitting CDC jobs
(#291)
---
paimon-web-ui/src/form-lib/cdc/use-submit-cdc-job.ts | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/paimon-web-ui/src/form-lib/cdc/use-submit-cdc-job.ts
b/paimon-web-ui/src/form-lib/cdc/use-submit-cdc-job.ts
index e7d6e318..ec86cad2 100644
--- a/paimon-web-ui/src/form-lib/cdc/use-submit-cdc-job.ts
+++ b/paimon-web-ui/src/form-lib/cdc/use-submit-cdc-job.ts
@@ -16,7 +16,10 @@ specific language governing permissions and limitations
under the License. */
import type { CdcJobSubmit } from '@/api/models/cdc'
+import { getClusterListByType } from '@/api/models/cluster'
+import type { Cluster } from '@/api/models/cluster/types'
import type { IJsonItem } from '@/components/dynamic-form/types'
+import type { SelectOption } from 'naive-ui'
export function useSumbitCdcJob(item: any) {
const { t } = useLocaleHooks()
@@ -25,15 +28,25 @@ export function useSumbitCdcJob(item: any) {
flinkSessionUrl: item.flinkSessionUrl,
})
+ const flinkSessionClusterOptions = ref<SelectOption[]>([])
+ getClusterListByType ('Flink', 1, Number.MAX_SAFE_INTEGER).then((response)
=> {
+ if (response && response.data) {
+ const clusterList = response.data as Cluster[]
+ flinkSessionClusterOptions.value = clusterList.map(cluster => ({
+ label: cluster.clusterName,
+ value: cluster.id.toString(),
+ }))
+ }})
return {
json: [
{
- type: 'input',
- field: 'flinkSessionUrl',
+ type: 'select',
+ field: 'clusterId',
name: t('common.flink_session_url'),
props: {
placeholder: '',
},
+ options: flinkSessionClusterOptions,
validate: {
trigger: ['input', 'blur'],
required: true,