Unverified Commit 2becec68 authored by gaoyan's avatar gaoyan Committed by GitHub

migrated global config i81n to the back end (#2315)

parent 6e319b46
...@@ -255,6 +255,86 @@ public enum Status { ...@@ -255,6 +255,86 @@ public enum Status {
*/ */
GLOBAL_PARAMS_CHECK_ERROR(90001, "global.params.check.error"), GLOBAL_PARAMS_CHECK_ERROR(90001, "global.params.check.error"),
GLOBAL_PARAMS_CHECK_ERROR_VALUE(90002, "global.params.check.error.value"), GLOBAL_PARAMS_CHECK_ERROR_VALUE(90002, "global.params.check.error.value"),
/**
* system config
*/
SYS_FLINK_SETTINGS_USERESTAPI(100, "sys.flink.settings.useRestAPI"),
SYS_FLINK_SETTINGS_USERESTAPI_NOTE(101, "sys.flink.settings.useRestAPI.note"),
SYS_FLINK_SETTINGS_SQLSEPARATOR(102, "sys.flink.settings.sqlSeparator"),
SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE(103, "sys.flink.settings.sqlSeparator.note"),
SYS_FLINK_SETTINGS_JOBIDWAIT(104, "sys.flink.settings.jobIdWait"),
SYS_FLINK_SETTINGS_JOBIDWAIT_NOTE(105, "sys.flink.settings.jobIdWait.note"),
SYS_MAVEN_SETTINGS_SETTINGSFILEPATH(106, "sys.maven.settings.settingsFilePath"),
SYS_MAVEN_SETTINGS_SETTINGSFILEPATH_NOTE(107, "sys.maven.settings.settingsFilePath.note"),
SYS_MAVEN_SETTINGS_REPOSITORY(108, "sys.maven.settings.repository"),
SYS_MAVEN_SETTINGS_REPOSITORY_NOTE(109, "sys.maven.settings.repository.note"),
SYS_MAVEN_SETTINGS_REPOSITORYUSER(110, "sys.maven.settings.repositoryUser"),
SYS_MAVEN_SETTINGS_REPOSITORYUSER_NOTE(111, "sys.maven.settings.repositoryUser.note"),
SYS_MAVEN_SETTINGS_REPOSITORYPASSWORD(112, "sys.maven.settings.repositoryPassword"),
SYS_MAVEN_SETTINGS_REPOSITORYPASSWORD_NOTE(113, "sys.maven.settings.repositoryPassword.note"),
SYS_ENV_SETTINGS_PYTHONHOME(114, "sys.env.settings.pythonHome"),
SYS_ENV_SETTINGS_PYTHONHOME_NOTE(115, "sys.env.settings.pythonHome.note"),
SYS_ENV_SETTINGS_DINKYADDR(116, "sys.env.settings.dinkyAddr"),
SYS_ENV_SETTINGS_DINKYADDR_NOTE(117, "sys.env.settings.dinkyAddr.note"),
SYS_DOLPHINSCHEDULER_SETTINGS_ENABLE(118, "sys.dolphinscheduler.settings.enable"),
SYS_DOLPHINSCHEDULER_SETTINGS_ENABLE_NOTE(119, "sys.dolphinscheduler.settings.enable.note"),
SYS_DOLPHINSCHEDULER_SETTINGS_URL(120, "sys.dolphinscheduler.settings.url"),
SYS_DOLPHINSCHEDULER_SETTINGS_URL_NOTE(121, "sys.dolphinscheduler.settings.url.note"),
SYS_DOLPHINSCHEDULER_SETTINGS_TOKEN(122, "sys.dolphinscheduler.settings.token"),
SYS_DOLPHINSCHEDULER_SETTINGS_TOKEN_NOTE(123, "sys.dolphinscheduler.settings.token.note"),
SYS_DOLPHINSCHEDULER_SETTINGS_PROJECTNAME(124, "sys.dolphinscheduler.settings.projectName"),
SYS_DOLPHINSCHEDULER_SETTINGS_PROJECTNAME_NOTE(125, "sys.dolphinscheduler.settings.projectName.note"),
SYS_LDAP_SETTINGS_URL(126, "sys.ldap.settings.url"),
SYS_LDAP_SETTINGS_URL_NOTE(127, "sys.ldap.settings.url.note"),
SYS_LDAP_SETTINGS_USERDN(128, "sys.ldap.settings.userDn"),
SYS_LDAP_SETTINGS_USERDN_NOTE(129, "sys.ldap.settings.userDn.note"),
SYS_LDAP_SETTINGS_USERPASSWORD(130, "sys.ldap.settings.userPassword"),
SYS_LDAP_SETTINGS_USERPASSWORD_NOTE(131, "sys.ldap.settings.userPassword.note"),
SYS_LDAP_SETTINGS_TIMELIMIT(132, "sys.ldap.settings.timeLimit"),
SYS_LDAP_SETTINGS_TIMELIMIT_NOTE(133, "sys.ldap.settings.timeLimit.note"),
SYS_LDAP_SETTINGS_BASEDN(134, "sys.ldap.settings.baseDn"),
SYS_LDAP_SETTINGS_BASEDN_NOTE(135, "sys.ldap.settings.baseDn.note"),
SYS_LDAP_SETTINGS_FILTER(136, "sys.ldap.settings.filter"),
SYS_LDAP_SETTINGS_FILTER_NOTE(137, "sys.ldap.settings.filter.note"),
SYS_LDAP_SETTINGS_AUTOLOAD(138, "sys.ldap.settings.autoload"),
SYS_LDAP_SETTINGS_AUTOLOAD_NOTE(139, "sys.ldap.settings.autoload.note"),
SYS_LDAP_SETTINGS_DEFAULTTEANT(140, "sys.ldap.settings.defaultTeant"),
SYS_LDAP_SETTINGS_DEFAULTTEANT_NOTE(141, "sys.ldap.settings.defaultTeant.note"),
SYS_LDAP_SETTINGS_CASTUSERNAME(142, "sys.ldap.settings.castUsername"),
SYS_LDAP_SETTINGS_CASTUSERNAME_NOTE(143, "sys.ldap.settings.castUsername.note"),
SYS_LDAP_SETTINGS_CASTNICKNAME(144, "sys.ldap.settings.castNickname"),
SYS_LDAP_SETTINGS_CASTNICKNAME_NOTE(145, "sys.ldap.settings.castNickname.note"),
SYS_LDAP_SETTINGS_ENABLE(146, "sys.ldap.settings.enable"),
SYS_LDAP_SETTINGS_ENABLE_NOTE(147, "sys.ldap.settings.enable.note"),
SYS_METRICS_SETTINGS_SYS_ENABLE(148, "sys.metrics.settings.sys.enable"),
SYS_METRICS_SETTINGS_SYS_ENABLE_NOTE(149, "sys.metrics.settings.sys.enable.note"),
SYS_METRICS_SETTINGS_SYS_GATHERTIMING(150, "sys.metrics.settings.sys.gatherTiming"),
SYS_METRICS_SETTINGS_SYS_GATHERTIMING_NOTE(151, "sys.metrics.settings.sys.gatherTiming.note"),
SYS_METRICS_SETTINGS_FLINK_GATHERTIMING(152, "sys.metrics.settings.flink.gatherTiming"),
SYS_METRICS_SETTINGS_FLINK_GATHERTIMING_NOTE(153, "sys.metrics.settings.flink.gatherTiming.note"),
SYS_METRICS_SETTINGS_FLINK_GATHERTIMEOUT(154, "sys.metrics.settings.flink.gatherTimeout"),
SYS_METRICS_SETTINGS_FLINK_GATHERTIMEOUT_NOTE(155, "sys.metrics.settings.flink.gatherTimeout.note"),
SYS_RESOURCE_SETTINGS_ENABLE(156, "sys.resource.settings.enable"),
SYS_RESOURCE_SETTINGS_ENABLE_NOTE(157, "sys.resource.settings.enable.note"),
SYS_RESOURCE_SETTINGS_UPLOAD_BASE_PATH(158, "sys.resource.settings.upload.base.path"),
SYS_RESOURCE_SETTINGS_UPLOAD_BASE_PATH_NOTE(159, "sys.resource.settings.upload.base.path.note"),
SYS_RESOURCE_SETTINGS_MODEL(160, "sys.resource.settings.model"),
SYS_RESOURCE_SETTINGS_MODEL_NOTE(161, "sys.resource.settings.model.note"),
SYS_RESOURCE_SETTINGS_OSS_ENDPOINT(162, "sys.resource.settings.oss.endpoint"),
SYS_RESOURCE_SETTINGS_OSS_ENDPOINT_NOTE(163, "sys.resource.settings.oss.endpoint.note"),
SYS_RESOURCE_SETTINGS_OSS_ACCESSKEY(164, "sys.resource.settings.oss.accessKey"),
SYS_RESOURCE_SETTINGS_OSS_ACCESSKEY_NOTE(165, "sys.resource.settings.oss.accessKey.note"),
SYS_RESOURCE_SETTINGS_OSS_SECRETKEY(166, "sys.resource.settings.oss.secretKey"),
SYS_RESOURCE_SETTINGS_OSS_SECRETKEY_NOTE(167, "sys.resource.settings.oss.secretKey.note"),
SYS_RESOURCE_SETTINGS_OSS_BUCKETNAME(168, "sys.resource.settings.oss.bucketName"),
SYS_RESOURCE_SETTINGS_OSS_BUCKETNAME_NOTE(169, "sys.resource.settings.oss.bucketName.note"),
SYS_RESOURCE_SETTINGS_OSS_REGION(170, "sys.resource.settings.oss.region"),
SYS_RESOURCE_SETTINGS_OSS_REGION_NOTE(171, "sys.resource.settings.oss.region.note"),
SYS_RESOURCE_SETTINGS_HDFS_ROOT_USER(172, "sys.resource.settings.hdfs.root.user"),
SYS_RESOURCE_SETTINGS_HDFS_ROOT_USER_NOTE(173, "sys.resource.settings.hdfs.root.user.note"),
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS(174, "sys.resource.settings.hdfs.fs.defaultFS"),
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS_NOTE(175, "sys.resource.settings.hdfs.fs.defaultFS.note"),
; ;
private final int code; private final int code;
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
package org.dinky.data.model; package org.dinky.data.model;
import org.dinky.data.enums.Status;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -36,10 +38,13 @@ import cn.hutool.core.util.EnumUtil; ...@@ -36,10 +38,13 @@ import cn.hutool.core.util.EnumUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.Setter;
@Getter @Getter
@Setter
public class Configuration<T> implements Serializable { public class Configuration<T> implements Serializable {
private final String key; private String key;
private String name;
@JsonIgnore @JsonIgnore
private final Class<T> type; private final Class<T> type;
...@@ -49,6 +54,10 @@ public class Configuration<T> implements Serializable { ...@@ -49,6 +54,10 @@ public class Configuration<T> implements Serializable {
private final String frontType; private final String frontType;
private final List<String> example = new ArrayList<>(); private final List<String> example = new ArrayList<>();
@JsonIgnore
private String noteKey;
private String note; private String note;
private final T defaultValue; private final T defaultValue;
...@@ -62,8 +71,8 @@ public class Configuration<T> implements Serializable { ...@@ -62,8 +71,8 @@ public class Configuration<T> implements Serializable {
private T value; private T value;
private static final List<Class<?>> NUMBER_LIST = CollUtil.newArrayList(Double.class, Float.class, Integer.class); private static final List<Class<?>> NUMBER_LIST = CollUtil.newArrayList(Double.class, Float.class, Integer.class);
public Configuration<T> note(String note) { public Configuration<T> note(Status status) {
this.note = note; this.noteKey = status.getKey();
return this; return this;
} }
......
...@@ -145,4 +145,83 @@ alert.rule.getJobInfoFail=Get Job Info Fail ...@@ -145,4 +145,83 @@ alert.rule.getJobInfoFail=Get Job Info Fail
alert.rule.jobRestart=Job Restart alert.rule.jobRestart=Job Restart
alert.rule.checkpointFail=Checkpoint Failure alert.rule.checkpointFail=Checkpoint Failure
alert.rule.jobRunException=Job Run Exception alert.rule.jobRunException=Job Run Exception
alert.rule.checkpointTimeout=Checkpoint Timeout alert.rule.checkpointTimeout=Checkpoint Timeout
\ No newline at end of file
# system config
sys.flink.settings.useRestAPI=Use Rest API
sys.flink.settings.useRestAPI.note=Whether to use RestAPI when operating and maintaining Flink tasks
sys.flink.settings.sqlSeparator=SQL Separator
sys.flink.settings.sqlSeparator.note=SQL Separator
sys.flink.settings.jobIdWait=Job submission waiting time
sys.flink.settings.jobIdWait.note=Maximum waiting time (seconds) for obtaining Job ID when submitting Application or PerJob tasks
sys.maven.settings.settingsFilePath=Maven configuration file path
sys.maven.settings.settingsFilePath.note=Maven configuration file path, eg
sys.maven.settings.repository=Maven warehouse address
sys.maven.settings.repository.note=Maven warehouse address
sys.maven.settings.repositoryUser=Maven warehouse user name
sys.maven.settings.repositoryUser.note=Maven private server authentication user name
sys.maven.settings.repositoryPassword=Maven warehouse password
sys.maven.settings.repositoryPassword.note=Maven private server authentication password, please note
sys.env.settings.pythonHome=Python Env variables
sys.env.settings.pythonHome.note=Python Env variables
sys.env.settings.dinkyAddr=Dinky Address
sys.env.settings.dinkyAddr.note=The address must be the same as the address configured in the Dinky Application background url
sys.dolphinscheduler.settings.enable=Whether to enable DolphinScheduler
sys.dolphinscheduler.settings.enable.note=Whether to enable DolphinScheduler, the relevant functions of DolphinScheduler can only be used after it is enabled, please ensure that the relevant configuration of DolphinScheduler is correct
sys.dolphinscheduler.settings.url=DolphinScheduler address
sys.dolphinscheduler.settings.url.note=The address must be consistent with the address configured in the DolphinScheduler background, eg: http://127.0.0.1:12345/dolphinscheduler
sys.dolphinscheduler.settings.token=DolphinScheduler Token
sys.dolphinscheduler.settings.token.note=DolphinScheduler‘s Token, please create a token in DolphinScheduler’s Security Center->Token Management, and fill in the configuration
sys.dolphinscheduler.settings.projectName=DolphinScheduler project name
sys.dolphinscheduler.settings.projectName.note=The project name specified in DolphinScheduler, case insensitive
sys.ldap.settings.url=ldap address of service
sys.ldap.settings.url.note=ldap address of service,eg:ldap://192.168.111.1:389
sys.ldap.settings.userDn=Login User name (DN)
sys.ldap.settings.userDn.note=User name for connecting to the ldap service, or the administrator DN
sys.ldap.settings.userPassword=login password
sys.ldap.settings.userPassword.note=Password used to connect to the ldap service
sys.ldap.settings.timeLimit=Connection Timeout
sys.ldap.settings.timeLimit.note=The maximum time to connect to the ldap service is disconnected
sys.ldap.settings.baseDn=BaseDn
sys.ldap.settings.baseDn.note=Dinky will conduct a user search on this base dn,eg:ou=users,dc=dinky,dc=com
sys.ldap.settings.filter=User filtering rules
sys.ldap.settings.filter.note=User filtering by using the filter syntax of the ldap,eg
sys.ldap.settings.autoload=User atically map users when logging in
sys.ldap.settings.autoload.note=When turned on, when a user logs in with LDAP, if there is no corresponding Dinky user mapping, the LDAP information is automatically pulled to create a Dinky user mapping to it. If this feature is closed, you will not be able to log in for unimported LDAP users
sys.ldap.settings.defaultTeant=The LDAP imports the default tenant code
sys.ldap.settings.defaultTeant.note=After opening the automatic import of users, the new user login needs a default tenant code, otherwise it cannot log in
sys.ldap.settings.castUsername=The LDAP user-name segment
sys.ldap.settings.castUsername.note=It is necessary to fill in the attribute field of the user in an LDAP to correspond to the Dinky user. Generally, cn or uid indicates the unique identity of the user
sys.ldap.settings.castNickname=The LDAP nickname field
sys.ldap.settings.castNickname.note=Need to fill in the attribute field of the user in an LDAP to correspond to the Dinky nickname, must be filled in, generally selected as sn or other identification, not required unique
sys.ldap.settings.enable=Whether to enable the ldap
sys.ldap.settings.enable.note=Turn the LDAP login function on
sys.metrics.settings.sys.enable=Dinky JVM Monitor switch
sys.metrics.settings.sys.enable.note=This switch is related to Dinky JVM Monitor, which determines the display of Dinky Server in the monitoring page and the collection of JVM Metrics
sys.metrics.settings.sys.gatherTiming=Dinky JVM Metrics collection time granularity
sys.metrics.settings.sys.gatherTiming.note=Dinky JVM Metrics collection time granularity, timed task interval trigger
sys.metrics.settings.flink.gatherTiming=Flink Metrics collection time granularity
sys.metrics.settings.flink.gatherTiming.note=Flink Metrics collection time granularity, scheduled task interval trigger
sys.metrics.settings.flink.gatherTimeout=Flink Metrics collection time granularity, scheduled task interval trigger
sys.metrics.settings.flink.gatherTimeout.note=Flink Metrics collection timeout period, scheduled task interval trigger (this configuration item should be smaller than Flink Metrics collection time granularity)
sys.resource.settings.enable=Whether to enable Resource
sys.resource.settings.enable.note=Enable the resource management function. If you switch the storage mode, you need to turn off this switch. After the relevant configuration is completed, turn it on again.
sys.resource.settings.upload.base.path=The root path of the upload directory
sys.resource.settings.upload.base.path.note=resource store on HDFS/OSS path, resource file will store to this base path, self configuration, please make sure the directory exists on hdfs and have read write permissions. /dinky is recommended
sys.resource.settings.model=Storage mode
sys.resource.settings.model.note=Storage mode
sys.resource.settings.oss.endpoint=URL of the object storage service
sys.resource.settings.oss.endpoint.note=The URL of the object storage service, for example: https://oss-cn-hangzhou.aliyuncs.com
sys.resource.settings.oss.accessKey=Access key is like a user ID, which can uniquely identify your account
sys.resource.settings.oss.accessKey.note=Access key is like a user ID, which can uniquely identify your account
sys.resource.settings.oss.secretKey=Secret key is your account password
sys.resource.settings.oss.secretKey.note=Secret key is your account password
sys.resource.settings.oss.bucketName=default bucket name
sys.resource.settings.oss.bucketName.note=default bucket name
sys.resource.settings.oss.region=region
sys.resource.settings.oss.region.note=region
sys.resource.settings.hdfs.root.user=HDFS operation user name
sys.resource.settings.hdfs.root.user.note=HDFS operation user name
sys.resource.settings.hdfs.fs.defaultFS=HDFS defaultFS
sys.resource.settings.hdfs.fs.defaultFS.note=fs.defaultFS configuration items, such as remote: hdfs://localhost:9000, local: file:///
\ No newline at end of file
...@@ -145,4 +145,83 @@ alert.rule.getJobInfoFail=获取作业信息失败 ...@@ -145,4 +145,83 @@ alert.rule.getJobInfoFail=获取作业信息失败
alert.rule.jobRestart=作业重启 alert.rule.jobRestart=作业重启
alert.rule.checkpointFail=checkpoint失败 alert.rule.checkpointFail=checkpoint失败
alert.rule.jobRunException=作业运行异常 alert.rule.jobRunException=作业运行异常
alert.rule.checkpointTimeout=checkpoint超时 alert.rule.checkpointTimeout=checkpoint超时
\ No newline at end of file
# system config
sys.flink.settings.useRestAPI=使用 Rest API
sys.flink.settings.useRestAPI.note=在运维 Flink 任务时是否使用 RestAPI
sys.flink.settings.sqlSeparator=SQL 分隔符
sys.flink.settings.sqlSeparator.note=SQL 分隔符
sys.flink.settings.jobIdWait=Job 提交等待时间
sys.flink.settings.jobIdWait.note=提交 Application 或 PerJob 任务时获取 Job ID 的最大等待时间(秒)
sys.maven.settings.settingsFilePath=Maven 配置文件路径
sys.maven.settings.settingsFilePath.note=Maven 配置文件路径, eg
sys.maven.settings.repository=Maven 仓库地址
sys.maven.settings.repository.note=Maven 仓库地址
sys.maven.settings.repositoryUser=Maven 仓库用户名
sys.maven.settings.repositoryUser.note=Maven 私服认证用户名
sys.maven.settings.repositoryPassword=Maven 仓库密码
sys.maven.settings.repositoryPassword.note=Maven 私服认证密码,请注意
sys.env.settings.pythonHome=Python 环境变量
sys.env.settings.pythonHome.note=Python 环境变量
sys.env.settings.dinkyAddr=Dinky 地址
sys.env.settings.dinkyAddr.note=该地址必须与Dinky Application后台url中配置的地址相同
sys.dolphinscheduler.settings.enable=是否启用 DolphinScheduler
sys.dolphinscheduler.settings.enable.note=是否启用 DolphinScheduler ,启用后才能使用 DolphinScheduler 的相关功能, 请确保 DolphinScheduler 的相关配置正确
sys.dolphinscheduler.settings.url=DolphinScheduler 地址
sys.dolphinscheduler.settings.url.note=地址必须和DolphinScheduler后台配置的地址一致,eg: http://127.0.0.1:12345/dolphinscheduler
sys.dolphinscheduler.settings.token=DolphinScheduler Token
sys.dolphinscheduler.settings.token.note=DolphinScheduler的Token,请在DolphinScheduler的安全中心->令牌管理中创建一个token,并填入该配置中
sys.dolphinscheduler.settings.projectName=DolphinScheduler 项目名
sys.dolphinscheduler.settings.projectName.note=DolphinScheduler 中指定的项目名称,不区分大小写
sys.ldap.settings.url=ldap服务地址
sys.ldap.settings.url.note=ldap认证服务地址,例如:ldap://192.168.111.1:389
sys.ldap.settings.userDn=登录用户名(DN)
sys.ldap.settings.userDn.note=用于连接ldap服务的用户名,或者管理员DN
sys.ldap.settings.userPassword=登录密码
sys.ldap.settings.userPassword.note=用于连接ldap服务的密码
sys.ldap.settings.timeLimit=连接超时
sys.ldap.settings.timeLimit.note=连接ldap服务的最大时间,超过则断开
sys.ldap.settings.baseDn=用户基础DN
sys.ldap.settings.baseDn.note=Dinky会在此基础dn下进行用户搜索,例如:ou=users,dc=dinky,dc=com
sys.ldap.settings.filter=用户过滤规则
sys.ldap.settings.filter.note=使用ldap的filter语法进行用户过滤,例如
sys.ldap.settings.autoload=登录时自动映射用户
sys.ldap.settings.autoload.note=开启后,当用户使用LDAP登录时,如果没有相应的Dinky用户映射,则会自动拉取LDAP信息创建一个Dinky用户与之映射,如果关闭此功能,对于未导入的LDAP用户将无法登录
sys.ldap.settings.defaultTeant=LDAP导入默认租户编码
sys.ldap.settings.defaultTeant.note=开启自动导入用户后,新用户登录需要一个默认的租户编码,否则无法登录
sys.ldap.settings.castUsername=LDAP用户名字段
sys.ldap.settings.castUsername.note=需要填写一个LDAP中用户的属性字段来与Dinky用户对应,必须填写,一般可选为 cn 或者 uid表示用户唯一标识
sys.ldap.settings.castNickname=LDAP昵称字段
sys.ldap.settings.castNickname.note=需要填写一个LDAP中用户的属性字段来与Dinky昵称对应,必须填写,一般可选为 sn 或者其他标识,不要求唯一
sys.ldap.settings.enable=是否启用ldap
sys.ldap.settings.enable.note=开启LDAP登录功能
sys.metrics.settings.sys.enable=Dinky JVM Monitor 开关
sys.metrics.settings.sys.enable.note=此开关会关系到Dinky JVM Monitor,决定监控页面中的Dinky Server显示,以及JVM Metrics采集
sys.metrics.settings.sys.gatherTiming=Dinky JVM Metrics 采集时间粒度
sys.metrics.settings.sys.gatherTiming.note=Dinky JVM Metrics 采集时间粒度,定时任务间隔触发
sys.metrics.settings.flink.gatherTiming=Flink Metrics 采集时间粒度
sys.metrics.settings.flink.gatherTiming.note=Flink Metrics 采集时间粒度,定时任务间隔触发
sys.metrics.settings.flink.gatherTimeout=Flink Metrics 采集时间粒度,定时任务间隔触发
sys.metrics.settings.flink.gatherTimeout.note=Flink Metrics 采集超时时长,定时任务间隔触发(此配置项应小于Flink Metrics 采集时间粒度)
sys.resource.settings.enable=是否启用Resource
sys.resource.settings.enable.note=启用资源管理功能,如果切换存储模式时,需关闭此开关,相关配置完成后,再开启
sys.resource.settings.upload.base.path=上传目录的根路径
sys.resource.settings.upload.base.path.note=资源存储在HDFS/OSS路径上,资源文件将存储到此基本路径,自行配置,请确保该目录存在于hdfs上并具有读写权限。推荐
sys.resource.settings.model=存储模式:支持HDFS、OSS
sys.resource.settings.model.note=存储模式:支持HDFS、OSS,切换选项后即可生效,同时并迁移资源文件
sys.resource.settings.oss.endpoint=对象存储服务的URL
sys.resource.settings.oss.endpoint.note=对象存储服务的URL,例如:https://oss-cn-hangzhou.aliyuncs.com
sys.resource.settings.oss.accessKey=Access key就像用户ID,可以唯一标识你的账户
sys.resource.settings.oss.accessKey.note=Access key就像用户ID,可以唯一标识你的账户
sys.resource.settings.oss.secretKey=Secret key是你账户的密码
sys.resource.settings.oss.secretKey.note=Secret key是你账户的密码
sys.resource.settings.oss.bucketName=默认的存储桶名称
sys.resource.settings.oss.bucketName.note=默认的存储桶名称
sys.resource.settings.oss.region=区域
sys.resource.settings.oss.region.note=区域
sys.resource.settings.hdfs.root.user=HDFS操作用户名
sys.resource.settings.hdfs.root.user.note=HDFS操作用户名
sys.resource.settings.hdfs.fs.defaultFS=HDFS defaultFS
sys.resource.settings.hdfs.fs.defaultFS.note=fs.defaultFS 配置项,例如远程:hdfs://localhost:9000,本地:file:///
\ No newline at end of file
...@@ -819,92 +819,6 @@ export default { ...@@ -819,92 +819,6 @@ export default {
'sys.setting.tag.core': 'Core Configuration', 'sys.setting.tag.core': 'Core Configuration',
'sys.setting.tag.integration': 'Integration Configuration', 'sys.setting.tag.integration': 'Integration Configuration',
'sys.setting.tag.system': 'System Configuration', 'sys.setting.tag.system': 'System Configuration',
'sys.env.settings.dinkyAddr': 'Dinky Address',
'sys.env.settings.dinkyAddr.note':
'The address must be the same as the address configured in the Dinky Application background url',
'sys.flink.settings.useRestAPI': 'Use Rest API',
'sys.flink.settings.useRestAPI.note':
'Whether to use RestAPI when operating and maintaining Flink tasks',
'sys.flink.settings.sqlSeparator': 'SQL Separator',
'sys.flink.settings.sqlSeparator.note': 'SQL Separator',
'sys.flink.settings.jobIdWait': 'Job submission waiting time',
'sys.flink.settings.jobIdWait.note':
'Maximum waiting time (seconds) for obtaining Job ID when submitting Application or PerJob tasks',
'sys.maven.settings.settingsFilePath': 'Maven configuration file path',
'sys.maven.settings.settingsFilePath.note':
'Maven configuration file path, eg: /opt/maven/conf/settings.xml , please fill in the full path, including the settings.xml file name',
'sys.maven.settings.repository': 'Maven warehouse address',
'sys.maven.settings.repository.note': 'Maven warehouse address',
'sys.maven.settings.repositoryUser': 'Maven warehouse user name',
'sys.maven.settings.repositoryUser.note': 'Maven private server authentication user name',
'sys.maven.settings.repositoryPassword': 'Maven warehouse password',
'sys.maven.settings.repositoryPassword.note':
'Maven private server authentication password, please note: For security reasons, the password will not be displayed in plain text, and it has been desensitized when it returns',
'sys.dolphinscheduler.settings.enable': 'Whether to enable DolphinScheduler',
'sys.dolphinscheduler.settings.enable.note':
'Whether to enable DolphinScheduler, the relevant functions of DolphinScheduler can only be used after it is enabled, please ensure that the relevant configuration of DolphinScheduler is correct',
'sys.dolphinscheduler.settings.url': 'DolphinScheduler address',
'sys.dolphinscheduler.settings.url.note':
'The address must be consistent with the address configured in the DolphinScheduler background, eg: http://127.0.0.1:12345/dolphinscheduler',
'sys.dolphinscheduler.settings.token': 'DolphinScheduler Token',
'sys.dolphinscheduler.settings.token.note':
'DolphinScheduler‘s Token, please create a token in DolphinScheduler’s Security Center->Token Management, and fill in the configuration',
'sys.dolphinscheduler.settings.projectName': 'DolphinScheduler project name',
'sys.dolphinscheduler.settings.projectName.note':
'The project name specified in DolphinScheduler, case insensitive',
//LDAP
'sys.ldap.settings.enable': 'Whether to enable the ldap',
'sys.ldap.settings.enable.note': 'Turn the LDAP login function on',
'sys.ldap.settings.url': 'ldap address of service',
'sys.ldap.settings.url.note': 'ldap address of service,eg:ldap://192.168.111.1:389 ',
'sys.ldap.settings.userDn': 'Login User name (DN)',
'sys.ldap.settings.userDn.note':
'User name for connecting to the ldap service, or the administrator DN',
'sys.ldap.settings.userPassword': 'login password',
'sys.ldap.settings.userPassword.note': 'Password used to connect to the ldap service',
'sys.ldap.settings.timeLimit': 'Connection Timeout',
'sys.ldap.settings.timeLimit.note':
'The maximum time to connect to the ldap service is disconnected',
'sys.ldap.settings.baseDn': 'BaseDn',
'sys.ldap.settings.baseDn.note':
'Dinky will conduct a user search on this base dn,eg:ou=users,dc=dinky,dc=com',
'sys.ldap.settings.filter': 'User filtering rules',
'sys.ldap.settings.filter.note':
'User filtering by using the filter syntax of the ldap,eg: (&(objectClass=inetOrgPerson))',
'sys.ldap.settings.autoload': 'User atically map users when logging in',
'sys.ldap.settings.autoload.note':
'When turned on, when a user logs in with LDAP, if there is no corresponding Dinky user mapping, the LDAP information is automatically pulled to create a Dinky user mapping to it. If this feature is closed, you will not be able to log in for unimported LDAP users',
'sys.ldap.settings.castUsername': 'The LDAP user-name segment',
'sys.ldap.settings.castUsername.note':
'It is necessary to fill in the attribute field of the user in an LDAP to correspond to the Dinky user. Generally, cn or uid indicates the unique identity of the user',
'sys.ldap.settings.castNickname': 'The LDAP nickname field',
'sys.ldap.settings.castNickname.note':
'Need to fill in the attribute field of the user in an LDAP to correspond to the Dinky nickname, must be filled in, generally selected as sn or other identification, not required unique',
'sys.ldap.settings.defaultTeant': 'The LDAP imports the default tenant code',
'sys.ldap.settings.defaultTeant.note':
'After opening the automatic import of users, the new user login needs a default tenant code, otherwise it cannot log in',
'sys.ldap.settings.testConnect': 'Test Connect',
'sys.ldap.settings.testConnect.success': 'Test Connect Successful, {count} users were obtained',
'sys.ldap.settings.testLogin': 'Test Login',
'sys.ldap.settings.loadUser': 'Load User',
'sys.ldap.settings.loadable': 'Whether it can be imported',
// Metrics
'sys.metrics.settings.sys.enable': 'Dinky JVM Monitor switch',
'sys.metrics.settings.sys.enable.note':
'This switch is related to Dinky JVM Monitor, which determines the display of Dinky Server in the monitoring page and the collection of JVM Metrics',
'sys.metrics.settings.sys.gatherTiming': 'Dinky JVM Metrics collection time granularity',
'sys.metrics.settings.sys.gatherTiming.note':
'Dinky JVM Metrics collection time granularity, timed task interval trigger',
'sys.metrics.settings.flink.gatherTiming': 'Flink Metrics collection time granularity',
'sys.metrics.settings.flink.gatherTiming.note':
'Flink Metrics collection time granularity, scheduled task interval trigger',
'sys.metrics.settings.flink.gatherTimeout':
'Flink Metrics collection time granularity, scheduled task interval trigger',
'sys.metrics.settings.flink.gatherTimeout.note':
'Flink Metrics collection timeout period, scheduled task interval trigger (this configuration item should be smaller than Flink Metrics collection time granularity)',
// process // process
'sys.process.id': 'Process ID', 'sys.process.id': 'Process ID',
......
...@@ -797,116 +797,6 @@ export default { ...@@ -797,116 +797,6 @@ export default {
'sys.setting.tag.core': '核心配置', 'sys.setting.tag.core': '核心配置',
'sys.setting.tag.integration': '集成配置', 'sys.setting.tag.integration': '集成配置',
'sys.setting.tag.system': '系统配置', 'sys.setting.tag.system': '系统配置',
'sys.env.settings.pythonHome': 'Python 环境变量',
'sys.env.settings.pythonHome.note': 'Python 环境变量',
'sys.env.settings.dinkyAddr': 'Dinky 地址',
'sys.env.settings.dinkyAddr.note': '该地址必须与Dinky Application后台url中配置的地址相同',
'sys.flink.settings.useRestAPI': '使用 Rest API',
'sys.flink.settings.useRestAPI.note': '在运维 Flink 任务时是否使用 RestAPI',
'sys.flink.settings.sqlSeparator': 'SQL 分隔符',
'sys.flink.settings.sqlSeparator.note': 'SQL 分隔符',
'sys.flink.settings.jobIdWait': 'Job 提交等待时间',
'sys.flink.settings.jobIdWait.note':
'提交 Application 或 PerJob 任务时获取 Job ID 的最大等待时间(秒)',
'sys.maven.settings.settingsFilePath': 'Maven 配置文件路径',
'sys.maven.settings.settingsFilePath.note':
'Maven 配置文件路径, eg: /opt/maven/conf/settings.xml , 请注意填写全路径,包含settings.xml文件名',
'sys.maven.settings.repository': 'Maven 仓库地址',
'sys.maven.settings.repository.note': 'Maven 仓库地址',
'sys.maven.settings.repositoryUser': 'Maven 仓库用户名',
'sys.maven.settings.repositoryUser.note': 'Maven 私服认证用户名',
'sys.maven.settings.repositoryPassword': 'Maven 仓库密码',
'sys.maven.settings.repositoryPassword.note':
'Maven 私服认证密码,请注意: 此处为了安全起见,密码不会显示明文,返回时已做脱敏处理',
'sys.dolphinscheduler.settings.enable': '是否启用 DolphinScheduler',
'sys.dolphinscheduler.settings.enable.note':
'是否启用 DolphinScheduler ,启用后才能使用 DolphinScheduler 的相关功能, 请确保 DolphinScheduler 的相关配置正确',
'sys.dolphinscheduler.settings.url': 'DolphinScheduler 地址',
'sys.dolphinscheduler.settings.url.note':
'地址必须和DolphinScheduler后台配置的地址一致,eg: http://127.0.0.1:12345/dolphinscheduler',
'sys.dolphinscheduler.settings.token': 'DolphinScheduler Token',
'sys.dolphinscheduler.settings.token.note':
'DolphinScheduler的Token,请在DolphinScheduler的安全中心->令牌管理中创建一个token,并填入该配置中',
'sys.dolphinscheduler.settings.projectName': 'DolphinScheduler 项目名',
'sys.dolphinscheduler.settings.projectName.note':
'DolphinScheduler 中指定的项目名称,不区分大小写',
//LDAP
'sys.ldap.settings.enable': '是否启用ldap',
'sys.ldap.settings.enable.note': '开启LDAP登录功能',
'sys.ldap.settings.url': 'ldap服务地址',
'sys.ldap.settings.url.note': 'ldap认证服务地址,例如:ldap://192.168.111.1:389 ',
'sys.ldap.settings.userDn': '登录用户名(DN)',
'sys.ldap.settings.userDn.note': '用于连接ldap服务的用户名,或者管理员DN',
'sys.ldap.settings.userPassword': '登录密码',
'sys.ldap.settings.userPassword.note': '用于连接ldap服务的密码',
// 'sys.ldap.settings.countLimit': '用于连接ldap服务的密码',
// 'sys.ldap.settings.countLimit.note': '用于连接ldap服务的密码',
'sys.ldap.settings.timeLimit': '连接超时',
'sys.ldap.settings.timeLimit.note': '连接ldap服务的最大时间,超过则断开',
'sys.ldap.settings.baseDn': '用户基础DN',
'sys.ldap.settings.baseDn.note': 'Dinky会在此基础dn下进行用户搜索,例如:ou=users,dc=dinky,dc=com',
'sys.ldap.settings.filter': '用户过滤规则',
'sys.ldap.settings.filter.note':
'使用ldap的filter语法进行用户过滤,例如: (&(objectClass=inetOrgPerson))',
'sys.ldap.settings.autoload': '登录时自动映射用户',
'sys.ldap.settings.autoload.note':
'开启后,当用户使用LDAP登录时,如果没有相应的Dinky用户映射,则会自动拉取LDAP信息创建一个Dinky用户与之映射,如果关闭此功能,对于未导入的LDAP用户将无法登录',
'sys.ldap.settings.castUsername': 'LDAP用户名字段',
'sys.ldap.settings.castUsername.note':
'需要填写一个LDAP中用户的属性字段来与Dinky用户对应,必须填写,一般可选为 cn 或者 uid表示用户唯一标识',
'sys.ldap.settings.castNickname': 'LDAP昵称字段',
'sys.ldap.settings.castNickname.note':
'需要填写一个LDAP中用户的属性字段来与Dinky昵称对应,必须填写,一般可选为 sn 或者其他标识,不要求唯一',
'sys.ldap.settings.defaultTeant': 'LDAP导入默认租户编码',
'sys.ldap.settings.defaultTeant.note':
'开启自动导入用户后,新用户登录需要一个默认的租户编码,否则无法登录',
'sys.ldap.settings.testConnect': '测试连接',
'sys.ldap.settings.testConnect.success': '测试连接成功,获取到了{count}个用户',
'sys.ldap.settings.testLogin': '测试登录',
'sys.ldap.settings.loadUser': '导入用户',
'sys.ldap.settings.loadable': '是否可以导入',
// Metrics
'sys.metrics.settings.sys.enable': 'Dinky JVM Monitor 开关',
'sys.metrics.settings.sys.enable.note':
'此开关会关系到Dinky JVM Monitor,决定监控页面中的Dinky Server显示,以及JVM Metrics采集',
'sys.metrics.settings.sys.gatherTiming': 'Dinky JVM Metrics 采集时间粒度',
'sys.metrics.settings.sys.gatherTiming.note': 'Dinky JVM Metrics 采集时间粒度,定时任务间隔触发',
'sys.metrics.settings.flink.gatherTiming': 'Flink Metrics 采集时间粒度',
'sys.metrics.settings.flink.gatherTiming.note': 'Flink Metrics 采集时间粒度,定时任务间隔触发',
'sys.metrics.settings.flink.gatherTimeout': 'Flink Metrics 采集时间粒度,定时任务间隔触发',
'sys.metrics.settings.flink.gatherTimeout.note':
'Flink Metrics 采集超时时长,定时任务间隔触发(此配置项应小于Flink Metrics 采集时间粒度)',
// Resource
'sys.resource.settings.enable': '是否启用Resource',
'sys.resource.settings.enable.note':
'启用资源管理功能,如果切换存储模式时,需关闭此开关,相关配置完成后,再开启',
'sys.resource.settings.upload.base.path': '上传目录的根路径',
// 'sys.resource.settings.upload.base.path.note':'resource store on HDFS/OSS path, resource file will store to this base path, self configuration, please make sure the directory exists on hdfs and have read write permissions. /dinky is recommended',
'sys.resource.settings.upload.base.path.note':
'资源存储在HDFS/OSS路径上,资源文件将存储到此基本路径,自行配置,请确保该目录存在于hdfs上并具有读写权限。推荐:/dinky',
'sys.resource.settings.model': '存储模式:支持HDFS、OSS',
'sys.resource.settings.model.note':
'存储模式:支持HDFS、OSS,切换选项后即可生效,同时并迁移资源文件',
'sys.resource.settings.hdfs.root.user': 'HDFS操作用户名',
'sys.resource.settings.hdfs.root.user.note': 'HDFS操作用户名',
'sys.resource.settings.hdfs.fs.defaultFS': 'HDFS defaultFS',
'sys.resource.settings.hdfs.fs.defaultFS.note':
'fs.defaultFS 配置项,例如远程:hdfs://localhost:9000,本地:file:///',
'sys.resource.settings.oss.endpoint': '对象存储服务的URL',
'sys.resource.settings.oss.endpoint.note':
'对象存储服务的URL,例如:https://oss-cn-hangzhou.aliyuncs.com',
'sys.resource.settings.oss.accessKey': 'Access key就像用户ID,可以唯一标识你的账户',
'sys.resource.settings.oss.accessKey.note': 'Access key就像用户ID,可以唯一标识你的账户',
'sys.resource.settings.oss.secretKey': 'Secret key是你账户的密码',
'sys.resource.settings.oss.secretKey.note': 'Secret key是你账户的密码',
'sys.resource.settings.oss.bucketName': '默认的存储桶名称',
'sys.resource.settings.oss.bucketName.note': '默认的存储桶名称',
'sys.resource.settings.oss.region': '区域',
'sys.resource.settings.oss.region.note': '区域',
// process // process
'sys.process.id': '进程ID', 'sys.process.id': '进程ID',
......
...@@ -73,7 +73,7 @@ const GeneralConfig: React.FC<GeneralConfigProps> = (props) => { ...@@ -73,7 +73,7 @@ const GeneralConfig: React.FC<GeneralConfigProps> = (props) => {
const renderTitle = (entity: BaseConfigProperties) => { const renderTitle = (entity: BaseConfigProperties) => {
return ( return (
<> <>
<Descriptions.Item>{l(`sys.${entity.key}`)}</Descriptions.Item> <Descriptions.Item>{entity.name}</Descriptions.Item>
<Space style={{ marginLeft: 15 }} size={0}> <Space style={{ marginLeft: 15 }} size={0}>
{tag} {tag}
</Space> </Space>
...@@ -94,7 +94,10 @@ const GeneralConfig: React.FC<GeneralConfigProps> = (props) => { ...@@ -94,7 +94,10 @@ const GeneralConfig: React.FC<GeneralConfigProps> = (props) => {
} else if (entity.frontType === 'option') { } else if (entity.frontType === 'option') {
// @ts-ignore // @ts-ignore
return ( return (
<Radio.Group onChange={selectChanges[entity.key]} defaultValue={entity.value.toLowerCase()}> <Radio.Group
onChange={selectChanges ? selectChanges[entity.key] : undefined}
defaultValue={entity.value.toLowerCase()}
>
{entity.example.map((item: any) => { {entity.example.map((item: any) => {
return ( return (
<Radio.Button key={item} value={item.toLowerCase()}> <Radio.Button key={item} value={item.toLowerCase()}>
...@@ -120,7 +123,7 @@ const GeneralConfig: React.FC<GeneralConfigProps> = (props) => { ...@@ -120,7 +123,7 @@ const GeneralConfig: React.FC<GeneralConfigProps> = (props) => {
}, },
description: { description: {
editable: false, editable: false,
render: (dom: any, entity: BaseConfigProperties) => <>{l(`sys.${entity.key}.note`)}</> render: (dom: any, entity: BaseConfigProperties) => <>{entity.note}</>
}, },
content: { content: {
dataIndex: 'value', dataIndex: 'value',
......
...@@ -23,6 +23,9 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => { ...@@ -23,6 +23,9 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => {
hdfs: [] as BaseConfigProperties[], hdfs: [] as BaseConfigProperties[],
oss: [] as BaseConfigProperties[] oss: [] as BaseConfigProperties[]
}); });
const modelKey: string = 'sys.resource.settings.model';
useEffect(() => { useEffect(() => {
if (data.length < 1) { if (data.length < 1) {
return; return;
...@@ -30,14 +33,14 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => { ...@@ -30,14 +33,14 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => {
const needDeleteIndexes: number[] = []; const needDeleteIndexes: number[] = [];
let m; let m;
data.forEach((datum, index) => { data.forEach((datum, index) => {
if (datum.key === 'resource.settings.model') { if (datum.key === modelKey) {
enumCache.base.push(datum); enumCache.base.push(datum);
const modelCase = datum.value.toLowerCase(); const modelCase = datum.value?.toLowerCase();
m = modelCase; m = modelCase;
setModel(modelCase); setModel(modelCase);
return; return;
} }
const v = datum.key.split('.').at(2); const v = datum.key.split('.').at(3);
if (v === 'hdfs' || v === 'oss') { if (v === 'hdfs' || v === 'oss') {
// @ts-ignore // @ts-ignore
enumCache[v].push(datum); enumCache[v].push(datum);
...@@ -74,9 +77,10 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => { ...@@ -74,9 +77,10 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => {
const selectChange = async (value: RadioChangeEvent) => { const selectChange = async (value: RadioChangeEvent) => {
setModel(value.target.value); setModel(value.target.value);
await onSaveHandler({ await onSaveHandler({
name: '',
example: [], example: [],
frontType: '', frontType: '',
key: 'resource.settings.model', key: modelKey,
note: '', note: '',
value: value.target.value.toLocaleUpperCase() value: value.target.value.toLocaleUpperCase()
}); });
...@@ -88,7 +92,7 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => { ...@@ -88,7 +92,7 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => {
onSave={onSaveHandler} onSave={onSaveHandler}
tag={<Tag color={'default'}>{l('sys.setting.tag.integration')}</Tag>} tag={<Tag color={'default'}>{l('sys.setting.tag.integration')}</Tag>}
data={baseData} data={baseData}
selectChanges={{ 'resource.settings.model': selectChange }} selectChanges={{ modelKey: selectChange }}
/> />
</> </>
); );
......
...@@ -72,7 +72,7 @@ const SettingOverView = () => { ...@@ -72,7 +72,7 @@ const SettingOverView = () => {
const { code } = const { code } =
(await handleOption( (await handleOption(
API_CONSTANTS.SYSTEM_MODIFY_CONFIG, API_CONSTANTS.SYSTEM_MODIFY_CONFIG,
l('sys.setting.modify', '', { key: l(`sys.${dataConfig.key}`) }), l('sys.setting.modify', '', { key: dataConfig.name }),
dataConfig dataConfig
)) ?? {}; )) ?? {};
...@@ -80,7 +80,7 @@ const SettingOverView = () => { ...@@ -80,7 +80,7 @@ const SettingOverView = () => {
await fetchData(); await fetchData();
} else { } else {
// @ts-ignore // @ts-ignore
for (const d of data[dataConfig.key.split('.')[0]]) { for (const d of data[dataConfig.key.split('.')[1]]) {
if (d.key === dataConfig.key) { if (d.key === dataConfig.key) {
d.value = dataConfig.value; d.value = dataConfig.value;
break; break;
......
...@@ -68,8 +68,10 @@ export type Settings = { ...@@ -68,8 +68,10 @@ export type Settings = {
metrics: BaseConfigProperties[]; metrics: BaseConfigProperties[];
resource: BaseConfigProperties[]; resource: BaseConfigProperties[];
}; };
export type BaseConfigProperties = { export type BaseConfigProperties = {
key: string; key: string;
name: string;
value: any; value: any;
note: string; note: string;
frontType: string; frontType: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment