feat: 0.0.4.2

1、通知场景可配置多个通知方式
2、修复分区只能从1开始问题
3、重试任务新增暂停、完成、恢复功能
This commit is contained in:
byteblogs168 2022-09-30 10:15:37 +08:00
parent 5ffead5c53
commit 88761f5d56
80 changed files with 351 additions and 198 deletions

View File

@ -26,7 +26,7 @@ CREATE TABLE `notify_config`
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_group_name_notify_scene` (`group_name`,`notify_scene`)
KEY `idx_group_name` (`group_name`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='通知配置'
;
@ -79,7 +79,6 @@ CREATE TABLE `retry_task_log`
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
`args_str` text NOT NULL COMMENT '执行方法参数',
`ext_attrs` text NOT NULL COMMENT '扩展字段',
`next_trigger_at` datetime NOT NULL COMMENT '下次触发时间',
`retry_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '重试状态 0、失败 1、成功',
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
@ -88,7 +87,7 @@ CREATE TABLE `retry_task_log`
KEY `idx_group_name` (`group_name`),
KEY `idx_scene_name` (`scene_name`),
KEY `idx_retry_status` (`retry_status`),
KEY `idx_biz_id` (`biz_id`),
KEY `idx_biz_id` (`biz_id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='重试日志表'
;

View File

@ -35,7 +35,7 @@ public class NestMethodServiceTest {
try {
nestMethodService.testNestMethod();
} catch (Exception e) {
System.out.println(e);
}
Thread.sleep(90000);

View File

@ -13,6 +13,7 @@ const api = {
allGroupNameList: `/group/all/group-name/list`,
retryTaskPage: '/retry-task/list',
retryTaskById: '/retry-task/',
updateRetryTaskStatus: '/retry-task/status',
retryTaskLogPage: '/retry-task-log/list',
retryTaskLogById: '/retry-task-log/',
retryDeadLetterPage: '/retry-dead-letter/list',
@ -104,6 +105,14 @@ export function getRetryTaskById (id, parameter) {
})
}
export function updateRetryTaskStatus (data) {
return request({
url: api.updateRetryTaskStatus,
method: 'put',
data
})
}
export function getScenePage (parameter) {
return request({
url: api.scenePageList,

View File

@ -50,5 +50,5 @@ export default {
</script>
<style lang="less" scoped>
@import "index";
//@import "index";
</style>

View File

@ -97,10 +97,10 @@ export default {
$notification['success']({
message: res.message
})
this.$refs.notify.reset()
}
})
}).catch(() => {
console.log('333')
const errors = Object.assign({}, groupConfig.form.getFieldsError())
const tmp = { ...errors }
this.errorList(tmp)

View File

@ -63,7 +63,7 @@
v-decorator="[
'groupPartition'
]"
:min="1"
:min="0"
:max="10"
/>
</a-form-item>

View File

@ -260,11 +260,25 @@ export default {
created () {
const groupName = this.$route.query.groupName
if (groupName) {
this.getNotifyConfigList(groupName)
}
},
methods: {
reset () {
this.formData = []
this.data = []
const groupName = this.$route.query.groupName
if (groupName) {
this.getNotifyConfigList(groupName)
}
},
getNotifyConfigList (groupName) {
getNotifyConfigList({ groupName: groupName }).then(res => {
res.data.map(record => {
const { id, notifyType, notifyThreshold, notifyScene, description, notifyAttribute } = record
this.data.push({
key: id,
id: id,
notifyType: notifyType.toString(),
notifyThreshold: notifyThreshold,
notifyScene: notifyScene.toString(),
@ -275,18 +289,17 @@ export default {
})
})
})
}
},
methods: {
remove (delKey) {
const delData = this.data.find(item => delKey === item.key)
const { key, notifyType, notifyThreshold, notifyAttribute, notifyScene, description } = delData
const { id, key, notifyType, notifyThreshold, notifyAttribute, notifyScene, description } = delData
this.formData.push({
key: key,
id: id,
notifyType: notifyType,
notifyThreshold: notifyThreshold,
notifyScene: notifyScene,
notifyAttribute: notifyAttribute,
notifyAttribute: JSON.stringify(notifyAttribute),
description: description,
isDeleted: 1
})
@ -296,7 +309,7 @@ export default {
},
saveRow (record) {
this.memberLoading = true
const { key, notifyType, notifyThreshold, notifyAttribute, notifyScene, description } = record
const { id, key, notifyType, notifyThreshold, notifyAttribute, notifyScene, description } = record
if (!notifyType || !notifyScene || !notifyAttribute || !description || (this.notifyThresholdDisabled.includes(notifyScene) ? false : !notifyThreshold)) {
this.memberLoading = false
@ -306,8 +319,11 @@ export default {
const target = this.formData.find(item => key === item.key)
if (!target) {
console.log(target)
console.log(this.formData)
this.formData.push({
key: key,
id,
notifyType: notifyType,
notifyThreshold: notifyThreshold,
notifyScene: notifyScene,

View File

@ -226,6 +226,19 @@ export default {
}
},
methods: {
reset () {
this.formData = []
this.data = []
const groupName = this.$route.query.groupName
if (groupName) {
this.fetch({
groupName: groupName,
size: 6,
page: 1
}
)
}
},
handleTableChange (pagination, filters, sorter) {
console.log(pagination)
const pager = { ...this.pagination }

View File

@ -79,6 +79,12 @@
<template>
<a @click="handleInfo(record)">详情</a>
<a-divider type="vertical" />
<a @click="handleSuspend(record)" v-if="record.retryStatus === 0">暂停</a>
<a-divider type="vertical" v-if="record.retryStatus === 0"/>
<a @click="handleRecovery(record)" v-if="record.retryStatus === 3">恢复</a>
<a-divider type="vertical" v-if="record.retryStatus === 3"/>
<a @click="handleFinish(record)" v-if="record.retryStatus !== 1">完成</a>
<a-divider type="vertical" v-if="record.retryStatus !== 1"/>
</template>
<!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">-->
@ -104,7 +110,7 @@ import ATextarea from 'ant-design-vue/es/input/TextArea'
import AInput from 'ant-design-vue/es/input/Input'
//
import Edit from '@/views/list/table/Edit'
import { getAllGroupNameList, getRetryTaskPage, getSceneList } from '@/api/manage'
import { getAllGroupNameList, getRetryTaskPage, getSceneList, updateRetryTaskStatus } from '@/api/manage'
import { STable } from '@/components'
import moment from 'moment'
@ -128,7 +134,8 @@ export default {
retryStatus: {
'0': '重试中',
'1': '重试完成',
'2': '最大次数'
'2': '最大次数',
'3': '暂停'
},
//
columns: [
@ -229,6 +236,39 @@ export default {
},
handleEdit (record) {
},
handleSuspend (record) {
updateRetryTaskStatus({ id: record.id, groupName: record.groupName, retryStatus: 3 }).then(res => {
const { status } = res
if (status === 0) {
this.$message.error('暂停失败')
} else {
this.$refs.table.refresh(true)
this.$message.success('暂停成功')
}
})
},
handleRecovery (record) {
updateRetryTaskStatus({ id: record.id, groupName: record.groupName, retryStatus: 0 }).then(res => {
const { status } = res
if (status === 0) {
this.$message.error('恢复失败')
} else {
this.$refs.table.refresh(true)
this.$message.success('恢复成功')
}
})
},
handleFinish (record) {
updateRetryTaskStatus({ id: record.id, groupName: record.groupName, retryStatus: 1 }).then(res => {
const { status } = res
if (status === 0) {
this.$message.error('重试完成失败')
} else {
this.$refs.table.refresh(true)
this.$message.success('重试完成成功')
}
})
}
}

View File

@ -1,6 +1,9 @@
package com.x.retry.common.core.enums;
import lombok.Getter;
import org.springframework.lang.NonNull;
import java.util.Objects;
/**
* 重试状态终态枚举
@ -24,12 +27,28 @@ public enum RetryStatusEnum {
/**
* 到达最大重试次数
*/
MAX_RETRY_COUNT(2);
MAX_RETRY_COUNT(2),
private final Integer level;
/**
* 暂停重试
*/
SUSPEND(3);
RetryStatusEnum(int level) {
this.level = level;
private final Integer status;
RetryStatusEnum(int status) {
this.status = status;
}
public static RetryStatusEnum getByStatus(@NonNull Integer status) {
for (RetryStatusEnum value : RetryStatusEnum.values()) {
if (Objects.equals(value.status, status)) {
return value;
}
}
return null;
}
}

View File

@ -47,7 +47,7 @@ public interface ConfigAccess {
* @param notifyScene {@link NotifySceneEnum} 场景类型
* @return {@link NotifyConfig} 场景配置
*/
NotifyConfig getNotifyConfigByGroupName(String groupName, Integer notifyScene);
List<NotifyConfig> getNotifyConfigByGroupName(String groupName, Integer notifyScene);
/**
* 获取通知配置

View File

@ -28,8 +28,8 @@ public abstract class AbstractConfigAccess implements ConfigAccess {
@Autowired
protected GroupConfigMapper groupConfigMapper;
protected NotifyConfig getByGroupIdAndNotifyScene(String groupName, Integer notifyScene) {
return notifyConfigMapper.selectOne(new LambdaQueryWrapper<NotifyConfig>().eq(NotifyConfig::getGroupName, groupName)
protected List<NotifyConfig> getByGroupIdAndNotifyScene(String groupName, Integer notifyScene) {
return notifyConfigMapper.selectList(new LambdaQueryWrapper<NotifyConfig>().eq(NotifyConfig::getGroupName, groupName)
.eq(NotifyConfig::getNotifyScene, notifyScene));
}

View File

@ -39,7 +39,7 @@ public class MybatisConfigAccess extends AbstractConfigAccess {
}
@Override
public NotifyConfig getNotifyConfigByGroupName(String shardingGroupId, Integer notifyScene) {
public List<NotifyConfig> getNotifyConfigByGroupName(String shardingGroupId, Integer notifyScene) {
return getByGroupIdAndNotifyScene(shardingGroupId, notifyScene);
}

View File

@ -34,7 +34,7 @@ public class MybatisRetryTaskAccess extends AbstractRetryTaskAccess {
setPartition(groupName);
return retryTaskMapper.selectPage(new PageDTO<>(0, pageSize),
new LambdaQueryWrapper<RetryTask>()
.eq(RetryTask::getRetryStatus, RetryStatusEnum.RUNNING.getLevel())
.eq(RetryTask::getRetryStatus, RetryStatusEnum.RUNNING.getStatus())
.eq(RetryTask::getGroupName, groupName).ge(RetryTask::getCreateDt, lastAt)
.orderByAsc(RetryTask::getCreateDt)).getRecords();
}

View File

@ -46,7 +46,7 @@ public class ConfigAccessProcessor implements ConfigAccess {
}
@Override
public NotifyConfig getNotifyConfigByGroupName(String groupName, Integer notifyScene) {
public List<NotifyConfig> getNotifyConfigByGroupName(String groupName, Integer notifyScene) {
return configAccess.getNotifyConfigByGroupName(groupName, notifyScene);
}

View File

@ -2,6 +2,7 @@ package com.x.retry.server.service;
import com.x.retry.server.web.model.base.PageResult;
import com.x.retry.server.web.model.request.RetryTaskQueryVO;
import com.x.retry.server.web.model.request.RetryTaskRequestVO;
import com.x.retry.server.web.model.response.RetryTaskResponseVO;
import java.util.List;
@ -16,4 +17,6 @@ public interface RetryTaskService {
PageResult<List<RetryTaskResponseVO>> getRetryTaskPage(RetryTaskQueryVO queryVO);
RetryTaskResponseVO getRetryTaskById(String groupName, Long id);
int updateRetryTaskStatus(RetryTaskRequestVO retryTaskRequestVO);
}

View File

@ -46,8 +46,8 @@ public class DashBoardServiceImpl implements DashBoardService {
TaskQuantityResponseVO taskQuantityResponseVO = new TaskQuantityResponseVO();
taskQuantityResponseVO.setTotal(retryTaskLogMapper.countTaskTotal());
taskQuantityResponseVO.setFinish(retryTaskLogMapper.countTaskByRetryStatus(RetryStatusEnum.FINISH.getLevel()));
taskQuantityResponseVO.setMaxRetryCount(retryTaskLogMapper.countTaskByRetryStatus(RetryStatusEnum.MAX_RETRY_COUNT.getLevel()));
taskQuantityResponseVO.setFinish(retryTaskLogMapper.countTaskByRetryStatus(RetryStatusEnum.FINISH.getStatus()));
taskQuantityResponseVO.setMaxRetryCount(retryTaskLogMapper.countTaskByRetryStatus(RetryStatusEnum.MAX_RETRY_COUNT.getStatus()));
taskQuantityResponseVO.setRunning(taskQuantityResponseVO.getTotal() - taskQuantityResponseVO.getFinish() - taskQuantityResponseVO.getMaxRetryCount());
return taskQuantityResponseVO;
@ -65,8 +65,8 @@ public class DashBoardServiceImpl implements DashBoardService {
}
Long success = retryTaskLogMapper.selectCount(new LambdaQueryWrapper<RetryTaskLog>()
.in(RetryTaskLog::getRetryStatus, RetryStatusEnum.MAX_RETRY_COUNT.getLevel(),
RetryStatusEnum.FINISH.getLevel()));
.in(RetryTaskLog::getRetryStatus, RetryStatusEnum.MAX_RETRY_COUNT.getStatus(),
RetryStatusEnum.FINISH.getStatus()));
dispatchQuantityResponseVO.setSuccessPercent(BigDecimal.valueOf(success).divide(BigDecimal.valueOf(total), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)));
return dispatchQuantityResponseVO;
@ -122,7 +122,7 @@ public class DashBoardServiceImpl implements DashBoardService {
List<DispatchQuantityResponseVO> totalDispatchQuantityResponseList = retryTaskLogMapper.lineDispatchQuantity(groupName, null, type, startDateTime, endDateTime);
List<DispatchQuantityResponseVO> successDispatchQuantityResponseList = retryTaskLogMapper.lineDispatchQuantity(groupName, RetryStatusEnum.FINISH.getLevel(), type, startDateTime, endDateTime);
List<DispatchQuantityResponseVO> successDispatchQuantityResponseList = retryTaskLogMapper.lineDispatchQuantity(groupName, RetryStatusEnum.FINISH.getStatus(), type, startDateTime, endDateTime);
Map<String, DispatchQuantityResponseVO> successDispatchQuantityResponseVOMap = successDispatchQuantityResponseList.stream().collect(Collectors.toMap(DispatchQuantityResponseVO::getCreateDt, i -> i));
for (DispatchQuantityResponseVO dispatchQuantityResponseVO : totalDispatchQuantityResponseList) {

View File

@ -227,49 +227,37 @@ public class GroupConfigServiceImpl implements GroupConfigService {
iterator.remove();
}
}
}
private void doUpdateNotifyConfig(GroupConfigRequestVO groupConfigRequestVO) {
List<GroupConfigRequestVO.NotifyConfigVO> notifyList = groupConfigRequestVO.getNotifyList();
if (!CollectionUtils.isEmpty(notifyList)) {
if (CollectionUtils.isEmpty(notifyList)) {
return;
}
List<NotifyConfig> notifyConfigs = notifyConfigMapper.selectList(new LambdaQueryWrapper<NotifyConfig>()
.eq(NotifyConfig::getGroupName, groupConfigRequestVO.getGroupName()));
Map<Integer, NotifyConfig> notifyConfigMap = notifyConfigs.stream().collect(Collectors.toMap(NotifyConfig::getNotifyScene, i -> i));
for (GroupConfigRequestVO.NotifyConfigVO notifyConfigVO : notifyList) {
Iterator<GroupConfigRequestVO.NotifyConfigVO> iterator = notifyList.iterator();
while (iterator.hasNext()) {
GroupConfigRequestVO.NotifyConfigVO notifyConfigVO = iterator.next();
NotifyConfig oldNotifyConfig = notifyConfigMap.get(notifyConfigVO.getNotifyScene());
NotifyConfig notifyConfig = notifyConfigConverter.convert(notifyConfigVO);
notifyConfig.setGroupName(groupConfigRequestVO.getGroupName());
notifyConfig.setCreateDt(LocalDateTime.now());
if (Objects.isNull(oldNotifyConfig)) {
if (Objects.isNull(notifyConfigVO.getId())) {
// insert
doSaveNotifyConfig(groupConfigRequestVO.getGroupName(), notifyConfigVO);
} else if (notifyConfigVO.getIsDeleted() == 1) {
Assert.isTrue(1 == notifyConfigMapper.deleteById(oldNotifyConfig.getId()),
new XRetryServerException("删除通知配置失败 sceneConfig:[{}]", JsonUtil.toJsonString(oldNotifyConfig)));
} else if (Objects.nonNull(notifyConfigVO.getId()) && notifyConfigVO.getIsDeleted() == 1) {
// delete
Assert.isTrue(1 == notifyConfigMapper.deleteById(notifyConfigVO.getId()),
new XRetryServerException("删除通知配置失败 sceneConfig:[{}]", JsonUtil.toJsonString(notifyConfigVO)));
} else {
// update
Assert.isTrue(1 == notifyConfigMapper.update(notifyConfig,
new LambdaQueryWrapper<NotifyConfig>()
.eq(NotifyConfig::getId, notifyConfigVO.getId())
.eq(NotifyConfig::getGroupName, notifyConfig.getGroupName())
.eq(NotifyConfig::getNotifyScene, notifyConfig.getNotifyScene())),
new XRetryServerException("插入通知配置失败 sceneConfig:[{}]", JsonUtil.toJsonString(notifyConfig)));
notifyConfigMap.remove(notifyConfigVO.getNotifyScene());
new XRetryServerException("更新通知配置失败 sceneConfig:[{}]", JsonUtil.toJsonString(notifyConfig)));
}
iterator.remove();
}
}
}

View File

@ -93,7 +93,7 @@ public class RetryServiceImpl implements RetryService {
// 清除重试完成的数据
clearFinishRetryData(groupId);
List<RetryTask> retryTasks = retryTaskAccess.listRetryTaskByRetryCount(groupId, RetryStatusEnum.MAX_RETRY_COUNT.getLevel());
List<RetryTask> retryTasks = retryTaskAccess.listRetryTaskByRetryCount(groupId, RetryStatusEnum.MAX_RETRY_COUNT.getStatus());
if (CollectionUtils.isEmpty(retryTasks)) {
return Boolean.TRUE;
}
@ -138,6 +138,6 @@ public class RetryServiceImpl implements RetryService {
*/
private void clearFinishRetryData(String groupId) {
// 将已经重试完成的数据删除
retryTaskAccess.deleteByDelayLevel(groupId, RetryStatusEnum.FINISH.getLevel());
retryTaskAccess.deleteByDelayLevel(groupId, RetryStatusEnum.FINISH.getStatus());
}
}

View File

@ -2,14 +2,19 @@ package com.x.retry.server.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.x.retry.common.core.enums.RetryResultStatusEnum;
import com.x.retry.common.core.enums.RetryStatusEnum;
import com.x.retry.server.config.RequestDataHelper;
import com.x.retry.server.exception.XRetryServerException;
import com.x.retry.server.persistence.mybatis.po.RetryTaskLog;
import com.x.retry.server.support.strategy.WaitStrategies;
import com.x.retry.server.web.model.base.PageResult;
import com.x.retry.server.persistence.mybatis.mapper.RetryTaskMapper;
import com.x.retry.server.persistence.mybatis.po.RetryTask;
import com.x.retry.server.service.RetryTaskService;
import com.x.retry.server.service.convert.RetryTaskResponseVOConverter;
import com.x.retry.server.web.model.request.RetryTaskQueryVO;
import com.x.retry.server.web.model.request.RetryTaskRequestVO;
import com.x.retry.server.web.model.response.RetryTaskResponseVO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @author www.byteblogs.com
@ -73,4 +79,30 @@ public class RetryTaskServiceImpl implements RetryTaskService {
RetryTask retryTask = retryTaskMapper.selectById(id);
return retryTaskResponseVOConverter.convert(retryTask);
}
@Override
public int updateRetryTaskStatus(RetryTaskRequestVO retryTaskRequestVO) {
RetryStatusEnum retryStatusEnum = RetryStatusEnum.getByStatus(retryTaskRequestVO.getRetryStatus());
if (Objects.isNull(retryStatusEnum)) {
throw new XRetryServerException("重试状态错误");
}
RequestDataHelper.setPartition(retryTaskRequestVO.getGroupName());
RetryTask retryTask = retryTaskMapper.selectById(retryTaskRequestVO.getId());
if (Objects.isNull(retryTask)) {
throw new XRetryServerException("未查询到重试任务");
}
retryTask.setRetryStatus(retryTaskRequestVO.getRetryStatus());
retryTask.setGroupName(retryTaskRequestVO.getGroupName());
// 若恢复重试则需要重新计算下次触发时间
if (RetryStatusEnum.RUNNING.getStatus().equals(retryStatusEnum.getStatus())) {
retryTask.setNextTriggerAt(WaitStrategies.randomWait(1, TimeUnit.SECONDS, 60, TimeUnit.SECONDS).computeRetryTime(null));
}
RequestDataHelper.setPartition(retryTaskRequestVO.getGroupName());
return retryTaskMapper.updateById(retryTask);
}
}

View File

@ -81,7 +81,7 @@ public class DispatchService implements Lifecycle {
try {
List<GroupConfig> currentHostGroupList = getCurrentHostGroupList();
LogUtils.info("当前节点[{}] 分配的组:[{}]", HostUtils.getIp(), JsonUtil.toJsonString(currentHostGroupList));
// LogUtils.info("当前节点[{}] 分配的组:[{}]", HostUtils.getIp(), JsonUtil.toJsonString(currentHostGroupList));
if (!CollectionUtils.isEmpty(currentHostGroupList)) {
for (GroupConfig groupConfigContext : currentHostGroupList) {
produceScanActorTask(groupConfigContext);

View File

@ -13,8 +13,6 @@ import com.x.retry.server.persistence.mybatis.po.RetryTaskLog;
import com.x.retry.server.persistence.mybatis.po.SceneConfig;
import com.x.retry.server.persistence.support.ConfigAccess;
import com.x.retry.server.persistence.support.RetryTaskAccess;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@ -22,7 +20,6 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -61,7 +58,7 @@ public class FailureActor extends AbstractActor {
configAccess.getSceneConfigByGroupNameAndSceneName(retryTask.getGroupName(), retryTask.getSceneName());
if (sceneConfig.getMaxRetryCount() <= retryTask.getRetryCount()) {
retryTask.setRetryStatus(RetryStatusEnum.MAX_RETRY_COUNT.getLevel());
retryTask.setRetryStatus(RetryStatusEnum.MAX_RETRY_COUNT.getStatus());
}
try {

View File

@ -11,8 +11,6 @@ import com.x.retry.server.persistence.mybatis.mapper.RetryTaskLogMapper;
import com.x.retry.server.persistence.mybatis.po.RetryTask;
import com.x.retry.server.persistence.mybatis.po.RetryTaskLog;
import com.x.retry.server.persistence.support.RetryTaskAccess;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@ -20,7 +18,6 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -50,7 +47,7 @@ public class FinishActor extends AbstractActor {
return receiveBuilder().match(RetryTask.class, retryTask->{
LogUtils.info("FinishActor params:[{}]", retryTask);
retryTask.setRetryStatus(RetryStatusEnum.FINISH.getLevel());
retryTask.setRetryStatus(RetryStatusEnum.FINISH.getStatus());
try {
retryTaskAccess.updateRetryTask(retryTask);

View File

@ -18,10 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects;
import java.util.List;
/**
* @author: www.byteblogs.com
@ -36,15 +37,13 @@ public class AlarmNotifyThreadSchedule {
"<font face=\"微软雅黑\" color=#ff0000 size=4>{}环境 重试失败数据监控</font> </br>" +
"> 名称:{} </br>" +
"> 时间窗口:{} ~ {} </br>" +
"> **共计:{}** \n"
;
"> **共计:{}** \n";
private static String retryTaskMoreThresholdTextMessageFormatter =
"<font face=\"微软雅黑\" color=#ff0000 size=4>{}环境 重试数据监控</font> </br>" +
"> 名称:{} </br>" +
"> 时间:{} </br>" +
"> **共计:{}** </br>"
;
"> **共计:{}** </br>";
@Autowired
private RetryDeadLetterMapper retryDeadLetterMapper;
@ -65,12 +64,13 @@ public class AlarmNotifyThreadSchedule {
LogUtils.info("retryTaskMoreThreshold time[{}] ip:[{}]", LocalDateTime.now(), HostUtils.getIp());
for (GroupConfig groupConfig : configAccess.getAllConfigGroupList()) {
NotifyConfig notifyConfig = configAccess.getNotifyConfigByGroupName(groupConfig.getGroupName(), NotifySceneEnum.MAX_RETRY.getNotifyScene());
if (Objects.isNull(notifyConfig)) {
List<NotifyConfig> notifyConfigs = configAccess.getNotifyConfigByGroupName(groupConfig.getGroupName(), NotifySceneEnum.MAX_RETRY.getNotifyScene());
if (CollectionUtils.isEmpty(notifyConfigs)) {
continue;
}
int count = retryTaskMapper.countAllRetryTaskByRetryStatus(groupConfig.getGroupPartition(), RetryStatusEnum.RUNNING.getLevel());
int count = retryTaskMapper.countAllRetryTaskByRetryStatus(groupConfig.getGroupPartition(), RetryStatusEnum.RUNNING.getStatus());
for (NotifyConfig notifyConfig : notifyConfigs) {
if (count > notifyConfig.getNotifyThreshold()) {
// 预警
AlarmContext context = AlarmContext.build()
@ -84,11 +84,9 @@ public class AlarmNotifyThreadSchedule {
Alarm<AlarmContext> alarmType = altinAlarmFactory.getAlarmType(notifyConfig.getNotifyType());
alarmType.asyncSendMessage(context);
}
}
}
}
/**
@ -100,14 +98,16 @@ public class AlarmNotifyThreadSchedule {
LogUtils.info("retryErrorMoreThreshold time[{}] ip:[{}]", LocalDateTime.now(), HostUtils.getIp());
for (GroupConfig groupConfig : configAccess.getAllConfigGroupList()) {
NotifyConfig notifyConfig = configAccess.getNotifyConfigByGroupName(groupConfig.getGroupName(), NotifySceneEnum.MAX_RETRY_ERROR.getNotifyScene());
if (Objects.isNull(notifyConfig)) {
List<NotifyConfig> notifyConfigs = configAccess.getNotifyConfigByGroupName(groupConfig.getGroupName(), NotifySceneEnum.MAX_RETRY_ERROR.getNotifyScene());
if (CollectionUtils.isEmpty(notifyConfigs)) {
continue;
}
// x分钟内进入死信队列的数据量
LocalDateTime now = LocalDateTime.now();
int count = retryDeadLetterMapper.countRetryDeadLetterByCreateAt(now.minusMinutes(30), now, groupConfig.getGroupPartition());
for (NotifyConfig notifyConfig : notifyConfigs) {
if (count > notifyConfig.getNotifyThreshold()) {
// 预警
AlarmContext context = AlarmContext.build()
@ -125,6 +125,5 @@ public class AlarmNotifyThreadSchedule {
}
}
}
}
}

View File

@ -1,15 +1,19 @@
package com.x.retry.server.web.controller;
import com.x.retry.server.model.dto.RetryTaskDTO;
import com.x.retry.server.service.RetryService;
import com.x.retry.server.service.RetryTaskService;
import com.x.retry.server.web.annotation.LoginRequired;
import com.x.retry.server.web.model.base.PageResult;
import com.x.retry.server.web.model.request.RetryTaskQueryVO;
import com.x.retry.server.web.model.request.RetryTaskRequestVO;
import com.x.retry.server.web.model.response.RetryTaskResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -37,4 +41,10 @@ public class RetryTaskController {
@PathVariable("id") Long id) {
return retryTaskService.getRetryTaskById(groupName, id);
}
@LoginRequired
@PutMapping("status")
public int updateRetryTaskStatus(@RequestBody RetryTaskRequestVO retryTaskRequestVO) {
return retryTaskService.updateRetryTaskStatus(retryTaskRequestVO);
}
}

View File

@ -52,6 +52,8 @@ public class GroupConfigRequestVO {
@Data
public static class NotifyConfigVO {
private Long id;
@NotNull(message = "通知类型不能为空")
private Integer notifyType;

View File

@ -0,0 +1,29 @@
package com.x.retry.server.web.model.request;
import com.x.retry.common.core.enums.RetryStatusEnum;
import lombok.Data;
/**
* @author www.byteblogs.com
* @date 2022-09-29
* @since 2.0
*/
@Data
public class RetryTaskRequestVO {
/**
* 重试状态 {@link RetryStatusEnum}
*/
private Integer retryStatus;
/**
* 组名称
*/
private String groupName;
/**
* 重试表id
*/
private Long id;
}

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.card[data-v-3b0f23ba]{margin-bottom:24px}.popover-wrapper[data-v-3b0f23ba] .antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content{min-width:256px;max-height:290px;padding:0;overflow:auto}.antd-pro-pages-forms-style-errorIcon[data-v-3b0f23ba]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:24px;color:#f5222d;cursor:pointer}.antd-pro-pages-forms-style-errorIcon i[data-v-3b0f23ba]{margin-right:4px}.antd-pro-pages-forms-style-errorListItem[data-v-3b0f23ba]{padding:8px 16px;list-style:none;border-bottom:1px solid #e8e8e8;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.antd-pro-pages-forms-style-errorListItem[data-v-3b0f23ba]:hover{background:#e6f7ff}.antd-pro-pages-forms-style-errorListItem .antd-pro-pages-forms-style-errorIcon[data-v-3b0f23ba]{float:left;margin-top:4px;margin-right:12px;padding-bottom:22px;color:#f5222d}.antd-pro-pages-forms-style-errorListItem .antd-pro-pages-forms-style-errorField[data-v-3b0f23ba]{margin-top:2px;color:rgba(0,0,0,.45);font-size:12px}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.card[data-v-2f27469c]{margin-bottom:24px}.popover-wrapper[data-v-2f27469c] .antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content{min-width:256px;max-height:290px;padding:0;overflow:auto}.antd-pro-pages-forms-style-errorIcon[data-v-2f27469c]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:24px;color:#f5222d;cursor:pointer}.antd-pro-pages-forms-style-errorIcon i[data-v-2f27469c]{margin-right:4px}.antd-pro-pages-forms-style-errorListItem[data-v-2f27469c]{padding:8px 16px;list-style:none;border-bottom:1px solid #e8e8e8;cursor:pointer;-webkit-transition:all .3s;transition:all .3s}.antd-pro-pages-forms-style-errorListItem[data-v-2f27469c]:hover{background:#e6f7ff}.antd-pro-pages-forms-style-errorListItem .antd-pro-pages-forms-style-errorIcon[data-v-2f27469c]{float:left;margin-top:4px;margin-right:12px;padding-bottom:22px;color:#f5222d}.antd-pro-pages-forms-style-errorListItem .antd-pro-pages-forms-style-errorField[data-v-2f27469c]{margin-top:2px;color:rgba(0,0,0,.45);font-size:12px}

View File

@ -1 +1 @@
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><title>X-RETRY</title><style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="/css/chunk-4e1551f3.e728df71.css" rel="prefetch"><link href="/css/chunk-6a1dbb17.1a0c6d40.css" rel="prefetch"><link href="/css/chunk-c02c9082.99cbbcce.css" rel="prefetch"><link href="/css/user.6ccd4506.css" rel="prefetch"><link href="/js/chunk-08798c7e.53670e76.js" rel="prefetch"><link href="/js/chunk-1bf36f2c.938f0a4b.js" rel="prefetch"><link href="/js/chunk-244a93b4.9f620343.js" rel="prefetch"><link href="/js/chunk-2515aa86.e9e92625.js" rel="prefetch"><link href="/js/chunk-2672acfa.44b9091e.js" rel="prefetch"><link href="/js/chunk-2d21a08f.9b98e5e6.js" rel="prefetch"><link href="/js/chunk-35f6c8ac.b6d2686b.js" rel="prefetch"><link href="/js/chunk-4e1551f3.89ca0342.js" rel="prefetch"><link href="/js/chunk-6a1dbb17.b4abdb6a.js" rel="prefetch"><link href="/js/chunk-71608044.89fd0c06.js" rel="prefetch"><link href="/js/chunk-bf3addda.471dd32a.js" rel="prefetch"><link href="/js/chunk-c02c9082.59e917bc.js" rel="prefetch"><link href="/js/fail.c3a58ea5.js" rel="prefetch"><link href="/js/lang-zh-CN-account-settings.c67af352.js" rel="prefetch"><link href="/js/lang-zh-CN-account.31178b83.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard-analysis.a03c1db8.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard.fbc2b052.js" rel="prefetch"><link href="/js/lang-zh-CN-form-basicForm.2de7abab.js" rel="prefetch"><link href="/js/lang-zh-CN-form.9e72dbc7.js" rel="prefetch"><link href="/js/lang-zh-CN-global.2ab19788.js" rel="prefetch"><link href="/js/lang-zh-CN-menu.3e33ed30.js" rel="prefetch"><link href="/js/lang-zh-CN-result-fail.e3747840.js" rel="prefetch"><link href="/js/lang-zh-CN-result-success.349556c5.js" rel="prefetch"><link href="/js/lang-zh-CN-result.5e7f6923.js" rel="prefetch"><link href="/js/lang-zh-CN-setting.78d9e9d1.js" rel="prefetch"><link href="/js/lang-zh-CN-user.696e6d3c.js" rel="prefetch"><link href="/js/lang-zh-CN.15588dfe.js" rel="prefetch"><link href="/js/user.a253eb15.js" rel="prefetch"><link href="/css/app.7dac075b.css" rel="preload" as="style"><link href="/css/chunk-vendors.f716a607.css" rel="preload" as="style"><link href="/js/app.94ecc558.js" rel="preload" as="script"><link href="/js/chunk-vendors.41a092b7.js" rel="preload" as="script"><link href="/css/chunk-vendors.f716a607.css" rel="stylesheet"><link href="/css/app.7dac075b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div class="first-loading-wrp"><h1>X-RETRY</h1><div class="loading-wrp"><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div><div style="display: flex; justify-content: center; align-items: center;">X-RETRY</div></div></div><script src="//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script><script src="//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js"></script><script src="//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js"></script><script src="//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js"></script><script src="/js/chunk-vendors.41a092b7.js"></script><script src="/js/app.94ecc558.js"></script></body></html>
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><title>X-RETRY</title><style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="/css/chunk-39be5683.cd4961ff.css" rel="prefetch"><link href="/css/chunk-4a2f6b49.a04e8eb5.css" rel="prefetch"><link href="/css/chunk-77aaac2a.99cbbcce.css" rel="prefetch"><link href="/css/user.6ccd4506.css" rel="prefetch"><link href="/js/chunk-08798c7e.3d1c2217.js" rel="prefetch"><link href="/js/chunk-1bf36f2c.77dfdf42.js" rel="prefetch"><link href="/js/chunk-244a93b4.28cf690b.js" rel="prefetch"><link href="/js/chunk-2515aa86.599bc7f3.js" rel="prefetch"><link href="/js/chunk-2672acfa.6c879ca6.js" rel="prefetch"><link href="/js/chunk-2d21a08f.78a44d95.js" rel="prefetch"><link href="/js/chunk-35f6c8ac.7808eb4b.js" rel="prefetch"><link href="/js/chunk-39be5683.ab099dd2.js" rel="prefetch"><link href="/js/chunk-4a2f6b49.f111b6b8.js" rel="prefetch"><link href="/js/chunk-71608044.f5556476.js" rel="prefetch"><link href="/js/chunk-77aaac2a.e87b660f.js" rel="prefetch"><link href="/js/chunk-bf3addda.54791a87.js" rel="prefetch"><link href="/js/fail.84b62970.js" rel="prefetch"><link href="/js/lang-zh-CN-account-settings.f8f25eaf.js" rel="prefetch"><link href="/js/lang-zh-CN-account.aa796242.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard-analysis.d7cabd65.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard.92d928c3.js" rel="prefetch"><link href="/js/lang-zh-CN-form-basicForm.ff3088ac.js" rel="prefetch"><link href="/js/lang-zh-CN-form.4042b6f3.js" rel="prefetch"><link href="/js/lang-zh-CN-global.bf0df5c8.js" rel="prefetch"><link href="/js/lang-zh-CN-menu.25425a62.js" rel="prefetch"><link href="/js/lang-zh-CN-result-fail.232762aa.js" rel="prefetch"><link href="/js/lang-zh-CN-result-success.3519c60c.js" rel="prefetch"><link href="/js/lang-zh-CN-result.3bf01153.js" rel="prefetch"><link href="/js/lang-zh-CN-setting.8c2ce690.js" rel="prefetch"><link href="/js/lang-zh-CN-user.81513cba.js" rel="prefetch"><link href="/js/lang-zh-CN.4a7452d2.js" rel="prefetch"><link href="/js/user.98174af1.js" rel="prefetch"><link href="/css/app.4f30d882.css" rel="preload" as="style"><link href="/css/chunk-vendors.f716a607.css" rel="preload" as="style"><link href="/js/app.3cd5ed5d.js" rel="preload" as="script"><link href="/js/chunk-vendors.dac3d562.js" rel="preload" as="script"><link href="/css/chunk-vendors.f716a607.css" rel="stylesheet"><link href="/css/app.4f30d882.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div class="first-loading-wrp"><h1>X-RETRY</h1><div class="loading-wrp"><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div><div style="display: flex; justify-content: center; align-items: center;">X-RETRY</div></div></div><script src="//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script><script src="//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js"></script><script src="//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js"></script><script src="//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js"></script><script src="/js/chunk-vendors.dac3d562.js"></script><script src="/js/app.3cd5ed5d.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21a08f"],{ba93:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("a-card",{attrs:{bordered:!1}},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-form",{attrs:{layout:"inline"}},[e("a-row",{attrs:{gutter:48}},[[e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:"组名称"}},[e("a-input",{attrs:{placeholder:"请输入组名称",allowClear:""},model:{value:t.queryParam.groupName,callback:function(e){t.$set(t.queryParam,"groupName",e)},expression:"queryParam.groupName"}})],1)],1)],e("a-col",{attrs:{md:t.advanced?24:8,sm:24}},[e("span",{staticClass:"table-page-search-submitButtons",style:t.advanced&&{float:"right",overflow:"hidden"}||{}},[e("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.$refs.table.refresh(!0)}}},[t._v("查询")]),e("a-button",{staticStyle:{"margin-left":"8px"},on:{click:function(){return t.queryParam={}}}},[t._v("重置")])],1)])],2)],1)],1),e("div",{staticClass:"table-operator"},[t.$auth("group.add")?e("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(e){return t.handleNew()}}},[t._v("新建")]):t._e()],1),e("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:t.columns,data:t.loadData,alert:t.options.alert,rowSelection:t.options.rowSelection},scopedSlots:t._u([{key:"serial",fn:function(a,n,r){return e("span",{},[t._v(" "+t._s(r+1)+" ")])}},{key:"groupStatus",fn:function(a){return e("span",{},[t._v(" "+t._s(0===a?"停用":"启用")+" ")])}},{key:"action",fn:function(a,n){return e("span",{},[[e("a",{on:{click:function(e){return t.handleEdit(n)}}},[t._v("编辑")]),e("a-divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.handleEditStatus(n)}}},[t._v(t._s(1===n.groupStatus?"停用":"启用"))])]],2)}}])})],1)},r=[],o=(a("d3b7"),a("25f0"),a("27e3")),s=a("0fea"),i=a("2af9"),u=a("c1df"),c=a.n(u),l={name:"TableListWrapper",components:{AInput:o["a"],STable:i["j"]},data:function(){var t=this;return{advanced:!1,queryParam:{},columns:[{title:"#",scopedSlots:{customRender:"serial"}},{title:"名称",dataIndex:"groupName"},{title:"状态",dataIndex:"groupStatus",scopedSlots:{customRender:"groupStatus"}},{title:"路由策略",dataIndex:"routeKey",customRender:function(e){return t.routeKey[e]}},{title:"版本",dataIndex:"version"},{title:"分区",dataIndex:"groupPartition",needTotal:!0},{title:"更新时间",dataIndex:"updateDt",sorter:!0,customRender:function(t){return c()(t).format("YYYY-MM-DD HH:mm:ss")}},{title:"描述",dataIndex:"description"},{title:"OnLine机器",dataIndex:"onlinePodList",customRender:function(t){return t.toString()}},{title:"操作",dataIndex:"action",width:"150px",scopedSlots:{customRender:"action"}}],loadData:function(e){return Object(s["g"])(Object.assign(e,t.queryParam)).then((function(t){return t}))},selectedRowKeys:[],selectedRows:[],options:{alert:{show:!0,clear:function(){t.selectedRowKeys=[]}},rowSelection:{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}},routeKey:{1:"一致性hash算法",2:"随机算法",3:"最近最久未使用算法"}}},created:function(){},methods:{handleNew:function(){this.$router.push("/basic-config")},handleEdit:function(t){this.$router.push({path:"/basic-config",query:{groupName:t.groupName}})},toggleAdvanced:function(){this.advanced=!this.advanced},handleEditStatus:function(t){var e=this,a=t.id,n=t.groupStatus,r=t.groupName,o=this.$notification;Object(s["v"])({id:a,groupName:r,groupStatus:1===n?0:1}).then((function(t){0===t.status?o["error"]({message:t.message}):(o["success"]({message:t.message}),e.$refs.table.refresh())}))}}},d=l,p=a("2877"),f=Object(p["a"])(d,n,r,!1,null,null,null);e["default"]=f.exports}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21a08f"],{ba93:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"table-page-search-wrapper"},[a("a-form",{attrs:{layout:"inline"}},[a("a-row",{attrs:{gutter:48}},[[a("a-col",{attrs:{md:8,sm:24}},[a("a-form-item",{attrs:{label:"组名称"}},[a("a-input",{attrs:{placeholder:"请输入组名称",allowClear:""},model:{value:t.queryParam.groupName,callback:function(e){t.$set(t.queryParam,"groupName",e)},expression:"queryParam.groupName"}})],1)],1)],a("a-col",{attrs:{md:t.advanced?24:8,sm:24}},[a("span",{staticClass:"table-page-search-submitButtons",style:t.advanced&&{float:"right",overflow:"hidden"}||{}},[a("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.$refs.table.refresh(!0)}}},[t._v("查询")]),a("a-button",{staticStyle:{"margin-left":"8px"},on:{click:function(){return t.queryParam={}}}},[t._v("重置")])],1)])],2)],1)],1),a("div",{staticClass:"table-operator"},[t.$auth("group.add")?a("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(e){return t.handleNew()}}},[t._v("新建")]):t._e()],1),a("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:t.columns,data:t.loadData,alert:t.options.alert,rowSelection:t.options.rowSelection},scopedSlots:t._u([{key:"serial",fn:function(e,n,r){return a("span",{},[t._v(" "+t._s(r+1)+" ")])}},{key:"groupStatus",fn:function(e){return a("span",{},[t._v(" "+t._s(0===e?"停用":"启用")+" ")])}},{key:"action",fn:function(e,n){return a("span",{},[[a("a",{on:{click:function(e){return t.handleEdit(n)}}},[t._v("编辑")]),a("a-divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.handleEditStatus(n)}}},[t._v(t._s(1===n.groupStatus?"停用":"启用"))])]],2)}}])})],1)},r=[],o=(a("d3b7"),a("25f0"),a("27e3")),s=a("0fea"),i=a("2af9"),u=a("c1df"),c=a.n(u),l={name:"TableListWrapper",components:{AInput:o["a"],STable:i["j"]},data:function(){var t=this;return{advanced:!1,queryParam:{},columns:[{title:"#",scopedSlots:{customRender:"serial"}},{title:"名称",dataIndex:"groupName"},{title:"状态",dataIndex:"groupStatus",scopedSlots:{customRender:"groupStatus"}},{title:"路由策略",dataIndex:"routeKey",customRender:function(e){return t.routeKey[e]}},{title:"版本",dataIndex:"version"},{title:"分区",dataIndex:"groupPartition",needTotal:!0},{title:"更新时间",dataIndex:"updateDt",sorter:!0,customRender:function(t){return c()(t).format("YYYY-MM-DD HH:mm:ss")}},{title:"描述",dataIndex:"description"},{title:"OnLine机器",dataIndex:"onlinePodList",customRender:function(t){return t.toString()}},{title:"操作",dataIndex:"action",width:"150px",scopedSlots:{customRender:"action"}}],loadData:function(e){return Object(s["g"])(Object.assign(e,t.queryParam)).then((function(t){return t}))},selectedRowKeys:[],selectedRows:[],options:{alert:{show:!0,clear:function(){t.selectedRowKeys=[]}},rowSelection:{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}},routeKey:{1:"一致性hash算法",2:"随机算法",3:"最近最久未使用算法"}}},created:function(){},methods:{handleNew:function(){this.$router.push("/basic-config")},handleEdit:function(t){this.$router.push({path:"/basic-config",query:{groupName:t.groupName}})},toggleAdvanced:function(){this.advanced=!this.advanced},handleEditStatus:function(t){var e=this,a=t.id,n=t.groupStatus,r=t.groupName,o=this.$notification;Object(s["v"])({id:a,groupName:r,groupStatus:1===n?0:1}).then((function(t){0===t.status?o["error"]({message:t.message}):(o["success"]({message:t.message}),e.$refs.table.refresh())}))}}},d=l,p=a("2877"),f=Object(p["a"])(d,n,r,!1,null,null,null);e["default"]=f.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["fail"],{cc89:function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t._self._c;return e("a-result",{attrs:{status:"404",title:"404","sub-title":"Sorry, the page you visited does not exist."},scopedSlots:t._u([{key:"extra",fn:function(){return[e("a-button",{attrs:{type:"primary"},on:{click:t.toHome}},[t._v(" Back Home ")])]},proxy:!0}])})},s=[],r={name:"Exception404",methods:{toHome:function(){this.$router.push({path:"/"})}}},u=r,a=o("2877"),i=Object(a["a"])(u,n,s,!1,null,null,null);e["default"]=i.exports}}]);

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["fail"],{cc89:function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("a-result",{attrs:{status:"404",title:"404","sub-title":"Sorry, the page you visited does not exist."},scopedSlots:t._u([{key:"extra",fn:function(){return[o("a-button",{attrs:{type:"primary"},on:{click:t.toHome}},[t._v(" Back Home ")])]},proxy:!0}])})},s=[],r={name:"Exception404",methods:{toHome:function(){this.$router.push({path:"/"})}}},u=r,a=o("2877"),i=Object(a["a"])(u,n,s,!1,null,null,null);e["default"]=i.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long