feat:2.5.0
1. 权限调整 2. 新增组详情
This commit is contained in:
parent
b7a1af4b04
commit
f4b27b5e06
@ -0,0 +1,17 @@
|
|||||||
|
package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: xiaowoniu
|
||||||
|
* @date : 2022-04-23 10:39
|
||||||
|
* @since : 2.5.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ActivePodQuantityResponseDO {
|
||||||
|
|
||||||
|
private Long total;
|
||||||
|
|
||||||
|
private Integer nodeType;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||||
|
|
||||||
|
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO;
|
||||||
import com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode;
|
import com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -16,4 +17,6 @@ public interface ServerNodeMapper extends BaseMapper<ServerNode> {
|
|||||||
|
|
||||||
int deleteByExpireAt(@Param("endTime") LocalDateTime endTime);
|
int deleteByExpireAt(@Param("endTime") LocalDateTime endTime);
|
||||||
|
|
||||||
|
List<ActivePodQuantityResponseDO> countActivePod(@Param("namespaceId") String namespaceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,4 +33,9 @@
|
|||||||
delete from server_node
|
delete from server_node
|
||||||
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="countActivePod" resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||||
|
SELECT node_type as nodeType, count(*) as total
|
||||||
|
from server_node
|
||||||
|
GROUP BY node_type
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -34,4 +34,10 @@
|
|||||||
delete from server_node
|
delete from server_node
|
||||||
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="countActivePod"
|
||||||
|
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||||
|
SELECT node_type as nodeType, count(*) as total
|
||||||
|
from server_node
|
||||||
|
GROUP BY node_type
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -17,24 +17,24 @@
|
|||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
|
id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
|
||||||
</sql>
|
</sql>
|
||||||
<insert id="insertOrUpdate" parameterType="com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertOrUpdate" parameterType="com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode"
|
||||||
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO server_node (group_name, host_id, host_ip, host_port,
|
INSERT INTO server_node (group_name, host_id, host_ip, host_port,
|
||||||
expire_at, node_type, ext_attrs, context_path, create_dt)
|
expire_at, node_type, ext_attrs, context_path, create_dt)
|
||||||
VALUES (#{groupName}, #{hostId}, #{hostIp}, #{hostPort},
|
VALUES (#{groupName}, #{hostId}, #{hostIp}, #{hostPort},
|
||||||
#{expireAt}, #{nodeType}, #{extAttrs}, #{contextPath}, #{createDt})
|
#{expireAt}, #{nodeType}, #{extAttrs}, #{contextPath}, #{createDt})
|
||||||
ON CONFLICT (host_id, host_ip) DO UPDATE SET
|
ON CONFLICT (host_id, host_ip) DO UPDATE SET expire_at = EXCLUDED.expire_at
|
||||||
group_name = EXCLUDED.group_name,
|
|
||||||
host_id = EXCLUDED.host_id,
|
|
||||||
host_ip = EXCLUDED.host_ip,
|
|
||||||
host_port = EXCLUDED.host_port,
|
|
||||||
expire_at = EXCLUDED.expire_at,
|
|
||||||
node_type = EXCLUDED.node_type,
|
|
||||||
ext_attrs = EXCLUDED.ext_attrs,
|
|
||||||
context_path = EXCLUDED.context_path,
|
|
||||||
create_dt = EXCLUDED.create_dt
|
|
||||||
</insert>
|
</insert>
|
||||||
<delete id="deleteByExpireAt">
|
<delete id="deleteByExpireAt">
|
||||||
delete from server_node
|
delete
|
||||||
|
from server_node
|
||||||
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
where expire_at <= #{endTime,jdbcType=TIMESTAMP}
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="countActivePod"
|
||||||
|
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
||||||
|
SELECT node_type as nodeType, count(*) as total
|
||||||
|
from server_node
|
||||||
|
GROUP BY node_type
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -43,13 +43,13 @@ public class GroupConfigController {
|
|||||||
return groupConfigService.addGroup(systemUser, groupConfigRequestVO);
|
return groupConfigService.addGroup(systemUser, groupConfigRequestVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LoginRequired
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@PutMapping("")
|
@PutMapping("")
|
||||||
public Boolean updateGroup(@RequestBody @Validated GroupConfigRequestVO groupConfigRequestVO) {
|
public Boolean updateGroup(@RequestBody @Validated GroupConfigRequestVO groupConfigRequestVO) {
|
||||||
return groupConfigService.updateGroup(groupConfigRequestVO);
|
return groupConfigService.updateGroup(groupConfigRequestVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LoginRequired
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@PutMapping("status")
|
@PutMapping("status")
|
||||||
public Boolean updateGroupStatus(@RequestBody @Validated GroupConfigRequestVO groupConfigRequestVO) {
|
public Boolean updateGroupStatus(@RequestBody @Validated GroupConfigRequestVO groupConfigRequestVO) {
|
||||||
String groupName = groupConfigRequestVO.getGroupName();
|
String groupName = groupConfigRequestVO.getGroupName();
|
||||||
@ -81,19 +81,19 @@ public class GroupConfigController {
|
|||||||
return groupConfigService.getAllGroupNameList();
|
return groupConfigService.getAllGroupNameList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@LoginRequired
|
@LoginRequired
|
||||||
@GetMapping("/partition")
|
@GetMapping("/on-line/pods/{groupName}")
|
||||||
public Integer getTotalPartition() {
|
public List<String> getOnlinePods(@PathVariable("groupName") String groupName) {
|
||||||
// 组分区从0开始,所以是最大值减一
|
return groupConfigService.getOnlinePods(groupName);
|
||||||
return systemProperties.getTotalPartition() - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LoginRequired
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@GetMapping("/partition-table/list")
|
@GetMapping("/partition-table/list")
|
||||||
public List<Integer> getTablePartitionList() {
|
public List<Integer> getTablePartitionList() {
|
||||||
// https://gitee.com/aizuda/easy-retry/issues/I8DAMH
|
// https://gitee.com/aizuda/easy-retry/issues/I8DAMH
|
||||||
List<String> tableList = jdbcTemplate.queryForList("SHOW TABLES LIKE 'retry_task_%'", String.class);
|
List<String> tableList = jdbcTemplate.queryForList("SHOW TABLES LIKE 'retry_task_%'", String.class);
|
||||||
return tableList.stream().map(ReUtil::getFirstNumber).filter(i -> !Objects.isNull(i) && i <= systemProperties.getTotalPartition()).distinct().collect(Collectors.toList());
|
return tableList.stream().map(ReUtil::getFirstNumber).filter(i -> !Objects.isNull(i) && i <= systemProperties.getTotalPartition()).distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.aizuda.easy.retry.server.web.controller;
|
package com.aizuda.easy.retry.server.web.controller;
|
||||||
|
|
||||||
|
import com.aizuda.easy.retry.server.web.annotation.LoginRequired;
|
||||||
|
import com.aizuda.easy.retry.server.web.annotation.RoleEnum;
|
||||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||||
import com.aizuda.easy.retry.server.web.model.request.NamespaceQueryVO;
|
import com.aizuda.easy.retry.server.web.model.request.NamespaceQueryVO;
|
||||||
import com.aizuda.easy.retry.server.web.model.request.NamespaceRequestVO;
|
import com.aizuda.easy.retry.server.web.model.request.NamespaceRequestVO;
|
||||||
@ -23,26 +25,31 @@ public class NamespaceController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
|
|
||||||
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Boolean saveNamespace(@RequestBody @Validated NamespaceRequestVO namespaceRequestVO) {
|
public Boolean saveNamespace(@RequestBody @Validated NamespaceRequestVO namespaceRequestVO) {
|
||||||
return namespaceService.saveNamespace(namespaceRequestVO);
|
return namespaceService.saveNamespace(namespaceRequestVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Boolean updateNamespace(@RequestBody @Validated NamespaceRequestVO namespaceRequestVO) {
|
public Boolean updateNamespace(@RequestBody @Validated NamespaceRequestVO namespaceRequestVO) {
|
||||||
return namespaceService.updateNamespace(namespaceRequestVO);
|
return namespaceService.updateNamespace(namespaceRequestVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public PageResult<List<NamespaceResponseVO>> getNamespacePage(NamespaceQueryVO queryVO) {
|
public PageResult<List<NamespaceResponseVO>> getNamespacePage(NamespaceQueryVO queryVO) {
|
||||||
return namespaceService.getNamespacePage(queryVO);
|
return namespaceService.getNamespacePage(queryVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@DeleteMapping("{id}")
|
@DeleteMapping("{id}")
|
||||||
public Boolean deleteNamespace(@PathVariable("id") Long id) {
|
public Boolean deleteNamespace(@PathVariable("id") Long id) {
|
||||||
return namespaceService.deleteNamespace(id);
|
return namespaceService.deleteNamespace(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LoginRequired(role = RoleEnum.ADMIN)
|
||||||
@GetMapping("/all")
|
@GetMapping("/all")
|
||||||
public List<NamespaceResponseVO> getAllNamespace() {
|
public List<NamespaceResponseVO> getAllNamespace() {
|
||||||
return namespaceService.getAllNamespace();
|
return namespaceService.getAllNamespace();
|
||||||
|
|||||||
@ -28,4 +28,5 @@ public interface GroupConfigService {
|
|||||||
|
|
||||||
List<String> getAllGroupNameList();
|
List<String> getAllGroupNameList();
|
||||||
|
|
||||||
|
List<String> getOnlinePods(String groupName);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,8 @@ import com.aizuda.easy.retry.server.common.dto.ServerNodeExtAttrs;
|
|||||||
import com.aizuda.easy.retry.server.common.register.ServerRegister;
|
import com.aizuda.easy.retry.server.common.register.ServerRegister;
|
||||||
import com.aizuda.easy.retry.server.web.service.convert.DispatchQuantityResponseVOConverter;
|
import com.aizuda.easy.retry.server.web.service.convert.DispatchQuantityResponseVOConverter;
|
||||||
import com.aizuda.easy.retry.server.web.service.convert.SceneQuantityRankResponseVOConverter;
|
import com.aizuda.easy.retry.server.web.service.convert.SceneQuantityRankResponseVOConverter;
|
||||||
|
import com.aizuda.easy.retry.server.web.util.UserSessionUtils;
|
||||||
|
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO;
|
||||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO;
|
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO;
|
||||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.SceneQuantityRankResponseDO;
|
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.SceneQuantityRankResponseDO;
|
||||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetryTaskLogMapper;
|
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetryTaskLogMapper;
|
||||||
@ -32,6 +34,7 @@ import com.aizuda.easy.retry.server.web.model.response.SceneQuantityRankResponse
|
|||||||
import com.aizuda.easy.retry.server.web.model.response.TaskQuantityResponseVO;
|
import com.aizuda.easy.retry.server.web.model.response.TaskQuantityResponseVO;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -107,9 +110,15 @@ public class DashBoardServiceImpl implements DashBoardService {
|
|||||||
public ActivePodQuantityResponseVO countActivePod() {
|
public ActivePodQuantityResponseVO countActivePod() {
|
||||||
|
|
||||||
ActivePodQuantityResponseVO activePodQuantityResponseVO = new ActivePodQuantityResponseVO();
|
ActivePodQuantityResponseVO activePodQuantityResponseVO = new ActivePodQuantityResponseVO();
|
||||||
activePodQuantityResponseVO.setTotal(serverNodeMapper.selectCount(null));
|
|
||||||
activePodQuantityResponseVO.setServerTotal(serverNodeMapper.selectCount(new LambdaQueryWrapper<ServerNode>().eq(ServerNode::getNodeType, NodeTypeEnum.SERVER.getType())));
|
List<ActivePodQuantityResponseDO> activePodQuantityDO = serverNodeMapper.countActivePod(UserSessionUtils.currentUserSession().getNamespaceId());
|
||||||
activePodQuantityResponseVO.setClientTotal(serverNodeMapper.selectCount(new LambdaQueryWrapper<ServerNode>().eq(ServerNode::getNodeType, NodeTypeEnum.CLIENT.getType())));
|
Map<Integer, Long> map = activePodQuantityDO.stream().collect(Collectors.toMap(ActivePodQuantityResponseDO::getNodeType, ActivePodQuantityResponseDO::getTotal));
|
||||||
|
Long clientTotal = map.getOrDefault(NodeTypeEnum.CLIENT.getType(), 0L);
|
||||||
|
Long serverTotal = map.getOrDefault(NodeTypeEnum.SERVER.getType(), 0L);
|
||||||
|
activePodQuantityResponseVO.setServerTotal(serverTotal);
|
||||||
|
activePodQuantityResponseVO.setClientTotal(clientTotal);
|
||||||
|
|
||||||
|
activePodQuantityResponseVO.setTotal(clientTotal + serverTotal);
|
||||||
|
|
||||||
return activePodQuantityResponseVO;
|
return activePodQuantityResponseVO;
|
||||||
}
|
}
|
||||||
@ -181,6 +190,9 @@ public class DashBoardServiceImpl implements DashBoardService {
|
|||||||
PageDTO<ServerNode> pageDTO = new PageDTO<>(queryVO.getPage(), queryVO.getSize());
|
PageDTO<ServerNode> pageDTO = new PageDTO<>(queryVO.getPage(), queryVO.getSize());
|
||||||
|
|
||||||
LambdaQueryWrapper<ServerNode> serverNodeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ServerNode> serverNodeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
serverNodeLambdaQueryWrapper.in(ServerNode::getNamespaceId, Lists.newArrayList(
|
||||||
|
UserSessionUtils.currentUserSession().getNamespaceId(), ServerRegister.NAMESPACE_ID
|
||||||
|
));
|
||||||
if (StrUtil.isNotBlank(queryVO.getGroupName())) {
|
if (StrUtil.isNotBlank(queryVO.getGroupName())) {
|
||||||
serverNodeLambdaQueryWrapper.eq(ServerNode::getGroupName, queryVO.getGroupName());
|
serverNodeLambdaQueryWrapper.eq(ServerNode::getGroupName, queryVO.getGroupName());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,12 +183,6 @@ public class GroupConfigServiceImpl implements GroupConfigService {
|
|||||||
records);
|
records);
|
||||||
|
|
||||||
for (GroupConfigResponseVO groupConfigResponseVO : responseVOList) {
|
for (GroupConfigResponseVO groupConfigResponseVO : responseVOList) {
|
||||||
List<ServerNode> serverNodes = serverNodeMapper.selectList(
|
|
||||||
new LambdaQueryWrapper<ServerNode>().eq(ServerNode::getGroupName,
|
|
||||||
groupConfigResponseVO.getGroupName()));
|
|
||||||
groupConfigResponseVO.setOnlinePodList(
|
|
||||||
serverNodes.stream().map(serverNode -> serverNode.getHostIp() + ":" + serverNode.getHostPort())
|
|
||||||
.collect(Collectors.toList()));
|
|
||||||
Optional.ofNullable(IdGeneratorMode.modeOf(groupConfigResponseVO.getIdGeneratorMode()))
|
Optional.ofNullable(IdGeneratorMode.modeOf(groupConfigResponseVO.getIdGeneratorMode()))
|
||||||
.ifPresent(idGeneratorMode -> {
|
.ifPresent(idGeneratorMode -> {
|
||||||
groupConfigResponseVO.setIdGeneratorModeName(idGeneratorMode.getDesc());
|
groupConfigResponseVO.setIdGeneratorModeName(idGeneratorMode.getDesc());
|
||||||
@ -302,4 +296,14 @@ public class GroupConfigServiceImpl implements GroupConfigService {
|
|||||||
return groupConfigs.stream().map(GroupConfig::getGroupName).collect(Collectors.toList());
|
return groupConfigs.stream().map(GroupConfig::getGroupName).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getOnlinePods(String groupName) {
|
||||||
|
List<ServerNode> serverNodes = serverNodeMapper.selectList(
|
||||||
|
new LambdaQueryWrapper<ServerNode>()
|
||||||
|
.eq(ServerNode::getNamespaceId, UserSessionUtils.currentUserSession().getNamespaceId())
|
||||||
|
.eq(ServerNode::getGroupName, groupName));
|
||||||
|
return serverNodes.stream().map(serverNode -> serverNode.getHostIp() + ":" + serverNode.getHostPort())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,8 @@ public class NamespaceServiceImpl implements NamespaceService {
|
|||||||
namespace.setName(namespaceRequestVO.getName());
|
namespace.setName(namespaceRequestVO.getName());
|
||||||
if (StrUtil.isBlank(namespaceRequestVO.getUniqueId())) {
|
if (StrUtil.isBlank(namespaceRequestVO.getUniqueId())) {
|
||||||
namespace.setUniqueId(IdUtil.simpleUUID());
|
namespace.setUniqueId(IdUtil.simpleUUID());
|
||||||
|
} else {
|
||||||
|
namespace.setUniqueId(namespaceRequestVO.getUniqueId());
|
||||||
}
|
}
|
||||||
return 1 == namespaceMapper.insert(namespace);
|
return 1 == namespaceMapper.insert(namespace);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ const api = {
|
|||||||
groupConfigByGroupName: `/group`,
|
groupConfigByGroupName: `/group`,
|
||||||
allGroupNameList: `/group/all/group-name/list`,
|
allGroupNameList: `/group/all/group-name/list`,
|
||||||
allGroupConfigList: `/group/all/group-config/list`,
|
allGroupConfigList: `/group/all/group-config/list`,
|
||||||
|
onlinePods: `/group/on-line/pods/`,
|
||||||
retryTaskPage: '/retry-task/list',
|
retryTaskPage: '/retry-task/list',
|
||||||
retryTaskById: '/retry-task/',
|
retryTaskById: '/retry-task/',
|
||||||
saveRetryTask: '/retry-task',
|
saveRetryTask: '/retry-task',
|
||||||
@ -58,6 +59,13 @@ const api = {
|
|||||||
|
|
||||||
export default api
|
export default api
|
||||||
|
|
||||||
|
export function onlinePods (parameter) {
|
||||||
|
return request({
|
||||||
|
url: api.onlinePods + parameter,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function allGroupConfigList (data) {
|
export function allGroupConfigList (data) {
|
||||||
return request({
|
return request({
|
||||||
url: api.allGroupConfigList,
|
url: api.allGroupConfigList,
|
||||||
|
|||||||
@ -42,22 +42,40 @@ export const asyncRouterMap = [
|
|||||||
path: '/namespace',
|
path: '/namespace',
|
||||||
name: 'namespace',
|
name: 'namespace',
|
||||||
component: () => import('@/views/namespace/NamespaceList'),
|
component: () => import('@/views/namespace/NamespaceList'),
|
||||||
meta: { title: '命名空间', icon: 'team', permission: ['group'] }
|
meta: { title: '命名空间', icon: 'team', permission: ['namespace'] }
|
||||||
},
|
},
|
||||||
// profile
|
// profile
|
||||||
{
|
{
|
||||||
path: '/basic-config-list',
|
path: '/group',
|
||||||
|
name: 'GroupConfigList',
|
||||||
|
component: RouteView,
|
||||||
|
hideChildrenInMenu: true,
|
||||||
|
redirect: '/group/list',
|
||||||
|
meta: { title: '组管理', hideChildrenInMenu: true, icon: 'team', permission: ['group'] },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '/group/list',
|
||||||
name: 'basicConfigList',
|
name: 'basicConfigList',
|
||||||
component: () => import('@/views/config/GroupList'),
|
component: () => import('@/views/config/GroupList'),
|
||||||
meta: { title: '组管理', icon: 'team', permission: ['group'] }
|
meta: { title: '组配置列表', hidden: true, icon: 'team', permission: ['group'] }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/basic-config',
|
path: '/group/config',
|
||||||
name: 'basicConfig',
|
name: 'GroupConfig',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/views/config/basicConfigForm/BasicConfigForm'),
|
component: () => import('@/views/config/basicConfigForm/BasicConfigForm'),
|
||||||
meta: { title: '基础信息配置', hidden: true, hideChildrenInMenu: true, icon: 'profile', permission: ['basicConfig'] }
|
meta: { title: '组信息配置', hidden: true, hideChildrenInMenu: true, icon: 'profile', permission: ['group'] }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/group/info',
|
||||||
|
name: 'GroupInfo',
|
||||||
|
hidden: true,
|
||||||
|
component: () => import('@/views/config/GroupInfo'),
|
||||||
|
meta: { title: '组配置详情', hidden: true, hideChildrenInMenu: true, icon: 'profile', permission: ['group'] }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/retry',
|
path: '/retry',
|
||||||
name: 'RetryTask',
|
name: 'RetryTask',
|
||||||
|
|||||||
@ -27,18 +27,13 @@ function plugin (Vue) {
|
|||||||
const [permission, action] = permissions.split('.')
|
const [permission, action] = permissions.split('.')
|
||||||
const permissionList = _this.$store.getters.roles.permissions
|
const permissionList = _this.$store.getters.roles.permissions
|
||||||
|
|
||||||
const actionList = permissionList.find((val) => {
|
return permissionList.find((val) => {
|
||||||
return val.permissionId === permission
|
return val.permissionId === permission
|
||||||
}).actionList
|
}).actionList.findIndex((val) => {
|
||||||
if (actionList) {
|
|
||||||
return actionList.findIndex((val) => {
|
|
||||||
console.log(val)
|
console.log(val)
|
||||||
console.log(action)
|
console.log(action)
|
||||||
return val === action
|
return val === action
|
||||||
}) > -1
|
}) > -1
|
||||||
} else {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,10 +72,11 @@ const user = {
|
|||||||
role.permissions = result.role.permissions
|
role.permissions = result.role.permissions
|
||||||
role.permissions.map(per => {
|
role.permissions.map(per => {
|
||||||
if (per.actionEntitySet != null && per.actionEntitySet.length > 0) {
|
if (per.actionEntitySet != null && per.actionEntitySet.length > 0) {
|
||||||
const action = per.actionEntitySet.map(action => {
|
per.actionList = (per.actionEntitySet || {}).map(action => {
|
||||||
return action.action
|
return action.action
|
||||||
})
|
})
|
||||||
per.actionList = action
|
} else {
|
||||||
|
per.actionList = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -1,255 +1,155 @@
|
|||||||
|
|
||||||
|
const commonAdmin = [
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'group',
|
||||||
|
permissionName: '组配置',
|
||||||
|
actionEntitySet: [
|
||||||
|
{
|
||||||
|
action: 'add',
|
||||||
|
describe: '新增',
|
||||||
|
defaultCheck: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'edit',
|
||||||
|
describe: '更新',
|
||||||
|
defaultCheck: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'stop',
|
||||||
|
describe: '停止',
|
||||||
|
defaultCheck: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'user',
|
||||||
|
permissionName: '用户'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'userForm',
|
||||||
|
permissionName: '新增或更新用户'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'basicConfig',
|
||||||
|
permissionName: '基础信息配置'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'namespace',
|
||||||
|
permissionName: '命名空间'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const retryAdmin = [
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'dashboard',
|
||||||
|
permissionName: '看板'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'retryTask',
|
||||||
|
permissionName: '任务管理'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'retryDeadLetter',
|
||||||
|
permissionName: '死信队列管理'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'retryLog',
|
||||||
|
permissionName: '重试日志管理'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const jobAdmin = [
|
||||||
|
{
|
||||||
|
roleId: 2,
|
||||||
|
permissionId: 'dashboard',
|
||||||
|
permissionName: '看板'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'job',
|
||||||
|
permissionName: '定时任务管理',
|
||||||
|
actionEntitySet: [
|
||||||
|
{
|
||||||
|
action: 'del',
|
||||||
|
describe: '新增',
|
||||||
|
defaultCheck: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'jobBatch',
|
||||||
|
permissionName: '任务批次'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const commonUser = [
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'group',
|
||||||
|
permissionName: '组配置',
|
||||||
|
actionEntitySet: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const retryUser = [
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'dashboard',
|
||||||
|
permissionName: '看板'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'retryTask',
|
||||||
|
permissionName: '任务管理'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'retryDeadLetter',
|
||||||
|
permissionName: '死信队列管理'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'retryLog',
|
||||||
|
permissionName: '重试日志管理'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const jobUser = [
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'dashboard',
|
||||||
|
permissionName: '看板'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'job',
|
||||||
|
permissionName: '定时任务管理'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
roleId: 1,
|
||||||
|
permissionId: 'jobBatch',
|
||||||
|
permissionName: '任务批次'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const permissionsConfig = {
|
const permissionsConfig = {
|
||||||
RETRY: {
|
RETRY: {
|
||||||
1: [
|
1: [...retryUser, ...commonUser],
|
||||||
{
|
2: [...retryAdmin, ...commonAdmin]
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'group',
|
|
||||||
permissionName: '组配置',
|
|
||||||
actionEntitySet: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'dashboard',
|
|
||||||
permissionName: '看板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'retryTask',
|
|
||||||
permissionName: '任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'retryDeadLetter',
|
|
||||||
permissionName: '死信队列管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'retryLog',
|
|
||||||
permissionName: '重试日志管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'basicConfig',
|
|
||||||
permissionName: '基础信息配置'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
2: [
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'group',
|
|
||||||
permissionName: '组配置',
|
|
||||||
actionEntitySet: [
|
|
||||||
{
|
|
||||||
action: 'add',
|
|
||||||
describe: '新增',
|
|
||||||
defaultCheck: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'user',
|
|
||||||
permissionName: '用户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'userForm',
|
|
||||||
permissionName: '新增或更新用户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'dashboard',
|
|
||||||
permissionName: '看板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'retryTask',
|
|
||||||
permissionName: '任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'retryDeadLetter',
|
|
||||||
permissionName: '死信队列管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'retryLog',
|
|
||||||
permissionName: '重试日志管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'basicConfig',
|
|
||||||
permissionName: '基础信息配置'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
JOB: {
|
JOB: {
|
||||||
1: [
|
1: [...jobUser, ...commonUser],
|
||||||
{
|
2: [...jobAdmin, ...commonAdmin]
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'group',
|
|
||||||
permissionName: '组配置',
|
|
||||||
actionEntitySet: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'dashboard',
|
|
||||||
permissionName: '看板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'job',
|
|
||||||
permissionName: '定时任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'jobBatch',
|
|
||||||
permissionName: '任务批次'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
2: [
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'group',
|
|
||||||
permissionName: '组配置',
|
|
||||||
actionEntitySet: [
|
|
||||||
{
|
|
||||||
action: 'add',
|
|
||||||
describe: '新增',
|
|
||||||
defaultCheck: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'user',
|
|
||||||
permissionName: '用户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'userForm',
|
|
||||||
permissionName: '新增或更新用户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'dashboard',
|
|
||||||
permissionName: '看板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'job',
|
|
||||||
permissionName: '定时任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'jobBatch',
|
|
||||||
permissionName: '任务批次'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
ALL: {
|
ALL: {
|
||||||
1: [
|
1: [...retryUser, ...jobUser, ...commonUser],
|
||||||
{
|
2: [...retryAdmin, ...jobAdmin, ...commonAdmin]
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'group',
|
|
||||||
permissionName: '组配置',
|
|
||||||
actionEntitySet: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'dashboard',
|
|
||||||
permissionName: '看板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'retryTask',
|
|
||||||
permissionName: '任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'retryDeadLetter',
|
|
||||||
permissionName: '死信队列管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'retryLog',
|
|
||||||
permissionName: '重试日志管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'basicConfig',
|
|
||||||
permissionName: '基础信息配置'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'job',
|
|
||||||
permissionName: '定时任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'jobBatch',
|
|
||||||
permissionName: '任务批次'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
2: [
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'group',
|
|
||||||
permissionName: '组配置',
|
|
||||||
actionEntitySet: [
|
|
||||||
{
|
|
||||||
action: 'add',
|
|
||||||
describe: '新增',
|
|
||||||
defaultCheck: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'user',
|
|
||||||
permissionName: '用户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'userForm',
|
|
||||||
permissionName: '新增或更新用户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'dashboard',
|
|
||||||
permissionName: '看板'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'retryTask',
|
|
||||||
permissionName: '任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'retryDeadLetter',
|
|
||||||
permissionName: '死信队列管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'retryLog',
|
|
||||||
permissionName: '重试日志管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 2,
|
|
||||||
permissionId: 'basicConfig',
|
|
||||||
permissionName: '基础信息配置'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'job',
|
|
||||||
permissionName: '定时任务管理'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
roleId: 1,
|
|
||||||
permissionId: 'jobBatch',
|
|
||||||
permissionName: '任务批次'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
101
frontend/src/views/config/GroupInfo.vue
Normal file
101
frontend/src/views/config/GroupInfo.vue
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<page-header-wrapper @back="() => $router.replace('/group/list')" style="margin: -24px -1px 0" v-if="showHeader">
|
||||||
|
<div></div>
|
||||||
|
</page-header-wrapper>
|
||||||
|
<a-card :bordered="false" v-if="groupInfo !==null ">
|
||||||
|
<a-descriptions title="通用配置" :column="column" bordered>
|
||||||
|
<a-descriptions-item label="组名称">
|
||||||
|
{{ groupInfo.groupName }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="状态">
|
||||||
|
<a-tag :color="groupStatus[groupInfo.groupStatus].color">
|
||||||
|
{{ groupStatus[groupInfo.groupStatus].name }}
|
||||||
|
</a-tag>
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="版本">
|
||||||
|
{{ groupInfo.version }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="描述" span="3">
|
||||||
|
{{ groupInfo.description }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="OnLine机器" span="3">
|
||||||
|
<a-tag color="blue" v-for="item in podInfo" :key="item">
|
||||||
|
{{ item }}
|
||||||
|
</a-tag>
|
||||||
|
</a-descriptions-item>
|
||||||
|
</a-descriptions>
|
||||||
|
<br/>
|
||||||
|
<a-descriptions title="重试配置" :column="column" bordered>
|
||||||
|
<a-descriptions-item label="ID生成模式">
|
||||||
|
<a-tag :color="idGeneratorMode[groupInfo.idGeneratorMode].color">
|
||||||
|
{{ idGeneratorMode[groupInfo.idGeneratorMode].name }}
|
||||||
|
</a-tag>
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="分区">
|
||||||
|
{{ groupInfo.groupPartition }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="初始化场景">
|
||||||
|
<a-tag :color="initScene[groupInfo.initScene].color">
|
||||||
|
{{ initScene[groupInfo.initScene].name }}
|
||||||
|
</a-tag>
|
||||||
|
</a-descriptions-item>
|
||||||
|
</a-descriptions>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getGroupConfigByGroupName, onlinePods } from '@/api/manage'
|
||||||
|
import enums from '@/utils/retryEnum'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'GroupInfo',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
showHeader: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
column: {
|
||||||
|
type: Number,
|
||||||
|
default: 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
groupInfo: null,
|
||||||
|
podInfo: [],
|
||||||
|
initScene: enums.initScene,
|
||||||
|
groupStatus: enums.groupStatus,
|
||||||
|
idGeneratorMode: enums.idGenMode
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
const groupName = this.$route.query.groupName
|
||||||
|
if (groupName) {
|
||||||
|
this.groupConfigDetail(groupName)
|
||||||
|
} else {
|
||||||
|
if (this.showHeader) {
|
||||||
|
this.$router.push({ path: '/404' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
groupConfigDetail (groupName) {
|
||||||
|
getGroupConfigByGroupName(groupName).then(res => {
|
||||||
|
this.groupInfo = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
onlinePods(groupName).then(res => {
|
||||||
|
this.podInfo = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang='less'>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -39,8 +39,8 @@
|
|||||||
:rowSelection="options.rowSelection"
|
:rowSelection="options.rowSelection"
|
||||||
:scroll="{ x: 1600 }"
|
:scroll="{ x: 1600 }"
|
||||||
>
|
>
|
||||||
<span slot="serial" slot-scope="text, record">
|
<span slot="groupName" slot-scope="text, record">
|
||||||
{{ record.id }}
|
<a href="#" @click="handlerOpenDrawer(record)">{{ text }}</a>
|
||||||
</span>
|
</span>
|
||||||
<span slot="groupStatus" slot-scope="text">
|
<span slot="groupStatus" slot-scope="text">
|
||||||
<a-tag :color="groupStatus[text].color">
|
<a-tag :color="groupStatus[text].color">
|
||||||
@ -59,19 +59,35 @@
|
|||||||
</span>
|
</span>
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<template>
|
<template>
|
||||||
<a @click="handleEdit(record)">编辑</a>
|
<a @click="handleInfo(record)">详情</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
<a @click="handleEdit(record)" v-if="$auth('group.edit')">编辑</a>
|
||||||
|
<a-divider type="vertical" v-if="$auth('group.edit')"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="record.groupStatus === 1 ? '是否停用?': '是否启用?'"
|
:title="record.groupStatus === 1 ? '是否停用?': '是否启用?'"
|
||||||
ok-text="确定"
|
ok-text="确定"
|
||||||
cancel-text="取消"
|
cancel-text="取消"
|
||||||
@confirm="handleEditStatus(record)"
|
@confirm="handleEditStatus(record)"
|
||||||
|
v-if="$auth('group.stop')"
|
||||||
>
|
>
|
||||||
<a href="javascript:;">{{ record.groupStatus === 1 ? '停用': '启用' }}</a>
|
<a href="javascript:;">{{ record.groupStatus === 1 ? '停用': '启用' }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
</s-table>
|
</s-table>
|
||||||
|
|
||||||
|
<Drawer
|
||||||
|
title="组配置详情"
|
||||||
|
placement="right"
|
||||||
|
:width="800"
|
||||||
|
:visibleAmplify="true"
|
||||||
|
:visible="openDrawer"
|
||||||
|
@closeDrawer="onClose"
|
||||||
|
@handlerAmplify="handleInfo"
|
||||||
|
>
|
||||||
|
<group-info ref="groupInfoRef" :showHeader="false" :column="1"/>
|
||||||
|
</Drawer>
|
||||||
|
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -79,13 +95,16 @@
|
|||||||
|
|
||||||
import AInput from 'ant-design-vue/es/input/Input'
|
import AInput from 'ant-design-vue/es/input/Input'
|
||||||
import { getGroupConfigForPage, updateGroupStatus } from '@/api/manage'
|
import { getGroupConfigForPage, updateGroupStatus } from '@/api/manage'
|
||||||
import { STable } from '@/components'
|
import { Drawer, STable } from '@/components'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import GroupInfo from '@/views/config/GroupInfo.vue'
|
||||||
const enums = require('@/utils/retryEnum')
|
const enums = require('@/utils/retryEnum')
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TableListWrapper',
|
name: 'TableListWrapper',
|
||||||
components: {
|
components: {
|
||||||
|
GroupInfo,
|
||||||
|
Drawer,
|
||||||
AInput,
|
AInput,
|
||||||
STable
|
STable
|
||||||
},
|
},
|
||||||
@ -97,13 +116,11 @@ export default {
|
|||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
// 表头
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
title: '#',
|
|
||||||
scopedSlots: { customRender: 'serial' }
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: '名称',
|
||||||
dataIndex: 'groupName'
|
dataIndex: 'groupName',
|
||||||
|
scopedSlots: { customRender: 'groupName' }
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
@ -139,11 +156,6 @@ export default {
|
|||||||
title: '描述',
|
title: '描述',
|
||||||
dataIndex: 'description'
|
dataIndex: 'description'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: 'OnLine机器',
|
|
||||||
dataIndex: 'onlinePodList',
|
|
||||||
customRender: (text) => text.toString()
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
@ -173,7 +185,9 @@ export default {
|
|||||||
},
|
},
|
||||||
initScene: enums.initScene,
|
initScene: enums.initScene,
|
||||||
groupStatus: enums.groupStatus,
|
groupStatus: enums.groupStatus,
|
||||||
idGeneratorMode: enums.idGenMode
|
idGeneratorMode: enums.idGenMode,
|
||||||
|
currentShowRecord: null,
|
||||||
|
openDrawer: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@ -181,10 +195,14 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleNew () {
|
handleNew () {
|
||||||
this.$router.push('/basic-config')
|
this.$router.push('/group/config')
|
||||||
},
|
},
|
||||||
handleEdit (record) {
|
handleEdit (record) {
|
||||||
this.$router.push({ path: '/basic-config', query: { groupName: record.groupName } })
|
this.$router.push({ path: '/group/config', query: { groupName: record.groupName } })
|
||||||
|
},
|
||||||
|
handleInfo (record) {
|
||||||
|
record = record || this.currentShowRecord
|
||||||
|
this.$router.push({ path: '/group/info', query: { groupName: record.groupName } })
|
||||||
},
|
},
|
||||||
toggleAdvanced () {
|
toggleAdvanced () {
|
||||||
this.advanced = !this.advanced
|
this.advanced = !this.advanced
|
||||||
@ -205,6 +223,17 @@ export default {
|
|||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
handlerOpenDrawer (record) {
|
||||||
|
this.currentShowRecord = record
|
||||||
|
this.openDrawer = true
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs.groupInfoRef.groupConfigDetail(record.groupName)
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
|
onClose () {
|
||||||
|
this.openDrawer = false
|
||||||
|
this.currentShowRecord = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<page-header-wrapper content="配置组、场景、通知配置" @back="() => $router.go(-1)" style="margin: -24px -1px 0">
|
<page-header-wrapper content="配置组" @back="() => $router.go(-1)" style="margin: -24px -1px 0">
|
||||||
<div></div>
|
<div></div>
|
||||||
</page-header-wrapper>
|
</page-header-wrapper>
|
||||||
<a-card class="card" :bordered="false">
|
<a-card class="card" :bordered="false">
|
||||||
|
|||||||
@ -150,6 +150,7 @@
|
|||||||
ok-text="删除"
|
ok-text="删除"
|
||||||
cancel-text="取消"
|
cancel-text="取消"
|
||||||
@confirm="handleDel(record)"
|
@confirm="handleDel(record)"
|
||||||
|
v-if="$auth('job.del')"
|
||||||
>
|
>
|
||||||
<a href="javascript:;" v-if="record.jobStatus === 0">删除</a>
|
<a href="javascript:;" v-if="record.jobStatus === 0">删除</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
|||||||
@ -7,11 +7,10 @@
|
|||||||
v-decorator="['id']" />
|
v-decorator="['id']" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="唯一标识"
|
label="唯一标识(默认UUID)">
|
||||||
v-if="isEdit">
|
|
||||||
<a-input
|
<a-input
|
||||||
placeholder="唯一标识"
|
placeholder="唯一标识"
|
||||||
disabled
|
:disabled="isEdit"
|
||||||
v-decorator="[
|
v-decorator="[
|
||||||
'uniqueId',
|
'uniqueId',
|
||||||
{rules: [{ required: false, message: '请输入空间名称', whitespace: true}]}
|
{rules: [{ required: false, message: '请输入空间名称', whitespace: true}]}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user