diff --git a/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java b/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java index 0921fd56c3..38018cbdea 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ResourceController.java @@ -140,7 +140,6 @@ public Result uploadFile(Integer pid, String desc, @RequestParam("file") M @ApiImplicitParam(name = "id", value = "Resource ID", required = true, dataType = "Integer", paramType = "query") @SaCheckPermission(PermissionConstants.REGISTRATION_RESOURCE_DELETE) public Result remove(Integer id) { - resourcesService.remove(id); - return Result.succeed(); + return resourcesService.remove(id); } } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java index 82105e6c6e..7a7974f845 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/ResourcesDTO.java @@ -45,6 +45,13 @@ public class ResourcesDTO implements Serializable { notes = "The name of the resource file") private String fileName; + @ApiModelProperty( + value = "Parent ID", + dataType = "Integer", + example = "1", + notes = "The unique identifier of the parent resource") + private Integer pid; + @ApiModelProperty( value = "Description", dataType = "String", diff --git a/dinky-admin/src/main/java/org/dinky/service/resource/ResourcesService.java b/dinky-admin/src/main/java/org/dinky/service/resource/ResourcesService.java index f12ba38ec8..5593117e51 100644 --- a/dinky-admin/src/main/java/org/dinky/service/resource/ResourcesService.java +++ b/dinky-admin/src/main/java/org/dinky/service/resource/ResourcesService.java @@ -86,7 +86,7 @@ public interface ResourcesService extends IService { */ void uploadFile(Integer pid, String desc, MultipartFile file); - void remove(Integer id); + Result remove(Integer id); /** * 递归获取所有的资源,从pid到0 diff --git a/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java index e09a0b4672..b29b6d145f 100644 --- a/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/resource/impl/ResourceServiceImpl.java @@ -20,6 +20,7 @@ package org.dinky.service.resource.impl; import org.dinky.data.dto.TreeNodeDTO; +import org.dinky.data.enums.Status; import org.dinky.data.exception.BusException; import org.dinky.data.model.Resources; import org.dinky.data.result.Result; @@ -203,27 +204,32 @@ public void uploadFile(Integer pid, String desc, MultipartFile file) { @Transactional(rollbackFor = Exception.class) @Override - public void remove(Integer id) { + public Result remove(Integer id) { + if (id == -1) { + return Result.failed(Status.ROOT_DIR_NOT_ALLOW_DELETE); + } if (id < 1) { getBaseResourceManager().remove("/"); // todo 删除主目录,实际是清空 - remove(new LambdaQueryWrapper().ne(Resources::getId, 0)); - return; + return remove(new LambdaQueryWrapper().ne(Resources::getId, 0)) + ? Result.succeed(Status.DELETE_SUCCESS) + : Result.failed(Status.DELETE_FAILED); } Resources byId = getById(id); if (!isExistsChildren(id)) { - removeById(id); - return; + return removeById(id) ? Result.succeed(Status.DELETE_SUCCESS) : Result.failed(Status.DELETE_FAILED); } getBaseResourceManager().remove(byId.getFullName()); if (byId.getIsDirectory()) { List resourceByPidToChildren = getResourceByPidToChildren(new ArrayList<>(), byId.getId()); - removeBatchByIds(resourceByPidToChildren); + return removeBatchByIds(resourceByPidToChildren) + ? Result.succeed(Status.DELETE_SUCCESS) + : Result.failed(Status.DELETE_FAILED); } List resourceByPidToParent = getResourceByPidToParent(new ArrayList<>(), byId.getPid()); resourceByPidToParent.forEach(x -> x.setSize(x.getSize() - byId.getSize())); updateBatchById(resourceByPidToParent); - removeById(id); + return removeById(id) ? Result.succeed(Status.DELETE_SUCCESS) : Result.failed(Status.DELETE_FAILED); } private boolean isExistsChildren(Integer id) { 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 1b2a060c36..5754b785e2 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 @@ -77,7 +77,6 @@ public enum Status { EXECUTE_FAILED(9020, "execute.failed"), RESTART_SUCCESS(9021, "restart.success"), RESTART_FAILED(9022, "restart.failed"), - // 已成功停止 STOP_SUCCESS(9023, "stop.success"), STOP_FAILED(9024, "stop.failed"), RENAME_SUCCESS(9025, "rename.success"), @@ -255,6 +254,11 @@ public enum Status { ALERT_RULE_JOB_RUN_EXCEPTION(20005, "alert.rule.jobRunException"), ALERT_RULE_CHECKPOINT_TIMEOUT(20006, "alert.rule.checkpointTimeout"), + /** + * Resource + */ + ROOT_DIR_NOT_ALLOW_DELETE(9031, "root.dir.not.allow.delete"), + /** * global exception */ @@ -327,12 +331,12 @@ public enum Status { 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_ENABLE(156, "sys.resource.settings.base.enable"), + SYS_RESOURCE_SETTINGS_ENABLE_NOTE(157, "sys.resource.settings.base.enable.note"), + SYS_RESOURCE_SETTINGS_UPLOAD_BASE_PATH(158, "sys.resource.settings.base.upload.base.path"), + SYS_RESOURCE_SETTINGS_UPLOAD_BASE_PATH_NOTE(159, "sys.resource.settings.base.upload.base.path.note"), + SYS_RESOURCE_SETTINGS_MODEL(160, "sys.resource.settings.base.model"), + SYS_RESOURCE_SETTINGS_MODEL_NOTE(161, "sys.resource.settings.base.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"), diff --git a/dinky-common/src/main/resources/i18n/messages_en_US.properties b/dinky-common/src/main/resources/i18n/messages_en_US.properties index 15b828174f..cfee88d47b 100644 --- a/dinky-common/src/main/resources/i18n/messages_en_US.properties +++ b/dinky-common/src/main/resources/i18n/messages_en_US.properties @@ -150,7 +150,7 @@ alert.rule.jobRunException=Job Run Exception alert.rule.checkpointTimeout=Checkpoint Timeout daemon.task.config.not.exist=the thread task configuration can not be empty -daemon.task.not.support=threaded task types are notsupported: +daemon.task.not.support=threaded task types are notsupported\uFF1A # system config @@ -177,11 +177,11 @@ sys.dolphinscheduler.settings.enable.note=Whether to enable DolphinScheduler, th 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.token.note=DolphinScheduler\u2018s Token, please create a token in DolphinScheduler\u2019s 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.url.note=ldap address of service\uFF0Ceg\uFF1Aldap://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 @@ -189,9 +189,9 @@ 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.baseDn.note=Dinky will conduct a user search on this base dn,eg\uFF1Aou=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.filter.note=User filtering by using the filter syntax of the ldap\uFF0Ceg 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 @@ -210,20 +210,20 @@ sys.metrics.settings.flink.gatherTiming=Flink Metrics collection time granularit 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.base.enable=Whether to enable Resource +sys.resource.settings.base.enable.note=Enable resource management function. If you switch storage mode, you need to turn off this switch. After the relevant configuration is completed, turn it on again. +sys.resource.settings.base.upload.base.path=Root path of the upload directory +sys.resource.settings.base.upload.base.path.note=Resources are stored on the HDFS/OSS path. Resource files will be stored in this base path. Configure it by yourself. Please ensure that the directory exists on the relevant storage system and has read capabilities. Write permission. recommend +sys.resource.settings.base.model=Storage model +sys.resource.settings.base.model.note=Supports HDFS and OSS, it will take effect after switching the option, and resource files will be migrated at the same time. 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.endpoint.note=For example: https://oss-cn-hangzhou.aliyuncs.com +sys.resource.settings.oss.accessKey=Access key +sys.resource.settings.oss.accessKey.note=Access key is like a user ID that uniquely identifies your account +sys.resource.settings.oss.secretKey=Secret key +sys.resource.settings.oss.secretKey.note=Secret key is the password of your account +sys.resource.settings.oss.bucketName=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 @@ -245,4 +245,8 @@ process.submit.checkSql=Check job process.submit.execute = execute the job process.submit.buildConfig=Build configuration information process.submit.execute.commSql=excute commonSql -process.submit.execute.flinkSql=excute flinkSql \ No newline at end of file +process.submit.execute.flinkSql=excute flinkSql + + +# resource +root.dir.not.allow.delete=The root directory is not allowed to be deleted \ No newline at end of file diff --git a/dinky-common/src/main/resources/i18n/messages_zh_CN.properties b/dinky-common/src/main/resources/i18n/messages_zh_CN.properties index 1c3cf22476..3b21e617d7 100644 --- a/dinky-common/src/main/resources/i18n/messages_zh_CN.properties +++ b/dinky-common/src/main/resources/i18n/messages_zh_CN.properties @@ -1,246 +1,250 @@ -test.connection.success=测试连接成功 -assign.menu.failed=分配菜单失败 -ldap.user.autoload.forbaid=未开启自动映射LDAP用户,请联系管理员导入 -cluster.instance.recycle.success=回收成功 -execute.failed=执行失败 -ldap.user.duplicat=ldap匹配到多个用户数据 -git.branch.not.found=获取不到分支信息 -copy.success=复制成功 -user.superadmin.cannot.disable=超级管理员用户不能停用 -ds.work.flow.not.save=请先保存工作流 -schedule.status.unknown=未知状态: {0} -user.binding.role.delete.all=用户绑定角色删除所有 -modify.failed=修改失败 -git.build.success=构建成功 -menu.has.child=存在子菜单 不允许删除 -tenant.already.exists=租户已存在 -save.failed=保存失败 -assign.menu.success=分配菜单成功 -user.disabled.by.admin=当前用户已被管理员停用 -select.menu=请选择菜单 -role.not.exist=角色不存在 -delete.success=删除成功 -clear.success=清除成功 -move.success=移动成功 -ldap.login.forbid=当前用户登录模式不是LDAP,请联系管理员修改,或不使用LDAP登录 -request.params.not.valid.error=请求参数[{0}]无效 -change.password.failed=修改密码失败 -menu.name.exist=菜单已存在 -ds.task.type.not.support=海豚调度类型为 [{}] 不支持,非DINKY类型 -datasource.connect.normal=数据源连接正常 -restart.success=重启成功 -test.msg.job.log.url=点击查看该任务的异常日志 -user.assign.role.success=用户分配角色成功 -global.params.check.error.value=字段: {0}, 不合法的值: {1} -change.password.success=修改密码成功 -user.not.exist=用户不存在 -refresh.success=刷新成功 -ds.get.node.list.error=节点获取失败 -ldap.default.tenant.nofound=LDAP默认租户不存在 -copy.failed=复制失败 -folder.not.empty=该目录下存在子目录/作业,无法删除 -be.replaced=token 已被顶下线 -datasource.connect.success=数据源连接测试成功 -sign.out.success=退出成功 -added.success=新增成功 -tenant.binding.user=删除租户失败,该租户已绑定用户 -send.test.failed=测试信息发送失败 -delete.failed=删除失败 -role.binding.user=该角色已绑定用户,无法删除 -not.token=未能读取到有效 Token -execute.success=执行成功 -token.freezed=token 已被冻结 -menu.has.assign=菜单已分配,不允许删除 -datasource.status.refresh.success=数据源状态刷新成功 -user.not.login=用户未登录 -tenant.assign.user.failed=分配用户失败 -stop.success=已成功停止 -move.failed=移动失败 -get.tenant.failed=获取租户信息失败 -send.test.success=测试信息发送成功 -login.success=登录成功 -login.password.not.null=登录密码不能为空 -unknown.error=未知异常: {0} -stop.failed=停止失败 -role.name.exist=角色已存在 -ldap.filter.incorrect=用户过滤规则不能为空,请填写相关配置 -tenant.assign.user.success=分配用户成功 -ds.add.work.flow.definition.success=添加工作流定义成功 -expired.token=Token 已过期 -refresh.failed=刷新失败 -operate.success=操作成功 -git.project.not.found=获取不到项目信息 -cluster.instance.heartbeat.success=集群实例心跳成功 -ldap.no.user.found=LDAP连接成功,但未匹配到任何用户 -login.failure=用户登录失败 -request.params.error=请求参数错误 -user.not.binding.tenant=用户未绑定租户 -user.assign.role.failed=用户分配角色失败 -rename.failed=重命名失败 -test.msg.job.name=测试任务 -tenant.binding.user.delete.all=该租户绑定的用户已被全部删除 -menu.not.exist=菜单不存在 -test.msg.job.name.title=任务 -ds.task.not.exist=任务不存在 -global.params.check.error=字段: {0}, {1} -test.msg.title=实时告警监控 -user.name.passwd.error=用户名或密码不正确 -no.prefix=未按照指定前缀提交 token -query.success=查询成功 -ds.work.flow.definition.not.exist=工作流定义不存在 -tenant.name.exist=租户已存在 -failed=获取失败 -added.failed=新增失败 -task.not.exist=任务不存在 -task.is.online=任务已上线,禁止修改 -cluster.instance.deploy=部署完成 -clear.failed=清除失败 -rename.success=重命名成功 -job.release.disabled.update=作业已发布,禁止修改 -success=获取成功 -tenant.not.exist=租户不存在 -user.already.exists=用户名已存在 -git.building=此任务正在构建 -ds.work.flow.definition.task.name.exist=添加失败,工作流定义 [{}] 已存在任务定义 [{}] 请刷新 -role.already.exists=角色已存在 -internal.server.error.args=服务端异常: {0} -kick.out=token 已被踢下线 -restart.failed=重启失败 -invalid.token=无效的 Token -datasource.not.exist=数据源不存在 -datasource.clear.cache.success=清除库表缓存成功 -tenant.admin.already.exists=已存在租户管理员, 租户超管只能有一个 -ds.work.flow.definition.online=工作流定义 [{}] 已经上线 -test.msg.job.url=跳转至该任务 -savepoint.is.null=保存点为空 -git.sort.success=排序成功 -ds.add.task.definition.success=添加任务定义成功 -alert.group.exist=告警组已存在 -git.sort.failed=排序失败 -query.failed=查询失败 -save.success=保存成功 -cluster.instance.kill=已杀死该进程/集群 -cluster.not.exist=集群不存在 -operate.failed=操作失败 -test.connection.failed=测试连接失败 -switching.tenant.success=选择租户成功 -tenant.name.not.exist=租户不存在 -job.instance.not.exist=作业实例不存在 -modify.success=修改成功 -user.old.password.incorrect=用户旧密码不正确 -ldap.user.incorrect=LDAP用户名(DN)不正确 -role.binding.row.permission=该角色已绑定行权限,无法删除 +test.connection.success=\u6D4B\u8BD5\u8FDE\u63A5\u6210\u529F +assign.menu.failed=\u5206\u914D\u83DC\u5355\u5931\u8D25 +ldap.user.autoload.forbaid=\u672A\u5F00\u542F\u81EA\u52A8\u6620\u5C04LDAP\u7528\u6237\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u5BFC\u5165 +cluster.instance.recycle.success=\u56DE\u6536\u6210\u529F +execute.failed=\u6267\u884C\u5931\u8D25 +ldap.user.duplicat=ldap\u5339\u914D\u5230\u591A\u4E2A\u7528\u6237\u6570\u636E +git.branch.not.found=\u83B7\u53D6\u4E0D\u5230\u5206\u652F\u4FE1\u606F +copy.success=\u590D\u5236\u6210\u529F +user.superadmin.cannot.disable=\u8D85\u7EA7\u7BA1\u7406\u5458\u7528\u6237\u4E0D\u80FD\u505C\u7528 +ds.work.flow.not.save=\u8BF7\u5148\u4FDD\u5B58\u5DE5\u4F5C\u6D41 +schedule.status.unknown=\u672A\u77E5\u72B6\u6001: {0} +user.binding.role.delete.all=\u7528\u6237\u7ED1\u5B9A\u89D2\u8272\u5220\u9664\u6240\u6709 +modify.failed=\u4FEE\u6539\u5931\u8D25 +git.build.success=\u6784\u5EFA\u6210\u529F +menu.has.child=\u5B58\u5728\u5B50\u83DC\u5355 \u4E0D\u5141\u8BB8\u5220\u9664 +tenant.already.exists=\u79DF\u6237\u5DF2\u5B58\u5728 +save.failed=\u4FDD\u5B58\u5931\u8D25 +assign.menu.success=\u5206\u914D\u83DC\u5355\u6210\u529F +user.disabled.by.admin=\u5F53\u524D\u7528\u6237\u5DF2\u88AB\u7BA1\u7406\u5458\u505C\u7528 +select.menu=\u8BF7\u9009\u62E9\u83DC\u5355 +role.not.exist=\u89D2\u8272\u4E0D\u5B58\u5728 +delete.success=\u5220\u9664\u6210\u529F +clear.success=\u6E05\u9664\u6210\u529F +move.success=\u79FB\u52A8\u6210\u529F +ldap.login.forbid=\u5F53\u524D\u7528\u6237\u767B\u5F55\u6A21\u5F0F\u4E0D\u662FLDAP\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u4FEE\u6539,\u6216\u4E0D\u4F7F\u7528LDAP\u767B\u5F55 +request.params.not.valid.error=\u8BF7\u6C42\u53C2\u6570[{0}]\u65E0\u6548 +change.password.failed=\u4FEE\u6539\u5BC6\u7801\u5931\u8D25 +menu.name.exist=\u83DC\u5355\u5DF2\u5B58\u5728 +ds.task.type.not.support=\u6D77\u8C5A\u8C03\u5EA6\u7C7B\u578B\u4E3A [{}] \u4E0D\u652F\u6301,\u975EDINKY\u7C7B\u578B +datasource.connect.normal=\u6570\u636E\u6E90\u8FDE\u63A5\u6B63\u5E38 +restart.success=\u91CD\u542F\u6210\u529F +test.msg.job.log.url=\u70B9\u51FB\u67E5\u770B\u8BE5\u4EFB\u52A1\u7684\u5F02\u5E38\u65E5\u5FD7 +user.assign.role.success=\u7528\u6237\u5206\u914D\u89D2\u8272\u6210\u529F +global.params.check.error.value=\u5B57\u6BB5: {0}, \u4E0D\u5408\u6CD5\u7684\u503C: {1} +change.password.success=\u4FEE\u6539\u5BC6\u7801\u6210\u529F +user.not.exist=\u7528\u6237\u4E0D\u5B58\u5728 +refresh.success=\u5237\u65B0\u6210\u529F +ds.get.node.list.error=\u8282\u70B9\u83B7\u53D6\u5931\u8D25 +ldap.default.tenant.nofound=LDAP\u9ED8\u8BA4\u79DF\u6237\u4E0D\u5B58\u5728 +copy.failed=\u590D\u5236\u5931\u8D25 +folder.not.empty=\u8BE5\u76EE\u5F55\u4E0B\u5B58\u5728\u5B50\u76EE\u5F55/\u4F5C\u4E1A\uFF0C\u65E0\u6CD5\u5220\u9664 +be.replaced=token \u5DF2\u88AB\u9876\u4E0B\u7EBF +datasource.connect.success=\u6570\u636E\u6E90\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F +sign.out.success=\u9000\u51FA\u6210\u529F +added.success=\u65B0\u589E\u6210\u529F +tenant.binding.user=\u5220\u9664\u79DF\u6237\u5931\u8D25\uFF0C\u8BE5\u79DF\u6237\u5DF2\u7ED1\u5B9A\u7528\u6237 +send.test.failed=\u6D4B\u8BD5\u4FE1\u606F\u53D1\u9001\u5931\u8D25 +delete.failed=\u5220\u9664\u5931\u8D25 +role.binding.user=\u8BE5\u89D2\u8272\u5DF2\u7ED1\u5B9A\u7528\u6237\uFF0C\u65E0\u6CD5\u5220\u9664 +not.token=\u672A\u80FD\u8BFB\u53D6\u5230\u6709\u6548 Token +execute.success=\u6267\u884C\u6210\u529F +token.freezed=token \u5DF2\u88AB\u51BB\u7ED3 +menu.has.assign=\u83DC\u5355\u5DF2\u5206\u914D,\u4E0D\u5141\u8BB8\u5220\u9664 +datasource.status.refresh.success=\u6570\u636E\u6E90\u72B6\u6001\u5237\u65B0\u6210\u529F +user.not.login=\u7528\u6237\u672A\u767B\u5F55 +tenant.assign.user.failed=\u5206\u914D\u7528\u6237\u5931\u8D25 +stop.success=\u5DF2\u6210\u529F\u505C\u6B62 +move.failed=\u79FB\u52A8\u5931\u8D25 +get.tenant.failed=\u83B7\u53D6\u79DF\u6237\u4FE1\u606F\u5931\u8D25 +send.test.success=\u6D4B\u8BD5\u4FE1\u606F\u53D1\u9001\u6210\u529F +login.success=\u767B\u5F55\u6210\u529F +login.password.not.null=\u767B\u5F55\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A +unknown.error=\u672A\u77E5\u5F02\u5E38: {0} +stop.failed=\u505C\u6B62\u5931\u8D25 +role.name.exist=\u89D2\u8272\u5DF2\u5B58\u5728 +ldap.filter.incorrect=\u7528\u6237\u8FC7\u6EE4\u89C4\u5219\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u914D\u7F6E +tenant.assign.user.success=\u5206\u914D\u7528\u6237\u6210\u529F +ds.add.work.flow.definition.success=\u6DFB\u52A0\u5DE5\u4F5C\u6D41\u5B9A\u4E49\u6210\u529F +expired.token=Token \u5DF2\u8FC7\u671F +refresh.failed=\u5237\u65B0\u5931\u8D25 +operate.success=\u64CD\u4F5C\u6210\u529F +git.project.not.found=\u83B7\u53D6\u4E0D\u5230\u9879\u76EE\u4FE1\u606F +cluster.instance.heartbeat.success=\u96C6\u7FA4\u5B9E\u4F8B\u5FC3\u8DF3\u6210\u529F +ldap.no.user.found=LDAP\u8FDE\u63A5\u6210\u529F\uFF0C\u4F46\u672A\u5339\u914D\u5230\u4EFB\u4F55\u7528\u6237 +login.failure=\u7528\u6237\u767B\u5F55\u5931\u8D25 +request.params.error=\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF +user.not.binding.tenant=\u7528\u6237\u672A\u7ED1\u5B9A\u79DF\u6237 +user.assign.role.failed=\u7528\u6237\u5206\u914D\u89D2\u8272\u5931\u8D25 +rename.failed=\u91CD\u547D\u540D\u5931\u8D25 +test.msg.job.name=\u6D4B\u8BD5\u4EFB\u52A1 +tenant.binding.user.delete.all=\u8BE5\u79DF\u6237\u7ED1\u5B9A\u7684\u7528\u6237\u5DF2\u88AB\u5168\u90E8\u5220\u9664 +menu.not.exist=\u83DC\u5355\u4E0D\u5B58\u5728 +test.msg.job.name.title=\u4EFB\u52A1 +ds.task.not.exist=\u4EFB\u52A1\u4E0D\u5B58\u5728 +global.params.check.error=\u5B57\u6BB5: {0}, {1} +test.msg.title=\u5B9E\u65F6\u544A\u8B66\u76D1\u63A7 +user.name.passwd.error=\u7528\u6237\u540D\u6216\u5BC6\u7801\u4E0D\u6B63\u786E +no.prefix=\u672A\u6309\u7167\u6307\u5B9A\u524D\u7F00\u63D0\u4EA4 token +query.success=\u67E5\u8BE2\u6210\u529F +ds.work.flow.definition.not.exist=\u5DE5\u4F5C\u6D41\u5B9A\u4E49\u4E0D\u5B58\u5728 +tenant.name.exist=\u79DF\u6237\u5DF2\u5B58\u5728 +failed=\u83B7\u53D6\u5931\u8D25 +added.failed=\u65B0\u589E\u5931\u8D25 +task.not.exist=\u4EFB\u52A1\u4E0D\u5B58\u5728 +task.is.online=\u4EFB\u52A1\u5DF2\u4E0A\u7EBF\uFF0C\u7981\u6B62\u4FEE\u6539 +cluster.instance.deploy=\u90E8\u7F72\u5B8C\u6210 +clear.failed=\u6E05\u9664\u5931\u8D25 +rename.success=\u91CD\u547D\u540D\u6210\u529F +job.release.disabled.update=\u4F5C\u4E1A\u5DF2\u53D1\u5E03\uFF0C\u7981\u6B62\u4FEE\u6539 +success=\u83B7\u53D6\u6210\u529F +tenant.not.exist=\u79DF\u6237\u4E0D\u5B58\u5728 +user.already.exists=\u7528\u6237\u540D\u5DF2\u5B58\u5728 +git.building=\u6B64\u4EFB\u52A1\u6B63\u5728\u6784\u5EFA +ds.work.flow.definition.task.name.exist=\u6DFB\u52A0\u5931\u8D25,\u5DE5\u4F5C\u6D41\u5B9A\u4E49 [{}] \u5DF2\u5B58\u5728\u4EFB\u52A1\u5B9A\u4E49 [{}] \u8BF7\u5237\u65B0 +role.already.exists=\u89D2\u8272\u5DF2\u5B58\u5728 +internal.server.error.args=\u670D\u52A1\u7AEF\u5F02\u5E38: {0} +kick.out=token \u5DF2\u88AB\u8E22\u4E0B\u7EBF +restart.failed=\u91CD\u542F\u5931\u8D25 +invalid.token=\u65E0\u6548\u7684 Token +datasource.not.exist=\u6570\u636E\u6E90\u4E0D\u5B58\u5728 +datasource.clear.cache.success=\u6E05\u9664\u5E93\u8868\u7F13\u5B58\u6210\u529F +tenant.admin.already.exists=\u5DF2\u5B58\u5728\u79DF\u6237\u7BA1\u7406\u5458, \u79DF\u6237\u8D85\u7BA1\u53EA\u80FD\u6709\u4E00\u4E2A +ds.work.flow.definition.online=\u5DE5\u4F5C\u6D41\u5B9A\u4E49 [{}] \u5DF2\u7ECF\u4E0A\u7EBF +test.msg.job.url=\u8DF3\u8F6C\u81F3\u8BE5\u4EFB\u52A1 +savepoint.is.null=\u4FDD\u5B58\u70B9\u4E3A\u7A7A +git.sort.success=\u6392\u5E8F\u6210\u529F +ds.add.task.definition.success=\u6DFB\u52A0\u4EFB\u52A1\u5B9A\u4E49\u6210\u529F +alert.group.exist=\u544A\u8B66\u7EC4\u5DF2\u5B58\u5728 +git.sort.failed=\u6392\u5E8F\u5931\u8D25 +query.failed=\u67E5\u8BE2\u5931\u8D25 +save.success=\u4FDD\u5B58\u6210\u529F +cluster.instance.kill=\u5DF2\u6740\u6B7B\u8BE5\u8FDB\u7A0B/\u96C6\u7FA4 +cluster.not.exist=\u96C6\u7FA4\u4E0D\u5B58\u5728 +operate.failed=\u64CD\u4F5C\u5931\u8D25 +test.connection.failed=\u6D4B\u8BD5\u8FDE\u63A5\u5931\u8D25 +switching.tenant.success=\u9009\u62E9\u79DF\u6237\u6210\u529F +tenant.name.not.exist=\u79DF\u6237\u4E0D\u5B58\u5728 +job.instance.not.exist=\u4F5C\u4E1A\u5B9E\u4F8B\u4E0D\u5B58\u5728 +modify.success=\u4FEE\u6539\u6210\u529F +user.old.password.incorrect=\u7528\u6237\u65E7\u5BC6\u7801\u4E0D\u6B63\u786E +ldap.user.incorrect=LDAP\u7528\u6237\u540D\uFF08DN\uFF09\u4E0D\u6B63\u786E +role.binding.row.permission=\u8BE5\u89D2\u8272\u5DF2\u7ED1\u5B9A\u884C\u6743\u9650\uFF0C\u65E0\u6CD5\u5220\u9664 # dinky-admin -unknown.i18n=未知 i18n 信息,请检查. . . +unknown.i18n=\u672A\u77E5 i18n \u4FE1\u606F,\u8BF7\u68C0\u67E5. . . -file.upload.failed=文件上传失败, 原因: {0} +file.upload.failed=\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25, \u539F\u56E0: {0} -hdfs.init.failed=内部hdfs信息错误, 原因: {0} -hdfs.file.lose= 在工程根目录下没有找到core-site.xml/hdfs-site.xml/yarn-site.xml文件, 请先上传这些文件 +hdfs.init.failed=\u5185\u90E8hdfs\u4FE1\u606F\u9519\u8BEF, \u539F\u56E0: {0} +hdfs.file.lose= \u5728\u5DE5\u7A0B\u6839\u76EE\u5F55\u4E0B\u6CA1\u6709\u627E\u5230core-site.xml/hdfs-site.xml/yarn-site.xml\u6587\u4EF6, \u8BF7\u5148\u4E0A\u4F20\u8FD9\u4E9B\u6587\u4EF6 -daemon.task.config.not.exist=线程任务配置不能为空 -daemon.task.not.support=不支持线程任务类型: +daemon.task.config.not.exist=\u7EBF\u7A0B\u4EFB\u52A1\u914D\u7F6E\u4E0D\u80FD\u4E3A\u7A7A +daemon.task.not.support=\u4E0D\u652F\u6301\u7EBF\u7A0B\u4EFB\u52A1\u7C7B\u578B\uFF1A # dinky-alert -alert.rule.jobFail=作业失败 -alert.rule.getJobInfoFail=获取作业信息失败 -alert.rule.jobRestart=作业重启 -alert.rule.checkpointFail=checkpoint失败 -alert.rule.jobRunException=作业运行异常 -alert.rule.checkpointTimeout=checkpoint超时 +alert.rule.jobFail=\u4F5C\u4E1A\u5931\u8D25 +alert.rule.getJobInfoFail=\u83B7\u53D6\u4F5C\u4E1A\u4FE1\u606F\u5931\u8D25 +alert.rule.jobRestart=\u4F5C\u4E1A\u91CD\u542F +alert.rule.checkpointFail=checkpoint\u5931\u8D25 +alert.rule.jobRunException=\u4F5C\u4E1A\u8FD0\u884C\u5F02\u5E38 +alert.rule.checkpointTimeout=checkpoint\u8D85\u65F6 # 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.flink.settings.useRestAPI=\u4F7F\u7528 Rest API +sys.flink.settings.useRestAPI.note=\u5728\u8FD0\u7EF4 Flink \u4EFB\u52A1\u65F6\u662F\u5426\u4F7F\u7528 RestAPI +sys.flink.settings.sqlSeparator=SQL \u5206\u9694\u7B26 +sys.flink.settings.sqlSeparator.note=SQL \u5206\u9694\u7B26 +sys.flink.settings.jobIdWait=Job \u63D0\u4EA4\u7B49\u5F85\u65F6\u95F4 +sys.flink.settings.jobIdWait.note=\u63D0\u4EA4 Application \u6216 PerJob \u4EFB\u52A1\u65F6\u83B7\u53D6 Job ID \u7684\u6700\u5927\u7B49\u5F85\u65F6\u95F4\uFF08\u79D2\uFF09 +sys.maven.settings.settingsFilePath=Maven \u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84 +sys.maven.settings.settingsFilePath.note=Maven \u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84, eg +sys.maven.settings.repository=Maven \u4ED3\u5E93\u5730\u5740 +sys.maven.settings.repository.note=Maven \u4ED3\u5E93\u5730\u5740 +sys.maven.settings.repositoryUser=Maven \u4ED3\u5E93\u7528\u6237\u540D +sys.maven.settings.repositoryUser.note=Maven \u79C1\u670D\u8BA4\u8BC1\u7528\u6237\u540D +sys.maven.settings.repositoryPassword=Maven \u4ED3\u5E93\u5BC6\u7801 +sys.maven.settings.repositoryPassword.note=Maven \u79C1\u670D\u8BA4\u8BC1\u5BC6\u7801,\u8BF7\u6CE8\u610F +sys.env.settings.pythonHome=Python \u73AF\u5883\u53D8\u91CF +sys.env.settings.pythonHome.note=Python \u73AF\u5883\u53D8\u91CF +sys.env.settings.dinkyAddr=Dinky \u5730\u5740 +sys.env.settings.dinkyAddr.note=\u8BE5\u5730\u5740\u5FC5\u987B\u4E0EDinky Application\u540E\u53F0url\u4E2D\u914D\u7F6E\u7684\u5730\u5740\u76F8\u540C +sys.dolphinscheduler.settings.enable=\u662F\u5426\u542F\u7528 DolphinScheduler +sys.dolphinscheduler.settings.enable.note=\u662F\u5426\u542F\u7528 DolphinScheduler ,\u542F\u7528\u540E\u624D\u80FD\u4F7F\u7528 DolphinScheduler \u7684\u76F8\u5173\u529F\u80FD, \u8BF7\u786E\u4FDD DolphinScheduler \u7684\u76F8\u5173\u914D\u7F6E\u6B63\u786E +sys.dolphinscheduler.settings.url=DolphinScheduler \u5730\u5740 +sys.dolphinscheduler.settings.url.note=\u5730\u5740\u5FC5\u987B\u548CDolphinScheduler\u540E\u53F0\u914D\u7F6E\u7684\u5730\u5740\u4E00\u81F4\uFF0Ceg: 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.dolphinscheduler.settings.token.note=DolphinScheduler\u7684Token\uFF0C\u8BF7\u5728DolphinScheduler\u7684\u5B89\u5168\u4E2D\u5FC3->\u4EE4\u724C\u7BA1\u7406\u4E2D\u521B\u5EFA\u4E00\u4E2Atoken\uFF0C\u5E76\u586B\u5165\u8BE5\u914D\u7F6E\u4E2D +sys.dolphinscheduler.settings.projectName=DolphinScheduler \u9879\u76EE\u540D +sys.dolphinscheduler.settings.projectName.note=DolphinScheduler \u4E2D\u6307\u5B9A\u7684\u9879\u76EE\u540D\u79F0\uFF0C\u4E0D\u533A\u5206\u5927\u5C0F\u5199 +sys.ldap.settings.url=ldap\u670D\u52A1\u5730\u5740 +sys.ldap.settings.url.note=ldap\u8BA4\u8BC1\u670D\u52A1\u5730\u5740\uFF0C\u4F8B\u5982\uFF1Aldap://192.168.111.1:389 +sys.ldap.settings.userDn=\u767B\u5F55\u7528\u6237\u540D\uFF08DN\uFF09 +sys.ldap.settings.userDn.note=\u7528\u4E8E\u8FDE\u63A5ldap\u670D\u52A1\u7684\u7528\u6237\u540D\uFF0C\u6216\u8005\u7BA1\u7406\u5458DN +sys.ldap.settings.userPassword=\u767B\u5F55\u5BC6\u7801 +sys.ldap.settings.userPassword.note=\u7528\u4E8E\u8FDE\u63A5ldap\u670D\u52A1\u7684\u5BC6\u7801 +sys.ldap.settings.timeLimit=\u8FDE\u63A5\u8D85\u65F6 +sys.ldap.settings.timeLimit.note=\u8FDE\u63A5ldap\u670D\u52A1\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u8D85\u8FC7\u5219\u65AD\u5F00 +sys.ldap.settings.baseDn=\u7528\u6237\u57FA\u7840DN +sys.ldap.settings.baseDn.note=Dinky\u4F1A\u5728\u6B64\u57FA\u7840dn\u4E0B\u8FDB\u884C\u7528\u6237\u641C\u7D22,\u4F8B\u5982\uFF1Aou=users,dc=dinky,dc=com +sys.ldap.settings.filter=\u7528\u6237\u8FC7\u6EE4\u89C4\u5219 +sys.ldap.settings.filter.note=\u4F7F\u7528ldap\u7684filter\u8BED\u6CD5\u8FDB\u884C\u7528\u6237\u8FC7\u6EE4\uFF0C\u4F8B\u5982 +sys.ldap.settings.autoload=\u767B\u5F55\u65F6\u81EA\u52A8\u6620\u5C04\u7528\u6237 +sys.ldap.settings.autoload.note=\u5F00\u542F\u540E\uFF0C\u5F53\u7528\u6237\u4F7F\u7528LDAP\u767B\u5F55\u65F6\uFF0C\u5982\u679C\u6CA1\u6709\u76F8\u5E94\u7684Dinky\u7528\u6237\u6620\u5C04\uFF0C\u5219\u4F1A\u81EA\u52A8\u62C9\u53D6LDAP\u4FE1\u606F\u521B\u5EFA\u4E00\u4E2ADinky\u7528\u6237\u4E0E\u4E4B\u6620\u5C04\uFF0C\u5982\u679C\u5173\u95ED\u6B64\u529F\u80FD\uFF0C\u5BF9\u4E8E\u672A\u5BFC\u5165\u7684LDAP\u7528\u6237\u5C06\u65E0\u6CD5\u767B\u5F55 +sys.ldap.settings.defaultTeant=LDAP\u5BFC\u5165\u9ED8\u8BA4\u79DF\u6237\u7F16\u7801 +sys.ldap.settings.defaultTeant.note=\u5F00\u542F\u81EA\u52A8\u5BFC\u5165\u7528\u6237\u540E\uFF0C\u65B0\u7528\u6237\u767B\u5F55\u9700\u8981\u4E00\u4E2A\u9ED8\u8BA4\u7684\u79DF\u6237\u7F16\u7801\uFF0C\u5426\u5219\u65E0\u6CD5\u767B\u5F55 +sys.ldap.settings.castUsername=LDAP\u7528\u6237\u540D\u5B57\u6BB5 +sys.ldap.settings.castUsername.note=\u9700\u8981\u586B\u5199\u4E00\u4E2ALDAP\u4E2D\u7528\u6237\u7684\u5C5E\u6027\u5B57\u6BB5\u6765\u4E0EDinky\u7528\u6237\u5BF9\u5E94\uFF0C\u5FC5\u987B\u586B\u5199\uFF0C\u4E00\u822C\u53EF\u9009\u4E3A cn \u6216\u8005 uid\u8868\u793A\u7528\u6237\u552F\u4E00\u6807\u8BC6 +sys.ldap.settings.castNickname=LDAP\u6635\u79F0\u5B57\u6BB5 +sys.ldap.settings.castNickname.note=\u9700\u8981\u586B\u5199\u4E00\u4E2ALDAP\u4E2D\u7528\u6237\u7684\u5C5E\u6027\u5B57\u6BB5\u6765\u4E0EDinky\u6635\u79F0\u5BF9\u5E94\uFF0C\u5FC5\u987B\u586B\u5199\uFF0C\u4E00\u822C\u53EF\u9009\u4E3A sn \u6216\u8005\u5176\u4ED6\u6807\u8BC6\uFF0C\u4E0D\u8981\u6C42\u552F\u4E00 +sys.ldap.settings.enable=\u662F\u5426\u542F\u7528ldap +sys.ldap.settings.enable.note=\u5F00\u542FLDAP\u767B\u5F55\u529F\u80FD +sys.metrics.settings.sys.enable=Dinky JVM Monitor \u5F00\u5173 +sys.metrics.settings.sys.enable.note=\u6B64\u5F00\u5173\u4F1A\u5173\u7CFB\u5230Dinky JVM Monitor\uFF0C\u51B3\u5B9A\u76D1\u63A7\u9875\u9762\u4E2D\u7684Dinky Server\u663E\u793A\uFF0C\u4EE5\u53CAJVM Metrics\u91C7\u96C6 +sys.metrics.settings.sys.gatherTiming=Dinky JVM Metrics \u91C7\u96C6\u65F6\u95F4\u7C92\u5EA6 +sys.metrics.settings.sys.gatherTiming.note=Dinky JVM Metrics \u91C7\u96C6\u65F6\u95F4\u7C92\u5EA6\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694\u89E6\u53D1 +sys.metrics.settings.flink.gatherTiming=Flink Metrics \u91C7\u96C6\u65F6\u95F4\u7C92\u5EA6 +sys.metrics.settings.flink.gatherTiming.note=Flink Metrics \u91C7\u96C6\u65F6\u95F4\u7C92\u5EA6\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694\u89E6\u53D1 +sys.metrics.settings.flink.gatherTimeout=Flink Metrics \u91C7\u96C6\u65F6\u95F4\u7C92\u5EA6\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694\u89E6\u53D1 +sys.metrics.settings.flink.gatherTimeout.note=Flink Metrics \u91C7\u96C6\u8D85\u65F6\u65F6\u957F\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694\u89E6\u53D1\uFF08\u6B64\u914D\u7F6E\u9879\u5E94\u5C0F\u4E8EFlink Metrics \u91C7\u96C6\u65F6\u95F4\u7C92\u5EA6\uFF09 +sys.resource.settings.base.enable=\u662F\u5426\u542F\u7528Resource +sys.resource.settings.base.enable.note=\u542F\u7528\u8D44\u6E90\u7BA1\u7406\u529F\u80FD\uFF0C\u5982\u679C\u5207\u6362\u5B58\u50A8\u6A21\u5F0F\u65F6\uFF0C\u9700\u5173\u95ED\u6B64\u5F00\u5173\uFF0C\u76F8\u5173\u914D\u7F6E\u5B8C\u6210\u540E\uFF0C\u518D\u5F00\u542F +sys.resource.settings.base.upload.base.path=\u4E0A\u4F20\u76EE\u5F55\u7684\u6839\u8DEF\u5F84 +sys.resource.settings.base.upload.base.path.note=\u8D44\u6E90\u5B58\u50A8\u5728HDFS/OSS\u8DEF\u5F84\u4E0A\uFF0C\u8D44\u6E90\u6587\u4EF6\u5C06\u5B58\u50A8\u5230\u6B64\u57FA\u672C\u8DEF\u5F84\uFF0C\u81EA\u884C\u914D\u7F6E\uFF0C\u8BF7\u786E\u4FDD\u8BE5\u76EE\u5F55\u5B58\u5728\u4E8E\u76F8\u5173\u5B58\u50A8\u7CFB\u7EDF\u4E0A\u5E76\u5177\u6709\u8BFB\u5199\u6743\u9650\u3002\u63A8\u8350 +sys.resource.settings.base.model=\u5B58\u50A8\u6A21\u5F0F +sys.resource.settings.base.model.note=\u652F\u6301HDFS\u3001OSS\uFF0C\u5207\u6362\u9009\u9879\u540E\u5373\u53EF\u751F\u6548\uFF0C\u540C\u65F6\u5E76\u8FC1\u79FB\u8D44\u6E90\u6587\u4EF6 +sys.resource.settings.oss.endpoint=\u5BF9\u8C61\u5B58\u50A8\u670D\u52A1\u7684URL +sys.resource.settings.oss.endpoint.note=\u4F8B\u5982\uFF1Ahttps://oss-cn-hangzhou.aliyuncs.com +sys.resource.settings.oss.accessKey=Access key +sys.resource.settings.oss.accessKey.note=Access key\u5C31\u50CF\u7528\u6237ID\uFF0C\u53EF\u4EE5\u552F\u4E00\u6807\u8BC6\u4F60\u7684\u8D26\u6237 +sys.resource.settings.oss.secretKey=Secret key +sys.resource.settings.oss.secretKey.note=Secret key\u662F\u4F60\u8D26\u6237\u7684\u5BC6\u7801 +sys.resource.settings.oss.bucketName=\u5B58\u50A8\u6876\u540D\u79F0 +sys.resource.settings.oss.bucketName.note=\u9ED8\u8BA4\u7684\u5B58\u50A8\u6876\u540D\u79F0 +sys.resource.settings.oss.region=\u533A\u57DF +sys.resource.settings.oss.region.note=\u533A\u57DF +sys.resource.settings.hdfs.root.user=HDFS\u64CD\u4F5C\u7528\u6237\u540D +sys.resource.settings.hdfs.root.user.note=HDFS\u64CD\u4F5C\u7528\u6237\u540D sys.resource.settings.hdfs.fs.defaultFS=HDFS defaultFS -sys.resource.settings.hdfs.fs.defaultFS.note=fs.defaultFS 配置项,例如远程:hdfs://localhost:9000,本地:file:/// +sys.resource.settings.hdfs.fs.defaultFS.note=fs.defaultFS \u914D\u7F6E\u9879\uFF0C\u4F8B\u5982\u8FDC\u7A0B\uFF1Ahdfs://localhost:9000\uFF0C\u672C\u5730\uFF1Afile:/// #Dinky Gateway -gateway.kubernetes.test.failed=测试 Flink 配置失败: +gateway.kubernetes.test.failed=\u6D4B\u8BD5 Flink \u914D\u7F6E\u5931\u8D25\uFF1A # Task -task.status.is.not.done=当前发布状态下有作业正在运行,上线失败,请停止后上线 -task.sql.explain.failed=sql解析失败,请检查 -task.update.failed=Task更新失败 +task.status.is.not.done=\u5F53\u524D\u53D1\u5E03\u72B6\u6001\u4E0B\u6709\u4F5C\u4E1A\u6B63\u5728\u8FD0\u884C\uFF0C\u4E0A\u7EBF\u5931\u8D25\uFF0C\u8BF7\u505C\u6B62\u540E\u4E0A\u7EBF +task.sql.explain.failed=sql\u89E3\u6790\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 +task.update.failed=Task\u66F4\u65B0\u5931\u8D25 # process -process.submit.submitTask=提交作业 -process.submit.checkSql=检查作业 -process.submit.execute=执行作业 -process.submit.buildConfig=构建配置信息 -process.submit.execute.commSql=执行普通sql -process.submit.execute.flinkSql=执行flinkSql \ No newline at end of file +process.submit.submitTask=\u63D0\u4EA4\u4F5C\u4E1A +process.submit.checkSql=\u68C0\u67E5\u4F5C\u4E1A +process.submit.execute=\u6267\u884C\u4F5C\u4E1A +process.submit.buildConfig=\u6784\u5EFA\u914D\u7F6E\u4FE1\u606F +process.submit.execute.commSql=\u6267\u884C\u666E\u901Asql +process.submit.execute.flinkSql=\u6267\u884CflinkSql + + +# resource +root.dir.not.allow.delete=\u6839\u76EE\u5F55\u4E0D\u5141\u8BB8\u5220\u9664 \ No newline at end of file diff --git a/dinky-web/src/locales/en-US/global.ts b/dinky-web/src/locales/en-US/global.ts index 32321aa3a8..77a82411b9 100644 --- a/dinky-web/src/locales/en-US/global.ts +++ b/dinky-web/src/locales/en-US/global.ts @@ -152,6 +152,7 @@ export default { 'global.table.lifecycle.publish': 'Publish', 'global.table.lifecycle.stopped': 'Stopped', 'global.table.lifecycle.online': 'Online', + 'global.table.lifecycle.offline': 'Offline', 'global.table.lifecycle.unknown': 'Unknown', 'global.table.execmode': 'Execution mode', 'global.table.runmode': 'Run Mode', diff --git a/dinky-web/src/locales/en-US/pages.ts b/dinky-web/src/locales/en-US/pages.ts index 1704553d0d..4a86396fb4 100644 --- a/dinky-web/src/locales/en-US/pages.ts +++ b/dinky-web/src/locales/en-US/pages.ts @@ -807,9 +807,17 @@ export default { 'rc.gv.value': 'Value', 'rc.gv.valuePlaceholder': 'Please enter the Global Variable value', 'rc.resource.click': 'Click left file to view details', - 'rc.resource.noResource': - '\t\tNo resources\nPlease Click the button above to upload folders/files', + 'rc.resource.click.tip1': + 'please make sure the resource configuration is correct, otherwise it will cause resource upload failure!', + 'rc.resource.click.tip2': + 'If the resource configuration of your configuration center does not configure the resource upload path or use the default resource upload path (/dinky)', + 'rc.resource.click.tip3': 'You can click the link on the right to configure ->', 'rc.resource.upload': 'Upload Files/Folders', + 'rc.resource.upload.success': 'File [{fileName}] Upload successfully', + 'rc.resource.upload.fail': 'File [{fileName}] Upload failed', + 'rc.resource.upload.tip1': 'Click or drag file to this area to upload', + 'rc.resource.upload.tip2': + 'Support for a single or bulk upload. Strictly prohibited from uploading company data or\n other banned files.', 'rc.template.codeType': 'Code Type', 'rc.template.codeTypePlaceholder': 'Please select code type! ', 'rc.template.create': 'Create UDF Template', diff --git a/dinky-web/src/locales/zh-CN/global.ts b/dinky-web/src/locales/zh-CN/global.ts index 8d04e820e0..cd9152c5e7 100644 --- a/dinky-web/src/locales/zh-CN/global.ts +++ b/dinky-web/src/locales/zh-CN/global.ts @@ -148,6 +148,7 @@ export default { 'global.table.lifecycle.publish': '已发布', 'global.table.lifecycle.stopped': '已停止', 'global.table.lifecycle.online': '已上线', + 'global.table.lifecycle.offline': '已下线', 'global.table.lifecycle.unknown': '未知', 'global.table.execmode': '执行模式', 'global.table.execmode.batch': '批模式', diff --git a/dinky-web/src/locales/zh-CN/pages.ts b/dinky-web/src/locales/zh-CN/pages.ts index 0768579a10..76170bf886 100644 --- a/dinky-web/src/locales/zh-CN/pages.ts +++ b/dinky-web/src/locales/zh-CN/pages.ts @@ -775,8 +775,15 @@ export default { 'rc.gv.value': '变量值', 'rc.gv.valuePlaceholder': '请输入全局变量值', 'rc.resource.click': '点击左侧文件查看详情', - 'rc.resource.noResource': '\t\t暂无资源\n请点击上方按钮上传文件夹/文件', + 'rc.resource.click.tip1': '请确保资源配置正确,否则会导致资源上传失败!', + 'rc.resource.click.tip2': + ' 如果您的配置中心的资源配置没有配置资源上传路径/使用默认的资源上传路径(/dinky)', + 'rc.resource.click.tip3': ' 您可以点击右侧链接进行配置 ->', 'rc.resource.upload': '上传文件夹/文件', + 'rc.resource.upload.success': '文件 【{fileName}】 上传成功', + 'rc.resource.upload.fail': '文件 【{fileName}】 上传失败', + 'rc.resource.upload.tip1': '点击或拖拽文件到此区域上传', + 'rc.resource.upload.tip2': '支持单个或批量上传。严禁上传公司数据或其他禁止上传的文件。', 'rc.template.codeType': '代码类型', 'rc.template.codeTypePlaceholder': '请选择代码类型!', 'rc.template.create': '创建 UDF 模板', diff --git a/dinky-web/src/pages/RegCenter/Resource/components/FileShow/index.tsx b/dinky-web/src/pages/RegCenter/Resource/components/FileShow/index.tsx index e73b203960..0861282c80 100644 --- a/dinky-web/src/pages/RegCenter/Resource/components/FileShow/index.tsx +++ b/dinky-web/src/pages/RegCenter/Resource/components/FileShow/index.tsx @@ -20,8 +20,11 @@ import CodeEdit from '@/components/CustomEditor/CodeEdit'; import { renderLanguage, unSupportView } from '@/utils/function'; import { l } from '@/utils/intl'; -import { Empty } from 'antd'; +import { Empty, Space, Typography } from 'antd'; import React from 'react'; +import { NavLink } from 'react-router-dom'; + +const { Text } = Typography; const CodeEditProps = { height: '88vh', @@ -60,10 +63,45 @@ const FileShow: React.FC = (props) => { const renderContent = () => { if (name && unSupportView(name) && isLeaf) { return ( - + ); } else if (code === '' || code === null || code === undefined) { - return ; + return ( + <> + + + + {' '} + {l('rc.resource.click')} + + + {l('rc.resource.click.tip1')} + + + {l('rc.resource.click.tip2')} + + + {l('rc.resource.click.tip3')}{' '} + {l('menu.settings')} + + + + } + /> + + ); } else { return ; } diff --git a/dinky-web/src/pages/RegCenter/Resource/components/FileTree/function.tsx b/dinky-web/src/pages/RegCenter/Resource/components/FileTree/function.tsx index f4612fbf95..0bdde0a3e1 100644 --- a/dinky-web/src/pages/RegCenter/Resource/components/FileTree/function.tsx +++ b/dinky-web/src/pages/RegCenter/Resource/components/FileTree/function.tsx @@ -1,34 +1,34 @@ -import { Resource } from '@/types/RegCenter/data'; -import { renderIcon } from '@/utils/function'; +import { ResourceInfo } from '@/types/RegCenter/data'; +import { parseByteStr, renderIcon } from '@/utils/function'; import { l } from '@/utils/intl'; -const buildTitleLabel = (item: Resource) => { +const buildTitleLabel = (item: ResourceInfo) => { return ( <> {item.fileName} {!item.isDirectory && ( {' '} -   {l('global.size', '', { size: item.size })} +   {l('global.size', '', { size: parseByteStr(item.size) })} )} ); }; -export const buildResourceTreeData = (data: Resource[]): any => - data.map((item: Resource) => { +export const buildResourceTreeData = (data: ResourceInfo[]): any => + data.map((item: ResourceInfo) => { return { - isLeaf: !item.children, + isLeaf: !item.isDirectory, name: item.fileName, parentId: item.pid, label: item.fullName + '/' + item.fileName, - icon: item.leaf && renderIcon(item.fileName, '.', item.leaf), + icon: renderIcon(item.fileName, '.', item.isDirectory), path: item.fullName, title: buildTitleLabel(item), fullInfo: item, key: item.id, id: item.id, - children: buildResourceTreeData(item.children) + children: item.children && buildResourceTreeData(item.children) }; }); diff --git a/dinky-web/src/pages/RegCenter/Resource/components/FileTree/index.tsx b/dinky-web/src/pages/RegCenter/Resource/components/FileTree/index.tsx index 3f52d40766..f480e6e4b8 100644 --- a/dinky-web/src/pages/RegCenter/Resource/components/FileTree/index.tsx +++ b/dinky-web/src/pages/RegCenter/Resource/components/FileTree/index.tsx @@ -18,48 +18,33 @@ */ import { buildResourceTreeData } from '@/pages/RegCenter/Resource/components/FileTree/function'; -import { Resource } from '@/types/RegCenter/data'; -import { l } from '@/utils/intl'; -import { UploadOutlined } from '@ant-design/icons'; -import { Button, Tree, Typography, Upload } from 'antd'; +import { ResourceInfo } from '@/types/RegCenter/data'; +import { Empty, Tree } from 'antd'; import React from 'react'; const { DirectoryTree } = Tree; -const { Text } = Typography; type FileTreeProps = { - treeData: Resource[]; + treeData: ResourceInfo[]; onNodeClick: (info: any) => void; onRightClick: (info: any) => void; selectedKeys: string[]; - loadData: ({ key, children }: any) => Promise; }; const FileTree: React.FC = (props) => { - const { treeData, selectedKeys, onNodeClick, onRightClick, loadData } = props; + const { treeData, selectedKeys, onNodeClick, onRightClick } = props; return ( <> {treeData.length > 0 ? ( onNodeClick(info)} onRightClick={(info) => onRightClick(info)} treeData={buildResourceTreeData(treeData)} /> ) : ( - <> -
- - - -
-
- - {l('rc.resource.noResource')} - - + )} ); diff --git a/dinky-web/src/pages/RegCenter/Resource/components/ResourceOverView/index.tsx b/dinky-web/src/pages/RegCenter/Resource/components/ResourceOverView/index.tsx index 1eb68e4e45..c5c80e79a7 100644 --- a/dinky-web/src/pages/RegCenter/Resource/components/ResourceOverView/index.tsx +++ b/dinky-web/src/pages/RegCenter/Resource/components/ResourceOverView/index.tsx @@ -26,9 +26,10 @@ import ResourceModal from '@/pages/RegCenter/Resource/components/ResourceModal'; import ResourcesUploadModal from '@/pages/RegCenter/Resource/components/ResourcesUploadModal'; import { handleOption, handleRemoveById, queryDataByParams } from '@/services/BusinessCrud'; import { API_CONSTANTS } from '@/services/endpoints'; -import { Resource } from '@/types/RegCenter/data'; +import { ResourceInfo } from '@/types/RegCenter/data'; import { InitResourceState } from '@/types/RegCenter/init.d'; import { ResourceState } from '@/types/RegCenter/state.d'; +import { l } from '@/utils/intl'; import { ProCard } from '@ant-design/pro-components'; import { MenuInfo } from 'rc-menu/es/interface'; import { Resizable } from 're-resizable'; @@ -45,37 +46,15 @@ const ResourceOverView: React.FC = () => { description: '' }); - const updateTreeData = (list: any[], key: React.Key, children: any[]): any[] => - list.map((node) => { - if (node.path === key) { - return { ...node, children }; - } - if (node.children) { - return { - ...node, - children: updateTreeData(node.children, key, children) - }; - } - return node; - }); - - const refreshTreeData = async (path: string) => { - const data = await queryDataByParams(API_CONSTANTS.RESOURCE_SHOW_TREE); - setResourceState((prevState) => ({ - ...prevState, - treeData: updateTreeData(prevState.treeData, path, data ?? []) - })); - }; - const refreshTree = async () => { - await queryDataByParams(API_CONSTANTS.RESOURCE_SHOW_TREE).then((res) => + await queryDataByParams(API_CONSTANTS.RESOURCE_SHOW_TREE).then((res) => setResourceState((prevState) => ({ ...prevState, treeData: res ?? [] })) ); }; useEffect(() => { refreshTree(); - }, []); + }, [resourceState]); /** * query content by id @@ -107,20 +86,6 @@ const ResourceOverView: React.FC = () => { setResourceState((prevState) => ({ ...prevState, content: '' })); } }; - const getSelectedNode = () => { - const indexes = (resourceState.rightClickedNode.pos.split('-') as string[]).map((x) => - parseInt(x) - ); - if (indexes.length === 1) { - return resourceState.treeData[indexes[0]]; - } else { - let temp = resourceState.treeData[indexes[0]]; - for (let i = 1; i < indexes.length - 1; i++) { - temp = temp.children[indexes[i]]; - } - return temp; - } - }; /** * the node right click event OF upload, @@ -141,30 +106,17 @@ const ResourceOverView: React.FC = () => { if (resourceState.rightClickedNode) { uploadValue.pid = resourceState.rightClickedNode.id; // todo: upload - setResourceState((prevState) => ({ ...prevState, uploadOpen: true })); + setResourceState((prevState) => ({ ...prevState, uploadOpen: true, contextMenuOpen: false })); } }; - const getSelectedParentNode = () => { - const indexes = (resourceState.rightClickedNode.pos.split('-') as string[]).map((x) => - parseInt(x) - ); - let temp = resourceState.treeData[indexes[0]]; - for (let i = 1; i < indexes.length - 2; i++) { - temp = temp.children[indexes[i]]; - } - return { node: temp, index: indexes[indexes.length - 2] }; - }; - /** * the node right click event OF delete, */ const handleDelete = async () => { if (resourceState.rightClickedNode) { + setResourceState((prevState) => ({ ...prevState, contextMenuOpen: false })); await handleRemoveById(API_CONSTANTS.RESOURCE_REMOVE, resourceState.rightClickedNode.id); - // await refreshTree() - const { node, index } = getSelectedParentNode(); - node.children.splice(index, 1); } }; @@ -183,12 +135,6 @@ const ResourceOverView: React.FC = () => { })); } }; - const handleRefresh = async () => { - if (resourceState.rightClickedNode) { - // const {id, name, desc, path} = rightClickedNode; - //todo refresh - } - }; const handleMenuClick = (node: MenuInfo) => { switch (node.key) { @@ -204,9 +150,6 @@ const ResourceOverView: React.FC = () => { case 'rename': handleRename(); break; - case 'refresh': - handleRefresh(); - break; default: break; } @@ -242,23 +185,16 @@ const ResourceOverView: React.FC = () => { /** * the rename ok */ - const handleModalSubmit = async (value: Partial) => { + const handleModalSubmit = async (value: Partial) => { + const { id: pid } = resourceState.rightClickedNode; if (editModal === 'createFolder') { - const d = ( - await handleOption(API_CONSTANTS.RESOURCE_CREATE_FOLDER, '创建文件夹', { - ...value - }) - ).datas; - if (getSelectedNode().children) { - getSelectedNode().children.push(d); - } else { - getSelectedNode().children = [d]; - } + await handleOption(API_CONSTANTS.RESOURCE_CREATE_FOLDER, l('right.menu.createFolder'), { + ...value, + pid + }); setResourceState((prevState) => ({ ...prevState, editOpen: false })); } else if (editModal === 'rename') { - await handleOption(API_CONSTANTS.RESOURCE_RENAME, '重命名', { ...value }); - getSelectedNode().fileName = value.fileName; - getSelectedNode().name = value.fileName; + await handleOption(API_CONSTANTS.RESOURCE_RENAME, l('right.menu.rename'), { ...value, pid }); } }; const handleUploadCancel = () => { @@ -274,13 +210,6 @@ const ResourceOverView: React.FC = () => { // todo: save content }; - const asyncLoadData = async ({ children, path, id }: any) => { - if (children.length > 0) { - return; - } - await refreshTreeData(path); - }; - const access = useAccess(); /** @@ -299,7 +228,6 @@ const ResourceOverView: React.FC = () => { > { - + { {resourceState.editOpen && ( = (props) => { const { onUpload, onClose, onOk, visible } = props; const { url, pid, description } = onUpload; + const uploadProps: UploadProps = { name: 'file', multiple: true, action: url + '?pid=' + pid, - onChange(info) { + onChange: async (info) => { const { status } = info.file; if (status !== 'uploading') { console.log(info.file, info.fileList); } if (status === 'done') { - message.success(`${info.file.name} file uploaded successfully.`); + await SuccessMessageAsync( + l('rc.resource.upload.success', '', { fileName: info.file.name }) + ); } else if (status === 'error') { - message.error(`${info.file.name} file upload failed.`); + await ErrorMessageAsync(l('rc.resource.upload.fail', '', { fileName: info.file.name })); } }, onDrop(e) { @@ -35,16 +40,13 @@ const ResourcesUploadModal: React.FC = (props) => { } }; return ( - +

-

Click or drag file to this area to upload

-

- Support for a single or bulk upload. Strictly prohibited from uploading company data or - other banned files. -

+

{l('rc.resource.upload.tip1')}

+

{l('rc.resource.upload.tip2')}

); diff --git a/dinky-web/src/pages/RegCenter/Resource/components/constants.tsx b/dinky-web/src/pages/RegCenter/Resource/components/constants.tsx index dd27f18b94..4cab5a6a85 100644 --- a/dinky-web/src/pages/RegCenter/Resource/components/constants.tsx +++ b/dinky-web/src/pages/RegCenter/Resource/components/constants.tsx @@ -22,7 +22,6 @@ import { DeleteOutlined, EditOutlined, PlusCircleOutlined, - UndoOutlined, UploadOutlined } from '@ant-design/icons'; @@ -60,11 +59,5 @@ export const RIGHT_CONTEXT_MENU = (isDisabled = false) => [ label: l('right.menu.rename'), disabled: isDisabled, path: '/registration/resource/rename' - }, - { - key: 'refresh', - icon: , - label: l('right.menu.refresh'), - disabled: isDisabled } ]; diff --git a/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/GeneralConfig.tsx b/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/GeneralConfig.tsx index 80c33e9481..4c2a46faee 100644 --- a/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/GeneralConfig.tsx +++ b/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/GeneralConfig.tsx @@ -35,7 +35,7 @@ type GeneralConfigProps = { onSave: (data: BaseConfigProperties) => void; loading: boolean; toolBarRender?: any; - selectChanges?: Record void>; + selectChanges?: (e: RadioChangeEvent) => void; }; const GeneralConfig: React.FC = (props) => { @@ -95,16 +95,15 @@ const GeneralConfig: React.FC = (props) => { // @ts-ignore return ( - {entity.example.map((item: any) => { - return ( - - {item} - - ); - })} + {entity.example.map((item: any) => ( + + {item} + + ))} ); } else { diff --git a/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/ResourcesConfig/index.tsx b/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/ResourcesConfig/index.tsx index 72b8482e84..0e207b7528 100644 --- a/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/ResourcesConfig/index.tsx +++ b/dinky-web/src/pages/SettingCenter/GlobalSetting/SettingOverView/ResourcesConfig/index.tsx @@ -9,80 +9,63 @@ interface ResourcesConfigProps { onSave: (data: BaseConfigProperties) => void; } -type CacheEnum = { - name: string; - configs: BaseConfigProperties[]; +const ModelType = { + HDFS: 'HDFS', + OSS: 'OSS' +}; + +type ResourceConfig = { + base: BaseConfigProperties[]; + hdfs: BaseConfigProperties[]; + oss: BaseConfigProperties[]; }; export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => { const [loading, setLoading] = React.useState(false); const [model, setModel] = React.useState('hdfs'); - const [baseData, setBaseData] = React.useState(data); - const [enumCache] = useState({ - base: [] as BaseConfigProperties[], - hdfs: [] as BaseConfigProperties[], - oss: [] as BaseConfigProperties[] + const [filterData, setFilterData] = useState({ + base: [], + hdfs: [], + oss: [] }); - const modelKey: string = 'sys.resource.settings.model'; - useEffect(() => { - if (data.length < 1) { - return; + // 处理 data / 规则: 前缀为 sys.resource.settings.base 的为基础配置,其他的为 hdfs/oss 配置 + const base: BaseConfigProperties[] = data.filter((d) => + d.key.startsWith('sys.resource.settings.base') + ); + const hdfs: BaseConfigProperties[] = data.filter((d) => + d.key.startsWith('sys.resource.settings.hdfs') + ); + const oss: BaseConfigProperties[] = data.filter((d) => + d.key.startsWith('sys.resource.settings.oss') + ); + setFilterData({ base, hdfs, oss }); + // 获取当前的 model + const currentModel = base.find((d) => d.key === 'sys.resource.settings.base.model')?.value; + if (currentModel) { + setModel(currentModel); } - const needDeleteIndexes: number[] = []; - let m; - data.forEach((datum, index) => { - if (datum.key === modelKey) { - enumCache.base.push(datum); - const modelCase = datum.value?.toLowerCase(); - m = modelCase; - setModel(modelCase); - return; - } - const v = datum.key.split('.').at(3); - if (v === 'hdfs' || v === 'oss') { - // @ts-ignore - enumCache[v].push(datum); - needDeleteIndexes.push(index); - } else { - enumCache.base.push(datum); - } - }); - - const baseConfigProperties = data.filter((d, index) => !needDeleteIndexes.includes(index)); - // @ts-ignore - enumCache[m].forEach((x) => { - baseConfigProperties.push(x); - }); - setBaseData(baseConfigProperties); + console.log('data', data, 'filterData', currentModel, 'currentModel'); }, [data]); - useEffect(() => { - const d: BaseConfigProperties[] = []; - enumCache.base.forEach((x) => { - d.push(x); - }); - console.log(enumCache); - // @ts-ignore - enumCache[model].forEach((x) => { - d.push(x); - }); - setBaseData(d); - }, [model]); + + const modelKey: string = 'sys.resource.settings.base.model'; + const onSaveHandler = async (data: BaseConfigProperties) => { setLoading(true); await onSave(data); setLoading(false); }; - const selectChange = async (value: RadioChangeEvent) => { - setModel(value.target.value); + const selectChange = async (e: RadioChangeEvent) => { + const { value } = e.target; + setModel(value); await onSaveHandler({ name: '', example: [], frontType: '', key: modelKey, note: '', - value: value.target.value.toLocaleUpperCase() + value: value.toString().toLocaleUpperCase() }); }; return ( @@ -91,9 +74,25 @@ export const ResourcesConfig = ({ data, onSave }: ResourcesConfigProps) => { loading={loading} onSave={onSaveHandler} tag={{l('sys.setting.tag.integration')}} - data={baseData} - selectChanges={{ modelKey: selectChange }} + data={filterData.base} + selectChanges={selectChange} /> + {model.toLocaleUpperCase() === ModelType.HDFS && ( + {l('sys.setting.tag.integration')}} + data={filterData.hdfs} + /> + )} + {model.toLocaleUpperCase() === ModelType.OSS && ( + {l('sys.setting.tag.integration')}} + data={filterData.oss} + /> + )} ); }; diff --git a/dinky-web/src/types/RegCenter/data.d.ts b/dinky-web/src/types/RegCenter/data.d.ts index d67db0b60c..cea4064cd4 100644 --- a/dinky-web/src/types/RegCenter/data.d.ts +++ b/dinky-web/src/types/RegCenter/data.d.ts @@ -221,7 +221,7 @@ export type UDFTemplate = BaseBeanColumns & { templateCode: string; }; -interface Resource { +export interface ResourceInfo { id: number; fileName: string; description: string; @@ -233,6 +233,6 @@ interface Resource { isDirectory: boolean; createTime: string; updateTime: string; - children: Resource[]; + children: ResourceInfo[]; leaf: boolean; } diff --git a/dinky-web/src/types/RegCenter/state.d.ts b/dinky-web/src/types/RegCenter/state.d.ts index 8bf26be108..3bd55a6e31 100644 --- a/dinky-web/src/types/RegCenter/state.d.ts +++ b/dinky-web/src/types/RegCenter/state.d.ts @@ -18,7 +18,6 @@ */ import { BuildStepsState } from '@/pages/RegCenter/GitProject/data.d'; -import { Resource } from '@/pages/RegCenter/Resource/components/ResourceOverView'; import { BaseState, ContextMenuPosition } from '@/types/Public/state.d'; import { Alert, @@ -26,6 +25,7 @@ import { Document, GitProject, GlobalVar, + ResourceInfo, UDFTemplate } from '@/types/RegCenter/data.d'; @@ -110,7 +110,7 @@ export interface GlobalVarState extends BaseState { * resource state */ export interface ResourceState { - treeData: Resource[]; + treeData: ResourceInfo[]; content: string; clickedNode: any; rightClickedNode: any; @@ -119,7 +119,7 @@ export interface ResourceState { selectedKeys: string[]; editOpen: boolean; uploadOpen: boolean; - value: Partial; + value: Partial; } /**