Skip to content

Commit

Permalink
Merge pull request #30 from lijiahangmax/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lijiahangmax committed Nov 11, 2022
2 parents 1d122c0 + 841d31f commit e278ef1
Show file tree
Hide file tree
Showing 125 changed files with 4,129 additions and 857 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<br/>

当前最新版本: **1.2.0**
当前最新版本: **1.2.1**
github: https://github.com/lijiahangmax/orion-ops
gitee: https://gitee.com/lijiahangmax/orion-ops
csdn: https://blog.csdn.net/qq_41011894
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
build:
context: .
dockerfile: docker/orion-ops/Dockerfile
image: orion-ops:1.2.0
image: orion-ops:1.2.1
ports:
- "3090:80"
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/orion-ops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config &&
ssh-keygen -t ed25519 -P '' -f /etc/ssh/ssh_host_ed25519_key && \
echo 'root:orionadmin' | chpasswd
WORKDIR /app
COPY orion-ops-api/orion-ops-web/target/orion-ops-web-1.2.0.jar /app/app.jar
COPY orion-ops-api/orion-ops-web/target/orion-ops-web-1.2.1.jar /app/app.jar
COPY orion-ops-vue/dist/index.html /usr/share/nginx/html/
COPY orion-ops-vue/dist /usr/share/nginx/html/ops
ADD docker/orion-ops/entrypoint.sh /app/entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion orion-ops-api/orion-ops-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.orion.ops</groupId>
<artifactId>orion-ops-api</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ private Const() {

public static final String PLUGINS = "plugins";

public static final String TIMEOUT = "timeout";

public static final String CAST_SUFFIX = "cast";

public static final Integer FORBID_DELETE_CAN = 1;
Expand All @@ -102,6 +104,10 @@ private Const() {

public static final Long HOST_MACHINE_ID = 1L;

public static final Long ROOT_TREE_ID = -1L;

public static final Integer DEFAULT_TREE_SORT = 1;

public static final String HOST_MACHINE_TAG = "host";

public static final String SWAP_FILE_SUFFIX = ".swp";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,28 @@ private KeyConst() {
*/
public static final int DATA_IMPORT_TOKEN_EXPIRE = 60 * 5;

/**
* 机器分组数据 key
* <p>
* machine:group:data
*/
public static final String MACHINE_GROUP_DATA_KEY = "machine:group:data";

/**
* 5 h
*/
public static final int MACHINE_GROUP_DATA_EXPIRE = 60 * 60 * 5;

/**
* 机器分组引用 key
* <p>
* machine:group:rel
*/
public static final String MACHINE_GROUP_REL_KEY = "machine:group:rel";

/**
* 5 h
*/
public static final int MACHINE_GROUP_REL_EXPIRE = 60 * 60 * 5;

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ private MessageConst() {

public static final String AUTH_EXCEPTION_MESSAGE = "认证失败";

public static final String TIMEOUT_EXCEPTION_MESSAGE = "连接超时";

public static final String IO_EXCEPTION_MESSAGE = "网络异常";

public static final String SQL_EXCEPTION_MESSAGE = "数据异常";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public enum ApplicationEnvAttr {
/**
* 发布序列方式
*
* @see com.orion.ops.constant.SerialType
* @see com.orion.ops.constant.common.SerialType
*/
RELEASE_SERIAL("发布序列方式 (serial/parallel)"),

/**
* 异常处理类型
*
* @see com.orion.ops.constant.SerialType#SERIAL
* @see com.orion.ops.constant.ExceptionHandlerType
* @see com.orion.ops.constant.common.SerialType#SERIAL
* @see com.orion.ops.constant.common.ExceptionHandlerType
*/
EXCEPTION_HANDLER("异常处理类型 (skip_all/skip_error)"),

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.orion.ops.constant;
package com.orion.ops.constant.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.orion.ops.constant;
package com.orion.ops.constant.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.orion.ops.constant;
package com.orion.ops.constant.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.orion.ops.constant;
package com.orion.ops.constant.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.orion.ops.constant;
package com.orion.ops.constant.common;

/**
* ANSI 高亮颜色转义码
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.orion.ops.constant.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* 树移动类型
*
* @author Jiahang Li
* @version 1.0.0
* @since 2022/9/28 17:42
*/
@Getter
@AllArgsConstructor
public enum TreeMoveType {

/**
* 移动到内层 上面
*/
IN_TOP(1),

/**
* 移动到内层 下面
*/
IN_BOTTOM(2),

/**
* 移动到节点 上面
*/
PREV(3),

/**
* 移动到节点 下面
*/
NEXT(4),

;

private final Integer type;

public static TreeMoveType of(Integer type) {
if (type == null) {
return null;
}
for (TreeMoveType value : values()) {
if (value.type.equals(type)) {
return value;
}
}
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ private MachineConst() {
/**
* 远程连接超时时间
*/
public static final int CONNECT_TIMEOUT = Const.MS_S_5;
public static final int CONNECT_TIMEOUT = Const.MS_S_30;

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ private MonitorConst() {
*/
public static final String START_SCRIPT_FILE_NAME = "start-machine-monitor-agent.sh";

/**
* agent 日志文件名称
*/
public static final String AGENT_LOG_FILE_NAME = "machine-monitor-agent.out";

@Value("${machine.monitor.latest.version}")
private void setLatestVersion(String latestVersion) {
MonitorConst.LATEST_VERSION = latestVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import com.orion.lang.utils.Exceptions;
import com.orion.lang.utils.Strings;
import com.orion.lang.utils.Valid;
import com.orion.ops.constant.EnableType;
import com.orion.ops.constant.MessageConst;
import com.orion.ops.constant.common.EnableType;
import lombok.AllArgsConstructor;
import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,25 @@ public enum WsCloseCode {
*/
INVALID_MACHINE(4200, WsCloseReason.CLOSED_CONNECTION),

/**
* 连接远程服务器连接超时
*/
CONNECTION_TIMEOUT(4201, WsCloseReason.CONNECTION_TIMEOUT),

/**
* 连接远程服务器失败
*/
CONNECTED_FAILURE(4202, WsCloseReason.REMOTE_SERVER_UNREACHABLE),
CONNECTION_FAILURE(4202, WsCloseReason.REMOTE_SERVER_UNREACHABLE),

/**
* 远程服务器认证失败
*/
CONNECTED_AUTH_FAILURE(4205, WsCloseReason.REMOTE_SERVER_AUTHENTICATION_FAILURE),
CONNECTION_AUTH_FAILURE(4205, WsCloseReason.REMOTE_SERVER_AUTHENTICATION_FAILURE),

/**
* 远程服务器认证出现异常
*/
CONNECTED_EXCEPTION(4210, WsCloseReason.UNABLE_TO_CONNECT_REMOTE_SERVER),
CONNECTION_EXCEPTION(4210, WsCloseReason.UNABLE_TO_CONNECT_REMOTE_SERVER),

/**
* 机器未启用
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ private WsCloseReason() {

public static final String REMOTE_SERVER_UNREACHABLE = "remote server unreachable...";

public static final String CONNECTION_TIMEOUT = "connection timeout...";

public static final String REMOTE_SERVER_AUTHENTICATION_FAILURE = "remote server authentication failure...";

public static final String MACHINE_DISABLED = "machine disabled...";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.orion.lang.utils.time.Dates;
import com.orion.ops.constant.CnConst;
import com.orion.ops.constant.Const;
import com.orion.ops.constant.StainCode;
import com.orion.ops.constant.common.StainCode;
import com.orion.ops.constant.system.SystemEnvAttr;

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion orion-ops-api/orion-ops-dao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.orion.ops</groupId>
<artifactId>orion-ops-api</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.orion.ops.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.orion.ops.entity.domain.MachineGroupDO;
import org.apache.ibatis.annotations.Param;

/**
* <p>
* 机器分组 Mapper 接口
* </p>
*
* @author Jiahang Li
* @since 2022-09-23
*/
public interface MachineGroupDAO extends BaseMapper<MachineGroupDO> {

/**
* 增加排序值
*
* @param parentId parentId
* @param greaterSort > sort
* @return effect
*/
Integer incrementSort(@Param("parentId") Long parentId, @Param("greaterSort") Integer greaterSort);

/**
* 增加最大 sort
*
* @param parentId parentId
* @return sort
*/
Integer getMaxSort(@Param("parentId") Long parentId);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.orion.ops.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.orion.ops.entity.domain.MachineGroupRelDO;

/**
* <p>
* 机器分组关联表 Mapper 接口
* </p>
*
* @author Jiahang Li
* @since 2022-09-23
*/
public interface MachineGroupRelDAO extends BaseMapper<MachineGroupRelDO> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public class ApplicationReleaseDO implements Serializable {
private Integer releaseStatus;

/**
* @see com.orion.ops.constant.SerialType
* @see com.orion.ops.constant.common.SerialType
*/
@ApiModelProperty(value = "发布序列 10串行 20并行")
@TableField("release_serialize")
private Integer releaseSerialize;

/**
* @see com.orion.ops.constant.ExceptionHandlerType
* @see com.orion.ops.constant.common.ExceptionHandlerType
*/
@ApiModelProperty(value = "异常处理 10跳过所有 20跳过错误")
@TableField("exception_handler")
Expand Down
Loading

0 comments on commit e278ef1

Please sign in to comment.