From 2c3bbc59747b342b492b91221cde7d365a8323fc Mon Sep 17 00:00:00 2001 From: gaoyan Date: Fri, 22 Nov 2024 16:40:02 +0800 Subject: [PATCH 1/2] add welcom page --- .../aop/TaskOperationPermissionAspect.java | 2 +- .../dinky/controller/SysConfigController.java | 16 + .../org/dinky/service/SysConfigService.java | 15 + .../service/impl/SysConfigServiceImpl.java | 58 ++ .../dinky/service/impl/TaskServiceImpl.java | 4 +- .../java/org/dinky/data/enums/Status.java | 4 + .../dinky/data/model/SystemConfiguration.java | 8 +- .../src/main/java/org/dinky/utils/I18n.java | 3 + .../KubernetesApplicationGateway.java | 4 +- .../org/dinky/gateway/yarn/YarnGateway.java | 2 +- dinky-web/config/routes.ts | 6 + .../src/components/Icons/WelcomIcons.tsx | 803 ++++++++++++++++++ dinky-web/src/locales/en-US.ts | 4 +- dinky-web/src/locales/en-US/welcom.ts | 50 ++ dinky-web/src/locales/zh-CN.ts | 4 +- dinky-web/src/locales/zh-CN/welcom.ts | 50 ++ .../src/pages/Other/Login/LoginForm/index.tsx | 58 +- .../Welcom/WelcomItem/BaseConfigItem.tsx | 56 ++ .../Other/Welcom/WelcomItem/FinishPage.tsx | 17 + .../Welcom/WelcomItem/FlinkConfigItem.tsx | 61 ++ .../Other/Welcom/WelcomItem/WelcomItem.tsx | 66 ++ dinky-web/src/pages/Other/Welcom/index.tsx | 72 ++ dinky-web/src/services/endpoints.tsx | 4 +- dinky-web/src/types/SettingCenter/data.d.ts | 1 + 24 files changed, 1329 insertions(+), 39 deletions(-) create mode 100644 dinky-web/src/components/Icons/WelcomIcons.tsx create mode 100644 dinky-web/src/locales/en-US/welcom.ts create mode 100644 dinky-web/src/locales/zh-CN/welcom.ts create mode 100644 dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx create mode 100644 dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx create mode 100644 dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx create mode 100644 dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx create mode 100644 dinky-web/src/pages/Other/Welcom/index.tsx diff --git a/dinky-admin/src/main/java/org/dinky/aop/TaskOperationPermissionAspect.java b/dinky-admin/src/main/java/org/dinky/aop/TaskOperationPermissionAspect.java index 76411b3851..271d6d7f64 100644 --- a/dinky-admin/src/main/java/org/dinky/aop/TaskOperationPermissionAspect.java +++ b/dinky-admin/src/main/java/org/dinky/aop/TaskOperationPermissionAspect.java @@ -62,7 +62,7 @@ public class TaskOperationPermissionAspect { @Around(value = "@annotation(checkTaskOwner)") public Object processAround(ProceedingJoinPoint joinPoint, CheckTaskOwner checkTaskOwner) throws Throwable { if (!TaskOwnerLockStrategyEnum.ALL.equals( - SystemConfiguration.getInstances().getTaskOwnerLockStrategy()) + SystemConfiguration.getInstances().GetTaskOwnerLockStrategyValue()) && BaseConstant.ADMIN_ID != StpUtil.getLoginIdAsInt()) { Class checkParam = checkTaskOwner.checkParam(); Object param = getParam(joinPoint, checkParam); diff --git a/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java b/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java index f3c9e8dfe9..1a63ecd7df 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java @@ -110,4 +110,20 @@ public Result>> getOneTypeByKey(@RequestParam("type") Stri .collect(Collectors.toList()); return Result.succeed(configList); } + + + @GetMapping("/getNeededCfg") + @ApiOperation("Get Needed Config") + @SaIgnore + public Result> getNeededCfg() { + return sysConfigService.getNeededCfg(); + } + + @PostMapping("/setInitConfig") + @ApiOperation("Get Needed Config") + @SaIgnore + public Result setInitConfig(@RequestBody Map params) { + return sysConfigService.setInitConfig(params); + } + } diff --git a/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java b/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java index 6c2f0203be..68ce40a3a3 100644 --- a/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java +++ b/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java @@ -21,6 +21,7 @@ import org.dinky.data.model.Configuration; import org.dinky.data.model.SysConfig; +import org.dinky.data.result.Result; import org.dinky.mybatis.service.ISuperService; import java.util.List; @@ -64,4 +65,18 @@ public interface SysConfigService extends ISuperService { * @param value The new value of the configuration. */ void updateSysConfigByKv(String key, String value); + + /** + * Get needed configurations. + * + * @return A map of string keys to lists of {@link Configuration} objects. + */ + Result> getNeededCfg(); + + /** + * Set initial configurations. + * + * @param params The parameters for initializing configurations. + */ + Result setInitConfig(Map params); } diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java index 0f538293a2..9c9389e75d 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java @@ -19,10 +19,14 @@ package org.dinky.service.impl; +import cn.dev33.satoken.secure.SaSecureUtil; +import lombok.RequiredArgsConstructor; import org.dinky.context.EngineContextHolder; import org.dinky.data.model.Configuration; import org.dinky.data.model.SysConfig; import org.dinky.data.model.SystemConfiguration; +import org.dinky.data.model.rbac.User; +import org.dinky.data.result.Result; import org.dinky.mapper.SysConfigMapper; import org.dinky.mybatis.service.impl.SuperServiceImpl; import org.dinky.service.SysConfigService; @@ -32,6 +36,8 @@ import java.util.Map; import java.util.stream.Collectors; +import org.dinky.service.UserService; +import org.dinky.utils.TextUtil; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -48,8 +54,11 @@ */ @Service @Slf4j +@RequiredArgsConstructor public class SysConfigServiceImpl extends SuperServiceImpl implements SysConfigService { + private final UserService userService; + @Override public Map>> getAll() { return SystemConfiguration.getInstances().getAllConfiguration(); @@ -121,4 +130,53 @@ public void updateSysConfigByKv(String key, String value) { initExpressionVariables(); } } + + + + @Override + public Result> getNeededCfg() { + Map result = new HashMap<>(); + + SystemConfiguration instances = SystemConfiguration.getInstances(); + + Configuration isFirstSystemIn = instances.getIsFirstSystemIn(); + Configuration ldapEnable = instances.getLdapEnable(); + + result.put(isFirstSystemIn.getKey(), isFirstSystemIn.getValue()); + result.put(ldapEnable.getKey(), ldapEnable.getValue()); + + if (isFirstSystemIn.getValue()) { + result.put(instances.getDinkyAddr().getKey(), instances.getDinkyAddr().getValue()); + result.put(instances.getTaskOwnerLockStrategy().getKey(), instances.getTaskOwnerLockStrategy().getValue()); + result.put(instances.getJobIdWait().getKey(), instances.getJobIdWait().getValue()); + result.put(instances.getUseFlinkHistoryServer().getKey(), instances.getUseFlinkHistoryServer().getValue()); + result.put(instances.getFlinkHistoryServerPort().getKey(), instances.getFlinkHistoryServerPort().getValue()); + } + return Result.succeed(result); + } + + @Override + public Result setInitConfig(Map params) { + SystemConfiguration instances = SystemConfiguration.getInstances(); + Configuration isFirstSystemIn = instances.getIsFirstSystemIn(); + + if (!isFirstSystemIn.getValue()) { + return Result.failed("not first init"); + } + + if (params.containsKey("password")) { + String password = params.remove("password").toString(); + if (!TextUtil.isEmpty(password)) { + User admin = userService.getUserByUsername("admin"); + admin.setPassword(SaSecureUtil.md5(password)); + userService.modifyUser(admin); + } + } + + for (Map.Entry entry : params.entrySet()) { + updateSysConfigByKv(entry.getKey(), entry.getValue().toString()); + } + updateSysConfigByKv(instances.getIsFirstSystemIn().getKey(), String.valueOf(false)); + return Result.succeed(); + } } diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java index a87d3a1d69..a99ee03c3e 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java @@ -1088,10 +1088,10 @@ public List getUserTasks(Integer userId) { private Boolean hasTaskOperatePermission(Integer firstLevelOwner, List secondLevelOwners) { boolean isFirstLevelOwner = firstLevelOwner != null && firstLevelOwner == StpUtil.getLoginIdAsInt(); if (TaskOwnerLockStrategyEnum.OWNER.equals( - SystemConfiguration.getInstances().getTaskOwnerLockStrategy())) { + SystemConfiguration.getInstances().GetTaskOwnerLockStrategyValue())) { return isFirstLevelOwner; } else if (TaskOwnerLockStrategyEnum.OWNER_AND_MAINTAINER.equals( - SystemConfiguration.getInstances().getTaskOwnerLockStrategy())) { + SystemConfiguration.getInstances().GetTaskOwnerLockStrategyValue())) { return isFirstLevelOwner || (secondLevelOwners != null && secondLevelOwners.contains(StpUtil.getLoginIdAsInt())); } diff --git a/dinky-common/src/main/java/org/dinky/data/enums/Status.java b/dinky-common/src/main/java/org/dinky/data/enums/Status.java index e047e8db74..9b0a586a8d 100644 --- a/dinky-common/src/main/java/org/dinky/data/enums/Status.java +++ b/dinky-common/src/main/java/org/dinky/data/enums/Status.java @@ -332,6 +332,10 @@ public enum Status { /** * system config */ + + SYS_GLOBAL_IS_FIRST(99,"sys.global.isFirst"), + + SYS_FLINK_SETTINGS_USERESTAPI(100, "sys.flink.settings.useRestAPI"), SYS_FLINK_SETTINGS_USERESTAPI_NOTE(101, "sys.flink.settings.useRestAPI.note"), SYS_FLINK_SETTINGS_JOBIDWAIT(104, "sys.flink.settings.jobIdWait"), diff --git a/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java b/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java index 5ef4aa6c84..c88e24ae96 100644 --- a/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java +++ b/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java @@ -70,6 +70,10 @@ public static Configuration.OptionBuilder key(Status status) { .map(f -> (Configuration) ReflectUtil.getFieldValue(systemConfiguration, f)) .collect(Collectors.toList()); + private final Configuration isFirstSystemIn = key(Status.SYS_GLOBAL_IS_FIRST) + .booleanType() + .defaultValue(true); + private final Configuration useRestAPI = key(Status.SYS_FLINK_SETTINGS_USERESTAPI) .booleanType() .defaultValue(true) @@ -391,7 +395,7 @@ public boolean isUseRestAPI() { return Asserts.isNull(useRestAPI.getValue()) ? useRestAPI.getDefaultValue() : useRestAPI.getValue(); } - public int getJobIdWait() { + public int GetJobIdWaitValue() { return jobIdWait.getValue(); } @@ -428,7 +432,7 @@ public OssProperties getOssProperties() { .build(); } - public TaskOwnerLockStrategyEnum getTaskOwnerLockStrategy() { + public TaskOwnerLockStrategyEnum GetTaskOwnerLockStrategyValue() { return taskOwnerLockStrategy.getValue(); } diff --git a/dinky-common/src/main/java/org/dinky/utils/I18n.java b/dinky-common/src/main/java/org/dinky/utils/I18n.java index fdc268a630..9d6e7a1918 100644 --- a/dinky-common/src/main/java/org/dinky/utils/I18n.java +++ b/dinky-common/src/main/java/org/dinky/utils/I18n.java @@ -56,6 +56,9 @@ public static void setLocale(Locale l) { public static String getMessage(String key) { ResourceBundle bundle = ResourceBundle.getBundle(MESSAGES_BASE); + if (!bundle.containsKey(key)) { + return key; + } String message = bundle.getString(key); if (!JDK_ABOVE_1_8) { message = new String(message.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java index 3e96aa2e50..3132fea281 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java @@ -201,7 +201,7 @@ public KubernetesResult waitForJmAndJobStart( KubernetesClient kubernetesClient, Deployment deployment, ClusterClientProvider clusterClient) throws InterruptedException { KubernetesResult result = KubernetesResult.build(getType()); - long waitSends = SystemConfiguration.getInstances().getJobIdWait() * 1000L; + long waitSends = SystemConfiguration.getInstances().GetJobIdWaitValue() * 1000L; long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < waitSends) { @@ -262,7 +262,7 @@ public KubernetesResult waitForJmAndJobStartByIngress( KubernetesClient kubernetesClient, Deployment deployment, ClusterClientProvider clusterClient) throws InterruptedException { KubernetesResult result = KubernetesResult.build(getType()); - long waitSends = SystemConfiguration.getInstances().getJobIdWait() * 1000L; + long waitSends = SystemConfiguration.getInstances().GetJobIdWaitValue() * 1000L; long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < waitSends) { diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnGateway.java index 13d69af6ab..d2d820d3ca 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnGateway.java @@ -380,7 +380,7 @@ protected YarnClusterDescriptor createInitYarnClusterDescriptor() { protected String getWebUrl(ClusterClient clusterClient, YarnResult result) throws YarnException, IOException, InterruptedException { String webUrl; - int counts = SystemConfiguration.getInstances().getJobIdWait(); + int counts = SystemConfiguration.getInstances().GetJobIdWaitValue(); while (yarnClient.getApplicationReport(clusterClient.getClusterId()).getYarnApplicationState() == YarnApplicationState.ACCEPTED && counts-- > 0) { diff --git a/dinky-web/config/routes.ts b/dinky-web/config/routes.ts index 9c7b6976bd..c742b829f8 100644 --- a/dinky-web/config/routes.ts +++ b/dinky-web/config/routes.ts @@ -29,6 +29,12 @@ * todo: 如何引入自定义 icon */ export default [ + { + path: '/welcom', + component: './Other/Welcom', + layout: false, + hideInMenu: true + }, { path: '/user', layout: false, diff --git a/dinky-web/src/components/Icons/WelcomIcons.tsx b/dinky-web/src/components/Icons/WelcomIcons.tsx new file mode 100644 index 0000000000..f0696661a8 --- /dev/null +++ b/dinky-web/src/components/Icons/WelcomIcons.tsx @@ -0,0 +1,803 @@ +import Icon from '@ant-design/icons'; + +const defaultSvgSize = '100%'; + +export const Congratulations = (props: {size?:number}) => { + const size = props.size || defaultSvgSize; + return ( + <> + ( + + + + + + + + + + + + + + + + + + + )} + /> + + ); +}; + +export const Magic = (props: {size?:number}) => { + const size = props.size || defaultSvgSize; + return ( + <> + ( + + + + + + + + + + + + + + )} + /> + + ); +}; + +export const WelcomPic1 = (props: {size?:number}) => { + const size = props.size || defaultSvgSize; + return ( + <> + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + /> + + ); +}; diff --git a/dinky-web/src/locales/en-US.ts b/dinky-web/src/locales/en-US.ts index fec5393c05..b3bb6338fe 100644 --- a/dinky-web/src/locales/en-US.ts +++ b/dinky-web/src/locales/en-US.ts @@ -24,6 +24,7 @@ import pwa from './en-US/pwa'; import request from './en-US/request'; import response from './en-US/response'; import shortcutKey from './en-US/shortcutKey'; +import welcom from "@/locales/en-US/welcom"; export default { 'navBar.lang': 'Languages', @@ -37,5 +38,6 @@ export default { ...pages, ...request, ...response, - ...shortcutKey + ...shortcutKey, + ...welcom }; diff --git a/dinky-web/src/locales/en-US/welcom.ts b/dinky-web/src/locales/en-US/welcom.ts new file mode 100644 index 0000000000..366d9b421b --- /dev/null +++ b/dinky-web/src/locales/en-US/welcom.ts @@ -0,0 +1,50 @@ +/* + * + * 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. + * + */ + +export default { + 'welcom.welcom': 'Welcome to Dinky!', + 'welcom.welcom.content': 'A next-generation real-time computing platform that is deeply customized for Apache Flink, providing agile Flink SQL and Flink Jar job development', + 'welcom.welcom.content.tip1': 'This looks like it\'s your first time logging into Dinky', + 'welcom.welcom.content.tip2': 'Don\'t worry, we only need a few simple guides to enjoy the Dinky tour!', + 'welcom.welcom.setPwd.tip': 'Set the admin password', + 'welcom.welcom.setPwd': 'Set the password', + 'welcom.welcom.skip': 'Skip this step', + + 'welcom.next': 'Next', + 'welcom.prev': 'Previous', + 'welcom.submit': 'Submit', + 'welcom.finish.title': 'Init Finished!', + 'welcom.finish': 'Start your Dinky journey today!', + + 'welcom.goLogin': 'Go Login!', + 'welcom.base.config.title': 'Base Config', + 'welcom.base.config.dinky.url.title': 'Dinky address:', + 'welcom.base.config.dinky.url': 'Make sure that the external service address of dinky can be accessed in the k8s or yarn cluster, otherwise the status of the application task may not be monitored', + 'welcom.tips': 'If you are still unsure about how to enter the parameters, don\'t worry, leave them as default, and you can go to the configuration center at any time to modify them', + 'welcom.base.config.taskowner.title': 'Task owner type:', + 'welcom.base.config.taskowner': 'When [OWNER] is selected, only the job owner can operate the job, and no other user can operate the modify job,\\n When [OWNER_AND_MAINTAINER] is selected,\\n Both the job owner and the maintainer can operate the modification job, and when [ALL] is selected, everyone can operate the modification job, which is [ALL] by default.', + + 'welcom.flink.config.title': 'Flink Config', + 'welcom.flink.config.jobwait.title': 'Job wait time:', + 'welcom.flink.config.jobwait': 'The maximum wait time (seconds) to get the Job ID\\n when submitting an Application or PerJob task, and if the job is submitted slowly, you need to increase this value', + 'welcom.flink.config.useHistoryServer.title': 'Use Flink History Server:', + 'welcom.flink.config.useHistoryServer': 'This feature will have a built-in Flink History Server in Dinky, which is used to query the history of Flink tasks, so that Flink tasks can reduce the UNKNOWN status and input the last status information of Flink tasks', + 'welcom.flink.config.historyPort.title' : 'Flink History Server Port:', + 'welcom.flink.config.historyPort' : 'The built-in Flink History Server port, for example, 8082, ensures that the port is not occupied', +}; diff --git a/dinky-web/src/locales/zh-CN.ts b/dinky-web/src/locales/zh-CN.ts index ccfa1c8060..0bfa8c4c85 100644 --- a/dinky-web/src/locales/zh-CN.ts +++ b/dinky-web/src/locales/zh-CN.ts @@ -24,6 +24,7 @@ import pwa from './zh-CN/pwa'; import request from './zh-CN/request'; import response from './zh-CN/response'; import shortcutKey from './zh-CN/shortcutKey'; +import welcom from "@/locales/zh-CN/welcom"; export default { 'navBar.lang': '语言', @@ -37,5 +38,6 @@ export default { ...pwa, ...request, ...response, - ...shortcutKey + ...shortcutKey, + ...welcom, }; diff --git a/dinky-web/src/locales/zh-CN/welcom.ts b/dinky-web/src/locales/zh-CN/welcom.ts new file mode 100644 index 0000000000..b3e484d164 --- /dev/null +++ b/dinky-web/src/locales/zh-CN/welcom.ts @@ -0,0 +1,50 @@ +/* + * + * 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. + * + */ + +export default { + 'welcom.welcom': '欢迎来到Dinky!', + 'welcom.welcom.content': '为 Apache Flink 深度定制的新一代实时计算平台,提供敏捷的 Flink SQL, Flink Jar 作业开发、\n 部署及监控能力,助力实时计算高效应用。', + 'welcom.welcom.content.tip1': '这看起来好像是你第一次登入Dinky', + 'welcom.welcom.content.tip2': '别担心,我们只需要几步简单的向导即可畅享Dinky之旅!', + 'welcom.welcom.setPwd.tip': '设置admin密码:', + 'welcom.welcom.setPwd': '设置密码', + 'welcom.welcom.skip': '跳过此步骤', + + 'welcom.next': '下一步', + 'welcom.prev': '上一步', + 'welcom.submit': '提交', + 'welcom.finish.title': '初始化完成!', + 'welcom.finish': '立即开始你的Dinky之旅吧!', + + 'welcom.goLogin': '去登陆!', + 'welcom.base.config.title': '基本配置', + 'welcom.base.config.dinky.url.title': 'Dinky地址:', + 'welcom.base.config.dinky.url': 'dinky对外服务地址,请确保k8s或yarn集群内可以正常访问此地址,否则对于Application任务可能会无法正常监控状态', + 'welcom.tips': '如果您还不清楚参数如何填写,不要担心,保持默认,后续可以随时前往配置中心进行修改', + 'welcom.base.config.taskowner.title': '作业责任人锁机制:', + 'welcom.base.config.taskowner': '当选择[OWNER]时,只有作业责任人才能操作作业,其他用户无法操作/修改作业,\n 当选择[OWNER_AND_MAINTAINER]时,\n 作业责任人和维护人都可以操作/修改作业, 当选择[ALL]时,所有人都可以操作/修改作业, 默认为[ALL]', + + 'welcom.flink.config.title': 'Flink配置', + 'welcom.flink.config.jobwait.title': 'Job 提交等待时间:', + 'welcom.flink.config.jobwait': '提交 Application 或 PerJob 任务时获取 Job ID\n 的最大等待时间(秒),如果作业提交较慢,需要增大此数值', + 'welcom.flink.config.useHistoryServer.title': '使用内置 Flink History Server:', + 'welcom.flink.config.useHistoryServer': '此功能会在 Dinky 里面内置一个Flink History Server ,作用于 Flink 任务的历史查询,\n 使 Flink 任务减少 UNKNOWN 状态的情况,并打入 Flink 任务最后的状态信息', + 'welcom.flink.config.historyPort.title' : 'Flink History Server 端口:', + 'welcom.flink.config.historyPort' : '内置Flink History Server 端口,例如:8082,确保端口没有被占用', +}; diff --git a/dinky-web/src/pages/Other/Login/LoginForm/index.tsx b/dinky-web/src/pages/Other/Login/LoginForm/index.tsx index 8b05465ab6..4459246c1e 100644 --- a/dinky-web/src/pages/Other/Login/LoginForm/index.tsx +++ b/dinky-web/src/pages/Other/Login/LoginForm/index.tsx @@ -17,39 +17,41 @@ * */ -import { getData } from '@/services/api'; -import { API_CONSTANTS } from '@/services/endpoints'; -import { l } from '@/utils/intl'; -import { GithubOutlined, LockOutlined, UserOutlined } from '@ant-design/icons'; -import { DefaultFooter, ProForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components'; -import { SubmitterProps } from '@ant-design/pro-form/es/components'; -import { Col, Flex, Row } from 'antd'; -import React, { useEffect, useState } from 'react'; +import {API_CONSTANTS} from '@/services/endpoints'; +import {l} from '@/utils/intl'; +import {GithubOutlined, LockOutlined, UserOutlined} from '@ant-design/icons'; +import {DefaultFooter, ProForm, ProFormCheckbox, ProFormText} from '@ant-design/pro-components'; +import {SubmitterProps} from '@ant-design/pro-form/es/components'; +import {Col, Flex, Row} from 'antd'; +import React, {useState} from 'react'; import style from '../../../../global.less'; import Lottie from 'react-lottie'; import DataPlatform from '../../../../../public/login_animation.json'; +import {useRequest} from "@@/exports"; +import {history} from "@umijs/max"; +import {GLOBAL_SETTING_KEYS} from '@/types/SettingCenter/data.d'; type LoginFormProps = { onSubmit: (values: any) => Promise; }; const LoginForm: React.FC = (props) => { - const { onSubmit } = props; + const {onSubmit} = props; const [form] = ProForm.useForm(); const [submitting, setSubmitting] = useState(false); const [ldapEnabled, setLdapEnabled] = useState(false); - useEffect(() => { - getData(API_CONSTANTS.GET_LDAP_ENABLE).then( - (res) => { - setLdapEnabled(res.data); - form.setFieldValue('ldapLogin', res.data); - }, - (err) => console.error(err) - ); - }, []); + useRequest(API_CONSTANTS.GET_NEEDED_CFG, { + onSuccess: (res) => { + if (res[GLOBAL_SETTING_KEYS.SYS_GLOBAL_ISFIRST]) { + history.push('/welcom'); + } + setLdapEnabled(res[GLOBAL_SETTING_KEYS.SYS_LDAP_SETTINGS_ENABLE]); + form.setFieldValue('ldapLogin', res[GLOBAL_SETTING_KEYS.SYS_LDAP_SETTINGS_ENABLE]); + } + }); const handleClickLogin = async () => { setSubmitting(true); @@ -138,7 +140,7 @@ const LoginForm: React.FC = (props) => { }} > = (props) => { xxl={8} > - {''} -

{l('layouts.userLayout.title')}

+ {''}/ +

{l('layouts.userLayout.title')}

{renderLoginForm()} = (props) => { }, { key: 'github', - title: , + title: , href: 'https://github.com/DataLinkDC/dinky', blankTarget: true } @@ -195,7 +197,7 @@ const LoginForm: React.FC = (props) => { height: '100%' }} > - + = (props) => { src={'./icons/footer-bg.svg'} width={'100%'} alt={''} - style={{ position: 'absolute', bottom: 0 }} + style={{position: 'absolute', bottom: 0}} /> ); diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx new file mode 100644 index 0000000000..21405a933a --- /dev/null +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx @@ -0,0 +1,56 @@ +import {Button, Flex, Input, Radio, Space, Typography} from "antd"; + +import {WelcomPic1} from "@/components/Icons/WelcomIcons"; +import FormItem from "antd/es/form/FormItem"; +import {WelcomProps} from "@/pages/Other/Welcom"; +import {l} from "@/utils/intl"; + +const {Title, Text, Link} = Typography; + +const BaseConfigItem = (prop: WelcomProps) => { + + return ( + +
+ + {l('welcom.base.config.title')} + +
+ {l('welcom.tips')} +
+
+ + + {l('welcom.base.config.dinky.url')} + + + + + + + {l('welcom.base.config.taskowner')} + +
+ + + OWNER + OWNER_AND_MAINTAINER + ALL + + +
+ + {l('welcom.prev')} +
+ +
+ ) +} +export default BaseConfigItem; diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx new file mode 100644 index 0000000000..a8cc7f1c04 --- /dev/null +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx @@ -0,0 +1,17 @@ +import {Button, Result} from "antd"; +import {l} from "@/utils/intl"; + +const FinishPage = () => { + + return window.location.href = '/login'}> + {l('welcom.goLogin')} + , + ]} + /> +} +export default FinishPage diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx new file mode 100644 index 0000000000..7418e7190b --- /dev/null +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx @@ -0,0 +1,61 @@ +import {Flex, Input, Space, Switch, Typography} from "antd"; + +import {WelcomPic1} from "@/components/Icons/WelcomIcons"; +import FormItem from "antd/es/form/FormItem"; +import {WelcomProps} from "@/pages/Other/Welcom"; +import {LoadingBtn} from "@/components/CallBackButton/LoadingBtn"; +import {l} from "@/utils/intl"; + +const {Title, Text, Link} = Typography; + +const FlinkConfigItem = (prop: WelcomProps) => { + + return ( + +
+ + {l('welcom.flink.config.title')} + +
+ {l('welcom.tips')} +
+
+ + + {l('welcom.flink.config.jobwait')} + + + + + + + {l('welcom.flink.config.useHistoryServer')} +
+ + + +
+ + + {l('welcom.flink.config.historyPort')} + + + + + + await prop.onSubmit?.()} + /> + + {l('welcom.prev')} +
+ +
+ ) +} +export default FlinkConfigItem; diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx new file mode 100644 index 0000000000..83cf85e7e8 --- /dev/null +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx @@ -0,0 +1,66 @@ +import {Button, Flex, Input, Space, Typography} from "antd"; +import {Congratulations, WelcomPic1} from "@/components/Icons/WelcomIcons"; +import FormItem from "antd/es/form/FormItem"; +import {WelcomProps} from "@/pages/Other/Welcom"; +import {l} from "@/utils/intl"; + +const {Title, Text, Link} = Typography; + + +const WelcomItem = (prop: WelcomProps) => { + + return ( + +
+ + + {l('welcom.welcom')} + +
+ + {l('welcom.welcom.content')} + +
+
+ + {l('welcom.welcom.content.tip1')} + +
+ + {l('welcom.welcom.content.tip2')} + + + {l('welcom.welcom.setPwd.tip')} + + + + + + + prop.onNext()}>{l('welcom.welcom.skip')} + +
+ +
+ ) +} +export default WelcomItem; diff --git a/dinky-web/src/pages/Other/Welcom/index.tsx b/dinky-web/src/pages/Other/Welcom/index.tsx new file mode 100644 index 0000000000..ed482cee11 --- /dev/null +++ b/dinky-web/src/pages/Other/Welcom/index.tsx @@ -0,0 +1,72 @@ +import {Flex, Form} from "antd"; +import {useState} from "react"; +import WelcomItem from "@/pages/Other/Welcom/WelcomItem/WelcomItem"; +import BaseConfigItem from "@/pages/Other/Welcom/WelcomItem/BaseConfigItem"; +import FlinkConfigItem from "@/pages/Other/Welcom/WelcomItem/FlinkConfigItem"; +import FinishPage from "@/pages/Other/Welcom/WelcomItem/FinishPage"; +import {log} from "@antv/g6/lib/utils/scale"; +import {history, useRequest} from "@@/exports"; +import {API_CONSTANTS} from "@/services/endpoints"; +import {GLOBAL_SETTING_KEYS} from "@/types/SettingCenter/data"; +import {postAll} from "@/services/api"; +import {sleep} from "@antfu/utils"; + +const boxStyle: React.CSSProperties = { + width: '100%', + height: '100%', + borderRadius: 6, +}; + +export type WelcomProps = { + onNext: () => void + onPrev: () => void + onSubmit?: () => void +} + +const Welcom = () => { + + const [form] = Form.useForm(); + const [formData, setFormData] = useState({}); + const [current, setCurrent] = useState(0); + + const {data,loading} = useRequest(API_CONSTANTS.GET_NEEDED_CFG); + + const setCfgReq = useRequest((params)=>postAll(API_CONSTANTS.SET_INIT_CFG,params),{manual: true}) + + const next = () => { + setFormData((prev)=>{ + return {...prev,...form.getFieldsValue()} + }) + setCurrent(current + 1); + } + const prev = () => { + setCurrent(current - 1); + } + + const submit = async () => { + const data = {...formData, ...form.getFieldsValue()} + await setCfgReq.run(data) + next() + } + + return ( + +
+ {loading?
loading
: +
+ {current == 0 && } + {current == 1 && } + {current == 2 && } + {current == 3 && } + } + +
+
+ ) +} + +export default Welcom; diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index b42731dbd5..33c4d60293 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -176,6 +176,9 @@ export enum API_CONSTANTS { /** -------------------------------------------- setting center ------------------------------------------------ */ // ------------------------------------ system settings ------------------------------------ + GET_NEEDED_CFG = '/api/sysConfig/getNeededCfg', + SET_INIT_CFG = '/api/sysConfig/setInitConfig', + SYSTEM_GET_ALL_CONFIG = '/api/sysConfig/getAll', SYSTEM_GET_ONE_TYPE_CONFIG = '/api/sysConfig/getConfigByType', SYSTEM_MODIFY_CONFIG = '/api/sysConfig/modifyConfig', @@ -225,7 +228,6 @@ export enum API_CONSTANTS { ALERT_HISTORY_DELETE = '/api/alertHistory/delete', // ----------------------------------------- ldap ------------------------------------ - GET_LDAP_ENABLE = '/api/ldap/ldapEnableStatus', LDAP_TEST_CONNECT = '/api/ldap/testConnection', LDAP_TEST_LOGIN = '/api/ldap/testLogin', LDAP_LIST_USER = '/api/ldap/listUser', diff --git a/dinky-web/src/types/SettingCenter/data.d.ts b/dinky-web/src/types/SettingCenter/data.d.ts index 634dc55858..5f2f2c7701 100644 --- a/dinky-web/src/types/SettingCenter/data.d.ts +++ b/dinky-web/src/types/SettingCenter/data.d.ts @@ -112,6 +112,7 @@ export enum TaskOwnerLockingStrategy { * 全局配置所有的 key */ export enum GLOBAL_SETTING_KEYS { + SYS_GLOBAL_ISFIRST = 'sys.global.isFirst', SYS_FLINK_SETTINGS_USE_REST_API = 'sys.flink.settings.useRestAPI', SYS_FLINK_SETTINGS_JOB_ID_WAIT = 'sys.flink.settings.jobIdWait', SYS_MAVEN_SETTINGS_SETTINGS_FILE_PATH = 'sys.maven.settings.settingsFilePath', From f724e63d49d483539e80e5239c4a56872c9aaf34 Mon Sep 17 00:00:00 2001 From: gaoyan1998 Date: Fri, 22 Nov 2024 08:42:07 +0000 Subject: [PATCH 2/2] Spotless Apply --- .../dinky/controller/SysConfigController.java | 6 +- .../org/dinky/service/SysConfigService.java | 4 +- .../service/impl/SysConfigServiceImpl.java | 28 +- .../java/org/dinky/data/enums/Status.java | 4 +- .../dinky/data/model/SystemConfiguration.java | 5 +- .../src/components/Icons/WelcomIcons.tsx | 3100 +++++++++++++---- dinky-web/src/locales/en-US.ts | 2 +- dinky-web/src/locales/en-US/welcom.ts | 28 +- dinky-web/src/locales/zh-CN.ts | 4 +- dinky-web/src/locales/zh-CN/welcom.ts | 19 +- .../src/pages/Other/Login/LoginForm/index.tsx | 42 +- .../Welcom/WelcomItem/BaseConfigItem.tsx | 70 +- .../Other/Welcom/WelcomItem/FinishPage.tsx | 50 +- .../Welcom/WelcomItem/FlinkConfigItem.tsx | 70 +- .../Other/Welcom/WelcomItem/WelcomItem.tsx | 84 +- dinky-web/src/pages/Other/Welcom/index.tsx | 108 +- 16 files changed, 2674 insertions(+), 950 deletions(-) diff --git a/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java b/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java index 1a63ecd7df..b49e4e780a 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/SysConfigController.java @@ -111,19 +111,17 @@ public Result>> getOneTypeByKey(@RequestParam("type") Stri return Result.succeed(configList); } - @GetMapping("/getNeededCfg") @ApiOperation("Get Needed Config") @SaIgnore - public Result> getNeededCfg() { + public Result> getNeededCfg() { return sysConfigService.getNeededCfg(); } @PostMapping("/setInitConfig") @ApiOperation("Get Needed Config") @SaIgnore - public Result setInitConfig(@RequestBody Map params) { + public Result setInitConfig(@RequestBody Map params) { return sysConfigService.setInitConfig(params); } - } diff --git a/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java b/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java index 68ce40a3a3..ced096202b 100644 --- a/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java +++ b/dinky-admin/src/main/java/org/dinky/service/SysConfigService.java @@ -71,12 +71,12 @@ public interface SysConfigService extends ISuperService { * * @return A map of string keys to lists of {@link Configuration} objects. */ - Result> getNeededCfg(); + Result> getNeededCfg(); /** * Set initial configurations. * * @param params The parameters for initializing configurations. */ - Result setInitConfig(Map params); + Result setInitConfig(Map params); } diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java index 9c9389e75d..1e49cfe31d 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/SysConfigServiceImpl.java @@ -19,8 +19,6 @@ package org.dinky.service.impl; -import cn.dev33.satoken.secure.SaSecureUtil; -import lombok.RequiredArgsConstructor; import org.dinky.context.EngineContextHolder; import org.dinky.data.model.Configuration; import org.dinky.data.model.SysConfig; @@ -30,21 +28,23 @@ import org.dinky.mapper.SysConfigMapper; import org.dinky.mybatis.service.impl.SuperServiceImpl; import org.dinky.service.SysConfigService; +import org.dinky.service.UserService; +import org.dinky.utils.TextUtil; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import org.dinky.service.UserService; -import org.dinky.utils.TextUtil; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.activerecord.Model; +import cn.dev33.satoken.secure.SaSecureUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; /** @@ -131,8 +131,6 @@ public void updateSysConfigByKv(String key, String value) { } } - - @Override public Result> getNeededCfg() { Map result = new HashMap<>(); @@ -146,11 +144,19 @@ public Result> getNeededCfg() { result.put(ldapEnable.getKey(), ldapEnable.getValue()); if (isFirstSystemIn.getValue()) { - result.put(instances.getDinkyAddr().getKey(), instances.getDinkyAddr().getValue()); - result.put(instances.getTaskOwnerLockStrategy().getKey(), instances.getTaskOwnerLockStrategy().getValue()); - result.put(instances.getJobIdWait().getKey(), instances.getJobIdWait().getValue()); - result.put(instances.getUseFlinkHistoryServer().getKey(), instances.getUseFlinkHistoryServer().getValue()); - result.put(instances.getFlinkHistoryServerPort().getKey(), instances.getFlinkHistoryServerPort().getValue()); + result.put( + instances.getDinkyAddr().getKey(), instances.getDinkyAddr().getValue()); + result.put( + instances.getTaskOwnerLockStrategy().getKey(), + instances.getTaskOwnerLockStrategy().getValue()); + result.put( + instances.getJobIdWait().getKey(), instances.getJobIdWait().getValue()); + result.put( + instances.getUseFlinkHistoryServer().getKey(), + instances.getUseFlinkHistoryServer().getValue()); + result.put( + instances.getFlinkHistoryServerPort().getKey(), + instances.getFlinkHistoryServerPort().getValue()); } return Result.succeed(result); } diff --git a/dinky-common/src/main/java/org/dinky/data/enums/Status.java b/dinky-common/src/main/java/org/dinky/data/enums/Status.java index 9b0a586a8d..24f516a9a9 100644 --- a/dinky-common/src/main/java/org/dinky/data/enums/Status.java +++ b/dinky-common/src/main/java/org/dinky/data/enums/Status.java @@ -332,9 +332,7 @@ public enum Status { /** * system config */ - - SYS_GLOBAL_IS_FIRST(99,"sys.global.isFirst"), - + SYS_GLOBAL_IS_FIRST(99, "sys.global.isFirst"), SYS_FLINK_SETTINGS_USERESTAPI(100, "sys.flink.settings.useRestAPI"), SYS_FLINK_SETTINGS_USERESTAPI_NOTE(101, "sys.flink.settings.useRestAPI.note"), diff --git a/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java b/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java index c88e24ae96..85ec79ce52 100644 --- a/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java +++ b/dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java @@ -70,9 +70,8 @@ public static Configuration.OptionBuilder key(Status status) { .map(f -> (Configuration) ReflectUtil.getFieldValue(systemConfiguration, f)) .collect(Collectors.toList()); - private final Configuration isFirstSystemIn = key(Status.SYS_GLOBAL_IS_FIRST) - .booleanType() - .defaultValue(true); + private final Configuration isFirstSystemIn = + key(Status.SYS_GLOBAL_IS_FIRST).booleanType().defaultValue(true); private final Configuration useRestAPI = key(Status.SYS_FLINK_SETTINGS_USERESTAPI) .booleanType() diff --git a/dinky-web/src/components/Icons/WelcomIcons.tsx b/dinky-web/src/components/Icons/WelcomIcons.tsx index f0696661a8..53029e0d14 100644 --- a/dinky-web/src/components/Icons/WelcomIcons.tsx +++ b/dinky-web/src/components/Icons/WelcomIcons.tsx @@ -1,67 +1,113 @@ +/* + * + * 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 Icon from '@ant-design/icons'; const defaultSvgSize = '100%'; -export const Congratulations = (props: {size?:number}) => { +export const Congratulations = (props: { size?: number }) => { const size = props.size || defaultSvgSize; return ( <> ( - + + d='M618.112 198.72m-15.084945-15.084945a21.333333 21.333333 0 1 0 30.16989 30.16989 21.333333 21.333333 0 1 0-30.16989-30.16989Z' + fill='#1A1F23' + p-id='1549' + > + d='M286.421333 280.981333m-15.084944-15.084944a21.333333 21.333333 0 1 0 30.169889 30.169889 21.333333 21.333333 0 1 0-30.169889-30.169889Z' + fill='#1A1F23' + p-id='1550' + > + d='M835.328 415.936m-15.084945-15.084945a21.333333 21.333333 0 1 0 30.16989 30.16989 21.333333 21.333333 0 1 0-30.16989-30.16989Z' + fill='#1A1F23' + p-id='1551' + > + d='M750.250667 744.810667m-15.084945-15.084945a21.333333 21.333333 0 1 0 30.169889 30.169889 21.333333 21.333333 0 1 0-30.169889-30.169889Z' + fill='#1A1F23' + p-id='1552' + > + d='M809.6 227.2l35.818667 21.482667a10.666667 10.666667 0 0 1 0 18.304l-35.797334 21.482666a10.666667 10.666667 0 0 0-3.669333 3.648l-21.482667 35.818667a10.666667 10.666667 0 0 1-18.304 0l-21.461333-35.818667a10.666667 10.666667 0 0 0-3.669333-3.648l-35.797334-21.482666a10.666667 10.666667 0 0 1 0-18.304l35.797334-21.482667a10.666667 10.666667 0 0 0 3.669333-3.648l21.461333-35.797333a10.666667 10.666667 0 0 1 18.304 0l21.482667 35.797333a10.666667 10.666667 0 0 0 3.648 3.648zM442.346667 126.4L465.28 161.28a10.666667 10.666667 0 0 1-7.936 16.469333l-41.6 3.797334a10.666667 10.666667 0 0 0-4.864 1.706666l-34.922667 22.912a10.666667 10.666667 0 0 1-16.469333-7.957333l-3.797333-41.578667a10.666667 10.666667 0 0 0-1.706667-4.885333L331.093333 116.864a10.666667 10.666667 0 0 1 7.936-16.469333l41.6-3.797334a10.666667 10.666667 0 0 0 4.864-1.706666l34.901334-22.912a10.666667 10.666667 0 0 1 16.490666 7.957333l3.776 41.578667c0.170667 1.749333 0.746667 3.413333 1.706667 4.885333zM926.762667 660.650667l-7.808 41.024a10.666667 10.666667 0 0 1-17.173334 6.293333l-32.512-26.197333a10.666667 10.666667 0 0 0-4.693333-2.154667l-41.024-7.829333a10.666667 10.666667 0 0 1-6.293333-17.173334l26.197333-32.512a10.666667 10.666667 0 0 0 2.176-4.693333l7.808-41.002667a10.666667 10.666667 0 0 1 17.173333-6.314666l32.512 26.197333a10.666667 10.666667 0 0 0 4.693334 2.176l41.002666 7.808a10.666667 10.666667 0 0 1 6.314667 17.173333l-26.197333 32.512a10.666667 10.666667 0 0 0-2.176 4.693334zM531.904 741.653333l-212.181333-212.16-141.44 353.6 353.6-141.44z' + fill='#FB1717' + p-id='1553' + > + d='M429.354667 774.826667l10.154666-108.224a10.666667 10.666667 0 0 1 15.552-8.469334l63.957334 33.28a10.666667 10.666667 0 0 1 5.696 10.517334l-6.826667 68.010666a10.666667 10.666667 0 0 1-9.514667 9.557334l-67.306666 6.912a10.666667 10.666667 0 0 1-11.712-11.605334z' + fill='#FB9E17' + p-id='1554' + > + d='M255.914667 876.437333l32-384-42.496-3.541333-32 384 42.496 3.541333z m106.837333-291.626666l-21.333333 245.333333 42.496 3.712 21.333333-245.333333-42.496-3.712zM691.370667 341.802667a21.333333 21.333333 0 0 1 0 30.165333l-196.117334 196.096a21.333333 21.333333 0 0 1-30.165333-30.165333l196.096-196.096a21.333333 21.333333 0 0 1 30.186667 0zM434.346667 224a21.333333 21.333333 0 0 1 27.84 11.605333c28.096 68.202667 28.586667 125.824 15.936 172.117334A226.474667 226.474667 0 0 1 419.84 507.733333a21.333333 21.333333 0 0 1-30.186667-30.165333 183.765333 183.765333 0 0 0 47.317334-81.045333c10.005333-36.672 10.474667-84.650667-14.229334-144.64a21.333333 21.333333 0 0 1 11.605334-27.861334zM799.850667 592.213333a21.333333 21.333333 0 0 0-13.44-27.029333c-128.597333-43.221333-220.224 19.84-262.293334 61.930667a21.333333 21.333333 0 0 0 30.165334 30.165333c36.16-36.16 111.530667-87.616 218.56-51.669333a21.333333 21.333333 0 0 0 27.008-13.418667z' + fill='#1A1F23' + p-id='1555' + > + d='M592.512 246.144a21.333333 21.333333 0 0 1 13.504 26.965333l-30.186667 90.517334a21.333333 21.333333 0 0 1-40.469333-13.482667l30.165333-90.517333a21.333333 21.333333 0 0 1 26.986667-13.482667z m194.517333 194.496a21.333333 21.333333 0 0 1-13.504 26.986667l-90.496 30.165333a21.333333 21.333333 0 0 1-13.504-40.469333l90.517334-30.165334a21.333333 21.333333 0 0 1 26.986666 13.482667zM315.029333 329.109333a21.333333 21.333333 0 0 1 26.986667 13.482667l22.613333 67.882667a21.333333 21.333333 0 1 1-40.448 13.504l-22.634666-67.882667a21.333333 21.333333 0 0 1 13.482666-26.986667z m389.034667 389.013334a21.333333 21.333333 0 0 1-26.986667 13.504l-67.882666-22.634667a21.333333 21.333333 0 1 1 13.482666-40.469333l67.882667 22.613333a21.333333 21.333333 0 0 1 13.504 26.986667z' + fill='#FB9E17' + p-id='1556' + > + d='M618.112 198.72m-15.084945-15.084945a21.333333 21.333333 0 1 0 30.16989 30.16989 21.333333 21.333333 0 1 0-30.16989-30.16989Z' + fill='#1A1F23' + p-id='1557' + > + d='M286.421333 280.981333m-15.084944-15.084944a21.333333 21.333333 0 1 0 30.169889 30.169889 21.333333 21.333333 0 1 0-30.169889-30.169889Z' + fill='#1A1F23' + p-id='1558' + > + d='M835.328 415.936m-15.084945-15.084945a21.333333 21.333333 0 1 0 30.16989 30.16989 21.333333 21.333333 0 1 0-30.16989-30.16989Z' + fill='#1A1F23' + p-id='1559' + > + d='M750.250667 744.810667m-15.084945-15.084945a21.333333 21.333333 0 1 0 30.169889 30.169889 21.333333 21.333333 0 1 0-30.169889-30.169889Z' + fill='#1A1F23' + p-id='1560' + > + d='M809.6 227.2l35.818667 21.482667a10.666667 10.666667 0 0 1 0 18.304l-35.797334 21.482666a10.666667 10.666667 0 0 0-3.669333 3.648l-21.482667 35.818667a10.666667 10.666667 0 0 1-18.304 0l-21.461333-35.818667a10.666667 10.666667 0 0 0-3.669333-3.648l-35.797334-21.482666a10.666667 10.666667 0 0 1 0-18.304l35.797334-21.482667a10.666667 10.666667 0 0 0 3.669333-3.648l21.461333-35.797333a10.666667 10.666667 0 0 1 18.304 0l21.482667 35.797333a10.666667 10.666667 0 0 0 3.648 3.648zM442.346667 126.4L465.28 161.28a10.666667 10.666667 0 0 1-7.936 16.469333l-41.6 3.797334a10.666667 10.666667 0 0 0-4.864 1.706666l-34.922667 22.912a10.666667 10.666667 0 0 1-16.469333-7.957333l-3.797333-41.578667a10.666667 10.666667 0 0 0-1.706667-4.885333L331.093333 116.864a10.666667 10.666667 0 0 1 7.936-16.469333l41.6-3.797334a10.666667 10.666667 0 0 0 4.864-1.706666l34.901334-22.912a10.666667 10.666667 0 0 1 16.490666 7.957333l3.776 41.578667c0.170667 1.749333 0.746667 3.413333 1.706667 4.885333zM926.762667 660.650667l-7.808 41.024a10.666667 10.666667 0 0 1-17.173334 6.293333l-32.512-26.197333a10.666667 10.666667 0 0 0-4.693333-2.154667l-41.024-7.829333a10.666667 10.666667 0 0 1-6.293333-17.173334l26.197333-32.512a10.666667 10.666667 0 0 0 2.176-4.693333l7.808-41.002667a10.666667 10.666667 0 0 1 17.173333-6.314666l32.512 26.197333a10.666667 10.666667 0 0 0 4.693334 2.176l41.002666 7.808a10.666667 10.666667 0 0 1 6.314667 17.173333l-26.197333 32.512a10.666667 10.666667 0 0 0-2.176 4.693334zM531.904 741.653333l-212.181333-212.16-141.44 353.6 353.6-141.44z' + fill='#FB1717' + p-id='1561' + > + d='M429.354667 774.826667l10.154666-108.224a10.666667 10.666667 0 0 1 15.552-8.469334l63.957334 33.28a10.666667 10.666667 0 0 1 5.696 10.517334l-6.826667 68.010666a10.666667 10.666667 0 0 1-9.514667 9.557334l-67.306666 6.912a10.666667 10.666667 0 0 1-11.712-11.605334z' + fill='#FB9E17' + p-id='1562' + > + d='M268.778667 448.426667a21.333333 21.333333 0 0 1 19.370666 5.824l281.6 281.6a21.333333 21.333333 0 0 1-7.168 34.901333l-469.333333 187.733333a21.333333 21.333333 0 0 1-27.733333-27.733333l187.733333-469.333333a21.333333 21.333333 0 0 1 15.530667-12.992z m12.074666 58.88l-157.226666 393.066666 393.066666-157.226666-235.84-235.861334z' + fill='#1A1F23' + p-id='1563' + > + d='M287.914667 492.437333l-32 384-42.517334-3.541333 32-384 42.517334 3.541333z m53.504 337.706667l21.333333-245.333333 42.496 3.712-21.333333 245.333333-42.496-3.712z' + fill='#1A1F23' + p-id='1564' + > )} /> @@ -69,50 +115,68 @@ export const Congratulations = (props: {size?:number}) => { ); }; -export const Magic = (props: {size?:number}) => { +export const Magic = (props: { size?: number }) => { const size = props.size || defaultSvgSize; return ( <> ( - + + d='M1.616842 739.085474l31.258947-50.526316c57.317053 56.212211 97.818947 91.809684 121.45179 106.765474 86.150737 54.514526 124.874105 25.6 163.516632 58.556631 25.761684 21.989053 52.493474 57.128421 80.195368 105.418105l-52.466526 48.397474c-3.341474-28.672-20.911158-58.017684-52.709053-88.037053-47.696842-45.002105-94.396632-21.611789-174.969263-72.784842-53.733053-34.142316-92.483368-70.063158-116.277895-107.789473z' + fill='#FFBABA' + p-id='5130' + > + d='M673.684211 685.460211l18.782315-11.776c7.221895 33.738105 13.069474 56.023579 17.569685 66.883368 16.330105 39.558737 33.441684 37.456842 39.235368 58.394947 3.826526 13.931789 5.578105 32.983579 5.200842 57.128421l-24.872421 6.224842c4.230737-11.398737 4.230737-26.246737 0-44.517052-6.332632-27.405474-24.872421-29.184-40.124632-66.236632-10.159158-24.737684-15.413895-46.753684-15.791157-66.101894z' + fill='#FFD600' + p-id='5131' + > + d='M1680.195368 596.992l-17.623579-16.653474c-16.410947 29.696-28.429474 48.990316-36.082526 57.882948-27.863579 32.498526-46.08 25.492211-57.667368 43.52-7.760842 11.991579-14.443789 29.453474-20.129684 52.331789l25.680842 13.204211c-1.751579-11.991579 1.994105-25.977263 11.210105-41.984 13.850947-23.983158 34.627368-20.183579 60.658526-50.661053 17.381053-20.291368 28.698947-39.504842 33.953684-57.667368zM245.463579 257.643789l22.366316-35.247157c76.907789 124.604632 122.610526 197.793684 137.162105 219.513263 52.924632 79.198316 23.120842 159.258947 46.484211 202.536421 15.575579 28.833684 37.025684 69.793684 64.350315 122.88l-40.097684 12.314947a1031.114105 1031.114105 0 0 0-52.224-126.248421c-28.645053-57.344 1.616842-128.215579-47.912421-202.482526a32714.401684 32714.401684 0 0 0-130.155789-193.266527z' + fill='#A0E3FF' + p-id='5132' + > + d='M970.105263 27.109053L915.833263 0c-4.634947 59.203368-10.832842 97.387789-18.647579 114.553263-40.798316 89.815579-86.474105 115.738947-96.525473 135.168-47.211789 91.082105 41.606737 158.800842 24.926315 206.95579A4869.497263 4869.497263 0 0 0 781.473684 592.842105h52.385684a4566.986105 4566.986105 0 0 0 41.930106-136.165052c18.297263-63.137684-66.533053-121.586526-22.474106-206.95579 19.671579-38.076632 63.811368-55.161263 91.998316-108.705684 9.296842-17.677474 17.569684-55.646316 24.791579-113.906526z' + fill='#D8A0FF' + p-id='5133' + > + d='M1127.558737 408.602947c5.712842 124.281263-34.465684 151.174737-24.441263 199.733895 6.682947 32.363789 16.249263 81.111579 28.672 146.189474h-35.84a1571.301053 1571.301053 0 0 0-16.545685-124.604632c-10.994526-63.649684 42.981053-135.221895 16.518737-221.318737 1.024 0 31.178105-9.889684 31.636211 0z' + fill='#58FF99' + p-id='5134' + > + d='M1431.471158 134.736842H1482.105263c-58.745263 104.286316-81.839158 168.96-69.254737 194.101895 45.864421 91.540211-40.421053 159.582316-24.252631 207.979789 10.832842 32.282947 25.114947 77.877895 42.873263 136.865685h-69.793684c4.230737-34.573474 0.404211-73.027368-11.425685-115.334737-17.785263-63.461053 54.218105-143.710316 11.425685-229.510737-28.537263-57.209263-5.281684-121.909895 69.793684-194.101895z' + fill='#FFD600' + p-id='5135' + > + d='M970.105263 700.631579m-26.947368 0a26.947368 26.947368 0 1 0 53.894737 0 26.947368 26.947368 0 1 0-53.894737 0Z' + fill='#A0E3FF' + p-id='5136' + > + d='M538.947368 323.368421m-26.947368 0a26.947368 26.947368 0 1 0 53.894737 0 26.947368 26.947368 0 1 0-53.894737 0Z' + fill='#FFBABA' + p-id='5137' + > + d='M1239.578947 269.473684m-26.947368 0a26.947368 26.947368 0 1 0 53.894737 0 26.947368 26.947368 0 1 0-53.894737 0Z' + fill='#FFBABA' + p-id='5138' + > + d='M269.473684 673.684211m-26.947368 0a26.947368 26.947368 0 1 0 53.894737 0 26.947368 26.947368 0 1 0-53.894737 0Z' + fill='#58FF99' + p-id='5139' + > + d='M1536 808.421053m-26.947368 0a26.947368 26.947368 0 1 0 53.894736 0 26.947368 26.947368 0 1 0-53.894736 0Z' + fill='#D8A0FF' + p-id='5140' + > )} /> @@ -120,679 +184,2257 @@ export const Magic = (props: {size?:number}) => { ); }; -export const WelcomPic1 = (props: {size?:number}) => { +export const WelcomPic1 = (props: { size?: number }) => { const size = props.size || defaultSvgSize; return ( <> ( - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dinky-web/src/locales/en-US.ts b/dinky-web/src/locales/en-US.ts index b3bb6338fe..e94eb74f5d 100644 --- a/dinky-web/src/locales/en-US.ts +++ b/dinky-web/src/locales/en-US.ts @@ -24,7 +24,7 @@ import pwa from './en-US/pwa'; import request from './en-US/request'; import response from './en-US/response'; import shortcutKey from './en-US/shortcutKey'; -import welcom from "@/locales/en-US/welcom"; +import welcom from '@/locales/en-US/welcom'; export default { 'navBar.lang': 'Languages', diff --git a/dinky-web/src/locales/en-US/welcom.ts b/dinky-web/src/locales/en-US/welcom.ts index 366d9b421b..7a22683c79 100644 --- a/dinky-web/src/locales/en-US/welcom.ts +++ b/dinky-web/src/locales/en-US/welcom.ts @@ -19,9 +19,11 @@ export default { 'welcom.welcom': 'Welcome to Dinky!', - 'welcom.welcom.content': 'A next-generation real-time computing platform that is deeply customized for Apache Flink, providing agile Flink SQL and Flink Jar job development', - 'welcom.welcom.content.tip1': 'This looks like it\'s your first time logging into Dinky', - 'welcom.welcom.content.tip2': 'Don\'t worry, we only need a few simple guides to enjoy the Dinky tour!', + 'welcom.welcom.content': + 'A next-generation real-time computing platform that is deeply customized for Apache Flink, providing agile Flink SQL and Flink Jar job development', + 'welcom.welcom.content.tip1': "This looks like it's your first time logging into Dinky", + 'welcom.welcom.content.tip2': + "Don't worry, we only need a few simple guides to enjoy the Dinky tour!", 'welcom.welcom.setPwd.tip': 'Set the admin password', 'welcom.welcom.setPwd': 'Set the password', 'welcom.welcom.skip': 'Skip this step', @@ -35,16 +37,22 @@ export default { 'welcom.goLogin': 'Go Login!', 'welcom.base.config.title': 'Base Config', 'welcom.base.config.dinky.url.title': 'Dinky address:', - 'welcom.base.config.dinky.url': 'Make sure that the external service address of dinky can be accessed in the k8s or yarn cluster, otherwise the status of the application task may not be monitored', - 'welcom.tips': 'If you are still unsure about how to enter the parameters, don\'t worry, leave them as default, and you can go to the configuration center at any time to modify them', + 'welcom.base.config.dinky.url': + 'Make sure that the external service address of dinky can be accessed in the k8s or yarn cluster, otherwise the status of the application task may not be monitored', + 'welcom.tips': + "If you are still unsure about how to enter the parameters, don't worry, leave them as default, and you can go to the configuration center at any time to modify them", 'welcom.base.config.taskowner.title': 'Task owner type:', - 'welcom.base.config.taskowner': 'When [OWNER] is selected, only the job owner can operate the job, and no other user can operate the modify job,\\n When [OWNER_AND_MAINTAINER] is selected,\\n Both the job owner and the maintainer can operate the modification job, and when [ALL] is selected, everyone can operate the modification job, which is [ALL] by default.', + 'welcom.base.config.taskowner': + 'When [OWNER] is selected, only the job owner can operate the job, and no other user can operate the modify job,\\n When [OWNER_AND_MAINTAINER] is selected,\\n Both the job owner and the maintainer can operate the modification job, and when [ALL] is selected, everyone can operate the modification job, which is [ALL] by default.', 'welcom.flink.config.title': 'Flink Config', 'welcom.flink.config.jobwait.title': 'Job wait time:', - 'welcom.flink.config.jobwait': 'The maximum wait time (seconds) to get the Job ID\\n when submitting an Application or PerJob task, and if the job is submitted slowly, you need to increase this value', + 'welcom.flink.config.jobwait': + 'The maximum wait time (seconds) to get the Job ID\\n when submitting an Application or PerJob task, and if the job is submitted slowly, you need to increase this value', 'welcom.flink.config.useHistoryServer.title': 'Use Flink History Server:', - 'welcom.flink.config.useHistoryServer': 'This feature will have a built-in Flink History Server in Dinky, which is used to query the history of Flink tasks, so that Flink tasks can reduce the UNKNOWN status and input the last status information of Flink tasks', - 'welcom.flink.config.historyPort.title' : 'Flink History Server Port:', - 'welcom.flink.config.historyPort' : 'The built-in Flink History Server port, for example, 8082, ensures that the port is not occupied', + 'welcom.flink.config.useHistoryServer': + 'This feature will have a built-in Flink History Server in Dinky, which is used to query the history of Flink tasks, so that Flink tasks can reduce the UNKNOWN status and input the last status information of Flink tasks', + 'welcom.flink.config.historyPort.title': 'Flink History Server Port:', + 'welcom.flink.config.historyPort': + 'The built-in Flink History Server port, for example, 8082, ensures that the port is not occupied' }; diff --git a/dinky-web/src/locales/zh-CN.ts b/dinky-web/src/locales/zh-CN.ts index 0bfa8c4c85..6c915ec32a 100644 --- a/dinky-web/src/locales/zh-CN.ts +++ b/dinky-web/src/locales/zh-CN.ts @@ -24,7 +24,7 @@ import pwa from './zh-CN/pwa'; import request from './zh-CN/request'; import response from './zh-CN/response'; import shortcutKey from './zh-CN/shortcutKey'; -import welcom from "@/locales/zh-CN/welcom"; +import welcom from '@/locales/zh-CN/welcom'; export default { 'navBar.lang': '语言', @@ -39,5 +39,5 @@ export default { ...request, ...response, ...shortcutKey, - ...welcom, + ...welcom }; diff --git a/dinky-web/src/locales/zh-CN/welcom.ts b/dinky-web/src/locales/zh-CN/welcom.ts index b3e484d164..9ffe555d58 100644 --- a/dinky-web/src/locales/zh-CN/welcom.ts +++ b/dinky-web/src/locales/zh-CN/welcom.ts @@ -19,7 +19,8 @@ export default { 'welcom.welcom': '欢迎来到Dinky!', - 'welcom.welcom.content': '为 Apache Flink 深度定制的新一代实时计算平台,提供敏捷的 Flink SQL, Flink Jar 作业开发、\n 部署及监控能力,助力实时计算高效应用。', + 'welcom.welcom.content': + '为 Apache Flink 深度定制的新一代实时计算平台,提供敏捷的 Flink SQL, Flink Jar 作业开发、\n 部署及监控能力,助力实时计算高效应用。', 'welcom.welcom.content.tip1': '这看起来好像是你第一次登入Dinky', 'welcom.welcom.content.tip2': '别担心,我们只需要几步简单的向导即可畅享Dinky之旅!', 'welcom.welcom.setPwd.tip': '设置admin密码:', @@ -35,16 +36,20 @@ export default { 'welcom.goLogin': '去登陆!', 'welcom.base.config.title': '基本配置', 'welcom.base.config.dinky.url.title': 'Dinky地址:', - 'welcom.base.config.dinky.url': 'dinky对外服务地址,请确保k8s或yarn集群内可以正常访问此地址,否则对于Application任务可能会无法正常监控状态', + 'welcom.base.config.dinky.url': + 'dinky对外服务地址,请确保k8s或yarn集群内可以正常访问此地址,否则对于Application任务可能会无法正常监控状态', 'welcom.tips': '如果您还不清楚参数如何填写,不要担心,保持默认,后续可以随时前往配置中心进行修改', 'welcom.base.config.taskowner.title': '作业责任人锁机制:', - 'welcom.base.config.taskowner': '当选择[OWNER]时,只有作业责任人才能操作作业,其他用户无法操作/修改作业,\n 当选择[OWNER_AND_MAINTAINER]时,\n 作业责任人和维护人都可以操作/修改作业, 当选择[ALL]时,所有人都可以操作/修改作业, 默认为[ALL]', + 'welcom.base.config.taskowner': + '当选择[OWNER]时,只有作业责任人才能操作作业,其他用户无法操作/修改作业,\n 当选择[OWNER_AND_MAINTAINER]时,\n 作业责任人和维护人都可以操作/修改作业, 当选择[ALL]时,所有人都可以操作/修改作业, 默认为[ALL]', 'welcom.flink.config.title': 'Flink配置', 'welcom.flink.config.jobwait.title': 'Job 提交等待时间:', - 'welcom.flink.config.jobwait': '提交 Application 或 PerJob 任务时获取 Job ID\n 的最大等待时间(秒),如果作业提交较慢,需要增大此数值', + 'welcom.flink.config.jobwait': + '提交 Application 或 PerJob 任务时获取 Job ID\n 的最大等待时间(秒),如果作业提交较慢,需要增大此数值', 'welcom.flink.config.useHistoryServer.title': '使用内置 Flink History Server:', - 'welcom.flink.config.useHistoryServer': '此功能会在 Dinky 里面内置一个Flink History Server ,作用于 Flink 任务的历史查询,\n 使 Flink 任务减少 UNKNOWN 状态的情况,并打入 Flink 任务最后的状态信息', - 'welcom.flink.config.historyPort.title' : 'Flink History Server 端口:', - 'welcom.flink.config.historyPort' : '内置Flink History Server 端口,例如:8082,确保端口没有被占用', + 'welcom.flink.config.useHistoryServer': + '此功能会在 Dinky 里面内置一个Flink History Server ,作用于 Flink 任务的历史查询,\n 使 Flink 任务减少 UNKNOWN 状态的情况,并打入 Flink 任务最后的状态信息', + 'welcom.flink.config.historyPort.title': 'Flink History Server 端口:', + 'welcom.flink.config.historyPort': '内置Flink History Server 端口,例如:8082,确保端口没有被占用' }; diff --git a/dinky-web/src/pages/Other/Login/LoginForm/index.tsx b/dinky-web/src/pages/Other/Login/LoginForm/index.tsx index 4459246c1e..22d73801e4 100644 --- a/dinky-web/src/pages/Other/Login/LoginForm/index.tsx +++ b/dinky-web/src/pages/Other/Login/LoginForm/index.tsx @@ -17,26 +17,26 @@ * */ -import {API_CONSTANTS} from '@/services/endpoints'; -import {l} from '@/utils/intl'; -import {GithubOutlined, LockOutlined, UserOutlined} from '@ant-design/icons'; -import {DefaultFooter, ProForm, ProFormCheckbox, ProFormText} from '@ant-design/pro-components'; -import {SubmitterProps} from '@ant-design/pro-form/es/components'; -import {Col, Flex, Row} from 'antd'; -import React, {useState} from 'react'; +import { API_CONSTANTS } from '@/services/endpoints'; +import { l } from '@/utils/intl'; +import { GithubOutlined, LockOutlined, UserOutlined } from '@ant-design/icons'; +import { DefaultFooter, ProForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components'; +import { SubmitterProps } from '@ant-design/pro-form/es/components'; +import { Col, Flex, Row } from 'antd'; +import React, { useState } from 'react'; import style from '../../../../global.less'; import Lottie from 'react-lottie'; import DataPlatform from '../../../../../public/login_animation.json'; -import {useRequest} from "@@/exports"; -import {history} from "@umijs/max"; -import {GLOBAL_SETTING_KEYS} from '@/types/SettingCenter/data.d'; +import { useRequest } from '@@/exports'; +import { history } from '@umijs/max'; +import { GLOBAL_SETTING_KEYS } from '@/types/SettingCenter/data.d'; type LoginFormProps = { onSubmit: (values: any) => Promise; }; const LoginForm: React.FC = (props) => { - const {onSubmit} = props; + const { onSubmit } = props; const [form] = ProForm.useForm(); @@ -140,7 +140,7 @@ const LoginForm: React.FC = (props) => { }} > = (props) => { xxl={8} > - {''}/ -

{l('layouts.userLayout.title')}

+ {''} +

{l('layouts.userLayout.title')}

{renderLoginForm()} = (props) => { }, { key: 'github', - title: , + title: , href: 'https://github.com/DataLinkDC/dinky', blankTarget: true } @@ -197,7 +197,7 @@ const LoginForm: React.FC = (props) => { height: '100%' }} > - + = (props) => { src={'./icons/footer-bg.svg'} width={'100%'} alt={''} - style={{position: 'absolute', bottom: 0}} + style={{ position: 'absolute', bottom: 0 }} /> ); diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx index 21405a933a..b0975a4c42 100644 --- a/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/BaseConfigItem.tsx @@ -1,56 +1,68 @@ -import {Button, Flex, Input, Radio, Space, Typography} from "antd"; +/* + * + * 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 {WelcomPic1} from "@/components/Icons/WelcomIcons"; -import FormItem from "antd/es/form/FormItem"; -import {WelcomProps} from "@/pages/Other/Welcom"; -import {l} from "@/utils/intl"; +import { Button, Flex, Input, Radio, Space, Typography } from 'antd'; -const {Title, Text, Link} = Typography; +import { WelcomPic1 } from '@/components/Icons/WelcomIcons'; +import FormItem from 'antd/es/form/FormItem'; +import { WelcomProps } from '@/pages/Other/Welcom'; +import { l } from '@/utils/intl'; -const BaseConfigItem = (prop: WelcomProps) => { +const { Title, Text, Link } = Typography; +const BaseConfigItem = (prop: WelcomProps) => { return (
{l('welcom.base.config.title')} -
- {l('welcom.tips')} -
-
+
+ {l('welcom.tips')} +
+
- {l('welcom.base.config.dinky.url')} + {l('welcom.base.config.dinky.url')} - + - {l('welcom.base.config.taskowner')} - -
- + {l('welcom.base.config.taskowner')} +
+ - OWNER - OWNER_AND_MAINTAINER - ALL + OWNER + OWNER_AND_MAINTAINER + ALL
- {l('welcom.prev')}
- +
- ) -} + ); +}; export default BaseConfigItem; diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx index a8cc7f1c04..1514ce8099 100644 --- a/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/FinishPage.tsx @@ -1,17 +1,37 @@ -import {Button, Result} from "antd"; -import {l} from "@/utils/intl"; +/* + * + * 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. + * + */ -const FinishPage = () => { +import { Button, Result } from 'antd'; +import { l } from '@/utils/intl'; - return window.location.href = '/login'}> - {l('welcom.goLogin')} - , - ]} - /> -} -export default FinishPage +const FinishPage = () => { + return ( + (window.location.href = '/login')}> + {l('welcom.goLogin')} + + ]} + /> + ); +}; +export default FinishPage; diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx index 7418e7190b..c930ee49ac 100644 --- a/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/FlinkConfigItem.tsx @@ -1,52 +1,70 @@ -import {Flex, Input, Space, Switch, Typography} from "antd"; +/* + * + * 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 {WelcomPic1} from "@/components/Icons/WelcomIcons"; -import FormItem from "antd/es/form/FormItem"; -import {WelcomProps} from "@/pages/Other/Welcom"; -import {LoadingBtn} from "@/components/CallBackButton/LoadingBtn"; -import {l} from "@/utils/intl"; +import { Flex, Input, Space, Switch, Typography } from 'antd'; -const {Title, Text, Link} = Typography; +import { WelcomPic1 } from '@/components/Icons/WelcomIcons'; +import FormItem from 'antd/es/form/FormItem'; +import { WelcomProps } from '@/pages/Other/Welcom'; +import { LoadingBtn } from '@/components/CallBackButton/LoadingBtn'; +import { l } from '@/utils/intl'; -const FlinkConfigItem = (prop: WelcomProps) => { +const { Title, Text, Link } = Typography; +const FlinkConfigItem = (prop: WelcomProps) => { return (
{l('welcom.flink.config.title')} -
- {l('welcom.tips')} -
-
+
+ {l('welcom.tips')} +
+
- {l('welcom.flink.config.jobwait')} + {l('welcom.flink.config.jobwait')} - + - {l('welcom.flink.config.useHistoryServer')} -
- - + {l('welcom.flink.config.useHistoryServer')} +
+ +
- {l('welcom.flink.config.historyPort')} - - + {l('welcom.flink.config.historyPort')} + + await prop.onSubmit?.()} @@ -54,8 +72,8 @@ const FlinkConfigItem = (prop: WelcomProps) => { {l('welcom.prev')}
- +
- ) -} + ); +}; export default FlinkConfigItem; diff --git a/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx b/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx index 83cf85e7e8..7204e8c853 100644 --- a/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx +++ b/dinky-web/src/pages/Other/Welcom/WelcomItem/WelcomItem.tsx @@ -1,66 +1,66 @@ -import {Button, Flex, Input, Space, Typography} from "antd"; -import {Congratulations, WelcomPic1} from "@/components/Icons/WelcomIcons"; -import FormItem from "antd/es/form/FormItem"; -import {WelcomProps} from "@/pages/Other/Welcom"; -import {l} from "@/utils/intl"; +/* + * + * 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. + * + */ -const {Title, Text, Link} = Typography; +import { Button, Flex, Input, Space, Typography } from 'antd'; +import { Congratulations, WelcomPic1 } from '@/components/Icons/WelcomIcons'; +import FormItem from 'antd/es/form/FormItem'; +import { WelcomProps } from '@/pages/Other/Welcom'; +import { l } from '@/utils/intl'; +const { Title, Text, Link } = Typography; const WelcomItem = (prop: WelcomProps) => { - return (
- + {l('welcom.welcom')} -
- - {l('welcom.welcom.content')} - -
-
- - {l('welcom.welcom.content.tip1')} - -
- - {l('welcom.welcom.content.tip2')} - +
+ {l('welcom.welcom.content')} +
+
+ {l('welcom.welcom.content.tip1')} +
+ {l('welcom.welcom.content.tip2')} {l('welcom.welcom.setPwd.tip')} - - + + - prop.onNext()}>{l('welcom.welcom.skip')}
- +
- ) -} + ); +}; export default WelcomItem; diff --git a/dinky-web/src/pages/Other/Welcom/index.tsx b/dinky-web/src/pages/Other/Welcom/index.tsx index ed482cee11..f0363e34e6 100644 --- a/dinky-web/src/pages/Other/Welcom/index.tsx +++ b/dinky-web/src/pages/Other/Welcom/index.tsx @@ -1,72 +1,90 @@ -import {Flex, Form} from "antd"; -import {useState} from "react"; -import WelcomItem from "@/pages/Other/Welcom/WelcomItem/WelcomItem"; -import BaseConfigItem from "@/pages/Other/Welcom/WelcomItem/BaseConfigItem"; -import FlinkConfigItem from "@/pages/Other/Welcom/WelcomItem/FlinkConfigItem"; -import FinishPage from "@/pages/Other/Welcom/WelcomItem/FinishPage"; -import {log} from "@antv/g6/lib/utils/scale"; -import {history, useRequest} from "@@/exports"; -import {API_CONSTANTS} from "@/services/endpoints"; -import {GLOBAL_SETTING_KEYS} from "@/types/SettingCenter/data"; -import {postAll} from "@/services/api"; -import {sleep} from "@antfu/utils"; +/* + * + * 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 { Flex, Form } from 'antd'; +import { useState } from 'react'; +import WelcomItem from '@/pages/Other/Welcom/WelcomItem/WelcomItem'; +import BaseConfigItem from '@/pages/Other/Welcom/WelcomItem/BaseConfigItem'; +import FlinkConfigItem from '@/pages/Other/Welcom/WelcomItem/FlinkConfigItem'; +import FinishPage from '@/pages/Other/Welcom/WelcomItem/FinishPage'; +import { log } from '@antv/g6/lib/utils/scale'; +import { history, useRequest } from '@@/exports'; +import { API_CONSTANTS } from '@/services/endpoints'; +import { GLOBAL_SETTING_KEYS } from '@/types/SettingCenter/data'; +import { postAll } from '@/services/api'; +import { sleep } from '@antfu/utils'; const boxStyle: React.CSSProperties = { width: '100%', height: '100%', - borderRadius: 6, + borderRadius: 6 }; export type WelcomProps = { - onNext: () => void - onPrev: () => void - onSubmit?: () => void -} + onNext: () => void; + onPrev: () => void; + onSubmit?: () => void; +}; const Welcom = () => { - const [form] = Form.useForm(); const [formData, setFormData] = useState({}); const [current, setCurrent] = useState(0); - const {data,loading} = useRequest(API_CONSTANTS.GET_NEEDED_CFG); + const { data, loading } = useRequest(API_CONSTANTS.GET_NEEDED_CFG); - const setCfgReq = useRequest((params)=>postAll(API_CONSTANTS.SET_INIT_CFG,params),{manual: true}) + const setCfgReq = useRequest((params) => postAll(API_CONSTANTS.SET_INIT_CFG, params), { + manual: true + }); const next = () => { - setFormData((prev)=>{ - return {...prev,...form.getFieldsValue()} - }) + setFormData((prev) => { + return { ...prev, ...form.getFieldsValue() }; + }); setCurrent(current + 1); - } + }; const prev = () => { setCurrent(current - 1); - } + }; const submit = async () => { - const data = {...formData, ...form.getFieldsValue()} - await setCfgReq.run(data) - next() - } + const data = { ...formData, ...form.getFieldsValue() }; + await setCfgReq.run(data); + next(); + }; return ( - -
- {loading?
loading
: -
- {current == 0 && } - {current == 1 && } - {current == 2 && } - {current == 3 && } - } - + +
+ {loading ? ( +
loading
+ ) : ( +
+ {current == 0 && } + {current == 1 && } + {current == 2 && } + {current == 3 && } + + )}
- ) -} + ); +}; export default Welcom;