Unverified Commit 4b23c1ba authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

[Refactor][admin,web] Refactor alertinstance (#1892)

* refactor alert instance * refactor alert instance dingtalk * refactor alert instance feishu * refactor alert instance wechat * refactor alert instance email * 优化常量 * 优化代码 * 优化代码1 * spotless:apply * change datetime gettype * coding op
parent 4435bfc1
...@@ -26,4 +26,6 @@ public class BaseConstant { ...@@ -26,4 +26,6 @@ public class BaseConstant {
/** default batch insert size */ /** default batch insert size */
public static final Integer DEFAULT_BATCH_INSERT_SIZE = 1000; public static final Integer DEFAULT_BATCH_INSERT_SIZE = 1000;
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
} }
...@@ -25,6 +25,7 @@ import org.dinky.common.result.ProTableResult; ...@@ -25,6 +25,7 @@ import org.dinky.common.result.ProTableResult;
import org.dinky.common.result.Result; import org.dinky.common.result.Result;
import org.dinky.model.AlertInstance; import org.dinky.model.AlertInstance;
import org.dinky.service.AlertInstanceService; import org.dinky.service.AlertInstanceService;
import org.dinky.utils.MessageResolverUtils;
import java.util.List; import java.util.List;
...@@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
...@@ -41,11 +43,7 @@ import com.fasterxml.jackson.databind.JsonNode; ...@@ -41,11 +43,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /** AlertInstanceController */
* AlertInstanceController
*
* @since 2022/2/24 19:54
*/
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/api/alertInstance") @RequestMapping("/api/alertInstance")
...@@ -54,51 +52,117 @@ public class AlertInstanceController { ...@@ -54,51 +52,117 @@ public class AlertInstanceController {
private final AlertInstanceService alertInstanceService; private final AlertInstanceService alertInstanceService;
/** 新增或者更新 */ /**
* saveOrUpdate
*
* @param alertInstance {@link AlertInstance}
* @return {@link Result} of {@link Void}
* @throws Exception {@link Exception}
*/
@PutMapping @PutMapping
public Result<Void> saveOrUpdate(@RequestBody AlertInstance alertInstance) throws Exception { public Result<Void> saveOrUpdate(@RequestBody AlertInstance alertInstance) throws Exception {
if (alertInstanceService.saveOrUpdate(alertInstance)) { if (alertInstanceService.saveOrUpdate(alertInstance)) {
AlertPool.remove(alertInstance.getName()); AlertPool.remove(alertInstance.getName());
return Result.succeed("新增成功"); return Result.succeed(MessageResolverUtils.getMessage("save.success"));
} else { } else {
return Result.failed("新增失败"); return Result.failed(MessageResolverUtils.getMessage("save.failed"));
} }
} }
/** 动态查询列表 */ /**
* listAlertInstances
*
* @param para {@link JsonNode}
* @return {@link ProTableResult} of {@link AlertInstance}
*/
@PostMapping @PostMapping
public ProTableResult<AlertInstance> listAlertInstances(@RequestBody JsonNode para) { public ProTableResult<AlertInstance> listAlertInstances(@RequestBody JsonNode para) {
return alertInstanceService.selectForProTable(para); return alertInstanceService.selectForProTable(para);
} }
/** 批量删除 */ /**
* bactchDelete AlertInstance, this method is {@link Deprecated} and will be removed in the
* future, please use {@link #deleteInstanceById(Integer)} instead.
*
* @param para
* @return
*/
@DeleteMapping @DeleteMapping
@Deprecated
public Result<Void> deleteMul(@RequestBody JsonNode para) { public Result<Void> deleteMul(@RequestBody JsonNode para) {
return alertInstanceService.deleteAlertInstance(para); return alertInstanceService.deleteAlertInstance(para);
} }
/** 获取指定ID的信息 */ /**
* delete AlertInstance by id
*
* @param id {@link Integer}
* @return {@link Result} of {@link Void}
*/
@DeleteMapping("/delete")
public Result<Void> deleteInstanceById(@RequestParam("id") Integer id) {
if (alertInstanceService.removeById(id)) {
return Result.succeed(MessageResolverUtils.getMessage("delete.success"));
} else {
return Result.failed(MessageResolverUtils.getMessage("delete.failed"));
}
}
/**
* delete AlertInstance by id
*
* @param id {@link Integer}
* @return {@link Result} of {@link Void}
*/
@PutMapping("/enable")
public Result<Void> enable(@RequestParam("id") Integer id) {
if (alertInstanceService.enable(id)) {
return Result.succeed(MessageResolverUtils.getMessage("modify.success"));
} else {
return Result.failed(MessageResolverUtils.getMessage("modify.failed"));
}
}
/**
* get AlertInstance info by id
*
* @param alertInstance {@link AlertInstance}
* @return {@link Result} of {@link AlertInstance}
* @throws Exception {@link Exception}
*/
@PostMapping("/getOneById") @PostMapping("/getOneById")
public Result<AlertInstance> getOneById(@RequestBody AlertInstance alertInstance) public Result<AlertInstance> getOneById(@RequestBody AlertInstance alertInstance)
throws Exception { throws Exception {
alertInstance = alertInstanceService.getById(alertInstance.getId()); alertInstance = alertInstanceService.getById(alertInstance.getId());
return Result.succeed(alertInstance, "获取成功"); return Result.succeed(
alertInstance, MessageResolverUtils.getMessage("response.get.success"));
} }
/** 获取可用的报警实例列表 */ /**
* get all enabled AlertInstance
*
* @return {@link Result} of {@link AlertInstance}
*/
@GetMapping("/listEnabledAll") @GetMapping("/listEnabledAll")
public Result<List<AlertInstance>> listEnabledAll() { public Result<List<AlertInstance>> listEnabledAll() {
return Result.succeed(alertInstanceService.listEnabledAll(), "获取成功"); return Result.succeed(
alertInstanceService.listEnabledAll(),
MessageResolverUtils.getMessage("response.get.success"));
} }
/** 发送告警实例的测试信息 */ /**
* send test alert message
*
* @param alertInstance {@link AlertInstance}
* @return {@link Result} of {@link Void}
*/
@PostMapping("/sendTest") @PostMapping("/sendTest")
public Result<Void> sendTest(@RequestBody AlertInstance alertInstance) { public Result<Void> sendTest(@RequestBody AlertInstance alertInstance) {
AlertResult alertResult = alertInstanceService.testAlert(alertInstance); AlertResult alertResult = alertInstanceService.testAlert(alertInstance);
if (alertResult.getSuccess()) { if (alertResult.getSuccess()) {
return Result.succeed("发送成功"); return Result.succeed(MessageResolverUtils.getMessage("send.success"));
} else { } else {
return Result.failed("发送失败"); return Result.failed(MessageResolverUtils.getMessage("send.failed"));
} }
} }
} }
...@@ -24,20 +24,45 @@ import org.dinky.common.result.Result; ...@@ -24,20 +24,45 @@ import org.dinky.common.result.Result;
import org.dinky.db.service.ISuperService; import org.dinky.db.service.ISuperService;
import org.dinky.model.AlertInstance; import org.dinky.model.AlertInstance;
import java.io.Serializable;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
/** /** AlertInstanceService */
* AlertInstanceService
*
* @since 2022/2/24 19:52
*/
public interface AlertInstanceService extends ISuperService<AlertInstance> { public interface AlertInstanceService extends ISuperService<AlertInstance> {
/**
* list all enabled alert instance
*
* @return {@link List<AlertInstance>}
*/
List<AlertInstance> listEnabledAll(); List<AlertInstance> listEnabledAll();
/**
* test one alert instance
*
* @param alertInstance {@link AlertInstance}
* @return {@link AlertResult}
*/
AlertResult testAlert(AlertInstance alertInstance); AlertResult testAlert(AlertInstance alertInstance);
/**
* batch delete alert instance , this method is{@link Deprecated} , will be removed in the
* future, please use {@link
* com.baomidou.mybatisplus.core.mapper.BaseMapper#deleteById(Serializable id)} instead
*
* @param para {@link JsonNode}
* @return {@link Result<Void>}
*/
@Deprecated
Result<Void> deleteAlertInstance(JsonNode para); Result<Void> deleteAlertInstance(JsonNode para);
/**
* enable or disable alert instance
*
* @param id {@link Integer}
* @return {@link Boolean}
*/
Boolean enable(Integer id);
} }
...@@ -25,6 +25,7 @@ import org.dinky.alert.AlertMsg; ...@@ -25,6 +25,7 @@ import org.dinky.alert.AlertMsg;
import org.dinky.alert.AlertResult; import org.dinky.alert.AlertResult;
import org.dinky.alert.ShowType; import org.dinky.alert.ShowType;
import org.dinky.common.result.Result; import org.dinky.common.result.Result;
import org.dinky.constant.BaseConstant;
import org.dinky.db.service.impl.SuperServiceImpl; import org.dinky.db.service.impl.SuperServiceImpl;
import org.dinky.mapper.AlertInstanceMapper; import org.dinky.mapper.AlertInstanceMapper;
import org.dinky.model.AlertGroup; import org.dinky.model.AlertGroup;
...@@ -37,10 +38,9 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -37,10 +38,9 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
...@@ -53,17 +53,12 @@ import java.util.stream.Collectors; ...@@ -53,17 +53,12 @@ import java.util.stream.Collectors;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
/** /** AlertInstanceServiceImpl */
* AlertInstanceServiceImpl
*
* @since 2022/2/24 19:53
*/
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapper, AlertInstance> public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapper, AlertInstance>
...@@ -73,7 +68,7 @@ public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapp ...@@ -73,7 +68,7 @@ public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapp
@Override @Override
public List<AlertInstance> listEnabledAll() { public List<AlertInstance> listEnabledAll() {
return list(new QueryWrapper<AlertInstance>().eq("enabled", 1)); return list(new LambdaQueryWrapper<AlertInstance>().eq(AlertInstance::getEnabled, 1));
} }
@Override @Override
...@@ -84,9 +79,11 @@ public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapp ...@@ -84,9 +79,11 @@ public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapp
alertInstance.getType(), alertInstance.getType(),
JSONUtil.toMap(alertInstance.getParams())); JSONUtil.toMap(alertInstance.getParams()));
Alert alert = Alert.buildTest(alertConfig); Alert alert = Alert.buildTest(alertConfig);
String currentDateTime = String currentDateTime =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") LocalDateTime.now()
.format(Calendar.getInstance().getTime()); .format(DateTimeFormatter.ofPattern(BaseConstant.YYYY_MM_DD_HH_MM_SS));
String uuid = UUID.randomUUID().toString(); String uuid = UUID.randomUUID().toString();
AlertMsg alertMsg = new AlertMsg(); AlertMsg alertMsg = new AlertMsg();
...@@ -137,6 +134,13 @@ public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapp ...@@ -137,6 +134,13 @@ public class AlertInstanceServiceImpl extends SuperServiceImpl<AlertInstanceMapp
} }
} }
@Override
public Boolean enable(Integer id) {
AlertInstance alertInstance = getById(id);
alertInstance.setEnabled(!alertInstance.getEnabled());
return updateById(alertInstance);
}
private void writeBackGroupInformation(Map<Integer, Set<Integer>> alertGroupInformation) { private void writeBackGroupInformation(Map<Integer, Set<Integer>> alertGroupInformation) {
if (MapUtils.isEmpty(alertGroupInformation)) { if (MapUtils.isEmpty(alertGroupInformation)) {
return; return;
......
...@@ -29,6 +29,8 @@ create.success=\u65B0\u589E\u6210\u529F ...@@ -29,6 +29,8 @@ create.success=\u65B0\u589E\u6210\u529F
create.failed=\u65B0\u589E\u5931\u8D25 create.failed=\u65B0\u589E\u5931\u8D25
save.success=\u4FDD\u5B58\u6210\u529F save.success=\u4FDD\u5B58\u6210\u529F
save.failed=\u4FDD\u5B58\u5931\u8D25 save.failed=\u4FDD\u5B58\u5931\u8D25
send.success=\u53D1\u9001\u6210\u529F
send.failed=\u53D1\u9001\u5931\u8D25
# response messages # response messages
request.params.error=\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF request.params.error=\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF
......
...@@ -28,6 +28,8 @@ create.success=Add successfully ...@@ -28,6 +28,8 @@ create.success=Add successfully
create.failed=Create failed create.failed=Create failed
save.success=Save successfully save.success=Save successfully
save.failed=Save failed save.failed=Save failed
send.success=Send successfully
send.failed=Send failed
# response messages # response messages
request.params.error=Request parameter error request.params.error=Request parameter error
......
...@@ -29,7 +29,8 @@ create.success=\u65B0\u589E\u6210\u529F ...@@ -29,7 +29,8 @@ create.success=\u65B0\u589E\u6210\u529F
create.failed=\u65B0\u589E\u5931\u8D25 create.failed=\u65B0\u589E\u5931\u8D25
save.success=\u4FDD\u5B58\u6210\u529F save.success=\u4FDD\u5B58\u6210\u529F
save.failed=\u4FDD\u5B58\u5931\u8D25 save.failed=\u4FDD\u5B58\u5931\u8D25
send.success=\u53D1\u9001\u6210\u529F
send.failed=\u53D1\u9001\u5931\u8D25
# response messages # response messages
request.params.error=\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF request.params.error=\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF
......
...@@ -183,4 +183,5 @@ export default defineConfig({ ...@@ -183,4 +183,5 @@ export default defineConfig({
strategy: 'normal', strategy: 'normal',
}, },
requestRecord: {}, requestRecord: {},
dva: {},
}); });
...@@ -128,12 +128,12 @@ export default [ ...@@ -128,12 +128,12 @@ export default [
{ {
path: '/registration/alert/instance', path: '/registration/alert/instance',
name: 'instance', name: 'instance',
// component: './RegistrationCenter/AlertManage/AlertInstance', component: './RegCenter/Alert/AlertInstance',
}, },
{ {
path: '/registration/alert/group', path: '/registration/alert/group',
name: 'group', name: 'group',
// component: './RegistrationCenter/AlertManage/AlertGroup', // component: './RegistrationCenter/Alert/AlertGroup',
}, },
], ],
}, },
......
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
"react-draggable": "^4.4.5", "react-draggable": "^4.4.5",
"react-helmet-async": "^1.3.0", "react-helmet-async": "^1.3.0",
"screenfull": "^6.0.2" "screenfull": "^6.0.2",
"rc-resize-observer": "1.3.1"
}, },
"devDependencies": { "devDependencies": {
"@ant-design/pro-cli": "^3.0.1", "@ant-design/pro-cli": "^3.0.1",
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Icon from "@ant-design/icons";
const defaultSvgSize = "100%";
const style = {overflow: "hidden"};
export const DingTalkSvg = (props: any) => {
const size = props.size || defaultSvgSize;
return <>
<Icon style={style} component={
() => (
<svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
width={size} height={size}>
<path
d="M512.003 79C272.855 79 79 272.855 79 512.003 79 751.145 272.855 945 512.003 945 751.145 945 945 751.145 945 512.003 945 272.855 751.145 79 512.003 79z m200.075 375.014c-0.867 3.764-3.117 9.347-6.234 16.012h0.087l-0.347 0.648c-18.183 38.86-65.631 115.108-65.631 115.108l-0.215-0.52-13.856 24.147h66.8L565.063 779l29.002-115.368h-52.598l18.27-76.29c-14.76 3.55-32.253 8.436-52.945 15.1 0 0-27.967 16.36-80.607-31.5 0 0-35.501-31.29-14.891-39.078 8.744-3.33 42.466-7.573 69.004-11.122 35.93-4.845 57.965-7.441 57.965-7.441s-110.607 1.643-136.841-2.468c-26.237-4.11-59.525-47.905-66.626-86.377 0 0-10.953-21.117 23.595-11.122 34.547 10 177.535 38.95 177.535 38.95s-185.933-56.992-198.36-70.929c-12.381-13.846-36.406-75.902-33.289-113.981 0 0 1.343-9.521 11.127-6.926 0 0 137.49 62.75 231.475 97.152 94.028 34.403 175.76 51.885 165.2 96.414z"
fill="#3AA2EB"></path>
</svg>
)
}/>
</>;
};
export const WeChatSvg = (props: any) => {
const size = props.size || defaultSvgSize;
return <>
<Icon style={style} component={
() => (
<svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
width={size} height={size}>
<path
d="M523.9 691.2c-28.2 8.6-57.1 13.3-85.4 13.3-20.6 0-42.5-2.6-61.8-4.9-30.8-3.6-55.2-6.5-73.6 0.1-15.2 5.4-30.9 17.5-47.5 30.4-8.8 6.8-17.9 13.8-26.1 19.1 1.1-4.9 2.3-9.9 3.3-13.8 6.8-27.4 13.9-55.7-0.2-77.4-3.6-5.5-9-12.5-15.8-21.3-32.2-41.5-99.3-128-86.6-210.3 5.3-34.1 23-99.2 82.4-152.2 57.7-51.6 138.5-77.7 240.2-77.7 60.8 0 132.1 26.9 185.9 70.1 60.3 48.4 93.5 111.6 93.5 177.9 0 4.7-0.2 9.3-0.5 13.9 2.2 0 4.3-0.1 6.5-0.1 18.4 0 36.2 1.8 53.3 5.1 0.4-6.3 0.7-12.6 0.7-19 0-84.8-41.2-164.6-115.9-224.6-65-52.2-148.5-83.4-223.5-83.4-60.6 0-116 8.7-164.5 25.7-44.2 15.6-83.1 38.2-115.7 67.3C118.2 278 82.1 344.7 70.9 417.2c-7.3 47.3 3 99 30.7 153.9 22 43.5 50.6 80.4 67.7 102.4 4.7 6 8.8 11.4 11.4 15 0.2 6.7-3.8 22.6-6.2 32.4-3.3 13.3-6.7 27-7.6 39.7-2 29 10.7 43 21.7 49.6 7.7 4.6 16.1 6.9 25.2 6.9 11.1 0 23.2-3.5 36.1-10.4 14.4-7.7 28.6-18.6 42.3-29.2 10.4-8 24.6-19 30.9-21.3 6.7-1.8 30.7 1.1 46.6 2.9 21 2.5 44.8 5.3 68.8 5.3 38.5 0 79-7.2 117.8-20.8-14.2-15.7-25.2-33.3-32.4-52.4z"
fill="#0685EE"></path>
<path
d="M811.4 547.7c-5.2-13-11.1-25.7-20.8-35.6-8.9-9-20.4-14.4-33.1-14.4-28.1 0-50.9 22.8-50.9 50.9 0 14.3 6.2 28.2 16.9 37.8 5.2 4.7 11.4 8.3 18.1 10.5 18.9 6.2 37.6 13.3 55.7 21.7 9.1 4.2 18.1 8.8 26.9 13.8 8.5 4.9 16.1 12.6 26.2 13.7 7 0.7 6.2-5.6 3.7-10.1-11-19.9-22.3-39.8-31.7-60.5-4-8.9-7.3-18.4-11-27.8z"
fill="#36BB06"></path>
<path
d="M904.2 740c13-5.1 25.7-11.1 35.6-20.8 9-8.9 14.4-20.4 14.4-33.1 0-28.1-22.8-50.9-50.9-50.9-14.3 0-28.2 6.2-37.8 16.9-4.7 5.2-8.3 11.4-10.5 18.1-6.2 18.9-13.3 37.6-21.7 55.7-4.2 9.1-8.8 18.1-13.8 26.9-4.9 8.5-12.6 16.1-13.7 26.2-0.7 7 5.6 6.2 10.1 3.7 19.9-11 39.8-22.3 60.5-31.7 8.9-4 18.4-7.3 27.8-11z"
fill="#0383EE"></path>
<path
d="M620.5 632.3c-13 5.1-25.7 11.1-35.6 20.8-9 8.9-14.4 20.4-14.4 33.1 0 28.1 22.8 50.9 50.9 50.9 14.3 0 28.2-6.2 37.8-16.9 4.7-5.2 8.3-11.4 10.5-18.1 6.2-18.9 13.3-37.6 21.7-55.7 4.2-9.1 8.8-18.1 13.8-26.9 4.9-8.5 12.6-16.1 13.7-26.2 0.7-7-5.6-6.2-10.1-3.7-19.9 11-39.8 22.3-60.5 31.7-8.9 4-18.4 7.3-27.8 11z"
fill="#FFD301"></path>
<path
d="M710.5 831.9c5.1 13 11.1 25.7 20.8 35.6 8.9 9 20.4 14.4 33.1 14.4 28.1 0 50.9-22.8 50.9-50.9 0-14.3-6.2-28.2-16.9-37.8-5.2-4.7-11.4-8.3-18.1-10.5-18.9-6.2-37.6-13.3-55.7-21.7-9.1-4.2-18.1-8.8-26.9-13.8-8.5-4.9-16.1-12.6-26.2-13.7-7-0.7-6.2 5.6-3.7 10.1 11 19.9 22.3 39.8 31.7 60.5 4 8.9 7.3 18.5 11 27.8z"
fill="#FF6005"></path>
</svg>
)
}/>
</>;
};
export const FeiShuSvg = (props: any) => {
const size = props.size || defaultSvgSize;
return <>
<Icon style={style} component={
() => (
<svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
width={size} height={size}>
<path
d="M738.588528 406.663717c-2.36797 0.127998-2.943963-0.959988-3.19996-3.19996-0.255997-2.36797-0.127998-5.183935-1.279984-7.039912-2.239972-3.519956-1.59998-7.679904-3.519956-11.327859a20.095749 20.095749 0 0 1-2.239972-6.207922c-0.127998-1.279984 0.191998-3.071962-0.703991-3.775953-2.047974-1.471982-1.279984-3.839952-2.559968-5.759928-1.407982-2.047974-1.471982-5.055937-2.559968-7.551906-1.087986-2.623967-2.43197-5.439932-2.687966-8.319896-0.127998-1.407982-1.727978-1.471982-1.66398-2.879964 0.127998-2.36797-1.59998-4.287946-2.175972-6.527918-0.76799-3.007962-2.43197-5.887926-3.583956-8.83189-0.895989-2.36797-1.855977-4.79994-2.943963-6.911913-1.59998-3.19996-2.943963-6.463919-4.79994-9.59988-1.791978-2.751966-2.303971-6.335921-4.223947-9.343883a52.287346 52.287346 0 0 1-4.095949-7.871902c-1.855977-4.351946-4.543943-8.127898-6.655917-12.287846a169.533881 169.533881 0 0 0-6.591917-12.095849c-2.239972-3.775953-4.223947-7.743903-6.847915-11.391858-1.023987-1.471982-2.687966-2.943963-2.943963-4.607942-0.383995-2.43197-2.239972-4.159948-3.391957-5.567931-1.59998-1.919976-1.663979-5.311934-4.79994-6.015924 0 0-0.127998-0.319996-0.064-0.447995 0.255997-2.559968-3.327958-3.263959-3.007962-5.887926-2.751966-0.959988-1.983975-4.991938-5.119936-5.759928 0 0-0.127998-0.255997-0.063999-0.383995 0.255997-2.559968-2.239972-3.96795-3.327959-5.63193a43.19946 43.19946 0 0 0-4.79994-6.015925c-0.83199-0.895989-2.239972-1.663979-2.559968-2.751965-1.087986-3.839952-4.735941-5.759928-6.591917-9.087887-1.727978-3.071962-4.735941-5.119936-7.103912-7.679904a24.575693 24.575693 0 0 0-8.319896-6.39992c-3.007962-1.151986-5.375933-3.583955-8.959888-3.775953-3.711954-0.191998-7.23191-2.36797-11.13586-2.239972 0-0.83199-0.255997-1.471982-1.279984-1.471981H214.883074c-1.023987 0-1.279984 0.639992-1.279984 1.471981-2.559968-0.191998-3.96795 1.919976-4.79994 3.455957-1.919976 3.391958 0.83199 9.59988 4.543944 11.071862 1.535981 0.575993 2.36797 1.663979 3.455956 2.687966 0.575993 0.575993 1.087986 1.471982 1.919976 1.343983 1.535981-0.127998 2.239972 0.959988 2.687967 1.855977 0.575993 1.215985 1.663979 1.663979 2.559968 2.111974a32.511594 32.511594 0 0 1 7.423907 5.311933c3.327958 3.071962 7.039912 5.56793 10.623867 8.191898 3.007962 2.175973 5.439932 5.055937 8.703891 6.847914 2.495969 1.279984 3.839952 4.159948 6.207923 5.311934 3.327958 1.663979 5.183935 4.863939 8.383895 6.527918 1.983975 1.023987 3.519956 2.687966 4.927938 4.351946 1.279984 1.471982 3.583955 1.535981 4.607943 3.007962 3.007962 4.479944 8.127898 6.527918 11.647854 10.559868 3.455957 3.903951 8.319896 6.271922 11.903851 10.367871 4.223947 4.927938 9.983875 8.447894 14.591818 13.055837 3.19996 3.19996 6.463919 6.207922 9.727878 9.279884 2.559968 2.36797 5.119936 4.735941 7.551906 7.231909 1.791978 1.791978 4.095949 3.19996 5.759928 4.79994 4.159948 4.03195 8.959888 7.615905 11.839852 12.79984l0.639992 0.767991c3.19996 3.007962 6.39992 6.015925 9.471882 9.087886 3.839952 3.839952 7.551906 7.935901 11.711853 11.583855a15.743803 15.743803 0 0 1 4.223947 4.735941c0.83199 1.919976 2.303971 3.19996 3.583956 4.415945 3.519956 3.455957 7.359908 6.655917 9.855876 11.007862 1.023987 1.791978 3.135961 2.43197 4.223948 4.159948 1.407982 2.175973 3.519956 3.711954 4.927938 6.015925 2.047974 3.391958 5.56793 5.759928 7.935901 9.279884 2.303971 3.455957 5.375933 6.783915 8.319896 9.727879 3.327958 3.327958 5.63193 7.423907 9.151885 10.431869 1.855977 1.535981 2.047974 4.479944 4.415945 5.439932 1.215985 0.511994 1.59998 1.535981 1.919976 2.367971 1.279984 2.751966 3.647954 4.671942 5.119936 7.231909 1.471982 2.559968 3.96795 4.159948 5.63193 6.655917 3.071962 4.735941 6.591918 9.279884 10.431869 13.439832 1.215985 1.407982 1.087986 3.583955 2.879964 4.287946 2.687966 1.087986 3.135961 3.96795 4.543944 5.887927 1.791978 2.495969 4.223947 4.607942 5.56793 7.359908 1.407982 2.943963 3.839952 5.119936 5.375933 7.807902 1.407982 2.43197 3.19996 4.607942 4.671941 7.039912 1.087986 1.855977 2.111974 3.96795 3.711954 5.567931 1.727978 1.727978 2.239972 4.351946 4.223947 5.951925 1.791978 1.471982 2.175973 3.839952 3.839952 5.503931 1.727978 1.919976 2.43197 4.735941 4.351946 6.591918 1.663979 1.59998 2.495969 3.775953 3.647954 5.63193 0.83199 1.279984 2.559968 2.047974 2.751966 3.775952 0.191998 1.919976 1.663979 3.071962 2.623967 4.479944 1.471982 2.175973 3.391958 4.351946 4.223947 6.39992 1.535981 3.839952 4.159948 6.783915 6.015925 10.239872 2.175973 3.839952 4.863939 7.679904 7.039912 11.647855 1.663979 2.879964 3.327958 5.759928 5.119936 8.447894 0.76799 1.343983 0.639992 3.135961 2.111974 4.159948 1.791978 1.279984 2.175973 3.455957 3.19996 5.247935 0.895989 1.59998 1.535981 3.519956 2.815964 4.607942 1.023987 0.895989 1.023987 1.727978 1.215985 2.751966 1.535981 0.639992 2.303971-0.575993 3.19996-1.407983l7.167911-7.103911 14.783815-14.591818c4.223947-4.159948 8.127898-8.575893 12.479844-12.607842 7.679904-7.039912 14.719816-14.591818 22.39972-21.695729 4.991938-4.671942 9.471882-9.791878 14.975813-13.951825 4.79994-3.711954 8.83189-8.319896 13.183835-12.607843l9.663879-9.59988c3.327958-3.327958 7.679904-5.503931 10.751866-9.087886a2.687966 2.687966 0 0 1 0.959988-0.83199c3.19996-1.279984 5.439932-3.903951 8.127898-5.887926 3.135961-2.239972 6.271922-4.479944 9.343883-6.847915 1.535981-1.215985 3.519956-1.791978 4.86394-3.13596 3.839952-3.839952 8.959888-5.56793 13.439832-8.255897 4.735941-2.815965 9.59988-5.56793 14.591817-7.935901 3.519956-1.663979 6.655917-4.351946 10.495869-5.119936 4.415945-0.895989 7.679904-3.903951 11.839852-5.183935 1.279984-0.383995 2.879964-0.511994 4.03195-1.407983 2.43197-1.919976 5.695929-1.919976 8.447894-3.19996 1.279984-0.639992 2.687966-1.471982 4.159948-1.663979 3.327958-0.447994 6.271922-1.983975 9.471882-2.815965 0.895989-0.191998 1.59998-0.703991 0.831989-1.791977"
fill="#00D6B9"></path>
<path
d="M830.747376 641.156786c-0.959988-0.639992-1.535981 0.191998-2.111973 0.76799-1.727978 1.535981-2.943963 3.583955-4.415945 5.375933l-7.359908 8.575893c-5.055937 5.56793-10.495869 10.879864-15.9998 15.871801-4.287946 3.903951-9.087886 7.23191-13.695829 10.751866-1.727978 1.279984-3.455957 2.687966-5.247934 3.839952-1.919976 1.343983-3.647954 3.135961-5.759928 4.031949-4.03195 1.727978-7.615905 4.223947-11.327859 6.39992a167.037912 167.037912 0 0 1-20.223747 9.407883c-3.903951 1.59998-7.743903 3.327958-11.775853 4.607942-3.19996 1.023987-6.335921 2.36797-9.59988 3.19996-1.087986 0.255997-2.239972 0.127998-3.263959 0.511994-3.19996 1.215985-6.591918 1.919976-9.919876 2.751965-2.879964 0.76799-6.015925 0.127998-8.511894 1.279984-3.839952 1.791978-8.191898 0.127998-11.775852 2.559968-5.56793-0.063999-11.135861 0.575993-16.703792 1.023988-9.855877 0.76799-19.711754-0.639992-29.56763-0.895989-4.479944-0.127998-8.703891-2.36797-13.247835-1.727979-0.255997 0-0.511994-0.063999-0.703991-0.255996-1.471982-1.151986-3.19996-1.087986-4.863939-1.087987-3.455957 0-6.783915-0.76799-10.047874-1.407982-3.19996-0.639992-6.463919-1.855977-9.59988-2.943963-1.855977-0.639992-3.839952-0.255997-5.503932-1.087987a28.607642 28.607642 0 0 0-7.679904-2.431969c-6.143923-1.279984-11.839852-3.839952-18.047774-4.86394-4.095949-0.703991-7.679904-3.007962-11.775853-3.839952-2.879964-0.639992-5.695929-1.663979-8.447894-2.559968-3.519956-1.151986-7.039912-2.36797-10.623867-3.263959-5.695929-1.535981-10.943863-3.96795-16.511794-5.759928-6.655917-2.175973-13.119836-4.79994-19.775753-7.039912-3.903951-1.279984-7.423907-3.647954-11.647854-4.287946a14.591818 14.591818 0 0 1-5.119936-1.919976c-3.135961-1.791978-6.655917-2.43197-9.855877-3.967951-2.687966-1.279984-5.695929-1.919976-8.319896-3.19996-4.351946-2.239972-9.407882-2.943963-13.375833-6.079924-0.255997-0.191998-0.639992-0.255997-0.959988-0.255996-3.19996-0.319996-6.079924-1.791978-8.831889-3.19996-6.079924-2.943963-12.607842-4.927938-18.559768-8.191898-4.735941-2.623967-9.983875-4.095949-14.719816-6.655917-1.087986-0.255997-2.047974-0.063999-3.19996-0.639992-1.983975-0.959988-3.839952-2.559968-5.887927-3.071961-3.903951-1.087986-6.847914-3.903951-10.687866-5.055937-2.175973-0.639992-3.839952-2.559968-5.887927-3.071962-2.559968-0.639992-4.671942-1.919976-6.719916-3.071961-3.391958-1.919976-7.039912-3.19996-10.431869-5.311934-1.855977-1.151986-4.287946-1.535981-5.887927-2.879964-2.43197-2.047974-6.207922-1.919976-7.871901-4.991938-4.095949-0.319996-6.847914-3.455957-10.367871-4.927938-4.159948-1.727978-7.935901-4.351946-11.903851-6.591918-1.663979-0.959988-3.19996-2.687966-4.79994-3.007962-4.351946-0.895989-7.295909-3.96795-10.879864-5.887926a124.414445 124.414445 0 0 1-12.159848-7.295909c-0.639992-0.383995-1.59998-0.319996-2.047974-0.83199-2.559968-2.879964-6.207922-4.351946-9.343883-6.271921a424.186698 424.186698 0 0 1-9.279884-5.63193c-3.775953-2.36797-7.679904-4.735941-11.26386-7.295909-2.36797-1.727978-5.375933-2.751966-7.423907-4.735941-1.535981-1.407982-3.391958-1.919976-4.927938-3.19996-2.815965-2.303971-6.079924-4.159948-9.151886-6.271921-1.407982-0.959988-3.263959-1.855977-4.223947-2.879964-1.855977-2.047974-4.351946-3.071962-6.335921-4.735941-2.943963-2.495969-6.655917-4.223947-9.59988-6.847914-1.727978-1.535981-4.287946-1.791978-5.56793-3.967951-0.447994-0.83199-1.279984-1.407982-2.43197-1.727978-1.919976-0.511994-3.263959-2.111974-4.863939-3.19996-2.36797-1.59998-4.479944-3.775953-6.911914-5.439932-2.943963-1.983975-5.503931-4.607942-8.511893-6.39992-3.263959-1.983975-5.56793-5.055937-8.83189-6.911914-1.983975-1.215985-3.19996-3.455957-5.119936-4.351945-3.455957-1.535981-5.503931-4.543943-8.639892-6.39992-2.43197-1.535981-4.095949-4.415945-6.655917-5.759928-3.007962-1.59998-4.79994-4.415945-7.487906-6.271922-0.76799-0.575993-1.663979-0.639992-2.36797-1.535981-1.727978-2.111974-4.095949-3.647954-6.079924-5.503931-2.111974-1.919976-4.735941-3.19996-6.655917-5.503931-1.535981-1.663979-3.19996-3.903951-5.119936-4.671942-2.943963-1.087986-4.223947-3.711954-6.527919-5.375933-2.879964-2.047974-4.991938-4.991938-7.807902-7.231909-1.791978-1.407982-3.839952-2.559968-5.247934-4.351946C128.03616 453.383133 125.348194 451.143161 122.916224 448.83919 119.716264 445.703229 116.644302 442.43927 113.316344 439.431307 110.756376 437.127336 108.388406 434.567368 105.764438 432.263397 103.332469 430.087424 101.156496 427.655454 98.724526 425.479482 95.524566 422.535518 92.580603 419.20756 89.508642 416.071599 86.500679 412.871639 83.23672 409.927676 80.292757 406.663717 77.732789 403.783753 75.172821 400.263797 70.180883 401.351783 67.748914 401.863777 66.596928 403.399758 65.700939 405.383733 63.20497 405.63973 64.228958 407.559706 64.228958 408.647692V771.075162c0 1.471982 0.127998 2.879964 0.063999 4.287946 0 1.087986 0.383995 1.59998 1.407982 1.663979-0.639992 3.327958 1.59998 6.015925 2.111974 9.087887 0.319996 2.175973 1.727978 4.03195 2.559968 6.079924 1.215985 2.815965 3.583955 5.183935 5.247934 7.871901a21.823727 21.823727 0 0 0 5.63193 5.823927c2.303971 1.663979 4.671942 3.455957 7.16791 4.927939 2.943963 1.663979 5.759928 3.775953 8.511894 5.695929 0.83199 0.511994 1.791978 0.639992 2.687966 1.471981 2.559968 2.303971 5.823927 4.03195 8.959888 5.63193 2.111974 1.087986 4.095949 2.559968 6.39992 3.519956 5.119936 2.111974 9.471882 5.951926 14.719816 7.9999 2.943963 1.087986 5.183935 3.19996 8.191898 4.095949 0.703991 0.255997 1.535981 0.319996 2.111973 0.703991 4.223947 2.943963 9.023887 4.607942 13.567831 6.911913 0.959988 0.511994 2.175973 0.511994 2.943963 1.151986a18.815765 18.815765 0 0 0 8.319896 3.711954c0.511994 0.127998 1.023987 0.191998 1.59998 0.639992 1.279984 0.959988 2.879964 1.663979 4.351946 2.495968 1.663979 0.959988 3.839952 0.383995 5.375932 2.047975 0.575993 0.639992 1.919976 1.471982 3.007963 1.663979 4.479944 0.83199 8.639892 2.943963 12.79984 4.607942 1.279984 0.511994 2.943963 0 3.839952 0.959988 1.663979 1.727978 4.03195 1.663979 5.951925 2.559968 2.815965 1.215985 5.759928 2.175973 8.895889 2.943964 1.343983 0.319996 3.19996 0.063999 4.03195 0.959988 1.59998 1.791978 4.03195 1.919976 5.759928 2.36797 4.607942 1.087986 9.087886 2.559968 13.56783 4.095949 3.583955 1.279984 7.615905 1.535981 11.391858 2.687966 3.19996 0.895989 6.39992 1.919976 9.59988 2.495969 1.471982 0.255997 3.647954-0.319996 4.479944 0.447994 2.43197 2.43197 5.759928 1.023987 8.511893 2.367971 2.687966 1.279984 6.39992 1.791978 9.855877 1.535981 0.639992-0.063999 1.59998-0.191998 1.919976 0.127998 2.559968 2.559968 6.527918 0 8.959888 2.623967 5.759928 0.511994 11.519856 0.76799 17.151786 2.43197 3.647954 1.087986 7.679904 0.511994 11.519856 1.407982 4.671942 1.087986 9.727878 0.76799 14.591817 1.279984 3.19996 0.255997 6.335921 0.127998 9.471882 0.191998 0 1.023987 0.575993 1.407982 1.59998 1.343983h69.119136c1.023987 0 1.59998-0.319996 1.59998-1.343983 7.679904 0.383995 15.23181-1.407982 22.847714-1.151986h4.223948c1.023987 0.063999 1.59998-0.319996 1.53598-1.407982a78.079024 78.079024 0 0 0 10.239872-1.279984c5.375933-1.087986 11.007862-0.83199 16.383796-2.559968 2.687966-0.895989 5.759928-0.76799 8.639892-1.471982 3.327958-0.76799 6.847914-1.663979 10.495868-1.407982 0.383995 0 1.023987 0 1.215985-0.191998 1.791978-2.36797 4.79994-1.279984 7.167911-2.36797a18.495769 18.495769 0 0 1 8.319896-1.471982c0.383995 0 0.895989 0 1.279984-0.191997a20.479744 20.479744 0 0 1 8.191897-2.623968 54.39932 54.39932 0 0 0 11.327859-2.943963 49.983375 49.983375 0 0 1 8.383895-2.239972c0.639992-0.127998 1.343983-0.127998 1.663979-0.511993 1.59998-1.663979 3.96795-1.727978 5.759928-2.239972 3.711954-0.959988 7.23191-2.36797 10.879864-3.455957 1.215985-0.319996 2.623967 0.063999 3.647954-0.639992a22.527718 22.527718 0 0 1 9.471882-3.839952c0.575993-0.063999 1.087986-0.127998 1.59998-0.511994 1.663979-1.023987 3.19996-2.239972 5.311934-2.495969 2.943963-0.319996 5.759928-1.791978 8.319896-3.071961 2.175973-1.087986 4.607942-1.919976 6.847914-3.071962 1.727978-0.895989 3.583955-1.983975 5.695929-2.36797 3.007962-0.511994 4.991938-3.135961 8.063899-3.775953a22.719716 22.719716 0 0 0 6.527918-2.751966c3.263959-1.855977 6.655917-3.391958 9.983876-4.991937 2.111974-1.087986 4.543943-1.983975 6.271921-3.263959a47.871402 47.871402 0 0 1 8.319896-4.607943c3.711954-1.663979 6.975913-4.03195 10.687867-5.631929 3.19996-1.471982 6.079924-3.839952 9.279884-5.63193 1.59998-0.895989 3.071962-2.303971 4.607942-3.071962a63.807202 63.807202 0 0 0 5.119936-3.007962c2.175973-1.471982 4.735941-2.36797 6.591918-4.223947 1.663979-1.663979 3.903951-2.239972 5.631929-3.775953 2.047974-1.727978 4.79994-2.559968 6.719916-4.479944 0.639992-0.639992 1.023987-1.279984 1.919976-1.279984a3.071962 3.071962 0 0 0 2.367971-1.59998 5.503931 5.503931 0 0 1 2.559968-2.175973c3.007962-1.087986 4.607942-3.96795 7.423907-5.375933 1.727978-0.83199 3.19996-2.43197 4.79994-3.583955 2.751966-1.919976 5.375933-3.96795 7.9999-6.015925 1.471982-1.151986 2.751966-3.135961 4.223947-3.583955 3.19996-1.023987 4.159948-4.479944 7.167911-5.759928a9.919876 9.919876 0 0 0 2.751965-2.047974c2.303971-2.559968 5.119936-4.607942 7.679904-7.103911 1.59998-1.663979 3.775953-2.43197 5.311934-4.223948a46.207422 46.207422 0 0 1 6.015925-6.079924c1.919976-1.535981 3.711954-3.327958 5.375932-5.119936l9.59988-9.53588c3.19996-3.071962 6.207922-6.207922 9.407883-9.215885a40.319496 40.319496 0 0 0 5.119936-6.015925 32.255597 32.255597 0 0 1 5.759928-6.079924c1.663979-1.343983 2.175973-3.391958 3.711953-4.79994a27.135661 27.135661 0 0 0 5.823928-6.591918c1.727978-2.943963 4.671942-4.79994 6.271921-7.807902 1.151986-2.175973 3.391958-3.583955 4.735941-5.759928 1.343983-2.303971 3.19996-4.351946 4.927938-6.39992 1.919976-2.303971 4.095949-4.735941 5.375933-7.295909 1.343983-2.751966 3.775953-4.479944 5.119936-7.231909a43.519456 43.519456 0 0 1 4.927939-7.103912c1.279984-1.59998 2.047974-3.391958 3.13596-5.055936 1.663979-2.559968 3.455957-5.055937 5.247935-7.551906 0.703991-1.087986 0.83199-2.239972 1.791977-3.327958 1.727978-1.791978 3.647954-3.96795 3.19996-6.911914"
fill="#3370FF"></path>
<path
d="M958.745776 423.23951c-0.383995-0.447994-0.76799-0.447994-1.279984-0.575993-1.407982-0.447994-3.007962-0.76799-4.287946-1.535981a26.36767 26.36767 0 0 0-4.479944-2.559968c-2.36797-0.959988-5.119936-1.279984-7.103911-2.687966-2.751966-2.111974-6.207922-2.047974-9.151886-3.583956a22.783715 22.783715 0 0 0-6.655917-2.36797c-1.791978-0.319996-3.647954-1.151986-5.375933-1.663979-2.36797-0.76799-4.863939-1.59998-7.295908-2.239972a143.806202 143.806202 0 0 1-11.327859-3.263959 19.96775 19.96775 0 0 0-8.063899-1.343984c-0.639992-2.623967-2.751966-1.087986-4.223947-1.407982-1.919976 0-3.711954-0.959988-5.503931-1.279984-5.823927-1.023987-11.775853-1.215985-17.66378-2.559968-4.671942-1.023987-9.727878-0.447994-14.591817-1.151986-2.879964-0.383995-5.759928-0.127998-8.703891-0.191997 0-1.151986-0.575993-1.407982-1.59998-1.407983h-28.095649c-1.023987 0-1.59998 0.319996-1.59998 1.407983-7.16791-0.383995-14.207822 1.215985-21.375733 1.151985h-4.223947c-1.023987-0.063999-1.471982 0.383995-1.535981 1.343984-4.095949-0.383995-7.935901 1.407982-12.03185 1.151985a1.279984 1.279984 0 0 0-0.703991 0.191998c-3.135961 2.175973-6.975913 1.407982-10.36787 2.559968-2.687966 0.895989-5.951926 0.76799-8.511894 1.727978-2.047974 0.703991-4.351946 1.279984-6.39992 2.111974a18.623767 18.623767 0 0 1-7.9999 1.59998c0.063999 0.511994 0.191998 1.151986-0.511993 1.215985-1.59998 0.127998-3.071962 0.959988-4.479944 1.279984-4.223947 1.087986-8.191898 2.687966-12.287847 4.095948-3.583955 1.279984-6.911914 3.19996-10.431869 4.03195-4.03195 0.959988-6.847914 4.159948-11.071862 4.671942a7.103911 7.103911 0 0 0-3.647954 1.279984 13.119836 13.119836 0 0 1-3.903952 2.36797 26.36767 26.36767 0 0 0-6.39992 3.135961c-2.943963 1.919976-6.143923 3.19996-8.959888 5.119936-1.087986 0.76799-2.879964 0.447994-3.391957 1.279984-2.047974 3.583955-6.271922 3.647954-9.151886 5.887926-3.071962 2.36797-6.719916 4.159948-9.791877 6.463919-2.559968 1.919976-5.247934 3.711954-7.679904 5.759928-3.19996 2.751966-6.655917 5.247934-10.047875 7.679904-1.791978 1.279984-2.879964 3.647954-4.735941 4.223948-2.943963 1.023987-4.479944 3.455957-6.39992 5.247934-1.919976 1.919976-4.095949 3.903951-6.015925 5.951926-2.943963 3.007962-6.079924 5.823927-9.151885 8.76789-2.303971 2.175973-4.287946 4.927938-6.847915 6.591918-3.839952 2.559968-6.655917 5.951926-9.855876 8.959888-3.19996 3.007962-6.39992 6.143923-9.471882 9.279884-3.583955 3.647954-7.551906 6.911914-10.943863 10.687866-2.943963 3.327958-6.335921 6.207922-9.471882 9.279884-3.19996 3.135961-6.207922 6.463919-9.59988 9.471882a155.96605 155.96605 0 0 0-9.471881 9.471881c-2.43197 2.559968-4.991938 5.055937-7.551906 7.487907-2.559968 2.43197-4.735941 5.311934-7.935901 7.039912-0.319996 1.535981-1.59998 2.175973-2.751965 2.943963-3.327958 2.111974-5.951926 4.991938-8.83189 7.679904-1.919976 1.727978-3.455957 4.03195-5.63193 5.247934-3.583955 1.919976-6.143923 5.119936-9.343883 7.423907-3.839952 2.815965-7.807902 5.695929-11.19986 9.087887-1.663979 1.59998-4.223947 1.855977-5.311933 3.96795-0.895989 1.791978-3.19996 1.407982-4.287947 2.815965-2.239972 3.007962-5.887926 4.223947-8.575893 6.655917-1.59998 1.471982-3.839952 2.687966-5.759928 3.839952-1.215985 0.639992-2.559968 1.087986-3.583955 2.047974a41.59948 41.59948 0 0 1-8.255897 5.759928c-1.279984 0.76799-3.007962 1.279984-3.96795 2.367971-1.791978 1.919976-4.287946 2.815965-6.335921 4.479944a25.727678 25.727678 0 0 1-6.783915 4.095948c-3.19996 1.215985-5.63193 3.455957-8.575893 4.927939-3.96795 1.919976-7.679904 4.287946-11.583855 6.207922-1.023987 0.511994-2.751966 0.83199-3.327958 2.239972 0 0.895989 0.383995 1.151986 1.151985 1.59998 1.727978 1.023987 3.647954 1.279984 5.375933 1.983975 2.815965 1.279984 5.503931 2.879964 8.319896 4.03195 2.687966 1.087986 4.927938 2.943963 8.127898 3.19996a7.9999 7.9999 0 0 1 3.903952 1.919976c1.919976 1.663979 4.351946 2.303971 6.39992 3.071962 1.791978 0.639992 3.519956 1.791978 5.56793 2.175972 1.279984 0.255997 3.007962 0.191998 4.03195 0.959988 1.791978 1.407982 3.839952 2.175973 5.759928 3.327959 1.279984 0.76799 3.007962-0.255997 3.775952 0.895989 1.087986 1.59998 3.071962 1.855977 4.287947 2.303971 3.647954 1.279984 7.039912 2.751966 10.623867 4.223947 3.071962 1.279984 6.207922 2.175973 9.215885 3.839952 2.495969 1.343983 5.823927 1.407982 8.703891 2.623967 1.087986 0.511994 1.663979 1.535981 2.879964 1.663979a18.047774 18.047774 0 0 1 7.871902 2.367971c0.76799 0.511994 1.59998 1.407982 2.559968 1.59998 2.815965 0.575993 5.56793 1.279984 8.319896 2.431969 2.559968 1.023987 5.247934 2.175973 7.9359 2.559968 1.471982 0.191998 1.791978 1.663979 3.19996 1.66398 2.495969 0 4.479944 1.59998 6.847915 2.111973 3.19996 0.76799 6.335921 1.919976 9.471881 2.879964 0.703991 0.191998 1.919976-0.127998 2.239972 0.255997 1.919976 2.559968 5.119936 1.279984 7.679904 2.559968 2.751966 1.407982 6.39992 2.047974 9.59988 3.135961 2.879964 1.023987 5.759928 2.111974 8.83189 2.239972 0.511994 0 0.959988 0.127998 1.407982 0.447994 2.047974 1.279984 4.415945 1.983975 6.783916 2.559968a50.751366 50.751366 0 0 0 3.391957 0.575993c2.047974 0.319996 3.711954 1.727978 5.695929 1.855977 2.943963 0.127998 5.439932 1.919976 8.511894 2.047974 1.151986 0.063999 3.071962-0.127998 4.031949 0.83199 1.983975 1.983975 4.79994 1.855977 7.039912 2.431969 4.863939 1.279984 10.047874 0.959988 15.039812 2.623968 2.879964 1.023987 6.143923 0.639992 9.343883 1.407982 5.119936 1.151986 10.687866 0.76799 16.127799 1.087986 10.047874 0.639992 20.159748 0.383995 30.143623-0.76799 2.559968-0.319996 4.927938-0.447994 7.423907-1.087986a62.39922 62.39922 0 0 1 10.879864-1.791978c3.135961-0.255997 6.015925-1.59998 9.215885-1.279984a1.215985 1.215985 0 0 0 0.639992-0.191998c2.751966-1.727978 5.951926-1.727978 8.83189-2.687966 2.047974-0.639992 4.479944-0.575993 6.207922-1.59998a17.663779 17.663779 0 0 1 5.823927-2.239972c3.19996-0.511994 5.439932-3.19996 8.703892-2.943963 0.127998 0 0.255997-0.191998 0.383995-0.255997 2.175973-1.663979 4.863939-2.559968 7.295909-3.391958a68.479144 68.479144 0 0 0 7.743903-3.19996c3.327958-1.663979 6.527918-3.839952 9.791877-5.759928 0.959988-0.575993 2.36797 0.255997 3.071962-1.279984 0.511994-1.279984 1.727978-1.919976 3.19996-2.239972 1.663979-0.447994 3.583955-1.087986 4.287946-3.007962 0.319996-0.83199 0.959988-0.895989 1.59998-0.83199a2.43197 2.43197 0 0 0 2.175973-1.215984c2.047974-3.071962 5.56793-4.479944 8.383895-6.527919 2.943963-2.047974 5.247934-4.79994 8.319896-6.655917 3.647954-2.111974 6.271922-5.503931 9.215885-8.447894 2.495969-2.559968 4.863939-5.183935 7.487907-7.487906 2.047974-1.791978 3.007962-4.223947 5.055936-6.015925 1.407982-1.279984 3.647954-2.559968 4.223948-4.479944 0.895989-3.007962 3.327958-4.223947 5.375932-6.079924a11.711854 11.711854 0 0 1 3.135961-4.03195l0.767991-1.215985c1.087986-0.639992 0.511994-2.239972 1.663979-2.943963 2.047974-1.343983 2.815965-3.839952 3.711953-5.759928 1.407982-2.943963 3.135961-5.823927 4.79994-8.575893 1.791978-3.007962 2.879964-6.335921 5.119936-9.151885 1.663979-2.175973 2.751966-5.055937 3.967951-7.615905 2.175973-4.479944 4.415945-8.895889 6.783915-13.247834 1.407982-2.559968 2.751966-5.247934 3.96795-7.935901 1.215985-2.815965 2.815965-5.439932 4.095949-8.127899 1.279984-2.815965 3.071962-5.375933 4.095949-8.127898 1.279984-3.391958 3.19996-6.271922 4.671942-9.535881 0.447994-1.151986 0.319996-2.559968 1.151985-3.391957a16.383795 16.383795 0 0 0 3.583955-6.271922c1.279984-3.391958 4.159948-6.015925 4.479944-9.791878l0.255997-0.127998c1.279984-0.959988 1.727978-2.559968 2.43197-3.903951 1.151986-2.111974 1.663979-4.607942 3.071961-6.527919 2.175973-3.071962 3.455957-6.527918 5.119936-9.791877 1.087986-2.047974 1.919976-4.351946 3.071962-6.207923 1.919976-3.007962 3.19996-6.39992 4.991938-9.407882a38.463519 38.463519 0 0 0 3.19996-6.719916c0.575993-1.535981 1.663979-3.071962 2.623967-4.479944 1.727978-2.687966 2.943963-5.759928 5.183935-8.127898 0.959988-1.023987 0.895989-2.43197 2.047974-3.583956 1.919976-1.919976 2.943963-4.479944 4.479944-6.719916 1.151986-1.663979 1.919976-3.711954 3.26396-4.991937 2.559968-2.43197 4.479944-5.439932 6.207922-8.191898 1.727978-2.751966 3.96795-5.247934 5.951926-7.615905 3.263959-3.96795 6.783915-7.871902 10.36787-11.711853a4652.741841 4652.741841 0 0 0 9.727878-10.367871c1.919976-1.983975 1.407982-2.43197 0-3.839952"
fill="#133C9A"></path>
</svg>
)
}/>
</>;
};
export const EmailSvg = (props: any) => {
const size = props.size || defaultSvgSize;
return <>
<Icon style={style} component={
() => (
<svg className="icon" viewBox="0 0 1036 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
width={size} height={size}>
<path
d="M41.451064 207.245088c-22.617114 31.327496-36.391838 69.3863-36.391838 110.965278l0 382.754381c0 41.387619 13.71128 79.446423 36.201503 110.648053l316.950675-368.974539L41.451064 207.245088 41.451064 207.245088zM933.812955 159.38608c-29.728068-19.416212-65.157999-30.883381-103.216803-30.883381L194.767915 128.502699c-40.044018 0-77.008908 12.559037-107.637486 33.69952l421.449681 313.109184L933.812955 159.38608 933.812955 159.38608zM980.778616 203.529463 658.953933 442.569698l321.115532 373.848547c24.861224-32.03767 40.238446-71.821769 40.238446-115.516944L1020.307911 318.210365C1020.24549 274.902 1005.184469 235.498572 980.778616 203.529463L980.778616 203.529463zM527.292288 540.342512c-2.116197 1.602498-4.740978 0.76748-6.985088 1.792832-4.037966 1.666966-7.366781 3.01159-11.657504 2.948145-4.361331 0.063445-7.689123-1.281179-11.728112-2.948145-2.306532-1.026376-4.931313-0.190335-7.04751-1.730411l-80.537268-59.904345L86.490863 856.334349c30.693046 21.400403 67.979254 34.148751 108.278075 34.148751l635.827213 0c38.058804 0 73.42529-11.403724 103.090936-30.755468L607.891977 480.500589 527.292288 540.342512 527.292288 540.342512zM527.292288 540.342512"
fill="#1296db" data-spm-anchor-id="a313x.7781069.0.i7" className=""></path>
</svg>
)
}/>
</>;
};
export const DefaultSvg = (props: any) => {
const size = props.size || defaultSvgSize;
return <>
<Icon style={style} component={
() => (
<svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
width={size} height={size}>
<path
d="M950.896028 907.262252 799.11209 753.232157c-12.108782-12.302187-31.893384-12.434194-44.163849-0.325411-12.286838 12.103666-12.434194 31.878035-0.325411 44.163849l151.783938 154.030096c6.110161 6.206352 14.177907 9.31311 22.24463 9.31311 7.919367 0 15.839757-2.989077 21.919219-8.987698C962.857455 939.323459 963.004811 919.54909 950.896028 907.262252z"
></path>
<path
d="M884.039341 602.546226c30.65723-17.944697 39.848567-39.624463 42.156122-54.645574 2.26253-14.700817 0.147356-37.530778-22.773679-62.84021-44.830021-49.441039-119.794363-128.689964-142.222165-152.352897-5.586229-32.177863-24.425296-139.980101-37.535895-206.1655-4.869914-24.50716-19.174712-44.387953-39.248909-54.53915-19.896142-10.060123-43.38102-9.739828-66.149583 0.919952-61.168128 28.716019-160.318312 77.455069-189.568497 91.861174-32.803103-3.975545-145.002488-17.466814-211.030297-24.145933-21.283746-2.170432-42.202171 5.363148-57.380872 20.608364-15.971763 16.038278-24.099884 38.928614-21.751397 61.238736 7.060813 67.115584 20.99415 179.407066 25.055652 211.919551-14.049994 29.635971-62.535265 132.146693-90.514503 194.163141-13.837146 30.555923-8.352225 53.30402-1.311879 67.004043 9.378601 18.249643 27.083845 31.165814 48.677653 35.461653 64.594157 12.617365 177.831174 32.345686 211.060997 38.104853 23.967878 22.915919 104.747669 99.984179 153.59826 144.738475 19.759019 18.116613 38.028105 22.941502 51.890834 22.941502 3.360538 0 6.461155-0.284479 9.261944-0.726547 14.365172-2.292206 34.922371-11.127432 51.245128-40.153512 33.336246-59.07342 87.722924-160.679539 103.425557-190.086289 28.390607-15.70775 124.57218-69.067029 183.102225-103.293551C884.029108 602.551342 884.034225 602.551342 884.039341 602.546226zM852.482625 548.642548c-68.234057 39.898709-188.638311 106.333794-189.842743 106.998943-5.301749 2.922563-9.642614 7.324826-12.484336 12.672624-0.681522 1.276063-68.345598 128.328737-107.075691 196.964954-2.948145 5.236258-5.428639 7.848759-6.699586 8.860808-1.514493-0.568958-4.666276-2.272763-9.06854-6.308683-57.065693-52.281737-158.473291-149.420101-159.490457-150.396335-4.493338-4.306072-10.17678-7.172353-16.312524-8.230452-1.428535-0.243547-143.858432-24.786523-218.98548-39.45664-2.917446-0.579191-4.793166-1.942235-5.195326-2.725064-0.457418-0.889253-0.873903-4.900613 2.673899-12.728906 32.568766-72.198346 93.310176-200.045105 93.920066-201.331401 2.562359-5.383614 3.523243-11.391445 2.780323-17.309224-0.178055-1.408069-17.827017-141.622508-26.047236-219.706911-0.381693-3.634784 1.183965-7.90504 3.89368-10.623965 2.115174-2.124384 4.122901-2.592035 5.779633-2.592035 0.37146 0 0.721431 0.020466 1.057075 0.056282 76.915787 7.777127 217.582527 24.954345 218.995713 25.127284 6.019087 0.726547 12.164041-0.310062 17.619286-2.99931 1.245364-0.615007 125.360126-61.899792 196.786898-95.439676 4.895497-2.297322 9.063423-2.922563 11.437493-1.733481 2.699482 1.367137 5.118578 5.67321 6.17156 10.959609 15.310707 77.302597 38.628786 212.590839 38.862099 213.947743 1.046842 6.089695 3.883447 11.732206 8.138354 16.211217 0.950651 0.9967 95.328136 100.345406 147.737786 158.14788 5.880941 6.491855 7.284917 10.608615 7.345292 11.30037C864.163665 539.349905 861.291245 543.483038 852.482625 548.642548z"
></path>
<path
d="M348.905458 492.080322c-12.169157-12.220323-31.948643-12.266371-44.168965-0.085958-12.220323 12.169157-12.261255 31.943526-0.085958 44.168965l22.676465 22.768563c6.099928 6.125511 14.111392 9.190313 22.127973 9.190313 7.970532 0 15.94618-3.035126 22.040992-9.104355 12.220323-12.169157 12.261255-31.948643 0.085958-44.168965L348.905458 492.080322z"
></path>
<path
d="M508.766352 376.774179c6.105045 6.125511 14.116509 9.190313 22.127973 9.190313 7.970532 0 15.94618-3.035126 22.040992-9.104355 12.220323-12.174274 12.261255-31.948643 0.085958-44.168965l-22.681582-22.768563c-12.17939-12.220323-31.948643-12.256138-44.168965-0.085958-12.220323 12.174274-12.261255 31.948643-0.085958 44.168965L508.766352 376.774179z"
></path>
<path
d="M564.67878 441.515692c-16.851806 3.680832-27.53103 20.322861-23.856337 37.174668 0.056282 0.248663 4.707209 25.564235-11.290137 41.621956-15.524578 15.575744-39.035038 11.153014-40.616046 10.832719-16.673751-3.715625-33.310663 6.668886-37.225833 23.352871-3.934612 16.790408 6.486738 33.596166 23.281239 37.535895 6.003737 1.408069 13.852496 2.409886 22.748097 2.409886 22.895453 0 52.745295-6.634094 76.067466-30.04734 32.16763-32.289404 32.777521-77.43972 28.065196-99.023294C598.167498 448.51613 581.51933 437.856349 564.67878 441.515692z"
></path>
</svg>
)
}/>
</>;
};
...@@ -77,6 +77,7 @@ ol { ...@@ -77,6 +77,7 @@ ol {
background-color: rgba(79, 79, 79, 0.04); background-color: rgba(79, 79, 79, 0.04);
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden;
} }
.blue-icon { .blue-icon {
...@@ -97,3 +98,7 @@ ol { ...@@ -97,3 +98,7 @@ ol {
padding: 0; padding: 0;
height: max-content; height: max-content;
} }
.hidden-overflow {
overflow: hidden;
}
...@@ -508,86 +508,80 @@ export default { ...@@ -508,86 +508,80 @@ export default {
'rc.clusterConfig.help.kubernets.taskManagerMemory': 'Optional,taskManagerMemory memory', 'rc.clusterConfig.help.kubernets.taskManagerMemory': 'Optional,taskManagerMemory memory',
'rc.alert.instanceManagement': 'Alarm Instance Management', 'rc.ai.management': 'Alarm Instance Management',
'rc.alert.instance.name': 'Name', 'rc.ai.name': 'Name',
'rc.alert.instance.namePleaseHolder': 'please enter alarm instance name', 'rc.ai.namePleaseHolder': 'please enter alarm instance name',
'rc.alert.instance.type': 'Type', 'rc.ai.type': 'Type',
'rc.alert.instance.delete': 'Delete the Alarm Instance ', 'rc.ai.delete': 'Delete the Alarm Instance ',
'rc.alert.instance.create': 'Create Alarm Instance', 'rc.ai.create': 'Create Alarm Instance',
'rc.alert.instance.modify': 'Modify Alarm Instance', 'rc.ai.modify': 'Modify Alarm Instance',
'rc.alert.instance.deleteConfirm': 'Are you sure to delete the selected Alarm Instance? ', 'rc.ai.deleteConfirm': 'Are you sure to delete the selected Alarm Instance? ',
'rc.alert.instance.enable': 'Enable Alarm Instance ', 'rc.ai.dingTalk': 'DingDingTalk Config',
'rc.alert.instance.enableConfirm': 'Are you sure you want to enable this Alarm Instance? ', 'rc.ai.email': 'Email Config',
'rc.alert.instance.disable': 'Disable the Alarm Instance ', 'rc.ai.feishu': 'FeiShu Config',
'rc.alert.instance.disableConfirm': 'Are you sure you want to disable this Alarm Instance? ', 'rc.ai.wechat': 'WeChat Config',
'rc.alert.instance.disableTotalOf': 'Total Of {total} Alarm Instance Is Disabled',
'rc.ai.webhookPleaseHolder': 'please enter webhook url',
'rc.alert.instance.dingTalk': 'DingDingTalk Config', 'rc.ai.keywordPleaseHolder': 'please enter keyword',
'rc.alert.instance.email': 'Email Config', 'rc.ai.secretPleaseHolder': 'please enter secret',
'rc.alert.instance.feishu': 'FeiShu Config', 'rc.ai.proxyPleaseHolder': 'please enter proxy',
'rc.alert.instance.wechat': 'WeChat Config', 'rc.ai.portPleaseHolder': 'please enter port',
'rc.ai.userPleaseHolder': 'please enter user',
'rc.alert.instance.webhookPleaseHolder': 'please enter webhook url', 'rc.ai.atUsersPleaseHolder': 'Please enter the user ID (user ID of Feishu background is required), separated by multiple commas!',
'rc.alert.instance.keywordPleaseHolder': 'please enter keyword', 'rc.ai.passwordPleaseHolder': 'please enter password',
'rc.alert.instance.secretPleaseHolder': 'please enter secret', 'rc.ai.atMobilesPleaseHolder': 'Please enter the members that need @, multiple use, separated by numbers',
'rc.alert.instance.proxyPleaseHolder': 'please enter proxy', 'rc.ai.msgtypePleaseHolder': 'please choose message Send Type`',
'rc.alert.instance.portPleaseHolder': 'please enter port', 'rc.ai.corpIdPleaseHolder': 'Please enter CorpId',
'rc.alert.instance.userPleaseHolder': 'please enter user', 'rc.ai.wechatAtUsersPleaseHolder': 'Please enter the @user ID (enterprise and micro user name spelled out), separated by multiple commas!',
'rc.alert.instance.atUsersPleaseHolder': 'Please enter the user ID (user ID of Feishu background is required), separated by multiple commas!', 'rc.ai.sendTypePleaseHolder' : 'Please choose Send Type',
'rc.alert.instance.passwordPleaseHolder': 'please enter password', 'rc.ai.agentIdPleaseHolder': 'Please enter AgentId',
'rc.alert.instance.atMobilesPleaseHolder': 'Please enter the members that need @, multiple use, separated by numbers', 'rc.ai.receiversPleaseHolder': 'Please enter recipient email address! Separate multiple commas',
'rc.alert.instance.msgtypePleaseHolder': 'please choose message Send Type`', 'rc.ai.receiverCcsPleaseHolder': 'Please enter the receiverCcs email address! Separate multiple commas!',
'rc.alert.instance.corpIdPleaseHolder': 'Please enter CorpId', 'rc.ai.serverHostPleaseHolder': 'Mail server host',
'rc.alert.instance.wechatAtUsersPleaseHolder': 'Please enter the @user ID (enterprise and micro user name spelled out), separated by multiple commas!', 'rc.ai.serverPortPleaseHolder': 'Please enter the mail server port',
'rc.alert.instance.sendTypePleaseHolder' : 'Please choose Send Type', 'rc.ai.senderPleaseHolder': 'Please enter the mail server sender Nickname',
'rc.alert.instance.agentIdPleaseHolder': 'Please enter AgentId', 'rc.ai.emailUserPleaseHolder': 'Please enter your email username',
'rc.alert.instance.receiversPleaseHolder': 'Please enter recipient email address! Separate multiple commas', 'rc.ai.emailPasswordPleaseHolder': 'Please enter the email password! Note: the password is the authorization code',
'rc.alert.instance.receiverCcsPleaseHolder': 'Please enter the receiverCcs email address! Separate multiple commas!', 'rc.ai.smtpSslTrustPleaseHolder': 'Please enter a trusted domain',
'rc.alert.instance.serverHostPleaseHolder': 'Mail server host', 'rc.ai.xls.file.pathPleaseHolder': 'Please enter the XLS storage directory! The default is /tmp/xls',
'rc.alert.instance.serverPortPleaseHolder': 'Please enter the mail server port',
'rc.alert.instance.senderPleaseHolder': 'Please enter the mail server sender sender',
'rc.alert.instance.emailUserPleaseHolder': 'Please enter your email username', 'rc.ai.webhook': 'WebHook Url',
'rc.alert.instance.emailPasswordPleaseHolder': 'Please enter the email password! Note: the password is the authorization code', 'rc.ai.keyword': 'KeyWord',
'rc.alert.instance.smtpSslTrustPleaseHolder': 'Please enter a trusted domain', 'rc.ai.secret': 'Secret',
'rc.alert.instance.xls.file.pathPleaseHolder': 'Please enter the XLS storage directory! The default is /tmp/xls', 'rc.ai.isEnableProxy': 'IsEnableProxy',
'rc.ai.proxy': 'Proxy',
'rc.ai.port': 'Port',
'rc.alert.instance.webhook': 'WebHook Url', 'rc.ai.user': 'User',
'rc.alert.instance.keyword': 'KeyWord', 'rc.ai.password': 'Password',
'rc.alert.instance.secret': 'Secret', 'rc.ai.isAtAll': 'IsAtAll',
'rc.alert.instance.isEnableProxy': 'IsEnableProxy', 'rc.ai.corpId': 'CorpId',
'rc.alert.instance.proxy': 'Proxy', 'rc.ai.atMobiles': 'At Mobiles',
'rc.alert.instance.port': 'Port', 'rc.ai.sendType': 'Send Type',
'rc.alert.instance.user': 'User', 'rc.ai.agentId': 'AgentId',
'rc.alert.instance.password': 'Password', 'rc.ai.atUsers': 'At Users',
'rc.alert.instance.isAtAll': 'IsAtAll', 'rc.ai.receivers': 'Receivers',
'rc.alert.instance.corpId': 'CorpId', 'rc.ai.receiverCcs': 'ReceiverCcs',
'rc.alert.instance.atMobiles': 'At Mobiles', 'rc.ai.serverHost': 'Mail server Host',
'rc.alert.instance.sendType': 'Send Type', 'rc.ai.serverPort': 'Mail server Port',
'rc.alert.instance.agentId': 'AgentId', 'rc.ai.sender': 'Sender Nickname',
'rc.alert.instance.atUsers': 'At Users', 'rc.ai.enableSmtpAuth': 'Enable SmtpAuth',
'rc.alert.instance.receivers': 'Receivers', 'rc.ai.emailUser': 'Email user',
'rc.alert.instance.receiverCcs': 'ReceiverCcs', 'rc.ai.emailPassword': 'Email password',
'rc.alert.instance.serverHost': 'Mail server Host', 'rc.ai.starttlsEnable': 'Start Tls Enable',
'rc.alert.instance.serverPort': 'Mail server Port', 'rc.ai.sslEnable': 'Ssl Enable',
'rc.alert.instance.sender': 'Sender nickname', 'rc.ai.smtpSslTrust': 'Smtp Ssl Trust',
'rc.alert.instance.enableSmtpAuth': 'Enable SmtpAuth', 'rc.ai.xls.file.path': 'XLS storage directory',
'rc.alert.instance.emailUser': 'Email user', 'rc.ai.msgtype': 'Send Message Type',
'rc.alert.instance.emailPassword': 'Email password',
'rc.alert.instance.starttlsEnable': 'Start Tls Enable', 'rc.ai.sendType.app': 'Application',
'rc.alert.instance.sslEnable': 'Ssl Enable', 'rc.ai.sendType.wechat': 'WeChat',
'rc.alert.instance.smtpSslTrust': 'Smtp Ssl Trust', 'rc.ai.markdown': 'MarkDown',
'rc.alert.instance.xls.file.path': 'XLS storage directory', 'rc.ai.text': 'Text',
'rc.alert.instance.msgtype': 'Send Message Type', 'rc.ai.post': 'Post',
'rc.ai.table': 'Table',
'rc.alert.instance.sendType.app': 'Application', 'rc.ai.attachment': 'Attachment',
'rc.alert.instance.sendType.wechat': 'WeChat', 'rc.ai.tableAttachment': 'Table And Attachment',
'rc.alert.instance.markdown': 'MarkDown',
'rc.alert.instance.text': 'Text',
'rc.alert.instance.post': 'Post',
'rc.alert.instance.table': 'Table',
'rc.alert.instance.attachment': 'Attachment',
'rc.alert.instance.tableAttachment': 'Table And Attachment',
'rc.alert.groupManagement': 'Alarm Group Management ', 'rc.alert.groupManagement': 'Alarm Group Management ',
'rc.alert.group.name': 'Alarm Group Name', 'rc.alert.group.name': 'Alarm Group Name',
......
...@@ -504,82 +504,77 @@ export default { ...@@ -504,82 +504,77 @@ export default {
'rc.clusterConfig.help.kubernets.jobManagerMemory': '可选,JobManager 的内存配置', 'rc.clusterConfig.help.kubernets.jobManagerMemory': '可选,JobManager 的内存配置',
'rc.clusterConfig.help.kubernets.taskManagerMemory': '可选,taskManagerMemory 的内存配置', 'rc.clusterConfig.help.kubernets.taskManagerMemory': '可选,taskManagerMemory 的内存配置',
// alert
'rc.alert.instanceManagement': '报警实例管理', 'rc.ai.management': '报警实例管理',
'rc.alert.instance.name': '名称', 'rc.ai.type': '类型',
'rc.alert.instance.namePleaseHolder': '请输入告警实例名称', 'rc.ai.name': '名称',
'rc.alert.instance.type': '类型', 'rc.ai.namePleaseHolder': '请输入告警实例名称',
'rc.alert.instance.delete': '删除报警实例', 'rc.ai.delete': '删除报警实例',
'rc.alert.instance.create': '创建告警实例', 'rc.ai.create': '创建告警实例',
'rc.alert.instance.modify': '修改告警实例', 'rc.ai.modify': '修改告警实例',
'rc.alert.instance.deleteConfirm': '确定删除选中的报警实例吗?', 'rc.ai.deleteConfirm': '确定删除选中的报警实例吗?',
'rc.alert.instance.enable': '启用报警实例', 'rc.ai.dingTalk': '钉钉告警配置',
'rc.alert.instance.enableConfirm': '您确定要启用此报警实例吗?', 'rc.ai.email': '邮箱告警配置',
'rc.alert.instance.disable': '禁用报警实例', 'rc.ai.feishu': '飞书告警配置',
'rc.alert.instance.disableConfirm': '您确定要禁用此报警实例吗?', 'rc.ai.wechat': '企业微信告警配置',
'rc.alert.instance.disableTotalOf': '被禁用的报警实例共 {total} 个', 'rc.ai.webhookPleaseHolder': '请输入 webhook 地址',
'rc.alert.instance.dingTalk': '钉钉告警配置', 'rc.ai.keywordPleaseHolder': '请输入关键词',
'rc.alert.instance.email': '邮箱告警配置', 'rc.ai.secretPleaseHolder': '请输入 密令',
'rc.alert.instance.feishu': '飞书告警配置', 'rc.ai.proxyPleaseHolder': '请输入代理主机',
'rc.alert.instance.wechat': '企业微信告警配置', 'rc.ai.portPleaseHolder': '请输入代理端口',
'rc.alert.instance.webhookPleaseHolder': '请输入 webhook 地址', 'rc.ai.userPleaseHolder': '请输入代理用户',
'rc.alert.instance.keywordPleaseHolder': '请输入关键词', 'rc.ai.atUsersPleaseHolder': '请输入被@用户ID(需要飞书后台的用户ID),多个逗号隔开!',
'rc.alert.instance.secretPleaseHolder': '请输入 密令', 'rc.ai.passwordPleaseHolder': '请输入密码',
'rc.alert.instance.proxyPleaseHolder': '请输入代理主机', 'rc.ai.atMobilesPleaseHolder': '请输入@手机号 多个使用英文逗号分开 ',
'rc.alert.instance.portPleaseHolder': '请输入代理端口', 'rc.ai.msgtypePleaseHolder': '请选择消息发送类型',
'rc.alert.instance.userPleaseHolder': '请输入代理用户', 'rc.ai.corpIdPleaseHolder': '请输入 企业Id',
'rc.alert.instance.atUsersPleaseHolder': '请输入被@用户ID(需要飞书后台的用户ID),多个逗号隔开!', 'rc.ai.wechatAtUsersPleaseHolder': '请输入被@用户ID(企微用户名全拼),多个逗号隔开!',
'rc.alert.instance.passwordPleaseHolder': '请输入密码', 'rc.ai.sendTypePleaseHolder' : '请选择发送方式!',
'rc.alert.instance.atMobilesPleaseHolder': '请输入@手机号 多个使用英文逗号分开 ', 'rc.ai.agentIdPleaseHolder': '请输入 AgentId',
'rc.alert.instance.msgtypePleaseHolder': '请选择消息发送类型', 'rc.ai.receiversPleaseHolder': '请输入收件人邮箱!多个英文逗号隔开',
'rc.alert.instance.corpIdPleaseHolder': '请输入 企业Id', 'rc.ai.receiverCcsPleaseHolder': '请输入抄送人邮箱!多个英文逗号隔开!',
'rc.alert.instance.wechatAtUsersPleaseHolder': '请输入被@用户ID(企微用户名全拼),多个逗号隔开!', 'rc.ai.serverHostPleaseHolder': '邮件服务器主机',
'rc.alert.instance.sendTypePleaseHolder' : '请选择发送方式!', 'rc.ai.serverPortPleaseHolder': '请输入邮件服务器端口',
'rc.alert.instance.agentIdPleaseHolder': '请输入 AgentId', 'rc.ai.senderPleaseHolder': '请输入邮件服务器发送者昵称',
'rc.alert.instance.receiversPleaseHolder': '请输入收件人邮箱!多个英文逗号隔开', 'rc.ai.emailUserPleaseHolder': '请输入邮箱用户名',
'rc.alert.instance.receiverCcsPleaseHolder': '请输入抄送人邮箱!多个英文逗号隔开!', 'rc.ai.emailPasswordPleaseHolder': '请输入邮箱密码! 注意:密码为授权码',
'rc.alert.instance.serverHostPleaseHolder': '邮件服务器主机', 'rc.ai.smtpSslTrustPleaseHolder': '请输入受信任域',
'rc.alert.instance.serverPortPleaseHolder': '请输入邮件服务器端口', 'rc.ai.xls.file.pathPleaseHolder': '请输入XLS存放目录! 默认为 /tmp/xls',
'rc.alert.instance.senderPleaseHolder': '请输入邮件服务器发送者sender', 'rc.ai.webhook': 'WebHook 地址',
'rc.alert.instance.emailUserPleaseHolder': '请输入邮箱用户名', 'rc.ai.keyword': '关键词',
'rc.alert.instance.emailPasswordPleaseHolder': '请输入邮箱密码! 注意:密码为授权码', 'rc.ai.secret': '密令',
'rc.alert.instance.smtpSslTrustPleaseHolder': '请输入受信任域', 'rc.ai.isEnableProxy': '是否启用代理',
'rc.alert.instance.xls.file.pathPleaseHolder': '请输入XLS存放目录! 默认为 /tmp/xls', 'rc.ai.proxy': '代理',
'rc.alert.instance.webhook': 'WebHook 地址', 'rc.ai.port': '端口',
'rc.alert.instance.keyword': '关键词', 'rc.ai.user': '用户名',
'rc.alert.instance.secret': '密令', 'rc.ai.password': '密码',
'rc.alert.instance.isEnableProxy': '是否启用代理', 'rc.ai.isAtAll': '是否@全部',
'rc.alert.instance.proxy': '代理', 'rc.ai.corpId': '企业Id',
'rc.alert.instance.port': '端口', 'rc.ai.atMobiles': '@手机号',
'rc.alert.instance.user': '用户名', 'rc.ai.sendType': '发送方式',
'rc.alert.instance.password': '密码', 'rc.ai.agentId': '代理ID',
'rc.alert.instance.isAtAll': '是否@全部', 'rc.ai.atUsers': '被@用户',
'rc.alert.instance.corpId': '企业Id', 'rc.ai.receivers': '收件人',
'rc.alert.instance.atMobiles': '@手机号', 'rc.ai.receiverCcs': '抄送人',
'rc.alert.instance.sendType': '发送方式', 'rc.ai.serverHost': '邮件服务器Host',
'rc.alert.instance.agentId': '代理ID', 'rc.ai.serverPort': '邮件服务器Port',
'rc.alert.instance.atUsers': '被@用户', 'rc.ai.sender': '发送者昵称',
'rc.alert.instance.receivers': '收件人', 'rc.ai.enableSmtpAuth': '开启邮箱验证',
'rc.alert.instance.receiverCcs': '抄送人', 'rc.ai.emailUser': '邮箱用户名',
'rc.alert.instance.serverHost': '邮件服务器Host', 'rc.ai.emailPassword': '邮箱密码',
'rc.alert.instance.serverPort': '邮件服务器Port', 'rc.ai.starttlsEnable': '开启tls证书',
'rc.alert.instance.sender': '发送者sender昵称', 'rc.ai.sslEnable': '开启SSL',
'rc.alert.instance.enableSmtpAuth': '是否开启邮箱验证', 'rc.ai.smtpSslTrust': '受信任域',
'rc.alert.instance.emailUser': '邮箱用户名', 'rc.ai.xls.file.path': 'XLS存放目录',
'rc.alert.instance.emailPassword': '邮箱密码', 'rc.ai.msgtype': '展示方式',
'rc.alert.instance.starttlsEnable': '是否开启tls证书验证', 'rc.ai.sendType.app': '应用',
'rc.alert.instance.sslEnable': '是否开启SSL验证', 'rc.ai.sendType.wechat': '群聊',
'rc.alert.instance.smtpSslTrust': '受信任域', 'rc.ai.markdown': 'MarkDown',
'rc.alert.instance.xls.file.path': 'XLS存放目录', 'rc.ai.text': '普通文本',
'rc.alert.instance.msgtype': '展示方式', 'rc.ai.post': '富文本',
'rc.alert.instance.sendType.app': '应用', 'rc.ai.table': '表格',
'rc.alert.instance.sendType.wechat': '群聊', 'rc.ai.attachment': '附件',
'rc.alert.instance.markdown': 'MarkDown', 'rc.ai.tableAttachment': '表格和附件',
'rc.alert.instance.text': '普通文本',
'rc.alert.instance.post': '富文本',
'rc.alert.instance.table': '表格',
'rc.alert.instance.attachment': '附件',
'rc.alert.instance.tableAttachment': '表格和附件',
'rc.alert.groupManagement': '报警组管理', 'rc.alert.groupManagement': '报警组管理',
'rc.alert.group.name': '报警组名称', 'rc.alert.group.name': '报警组名称',
......
...@@ -22,7 +22,7 @@ import React, {useState} from "react"; ...@@ -22,7 +22,7 @@ import React, {useState} from "react";
import {Form, Modal} from "antd"; import {Form, Modal} from "antd";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {ProForm, ProFormSwitch, ProFormText} from "@ant-design/pro-components"; import {ProForm, ProFormSwitch, ProFormText} from "@ant-design/pro-components";
import {FORM_LAYOUT_PUBLIC, NORMAL_MODAL_OPTIONS} from "@/services/constants"; import {FORM_LAYOUT_PUBLIC, NORMAL_MODAL_OPTIONS, SWITCH_OPTIONS} from "@/services/constants";
export type UserFormProps = { export type UserFormProps = {
onCancel: (flag?: boolean) => void; onCancel: (flag?: boolean) => void;
...@@ -110,9 +110,8 @@ const UserForm: React.FC<UserFormProps> = (props) => { ...@@ -110,9 +110,8 @@ const UserForm: React.FC<UserFormProps> = (props) => {
<ProFormSwitch <ProFormSwitch
name="enabled" name="enabled"
{...SWITCH_OPTIONS()}
label={l("global.table.isEnable")} label={l("global.table.isEnable")}
checkedChildren={l("button.enable")}
unCheckedChildren={l("button.disable")}
/> />
</> </>
); );
......
...@@ -29,7 +29,13 @@ import TableTransferFrom from "@/pages/AuthCenter/User/components/UserTransfer"; ...@@ -29,7 +29,13 @@ import TableTransferFrom from "@/pages/AuthCenter/User/components/UserTransfer";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {handleAddOrUpdate, handleOption, handlePutData, handleRemoveById, updateEnabled} from "@/services/BusinessCrud"; import {handleAddOrUpdate, handleOption, handlePutData, handleRemoveById, updateEnabled} from "@/services/BusinessCrud";
import {queryList} from "@/services/api"; import {queryList} from "@/services/api";
import {API_CONSTANTS, PROTABLE_OPTIONS_PUBLIC, STATUS_ENUM, STATUS_MAPPING} from "@/services/constants"; import {
API_CONSTANTS,
PROTABLE_OPTIONS_PUBLIC,
STATUS_ENUM,
STATUS_MAPPING,
SWITCH_OPTIONS
} from "@/services/constants";
import {useAccess} from "@@/exports"; import {useAccess} from "@@/exports";
import {DangerDeleteIcon} from "@/components/Icons/CustomIcons"; import {DangerDeleteIcon} from "@/components/Icons/CustomIcons";
...@@ -202,8 +208,7 @@ const UserTableList: React.FC = () => { ...@@ -202,8 +208,7 @@ const UserTableList: React.FC = () => {
<Space> <Space>
<Switch <Switch
key={record.id} key={record.id}
checkedChildren={l("status.enabled")} {...SWITCH_OPTIONS()}
unCheckedChildren={l("status.disabled")}
checked={record.enabled} checked={record.enabled}
onChange={() => handleChangeEnable(record)}/> onChange={() => handleChangeEnable(record)}/>
</Space> </Space>
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {useState} from "react";
import {Card, List, Modal} from "antd";
import {connect} from "umi";
import {l} from "@/utils/intl";
import {Alert, ALERT_CONFIG_LIST, ALERT_TYPE, AlertConfig} from "@/types/RegCenter/data.d";
import {createOrModifyAlertInstance, sendTest} from "@/pages/RegCenter/Alert/AlertInstance/service";
import {AlertStateType} from "@/pages/RegCenter/Alert/AlertInstance/model";
import {getAlertIcon} from "@/pages/RegCenter/Alert/AlertInstance/function";
import {NORMAL_MODAL_OPTIONS} from "@/services/constants";
import DingTalk from "../DingTalk";
import WeChat from "../WeChat";
import FeiShu from "../FeiShu";
import Email from "../Email";
/**
* update form props
*/
type UpdateFormProps = {
onCancel: (flag?: boolean, formVals?: Partial<Alert.AlertInstance>) => void;
onSubmit: (values: Partial<Alert.AlertInstance>) => void;
modalVisible: boolean;
values: Partial<Alert.AlertInstance>;
};
const AlertTypeChoose: React.FC<UpdateFormProps> = (props) => {
/**
* state
*/
const [alertType, setAlertType] = useState<string>();
/**
* extract props
*/
const {
onSubmit: handleUpdate,
onCancel: handleChooseModalVisible,
modalVisible,
values
} = props;
/**
* choose one type
* @param item
*/
const chooseAlertType = (item: AlertConfig) => {
setAlertType(item.type);
};
/**
* submit form
* @param value
*/
const onSubmit = async (value: any) => {
const success = await createOrModifyAlertInstance(value);
if (success) {
handleChooseModalVisible();
setAlertType(undefined);
handleUpdate(value);
}
};
/**
* test alert msg
* @param value
*/
const onTest = async (value: any) => {
await sendTest(value);
};
/**
* cancel choose
*/
const handleCancel = () => {
setAlertType(undefined);
handleChooseModalVisible();
};
/**
* render card item
* @param item
*/
const renderCardItem = (item: AlertConfig) => {
return (
<List.Item onClick={() => {
chooseAlertType(item);
}}>
<Card>{getAlertIcon(item.type)}</Card>
</List.Item>
);
};
/**
* get alert type
* @param assertsType
*/
const getAlertType = (assertsType: string) => {
return values?.type === assertsType || alertType === assertsType;
};
/**
* card list
*/
const renderChooseTypesCardList = () => {
return <>
<List
grid={{gutter: 24, column: 4}}
dataSource={ALERT_CONFIG_LIST}
renderItem={(item: AlertConfig) => renderCardItem(item)}
/>
</>;
};
/**
* choose modal props
*/
const chooseProps = {
onCancel: handleCancel,
modalVisible: modalVisible,
values: values,
onSubmit: (value: any) => onSubmit(value),
onTest: (value: any) => onTest(value)
};
return (
<>
<Modal
{...NORMAL_MODAL_OPTIONS}
title={values?.id ? l("rc.ai.modify") : l("rc.ai.create")}
open={modalVisible}
onCancel={handleCancel}
footer={null}
>
{/* render card list*/}
{(!alertType && !values?.id) && renderChooseTypesCardList()}
{/* Renders the alert component form based on the selected alert type */}
{getAlertType(ALERT_TYPE.DINGTALK) && <DingTalk{...chooseProps}/>}
{getAlertType(ALERT_TYPE.WECHAT) && <WeChat{...chooseProps}/>}
{getAlertType(ALERT_TYPE.FEISHU) && <FeiShu{...chooseProps}/>}
{getAlertType(ALERT_TYPE.EMAIL) && <Email{...chooseProps}/>}
</Modal>
</>
);
};
export default connect(({Alert}: { Alert: AlertStateType }) => ({
instance: Alert.instance,
}))(AlertTypeChoose);
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {useState} from "react";
import {Button, Divider, Form, Radio, Space} from "antd";
import {l} from "@/utils/intl";
import {Alert, ALERT_TYPE} from "@/types/RegCenter/data.d";
import {buildJSONData, getJSONData} from "@/pages/RegCenter/Alert/AlertInstance/function";
import {
ModalForm,
ProForm, ProFormDigit, ProFormRadio,
ProFormSwitch,
ProFormText,
ProFormTextArea
} from "@ant-design/pro-components";
import {MODAL_FORM_STYLE, SWITCH_OPTIONS} from "@/services/constants";
import {AlertInstanceFormProps} from "@/pages/RegCenter/Alert/AlertInstance/constans";
const DingTalk: React.FC<AlertInstanceFormProps> = (props) => {
/**
* status of form
*/
const [form] = Form.useForm();
const [formVals, setFormVals] = useState<Partial<Alert.AlertInstance>>({
id: props.values?.id,
name: props.values?.name,
type: ALERT_TYPE.DINGTALK,
params: props.values?.params,
enabled: props.values?.enabled,
});
/**
* extract props
*/
const {
onSubmit: handleSubmit,
onCancel: handleModalVisible,
onTest: handleTest,
modalVisible,
} = props;
/**
* on values change
* @param change
*/
const onValuesChange = (change: any) => {
setFormVals({...formVals, ...change});
};
/**
* send test msg to dingtalk
*/
const sendTestForm = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleTest(buildJSONData(formVals, fieldsValue));
};
/**
* submit form data
*/
const submitForm = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleSubmit(buildJSONData(formVals, fieldsValue));
};
/**
* render dingtalk form
* @param vals
*/
const renderDingTalkForm = (vals: any) => {
return (
<>
<Divider>{l("rc.ai.dingTalk")}</Divider>
{/* base columns */}
<ProForm.Group>
<ProFormText
width="md"
name="name"
label={l("rc.ai.name")}
rules={[{required: true, message: l("rc.ai.namePleaseHolder")}]}
placeholder={l("rc.ai.namePleaseHolder")}
/>
<ProFormText
width="md"
name="keyword"
label={l("rc.ai.keyword")}
placeholder={l("rc.ai.keywordPleaseHolder")}
/>
<ProFormTextArea
width="md"
allowClear
name="webhook"
label={l("rc.ai.webhook")}
rules={[{required: true, message: l("rc.ai.webhookPleaseHolder")}]}
placeholder={l("rc.ai.webhookPleaseHolder")}
/>
<ProFormText.Password
width="md"
allowClear
name="secret"
label={l("rc.ai.secret")}
placeholder={l("rc.ai.secretPleaseHolder")}
/>
</ProForm.Group>
{/* advanced columns */}
<ProForm.Group>
<ProFormRadio.Group
name="msgtype"
width={"xs"}
label={l("rc.ai.msgtype")}
rules={[{required: true, message: l("rc.ai.msgtypePleaseHolder")}]}
>
<Radio.Group>
<Radio value="markdown">{l("rc.ai.markdown")}</Radio>
<Radio value="text">{l("rc.ai.text")}</Radio>
</Radio.Group>
</ProFormRadio.Group>
<ProFormSwitch
width="xs"
name="isEnableProxy"
label={l("rc.ai.isEnableProxy")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="isAtAll"
label={l("rc.ai.isAtAll")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="enabled"
label={l("global.table.isEnable")}
{...SWITCH_OPTIONS()}
/>
</ProForm.Group>
{/* if Enable Proxy this group do render */}
<ProForm.Group>
{vals.isEnableProxy && <>
<ProFormText
width="md"
name="proxy"
label={l("rc.ai.proxy")}
rules={[{required: true, message: l("rc.ai.proxyPleaseHolder")}]}
placeholder={l("rc.ai.proxyPleaseHolder")}
/>
<ProFormDigit
width="md"
name="port"
label={l("rc.ai.port")}
rules={[{required: true, message: l("rc.ai.portPleaseHolder")}]}
placeholder={l("rc.ai.portPleaseHolder")}
/>
<ProFormText
width="md"
name="user"
label={l("rc.ai.user")}
rules={[{required: true, message: l("rc.ai.userPleaseHolder")}]}
placeholder={l("rc.ai.userPleaseHolder")}
/>
<ProFormText.Password
width={"md"}
name="password"
label={l("rc.ai.password")}
rules={[{required: true, message: l("rc.ai.passwordPleaseHolder")}]}
placeholder={l("rc.ai.passwordPleaseHolder")}
/>
</>
}
</ProForm.Group>
{/* if not Enable At All this group do render */}
<ProForm.Group>
{!vals.isAtAll &&
<>
<ProFormTextArea
width="md"
name="atMobiles"
label={l("rc.ai.atMobiles")}
rules={[{required: true, message: l("rc.ai.atMobilesPleaseHolder")}]}
placeholder={l("rc.ai.atMobilesPleaseHolder")}
/>
</>
}
</ProForm.Group>
</>
);
};
const renderFooter = () => {
return [
<Button key={"AlertCancel"} onClick={() => handleModalVisible(false)}>{l("button.cancel")}</Button>,
<Button key={"AlertTest"} type="primary" onClick={() => sendTestForm()}>{l("button.test")}</Button>,
<Button key={"AlertFinish"} type="primary" onClick={() => submitForm()}>{l("button.finish")}</Button>,
];
};
return (
<Space>
<ModalForm<Alert.AlertInstance>
{...MODAL_FORM_STYLE}
title={formVals.id ? l("rc.ai.modify") : l("rc.ai.create")}
open={modalVisible}
submitter={{render: () => [...renderFooter()]}}
>
<ProForm
form={form}
initialValues={getJSONData(formVals)}
onValuesChange={onValuesChange}
submitter={false}
>
{renderDingTalkForm(getJSONData(formVals))}
</ProForm>
</ModalForm>
</Space>
);
};
export default DingTalk;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {useState} from "react";
import {Button, Divider, Form, Radio, Space} from "antd";
import {l} from "@/utils/intl";
import {Alert, ALERT_TYPE} from "@/types/RegCenter/data.d";
import {buildJSONData, getJSONData} from "@/pages/RegCenter/Alert/AlertInstance/function";
import {
ModalForm,
ProForm,
ProFormDigit, ProFormSwitch,
ProFormText,
ProFormTextArea
} from "@ant-design/pro-components";
import {MODAL_FORM_STYLE, SWITCH_OPTIONS} from "@/services/constants";
import {AlertInstanceFormProps} from "@/pages/RegCenter/Alert/AlertInstance/constans";
const Email: React.FC<AlertInstanceFormProps> = (props) => {
/**
* state
*/
const [form] = Form.useForm();
const [formVals, setFormVals] = useState<Partial<Alert.AlertInstance>>({
id: props.values?.id,
name: props.values?.name,
type: ALERT_TYPE.EMAIL,
params: props.values?.params,
enabled: props.values?.enabled,
});
/**
* extract props
*/
const {
onSubmit: handleSubmit,
onCancel: handleModalVisible,
onTest: handleTest,
modalVisible,
} = props;
/**
* values change callback
* @param change
*/
const onValuesChange = (change: any) => {
setFormVals({...formVals, ...change});
};
/**
* send test email callback
*/
const sendTestMsg = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleTest(buildJSONData(formVals, fieldsValue));
};
/**
* submit form callback
*/
const submitForm = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleSubmit(buildJSONData(formVals, fieldsValue));
};
/**
* render email content
* @param vals
*/
const renderEmailForm = (vals: any) => {
return (
<>
<Divider>{l("rc.ai.email")}</Divider>
{/* base columns */}
<ProForm.Group>
<ProFormText
width="md"
name="name"
label={l("rc.ai.name")}
rules={[{required: true, message: l("rc.ai.namePleaseHolder")}]}
placeholder={l("rc.ai.namePleaseHolder")}
/>
<ProFormText
width="md"
name="serverHost"
label={l("rc.ai.serverHost")}
rules={[{required: true, message: l("rc.ai.serverHostPleaseHolder")}]}
placeholder={l("rc.ai.serverHostPleaseHolder")}
/>
<ProFormDigit
width="md"
name="serverPort"
label={l("rc.ai.serverPort")}
rules={[{required: true, message: l("rc.ai.serverPortPleaseHolder")}]}
placeholder={l("rc.ai.serverPortPleaseHolder")}
/>
<ProFormText
width="md"
name="sender"
label={l("rc.ai.sender")}
rules={[{required: true, message: l("rc.ai.senderPleaseHolder")}]}
placeholder={l("rc.ai.senderPleaseHolder")}
/>
<ProFormTextArea
width="md"
name="receivers"
label={l("rc.ai.receivers")}
rules={[{required: true, message: l("rc.ai.receiversPleaseHolder")}]}
placeholder={l("rc.ai.receiversPleaseHolder")}
/>
<ProFormTextArea
width="md"
name="receiverCcs"
label={l("rc.ai.receiverCcs")}
placeholder={l("rc.ai.receiverCcsPleaseHolder")}
/>
</ProForm.Group>
{/* switch */}
<ProForm.Group>
<ProFormSwitch
width="xs"
name="enableSmtpAuth"
label={l("rc.ai.enableSmtpAuth")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="starttlsEnable"
label={l("rc.ai.starttlsEnable")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="sslEnable"
label={l("rc.ai.sslEnable")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="enabled"
label={l("global.table.isEnable")}
{...SWITCH_OPTIONS()}
/>
{/* ssl */}
{(vals.sslEnable) &&
<ProFormText
name="smtpSslTrust"
width={"sm"}
label={l("rc.ai.smtpSslTrust")}
rules={[{required: true, message: l("rc.ai.smtpSslTrustPleaseHolder")}]}
placeholder={l("rc.ai.smtpSslTrustPleaseHolder")}
/>
}
{/* msgtype */}
<Form.Item
name="msgtype"
label={l("rc.ai.msgtype")}
rules={[{required: true, message: l("rc.ai.msgtypePleaseHolder")}]}
>
<Radio.Group>
<Radio value="text">{l("rc.ai.text")}</Radio>
<Radio value="table">{l("rc.ai.table")}</Radio>
<Radio value="attachment">{l("rc.ai.attachment")}</Radio>
<Radio value="table attachment">{l("rc.ai.tableAttachment")}</Radio>
</Radio.Group>
</Form.Item>
{/* if choose attachment || table attachment , this input is render */}
{(vals.msgtype === "attachment" || vals.msgtype === "table attachment") &&
<ProFormText
name="xls.file.path"
width={"md"}
label={l("rc.ai.xls.file.path")}
placeholder={l("rc.ai.xls.file.pathPleaseHolder")} allowClear
/>}
</ProForm.Group>
{/* proxy */}
<ProForm.Group>
{vals.enableSmtpAuth &&
<>
<ProFormText
name="User"
width={"md"}
label={l("rc.ai.emailUser")}
rules={[{required: true, message: l("rc.ai.emailUserPleaseHolder")}]}
allowClear placeholder={l("rc.ai.emailUserPleaseHolder")}
/>
<ProFormText.Password
name="Password"
width={"md"}
label={l("rc.ai.emailPassword")}
rules={[{required: true, message: l("rc.ai.emailPasswordPleaseHolder")}]}
allowClear placeholder={l("rc.ai.emailPasswordPleaseHolder")}
/>
</>}
</ProForm.Group>
</>
);
};
/**
* render footer button
*/
const renderFooter = () => {
return [
<Button key={"AlertCancel"} onClick={() => handleModalVisible(false)}>{l("button.cancel")}</Button>,
<Button key={"AlertTest"} type="primary" onClick={() => sendTestMsg()}>{l("button.test")}</Button>,
<Button key={"AlertFinish"} type="primary" onClick={() => submitForm()}>{l("button.finish")}</Button>,
];
};
return (
<Space>
<ModalForm<Alert.AlertInstance>
{...MODAL_FORM_STYLE}
title={formVals.id ? l("rc.ai.modify") : l("rc.ai.create")}
open={modalVisible}
submitter={{render: () => [...renderFooter()]}}
>
<ProForm
form={form}
initialValues={getJSONData(formVals)}
onValuesChange={onValuesChange}
submitter={false}
>
{renderEmailForm(getJSONData(formVals))}
</ProForm>
</ModalForm>
</Space>
);
};
export default Email;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {useState} from 'react';
import {Button, Divider, Form, Radio, Space} from "antd";
import {l} from "@/utils/intl";
import {Alert, ALERT_TYPE} from "@/types/RegCenter/data.d";
import {buildJSONData, getJSONData} from "@/pages/RegCenter/Alert/AlertInstance/function";
import {
ModalForm,
ProForm, ProFormDigit,
ProFormRadio,
ProFormSwitch,
ProFormText,
ProFormTextArea
} from "@ant-design/pro-components";
import {MODAL_FORM_STYLE, SWITCH_OPTIONS} from "@/services/constants";
import {AlertInstanceFormProps} from "@/pages/RegCenter/Alert/AlertInstance/constans";
const FeiShu: React.FC<AlertInstanceFormProps> = (props) => {
/**
* status of form
*/
const [form] = Form.useForm();
const [formVals, setFormVals] = useState<Partial<Alert.AlertInstance>>({
id: props.values?.id,
name: props.values?.name,
type: ALERT_TYPE.FEISHU,
params: props.values?.params,
enabled: props.values?.enabled,
});
/**
* extract props
*/
const {
onSubmit: handleSubmit,
onTest: handleTest,
onCancel: handleModalVisible,
modalVisible,
} = props;
/**
* on values change
* @param change
*/
const onValuesChange = (change: any) => {
setFormVals({...formVals, ...change});
};
/**
* submit form
*/
const submitForm = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleSubmit(buildJSONData(formVals, fieldsValue));
};
/**
* send test msg
*/
const sendTestMsg = async () => {
const fieldsValue = await form.getFieldsValue();
setFormVals(buildJSONData(formVals, fieldsValue));
handleTest(buildJSONData(formVals, fieldsValue));
};
/**
* render content
* @param vals
*/
const renderFeiShuForm = (vals: any) => {
return (
<>
<Divider>{l('rc.ai.feishu')}</Divider>
<ProForm.Group>
<ProFormText
width="md"
name="name"
label={l('rc.ai.name')}
rules={[{required: true, message: l('rc.ai.namePleaseHolder')}]}
placeholder={l("rc.ai.namePleaseHolder")}
/>
<ProFormText
width="md"
name="keyword"
label={l("rc.ai.keyword")}
placeholder={l("rc.ai.keywordPleaseHolder")}
/>
<ProFormTextArea
width="md"
allowClear
name="webhook"
label={l("rc.ai.webhook")}
rules={[{required: true, message: l("rc.ai.webhookPleaseHolder")}]}
placeholder={l("rc.ai.webhookPleaseHolder")}
/>
<ProFormText.Password
width="md"
allowClear
name="secret"
label={l("rc.ai.secret")}
placeholder={l("rc.ai.secretPleaseHolder")}
/>
</ProForm.Group>
{/* advanced columns */}
<ProForm.Group>
<ProFormRadio.Group
name="msgtype"
width={"xs"}
label={l("rc.ai.msgtype")}
rules={[{required: true, message: l("rc.ai.msgtypePleaseHolder")}]}
>
<Radio.Group>
<Radio value='post'>{l('rc.ai.post')}</Radio>
<Radio value='text'>{l('rc.ai.text')}</Radio>
</Radio.Group>
</ProFormRadio.Group>
<ProFormSwitch
width="xs"
name="isEnableProxy"
label={l("rc.ai.isEnableProxy")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="isAtAll"
label={l("rc.ai.isAtAll")}
{...SWITCH_OPTIONS()}
/>
<ProFormSwitch
width="xs"
name="enabled"
label={l("global.table.isEnable")}
{...SWITCH_OPTIONS()}
/>
</ProForm.Group>
{/* if Enable Proxy this group do render */}
<ProForm.Group>
{vals.isEnableProxy && <>
<ProFormText
width="md"
name="proxy"
label={l("rc.ai.proxy")}
rules={[{required: true, message: l("rc.ai.proxyPleaseHolder")}]}
placeholder={l("rc.ai.proxyPleaseHolder")}
/>
<ProFormDigit
width="md"
name="port"
label={l("rc.ai.port")}
rules={[{required: true, message: l("rc.ai.portPleaseHolder")}]}
placeholder={l("rc.ai.portPleaseHolder")}
/>
<ProFormText
width="md"
name="user"
label={l("rc.ai.user")}
rules={[{required: true, message: l("rc.ai.userPleaseHolder")}]}
placeholder={l("rc.ai.userPleaseHolder")}
/>
<ProFormText.Password
width={"md"}
name="password"
label={l("rc.ai.password")}
rules={[{required: true, message: l("rc.ai.passwordPleaseHolder")}]}
placeholder={l("rc.ai.passwordPleaseHolder")}
/>
</>
}
</ProForm.Group>
{/* if not Enable At All this group do render */}
<ProForm.Group>
{!vals.isAtAll &&
<>
<ProFormTextArea
width="md"
name="users"
label={l('rc.ai.atUsers')}
rules={[{required: true, message: l('rc.ai.atUsersPleaseHolder')}]}
placeholder={l("rc.ai.atUsersPleaseHolder")}
/>
</>
}
</ProForm.Group>
</>
);
};
/**
* render footer button
*/
const renderFooter = () => {
return [
<Button key={"AlertCancel"} onClick={() => handleModalVisible(false)}>{l("button.cancel")}</Button>,
<Button key={"AlertTest"} type="primary" onClick={() => sendTestMsg()}>{l("button.test")}</Button>,
<Button key={"AlertFinish"} type="primary" onClick={() => submitForm()}>{l("button.finish")}</Button>,
];
};
/**
* render
*/
return (
<Space>
<ModalForm<Alert.AlertInstance>
{...MODAL_FORM_STYLE}
title={formVals.id ? l('rc.ai.modify') : l('rc.ai.create')}
open={modalVisible}
submitter={{render: () => [...renderFooter()]}}
>
<ProForm
form={form}
initialValues={getJSONData(formVals)}
onValuesChange={onValuesChange}
submitter={false}
>
{renderFeiShuForm(getJSONData(formVals))}
</ProForm>
</ModalForm>
</Space>
);
};
export default FeiShu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {useState} from "react";
import {Button, Divider, Form, Radio, Space} from "antd";
import {l} from "@/utils/intl";
import {Alert, ALERT_TYPE} from "@/types/RegCenter/data.d";
import {buildJSONData, getJSONData} from "@/pages/RegCenter/Alert/AlertInstance/function";
import {
ModalForm,
ProForm, ProFormDigit,
ProFormRadio,
ProFormSwitch,
ProFormText,
ProFormTextArea
} from "@ant-design/pro-components";
import {MODAL_FORM_STYLE, SWITCH_OPTIONS} from "@/services/constants";
import {AlertInstanceFormProps} from "@/pages/RegCenter/Alert/AlertInstance/constans";
const WeChat: React.FC<AlertInstanceFormProps> = (props) => {
/**
* status of form
*/
const [form] = Form.useForm();
const [formVals, setFormVals] = useState<Partial<Alert.AlertInstance>>({
id: props.values?.id,
name: props.values?.name,
type: ALERT_TYPE.WECHAT,
params: props.values?.params,
enabled: props.values?.enabled,
});
/**
* extract props
*/
const {
onSubmit: handleSubmit,
onCancel: handleModalVisible,
onTest: handleTest,
modalVisible,
} = props;
/**
* on values change
* @param change
*/
const onValuesChange = (change: any) => {
setFormVals({...formVals, ...change});
};
/**
* send test message
*/
const sendTestMsg = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleTest(buildJSONData(formVals, fieldsValue));
};
/**
* submit form
*/
const submitForm = async () => {
const fieldsValue = await form.validateFields();
setFormVals(buildJSONData(formVals, fieldsValue));
handleSubmit(buildJSONData(formVals, fieldsValue));
};
/**
* render form
* @param vals
*/
const renderWeChatForm = (vals: any) => {
return (
<>
<Divider>{l("rc.ai.wechat")}</Divider>
<ProForm.Group>
<ProFormText
width="md"
name="name"
label={l("rc.ai.name")}
rules={[{required: true, message: l("rc.ai.namePleaseHolder")}]}
placeholder={l("rc.ai.namePleaseHolder")}
/>
<ProFormRadio.Group
name="msgtype"
label={l("rc.ai.msgtype")}
rules={[{required: true, message: l("rc.ai.msgtypePleaseHolder")}]}
>
<Radio.Group>
<Radio value="markdown">{l("rc.ai.markdown")}</Radio>
<Radio value="text">{l("rc.ai.text")}</Radio>
</Radio.Group>
</ProFormRadio.Group>
<ProForm.Item
name="sendType"
validateTrigger={["onChange", "onBlur"]}
label={l("rc.ai.sendType")}
rules={[{required: true, message: l("rc.ai.sendTypePleaseHolder")}]}
>
<Radio.Group>
<Radio value="app">{l("rc.ai.sendType.app")}</Radio>
<Radio value="wechat">{l("rc.ai.sendType.wechat")}</Radio>
</Radio.Group>
</ProForm.Item>
<ProFormSwitch
name="enabled"
label={l("global.table.isEnable")}
{...SWITCH_OPTIONS()}
/>
{(vals.sendType === "wechat") &&
// if sendType is wechat render this switch group
<ProFormSwitch
name="isAtAll"
label={l("rc.ai.isAtAll")}
{...SWITCH_OPTIONS()}
/>
}
</ProForm.Group>
<ProForm.Group>
{(vals.sendType === "wechat") ?
// if sendType is wechat
<>
<ProFormTextArea
width="md"
allowClear
name="webhook"
label={l("rc.ai.webhook")}
rules={[{required: true, message: l("rc.ai.webhookPleaseHolder")}]}
placeholder={l("rc.ai.webhookPleaseHolder")}
/>
<ProFormText
width="md"
name="keyword"
label={l("rc.ai.keyword")}
placeholder={l("rc.ai.keywordPleaseHolder")}
/>
{/* if not Enable At All this group do render */}
{!vals.isAtAll &&
<>
<ProFormTextArea
width="md"
name="users"
label={l("rc.ai.atUsers")}
rules={[{required: true, message: l("rc.ai.atUsersPleaseHolder")}]}
placeholder={l("rc.ai.atUsersPleaseHolder")}
/>
</>
}
</>:
(vals.sendType === "app") &&
// if sendType is app
<>
<ProFormText
width="sm"
name="corpId"
label={l("rc.ai.corpId")}
rules={[{required: true, message: l("rc.ai.corpIdPleaseHolder")}]}
placeholder={l("rc.ai.corpIdPleaseHolder")}
/>
<ProFormText.Password
width="sm"
name="secret"
label={l("rc.ai.secret")}
rules={[{required: true, message: l("rc.ai.secretPleaseHolder")}]}
placeholder={l("rc.ai.secretPleaseHolder")}
/>
<ProFormDigit
width="sm"
name="agentId"
label={l("rc.ai.agentId")}
rules={[{required: true, message: l("rc.ai.agentIdPleaseHolder")}]}
placeholder={l("rc.ai.agentIdPleaseHolder")}
/>
<ProFormTextArea
width="xl"
name="users"
label={l("rc.ai.user")}
rules={[{required: true, message: l("rc.ai.userPleaseHolder")}]}
placeholder={l("rc.ai.userPleaseHolder")}
/>
</>
}
</ProForm.Group>
</>
);
};
/**
* render footer button
*/
const renderFooter = () => {
return [
<Button key={"AlertCancel"} onClick={() => handleModalVisible(false)}>{l("button.cancel")}</Button>,
<Button key={"AlertTest"} type="primary" onClick={() => sendTestMsg()}>{l("button.test")}</Button>,
<Button key={"AlertFinish"} type="primary" onClick={() => submitForm()}>{l("button.finish")}</Button>,
];
};
/**
* render
*/
return (
<Space>
<ModalForm<Alert.AlertInstance>
{...MODAL_FORM_STYLE}
title={formVals.id ? l("rc.ai.modify") : l("rc.ai.create")}
open={modalVisible}
submitter={{render: () => [...renderFooter()]}}
>
<ProForm
form={form}
initialValues={getJSONData(formVals)}
onValuesChange={onValuesChange}
submitter={false}
>
{renderWeChatForm(getJSONData(formVals))}
</ProForm>
</ModalForm>
</Space>
);
};
export default WeChat;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Alert} from "@/types/RegCenter/data";
/**
* AlertInstanceFormProps
*/
export type AlertInstanceFormProps = {
onCancel: (flag?: boolean) => void;
onSubmit: (values: Partial<Alert.AlertInstance>) => void;
onTest: (values: Partial<Alert.AlertInstance>) => void;
modalVisible: boolean;
values: Partial<Alert.AlertInstance>;
};
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Alert, ALERT_TYPE} from "@/types/RegCenter/data.d";
import {DefaultSvg, DingTalkSvg, EmailSvg, FeiShuSvg, WeChatSvg} from "@/components/Icons/AlertIcon";
/**
* get json data to alert instance
* @param values
*/
export const getJSONData = (values: Partial<Alert.AlertInstance>) => {
if (!values.params || values.params === "") {
return values;
}
let data = JSON.parse(values.params);
return {...data, ...values};
};
/**
* build json data to alert instance
* @param values
* @param params
*/
export const buildJSONData = (values: Partial<Alert.AlertInstance>, params: any) => {
let newValue = values;
if (params.name) {
newValue.name = params.name;
delete params.name;
}
if (params.enabled) {
newValue.enabled = params.enabled;
delete params.enabled;
}
let data: string = JSON.stringify(params);
return {...newValue, params: data};
};
/**
* get alert icon
* @param type alert type
* @param size icon size
*/
export const getAlertIcon = (type: string, size?: number) => {
switch (type) {
case ALERT_TYPE.DINGTALK:
return <DingTalkSvg size={size}/>;
case ALERT_TYPE.WECHAT:
return <WeChatSvg size={size}/>;
case ALERT_TYPE.FEISHU:
return <FeiShuSvg size={size}/>;
case ALERT_TYPE.EMAIL:
return <EmailSvg size={size}/>;
default:
return <DefaultSvg size={size}/>;
}
};
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, {useEffect, useRef, useState} from "react";
import {EditTwoTone, PlusOutlined} from "@ant-design/icons";
import {ActionType} from "@ant-design/pro-table";
import {Button, Descriptions, Modal, Space, Switch, Tag, Tooltip} from "antd";
import {PageContainer} from "@ant-design/pro-layout";
import {l} from "@/utils/intl";
import {Alert} from "@/types/RegCenter/data.d";
import {queryList} from "@/services/api";
import {handleRemoveById, updateEnabled} from "@/services/BusinessCrud";
import {ProList} from "@ant-design/pro-components";
import {API_CONSTANTS, PROTABLE_OPTIONS_PUBLIC, SWITCH_OPTIONS} from "@/services/constants";
import {DangerDeleteIcon} from "@/components/Icons/CustomIcons";
import {getAlertIcon} from "@/pages/RegCenter/Alert/AlertInstance/function";
import DescriptionsItem from "antd/es/descriptions/Item";
import AlertTypeChoose from "./components/AlertTypeChoose";
const PRO_LIST_CARD_META = {
title: {},
subTitle: {},
type: {},
avatar: {},
content: {},
actions: {
cardActionProps: "actions"
},
};
const PRO_LIST_CARD_OPTIONS = {
search: false,
metas: PRO_LIST_CARD_META,
grid: {gutter: 24, column: 6}
};
const AlertInstanceTableList: React.FC = () => {
/**
* status
*/
const actionRef = useRef<ActionType>();
const [formValues, setFormValues] = useState<Alert.AlertInstance>();
const [modalVisible, handleModalVisible] = useState<boolean>(false);
const [alertInstanceList, setAlertInstanceList] = useState<Alert.AlertInstance[]>([]);
/**
* execute query alert instance list
* set alert instance list
*/
const queryAlertInstanceList = async () => {
await queryList(API_CONSTANTS.ALERT_INSTANCE).then(res => {
setAlertInstanceList(res.data);
});
};
/**
* handle delete alert instance
* @param id
*/
const handleDeleteSubmit = async (id: number) => {
Modal.confirm({
title: l("rc.ai.delete"),
content: l("rc.ai.deleteConfirm"),
okText: l("button.confirm"),
cancelText: l("button.cancel"),
onOk: async () => {
await handleRemoveById(API_CONSTANTS.ALERT_INSTANCE_DELETE, id);
await queryAlertInstanceList();
}
});
};
/**
* handle enable alert instance
* @param item
*/
const handleEnable = async (item: Alert.AlertInstance) => {
await updateEnabled(API_CONSTANTS.ALERT_INSTANCE_ENABLE, {id: item.id});
await queryAlertInstanceList();
};
/**
* query alert instance list
*/
useEffect(() => {
queryAlertInstanceList();
}, [modalVisible]);
/**
* render alert instance sub title
* @param item
*/
const renderAlertInstanceSubTitle = (item: Alert.AlertInstance) => {
return (
<Descriptions size={"small"} layout={"vertical"} column={1}>
<DescriptionsItem
className={"hidden-overflow"}
key={item.id}>
<Tooltip key={item.name} title={item.name}>{item.name}</Tooltip>
</DescriptionsItem>
</Descriptions>
);
};
/**
* edit click callback
* @param item
*/
const editClick = (item: Alert.AlertInstance) => {
setFormValues(item);
handleModalVisible(!modalVisible);
};
/**
* render alert instance action button
* @param item
*/
const renderAlertInstanceActionButton = (item: Alert.AlertInstance) => {
return [
<Button
className={"options-button"}
key={"AlertInstanceEdit"}
icon={<EditTwoTone/>}
title={l("button.edit")}
onClick={() => editClick(item)}
/>,
<Button
className={"options-button"}
key={"DeleteAlertInstanceIcon"}
icon={<DangerDeleteIcon/>}
onClick={() => handleDeleteSubmit(item.id)}
/>,
];
};
/**
* render alert instance action button
* @param item
*/
const renderAlertInstanceContent = (item: Alert.AlertInstance) => {
return (
<Space className={"hidden-overflow"}>
<Tag color="#5BD8A6">{item.type}</Tag>
<Switch
key={item.id}
{...SWITCH_OPTIONS()}
checked={item.enabled}
onChange={() => handleEnable(item)}
/>
</Space>
);
};
/**
* render data source
*/
const renderDataSource = alertInstanceList.map((item) => ({
subTitle: renderAlertInstanceSubTitle(item),
actions: renderAlertInstanceActionButton(item),
avatar: getAlertIcon(item.type, 60),
content: renderAlertInstanceContent(item),
}));
/**
* render right tool bar
*/
const renderToolBar = () => {
return () => [
<Button key={"CreateAlertInstance"} type="primary" onClick={() => handleModalVisible(true)}>
<PlusOutlined/> {l("button.create")}
</Button>,
];
};
/**
* click cancel button callback
*/
const cancelHandler = () => {
handleModalVisible(false);
setFormValues(undefined);
};
/**
* click submit button callback
*/
const chooseSubmitHandler = () => {
actionRef.current?.reloadAndRest?.();
};
/**
* render main list
*/
return (
<PageContainer title={false}>
{/* alert instance list */}
<ProList<Alert.AlertInstance>
{...PROTABLE_OPTIONS_PUBLIC}
{...PRO_LIST_CARD_OPTIONS as any}
actionRef={actionRef}
headerTitle={l("rc.ai.management")}
toolBarRender={renderToolBar()}
dataSource={renderDataSource}
/>
{/* render choose alert type list */}
<AlertTypeChoose
onCancel={cancelHandler}
modalVisible={modalVisible}
onSubmit={chooseSubmitHandler}
values={formValues}
/>
</PageContainer>
);
};
export default AlertInstanceTableList;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Reducer} from "umi";
import {Alert} from "@/types/RegCenter/data.d";
export type AlertStateType = {
instance:Alert.AlertInstance[],
group:Alert.AlertGroup[]
};
export type AlertModelType = {
namespace: string;
state: AlertStateType;
effects: {
};
reducers: {
saveInstance: Reducer<AlertStateType>;
saveGroup: Reducer<AlertStateType>;
};
};
const AlertModel: AlertModelType = {
namespace: 'Alert',
state: {
instance:[],
group:[],
},
effects: {
},
reducers: {
saveInstance(state, {payload}) {
return {
...state,
instance: payload,
};
},
saveGroup(state, {payload}) {
return {
...state,
group: payload,
};
},
},
};
export default AlertModel;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {l} from "@/utils/intl";
import {handleAddOrUpdate} from "@/services/BusinessCrud";
import {Alert} from "@/types/RegCenter/data.d";
import {postAll} from "@/services/api";
import {ErrorMessage, LoadingMessageAsync, SuccessMessage, WarningMessage} from "@/utils/messages";
import {RESPONSE_CODE} from "@/services/constants";
export async function createOrModifyAlertInstance(alertInstance: Alert.AlertInstance) {
return handleAddOrUpdate("/api/alertInstance", alertInstance);
}
export async function sendTest(alertInstance: Alert.AlertInstance) {
await LoadingMessageAsync(l("app.request.test.alert.msg"));
try {
const {code, msg} = await postAll("/api/alertInstance/sendTest", alertInstance);
if (code === RESPONSE_CODE.SUCCESS) {
SuccessMessage(msg);
return true;
} else {
WarningMessage(msg);
return false;
}
} catch (error) {
ErrorMessage(l("app.request.failed"));
return false;
}
}
...@@ -35,7 +35,13 @@ import { ...@@ -35,7 +35,13 @@ import {
DOCUMENT_FUNCTION_ENUMS, DOCUMENT_FUNCTION_ENUMS,
DOCUMENT_FUNCTION_TYPE, DOCUMENT_SUBTYPE, DOCUMENT_SUBTYPE_ENUMS DOCUMENT_FUNCTION_TYPE, DOCUMENT_SUBTYPE, DOCUMENT_SUBTYPE_ENUMS
} from "@/pages/RegCenter/Document/constans"; } from "@/pages/RegCenter/Document/constans";
import {API_CONSTANTS, PROTABLE_OPTIONS_PUBLIC, STATUS_ENUM, STATUS_MAPPING} from "@/services/constants"; import {
API_CONSTANTS,
PROTABLE_OPTIONS_PUBLIC,
STATUS_ENUM,
STATUS_MAPPING,
SWITCH_OPTIONS
} from "@/services/constants";
import CodeShow from "@/components/CustomMonacoEditor/CodeShow"; import CodeShow from "@/components/CustomMonacoEditor/CodeShow";
import {DangerDeleteIcon} from "@/components/Icons/CustomIcons"; import {DangerDeleteIcon} from "@/components/Icons/CustomIcons";
import {handleAddOrUpdate, handleRemoveById, updateEnabled} from "@/services/BusinessCrud"; import {handleAddOrUpdate, handleRemoveById, updateEnabled} from "@/services/BusinessCrud";
...@@ -177,8 +183,7 @@ const DocumentTableList: React.FC = (props: any) => { ...@@ -177,8 +183,7 @@ const DocumentTableList: React.FC = (props: any) => {
<Space> <Space>
<Switch <Switch
key={record.id} key={record.id}
checkedChildren={l("status.enabled")} {...SWITCH_OPTIONS()}
unCheckedChildren={l("status.disabled")}
checked={record.enabled} checked={record.enabled}
onChange={() => handleChangeEnable(record)}/> onChange={() => handleChangeEnable(record)}/>
</Space> </Space>
...@@ -216,6 +221,7 @@ const DocumentTableList: React.FC = (props: any) => { ...@@ -216,6 +221,7 @@ const DocumentTableList: React.FC = (props: any) => {
}} }}
/>, />,
<Popconfirm <Popconfirm
key={'DocumentDelete'}
placement="topRight" placement="topRight"
title={l("button.delete")} title={l("button.delete")}
description={l("rc.doc.deleteConfirm")} description={l("rc.doc.deleteConfirm")}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
import {EditTwoTone, PlusOutlined} from '@ant-design/icons'; import {EditTwoTone, PlusOutlined} from '@ant-design/icons';
import {Button, Drawer, Form, Popconfirm, Space, Switch} from 'antd'; import {Button, Drawer, Popconfirm, Space, Switch} from 'antd';
import React, {useRef, useState} from 'react'; import React, {useRef, useState} from 'react';
import {PageContainer} from '@ant-design/pro-layout'; import {PageContainer} from '@ant-design/pro-layout';
import type {ActionType, ProColumns} from '@ant-design/pro-table'; import type {ActionType, ProColumns} from '@ant-design/pro-table';
...@@ -26,7 +26,13 @@ import ProTable from '@ant-design/pro-table'; ...@@ -26,7 +26,13 @@ import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions'; import ProDescriptions from '@ant-design/pro-descriptions';
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {GlobalVar} from "@/types/RegCenter/data"; import {GlobalVar} from "@/types/RegCenter/data";
import {API_CONSTANTS, PROTABLE_OPTIONS_PUBLIC, STATUS_ENUM, STATUS_MAPPING} from "@/services/constants"; import {
API_CONSTANTS,
PROTABLE_OPTIONS_PUBLIC,
STATUS_ENUM,
STATUS_MAPPING,
SWITCH_OPTIONS
} from "@/services/constants";
import {DangerDeleteIcon} from "@/components/Icons/CustomIcons"; import {DangerDeleteIcon} from "@/components/Icons/CustomIcons";
import {handleAddOrUpdate, handleRemoveById, updateEnabled} from "@/services/BusinessCrud"; import {handleAddOrUpdate, handleRemoveById, updateEnabled} from "@/services/BusinessCrud";
import GlobalVarForm from "@/pages/RegCenter/GlobalVar/components/GlobalVarForm"; import GlobalVarForm from "@/pages/RegCenter/GlobalVar/components/GlobalVarForm";
...@@ -131,8 +137,7 @@ const GlobalVarList: React.FC = (props: any) => { ...@@ -131,8 +137,7 @@ const GlobalVarList: React.FC = (props: any) => {
<Space> <Space>
<Switch <Switch
key={record.id} key={record.id}
checkedChildren={l("status.enabled")} {...SWITCH_OPTIONS()}
unCheckedChildren={l("status.disabled")}
checked={record.enabled} checked={record.enabled}
onChange={() => handleChangeEnable(record)}/> onChange={() => handleChangeEnable(record)}/>
</Space> </Space>
...@@ -174,6 +179,7 @@ const GlobalVarList: React.FC = (props: any) => { ...@@ -174,6 +179,7 @@ const GlobalVarList: React.FC = (props: any) => {
}} }}
/>, />,
<Popconfirm <Popconfirm
key={'GlobalVarDelete'}
placement="topRight" placement="topRight"
title={l("button.delete")} title={l("button.delete")}
description={l("rc.gv.deleteConfirm")} description={l("rc.gv.deleteConfirm")}
......
...@@ -79,6 +79,15 @@ export const API_CONSTANTS = { ...@@ -79,6 +79,15 @@ export const API_CONSTANTS = {
// document enable or disable // document enable or disable
DOCUMENT_ENABLE: "/api/document/enable", DOCUMENT_ENABLE: "/api/document/enable",
// ---- alert instance ----
// alert instance list
ALERT_INSTANCE: "/api/alertInstance",
// delete alert instance by id
ALERT_INSTANCE_DELETE: "/api/alertInstance/delete",
// alert instance enable or disable
ALERT_INSTANCE_ENABLE: "/api/alertInstance/enable",
}; };
...@@ -147,6 +156,19 @@ export const FORM_LAYOUT_PUBLIC = { ...@@ -147,6 +156,19 @@ export const FORM_LAYOUT_PUBLIC = {
wrapperCol: {span: 15}, wrapperCol: {span: 15},
}; };
/**
* the modal form layout of public
*/
export const MODAL_FORM_STYLE: any = {
width: "40%",
style: {
maxHeight: "70vh",
overflowY: "auto",
},
};
/** /**
* the protable layout of public * the protable layout of public
*/ */
...@@ -185,7 +207,15 @@ export const NORMAL_TABLE_OPTIONS = { ...@@ -185,7 +207,15 @@ export const NORMAL_TABLE_OPTIONS = {
export const SCROLLBAR_OPTIONS = { export const SCROLLBAR_OPTIONS = {
style: { style: {
height: '520px', height: "520px",
width: '100%', width: "100%",
} }
}; };
export const SWITCH_OPTIONS =() => {
return {
checkedChildren: l("status.enabled"),
unCheckedChildren: l("status.disabled"),
};
}
...@@ -46,6 +46,30 @@ declare namespace Alert { ...@@ -46,6 +46,30 @@ declare namespace Alert {
}; };
} }
export type AlertConfig = {
type: string,
}
export const ALERT_TYPE = {
DINGTALK: "DingTalk",
WECHAT: "WeChat",
FEISHU: "FeiShu",
EMAIL: "Email",
};
export const ALERT_CONFIG_LIST: AlertConfig[] = [{
type: ALERT_TYPE.DINGTALK,
}, {
type: ALERT_TYPE.WECHAT,
}, {
type: ALERT_TYPE.FEISHU,
}, {
type: ALERT_TYPE.EMAIL,
}
];
/** /**
* about flink cluster * about flink cluster
*/ */
......
...@@ -82,7 +82,8 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => { ...@@ -82,7 +82,8 @@ const AlertInstanceChooseForm: React.FC<UpdateFormProps> = (props) => {
maskClosable={false} maskClosable={false}
destroyOnClose={true} destroyOnClose={true}
footer={null} footer={null}
>{ >
{
(!alertType && !values?.id) && (<List (!alertType && !values?.id) && (<List
grid={{ grid={{
gutter: 16, gutter: 16,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment