diff --git a/inlong-dashboard/src/plugins/clusters/defaults/Sort.ts b/inlong-dashboard/src/plugins/clusters/defaults/Sort.ts new file mode 100644 index 00000000000..c00587934e5 --- /dev/null +++ b/inlong-dashboard/src/plugins/clusters/defaults/Sort.ts @@ -0,0 +1,136 @@ +/* + * 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + +import { DataWithBackend } from '@/plugins/DataWithBackend'; +import { RenderRow } from '@/plugins/RenderRow'; +import { RenderList } from '@/plugins/RenderList'; +import { ClusterInfo } from '../common/ClusterInfo'; + +const { I18n } = DataWithBackend; +const { FieldDecorator } = RenderRow; + +const EngineVersions = [ + { label: '1.13', value: '1.13', type: 'Flink' }, + { label: '1.15', value: '1.15', type: 'Flink' }, +]; + +export default class SortCluster + extends ClusterInfo + implements DataWithBackend, RenderRow, RenderList +{ + @FieldDecorator({ + type: 'select', + initialValue: '', + rules: [{ required: true }], + props: { + options: [ + { + label: 'Flink', + value: 'Flink', + }, + { + label: 'Spark', + value: 'Spark', + }, + ], + }, + }) + @I18n('pages.Sort.EngineType') + engineType: string; + + @FieldDecorator({ + type: 'select', + initialValue: '', + rules: [{ required: true }], + props: values => ({ + options: EngineVersions.filter(e => values!.engineType === e.type).map(item => ({ + label: item.label, + value: item.value, + })), + }), + }) + @I18n('pages.Sort.EngineVersion') + engineVersion: string; + + @FieldDecorator({ + type: 'select', + initialValue: '', + rules: [{ required: true }], + props: { + options: [ + { + label: 'Apache Yarn', + value: 'ApacheYarn', + }, + { + label: 'Kubernetes', + value: 'Kubernetes', + }, + ], + }, + }) + @I18n('pages.Sort.ResourceType') + resourceType: string; + + @FieldDecorator({ + type: 'input', + initialValue: '127.0.0.1', + rules: [{ required: false }], + props: { + placeholder: '127.0.0.1', + }, + visible: values => values!.resourceType === 'ApacheYarn', + }) + @I18n('pages.Sort.yarnRestHost') + yarnRestHost: string; + + @FieldDecorator({ + type: 'inputnumber', + initialValue: '8081', + rules: [{ required: false }], + props: { + placeholder: '8081', + }, + visible: values => values!.resourceType === 'ApacheYarn', + }) + @I18n('pages.Sort.yarnRestPort') + yarnRestPort: number; + + @FieldDecorator({ + type: 'inputnumber', + initialValue: '1', + rules: [{ required: true }], + props: { + placeholder: '1', + }, + }) + @I18n('pages.Sort.Parallelism') + parallelism: number; + + @FieldDecorator({ + type: 'input', + initialValue: '127.0.0.1:10081', + rules: [{ required: true }], + props: { + placeholder: '127.0.0.1:10081', + }, + }) + @I18n('pages.Sort.AuditProxy') + auditProxy: string; +} diff --git a/inlong-dashboard/src/plugins/clusters/defaults/index.ts b/inlong-dashboard/src/plugins/clusters/defaults/index.ts index 8d923db35f3..0831f3b5f19 100644 --- a/inlong-dashboard/src/plugins/clusters/defaults/index.ts +++ b/inlong-dashboard/src/plugins/clusters/defaults/index.ts @@ -51,4 +51,9 @@ export const allDefaultClusters: MetaExportWithBackendList = [ value: 'TUBEMQ', LoadEntity: () => import('./TubeMq'), }, + { + label: 'Sort', + value: 'SORT', + LoadEntity: () => import('./Sort'), + }, ]; diff --git a/inlong-dashboard/src/ui/locales/cn.json b/inlong-dashboard/src/ui/locales/cn.json index 6ab2743cc84..769eaff992f 100644 --- a/inlong-dashboard/src/ui/locales/cn.json +++ b/inlong-dashboard/src/ui/locales/cn.json @@ -729,5 +729,12 @@ "pages.ApprovalManagement.Creator": "创建人", "pages.ApprovalManagement.Modifier": "修改人", "pages.ApprovalManagement.CreateProcess": "新建流程", - "pages.Nodes.TestConnection": "测试连接" + "pages.Nodes.TestConnection": "测试连接", + "pages.Sort.EngineType": "引擎", + "pages.Sort.EngineVersion": "引擎版本", + "pages.Sort.ResourceType": "资源管理", + "pages.Sort.yarnRestHost": "YarnRestHost", + "pages.Sort.yarnRestPort": "YarnRestPort", + "pages.Sort.Parallelism": "并行度", + "pages.Sort.AuditProxy": "审计代理地址" } diff --git a/inlong-dashboard/src/ui/locales/en.json b/inlong-dashboard/src/ui/locales/en.json index 958d1901e88..431c3c47dd9 100644 --- a/inlong-dashboard/src/ui/locales/en.json +++ b/inlong-dashboard/src/ui/locales/en.json @@ -728,5 +728,12 @@ "pages.ApprovalManagement.Creator": "Creator Name", "pages.ApprovalManagement.Modifier": "Modifier Name", "pages.ApprovalManagement.CreateProcess": "Create Process", - "pages.Nodes.TestConnection": "Test Connection" + "pages.Nodes.TestConnection": "Test Connection", + "pages.Sort.EngineType": "Engine", + "pages.Sort.EngineVersion": "Engine Version", + "pages.Sort.ResourceType": "Resource Management", + "pages.Sort.yarnRestHost": "Yarn Rest Host", + "pages.Sort.yarnRestPort": "Yarn Rest Port", + "pages.Sort.Parallelism": "Parallelism", + "pages.Sort.AuditProxy": "Audit Proxy" }