diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java b/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java index 57030ed9f4..0010de8037 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertGroupController.java @@ -24,7 +24,6 @@ import org.dinky.data.enums.BusinessType; import org.dinky.data.enums.Status; import org.dinky.data.model.AlertGroup; -import org.dinky.data.result.ProTableResult; import org.dinky.data.result.Result; import org.dinky.service.AlertGroupService; @@ -32,15 +31,12 @@ import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.fasterxml.jackson.databind.JsonNode; - import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import io.swagger.annotations.Api; @@ -65,7 +61,7 @@ public class AlertGroupController { * @param alertGroup {@link AlertGroup} * @return {@link Result} with {@link Void} */ - @PutMapping + @PutMapping("/addOrUpdate") @SaCheckPermission( value = {PermissionConstants.REGISTRATION_ALERT_GROUP_ADD, PermissionConstants.REGISTRATION_ALERT_GROUP_EDIT }, @@ -89,19 +85,13 @@ public Result saveOrUpdateAlertGroup(@RequestBody AlertGroup alertGroup) { /** * list alert groups * - * @param para {@link JsonNode} - * @return {@link ProTableResult} with {@link AlertGroup} + * @param keyword {@link String} + * @return {@link Result} with {@link AlertGroup} */ - @PostMapping - @ApiImplicitParam( - name = "para", - value = "JsonNode", - required = true, - dataType = "JsonNode", - dataTypeClass = JsonNode.class) + @GetMapping("/list") @ApiOperation("Query AlertGroup List") - public ProTableResult listAlertGroups(@RequestBody JsonNode para) { - return alertGroupService.selectForProTable(para); + public Result> listAlertGroups(@RequestParam String keyword) { + return Result.succeed(alertGroupService.selectListByKeyWord(keyword)); } /** diff --git a/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java b/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java index bb2e27b2c5..79d609bebc 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/AlertInstanceController.java @@ -27,7 +27,6 @@ import org.dinky.data.enums.BusinessType; import org.dinky.data.enums.Status; import org.dinky.data.model.AlertInstance; -import org.dinky.data.result.ProTableResult; import org.dinky.data.result.Result; import org.dinky.service.AlertInstanceService; @@ -42,7 +41,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.fasterxml.jackson.databind.JsonNode; import com.github.xiaoymin.knife4j.annotations.DynamicParameter; import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters; @@ -54,7 +52,9 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -/** AlertInstanceController */ +/** + * AlertInstanceController + */ @Slf4j @RestController @Api(tags = "Alert Instance Controller") @@ -71,7 +71,7 @@ public class AlertInstanceController { * @return {@link Result} of {@link Void} * @throws Exception {@link Exception} */ - @PutMapping + @PutMapping("/saveOrUpdate") @Log(title = "Insert OR Update AlertInstance", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert OR Update AlertInstance") @ApiImplicitParam( @@ -98,21 +98,12 @@ public Result saveOrUpdate(@RequestBody AlertInstance alertInstance) throw /** * listAlertInstances - * - * @param para {@link JsonNode} - * @return {@link ProTableResult} of {@link AlertInstance} + * @return {@link Result} of {@link AlertInstance} */ - @PostMapping + @GetMapping("/list") @ApiOperation("Query AlertInstance List") - @ApiImplicitParam( - name = "para", - value = "Query Condition", - dataType = "JsonNode", - paramType = "body", - required = true, - dataTypeClass = JsonNode.class) - public ProTableResult listAlertInstances(@RequestBody JsonNode para) { - return alertInstanceService.selectForProTable(para); + public Result> listAlertInstances(@RequestParam(value = "keyword") String keyword) { + return Result.succeed(alertInstanceService.selectListByKeyWord(keyword)); } /** diff --git a/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java b/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java index d6ea31c9ce..9a2de6e714 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java @@ -25,13 +25,11 @@ import org.dinky.data.enums.BusinessType; import org.dinky.data.enums.Status; import org.dinky.data.model.ClusterConfiguration; -import org.dinky.data.result.ProTableResult; import org.dinky.data.result.Result; import org.dinky.gateway.result.TestResult; import org.dinky.service.ClusterConfigurationService; import java.util.List; -import java.util.stream.Collectors; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -42,8 +40,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.fasterxml.jackson.databind.JsonNode; - import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import io.swagger.annotations.Api; @@ -70,7 +66,7 @@ public class ClusterConfigurationController { * @param clusterConfiguration * @return */ - @PutMapping + @PutMapping("/saveOrUpdate") @Log(title = "Insert Or Update Cluster Config", businessType = BusinessType.INSERT_OR_UPDATE) @ApiOperation("Insert Or Update Cluster Config") @ApiImplicitParam( @@ -98,29 +94,13 @@ public Result saveOrUpdateClusterConfig(@RequestBody ClusterConfigurationD /** * query cluster config list - * - * @param para + * @param keyword * @return */ - @PostMapping + @GetMapping("/list") @ApiOperation("Cluster Config List") - @ApiImplicitParam( - name = "para", - value = "Cluster Configuration", - dataType = "JsonNode", - paramType = "body", - required = true) - public ProTableResult listClusterConfigList(@RequestBody JsonNode para) { - ProTableResult result = clusterConfigurationService.selectForProTable(para); - List dtoList = - result.getData().stream().map(ClusterConfigurationDTO::fromBean).collect(Collectors.toList()); - return ProTableResult.builder() - .success(true) - .data(dtoList) - .total(result.getTotal()) - .current(result.getCurrent()) - .pageSize(result.getPageSize()) - .build(); + public Result> listClusterConfigList(@RequestParam String keyword) { + return Result.succeed(clusterConfigurationService.selectListByKeyWord(keyword)); } /** diff --git a/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java b/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java index b92f4a4229..555f6cff8d 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/ClusterInstanceController.java @@ -40,7 +40,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.fasterxml.jackson.databind.JsonNode; import cn.dev33.satoken.annotation.SaCheckPermission; @@ -156,12 +155,7 @@ public Result deleteClusterInstanceById(@RequestParam Integer id) { required = true, dataTypeClass = JsonNode.class) public Result> listClusterInstance(@RequestParam("keyword") String searchKeyWord) { - return Result.succeed(clusterInstanceService.list(new LambdaQueryWrapper() - .like(ClusterInstance::getName, searchKeyWord) - .or() - .like(ClusterInstance::getAlias, searchKeyWord) - .or() - .like(ClusterInstance::getNote, searchKeyWord))); + return Result.succeed(clusterInstanceService.selectListByKeyWord(searchKeyWord)); } /** diff --git a/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java b/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java index 9b328fd26e..b941056fdc 100644 --- a/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java +++ b/dinky-admin/src/main/java/org/dinky/controller/DataBaseController.java @@ -31,7 +31,6 @@ import org.dinky.data.model.QueryData; import org.dinky.data.model.Schema; import org.dinky.data.model.SqlGeneration; -import org.dinky.data.result.ProTableResult; import org.dinky.data.result.Result; import org.dinky.metadata.driver.DriverPool; import org.dinky.metadata.result.JdbcSelectResult; @@ -50,8 +49,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.fasterxml.jackson.databind.JsonNode; - import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaMode; import io.swagger.annotations.Api; @@ -107,27 +104,13 @@ public Result saveOrUpdateDataBase(@RequestBody DataBaseDTO dataBaseDTO) { /** * get all database * - * @param para {@link JsonNode} - * @return {@link ProTableResult}< {@link DataBase}> + * @param keyword {@link String} + * @return {@link Result}< {@link DataBase}> */ - @PostMapping + @GetMapping("/list") @ApiOperation("DataBase Get All") - @ApiImplicitParam( - name = "para", - value = "JsonNode", - required = true, - dataType = "JsonNode", - paramType = "body", - dataTypeClass = JsonNode.class) - public ProTableResult listDataBases(@RequestBody JsonNode para) { - final ProTableResult result = databaseService.selectForProTable(para); - // 密码不返回 - if (result != null && result.getData() != null) { - for (DataBase data : result.getData()) { - data.setPassword(null); - } - } - return result; + public Result> listDataBases(@RequestParam(value = "keyword") String keyword) { + return Result.succeed(databaseService.selectListByKeyWord(keyword)); } /** @@ -295,9 +278,9 @@ public Result unCacheSchemasAndTables(@RequestParam Integer id) { /** * get columns of table * - * @param id {@link Integer} + * @param id {@link Integer} * @param schemaName {@link String} - * @param tableName {@link String} + * @param tableName {@link String} * @return {@link Result}< {@link List}< {@link Column}>> */ @GetMapping("/listColumns") @@ -387,9 +370,9 @@ public Result execSql(@RequestBody QueryData queryData) { /** * get sql generation * - * @param id {@link Integer} + * @param id {@link Integer} * @param schemaName {@link String} - * @param tableName {@link String} + * @param tableName {@link String} * @return {@link Result}< {@link SqlGeneration}> */ @GetMapping("/getSqlGeneration") diff --git a/dinky-admin/src/main/java/org/dinky/service/AlertGroupService.java b/dinky-admin/src/main/java/org/dinky/service/AlertGroupService.java index 5ca9aa8a8c..c7f05f3b9c 100644 --- a/dinky-admin/src/main/java/org/dinky/service/AlertGroupService.java +++ b/dinky-admin/src/main/java/org/dinky/service/AlertGroupService.java @@ -57,4 +57,6 @@ public interface AlertGroupService extends ISuperService { * @return {@link Boolean} */ Boolean deleteGroupById(Integer id); + + List selectListByKeyWord(String keyword); } diff --git a/dinky-admin/src/main/java/org/dinky/service/AlertInstanceService.java b/dinky-admin/src/main/java/org/dinky/service/AlertInstanceService.java index a3c134e11a..f4530ff036 100644 --- a/dinky-admin/src/main/java/org/dinky/service/AlertInstanceService.java +++ b/dinky-admin/src/main/java/org/dinky/service/AlertInstanceService.java @@ -60,4 +60,6 @@ public interface AlertInstanceService extends ISuperService { * @return {@link Boolean} */ Boolean modifyAlertInstanceStatus(Integer id); + + List selectListByKeyWord(String keyword); } diff --git a/dinky-admin/src/main/java/org/dinky/service/ClusterConfigurationService.java b/dinky-admin/src/main/java/org/dinky/service/ClusterConfigurationService.java index 7b15b2b02c..6d0687b3df 100644 --- a/dinky-admin/src/main/java/org/dinky/service/ClusterConfigurationService.java +++ b/dinky-admin/src/main/java/org/dinky/service/ClusterConfigurationService.java @@ -72,4 +72,6 @@ public interface ClusterConfigurationService extends ISuperService selectListByKeyWord(String keyword); } diff --git a/dinky-admin/src/main/java/org/dinky/service/ClusterInstanceService.java b/dinky-admin/src/main/java/org/dinky/service/ClusterInstanceService.java index d87a5b19ad..43742d40d4 100644 --- a/dinky-admin/src/main/java/org/dinky/service/ClusterInstanceService.java +++ b/dinky-admin/src/main/java/org/dinky/service/ClusterInstanceService.java @@ -144,4 +144,6 @@ public interface ClusterInstanceService extends ISuperService { * @return {@link ClusterInstance} */ ClusterInstance deploySessionCluster(Integer id); + + List selectListByKeyWord(String searchKeyWord); } diff --git a/dinky-admin/src/main/java/org/dinky/service/DataBaseService.java b/dinky-admin/src/main/java/org/dinky/service/DataBaseService.java index f388101175..c8245f6311 100644 --- a/dinky-admin/src/main/java/org/dinky/service/DataBaseService.java +++ b/dinky-admin/src/main/java/org/dinky/service/DataBaseService.java @@ -194,4 +194,6 @@ public interface DataBaseService extends ISuperService { * @return A {@link JobResult} object representing the execution result of the SQL statement. */ JobResult executeCommonSql(SqlDTO sqlDTO); + + List selectListByKeyWord(String keyword); } diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/AlertGroupServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/AlertGroupServiceImpl.java index 7a075b9908..629c910a34 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/AlertGroupServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/AlertGroupServiceImpl.java @@ -43,7 +43,9 @@ import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; -/** AlertGroupServiceImpl */ +/** + * AlertGroupServiceImpl + */ @Service @RequiredArgsConstructor public class AlertGroupServiceImpl extends SuperServiceImpl implements AlertGroupService { @@ -100,4 +102,17 @@ public Boolean deleteGroupById(Integer id) { .forEach(alertHistory -> alertHistoryService.removeById(alertHistory.getId())); return removeById(id); } + + /** + * @param keyword + * @return + */ + @Override + public List selectListByKeyWord(String keyword) { + return getBaseMapper() + .selectList(new LambdaQueryWrapper<>(AlertGroup.class) + .like(AlertGroup::getName, keyword) + .or() + .like(AlertGroup::getNote, keyword)); + } } diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/AlertInstanceServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/AlertInstanceServiceImpl.java index b447cc7e96..3301f5cd9c 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/AlertInstanceServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/AlertInstanceServiceImpl.java @@ -109,6 +109,19 @@ public Boolean modifyAlertInstanceStatus(Integer id) { return updateById(alertInstance); } + /** + * @param keyword + * @return + */ + @Override + public List selectListByKeyWord(String keyword) { + return getBaseMapper() + .selectList(new LambdaQueryWrapper() + .like(AlertInstance::getName, keyword) + .or() + .like(AlertInstance::getType, keyword)); + } + private void writeBackGroupInformation(Map> alertGroupInformation) { if (MapUtils.isEmpty(alertGroupInformation)) { return; diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java index ce01a6c73c..8dbc6e2741 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java @@ -31,10 +31,12 @@ import org.dinky.service.ClusterConfigurationService; import java.util.List; +import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.hutool.core.lang.Assert; @@ -87,4 +89,17 @@ public Boolean modifyClusterConfigStatus(Integer id) { } return false; } + + /** + * @param keyword + * @return + */ + @Override + public List selectListByKeyWord(String keyword) { + return getBaseMapper() + .selectList(new LambdaQueryWrapper().like(ClusterConfiguration::getName, keyword)) + .stream() + .map(ClusterConfigurationDTO::fromBean) + .collect(Collectors.toList()); + } } diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java index 35d86d39e1..f88337eda5 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java @@ -45,6 +45,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.hutool.core.util.StrUtil; @@ -207,6 +208,21 @@ public ClusterInstance deploySessionCluster(Integer id) { null)); } + /** + * @param searchKeyWord + * @return + */ + @Override + public List selectListByKeyWord(String searchKeyWord) { + return getBaseMapper() + .selectList(new LambdaQueryWrapper() + .like(ClusterInstance::getName, searchKeyWord) + .or() + .like(ClusterInstance::getAlias, searchKeyWord) + .or() + .like(ClusterInstance::getNote, searchKeyWord)); + } + private boolean checkHealth(ClusterInstance clusterInstance) { FlinkClusterInfo info = checkHeartBeat(clusterInstance.getHosts(), clusterInstance.getJobManagerHost()); if (!info.isEffective()) { diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java index df37534871..f528ab35a9 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/DataBaseServiceImpl.java @@ -51,8 +51,11 @@ import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import cn.hutool.core.collection.CollectionUtil; + /** * DataBaseServiceImpl * @@ -308,4 +311,25 @@ public JobResult executeCommonSql(SqlDTO sqlDTO) { result.setEndTime(LocalDateTime.now()); return result; } + + /** + * @param keyword + * @return + */ + @Override + public List selectListByKeyWord(String keyword) { + + List dataBaseList = getBaseMapper() + .selectList(new LambdaQueryWrapper() + .like(DataBase::getName, keyword) + .or() + .like(DataBase::getNote, keyword)); + + if (CollectionUtil.isNotEmpty(dataBaseList)) { + for (DataBase data : dataBaseList) { + data.setPassword(null); + } + } + return dataBaseList; + } } diff --git a/dinky-web/src/locales/en-US/pages.ts b/dinky-web/src/locales/en-US/pages.ts index 2dabb560b2..408248c2af 100644 --- a/dinky-web/src/locales/en-US/pages.ts +++ b/dinky-web/src/locales/en-US/pages.ts @@ -438,6 +438,7 @@ export default { 'rc.ag.management': 'Alert Group Management ', 'rc.ag.modify': 'Modify Alert Group', 'rc.ag.name': 'Alert Group Name', + 'rc.ag.search': 'Search Name/Note', 'rc.ai.accessKeyId': 'AccessKeyId', 'rc.ai.accessKeyIdPleaseHolder': 'Please enter AccessKeyId', 'rc.ai.accessKeySecret': 'AccessKeySecret', @@ -500,6 +501,7 @@ export default { 'rc.ai.mf.uni': 'Uni SMS', 'rc.ai.mf.yunpian': 'Yunpian SMS', 'rc.ai.modify': 'Modify Alert Instance', + 'rc.ai.search': 'Search Name/Type', 'rc.ai.name': 'Name', 'rc.ai.namePleaseHolder': 'please enter Alert instance name', 'rc.ai.password': 'Password', @@ -634,6 +636,7 @@ export default { 'rc.cc.management': 'Cluster Config Management', 'rc.cc.modify': 'Modify Cluster Config', 'rc.cc.name': 'Cluster Config Name', + 'rc.cc.search': 'Search Name', 'rc.cc.namePlaceholder': 'Please enter the cluster configuration name!', 'rc.cc.spDir': 'SavePoint Path', 'rc.cc.spDirHelp': 'Please enter the savepoint path! This parameter configuration item is', @@ -708,6 +711,7 @@ export default { 'rc.ds.columnName': 'Field Name', 'rc.ds.columnType': 'Type', 'rc.ds.comment': 'Comment', + 'rc.ds.search': 'Search Name/Note', 'rc.ds.console.exec': 'Execute', 'rc.ds.console.running': 'Running...', 'rc.ds.create': 'Create DataSource', diff --git a/dinky-web/src/locales/zh-CN/pages.ts b/dinky-web/src/locales/zh-CN/pages.ts index 16528c23cd..f54d21c181 100644 --- a/dinky-web/src/locales/zh-CN/pages.ts +++ b/dinky-web/src/locales/zh-CN/pages.ts @@ -422,6 +422,7 @@ export default { 'rc.ag.management': '告警组管理', 'rc.ag.modify': '修改告警组', 'rc.ag.name': '告警组名称', + 'rc.ag.search': '搜索 名称/备注', 'rc.ai.accessKeyId': 'AccessKeyId', 'rc.ai.accessKeyIdPleaseHolder': '请输入AccessKeyId', 'rc.ai.accessKeySecret': 'AccessKeySecret', @@ -483,6 +484,7 @@ export default { 'rc.ai.mf.yunpian': '云片短信', 'rc.ai.modify': '修改告警实例', 'rc.ai.name': '名称', + 'rc.ai.search': '搜索 名称/类型', 'rc.ai.namePleaseHolder': '请输入告警实例名称', 'rc.ai.password': '密码', 'rc.ai.passwordPleaseHolder': '请输入密码', @@ -605,6 +607,7 @@ export default { 'rc.cc.management': '集群配置管理', 'rc.cc.modify': '修改集群配置', 'rc.cc.name': '集群配置名称', + 'rc.cc.search': '搜索 名称', 'rc.cc.namePlaceholder': '请输入集群配置名称!', 'rc.cc.spDir': '保存点路径', 'rc.cc.spDirHelp': '请输入保存点路径! 此参数配置项为', @@ -674,6 +677,7 @@ export default { 'rc.ds.collationRule': '排序规则', 'rc.ds.columnName': '名称', 'rc.ds.columnType': '类型', + 'rc.ds.search': '搜索 名称/注释', 'rc.ds.comment': '注释', 'rc.ds.console.exec': '执行', 'rc.ds.console.running': '运行中...', diff --git a/dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx b/dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx index 1b1f8cb674..ec3105702d 100644 --- a/dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx +++ b/dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx @@ -1,19 +1,19 @@ /* * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * */ @@ -131,11 +131,21 @@ const JobConfig = (props: any) => { ) : ( { size={'middle'} initialValues={{ type: RUN_MODE.LOCAL, - envId: 0, + envId: -1, parallelism: 1, savePointStrategy: 0, - alertGroupId: 0 + alertGroupId: -1 }} className={'data-studio-form'} style={{ paddingInline: '15px', overflow: 'scroll' }} @@ -166,6 +176,7 @@ const JobConfig = (props: any) => { name='type' label={l('global.table.execmode')} tooltip={l('pages.datastudio.label.jobConfig.execmode.tip')} + rules={[{ required: true, message: l('pages.datastudio.label.jobConfig.execmode.tip') }]} options={buildRunModelOptions()} /> @@ -183,9 +194,12 @@ const JobConfig = (props: any) => { name='clusterConfigurationId' placeholder={l('pages.datastudio.label.jobConfig.clusterConfig.tip2')} label={l('pages.datastudio.label.jobConfig.clusterConfig')} - tooltip={l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', { + tooltip={l('pages.datastudio.label.jobConfig.clusterConfig.tip2', '', { type: current?.type })} + rules={[ + { required: true, message: l('pages.datastudio.label.jobConfig.clusterConfig.tip2') } + ]} options={buildClusterConfigOptions(current, clusterConfiguration)} /> )} @@ -195,6 +209,9 @@ const JobConfig = (props: any) => { label={l('pages.datastudio.label.jobConfig.flinksql.env')} tooltip={l('pages.datastudio.label.jobConfig.flinksql.env.tip1')} options={buildEnvOptions(env)} + rules={[ + { required: true, message: l('pages.datastudio.label.jobConfig.flinksql.env.tip1') } + ]} showSearch /> diff --git a/dinky-web/src/pages/RegCenter/Alert/AlertGroup/index.tsx b/dinky-web/src/pages/RegCenter/Alert/AlertGroup/index.tsx index 8340acb35c..5bca2e8fe1 100644 --- a/dinky-web/src/pages/RegCenter/Alert/AlertGroup/index.tsx +++ b/dinky-web/src/pages/RegCenter/Alert/AlertGroup/index.tsx @@ -26,8 +26,12 @@ import { Authorized, HasAuthority } from '@/hooks/useAccess'; import AlertGroupForm from '@/pages/RegCenter/Alert/AlertGroup/components/AlertGroupForm'; import { getAlertIcon } from '@/pages/RegCenter/Alert/AlertInstance/function'; import { ALERT_MODEL_ASYNC } from '@/pages/RegCenter/Alert/AlertInstance/model'; -import { queryList } from '@/services/api'; -import { handleAddOrUpdate, handleRemoveById, updateDataByParam } from '@/services/BusinessCrud'; +import { + handleAddOrUpdate, + handleRemoveById, + queryDataByParams, + updateDataByParam +} from '@/services/BusinessCrud'; import { PROTABLE_OPTIONS_PUBLIC, PRO_LIST_CARD_OPTIONS } from '@/services/constants'; import { API_CONSTANTS } from '@/services/endpoints'; import { Alert, ALERT_TYPE } from '@/types/RegCenter/data.d'; @@ -39,7 +43,7 @@ import { ProList } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-layout'; import { ActionType } from '@ant-design/pro-table'; import { connect, Dispatch } from '@umijs/max'; -import { Button, Descriptions, Modal, Space, Tag, Tooltip } from 'antd'; +import { Button, Descriptions, Input, Modal, Space, Tag, Tooltip } from 'antd'; import React, { useEffect, useRef, useState } from 'react'; const AlertGroupTableList: React.FC = (props: any) => { @@ -54,9 +58,12 @@ const AlertGroupTableList: React.FC = (props: any) => { * execute query alert instance list * set alert instance list */ - const queryAlertGroupList = async () => { - queryList(API_CONSTANTS.ALERT_GROUP).then((res) => - setAlertGroupState((prevState) => ({ ...prevState, alertGroupList: res.data })) + const queryAlertGroupList = async (keyword = '') => { + queryDataByParams(API_CONSTANTS.ALERT_GROUP, { keyword }).then((res) => + setAlertGroupState((prevState) => ({ + ...prevState, + alertGroupList: res as Alert.AlertGroup[] + })) ); }; @@ -124,7 +131,7 @@ const AlertGroupTableList: React.FC = (props: any) => { const handleSubmit = async (value: Alert.AlertGroup) => { await exexuteWithRefreshLoading(async () => handleAddOrUpdate( - API_CONSTANTS.ALERT_GROUP, + API_CONSTANTS.ALERT_GROUP_ADD_OR_UPDATE, value, () => {}, () => handleCleanState() @@ -137,6 +144,13 @@ const AlertGroupTableList: React.FC = (props: any) => { */ const renderToolBar = () => { return () => [ + queryAlertGroupList(value)} + />,