Skip to content

Commit

Permalink
Spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyan1998 authored and github-actions[bot] committed Nov 22, 2024
1 parent 2c3bbc5 commit f724e63
Show file tree
Hide file tree
Showing 16 changed files with 2,674 additions and 950 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,17 @@ public Result<List<Configuration<?>>> getOneTypeByKey(@RequestParam("type") Stri
return Result.succeed(configList);
}


@GetMapping("/getNeededCfg")
@ApiOperation("Get Needed Config")
@SaIgnore
public Result<Map<String,Object>> getNeededCfg() {
public Result<Map<String, Object>> getNeededCfg() {
return sysConfigService.getNeededCfg();
}

@PostMapping("/setInitConfig")
@ApiOperation("Get Needed Config")
@SaIgnore
public Result<Void> setInitConfig(@RequestBody Map<String,Object> params) {
public Result<Void> setInitConfig(@RequestBody Map<String, Object> params) {
return sysConfigService.setInitConfig(params);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public interface SysConfigService extends ISuperService<SysConfig> {
*
* @return A map of string keys to lists of {@link Configuration} objects.
*/
Result<Map<String,Object>> getNeededCfg();
Result<Map<String, Object>> getNeededCfg();

/**
* Set initial configurations.
*
* @param params The parameters for initializing configurations.
*/
Result<Void> setInitConfig(Map<String,Object> params);
Result<Void> setInitConfig(Map<String, Object> params);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
Expand Down Expand Up @@ -131,8 +131,6 @@ public void updateSysConfigByKv(String key, String value) {
}
}



@Override
public Result<Map<String, Object>> getNeededCfg() {
Map<String, Object> result = new HashMap<>();
Expand All @@ -146,11 +144,19 @@ public Result<Map<String, Object>> 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);
}
Expand Down
4 changes: 1 addition & 3 deletions dinky-common/src/main/java/org/dinky/data/enums/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ public static Configuration.OptionBuilder key(Status status) {
.map(f -> (Configuration<?>) ReflectUtil.getFieldValue(systemConfiguration, f))
.collect(Collectors.toList());

private final Configuration<Boolean> isFirstSystemIn = key(Status.SYS_GLOBAL_IS_FIRST)
.booleanType()
.defaultValue(true);
private final Configuration<Boolean> isFirstSystemIn =
key(Status.SYS_GLOBAL_IS_FIRST).booleanType().defaultValue(true);

private final Configuration<Boolean> useRestAPI = key(Status.SYS_FLINK_SETTINGS_USERESTAPI)
.booleanType()
Expand Down
3,100 changes: 2,371 additions & 729 deletions dinky-web/src/components/Icons/WelcomIcons.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dinky-web/src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
28 changes: 18 additions & 10 deletions dinky-web/src/locales/en-US/welcom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'
};
4 changes: 2 additions & 2 deletions dinky-web/src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': '语言',
Expand All @@ -39,5 +39,5 @@ export default {
...request,
...response,
...shortcutKey,
...welcom,
...welcom
};
19 changes: 12 additions & 7 deletions dinky-web/src/locales/zh-CN/welcom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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密码:',
Expand All @@ -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,确保端口没有被占用'
};
42 changes: 21 additions & 21 deletions dinky-web/src/pages/Other/Login/LoginForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>;
};

const LoginForm: React.FC<LoginFormProps> = (props) => {
const {onSubmit} = props;
const { onSubmit } = props;

const [form] = ProForm.useForm();

Expand Down Expand Up @@ -140,7 +140,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
}}
>
<Col
style={{padding: '5%', backgroundColor: '#fff'}}
style={{ padding: '5%', backgroundColor: '#fff' }}
xs={24}
sm={24}
md={10}
Expand All @@ -149,25 +149,25 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
xxl={8}
>
<Row
style={{color: '#00b0ff', marginBottom: 60, justifyContent: 'center'}}
style={{ color: '#00b0ff', marginBottom: 60, justifyContent: 'center' }}
align={'middle'}
>
<img src={'./dinky.svg'} width={150} alt={''}/>
<h1 style={{margin: '0'}}>{l('layouts.userLayout.title')}</h1>
<img src={'./dinky.svg'} width={150} alt={''} />
<h1 style={{ margin: '0' }}>{l('layouts.userLayout.title')}</h1>
</Row>

<ProForm
className={style.loginform}
form={form}
onFinish={handleClickLogin}
initialValues={{autoLogin: true}}
submitter={{...proFormSubmitter}}
initialValues={{ autoLogin: true }}
submitter={{ ...proFormSubmitter }}
>
{renderLoginForm()}
</ProForm>
<DefaultFooter
copyright={`${new Date().getFullYear()} ` + l('app.copyright.produced')}
style={{backgroundColor: '#fff'}}
style={{ backgroundColor: '#fff' }}
links={[
{
key: 'Dinky',
Expand All @@ -177,7 +177,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
},
{
key: 'github',
title: <GithubOutlined/>,
title: <GithubOutlined />,
href: 'https://github.com/DataLinkDC/dinky',
blankTarget: true
}
Expand All @@ -197,7 +197,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
height: '100%'
}}
>
<Flex align={'center'} style={{width: '100%', height: '100%'}}>
<Flex align={'center'} style={{ width: '100%', height: '100%' }}>
<Lottie
options={{
loop: true,
Expand All @@ -220,7 +220,7 @@ const LoginForm: React.FC<LoginFormProps> = (props) => {
src={'./icons/footer-bg.svg'}
width={'100%'}
alt={''}
style={{position: 'absolute', bottom: 0}}
style={{ position: 'absolute', bottom: 0 }}
/>
</>
);
Expand Down
Loading

0 comments on commit f724e63

Please sign in to comment.