⚡ 修改配置.
This commit is contained in:
12
README.md
12
README.md
@@ -30,7 +30,7 @@
|
||||
|
||||
**github:** https://github.com/lijiahangmax/orion-ops-pro
|
||||
**gitee:** https://gitee.com/lijiahangmax/orion-ops-pro
|
||||
**文档:** https://lijiahangmax.gitee.io/orion-ops-pro/#/
|
||||
**文档:** https://lijiahangmax.github.io/orion-ops-pro/#/
|
||||
**demo:** http://101.43.254.243:1081/
|
||||
|
||||
演示账号: `admin`
|
||||
@@ -53,11 +53,11 @@
|
||||
|
||||
## 快速开始
|
||||
|
||||
* [docker安装](https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/docker-install)
|
||||
* [普通安装](https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/install)
|
||||
* [更新日志](https://lijiahangmax.gitee.io/orion-ops-pro/#/about/change-log)
|
||||
* [操作手册](https://lijiahangmax.gitee.io/orion-ops-pro/#/operator/asset)
|
||||
* [常见问题](https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/faq)
|
||||
* [docker安装](https://lijiahangmax.github.io/orion-ops-pro/#/quickstart/docker-install)
|
||||
* [普通安装](https://lijiahangmax.github.io/orion-ops-pro/#/quickstart/install)
|
||||
* [更新日志](https://lijiahangmax.github.io/orion-ops-pro/#/about/change-log)
|
||||
* [操作手册](https://lijiahangmax.github.io/orion-ops-pro/#/operator/asset)
|
||||
* [常见问题](https://lijiahangmax.github.io/orion-ops-pro/#/quickstart/faq)
|
||||
|
||||
## 技术栈
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
**github:** https://github.com/lijiahangmax/orion-ops-pro
|
||||
**gitee:** https://gitee.com/lijiahangmax/orion-ops-pro
|
||||
**文档:** https://lijiahangmax.gitee.io/orion-ops-pro/#/
|
||||
**文档:** https://lijiahangmax.github.io/orion-ops-pro/#/
|
||||
**demo:** http://101.43.254.243:1081/
|
||||
|
||||
演示账号: `admin`
|
||||
@@ -53,11 +53,11 @@
|
||||
|
||||
## 快速开始
|
||||
|
||||
* [docker安装](https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/docker-install)
|
||||
* [普通安装](https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/install)
|
||||
* [更新日志](https://lijiahangmax.gitee.io/orion-ops-pro/#/about/change-log)
|
||||
* [操作手册](https://lijiahangmax.gitee.io/orion-ops-pro/#/operator/asset)
|
||||
* [常见问题](https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/faq)
|
||||
* [docker安装](/quickstart/docker-install)
|
||||
* [普通安装](/quickstart/install)
|
||||
* [更新日志](/about/change-log)
|
||||
* [操作手册](/operator/asset)
|
||||
* [常见问题](/quickstart/faq)
|
||||
|
||||
## 技术栈
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* 🐞 修复 查看计划任务日志时提示日志不存在
|
||||
* 🩰 修改 命令执行日志 UI 修改
|
||||
* 🌈 新增 文件传输列表添加操作栏
|
||||
* 🌈 新增 主机在线会话
|
||||
* 🔨 优化
|
||||
|
||||
[如何升级](/update/v1.0.7.md)
|
||||
|
||||
@@ -184,7 +184,7 @@ app:
|
||||
# 自动清理执行文件
|
||||
auto-clear: true
|
||||
# 保留周期 (天)
|
||||
keep-period: 60
|
||||
keep-period: 30
|
||||
|
||||
# orion framework config
|
||||
orion:
|
||||
|
||||
@@ -34,7 +34,7 @@ public class AppExecLogConfig {
|
||||
public AppExecLogConfig() {
|
||||
this.appendAnsi = true;
|
||||
this.autoClear = true;
|
||||
this.keepPeriod = 60;
|
||||
this.keepPeriod = 30;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,16 +31,16 @@ public class ExecCommandAnsiHandler extends BaseExecCommandHandler {
|
||||
super.initLogOutputStream();
|
||||
// 拼接启动日志
|
||||
AnsiAppender appender = AnsiAppender.create()
|
||||
.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "> 准备执行命令 ")
|
||||
.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "> 准备执行命令 ")
|
||||
.append(Dates.current())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "执行记录: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "执行记录: ")
|
||||
.append(execCommand.getLogId())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "执行描述: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "执行描述: ")
|
||||
.append(execCommand.getDescription())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "执行用户: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "执行用户: ")
|
||||
.append(execCommand.getUsername());
|
||||
// 非系统用户执行添加 userId
|
||||
if (Const.SYSTEM_USER_ID.equals(execCommand.getUserId())) {
|
||||
@@ -53,35 +53,35 @@ public class ExecCommandAnsiHandler extends BaseExecCommandHandler {
|
||||
}
|
||||
// 执行序列
|
||||
if (execCommand.getExecSeq() != null) {
|
||||
appender.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "执行序列: ")
|
||||
appender.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "执行序列: ")
|
||||
.append('#')
|
||||
.append(execCommand.getExecSeq())
|
||||
.newLine();
|
||||
}
|
||||
appender.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "执行主机: ")
|
||||
appender.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "执行主机: ")
|
||||
.append(execHostCommand.getHostName())
|
||||
.append(" (")
|
||||
.append(execHostCommand.getHostId())
|
||||
.append(")")
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "主机地址: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "主机地址: ")
|
||||
.append(execHostCommand.getHostAddress())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "超时时间: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "超时时间: ")
|
||||
.append(execCommand.getTimeout())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "脚本执行: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "脚本执行: ")
|
||||
.append(execCommand.getScriptExec())
|
||||
.newLine()
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "> 执行命令 ")
|
||||
.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "> 执行命令 ")
|
||||
.newLine()
|
||||
.append(execHostCommand.getCommand())
|
||||
.newLine()
|
||||
.newLine();
|
||||
// 非脚本执行拼接开始执行日志
|
||||
if (!Booleans.isTrue(execCommand.getScriptExec())) {
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "> 开始执行命令 ")
|
||||
appender.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "> 开始执行命令 ")
|
||||
.append(Dates.current())
|
||||
.newLine();
|
||||
}
|
||||
@@ -94,10 +94,10 @@ public class ExecCommandAnsiHandler extends BaseExecCommandHandler {
|
||||
// 拼接上传日志
|
||||
AnsiAppender startAppender = AnsiAppender.create()
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "> 准备上传脚本 ")
|
||||
.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "> 准备上传脚本 ")
|
||||
.append(Dates.current())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "文件路径: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "文件路径: ")
|
||||
.append(execHostCommand.getScriptPath())
|
||||
.newLine();
|
||||
this.appendLog(startAppender);
|
||||
@@ -105,18 +105,18 @@ public class ExecCommandAnsiHandler extends BaseExecCommandHandler {
|
||||
super.uploadScriptFile();
|
||||
// 拼接完成日志
|
||||
AnsiAppender finishAppender = AnsiAppender.create()
|
||||
.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "< 脚本上传成功 ")
|
||||
.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "< 脚本上传成功 ")
|
||||
.append(Dates.current())
|
||||
.newLine()
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "> 开始执行脚本 ")
|
||||
.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "> 开始执行脚本 ")
|
||||
.append(Dates.current())
|
||||
.newLine();
|
||||
this.appendLog(finishAppender);
|
||||
} catch (Exception e) {
|
||||
// 拼接失败日志
|
||||
AnsiAppender errorAppender = AnsiAppender.create()
|
||||
.append(AnsiForeground.BRIGHT_RED.and(AnsiFont.BOLD), "< 脚本上传失败 ")
|
||||
.append(AnsiForeground.RED.and(AnsiFont.BOLD), "< 脚本上传失败 ")
|
||||
.append(Dates.current())
|
||||
.newLine();
|
||||
this.appendLog(errorAppender);
|
||||
@@ -133,37 +133,37 @@ public class ExecCommandAnsiHandler extends BaseExecCommandHandler {
|
||||
.newLine();
|
||||
if (this.status == ExecHostStatusEnum.INTERRUPTED) {
|
||||
// 中断执行
|
||||
appender.append(AnsiForeground.BRIGHT_YELLOW.and(AnsiFont.BOLD), "< 命令执行中断 ")
|
||||
appender.append(AnsiForeground.YELLOW.and(AnsiFont.BOLD), "< 命令执行中断 ")
|
||||
.append(Dates.current())
|
||||
.newLine();
|
||||
} else if (this.status == ExecHostStatusEnum.FAILED) {
|
||||
// 执行失败
|
||||
appender.append(AnsiForeground.BRIGHT_RED.and(AnsiFont.BOLD), "< 命令执行失败 ")
|
||||
appender.append(AnsiForeground.RED.and(AnsiFont.BOLD), "< 命令执行失败 ")
|
||||
.append(Dates.current())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_RED.and(AnsiFont.BOLD), "错误原因: ")
|
||||
.append(AnsiForeground.RED.and(AnsiFont.BOLD), "错误原因: ")
|
||||
.append(this.getErrorMessage(e))
|
||||
.newLine();
|
||||
} else if (this.status == ExecHostStatusEnum.TIMEOUT) {
|
||||
// 更新执行超时
|
||||
appender.append(AnsiForeground.BRIGHT_YELLOW.and(AnsiFont.BOLD), "< 命令执行超时 ")
|
||||
appender.append(AnsiForeground.YELLOW.and(AnsiFont.BOLD), "< 命令执行超时 ")
|
||||
.append(Dates.current())
|
||||
.newLine();
|
||||
} else {
|
||||
long ms = this.updateRecord.getFinishTime().getTime() - this.updateRecord.getStartTime().getTime();
|
||||
Integer exitStatus = this.updateRecord.getExitStatus();
|
||||
// 执行完成
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), "< 命令执行完成 ")
|
||||
appender.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), "< 命令执行完成 ")
|
||||
.append(Dates.current())
|
||||
.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "exit: ");
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "exit: ");
|
||||
if (ExitCode.isSuccess(exitStatus)) {
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN.and(AnsiFont.BOLD), exitStatus);
|
||||
appender.append(AnsiForeground.GREEN.and(AnsiFont.BOLD), exitStatus);
|
||||
} else {
|
||||
appender.append(AnsiForeground.BRIGHT_RED.and(AnsiFont.BOLD), exitStatus);
|
||||
appender.append(AnsiForeground.RED.and(AnsiFont.BOLD), exitStatus);
|
||||
}
|
||||
appender.newLine()
|
||||
.append(AnsiForeground.BRIGHT_BLUE.and(AnsiFont.BOLD), "used: ")
|
||||
.append(AnsiForeground.BLUE.and(AnsiFont.BOLD), "used: ")
|
||||
.append(Dates.interval(ms, false, "d ", "h ", "m ", "s"))
|
||||
.append(" (")
|
||||
.append(ms)
|
||||
|
||||
@@ -113,7 +113,7 @@ public class HostConnectLogServiceImpl implements HostConnectLogService {
|
||||
|
||||
@Override
|
||||
public Integer updateStatusById(Long id, HostConnectStatusEnum status, Map<String, Object> partial) {
|
||||
log.info("HostConnectLogService-updateStatusByToken start id: {}, status: {}", id, status);
|
||||
log.info("HostConnectLogService-updateStatusById start id: {}, status: {}", id, status);
|
||||
// 查询
|
||||
HostConnectLogDO record = hostConnectLogDAO.of()
|
||||
.createWrapper()
|
||||
@@ -122,7 +122,7 @@ public class HostConnectLogServiceImpl implements HostConnectLogService {
|
||||
.then()
|
||||
.getOne();
|
||||
if (record == null) {
|
||||
log.info("HostConnectLogService-updateStatusByToken no record id: {}", id);
|
||||
log.info("HostConnectLogService-updateStatusById no record id: {}", id);
|
||||
return Const.N_0;
|
||||
}
|
||||
return this.updateStatus(record, status, partial);
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"name": "app.exec-log.keep-period",
|
||||
"type": "java.lang.Integer",
|
||||
"description": "保留周期 (天)",
|
||||
"defaultValue": "60"
|
||||
"defaultValue": "30"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user