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 2024/03/13 07:46:41 UTC
(incubator-streampark) branch sync_2.1.3 created (now 545b3ae35)
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a change to branch sync_2.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
at 545b3ae35 [Improve] docker|email check improvements
This branch includes the following new commits:
new d5f792ab1 [Improve] 2.1.3 ddl
new 545b3ae35 [Improve] docker|email check improvements
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-streampark) 02/02: [Improve] docker|email check improvements
Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch sync_2.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
commit 545b3ae355f5fe295457eadc31156c4902145d56
Author: benjobs <be...@gmail.com>
AuthorDate: Wed Mar 13 15:46:30 2024 +0800
[Improve] docker|email check improvements
---
.../common/conf/InternalConfigHolder.scala | 3 +
.../console/core/controller/SettingController.java | 4 +-
.../console/core/runner/EnvInitializer.java | 6 +-
.../src/api/setting/index.ts | 71 ++++++++-
.../src/locales/lang/en/setting/system.ts | 67 +++++++-
.../src/locales/lang/zh-CN/setting/system.ts | 67 +++++++-
.../src/views/setting/{Alarm => alarm}/View.vue | 0
.../{Alarm => alarm}/components/AlertModal.vue | 0
.../{Alarm => alarm}/components/AlertTypeInfo.vue | 0
.../{Alarm => alarm}/components/DetailModal.vue | 0
.../{Alarm => alarm}/components/index.data.ts | 0
.../setting/{Alarm => alarm}/components/index.ts | 0
.../src/views/setting/system/SettingForm.vue | 168 +++++++++++++++++++++
.../setting/{System => system}/SettingList.vue | 75 ++++++---
.../src/views/setting/{System => system}/View.vue | 0
.../src/views/setting/system/config.ts | 138 +++++++++++++++++
.../setting/{YarnQueue => yarnqueue}/View.vue | 0
.../{YarnQueue => yarnqueue}/YarnQueueDrawer.vue | 0
.../setting/{YarnQueue => yarnqueue}/index.data.ts | 0
.../useYarnQueueRender.tsx | 0
20 files changed, 567 insertions(+), 32 deletions(-)
diff --git a/streampark-common/src/main/scala/org/apache/streampark/common/conf/InternalConfigHolder.scala b/streampark-common/src/main/scala/org/apache/streampark/common/conf/InternalConfigHolder.scala
index d61ac2ee3..764031108 100644
--- a/streampark-common/src/main/scala/org/apache/streampark/common/conf/InternalConfigHolder.scala
+++ b/streampark-common/src/main/scala/org/apache/streampark/common/conf/InternalConfigHolder.scala
@@ -43,6 +43,9 @@ object InternalConfigHolder extends Logger {
/** configuration key options storage (key -> ConfigOption) */
private val confOptions = new ConcurrentHashMap[String, InternalOption](initialCapacity)
+ /** Initialize the ConfigHub. */
+ Seq(CommonConfig, K8sFlinkConfig)
+
/** Register the ConfigOption */
private[conf] def register(@Nonnull conf: InternalOption): Unit = {
confOptions.put(conf.key, conf)
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java
index 6517e7e1e..27b357549 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java
@@ -43,7 +43,7 @@ import java.util.List;
@Slf4j
@Validated
@RestController
-@RequestMapping("flink/setting")
+@RequestMapping("setting")
public class SettingController {
@Autowired private SettingService settingService;
@@ -122,7 +122,7 @@ public class SettingController {
}
@Operation(summary = "Check hadoop status")
- @PostMapping("checkHadoop")
+ @PostMapping("check/hadoop")
public RestResponse checkHadoop() {
try {
HadoopUtils.hdfs().getStatus();
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/EnvInitializer.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/EnvInitializer.java
index 032dc9e0c..635c2a465 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/EnvInitializer.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/runner/EnvInitializer.java
@@ -77,6 +77,9 @@ public class EnvInitializer implements ApplicationRunner {
@SneakyThrows
@Override
public void run(ApplicationArguments args) throws Exception {
+
+ checkAppHome();
+
// init InternalConfig
initConfig();
@@ -101,6 +104,7 @@ public class EnvInitializer implements ApplicationRunner {
Utils.requireNotNull(config);
InternalConfigHolder.set(config, env.getProperty(key, config.classType()));
});
+
InternalConfigHolder.log();
settingService.getMavenConfig().updateConfig();
@@ -118,8 +122,6 @@ public class EnvInitializer implements ApplicationRunner {
public synchronized void storageInitialize(StorageType storageType) {
- checkAppHome();
-
if (initialized.contains(storageType)) {
return;
}
diff --git a/streampark-console/streampark-console-webapp/src/api/setting/index.ts b/streampark-console/streampark-console-webapp/src/api/setting/index.ts
index 305e1a0ed..c2f771c23 100644
--- a/streampark-console/streampark-console-webapp/src/api/setting/index.ts
+++ b/streampark-console/streampark-console-webapp/src/api/setting/index.ts
@@ -18,11 +18,16 @@ import { SystemSetting } from './types/setting.type';
import { defHttp } from '/@/utils/http/axios';
enum SETTING_APi {
- GET = '/flink/setting/get',
- ALL = '/flink/setting/all',
- CHECK_HADOOP = '/flink/setting/checkHadoop',
- SYNC = '/flink/setting/sync',
- UPDATE = '/flink/setting/update',
+ GET = '/setting/get',
+ GET_DOCKER = '/setting/docker',
+ GET_EMAIL = '/setting/email',
+ ALL = '/setting/all',
+ UPDATE = '/setting/update',
+ CHECK_HADOOP = '/setting/check/hadoop',
+ CHECK_DOCKER = '/setting/check/docker',
+ UPDATE_DOCKER = '/setting/update/docker',
+ CHECK_EMAIL = '/setting/check/email',
+ UPDATE_ALERT = '/setting/update/email',
}
/**
* Get system settings
@@ -58,3 +63,59 @@ export function fetchCheckHadoop(): Promise<boolean> {
url: SETTING_APi.CHECK_HADOOP,
});
}
+
+/**
+ * get docker setting info
+ */
+export function fetchDockerConfig() {
+ return defHttp.post({ url: SETTING_APi.GET_DOCKER });
+}
+
+/**
+ * verify docker setting info
+ */
+export function fetchVerifyDocker(data: Recordable): Promise<boolean> {
+ return defHttp.post({
+ url: SETTING_APi.CHECK_DOCKER,
+ data,
+ });
+}
+
+/**
+ * verify docker setting info
+ */
+export function fetchVerifyEmail(data: Recordable): Promise<boolean> {
+ return defHttp.post({
+ url: SETTING_APi.CHECK_EMAIL,
+ data,
+ });
+}
+
+/**
+ * get alert setting info
+ */
+export function fetchEmailConfig() {
+ return defHttp.post({ url: SETTING_APi.GET_EMAIL });
+}
+
+/**
+ * Update docker setting
+ * @returns {Promise<Boolean>}
+ */
+export function fetchDockerUpdate(data: Recordable): Promise<boolean> {
+ return defHttp.post({
+ url: SETTING_APi.UPDATE_DOCKER,
+ data,
+ });
+}
+
+/**
+ * Update alert setting
+ * @returns {Promise<Boolean>}
+ */
+export function fetchEmailUpdate(data: Recordable): Promise<boolean> {
+ return defHttp.post({
+ url: SETTING_APi.UPDATE_ALERT,
+ data,
+ });
+}
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/system.ts b/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/system.ts
index ca20ab348..065cdae1f 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/system.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/en/setting/system.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
export default {
- systemSetting: 'Environment Setting',
+ systemSetting: 'System Setting',
systemSettingItems: {
mavenSetting: {
name: 'Maven Setting',
@@ -34,6 +34,69 @@ export default {
},
},
update: {
- success: 'setting updated successfully',
+ success: 'Setting updated successfully',
+ dockerNotStart: 'Please make sure your Docker service has been started. 🙂',
+ },
+ title: {
+ mavenSettings: 'Maven Settings File Path',
+ mavenRepository: 'Maven Central Repository',
+ mavenUser: 'Maven Central Repository Auth User',
+ mavenPassword: 'Maven Central Repository Auth Password',
+ docker: 'Docker Setting',
+ email: 'Alert Mailbox Setting',
+ ingress: 'Ingress domain address Setting',
+ },
+ desc: {
+ mavenSettings: 'Specify the full path to the local maven settings.xml',
+ mavenRepository: 'Maven central repository, Specify a repository address for maven.',
+ mavenUser: 'Maven central repository authentication username',
+ mavenPassword: 'Maven central repository authentication password',
+ docker: 'Docker container service settings',
+ email: 'Alert Mailbox settings used to sent alert email',
+ ingress: 'Automatically generate an nginx-based ingress by passing in a domain name',
+ },
+ docker: {
+ address: {
+ label: 'Docker Address',
+ desc: 'Docker container service address',
+ },
+ namespace: {
+ label: 'Docker namespace',
+ desc: 'Namespace for docker image used in docker building env and target image register',
+ },
+ userName: {
+ label: 'Docker Username',
+ desc: 'Docker container service authentication username',
+ },
+ password: {
+ label: 'Docker Password',
+ desc: 'Docker container service authentication password',
+ },
+ },
+ email: {
+ host: {
+ label: 'Smtp Host',
+ desc: 'Alert Mailbox Smtp Host',
+ },
+ port: {
+ label: 'Smtp Port',
+ desc: 'Smtp Port of the mailbox',
+ },
+ from: {
+ label: 'Email Address',
+ desc: 'Your email address used to send alert email',
+ },
+ userName: {
+ label: 'Email Username',
+ desc: 'Authentication username used to send email,generally: your email address',
+ },
+ password: {
+ label: 'Email Password',
+ desc: 'Authentication password used to send alert email',
+ },
+ ssl: {
+ label: 'SSL enable',
+ desc: 'Whether to enable SSL in the mailbox that sends the alert',
+ },
},
};
diff --git a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/system.ts b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/system.ts
index 03c138c8e..b1e5232aa 100644
--- a/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/system.ts
+++ b/streampark-console/streampark-console-webapp/src/locales/lang/zh-CN/setting/system.ts
@@ -18,10 +18,10 @@ export default {
systemSetting: '系统设置',
systemSettingItems: {
mavenSetting: {
- name: 'Maven配置',
+ name: 'Maven 配置',
},
dockerSetting: {
- name: 'Docker环境配置',
+ name: 'Docker 环境配置',
},
emailSetting: {
name: '邮箱配置',
@@ -35,5 +35,68 @@ export default {
},
update: {
success: '设置更新成功!',
+ dockerNotStart: '依赖你本地的Docker服务,请确保本地Docker已启动. 🙂',
+ },
+ title: {
+ mavenSettings: 'Maven Settings 文件路径',
+ mavenRepository: 'Maven 仓库',
+ mavenUser: 'Maven 仓库访问用户',
+ mavenPassword: 'Maven 仓库访问密码',
+ docker: 'Docker 容器服务设置',
+ email: '告警邮箱设置',
+ ingress: 'Ingress 域名设置',
+ },
+ desc: {
+ mavenSettings: '指定本地 maven 的 settings.xml 文件完成路径',
+ mavenRepository: '设置 maven 的仓库地址,可以是 maven 私服的地址或者阿里云等 maven 私服地址',
+ mavenUser: '访问 maven 私服所需的认证用户名(如需要)',
+ mavenPassword: '访问 maven 私服所需的认证密码(如需要)',
+ docker: '设置 docker 容器服务的注册信息',
+ email: '设置用于发送告警的 email 发送者信息',
+ ingress: 'ingress 设置,通过传入域名自动生成基于 nginx 的 ingress',
+ },
+ docker: {
+ address: {
+ label: 'Docker 地址',
+ desc: 'Docker 容器的服务地址',
+ },
+ namespace: {
+ label: 'Docker 命名空间',
+ desc: 'Docker 构建环境和目标镜像注册使用的命名空间',
+ },
+ userName: {
+ label: 'Docker 用户名',
+ desc: 'Docker 容器服务认证用户名',
+ },
+ password: {
+ label: 'Docker 密码',
+ desc: 'Docker 容器服务认证密码',
+ },
+ },
+ email: {
+ host: {
+ label: '发送邮件服务器',
+ desc: '发送告警邮件的服务器 Smtp 主机',
+ },
+ port: {
+ label: '发送邮件Smtp端口',
+ desc: '告警邮箱 Smtp端口',
+ },
+ userName: {
+ label: '邮箱用户名',
+ desc: '发送告警邮件的用户名,一般是你的邮箱地址',
+ },
+ password: {
+ label: '邮箱密码',
+ desc: '用于发送告警邮件的认证密码',
+ },
+ from: {
+ label: '邮箱地址',
+ desc: '用于发送告警的邮箱',
+ },
+ ssl: {
+ label: '开启 SSL',
+ desc: '是否在发送告警邮箱中启用 SSL',
+ },
},
};
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/Alarm/View.vue b/streampark-console/streampark-console-webapp/src/views/setting/alarm/View.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/Alarm/View.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/alarm/View.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/AlertModal.vue b/streampark-console/streampark-console-webapp/src/views/setting/alarm/components/AlertModal.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/AlertModal.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/alarm/components/AlertModal.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/AlertTypeInfo.vue b/streampark-console/streampark-console-webapp/src/views/setting/alarm/components/AlertTypeInfo.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/AlertTypeInfo.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/alarm/components/AlertTypeInfo.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/DetailModal.vue b/streampark-console/streampark-console-webapp/src/views/setting/alarm/components/DetailModal.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/DetailModal.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/alarm/components/DetailModal.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/index.data.ts b/streampark-console/streampark-console-webapp/src/views/setting/alarm/components/index.data.ts
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/index.data.ts
rename to streampark-console/streampark-console-webapp/src/views/setting/alarm/components/index.data.ts
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/index.ts b/streampark-console/streampark-console-webapp/src/views/setting/alarm/components/index.ts
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/Alarm/components/index.ts
rename to streampark-console/streampark-console-webapp/src/views/setting/alarm/components/index.ts
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/system/SettingForm.vue b/streampark-console/streampark-console-webapp/src/views/setting/system/SettingForm.vue
new file mode 100644
index 000000000..62a859f99
--- /dev/null
+++ b/streampark-console/streampark-console-webapp/src/views/setting/system/SettingForm.vue
@@ -0,0 +1,168 @@
+<!--
+ 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.
+-->
+<script setup lang="ts">
+ import { computed, ref } from 'vue';
+ import { BasicForm, FormSchema, useForm } from '/@/components/Form';
+ import { BasicModal, useModalInner } from '/@/components/Modal';
+ import {
+ fetchEmailConfig,
+ fetchEmailUpdate,
+ fetchDockerConfig,
+ fetchDockerUpdate,
+ fetchVerifyDocker,
+ fetchVerifyEmail,
+ } from '/@/api/setting';
+ import { useMessage } from '/@/hooks/web/useMessage';
+ import { useI18n } from '/@/hooks/web/useI18n';
+ import { isNullOrUnDef } from '/@/utils/is';
+ import { settingFormSchema } from './config';
+ import { SvgIcon } from '/@/components/Icon';
+ import Swal from 'sweetalert2';
+
+ const emit = defineEmits(['success', 'register']);
+ const { createMessage } = useMessage();
+ const { t } = useI18n();
+ defineOptions({ name: 'DockerSetting' });
+
+ const settingConfig = ref<Recordable>({});
+ const type = ref('docker');
+ const title = computed(() => {
+ if (type.value == 'docker') return t('setting.system.systemSettingItems.dockerSetting.name');
+ if (type.value == 'email') return t('setting.system.systemSettingItems.emailSetting.name');
+ return '';
+ });
+ const [registerModal, { closeModal, changeLoading }] = useModalInner(async (data) => {
+ try {
+ changeLoading(true);
+ await resetFields();
+ type.value = data.type;
+
+ if (data.type === 'docker') {
+ settingConfig.value = await fetchDockerConfig();
+ } else if (data.type === 'email') {
+ settingConfig.value = await fetchEmailConfig();
+ }
+
+ await setFieldsValue(
+ Object.keys(settingConfig.value).reduce((pre, cur) => {
+ if (!isNullOrUnDef(settingConfig.value[cur])) pre[cur] = settingConfig.value[cur];
+ return pre;
+ }, {}),
+ );
+ } catch (error) {
+ console.error(error);
+ } finally {
+ changeLoading(false);
+ }
+ });
+ const [registerForm, { validate, setFieldsValue, resetFields }] = useForm({
+ colon: true,
+ labelWidth: 140,
+ name: 'SettingForm',
+ labelCol: { span: 8 },
+ wrapperCol: { span: 14 },
+ baseColProps: { span: 24 },
+ showActionButtonGroup: false,
+ });
+ const formSchemas = computed((): FormSchema[] => {
+ if (Reflect.has(settingFormSchema, type.value)) {
+ return settingFormSchema[type.value];
+ }
+ return Object.keys(settingConfig.value).map((key) => {
+ return {
+ field: key,
+ label: key,
+ component: 'Input',
+ };
+ });
+ });
+ async function handleOk() {
+ try {
+ const formData = await validate();
+ if (type.value === 'docker') {
+ const resp = await fetchVerifyDocker(formData);
+ switch (resp.status) {
+ case 200:
+ await fetchDockerUpdate(formData);
+ break;
+ case 400:
+ Swal.fire({
+ icon: 'error',
+ title: t('setting.system.update.dockerNotStart'),
+ showConfirmButton: true,
+ timer: 3500,
+ });
+ return;
+ case 500:
+ Swal.fire({
+ icon: 'error',
+ title: resp.msg,
+ showConfirmButton: true,
+ timer: 3500,
+ });
+ return;
+ default:
+ break;
+ }
+ }
+ if (type.value === 'email') {
+ const resp = await fetchVerifyEmail(formData);
+ if (resp.status === 200) {
+ await fetchEmailUpdate(formData);
+ } else {
+ Swal.fire({
+ icon: 'error',
+ title: resp.msg,
+ showConfirmButton: true,
+ timer: 3500,
+ });
+ return;
+ }
+ }
+ Swal.fire({
+ icon: 'success',
+ title: t('setting.system.update.success'),
+ showConfirmButton: false,
+ timer: 2000,
+ });
+ closeModal();
+ emit('success');
+ } catch (error) {
+ console.error(error);
+ }
+ }
+ async function afterClose() {
+ settingConfig.value = [];
+ }
+</script>
+
+<template>
+ <BasicModal
+ @register="registerModal"
+ :width="650"
+ @ok="handleOk"
+ :after-close="afterClose"
+ centered
+ >
+ <template #title>
+ <SvgIcon v-if="type === 'docker'" name="docker" size="20" class="ml-10px" />
+ <SvgIcon v-if="type === 'email'" name="mail" size="18" class="ml-10px" />
+ {{ title }}
+ </template>
+ <BasicForm @register="registerForm" :schemas="formSchemas" style="margin-top: 30px" />
+ </BasicModal>
+</template>
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/System/SettingList.vue b/streampark-console/streampark-console-webapp/src/views/setting/system/SettingList.vue
similarity index 64%
rename from streampark-console/streampark-console-webapp/src/views/setting/System/SettingList.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/system/SettingList.vue
index f510b09fb..1d67ccf7c 100644
--- a/streampark-console/streampark-console-webapp/src/views/setting/System/SettingList.vue
+++ b/streampark-console/streampark-console-webapp/src/views/setting/system/SettingList.vue
@@ -16,6 +16,7 @@
-->
<script lang="ts">
import { defineComponent } from 'vue';
+ import { useModal } from '/@/components/Modal';
export default defineComponent({
name: 'MavenSetting',
});
@@ -27,29 +28,43 @@
import { fetchSystemSettingUpdate } from '/@/api/setting';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
+ import SettingForm from './SettingForm.vue';
+
+ const { t } = useI18n();
const AvatarMap = {
- 'streampark.maven.settings': 'settings',
+ 'streampark.maven.settings': 'settings2',
'streampark.maven.central.repository': 'maven',
'streampark.maven.auth.user': 'user',
'streampark.maven.auth.password': 'mvnpass',
'docker.register.address': 'docker',
- 'docker.register.namespace': 'namespace',
- 'docker.register.user': 'auth',
- 'docker.register.password': 'password',
- 'alert.email.host': 'host',
- 'alert.email.port': 'port',
'alert.email.from': 'mail',
- 'alert.email.userName': 'user',
- 'alert.email.password': 'keys',
- 'alert.email.ssl': 'ssl',
- 'ingress.mode.default': 'settings',
+ 'ingress.mode.default': 'nginx',
+ };
+
+ const settingTitles = {
+ 'streampark.maven.settings': t('setting.system.title.mavenSettings'),
+ 'streampark.maven.central.repository': t('setting.system.title.mavenRepository'),
+ 'streampark.maven.auth.user': t('setting.system.title.mavenUser'),
+ 'streampark.maven.auth.password': t('setting.system.title.mavenPassword'),
+ 'docker.register.address': t('setting.system.title.docker'),
+ 'alert.email.from': t('setting.system.title.email'),
+ 'ingress.mode.default': t('setting.system.title.ingress'),
+ };
+
+ const settingDesc = {
+ 'streampark.maven.settings': t('setting.system.desc.mavenSettings'),
+ 'streampark.maven.central.repository': t('setting.system.desc.mavenRepository'),
+ 'streampark.maven.auth.user': t('setting.system.desc.mavenUser'),
+ 'streampark.maven.auth.password': t('setting.system.desc.mavenPassword'),
+ 'docker.register.address': t('setting.system.desc.docker'),
+ 'alert.email.from': t('setting.system.desc.email'),
+ 'ingress.mode.default': t('setting.system.desc.ingress'),
};
const ListItem = List.Item;
const ListItemMeta = ListItem.Meta;
- const { t } = useI18n();
const emits = defineEmits(['updateValue', 'reload']);
defineProps({
data: {
@@ -63,15 +78,26 @@
});
const { createMessage } = useMessage();
+ const [registerModal, { openModal }] = useModal();
function handleSwitch(record: SystemSetting) {
emits('updateValue', record);
}
/* edit input */
function handleEdit(record: SystemSetting) {
- if (!record.editable) {
- record.submitting = true;
+ if (record.settingKey.startsWith('docker.register')) {
+ openModal(true, {
+ type: 'docker',
+ });
+ } else if (record.settingKey.startsWith('alert.email')) {
+ openModal(true, {
+ type: 'email',
+ });
+ } else {
+ if (!record.editable) {
+ record.submitting = true;
+ }
+ record.editable = !record.editable;
}
- record.editable = !record.editable;
}
/* edit commit */
async function handleSubmit(record: SystemSetting) {
@@ -88,9 +114,15 @@
<template>
<List>
- <template v-for="item in data" :key="item.settingKey">
- <ListItem>
- <ListItemMeta :title="item.settingName" :description="item.description" style="width: 50%">
+ <template v-for="item in data">
+ <ListItem v-if="AvatarMap[item.settingKey]" :key="item.settingKey">
+ <ListItemMeta style="width: 50%">
+ <template #title>
+ {{ settingTitles[item.settingKey] }}
+ </template>
+ <template #description>
+ {{ settingDesc[item.settingKey] }}
+ </template>
<template #avatar>
<div class="avatar">
<SvgIcon :name="AvatarMap[item.settingKey]" />
@@ -127,14 +159,19 @@
<template #actions>
<div v-if="item.type === 1" v-auth="'setting:update'">
<a v-if="!item.submitting" @click="handleEdit(item)">
- {{ t('common.edit') }}
+ <a-button type="primary" shape="circle">
+ <SvgIcon name="edit" />
+ </a-button>
</a>
<a v-else @click="handleSubmit(item)">
- {{ t('common.submitText') }}
+ <a-button type="primary" shape="circle">
+ <SvgIcon name="save" />
+ </a-button>
</a>
</div>
</template>
</ListItem>
</template>
</List>
+ <SettingForm @register="registerModal" @success="emits('reload')" />
</template>
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/System/View.vue b/streampark-console/streampark-console-webapp/src/views/setting/system/View.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/System/View.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/system/View.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/system/config.ts b/streampark-console/streampark-console-webapp/src/views/setting/system/config.ts
new file mode 100644
index 000000000..f8aa94850
--- /dev/null
+++ b/streampark-console/streampark-console-webapp/src/views/setting/system/config.ts
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+import { FormSchema } from '/@/components/Form';
+import { useI18n } from '/@/hooks/web/useI18n';
+
+export type SettingType = 'docker' | 'email';
+
+type SettingForm = {
+ [P in SettingType]: FormSchema[];
+};
+
+const { t } = useI18n();
+export const settingFormSchema: SettingForm = {
+ docker: [
+ {
+ field: 'address',
+ label: t('setting.system.docker.address.label'),
+ helpMessage: t('setting.system.docker.address.desc'),
+ component: 'Input',
+ componentProps: {
+ placeholder: t('setting.system.docker.address.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'namespace',
+ label: t('setting.system.docker.namespace.label'),
+ helpMessage: t('setting.system.docker.namespace.desc'),
+ component: 'Input',
+ componentProps: {
+ placeholder: t('setting.system.docker.namespace.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'userName',
+ label: t('setting.system.docker.userName.label'),
+ helpMessage: t('setting.system.docker.userName.desc'),
+ component: 'Input',
+ componentProps: {
+ placeholder: t('setting.system.docker.userName.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'password',
+ label: t('setting.system.docker.password.label'),
+ helpMessage: t('setting.system.docker.password.desc'),
+ component: 'InputPassword',
+ componentProps: {
+ autocomplete: 'new-password',
+ placeholder: t('setting.system.docker.password.label'),
+ },
+ required: true,
+ },
+ ],
+ email: [
+ {
+ field: 'host',
+ label: t('setting.system.email.host.label'),
+ helpMessage: t('setting.system.email.host.desc'),
+ component: 'Input',
+ componentProps: {
+ placeholder: t('setting.system.email.host.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'port',
+ label: t('setting.system.email.port.label'),
+ helpMessage: t('setting.system.email.port.desc'),
+ component: 'InputNumber',
+ componentProps: {
+ class: '!w-full',
+ controls: false,
+ min: 0,
+ max: 65535,
+ placeholder: t('setting.system.email.port.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'from',
+ label: t('setting.system.email.from.label'),
+ helpMessage: t('setting.system.email.from.desc'),
+ component: 'Input',
+ componentProps: {
+ placeholder: t('setting.system.email.from.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'userName',
+ label: t('setting.system.email.userName.label'),
+ helpMessage: t('setting.system.email.userName.desc'),
+ component: 'Input',
+ componentProps: {
+ placeholder: t('setting.system.email.userName.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'password',
+ label: t('setting.system.email.password.label'),
+ helpMessage: t('setting.system.email.password.label'),
+ component: 'InputPassword',
+ componentProps: {
+ autocomplete: 'new-password',
+ placeholder: t('setting.system.email.password.label'),
+ },
+ required: true,
+ },
+ {
+ field: 'ssl',
+ label: t('setting.system.email.ssl.label'),
+ helpMessage: t('setting.system.email.ssl.label'),
+ component: 'Switch',
+ componentProps: {
+ checkedChildren: 'ON',
+ unCheckedChildren: 'OFF',
+ },
+ },
+ ],
+};
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/View.vue b/streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/View.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/View.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/View.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/YarnQueueDrawer.vue b/streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/YarnQueueDrawer.vue
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/YarnQueueDrawer.vue
rename to streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/YarnQueueDrawer.vue
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/index.data.ts b/streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/index.data.ts
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/index.data.ts
rename to streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/index.data.ts
diff --git a/streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/useYarnQueueRender.tsx b/streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/useYarnQueueRender.tsx
similarity index 100%
rename from streampark-console/streampark-console-webapp/src/views/setting/YarnQueue/useYarnQueueRender.tsx
rename to streampark-console/streampark-console-webapp/src/views/setting/yarnqueue/useYarnQueueRender.tsx
(incubator-streampark) 01/02: [Improve] 2.1.3 ddl
Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch sync_2.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
commit d5f792ab110c674b888a6dc4fcf464bd542cf21d
Author: benjobs <be...@gmail.com>
AuthorDate: Wed Mar 13 14:25:38 2024 +0800
[Improve] 2.1.3 ddl
---
.../src/main/assembly/script/data/mysql-data.sql | 3 +-
.../src/main/assembly/script/data/pgsql-data.sql | 1 +
.../main/assembly/script/upgrade/mysql/2.1.2.sql | 27 +++++++++++++
.../main/assembly/script/upgrade/mysql/2.1.3.sql | 46 ++++++++++++++++++++++
.../main/assembly/script/upgrade/pgsql/2.1.2.sql | 19 +++++++++
.../main/assembly/script/upgrade/pgsql/2.1.3.sql | 24 +++++++++++
6 files changed, 119 insertions(+), 1 deletion(-)
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql b/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql
index 5ae06037d..b47810339 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/data/mysql-data.sql
@@ -284,7 +284,8 @@ insert into `t_setting` values (6, 'alert.email.port', null, 'Alert Email Smtp P
insert into `t_setting` values (7, 'alert.email.from', null, 'Alert Sender Email', 'Email to send alerts', 1);
insert into `t_setting` values (8, 'alert.email.userName', null, 'Alert Email User', 'Authentication username used to send alert emails', 1);
insert into `t_setting` values (9, 'alert.email.password', null, 'Alert Email Password', 'Authentication password used to send alarm email', 1);
-insert into `t_setting` values (10, 'alert.email.ssl', 'false', 'Alert Email SSL', 'Whether to enable SSL in the mailbox that sends the alert', 2);insert into `t_setting` values (11, 'docker.register.address', null, 'Docker Register Address', 'Docker container service address', 1);
+insert into `t_setting` values (10, 'alert.email.ssl', 'false', 'Alert Email SSL', 'Whether to enable SSL in the mailbox that sends the alert', 2);
+insert into `t_setting` values (11, 'docker.register.address', null, 'Docker Register Address', 'Docker container service address', 1);
insert into `t_setting` values (12, 'docker.register.user', null, 'Docker Register User', 'Docker container service authentication username', 1);
insert into `t_setting` values (13, 'docker.register.password', null, 'Docker Register Password', 'Docker container service authentication password', 1);
insert into `t_setting` values (14, 'docker.register.namespace', null, 'Docker namespace', 'Namespace for docker image used in docker building env and target image register', 1);
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql b/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql
index 0e5a96462..d9105e592 100644
--- a/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/data/pgsql-data.sql
@@ -255,6 +255,7 @@ insert into "public"."t_setting" values (12, 'docker.register.user', null, 'Dock
insert into "public"."t_setting" values (13, 'docker.register.password', null, 'Docker Register Password', 'Docker container service authentication password', 1);
insert into "public"."t_setting" values (14, 'docker.register.namespace', null, 'Docker namespace', 'Namespace for docker image used in docker building env and target image register', 1);
insert into "public"."t_setting" values (15, 'ingress.mode.default', null, 'Ingress domain address', 'Automatically generate an nginx-based ingress by passing in a domain name', 1);
+
-- ----------------------------
-- Records of t_user
-- ----------------------------
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.2.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.2.sql
new file mode 100644
index 000000000..c0fafc641
--- /dev/null
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.2.sql
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+use streampark;
+
+set names utf8mb4;
+set foreign_key_checks = 0;
+
+alter table `t_flink_app`
+ add column `dependency` text collate utf8mb4_general_ci default null after `main_class`,
+ modify column `modify_time` datetime not null comment 'modify time';
+
+set foreign_key_checks = 1;
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.3.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.3.sql
new file mode 100644
index 000000000..b942363db
--- /dev/null
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.3.sql
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+use streampark;
+
+set names utf8mb4;
+set foreign_key_checks = 0;
+
+update `t_menu` set menu_name='Apache Flink',order_num=1 where menu_id = 120000;
+update `t_menu` set order_num=3 where menu_id = 110000;
+update `t_menu` set order_num=2 where menu_id = 130000;
+delete from `t_menu` where menu_id=110300;
+
+alter table `t_flink_app`
+ modify column `args` longtext,
+ modify column `dynamic_properties` longtext,
+ modify column `k8s_pod_template` longtext,
+ modify column `k8s_jm_pod_template` longtext,
+ modify column `k8s_tm_pod_template` longtext,
+ modify column `options` longtext comment 'json form of parameter collection ',
+ modify column `modify_time` datetime default null comment 'modify time';
+
+alter table `t_flink_cluster`
+ modify column `options` longtext comment 'json form of parameter collection ',
+ modify column `dynamic_properties` longtext comment 'allows specifying multiple generic configuration options',
+ modify column `exception` longtext comment 'exception information';
+
+alter table `t_message` modify column `context` longtext;
+
+alter table `t_flink_project` drop column `git_credential`;
+
+set foreign_key_checks = 1;
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.1.2.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.1.2.sql
new file mode 100644
index 000000000..a87816bf4
--- /dev/null
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.1.2.sql
@@ -0,0 +1,19 @@
+/*
+* 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.
+*/
+
+alter table "public"."t_flink_app"
+ add column "dependency" text collate "pg_catalog"."default";
diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.1.3.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.1.3.sql
new file mode 100644
index 000000000..2f147d89a
--- /dev/null
+++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/pgsql/2.1.3.sql
@@ -0,0 +1,24 @@
+/*
+* 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.
+*/
+
+alter table "public"."t_flink_project"
+ drop column "git_credential";
+
+update "public"."t_menu" set menu_name='Apache Flink',order_num=1 where menu_id = 120000;
+update "public"."t_menu" set order_num=3 where menu_id = 110000;
+update "public"."t_menu" set order_num=2 where menu_id = 130000;
+delete from "public"."t_menu" where menu_id=110300;