You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/12/03 12:24:59 UTC
[incubator-streampark] branch dev updated: [Improve] project && system settings module i18n support. (#2128)
This is an automated email from the ASF dual-hosted git repository.
benjobs 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 f6247eb58 [Improve] project && system settings module i18n support. (#2128)
f6247eb58 is described below
commit f6247eb5822e337b0167079fa14a07564817dbd5
Author: lvlin241 <lv...@163.com>
AuthorDate: Sat Dec 3 20:24:53 2022 +0800
[Improve] project && system settings module i18n support. (#2128)
* [Improve] system module (including system,flink and flink cluster) i18n support.
---
.../src/locales/lang/en/flink/project.ts | 74 ++++++++++++++++++
.../src/locales/lang/en/flink/setting.ts | 89 ++++++++++++++++++++++
.../src/locales/lang/zh-CN/flink/project.ts | 74 ++++++++++++++++++
.../src/locales/lang/zh-CN/flink/setting.ts | 89 ++++++++++++++++++++++
.../src/views/flink/project/View.vue | 2 +-
.../views/flink/project/components/ListItem.vue | 40 +++++-----
.../src/views/flink/project/project.data.ts | 22 +++---
.../src/views/flink/project/useProject.ts | 60 +++++++--------
.../src/views/flink/setting/AddCluster.vue | 4 +-
.../src/views/flink/setting/EditCluster.vue | 2 +-
.../src/views/flink/setting/View.vue | 10 ++-
.../setting/components/FlinkClusterSetting.vue | 10 +--
.../flink/setting/components/FlinkEnvModal.vue | 26 +++----
.../flink/setting/components/SystemSetting.vue | 12 +--
.../views/flink/setting/hooks/useClusterSetting.ts | 79 ++++++++++---------
15 files changed, 463 insertions(+), 130 deletions(-)
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
new file mode 100644
index 000000000..70748d861
--- /dev/null
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/project.ts
@@ -0,0 +1,74 @@
+/*
+ * 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
+ *
+ * https://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.
+ */
+export default {
+ projectStatus : {
+ all: 'ALL',
+ notBuild: 'Not Build',
+ building: 'Building',
+ buildSuccess: 'Build Success',
+ buildFailed: 'Build Failed',
+ needRebuild: 'NEED REBUILD',
+ successful: 'SUCCESSFUL',
+ failed: 'FAILED',
+ },
+ searchPlaceholder: 'please enter a keyword search',
+ form : {
+ projectName: 'Project Name',
+ projectNamePlaceholder: 'please input Project Name',
+ projectType: 'Project Type',
+ projectTypePlaceholder: 'please select project type',
+ cvs: 'CVS',
+ cvsPlaceholder: 'CVS',
+ repositoryURL: 'Repository URL',
+ repositoryURLPlaceholder: 'The Repository URL for this project',
+ userName: 'UserName',
+ userNamePlaceholder: 'UserName for this project',
+ password: 'Password',
+ passwordPlaceholder: 'Password for this project',
+ branches: 'Branches',
+ branchesPlaceholder: 'Select a branch',
+ pom: 'POM',
+ pomPlaceholder: 'By default,lookup pom.xml in root path,You can manually specify the module to compile pom.xmlh',
+ buildArgs: 'Build Argument',
+ buildArgsPlaceholder: 'Build Argument, e.g: -Pprod',
+ description: 'description',
+ descriptionPlaceholder: 'Description for this project',
+ lastBuild: 'Last Build',
+ buildState: 'Build State',
+ },
+ operationTips: {
+ projectNameIsRequiredMessage: 'Project Name is required',
+ projectNameIsUniqueMessage: 'The Project Name is already exists. Please check',
+ projectTypeIsRequiredMessage: 'Project Type is required',
+ cvsIsRequiredMessage: 'CVS is required',
+ repositoryURLIsRequiredMessage: 'Repository URL is required',
+ pomSpecifiesModuleMessage: 'Specifies the module to compile pom.xml If it is not specified, it is found under the root path pom.xml',
+ projectIsbuildingMessage: 'The current project is building',
+ projectIsbuildFailedMessage: 'Build Fail',
+ deleteProjectSuccessMessage: 'delete successful',
+ deleteProjectFailedMessage: 'Delete Fail',
+ deleteProjectFailedDetailMessage: 'Please check if any application belongs to this project',
+ notAuthorizedMessage: 'not authorized ..>﹏<.. <br><br> userName and password is required',
+ authenticationErrorMessage: 'authentication error ..>﹏<.. <br><br> please check userName and password',
+ seeBuildLog: 'See Build log',
+ buildProject: 'Build Project',
+ buildProjectMessage: 'Are you sure build this project?',
+ updateProject: 'Update Project',
+ deleteProject: 'Delete Project',
+ deleteProjectMessage: 'Are you sure delete this project ?',
+ }
+};
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts
index 6c16c7890..bb99bfb54 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/flink/setting.ts
@@ -15,6 +15,46 @@
* limitations under the License.
*/
export default {
+ settingTab: {
+ systemSetting: 'System Setting',
+ alertSetting: 'Alert Setting',
+ flinkHome: 'Flink Home',
+ flinkCluster: 'Flink Cluster',
+ },
+ systemSettingItems: {
+ mavenSetting: {
+ name: 'Maven Setting',
+ },
+ dockerSetting: {
+ name: 'Docker Setting',
+ },
+ emailSetting: {
+ name: 'Sender Email Setting',
+ },
+ consoleSetting: {
+ name: 'Console Setting',
+ },
+ ingressSetting: {
+ name: 'Ingress Setting',
+ },
+ },
+ flink: {
+ flinkName: 'Flink Name',
+ flinkNamePlaceholder: 'Please enter flink name',
+ flinkHome: 'Flink Home',
+ flinkHomePlaceholder: 'Please enter flink home',
+ description: 'description',
+ descriptionPlaceholder: 'Please enter description',
+ operateMessage: {
+ flinkNameTips: 'the flink name, e.g: flink-1.12',
+ flinkNameIsUnique: 'flink name is already exists',
+ flinkNameIsRequired: 'flink name is required',
+ flinkHomeTips: 'The absolute path of the FLINK_HOME',
+ flinkHomeIsRequired: 'flink name is required',
+ createFlinkHomeSuccessful: ' create successful!',
+ updateFlinkHomeSuccessful: ' update successful!',
+ }
+ },
alert: {
alertSetting: 'Alert Setting',
alertName: 'Alert Name',
@@ -80,16 +120,65 @@ export default {
edit: 'Edit Cluster',
delete: 'Are you sure delete this cluster ?',
form: {
+ clusterName: 'Cluster Name',
+ executionMode: 'Execution Mode',
+ versionId: 'Flink Version',
addType: 'Add Type',
addExisting: 'existing cluster',
addNew: 'new cluster',
+ yarnQueue: 'Yarn Queue',
+ address: 'Address',
+ yarnSessionClusterId: 'Yarn Session Cluster',
+ k8sNamespace: 'Kubernetes Namespace',
+ k8sClusterId: 'Kubernetes ClusterId',
+ serviceAccount: 'Service Account',
+ k8sConf: 'Kube Conf File',
+ flinkImage: 'Flink Base Docker Image',
+ k8sRestExposedType: 'Rest-Service Exposed Type',
+ resolveOrder: 'Resolve Order',
+ taskSlots: 'Task Slots',
+ totalOptions: 'Total Memory Options',
+ jmOptions: 'JM Memory Options',
+ tmOptions: 'TM Memory Options',
+ dynamicProperties: 'Dynamic Properties',
+ clusterDescription: 'Description',
},
placeholder: {
addType: 'Please select cluster Add Type',
+ clusterName: 'Please enter cluster name',
+ executionMode: 'Please enter cluster name',
+ versionId: 'please select Flink Version',
+ yarnQueue: 'Please enter yarn queue',
+ addressRemoteMode: 'Please enter cluster address, multiple addresses use \',\' split e.g: http://host:port,http://host1:port2',
+ addressNoRemoteMode: 'Please enter cluster address, e.g: http://host:port',
+ yarnSessionClusterId: 'Please enter Yarn Session cluster',
+ k8sConf: '~/.kube/config',
+ flinkImage: 'Please enter the tag of Flink base docker image, such as: flink:1.13.0-scala_2.11-java8',
+ k8sRestExposedType: 'kubernetes.rest-service.exposed.type',
+ resolveOrder: 'classloader.resolve-order',
+ taskSlots: 'Number of slots per TaskManager',
+ jmOptions: 'Please select the resource parameters to set',
+ tmOptions: 'Please select the resource parameters to set',
+ clusterDescription: 'Please enter description for this application',
},
required: {
address: 'cluster address is required',
+ executionMode: 'Execution Mode is required',
clusterId: 'Yarn Session Cluster is required',
+ versionId: 'Flink Version is required',
+ flinkImage: 'Flink Base Docker Image is required',
+ resolveOrder: 'Resolve Order is required',
+ },
+ operateMessage: {
+ createFlinkSessionClusterSuccessful: ' create successful!',
+ createFlinkSessionClusterFailed: 'create cluster failed, please check log',
+ hadoopEnvInitializationFailed: 'Hadoop environment initialization failed, please check the environment settings',
+ flinkClusterIsStarting: 'The current cluster is starting',
+ flinkClusterHasStartedSuccessful: 'The current cluster is started',
+ updateFlinkClusterSuccessful: ' update successful!',
+ },
+ view: {
+ clusterId: 'ClusterId'
},
},
env: {
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
new file mode 100644
index 000000000..5d8d2cb90
--- /dev/null
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/project.ts
@@ -0,0 +1,74 @@
+/*
+ * 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
+ *
+ * https://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.
+ */
+export default {
+ projectStatus : {
+ all: '所有(状态)',
+ notBuild: '未构建',
+ building: '构建中',
+ buildSuccess: '构建成功',
+ buildFailed: '构建失败',
+ needRebuild: '需重新构建',
+ successful: '成功',
+ failed: '失败',
+ },
+ searchPlaceholder: '请输入关键词搜索',
+ form : {
+ projectName: '项目名称',
+ projectNamePlaceholder: '请输入项目名称',
+ projectType: '项目类型',
+ projectTypePlaceholder: '请选择项目类型',
+ cvs: '项目来源',
+ cvsPlaceholder: '项目来源',
+ repositoryURL: '仓库地址',
+ repositoryURLPlaceholder: '请输入该项目的仓库地址',
+ userName: '项目用户名',
+ userNamePlaceholder: '请输入(访问)该项目仓库的用户名',
+ password: '项目密码',
+ passwordPlaceholder: '请输入(访问)该项目仓库的密码',
+ branches: '项目分支',
+ branchesPlaceholder: '请选择分支',
+ pom: 'POM依赖',
+ pomPlaceholder: '默认情况下,在根路径中查找pom.xml,你可以手动指定模块来编译pom.xml',
+ buildArgs: '构建(项目)参数',
+ buildArgsPlaceholder: '构建参数, 比如: -Pprod',
+ description: '描述',
+ descriptionPlaceholder: '请输入对该项目的描述信息',
+ lastBuild: '最近一次构建',
+ buildState: '构建状态',
+ },
+ operationTips: {
+ projectNameIsRequiredMessage: '项目名称必填',
+ projectNameIsUniqueMessage: '项目名称已存在,请再次输入',
+ projectTypeIsRequiredMessage: '项目类型必选',
+ cvsIsRequiredMessage: '资源来源必选',
+ repositoryURLIsRequiredMessage: '(项目)仓库地址必填',
+ pomSpecifiesModuleMessage: '指定编译pom.xml的模块 如未指定,则在根路径pom.xml下找到',
+ projectIsbuildingMessage: '当前项目正在构件中',
+ projectIsbuildFailedMessage: '构建失败',
+ deleteProjectSuccessMessage: '删除成功',
+ deleteProjectFailedMessage: '删除事变',
+ deleteProjectFailedDetailMessage: '请检查该项目是否有应用(模块)',
+ notAuthorizedMessage: '未鉴权 ..>﹏<.. <br><br> 用户名和密码是必填的',
+ authenticationErrorMessage: '鉴权失败 ..>﹏<.. <br><br> 请检查用户名和密码',
+ seeBuildLog: '查看构建日志',
+ buildProject: '构建项目',
+ buildProjectMessage: '确定构建项目?',
+ updateProject: '更新项目',
+ deleteProject: '删除项目',
+ deleteProjectMessage: '确定删除项目?',
+ }
+};
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts
index 800027de2..bf0dc5fbd 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/flink/setting.ts
@@ -15,6 +15,46 @@
* limitations under the License.
*/
export default {
+ settingTab: {
+ systemSetting: '系统设置',
+ alertSetting: '告警设置',
+ flinkHome: 'Flink配置',
+ flinkCluster: 'Flink集群配置',
+ },
+ systemSettingItems: {
+ mavenSetting: {
+ name: 'Maven配置'
+ },
+ dockerSetting: {
+ name: 'Docker环境配置',
+ },
+ emailSetting: {
+ name: '邮箱配置',
+ },
+ consoleSetting: {
+ name: '控制台配置',
+ },
+ ingressSetting: {
+ name: 'k8s Ingress 配置',
+ },
+ },
+ flink: {
+ flinkName: 'Flink环境(别名)',
+ flinkNamePlaceholder: '请输入flink环境别名',
+ flinkHome: 'Flink安装路径',
+ flinkHomePlaceholder: '请输入Flink安装路径',
+ description: 'flink环境描述',
+ descriptionPlaceholder: 'flink环境描述',
+ operateMessage: {
+ flinkNameTips: 'flink环境别名,举例: flink-1.12',
+ flinkNameIsUnique: 'flink环境别名已存在',
+ flinkNameIsRequired: 'flink环境别名必填',
+ flinkHomeTips: 'flink所在服务器的绝对路径,举例: /usr/local/flink',
+ flinkHomeIsRequired: 'Flink安装路径必填',
+ createFlinkHomeSuccessful: ' 创建成功!',
+ updateFlinkHomeSuccessful: ' 更新成功!',
+ }
+ },
alert: {
alertSetting: '告警设置',
alertName: '告警名称',
@@ -79,16 +119,65 @@ export default {
edit: '编辑集群',
delete: '确定要删除此集群 ?',
form: {
+ clusterName: '集群名称',
+ executionMode: '执行模式',
+ versionId: 'Flink版本',
addType: '添加类型',
addExisting: '已有集群',
addNew: '全新集群',
+ yarnQueue: 'Yarn队列',
+ address: '集群地址',
+ yarnSessionClusterId: 'Yarn Session模式集群ID',
+ k8sNamespace: 'k8s命名空间',
+ k8sClusterId: 'k8s集群ID',
+ serviceAccount: 'k8s命名空间绑定的服务账号',
+ k8sConf: 'k8s环境Kube配置文件',
+ flinkImage: 'Flink基础docker镜像',
+ k8sRestExposedType: 'K8S服务对外类型',
+ resolveOrder: '类加载顺序',
+ taskSlots: '任务槽数',
+ jmOptions: 'JM内存',
+ tmOptions: 'TM内存',
+ dynamicProperties: '动态参数',
+ clusterDescription: '集群描述',
},
placeholder: {
addType: '请选择集群添加类型',
+ clusterName: '请输入集群名称',
+ executionMode: '请选择执行模式',
+ versionId: '请选择Flink版本',
+ yarnQueue: '请选择Yarn队列',
+ addressRemoteMode: '请输入集群地址,多个地址使用英文逗号分割,例如:http://host:port,http://host1:port2',
+ addressNoRemoteMode: '请输入集群地址,例如:http://host:port',
+ yarnSessionClusterId: '请输入Yarn Session模式集群ID',
+ k8sConf: '示例:~/.kube/config',
+ flinkImage: '请输入Flink基础docker镜像的标签,如:flink:1.13.0-scala_2.11-java8',
+ k8sRestExposedType: 'kubernetes.rest-service.exposed.type',
+ resolveOrder: 'classloader.resolve-order',
+ taskSlots: '每个TaskManager的插槽数',
+ totalOptions: '总内存',
+ jmOptions: '请选择要设置的jm资源参数',
+ tmOptions: '请选择要设置的tm资源参数',
+ clusterDescription: '请输入对该申请的描述',
},
required: {
address: '必须填写集群地址',
+ executionMode: '执行模式必填',
clusterId: 'Yarn Session Cluster 为必填项',
+ versionId: 'Flink 版本必选',
+ flinkImage: 'link基础docker镜像是必填的',
+ resolveOrder: '类加载顺序必选',
+ },
+ operateMessage: {
+ createFlinkSessionClusterSuccessful: ' 创建成功!',
+ createFlinkSessionClusterFailed: 'session集群创建失败, 请检查日志',
+ hadoopEnvInitializationFailed: 'Hadoop环境初始化失败,请检查环境设置',
+ flinkClusterIsStarting: '当前集群正在启动',
+ flinkClusterHasStartedSuccessful: '当前集群已成功启动',
+ updateFlinkClusterSuccessful: ' 更新成功!',
+ },
+ view: {
+ clusterId: '集群ID'
},
},
env: {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/project/View.vue b/streampark-console/streampark-console-webapp/src/views/flink/project/View.vue
index 331d4280f..8515eb1be 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/project/View.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/project/View.vue
@@ -29,7 +29,7 @@
</a-radio-group>
<a-input-search
@search="handleSearch"
- placeholder="please enter a keyword search"
+ :placeholder="t('flink.project.searchPlaceholder')"
class="search-input"
/>
</template>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue b/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue
index d4a05b622..f9eea8143 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/project/components/ListItem.vue
@@ -44,28 +44,28 @@
<ul class="list-content">
<li class="list-content_item">
- <span>CVS</span>
+ <span>{{t('flink.project.form.cvs')}}</span>
<p><github-outlined /></p>
</li>
<li class="list-content_item">
- <span>Branches</span>
+ <span>{{t('flink.project.form.branches')}}</span>
<p>
<a-tag color="blue">{{ item.branches }}</a-tag>
</p>
</li>
<li class="list-content_item build_time">
- <span>Last Build</span>
+ <span>{{t('flink.project.form.lastBuild')}}</span>
<p>{{ item.lastBuild || '--' }}</p>
</li>
<li class="list-content_item build_state">
- <span>Build State</span>
+ <span>{{t('flink.project.form.buildState')}}</span>
<p>
<a-tag :color="buildState.color" :class="tagClass">{{ buildState.label }}</a-tag>
</p>
</li>
</ul>
<div class="operation">
- <a-tooltip title="See Build log">
+ <a-tooltip :title="t('flink.project.operationTips.seeBuildLog')">
<a-button
shape="circle"
@click="handleSeeLog"
@@ -77,11 +77,11 @@
</a-tooltip>
<template v-if="!isBuilding">
- <a-tooltip title="Build Project">
+ <a-tooltip :title="t('flink.project.operationTips.buildProject')">
<a-popconfirm
- title="Are you sure build this project?"
- cancel-text="No"
- ok-text="Yes"
+ :title="t('flink.project.operationTips.buildProjectMessage')"
+ :cancel-text="t('common.cancelText')"
+ :ok-text="t('common.okText')"
@confirm="handleBuild"
>
<a-button shape="circle" class="ml-8px" v-auth="'project:build'">
@@ -91,16 +91,16 @@
</a-tooltip>
</template>
- <a-tooltip title="Update Project">
+ <a-tooltip :title="t('flink.project.operationTips.updateProject')">
<a-button v-auth="'project:update'" @click="handleEdit" shape="circle" class="ml-8px">
<EditOutlined />
</a-button>
</a-tooltip>
- <a-tooltip title="Delete Project">
+ <a-tooltip :title="t('flink.project.operationTips.deleteProject')">
<a-popconfirm
- title="Are you sure delete this project ?"
- cancel-text="No"
- ok-text="Yes"
+ :title="t('flink.project.operationTips.deleteProjectMessage')"
+ :cancel-text="t('common.cancelText')"
+ :ok-text="t('common.okText')"
@confirm="handleDelete"
>
<a-button type="danger" v-auth="'project:delete'" shape="circle" style="margin-left: 8px">
@@ -128,7 +128,9 @@
import { useGo } from '/@/hooks/web/usePage';
import { ProjectRecord } from '/@/api/flink/project/model/projectModel';
import { BuildStateEnum } from '/@/enums/flinkEnum';
+ import { useI18n } from '/@/hooks/web/useI18n';
+ const { t } = useI18n();
const emit = defineEmits(['viewLog', 'success']);
const { Swal, createMessage } = useMessage();
@@ -159,12 +161,12 @@
});
Swal.fire({
icon: 'success',
- title: 'The current project is building',
+ title: t('flink.project.operationTips.projectIsbuildingMessage'),
showConfirmButton: false,
timer: 2000,
});
} catch (e) {
- createMessage.error('Build Fail');
+ createMessage.error(t('flink.project.operationTips.projectIsbuildFailedMessage'));
}
}
@@ -178,16 +180,16 @@
if (data.data) {
Swal.fire({
icon: 'success',
- title: 'delete successful',
+ title: t('flink.project.operationTips.deleteProjectSuccessMessage'),
showConfirmButton: false,
timer: 2000,
});
emit('success', true);
} else {
- Swal.fire('Failed', 'Please check if any application belongs to this project', 'error');
+ Swal.fire('Failed', t('flink.project.operationTips.deleteProjectFailedDetailMessage'), 'error');
}
} catch (e) {
- createMessage.error('Delete Fail');
+ createMessage.error(t('flink.project.operationTips.deleteProjectFailedMessage'));
}
}
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/project/project.data.ts b/streampark-console/streampark-console-webapp/src/views/flink/project/project.data.ts
index bca82b4a0..9b6274e91 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/project/project.data.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/project/project.data.ts
@@ -16,6 +16,8 @@
*/
import { BuildStateEnum } from '/@/enums/flinkEnum';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
interface Status {
label?: string;
@@ -23,23 +25,23 @@ interface Status {
}
export const statusList: Status[] = [
- { label: 'All', key: '' },
- { label: 'Not Build', key: String(BuildStateEnum.NOT_BUDIL) },
- { label: 'Building', key: String(BuildStateEnum.BUILDING) },
- { label: 'Build Success', key: String(BuildStateEnum.SUCCESSFUL) },
- { label: 'Build Failed', key: String(BuildStateEnum.FAILED) },
+ { label: t('flink.project.projectStatus.all'), key: '' },
+ { label: t('flink.project.projectStatus.notBuild'), key: String(BuildStateEnum.NOT_BUDIL) },
+ { label: t('flink.project.projectStatus.building'), key: String(BuildStateEnum.BUILDING) },
+ { label: t('flink.project.projectStatus.buildSuccess'), key: String(BuildStateEnum.SUCCESSFUL) },
+ { label: t('flink.project.projectStatus.buildFailed'), key: String(BuildStateEnum.FAILED) },
];
export const buildStateMap = {
- [String(BuildStateEnum.NOT_BUDIL)]: { color: '#C0C0C0', label: 'NOT BUILD' },
- [String(BuildStateEnum.NEED_REBUILD)]: { color: '#FFA500', label: 'NEED REBUILD' },
+ [String(BuildStateEnum.NOT_BUDIL)]: { color: '#C0C0C0', label: t('flink.project.projectStatus.notBuild') },
+ [String(BuildStateEnum.NEED_REBUILD)]: { color: '#FFA500', label: t('flink.project.projectStatus.needRebuild') },
[String(BuildStateEnum.BUILDING)]: {
color: '#1AB58E',
- label: 'BUILDING',
+ label: t('flink.project.projectStatus.building'),
className: 'status-processing-building',
},
- [String(BuildStateEnum.SUCCESSFUL)]: { color: '#52c41a', label: 'SUCCESSFUL' },
- [String(BuildStateEnum.FAILED)]: { color: '#f5222d', label: 'FAILED' },
+ [String(BuildStateEnum.SUCCESSFUL)]: { color: '#52c41a', label: t('flink.project.projectStatus.successful') },
+ [String(BuildStateEnum.FAILED)]: { color: '#f5222d', label: t('flink.project.projectStatus.failed') },
};
export enum ProjectType {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/project/useProject.ts b/streampark-console/streampark-console-webapp/src/views/flink/project/useProject.ts
index 062be31a7..3057c4c98 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/project/useProject.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/project/useProject.ts
@@ -23,7 +23,9 @@ import { useMessage } from '/@/hooks/web/useMessage';
import { useRoute } from 'vue-router';
import { ProjectRecord } from '/@/api/flink/project/model/projectModel';
import { filterOption } from '../app/utils';
+import { useI18n } from '/@/hooks/web/useI18n';
+const { t } = useI18n();
export const useProject = () => {
const route = useRoute();
const { createMessage, createErrorSwal } = useMessage();
@@ -39,18 +41,18 @@ export const useProject = () => {
return [
{
field: 'name',
- label: 'Project Name',
+ label: t('flink.project.form.projectName'),
component: 'Input',
rules: [{ required: true, validator: checkProjectName, trigger: 'blur' }],
- componentProps: { placeholder: 'the project name' },
+ componentProps: { placeholder: t('flink.project.form.projectNamePlaceholder') },
},
{
field: 'type',
- label: 'Project Type',
+ label: t('flink.project.form.projectType'),
component: 'Select',
defaultValue: 1,
componentProps: {
- placeholder: 'the project type',
+ placeholder: t('flink.project.form.projectTypePlaceholder'),
options: [
{ label: 'apache flink', value: 1, disabled: false },
{ label: 'apache spark', value: 2, disabled: true },
@@ -59,11 +61,11 @@ export const useProject = () => {
optionFilterProp: 'children',
filterOption,
},
- rules: [{ required: true, type: 'number', message: 'Project Type is required' }],
+ rules: [{ required: true, type: 'number', message: t('flink.project.operationTips.projectTypeIsRequiredMessage') }],
},
{
field: 'repository',
- label: 'CVS',
+ label: t('flink.project.form.cvs'),
component: 'Select',
componentProps: {
showSearch: true,
@@ -73,45 +75,45 @@ export const useProject = () => {
{ label: 'GitHub/GitLab', value: 1, disabled: false },
{ label: 'Subversion', value: 2, disabled: true },
],
- placeholder: 'CVS',
+ placeholder: t('flink.project.form.cvsPlaceholder'),
},
- rules: [{ required: true, type: 'number', message: 'CVS is required' }],
+ rules: [{ required: true, type: 'number', message: t('flink.project.operationTips.cvsIsRequiredMessage') }],
},
{
field: 'url',
- label: 'Repository URL',
+ label: t('flink.project.form.repositoryURL'),
component: 'Input',
componentProps: {
- placeholder: 'The Repository URL for this project',
+ placeholder: t('flink.project.form.repositoryURLPlaceholder'),
},
- rules: [{ required: true, message: 'Repository URL is required' }],
+ rules: [{ required: true, message: t('flink.project.operationTips.repositoryURLIsRequiredMessage') }],
},
{
field: 'userName',
- label: 'UserName',
+ label: t('flink.project.form.userName'),
component: 'Input',
componentProps: {
- placeholder: 'UserName for this project',
+ placeholder: t('flink.project.form.userNamePlaceholder'),
},
},
{
field: 'password',
- label: 'Password',
+ label: t('flink.project.form.password'),
component: 'InputPassword',
componentProps: {
- placeholder: 'Password for this project',
+ placeholder: t('flink.project.form.passwordPlaceholder'),
},
},
{
field: 'branches',
- label: 'Branches',
+ label: t('flink.project.form.branches'),
component: 'Select',
required: true,
componentProps: ({ formModel }) => {
return {
showSearch: true,
filterOption,
- placeholder: 'Select a branch',
+ placeholder: t('flink.project.form.branchesPlaceholder'),
options: unref(branchList),
onDropdownVisibleChange: (open: boolean) => {
console.log('open', open);
@@ -124,35 +126,33 @@ export const useProject = () => {
},
{
field: 'pom',
- label: 'POM',
+ label: t('flink.project.form.pom'),
component: 'Input',
componentProps: {
- placeholder:
- 'By default,lookup pom.xml in root path,You can manually specify the module to compile pom.xml"',
+ placeholder: t('flink.project.form.pomPlaceholder'),
},
rules: [
{
- message:
- 'Specifies the module to compile pom.xml If it is not specified, it is found under the root path pom.xml',
+ message: t('flink.project.operationTips.pomSpecifiesModuleMessage'),
},
],
},
{
field: 'buildArgs',
- label: 'Build Argument',
+ label: t('flink.project.form.buildArgs'),
component: 'InputTextArea',
componentProps: {
rows: 2,
- placeholder: 'Build Argument, e.g: -Pprod',
+ placeholder: t('flink.project.form.buildArgsPlaceholder'),
},
},
{
field: 'description',
- label: 'description',
+ label: t('flink.project.form.description'),
component: 'InputTextArea',
componentProps: {
rows: 4,
- placeholder: 'Description for this project',
+ placeholder: t('flink.project.form.descriptionPlaceholder'),
},
},
];
@@ -171,12 +171,12 @@ export const useProject = () => {
async function checkProjectName(_rule: RuleObject, value: StoreValue) {
if (!value) {
- return Promise.reject('The Project Name is required');
+ return Promise.reject(t('flink.project.operationTips.projectNameIsRequiredMessage'));
}
if (Object.keys(projectResource).length == 0 || value !== projectResource.name) {
const res = await isExist({ name: value });
if (res) {
- return Promise.reject(`The Project Name is already exists. Please check`);
+ return Promise.reject(t('flink.project.operationTips.projectNameIsUniqueMessage'));
}
} else {
return Promise.resolve();
@@ -209,8 +209,8 @@ export const useProject = () => {
} else {
createErrorSwal(
res === 1
- ? 'not authorized ..>﹏<.. <br><br> userName and password is required'
- : 'authentication error ..>﹏<.. <br><br> please check userName and password',
+ ? t('flink.project.operationTips.notAuthorizedMessage')
+ : t('flink.project.operationTips.authenticationErrorMessage'),
);
}
} catch (error) {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/AddCluster.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/AddCluster.vue
index 3a001023e..6046b03a9 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/AddCluster.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/AddCluster.vue
@@ -56,13 +56,13 @@
if (resp) {
Swal.fire({
icon: 'success',
- title: values.clusterName.concat(' create successful!'),
+ title: values.clusterName.concat(t('flink.setting.cluster.operateMessage.createFlinkSessionClusterSuccessful')),
showConfirmButton: false,
timer: 2000,
});
go('/flink/setting?activeKey=cluster');
} else {
- Swal.fire('Failed', 'create cluster failed, please check log', 'error');
+ Swal.fire('Failed', t('flink.setting.cluster.operateMessage.createFlinkSessionClusterFailed'), 'error');
}
} else {
Swal.fire('Failed', res.msg, 'error');
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/EditCluster.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/EditCluster.vue
index fc1c11676..27467917c 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/EditCluster.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/EditCluster.vue
@@ -70,7 +70,7 @@
fetchUpdateCluster(params);
Swal.fire({
icon: 'success',
- title: values.clusterName.concat(' update successful!'),
+ title: values.clusterName.concat(t('flink.setting.cluster.operateMessage.updateFlinkClusterSuccessful')),
showConfirmButton: false,
timer: 2000,
});
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/View.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/View.vue
index 016aa178e..061770201 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/View.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/View.vue
@@ -18,12 +18,12 @@
<PageWrapper contentFullHeight>
<div class="card-container">
<Tabs type="card" class="setting" v-model:activeKey="activeKey">
- <TabPane tab="System Setting" key="system">
+ <TabPane :tab="t('flink.setting.settingTab.systemSetting')" key="system">
<Card :bordered="false" class="system-setting">
<SystemSetting />
</Card>
</TabPane>
- <TabPane tab="Alert Setting" key="alert">
+ <TabPane :tab="t('flink.setting.settingTab.alertSetting')" key="alert">
<Card
:bordered="false"
class="system-setting !bg-transparent"
@@ -32,12 +32,12 @@
<AlertSetting />
</Card>
</TabPane>
- <TabPane tab="Flink Home" key="flink">
+ <TabPane :tab="t('flink.setting.settingTab.flinkHome')" key="flink">
<Card :bordered="false" class="system-setting">
<FlinkEnvSetting />
</Card>
</TabPane>
- <TabPane tab="Flink Cluster" key="cluster">
+ <TabPane :tab="t('flink.setting.settingTab.flinkCluster')" key="cluster">
<Card :bordered="false" class="system-setting">
<FlinkClusterSetting />
</Card>
@@ -55,7 +55,9 @@
import FlinkEnvSetting from './components/FlinkEnvSetting.vue';
import FlinkClusterSetting from './components/FlinkClusterSetting.vue';
import { useRoute } from 'vue-router';
+ import { useI18n } from '/@/hooks/web/useI18n';
+ const { t } = useI18n();
const TabPane = Tabs.TabPane;
const route = useRoute();
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkClusterSetting.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkClusterSetting.vue
index 0d290255a..12ceaa86a 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkClusterSetting.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkClusterSetting.vue
@@ -64,12 +64,12 @@
}
/* deploy */
async function handleDeployCluster(item: FlinkCluster) {
- const hide = createMessage.loading('The current cluster is starting', 0);
+ const hide = createMessage.loading(t('flink.setting.cluster.operateMessage.flinkClusterIsStarting'), 0);
try {
await fetchClusterStart(item.id);
await Swal.fire({
icon: 'success',
- title: 'The current cluster is started',
+ title: t('flink.setting.cluster.operateMessage.flinkClusterHasStartedSuccessful'),
showConfirmButton: false,
timer: 2000,
});
@@ -127,7 +127,7 @@
</ListItemMeta>
<div class="list-content" style="width: 15%">
<div class="list-content-item" style="width: 60%">
- <span>ExecutionMode</span>
+ <span>{{t('flink.setting.cluster.form.executionMode')}}</span>
<p style="margin-top: 10px">
{{ item.executionModeEnum.toLowerCase() }}
</p>
@@ -135,7 +135,7 @@
</div>
<div class="list-content" style="width: 15%">
<div class="list-content-item" style="width: 80%">
- <span>ClusterId</span>
+ <span>{{t('flink.setting.cluster.view.clusterId')}}</span>
<p style="margin-top: 10px">
{{ item.clusterId }}
</p>
@@ -143,7 +143,7 @@
</div>
<div class="list-content" style="width: 20%">
<div class="list-content-item" style="width: 60%">
- <span>Address</span>
+ <span>{{t('flink.setting.cluster.form.address')}}</span>
<p style="margin-top: 10px">
{{ item.address }}
</p>
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkEnvModal.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkEnvModal.vue
index 59b873224..15812986a 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkEnvModal.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/FlinkEnvModal.vue
@@ -48,32 +48,32 @@
schemas: [
{
field: 'flinkName',
- label: 'Flink Name',
+ label: t('flink.setting.flink.flinkName'),
component: 'Input',
componentProps: {
- placeholder: 'Please enter flink name',
+ placeholder: t('flink.setting.flink.flinkNamePlaceholder'),
allowClear: true,
},
- afterItem: () => h('span', { class: 'conf-switch' }, 'the flink name, e.g: flink-1.12'),
- rules: [{ required: true, message: 'flink name is required' }],
+ afterItem: () => h('span', { class: 'conf-switch' }, t('flink.setting.flink.operateMessage.flinkNameTips')),
+ rules: [{ required: true, message: t('flink.setting.flink.operateMessage.flinkNameIsRequired') }],
},
{
field: 'flinkHome',
- label: 'Flink Home',
+ label: t('flink.setting.flink.flinkHome'),
component: 'Input',
componentProps: {
- placeholder: 'Please enter flink home',
+ placeholder: t('flink.setting.flink.flinkHomePlaceholder'),
allowClear: true,
},
- afterItem: () => h('span', { class: 'conf-switch' }, 'The absolute path of the FLINK_HOME'),
- rules: [{ required: true, message: 'flink home is required' }],
+ afterItem: () => h('span', { class: 'conf-switch' }, t('flink.setting.flink.operateMessage.flinkHomeTips')),
+ rules: [{ required: true, message: t('flink.setting.flink.operateMessage.descriptionPlaceholder') }],
},
{
field: 'description',
- label: 'Description',
+ label: t('flink.setting.flink.description'),
component: 'InputTextArea',
componentProps: {
- placeholder: 'Please enter description',
+ placeholder: t('flink.setting.flink.descriptionPlaceholder'),
allowClear: true,
},
},
@@ -107,7 +107,7 @@
const { data } = await fetchFlinkCreate(formValue);
if (data.data) {
success = true;
- message = formValue.flinkName.concat(' create successful!');
+ message = formValue.flinkName.concat(t('flink.setting.flink.operateMessage.createFlinkHomeSuccessful'));
} else {
message = data.message;
}
@@ -118,7 +118,7 @@
...formValue,
});
if (data.data) {
- message = formValue.flinkName.concat(' update successful!');
+ message = formValue.flinkName.concat(t('flink.setting.flink.operateMessage.updateFlinkHomeSuccessful'));
success = true;
} else {
message = data.message;
@@ -144,7 +144,7 @@
'error',
);
} else {
- Swal.fire('Failed', 'flink name is already exists', 'error');
+ Swal.fire('Failed', t('flink.setting.flink.operateMessage.flinkNameIsUnique'), 'error');
}
}
} catch (error: any) {
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/SystemSetting.vue b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/SystemSetting.vue
index 1d947eed6..cd77ef0f1 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/components/SystemSetting.vue
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/components/SystemSetting.vue
@@ -28,7 +28,9 @@
import SettingList from './SettingList.vue';
import { fetchSystemSettingUpdate } from '/@/api/flink/setting';
import { useMessage } from '/@/hooks/web/useMessage';
+ import { useI18n } from '/@/hooks/web/useI18n';
+ const { t } = useI18n();
const CollapsePane = Collapse.Panel;
const { createMessage } = useMessage();
const settings = ref<SystemSetting[]>([]);
@@ -40,31 +42,31 @@
return [
{
key: 1,
- title: 'Maven Setting',
+ title: t('flink.setting.systemSettingItems.mavenSetting.name'),
isPassword: (item: SystemSetting) => item.settingKey === 'streampark.maven.auth.password',
data: filterValue('streampark.maven'),
},
{
key: 2,
- title: 'Docker Setting',
+ title: t('flink.setting.systemSettingItems.dockerSetting.name'),
isPassword: (item: SystemSetting) => item.settingKey === 'docker.register.password',
data: filterValue('docker.register'),
},
{
key: 3,
- title: 'Sender Email Setting',
+ title: t('flink.setting.systemSettingItems.emailSetting.name'),
isPassword: (item: SystemSetting) => item.settingKey === 'alert.email.password',
data: filterValue('alert.email'),
},
{
key: 4,
- title: 'Console Setting',
+ title: t('flink.setting.systemSettingItems.consoleSetting.name'),
isPassword: () => false,
data: settings.value.filter((i) => i.settingKey.indexOf('streampark.console') > -1),
},
{
key: 5,
- title: 'Ingrsss Setting',
+ title: t('flink.setting.systemSettingItems.ingressSetting.name'),
isPassword: () => false,
data: filterValue('ingress.mode'),
},
diff --git a/streampark-console/streampark-console-webapp/src/views/flink/setting/hooks/useClusterSetting.ts b/streampark-console/streampark-console-webapp/src/views/flink/setting/hooks/useClusterSetting.ts
index 0cd2a5ab3..95d80394f 100644
--- a/streampark-console/streampark-console-webapp/src/views/flink/setting/hooks/useClusterSetting.ts
+++ b/streampark-console/streampark-console-webapp/src/views/flink/setting/hooks/useClusterSetting.ts
@@ -67,7 +67,7 @@ export const useClusterSetting = () => {
/* check */
async function handleCheckExecMode(_rule: RuleObject, value: StoreValue) {
if (value === null || value === undefined || value === '') {
- return Promise.reject('Execution Mode is required');
+ return Promise.reject(t('flink.setting.cluster.required.executionMode'));
} else {
if (value === ExecModeEnum.YARN_SESSION) {
try {
@@ -76,12 +76,12 @@ export const useClusterSetting = () => {
return Promise.resolve();
} else {
return Promise.reject(
- 'Hadoop environment initialization failed, please check the environment settings',
+ t('flink.setting.cluster.operateMessage.hadoopEnvInitializationFailed'),
);
}
} catch (error) {
return Promise.reject(
- 'Hadoop environment initialization failed, please check the environment settings',
+ t('flink.setting.cluster.operateMessage.hadoopEnvInitializationFailed'),
);
}
} else {
@@ -109,19 +109,19 @@ export const useClusterSetting = () => {
return [
{
field: 'clusterName',
- label: 'Cluster Name',
+ label: t('flink.setting.cluster.form.clusterName'),
component: 'Input',
componentProps: {
- placeholder: 'Please enter cluster name',
+ placeholder: t('flink.setting.cluster.placeholder.clusterName'),
},
required: true,
},
{
field: 'executionMode',
- label: 'Execution Mode',
+ label: t('flink.setting.cluster.form.executionMode'),
component: 'Select',
componentProps: {
- placeholder: 'Please enter cluster name',
+ placeholder: t('flink.setting.cluster.placeholder.executionMode'),
options: [
{ label: 'remote (standalone)', value: ExecModeEnum.REMOTE },
{ label: 'yarn session', value: ExecModeEnum.YARN_SESSION },
@@ -134,14 +134,14 @@ export const useClusterSetting = () => {
},
{
field: 'versionId',
- label: 'Flink Version',
+ label: t('flink.setting.cluster.form.versionId'),
component: 'Select',
componentProps: {
- placeholder: 'Flink Version',
+ placeholder: t('flink.setting.cluster.placeholder.versionId'),
options: unref(flinkEnvs),
fieldNames: { label: 'flinkName', value: 'id', options: 'options' },
},
- rules: [{ required: true, message: 'Flink Version is required' }],
+ rules: [{ required: true, message: t('flink.setting.cluster.required.versionId') }],
},
{
field: 'addType',
@@ -166,10 +166,10 @@ export const useClusterSetting = () => {
},
{
field: 'yarnQueue',
- label: 'Yarn Queue',
+ label: t('flink.setting.cluster.form.yarnQueue'),
component: 'Input',
componentProps: {
- placeholder: 'Please enter yarn queue',
+ placeholder: t('flink.setting.cluster.placeholder.yarnQueue'),
},
ifShow: ({ values }) =>
values.executionMode == ExecModeEnum.YARN_SESSION &&
@@ -177,14 +177,14 @@ export const useClusterSetting = () => {
},
{
field: 'address',
- label: 'Address',
+ label: t('flink.setting.cluster.form.address'),
component: 'Input',
componentProps: ({ formModel }) => {
return {
placeholder:
formModel.executionMode == ExecModeEnum.REMOTE
- ? "Please enter cluster address, multiple addresses use ',' split e.g: http://host:port,http://host1:port2"
- : 'Please enter cluster address, e.g: http://host:port',
+ ? t('flink.setting.cluster.placeholder.addressRemoteMode')
+ : t('flink.setting.cluster.placeholder.addressNoRemoteMode'),
};
},
ifShow: ({ values }) =>
@@ -193,17 +193,17 @@ export const useClusterSetting = () => {
},
{
field: 'clusterId',
- label: 'Yarn Session Cluster',
+ label: t('flink.setting.cluster.form.yarnSessionClusterId'),
component: 'Input',
componentProps: {
- placeholder: 'Please enter Yarn Session cluster',
+ placeholder: t('flink.setting.cluster.placeholder.yarnSessionClusterId'),
},
ifShow: ({ values }) => isAddExistYarnSession(values),
rules: [{ required: true, message: t('flink.setting.cluster.required.clusterId') }],
},
{
field: 'k8sNamespace',
- label: 'Kubernetes Namespace',
+ label: t('flink.setting.cluster.form.k8sNamespace'),
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
component: 'Input',
render: ({ model, field }) =>
@@ -214,7 +214,7 @@ export const useClusterSetting = () => {
},
{
field: 'clusterId',
- label: 'Kubernetes ClusterId',
+ label: t('flink.setting.cluster.form.k8sClusterId'),
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
component: 'Input',
defaultValue: unref(flinkEnvs).filter((v) => v.isDefault)[0],
@@ -226,7 +226,7 @@ export const useClusterSetting = () => {
},
{
field: 'serviceAccount',
- label: 'Service Account',
+ label: t('flink.setting.cluster.form.serviceAccount'),
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
component: 'Input',
render: ({ model, field }) =>
@@ -237,53 +237,52 @@ export const useClusterSetting = () => {
},
{
field: 'k8sConf',
- label: 'Kube Conf File',
+ label: t('flink.setting.cluster.form.k8sConf'),
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
component: 'Input',
render: ({ model, field }) =>
renderInputDropdown(model, field, {
- placeholder: '~/.kube/config',
+ placeholder: t('flink.setting.cluster.placeholder.k8sConf'),
options: historyRecord.k8sConf,
}),
},
{
field: 'flinkImage',
- label: 'Flink Base Docker Image',
+ label: t('flink.setting.cluster.form.flinkImage'),
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
component: 'Input',
render: ({ model, field }) =>
renderInputDropdown(model, field, {
- placeholder:
- 'Please enter the tag of Flink base docker image, such as: flink:1.13.0-scala_2.11-java8',
+ placeholder: t('flink.setting.cluster.placeholder.flinkImage'),
options: historyRecord.flinkImage,
}),
- rules: [{ required: true, message: 'Flink Base Docker Image is required' }],
+ rules: [{ required: true, message: t('flink.setting.cluster.required.flinkImage') }],
},
{
field: 'k8sRestExposedType',
- label: 'Rest-Service Exposed Type',
+ label: t('flink.setting.cluster.form.k8sRestExposedType'),
ifShow: ({ values }) => values.executionMode == ExecModeEnum.KUBERNETES_SESSION,
component: 'Select',
componentProps: {
- placeholder: 'kubernetes.rest-service.exposed.type',
+ placeholder: t('flink.setting.cluster.placeholder.k8sRestExposedType'),
options: k8sRestExposedType,
},
},
{
field: 'resolveOrder',
- label: 'Resolve Order',
+ label: t('flink.setting.cluster.form.resolveOrder'),
ifShow: ({ values }) => isShowInSessionMode(values),
component: 'Select',
- componentProps: { placeholder: 'classloader.resolve-order', options: resolveOrder },
- rules: [{ message: 'Resolve Order is required', type: 'number' }],
+ componentProps: { placeholder: t('flink.setting.cluster.placeholder.resolveOrder'), options: resolveOrder },
+ rules: [{ message: t('flink.setting.cluster.placeholder.resolveOrder'), type: 'number' }],
},
{
field: 'slot',
- label: 'Task Slots',
+ label: t('flink.setting.cluster.form.taskSlots'),
ifShow: ({ values }) => isShowInSessionMode(values),
component: 'InputNumber',
componentProps: {
- placeholder: 'Number of slots per TaskManager',
+ placeholder: t('flink.setting.cluster.placeholder.taskSlots'),
min: 1,
step: 1,
class: '!w-full',
@@ -306,7 +305,7 @@ export const useClusterSetting = () => {
},
{
field: 'jmOptions',
- label: 'JM Memory Options',
+ label: t('flink.setting.cluster.form.jmOptions'),
ifShow: ({ values }) => isShowInSessionMode(values),
component: 'Select',
componentProps: {
@@ -314,7 +313,7 @@ export const useClusterSetting = () => {
allowClear: true,
mode: 'multiple',
maxTagCount: 2,
- placeholder: 'Please select the resource parameters to set',
+ placeholder: t('flink.setting.cluster.placeholder.jmOptions'),
fieldNames: { label: 'name', value: 'key', options: 'options' },
options: optionData.filter((x) => x.group === 'jobmanager-memory'),
},
@@ -329,7 +328,7 @@ export const useClusterSetting = () => {
},
{
field: 'tmOptions',
- label: 'TM Memory Options',
+ label: t('flink.setting.cluster.form.tmOptions'),
ifShow: ({ values }) => isShowInSessionMode(values),
component: 'Select',
componentProps: {
@@ -337,7 +336,7 @@ export const useClusterSetting = () => {
allowClear: true,
mode: 'multiple',
maxTagCount: 2,
- placeholder: 'Please select the resource parameters to set',
+ placeholder: t('flink.setting.cluster.placeholder.tmOptions'),
fieldNames: { label: 'name', value: 'key', options: 'options' },
options: optionData.filter((x) => x.group === 'taskmanager-memory'),
},
@@ -352,18 +351,18 @@ export const useClusterSetting = () => {
},
{
field: 'dynamicProperties',
- label: 'Dynamic Properties',
+ label: t('flink.setting.cluster.form.dynamicProperties'),
ifShow: ({ values }) => isShowInSessionMode(values),
component: 'Input',
render: (renderCallbackParams) => renderDynamicProperties(renderCallbackParams),
},
{
field: 'description',
- label: 'Description',
+ label: t('flink.setting.cluster.form.clusterDescription'),
component: 'InputTextArea',
componentProps: {
rows: 4,
- placeholder: 'Please enter description for this application',
+ placeholder: t('flink.setting.cluster.placeholder.clusterDescription'),
},
},
];