diff --git a/README.md b/README.md index 4af61332..792c298c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ orion-ops-pro 是什么 -`orion-ops-pro` 一款开箱即用的一站式智能运维平台, 提供了资产管理、资产授权、Web终端、WebSftp、角色管理、系统管理等功能。致力于简化运维团队的治理工作。它是根据 `orion-ops` -的产品思路完全重构的一套系统, 重新设计了架构并优化交互逻辑, 操作更快捷友好。 +`orion-ops-pro` 是一款现代化、高颜值的一站式智能运维管理平台,集资产管理、资产授权、批量执行、Web终端、WebSftp、角色管理、系统管理等功能于一体,致力于简化运维团队的治理工作。它是基于 `orion-ops` +的产品思路进行重构,技术架构升级,并优化了交互逻辑,让操作更快捷更友好。

@@ -28,32 +28,31 @@
-当前版本: **1.0.1** +当前版本: **1.0.2** github: https://github.com/lijiahangmax/orion-ops-pro gitee: https://gitee.com/lijiahangmax/orion-ops-pro 文档: https://lijiahangmax.gitee.io/orion-ops-pro/#/ -demo: http://101.43.254.243:1081/#/ +demo: http://101.43.254.243:1081/ 演示账号: `admin` 演示密码: `admin` -留个小星星再走吧⭐ +⭐ 体验后可以点一下 `star` 这对我很重要 +📞 合作/功能定制请联系底部 备注: '定制' ## 特性 * 易用便捷: 极简配置, 开箱即用, 支持 Docker 部署方式。 -* 资产管理: 支持灵活配置主机分组, 统一管理主机、秘钥和身份。 -* 资产授权: 可将资产数据授权给指定角色和用户。 +* 资产管理: 支持灵活配置主机分组, 实现对主机、秘钥和身份的统一管理。 +* 资产授权: 可将资产数据授权给指定角色和用户, 确保数据安全性。 * 权限控制: 全面管理用户角色, 支持动态菜单配置和强制下线等功能。 * 在线终端: 提供便捷的在线 Web 终端服务, 支持快捷命令、自定义快捷键和主题风格。 * 文件管理: 实现远程主机大文件的批量上传、下载和在线编辑等操作。 -* 可扩展性: 前后端代码规范统一, 代码质量高、健壮且易于阅读和扩展。 - -[comment]: <> ( FIXME * 批量操作: 支持远程主机批量执行命令 以及 批量执行上传文件) +* 批量操作: 支持远程主机批量执行 shell 命令。 +* 操作日志: 记录用户操作日志,确保操作可追溯, 提高系统安全性。 +* 可扩展性: 前后端代码规范统一、代码质量高、健壮且易于阅读和扩展。 [comment]: <> ( FIXME * 调度任务: 维护 cron 表达式, 定时执行主机命令) -[comment]: <> ( FIXME * 功能强大: 命令批量执行, 任务定时调度, 远程日志查看, 操作日志全记录等) - ## 快速开始 docker安装: https://lijiahangmax.gitee.io/orion-ops-pro/#/quickstart/docker-install @@ -78,32 +77,38 @@ roadmap: https://lijiahangmax.gitee.io/orion-ops-pro/#/about/roadmap > 工作台 -![工作台](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/69328bb3-8a8d-47ca-8a5b-d16c56be704b.png "工作台") +![工作台](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/13d79a89-aadf-4100-8bb3-afb03758001f.png "工作台") > 资产管理 -![主机列表](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/8ca59a20-09b6-48e5-b511-c01319d963df.png "主机列表") -![资产授权](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/a6e48de3-5145-4c48-a6a2-b99208cb1ae1.png "资产授权") +![主机列表](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/d9954335-9afa-4579-b040-a1c3006cb1f0.png "主机列表") +![资产授权](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/ffbdd0e2-4811-4776-a96c-7b5d9b4f3e89.png "资产授权") > 主机终端 -![主机终端](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/7264f870-45c7-4037-9179-6473d254c231.png "主机终端") -![命令片段](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/0803bb07-3776-4de3-bd4a-02931fab7ca7.png "命令片段") -![主题设置](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/89f75025-b0d4-4ccf-b1a7-de311c576ab4.png "主题设置") -![终端设置](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/b6d2da7a-5aaf-4790-b4e9-d8e8428e2122.png "终端设置") -![sftp](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/9c096d5e-3a1c-40e3-b047-1e8725f27726.png "sftp") -![传输列表](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/cebee39c-d5f6-4d82-b4b8-f2734c9a49bf.png "传输列表") +![主机终端](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/de6ae2bb-3d9a-44d6-b530-664febee7dbc.png "主机终端") +![命令片段](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/0a2a8077-fb47-4c87-8327-9d6b93ecc552.png "命令片段") +![主题设置](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/20741d51-af62-40f0-bd6f-6e954d9b0398.png "主题设置") +![终端设置](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/a3bf32bc-26b5-4ec7-b429-54c17ccd136b.png "终端设置") +![sftp](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/0ae07072-1740-4f84-aaf7-c18a8074ce61.png "sftp") +![传输列表](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/ccf880a4-c393-4a35-9f35-fe7572256edd.png "传输列表") + +> 批量执行 + +![批量执行](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/0a222b64-d2c1-481c-99b8-c3a0616d2fab.png "批量执行") +![执行日志](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/06d02d38-70ef-43c2-950c-9f8c73a105ba.png "执行日志") +![执行记录](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/0e474cc2-f7cf-49bc-be3c-f6445783ad7c.png "执行记录") > 用户管理 -![用户列表](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/b9ca5bb6-f88a-43e6-888f-b7259df02521.png "用户列表") -![个人中心](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/6a4985c6-e828-4eb3-96b2-b1ca48df7579.png "个人中心") -![操作日志](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/304c6e12-755e-4ce7-8d37-051676ff6fe9.png "操作日志") +![用户列表](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/0d5f26e0-de4e-4342-800c-30a0d5d3078e.png "用户列表") +![个人中心](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/ed1e5e02-f854-44ee-bb37-ea6e45526457.png "个人中心") +![操作日志](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/ba6f1526-da00-4a3d-a550-470a6b3d2803.png "操作日志") > 系统管理 -![系统菜单](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/89dcd816-7f76-4bed-be4c-79a412dbeba4.png "系统菜单") -![分配菜单](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/ac5ca3da-6874-4655-b192-b88bad6cfa06.png "分配菜单") +![系统菜单](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/5087cd35-6a65-4338-bc87-c81969cdb947.png "系统菜单") +![分配菜单](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/3/22/5a7804ed-179c-4d25-820f-af2af1aabbba.png "分配菜单") ## 联系我 @@ -112,7 +117,8 @@ roadmap: https://lijiahangmax.gitee.io/orion-ops-pro/#/about/roadmap wx -📧 微信添加备注: ops +📧 咨询问题微信备注: ops +📧 合作/功能定制备注: 合作 ## 支持一下 diff --git a/docker-compose.yml b/docker-compose.yml index 691aeb80..f42af95f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.3' services: orion-ops-pro: - image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-ops-pro:1.0.1 + image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-ops-pro:1.0.2 ports: - 1081:80 environment: diff --git a/docker/orion-ops-pro/build.sh b/docker/orion-ops-pro/build.sh index 27408cd7..be4e2a1f 100644 --- a/docker/orion-ops-pro/build.sh +++ b/docker/orion-ops-pro/build.sh @@ -1,3 +1,3 @@ mv ../../orion-ops-launch/target/orion-ops-launch.jar ./ mv ../../orion-ops-ui/dist ./dist -docker build -t orion-ops-pro:1.0.1 . +docker build -t orion-ops-pro:1.0.2 . diff --git a/docs/README.md b/docs/README.md index f1cfb920..72999a33 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,8 +2,9 @@ orion-ops-pro 是什么 -`orion-ops-pro` 一款开箱即用的一站式智能运维平台, 提供了资产管理、资产授权、Web终端、WebSftp、角色管理、系统管理等功能。致力于简化运维团队的治理工作。它是根据 `orion-ops` -的产品思路完全重构的一套系统, 重新设计了架构并优化交互逻辑, 操作更快捷友好。 +`orion-ops-pro` +是一款现代化、高颜值的一站式智能运维管理平台,集资产管理、资产授权、批量执行、Web终端、WebSftp、角色管理、系统管理等功能于一体,致力于简化运维团队的治理工作。它是基于 `orion-ops` +的产品思路进行重构,技术架构升级,并优化了交互逻辑,让操作更快捷更友好。

@@ -28,31 +29,28 @@
-当前版本: **1.0.1** +当前版本: **1.0.2** github: https://github.com/lijiahangmax/orion-ops-pro gitee: https://gitee.com/lijiahangmax/orion-ops-pro 文档: https://lijiahangmax.gitee.io/orion-ops-pro/#/ -demo: http://101.43.254.243:1081/#/ +demo: http://101.43.254.243:1081/ 演示账号: `admin` 演示密码: `admin` -留个小星星再走吧⭐ +⭐ 体验后可以点一下 `star` 这对我很重要 +📞 合作/功能定制请联系底部 备注: '合作' ## 特性 * 易用便捷: 极简配置, 开箱即用, 支持 Docker 部署方式。 -* 资产管理: 支持灵活配置主机分组, 统一管理主机、秘钥和身份。 -* 资产授权: 可将资产数据授权给指定角色和用户。 +* 资产管理: 支持灵活配置主机分组, 实现对主机、秘钥和身份的统一管理。 +* 资产授权: 可将资产数据授权给指定角色和用户, 确保数据安全性。 * 权限控制: 全面管理用户角色, 支持动态菜单配置和强制下线等功能。 * 在线终端: 提供便捷的在线 Web 终端服务, 支持快捷命令、自定义快捷键和主题风格。 * 文件管理: 实现远程主机大文件的批量上传、下载和在线编辑等操作。 -* 可扩展性: 前后端代码规范统一, 代码质量高、健壮且易于阅读和扩展。 - -[comment]: <> ( FIXME * 批量操作: 支持远程主机批量执行命令 以及 批量执行上传文件) - -[comment]: <> ( FIXME * 调度任务: 维护 cron 表达式, 定时执行主机命令) - -[comment]: <> ( FIXME * 功能强大: 命令批量执行, 任务定时调度, 远程日志查看, 操作日志全记录等) +* 批量操作: 支持远程主机批量执行 shell 命令。 +* 操作日志: 记录用户操作日志,确保操作可追溯, 提高系统安全性。 +* 可扩展性: 前后端代码规范统一、代码质量高、健壮且易于阅读和扩展。 ## 快速开始 @@ -94,6 +92,12 @@ roadmap: https://lijiahangmax.gitee.io/orion-ops-pro/#/about/roadmap ![sftp](./assert/img/terminal_sftp.png "sftp") ![传输列表](./assert/img/terminal_transfer.png "传输列表") +> 批量执行 + +![批量执行](./assert/img/batch_exec.png "批量执行") +![执行日志](./assert/img/batch_exec_log.png "执行日志") +![执行记录](./assert/img/batch_exec_record.png "执行记录") + > 用户管理 ![用户列表](./assert/img/user_list.png "用户列表") @@ -112,7 +116,8 @@ roadmap: https://lijiahangmax.gitee.io/orion-ops-pro/#/about/roadmap wx -📧 微信添加备注: ops +📧 咨询问题微信备注: ops +📧 合作/功能定制备注: 合作 ## 支持一下 diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 44f94d9c..22850658 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,4 +1,4 @@ -# orion-ops-pro 1.0.1 +# orion-ops-pro 1.0.2 > 一款开箱即用的运维平台。 diff --git a/docs/_sidebar.md b/docs/_sidebar.md index ddaec6ed..0de2b3b2 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -9,7 +9,7 @@ * [常见问题](quickstart/faq.md) * 操作手册 * [资产管理](operator/asset.md) - * [主机运维](operator/host_ops.md) - * [运维审计](operator/host_audit.md) + * [主机运维](operator/host-ops.md) + * [运维审计](operator/asset-audit.md) * [用户管理](operator/user.md) * [系统管理](operator/system.md) diff --git a/docs/about/change-log.md b/docs/about/change-log.md index 7e5fd687..1d8e9d9f 100644 --- a/docs/about/change-log.md +++ b/docs/about/change-log.md @@ -1,17 +1,36 @@ > 版本号严格遵循 Semver 规范。 +## v1.0.2 + +`2024-03-22` `release` + +* 🐞 修复 SFTP 加载失败后一直 loading +* 🐞 修复 主机终端搜索框报错 +* 🐞 修复 SSH 配置未启用还可以连接 +* 🐞 修复 主机配置保存后无法修改状态 +* 🐞 修复 添加快捷命令时编辑器无代码提示 +* 🔨 修改 菜单路由命名逻辑修改 +* 🔨 优化 前端组件命名规范化 +* 🔨 优化 前端 emit 命名规范化 +* 🌈 新增 双击终端会话 Tab 快速复制 +* 🌈 新增 批量执行命令 +* 🌈 新增 命令执行日志 +* 🌈 新增 执行模板功能 + +[如何升级](/about/update.md?id=_v102) + ## v1.0.1 `2024-03-06` `release` -🐞 修复 用户操作日志条件重置后类型框数据不正常的问题 -🩰 修改 主机连接日志 UI -🌈 新增 SFTP 使用日志列表 -🌈 新增 主机连接日志强制下线会话 -🌈 新增 主机连接日志删除/清理 -🌈 新增 用户操作日志日志删除/清理 -🌈 新增 用户操作日志日志删除/清理 -🔨 优化 用户锁定次数/时间可配置 +* 🐞 修复 用户操作日志条件重置后类型框数据不正常的问题 +* 🩰 修改 主机连接日志 UI +* 🌈 新增 SFTP 使用日志列表 +* 🌈 新增 主机连接日志强制下线会话 +* 🌈 新增 主机连接日志删除/清理 +* 🌈 新增 用户操作日志日志删除/清理 +* 🌈 新增 用户操作日志日志删除/清理 +* 🔨 优化 用户锁定次数/时间可配置 [如何升级](/about/update.md?id=_v101) @@ -19,8 +38,8 @@ `2024-03-01` `release` -🌈 新增 用户自定义终端标签颜色 -🔨 拓展数据模块添加缓存 +* 🌈 新增 用户自定义终端标签颜色 +* 🔨 拓展数据模块添加缓存 [如何升级](/about/update.md?id=_v100) @@ -28,15 +47,15 @@ `2024-02-28` `preview` -🌈 主机管理 -🌈 主机秘钥 -🌈 主机身份 -🌈 资产授权 -🌈 主机终端 -🌈 连接日志 -🌈 角色管理 -🌈 用户管理 -🌈 操作日志 -🌈 系统菜单 -🌈 数据字典项 -🌈 数据字典值 +* 🌈 主机管理 +* 🌈 主机秘钥 +* 🌈 主机身份 +* 🌈 资产授权 +* 🌈 主机终端 +* 🌈 连接日志 +* 🌈 角色管理 +* 🌈 用户管理 +* 🌈 操作日志 +* 🌈 系统菜单 +* 🌈 数据字典项 +* 🌈 数据字典值 diff --git a/docs/about/roadmap.md b/docs/about/roadmap.md index 588f70fd..3a63dc57 100644 --- a/docs/about/roadmap.md +++ b/docs/about/roadmap.md @@ -1,12 +1,12 @@ -## 已完成 ✅ +## 功能排期 ⏳ -## 开发中 ⏱ - -## 未开始 ⏳ - -* 资产管理表结构优化 -* 批量执行 * 定时执行 +* 文件夹书签 +* 文件重复删除/重命名 可配置 +* tracker 可配置 +* 断开连接后回车重新连接 +* template 配置默认主机 +* 批量上传 * 站内消息 * 终端背景图片 * 资产授权 UI 改版 diff --git a/docs/about/update.md b/docs/about/update.md index 89ab7d14..ca5f3904 100644 --- a/docs/about/update.md +++ b/docs/about/update.md @@ -1,5 +1,218 @@ ⚡ 注意: 应用不支持跨版本升级, 可以进行多次升级 +## v1.0.2 + +> sql 脚本 + +```sql +-- 表结构 +ALTER TABLE `host_connect_log` +MODIFY COLUMN `start_time` datetime(3) NULL DEFAULT NULL COMMENT '开始时间' AFTER `token`, +MODIFY COLUMN `end_time` datetime(3) NULL DEFAULT NULL COMMENT '结束时间' AFTER `start_time`; + +CREATE TABLE `exec_host_log` +( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT 'id', + `log_id` bigint(0) NULL DEFAULT NULL COMMENT '执行日志id', + `host_id` bigint(0) NULL DEFAULT NULL COMMENT '主机id', + `host_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主机名称', + `host_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主机地址', + `status` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行状态', + `command` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '执行命令', + `parameter` json NULL COMMENT '执行参数', + `exit_status` int(0) NULL DEFAULT NULL COMMENT '退出码', + `log_path` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日志路径', + `error_message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '错误信息', + `start_time` datetime(3) NULL DEFAULT NULL COMMENT '执行开始时间', + `finish_time` datetime(3) NULL DEFAULT NULL COMMENT '执行结束时间', + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除 0未删除 1已删除', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_log_id` (`log_id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '批量执行主机日志' + ROW_FORMAT = Dynamic; + +CREATE TABLE `exec_log` +( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT 'id', + `user_id` bigint(0) NULL DEFAULT NULL COMMENT '执行用户id', + `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行用户名', + `source` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行来源', + `source_id` bigint(0) NULL DEFAULT NULL COMMENT '执行来源id', + `description` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行描述', + `command` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '执行命令', + `parameter_schema` json NULL COMMENT '参数 schema', + `timeout` int(0) NULL DEFAULT NULL COMMENT '超时时间', + `status` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '执行状态', + `start_time` datetime(3) NULL DEFAULT NULL COMMENT '执行开始时间', + `finish_time` datetime(3) NULL DEFAULT NULL COMMENT '执行完成时间', + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除 0未删除 1已删除', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_user_id` (`user_id`) USING BTREE, + INDEX `idx_source` (`source`, `source_id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '批量执行日志' + ROW_FORMAT = Dynamic; + +CREATE TABLE `exec_template` +( + `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT 'id', + `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名称', + `command` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '命令', + `timeout` int(0) NULL DEFAULT 0 COMMENT '超时时间秒 0不超时', + `parameter` json NULL COMMENT '参数', + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除 0未删除 1已删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_general_ci COMMENT = '执行模板' + ROW_FORMAT = Dynamic; + +-- 菜单配置 +TRUNCATE `system_menu`; +INSERT INTO `system_menu` VALUES (1, 0, '工作台', NULL, 1, 10, 1, 1, 1, 0, 'IconComputer', NULL, 'workplace', '2023-07-28 10:51:50', '2023-09-11 15:27:52', '1', '1', 0); +INSERT INTO `system_menu` VALUES (5, 0, '用户设置', NULL, 1, 700, 1, 1, 1, 0, 'icon-user', NULL, '', '2023-07-28 10:55:38', '2024-03-07 19:03:52', '1', '1', 0); +INSERT INTO `system_menu` VALUES (8, 0, '项目地址 github', NULL, 1, 1000, 1, 1, 1, 0, 'icon-github', 'https://github.com/lijiahangmax/orion-ops-pro', '', '2023-07-28 11:04:59', '2023-10-12 15:21:22', '1', '1', 0); +INSERT INTO `system_menu` VALUES (10, 5, '角色管理', NULL, 2, 10, 1, 1, 1, 0, 'IconUserGroup', '', 'role', '2023-07-28 10:55:52', '2024-03-07 19:10:13', '1', '1', 0); +INSERT INTO `system_menu` VALUES (11, 0, '项目地址 gitee', NULL, 1, 1010, 1, 1, 1, 0, 'icon-gitlab', 'https://gitee.com/lijiahangmax/orion-ops-pro', '', '2023-08-02 18:08:07', '2023-08-11 18:11:34', '1', '1', 0); +INSERT INTO `system_menu` VALUES (12, 0, '系统设置', NULL, 1, 800, 1, 1, 1, 0, 'icon-tool', NULL, '', '2023-08-02 18:24:24', '2024-03-07 19:03:57', '1', '1', 0); +INSERT INTO `system_menu` VALUES (13, 12, '系统菜单', '', 2, 10, 1, 1, 1, 0, 'icon-menu', NULL, 'systemMenu', '2023-08-02 18:29:01', '2024-03-07 22:25:00', '1', '1', 0); +INSERT INTO `system_menu` VALUES (20, 10, '创建角色', 'infra:system-role:create', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:36:54', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (21, 10, '修改角色', 'infra:system-role:update', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:37:33', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (22, 10, '更新状态', 'infra:system-role:update-status', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:37:58', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (23, 10, '查询角色', 'infra:system-role:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:38:26', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (24, 10, '分配菜单', 'infra:system-role:grant-menu', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:39:41', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (25, 10, '删除角色', 'infra:system-role:delete', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:40:45', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (26, 13, '创建菜单', 'infra:system-menu:create', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:41:30', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (27, 13, '修改菜单', 'infra:system-menu:update', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:41:55', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (28, 13, '修改状态', 'infra:system-menu:update-status', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:42:41', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (29, 13, '查询菜单', 'infra:system-menu:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:42:57', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (30, 13, '删除菜单', 'infra:system-menu:delete', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-15 16:43:16', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (48, 5, '用户管理', NULL, 2, 10, 1, 1, 1, 0, 'IconUserAdd', NULL, 'user', '2023-08-16 10:19:24', '2024-03-07 19:10:21', '1', '1', 0); +INSERT INTO `system_menu` VALUES (49, 48, '创建用户', 'infra:system-user:create', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 10:19:24', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (50, 48, '修改用户', 'infra:system-user:update', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 10:19:24', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (51, 48, '查询用户', 'infra:system-user:query', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 10:19:24', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (52, 48, '删除用户', 'infra:system-user:delete', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 10:19:24', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (53, 13, '刷新缓存', 'infra:system-menu:management:refresh-cache', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 10:29:10', '2023-12-27 12:39:48', '1', '1', 0); +INSERT INTO `system_menu` VALUES (60, 48, '修改用户状态', 'infra:system-user:update-status', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 11:49:04', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (61, 48, '分配用户角色', 'infra:system-user:grant-role', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 11:49:23', '2023-10-27 01:20:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (62, 48, '重置用户密码', 'infra:system-user:management:reset-password', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-08-16 11:49:50', '2023-12-27 12:42:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (63, 0, '资产管理', NULL, 1, 300, 1, 1, 1, 0, 'IconStorage', NULL, '', '2023-09-11 14:17:31', '2024-03-07 19:03:39', '1', '1', 0); +INSERT INTO `system_menu` VALUES (64, 63, '主机管理', NULL, 2, 40, 1, 1, 1, 0, 'IconDesktop', NULL, 'hostList', '2023-09-11 14:17:31', '2024-03-07 19:09:20', '1', '1', 0); +INSERT INTO `system_menu` VALUES (65, 64, '查询主机', 'asset:host:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-11 14:17:31', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (66, 64, '创建主机', 'asset:host:create', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-11 14:17:31', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (67, 64, '修改主机', 'asset:host:update', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-11 14:17:31', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (68, 64, '删除主机', 'asset:host:delete', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-11 14:17:31', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (70, 64, '修改配置', 'asset:host:update-config', 3, 60, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-14 16:27:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (72, 63, '主机身份', NULL, 2, 60, 1, 1, 1, 0, 'IconIdcard', NULL, 'hostIdentity', '2023-09-20 11:47:18', '2024-03-07 19:09:31', '1', '1', 0); +INSERT INTO `system_menu` VALUES (73, 72, '查询主机身份', 'asset:host-identity:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (74, 72, '创建主机身份', 'asset:host-identity:create', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (75, 72, '修改主机身份', 'asset:host-identity:update', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (76, 72, '删除主机身份', 'asset:host-identity:delete', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (79, 63, '主机秘钥', NULL, 2, 50, 1, 1, 1, 0, 'IconLock', NULL, 'hostKey', '2023-09-20 11:47:18', '2024-03-07 19:09:26', '1', '1', 0); +INSERT INTO `system_menu` VALUES (80, 79, '查询主机秘钥', 'asset:host-key:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (81, 79, '创建主机秘钥', 'asset:host-key:create', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (82, 79, '修改主机秘钥', 'asset:host-key:update', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (83, 79, '删除主机秘钥', 'asset:host-key:delete', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-10-27 01:15:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (84, 79, '查询主机秘钥详情', 'asset:host-key:query-detail', 3, 50, 1, 1, 1, 0, NULL, NULL, NULL, '2023-09-20 11:47:18', '2023-11-09 15:52:57', '1', '1', 0); +INSERT INTO `system_menu` VALUES (94, 5, '个人中心', NULL, 2, 20, 0, 1, 0, 0, 'IconUser', NULL, 'userInfo', '2023-10-08 18:53:01', '2023-11-02 11:47:34', '1', '1', 0); +INSERT INTO `system_menu` VALUES (97, 12, '数据字典项', NULL, 2, 20, 1, 1, 1, 0, 'IconBook', NULL, 'dictKey', '2023-10-17 11:38:13', '2024-03-07 19:10:45', '1', '1', 0); +INSERT INTO `system_menu` VALUES (99, 97, '创建字典配置项', 'infra:dict-key:create', 3, 110, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:13', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (100, 97, '修改字典配置项', 'infra:dict-key:update', 3, 120, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:13', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (101, 97, '删除字典配置项', 'infra:dict-key:delete', 3, 130, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:13', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (105, 12, '数据字典值', NULL, 2, 30, 1, 1, 1, 0, 'IconNav', NULL, 'dictValue', '2023-10-17 11:38:13', '2024-03-07 19:10:49', '1', '1', 0); +INSERT INTO `system_menu` VALUES (106, 105, '查询字典配置值', 'infra:dict-value:query', 3, 210, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:18', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (107, 105, '创建字典配置值', 'infra:dict-value:create', 3, 220, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:18', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (108, 105, '修改字典配置值', 'infra:dict-value:update', 3, 230, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:18', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (109, 105, '删除字典配置值', 'infra:dict-value:delete', 3, 240, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-17 11:38:18', '2023-10-27 01:16:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (120, 97, '查询字典配置项', 'infra:dict-key:query', 3, 100, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-20 11:27:12', '2023-12-27 18:39:22', '1', '1', 0); +INSERT INTO `system_menu` VALUES (121, 97, '刷新缓存', 'infra:dict-key:management:refresh-cache', 3, 140, 1, 1, 1, 0, NULL, NULL, NULL, '2023-10-27 15:50:04', '2023-12-27 12:40:12', '1', '1', 0); +INSERT INTO `system_menu` VALUES (122, 5, '操作日志', NULL, 2, 30, 1, 1, 1, 0, 'IconCalendarClock', NULL, 'operatorLog', '2023-11-01 14:09:36', '2024-03-07 19:10:30', '1', '1', 0); +INSERT INTO `system_menu` VALUES (123, 122, '查询操作日志', 'infra:operator-log:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-02 11:22:54', '2023-11-02 11:22:54', '1', '1', 0); +INSERT INTO `system_menu` VALUES (124, 48, '查询用户会话', 'infra:system-user:query-session', 3, 50, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-02 11:24:14', '2023-11-02 11:24:14', '1', '1', 0); +INSERT INTO `system_menu` VALUES (125, 48, '下线用户会话', 'infra:system-user:management:offline-session', 3, 60, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-02 11:24:37', '2023-12-27 12:39:17', '1', '1', 0); +INSERT INTO `system_menu` VALUES (126, 48, '查询用户登录日志', 'infra:system-user:login-history', 3, 70, 1, 1, 1, 0, NULL, NULL, NULL, '2023-12-27 15:05:37', '2023-12-27 15:07:19', '1', '1', 0); +INSERT INTO `system_menu` VALUES (129, 64, '编辑主机分组', 'asset:host-group:update', 3, 100, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-13 18:16:32', '2023-12-01 01:47:58', '1', '1', 0); +INSERT INTO `system_menu` VALUES (133, 144, '主机分组授权', 'asset:host-group:grant', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-23 18:08:57', '2023-11-30 22:39:53', '1', '1', 0); +INSERT INTO `system_menu` VALUES (142, 144, '主机秘钥授权', 'asset:host-key:grant', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-30 21:06:13', '2023-11-30 22:39:47', '1', '1', 0); +INSERT INTO `system_menu` VALUES (143, 144, '主机身份授权', 'asset:host-identity:grant', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2023-11-30 21:06:26', '2023-11-30 22:40:11', '1', '1', 0); +INSERT INTO `system_menu` VALUES (144, 63, '资产授权', NULL, 2, 70, 1, 1, 1, 0, 'icon-safe', NULL, 'assetGrant', '2023-11-30 22:38:57', '2023-11-30 22:39:06', '1', '1', 0); +INSERT INTO `system_menu` VALUES (145, 0, '主机运维', NULL, 1, 400, 1, 1, 1, 1, 'IconDesktop', NULL, '', '2023-12-04 23:33:25', '2024-03-07 19:03:46', '1', '1', 0); +INSERT INTO `system_menu` VALUES (146, 145, '主机终端', NULL, 2, 10, 1, 1, 1, 1, 'icon-code-square', NULL, 'terminal', '2023-12-04 23:38:01', '2024-03-07 19:09:44', '1', '1', 0); +INSERT INTO `system_menu` VALUES (148, 152, '连接日志', NULL, 2, 10, 1, 1, 1, 0, 'IconLink', NULL, 'connectLog', '2023-12-26 22:53:07', '2024-03-07 19:09:59', '1', '1', 0); +INSERT INTO `system_menu` VALUES (149, 148, '查询连接日志', 'asset:host-connect-log:management:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-12-26 22:53:08', '2024-03-04 13:40:42', '1', '1', 0); +INSERT INTO `system_menu` VALUES (151, 146, '连接终端', 'asset:host-terminal:access', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-12-27 18:56:33', '2023-12-27 18:56:33', '2', '2', 0); +INSERT INTO `system_menu` VALUES (152, 0, '运维审计', NULL, 1, 410, 1, 1, 1, 0, 'IconSafe', NULL, '', '2024-01-04 17:54:56', '2024-03-07 19:02:28', '1', '1', 0); +INSERT INTO `system_menu` VALUES (153, 148, '删除连接日志', 'asset:host-connect-log:management:delete', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 13:39:46', '2024-03-04 13:40:29', '1', '1', 0); +INSERT INTO `system_menu` VALUES (154, 148, '清空连接日志', 'asset:host-connect-log:management:clear', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 13:40:05', '2024-03-04 13:40:34', '1', '1', 0); +INSERT INTO `system_menu` VALUES (155, 148, '强制断开连接', 'asset:host-connect-log:management:force-offline', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 13:41:02', '2024-03-05 23:32:01', '1', '1', 0); +INSERT INTO `system_menu` VALUES (156, 122, '删除操作日志', 'infra:operator-log:delete', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 17:06:55', '2024-03-04 17:08:22', '1', '1', 0); +INSERT INTO `system_menu` VALUES (157, 122, '清空操作日志', 'infra:operator-log:clear', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 17:07:25', '2024-03-04 17:08:27', '1', '1', 0); +INSERT INTO `system_menu` VALUES (158, 152, 'SFTP 操作日志', NULL, 2, 20, 1, 1, 1, 0, 'IconFile', NULL, 'sftpLog', '2024-03-05 15:30:13', '2024-03-07 19:10:05', '1', '1', 0); +INSERT INTO `system_menu` VALUES (159, 158, '查询 SFTP 操作日志', 'asset:host-sftp-log:management:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-05 15:31:02', '2024-03-05 15:57:20', '1', '1', 0); +INSERT INTO `system_menu` VALUES (160, 158, '删除 SFTP 操作日志', 'asset:host-sftp-log:management:delete', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-05 15:31:17', '2024-03-05 15:57:30', '1', '1', 0); +INSERT INTO `system_menu` VALUES (161, 145, '执行模板', NULL, 2, 50, 1, 1, 1, 0, 'IconBookmark', NULL, 'execTemplate', '2024-03-07 18:32:41', '2024-03-21 14:03:17', '1', '1', 0); +INSERT INTO `system_menu` VALUES (162, 161, '查询执行模板', 'asset:exec-template:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `system_menu` VALUES (163, 161, '创建执行模板', 'asset:exec-template:create', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `system_menu` VALUES (164, 161, '修改执行模板', 'asset:exec-template:update', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `system_menu` VALUES (165, 161, '删除执行模板', 'asset:exec-template:delete', 3, 40, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `system_menu` VALUES (167, 145, '执行记录', NULL, 2, 30, 1, 1, 1, 0, 'icon-history', NULL, 'execLog', '2024-03-13 15:08:23', '2024-03-13 15:28:29', '1', '1', 0); +INSERT INTO `system_menu` VALUES (168, 167, '查询执行记录', 'asset:exec-log:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-03-13 15:14:32', '1', '1', 0); +INSERT INTO `system_menu` VALUES (169, 167, '删除执行记录', 'asset:exec-log:delete', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-03-13 15:32:09', '1', '1', 0); +INSERT INTO `system_menu` VALUES (170, 167, '清理执行记录', 'asset:exec-log:management:clear', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-03-13 15:30:09', '1', '1', 0); +INSERT INTO `system_menu` VALUES (172, 145, '批量执行', NULL, 2, 20, 1, 1, 1, 0, 'icon-thunderbolt', NULL, 'execCommand', '2024-03-13 15:08:23', '2024-03-13 15:29:10', '1', '1', 0); +INSERT INTO `system_menu` VALUES (173, 172, '执行命令', 'asset:exec:exec-command', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:08:23', '2024-03-13 15:25:41', '1', '1', 0); +INSERT INTO `system_menu` VALUES (174, 172, '中断执行', 'asset:exec:interrupt-exec', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-13 15:25:36', '2024-03-13 15:25:57', '1', '1', 0); +INSERT INTO `system_menu` VALUES (175, 145, '执行日志新页面', NULL, 2, 40, 0, 1, 0, 1, 'IconUnorderedList', NULL, 'execLogView', '2024-03-21 14:03:10', '2024-03-21 14:03:10', '1', '1', 0); + +-- 字典配置项 +DELETE FROM `dict_key` WHERE `id` >= 34; +INSERT INTO `dict_key` VALUES (34, 'execStatus', 'STRING', '[{\"name\": \"color\", \"type\": \"STRING\"}]', '批量执行状态', '2024-03-13 15:08:43', '2024-03-13 15:39:46', '1', '1', 0); +INSERT INTO `dict_key` VALUES (35, 'execHostStatus', 'STRING', '[{\"name\": \"color\", \"type\": \"COLOR\"}, {\"name\": \"execColor\", \"type\": \"COLOR\"}]', '主机执行状态', '2024-03-13 15:09:10', '2024-03-17 20:31:07', '1', '1', 0); + +-- 字典配置值 +DELETE FROM `dict_value` WHERE `id` >= 232; +INSERT INTO `dict_value` VALUES (232, 1, 'operatorLogModule', 'asset:exec-template', '执行模板', '{}', 2070, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `dict_value` VALUES (233, 2, 'operatorLogType', 'exec-template:create', '创建执行模板', '{}', 110, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `dict_value` VALUES (234, 2, 'operatorLogType', 'exec-template:update', '更新执行模板', '{}', 120, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `dict_value` VALUES (235, 2, 'operatorLogType', 'exec-template:delete', '删除执行模板', '{}', 130, '2024-03-07 18:32:41', '2024-03-07 18:32:41', '1', '1', 0); +INSERT INTO `dict_value` VALUES (236, 1, 'operatorLogModule', 'asset:exec', '批量执行', '{}', 2080, '2024-03-13 15:08:43', '2024-03-13 15:21:20', '1', '1', 0); +INSERT INTO `dict_value` VALUES (237, 2, 'operatorLogType', 'exec:delete-log', '删除执行记录', '{}', 40, '2024-03-13 15:08:43', '2024-03-18 17:26:43', '1', '1', 0); +INSERT INTO `dict_value` VALUES (238, 2, 'operatorLogType', 'exec:clear-log', '清理执行记录', '{}', 50, '2024-03-13 15:08:43', '2024-03-18 17:26:44', '1', '1', 0); +INSERT INTO `dict_value` VALUES (239, 2, 'operatorLogType', 'exec:delete-host-log', '删除主机执行记录', '{}', 60, '2024-03-13 15:08:43', '2024-03-18 17:26:47', '1', '1', 0); +INSERT INTO `dict_value` VALUES (240, 34, 'execStatus', 'WAITING', '等待中', '{\"color\": \"gray\"}', 10, '2024-03-13 15:08:43', '2024-03-13 15:53:55', '1', '1', 0); +INSERT INTO `dict_value` VALUES (241, 34, 'execStatus', 'RUNNING', '运行中', '{\"color\": \"green\"}', 20, '2024-03-13 15:08:43', '2024-03-13 15:53:55', '1', '1', 0); +INSERT INTO `dict_value` VALUES (242, 34, 'execStatus', 'COMPLETED', '执行完成', '{\"color\": \"arcoblue\"}', 30, '2024-03-13 15:08:43', '2024-03-13 15:53:55', '1', '1', 0); +INSERT INTO `dict_value` VALUES (243, 34, 'execStatus', 'FAILED', '执行失败', '{\"color\": \"red\"}', 40, '2024-03-13 15:08:43', '2024-03-13 15:53:55', '1', '1', 0); +INSERT INTO `dict_value` VALUES (244, 35, 'execHostStatus', 'WAITING', '等待中', '{\"color\": \"gray\", \"execColor\": \"#94D82D\"}', 10, '2024-03-13 15:09:11', '2024-03-19 19:09:53', '1', '1', 0); +INSERT INTO `dict_value` VALUES (245, 35, 'execHostStatus', 'RUNNING', '运行中', '{\"color\": \"green\", \"execColor\": \"#339AF0\"}', 20, '2024-03-13 15:09:11', '2024-03-17 20:50:53', '1', '1', 0); +INSERT INTO `dict_value` VALUES (246, 35, 'execHostStatus', 'COMPLETED', '执行完成', '{\"color\": \"arcoblue\", \"execColor\": \"#5C7CFA\"}', 30, '2024-03-13 15:09:11', '2024-03-17 20:42:17', '1', '1', 0); +INSERT INTO `dict_value` VALUES (247, 35, 'execHostStatus', 'FAILED', '执行失败', '{\"color\": \"red\", \"execColor\": \"#FF6B6B\"}', 40, '2024-03-13 15:09:11', '2024-03-17 20:42:39', '1', '1', 0); +INSERT INTO `dict_value` VALUES (248, 35, 'execHostStatus', 'INTERRUPTED', '已中断', '{\"color\": \"purple\", \"execColor\": \"#845EF7\"}', 60, '2024-03-13 15:09:11', '2024-03-19 19:05:03', '1', '1', 0); +INSERT INTO `dict_value` VALUES (249, 2, 'operatorLogType', 'exec:exec-command', '执行主机命令', '{}', 10, '2024-03-13 15:08:43', '2024-03-18 17:26:31', '1', '1', 0); +INSERT INTO `dict_value` VALUES (250, 2, 'operatorLogType', 'exec:interrupt-exec', '中断执行命令', '{}', 20, '2024-03-13 15:08:43', '2024-03-18 17:26:33', '1', '1', 0); +INSERT INTO `dict_value` VALUES (251, 2, 'operatorLogType', 'exec:interrupt-host', '中断主机命令', '{}', 30, '2024-03-13 15:08:43', '2024-03-18 17:26:34', '1', '1', 0); +INSERT INTO `dict_value` VALUES (252, 2, 'operatorLogType', 'exec:download-host-log', '下载执行日志', '{}', 70, '2024-03-18 17:25:44', '2024-03-18 17:26:49', '1', '1', 0); +INSERT INTO `dict_value` VALUES (253, 35, 'execHostStatus', 'TIMEOUT', '执行超时', '{\"color\": \"orangered\", \"execColor\": \"#fA8C16\"}', 50, '2024-03-19 19:05:56', '2024-03-19 19:08:14', '1', '1', 0); +``` + ## v1.0.1 > sql 脚本 @@ -9,8 +222,8 @@ DROP TABLE IF EXISTS `command_template`; ALTER TABLE `operator_log` ADD INDEX `idx_type`(`type`); -- 菜单配置 DELETE FROM `system_menu` WHERE id IN (148, 149); -INSERT INTO `system_menu` VALUES (148, 152, '连接日志', NULL, 2, 10, 1, 1, 1, 0, 'IconLink', NULL, 'assetAuditConnectLog', '2023-12-26 22:53:07', '2024-03-05 23:31:23', NULL, '1', 0); -INSERT INTO `system_menu` VALUES (149, 148, '查询连接日志', 'asset:host-connect-log:management:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-12-26 22:53:08', '2024-03-04 13:40:42', NULL, '1', 0); +INSERT INTO `system_menu` VALUES (148, 152, '连接日志', NULL, 2, 10, 1, 1, 1, 0, 'IconLink', NULL, 'assetAuditConnectLog', '2023-12-26 22:53:07', '2024-03-05 23:31:23', '1', '1', 0); +INSERT INTO `system_menu` VALUES (149, 148, '查询连接日志', 'asset:host-connect-log:management:query', 3, 10, 1, 1, 1, 0, NULL, NULL, NULL, '2023-12-26 22:53:08', '2024-03-04 13:40:42', '1', '1', 0); INSERT INTO `system_menu` VALUES (152, 0, '运维审计', NULL, 1, 410, 1, 1, 1, 0, 'IconSafe', NULL, 'assetAudit', '2024-01-04 17:54:56', '2024-03-05 23:31:10', '1', '1', 0); INSERT INTO `system_menu` VALUES (153, 148, '删除连接日志', 'asset:host-connect-log:management:delete', 3, 20, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 13:39:46', '2024-03-04 13:40:29', '1', '1', 0); INSERT INTO `system_menu` VALUES (154, 148, '清空连接日志', 'asset:host-connect-log:management:clear', 3, 30, 1, 1, 1, 0, NULL, NULL, NULL, '2024-03-04 13:40:05', '2024-03-04 13:40:34', '1', '1', 0); diff --git a/docs/assert/img/asset_grant.png b/docs/assert/img/asset_grant.png index 221c5d91..d3e025d1 100644 Binary files a/docs/assert/img/asset_grant.png and b/docs/assert/img/asset_grant.png differ diff --git a/docs/assert/img/asset_host_list.png b/docs/assert/img/asset_host_list.png index 07905865..a647a8b1 100644 Binary files a/docs/assert/img/asset_host_list.png and b/docs/assert/img/asset_host_list.png differ diff --git a/docs/assert/img/batch_exec.png b/docs/assert/img/batch_exec.png new file mode 100644 index 00000000..3194ad0f Binary files /dev/null and b/docs/assert/img/batch_exec.png differ diff --git a/docs/assert/img/batch_exec_log.png b/docs/assert/img/batch_exec_log.png new file mode 100644 index 00000000..8d72a172 Binary files /dev/null and b/docs/assert/img/batch_exec_log.png differ diff --git a/docs/assert/img/batch_exec_record.png b/docs/assert/img/batch_exec_record.png new file mode 100644 index 00000000..ca0c89d5 Binary files /dev/null and b/docs/assert/img/batch_exec_record.png differ diff --git a/docs/assert/img/system_menu.png b/docs/assert/img/system_menu.png index 28daf4bb..20e3f594 100644 Binary files a/docs/assert/img/system_menu.png and b/docs/assert/img/system_menu.png differ diff --git a/docs/assert/img/terminal_setting.png b/docs/assert/img/terminal_setting.png index 09d72d9d..4f5b06b3 100644 Binary files a/docs/assert/img/terminal_setting.png and b/docs/assert/img/terminal_setting.png differ diff --git a/docs/assert/img/terminal_sftp.png b/docs/assert/img/terminal_sftp.png index dc5b1b1b..ae452f80 100644 Binary files a/docs/assert/img/terminal_sftp.png and b/docs/assert/img/terminal_sftp.png differ diff --git a/docs/assert/img/terminal_snippet.png b/docs/assert/img/terminal_snippet.png index b6b2215a..bb4afee6 100644 Binary files a/docs/assert/img/terminal_snippet.png and b/docs/assert/img/terminal_snippet.png differ diff --git a/docs/assert/img/terminal_ssh.png b/docs/assert/img/terminal_ssh.png index 7eb19b5f..1b4661dd 100644 Binary files a/docs/assert/img/terminal_ssh.png and b/docs/assert/img/terminal_ssh.png differ diff --git a/docs/assert/img/terminal_theme.png b/docs/assert/img/terminal_theme.png index 59c86b46..9b2a5452 100644 Binary files a/docs/assert/img/terminal_theme.png and b/docs/assert/img/terminal_theme.png differ diff --git a/docs/assert/img/terminal_transfer.png b/docs/assert/img/terminal_transfer.png index 19c3d1e1..be85b875 100644 Binary files a/docs/assert/img/terminal_transfer.png and b/docs/assert/img/terminal_transfer.png differ diff --git a/docs/assert/img/user_grant_menu.png b/docs/assert/img/user_grant_menu.png index 0e275c21..ac67e722 100644 Binary files a/docs/assert/img/user_grant_menu.png and b/docs/assert/img/user_grant_menu.png differ diff --git a/docs/assert/img/user_info.png b/docs/assert/img/user_info.png index 34c93947..e4d9c578 100644 Binary files a/docs/assert/img/user_info.png and b/docs/assert/img/user_info.png differ diff --git a/docs/assert/img/user_list.png b/docs/assert/img/user_list.png index dd68e338..3c040919 100644 Binary files a/docs/assert/img/user_list.png and b/docs/assert/img/user_list.png differ diff --git a/docs/assert/img/user_operator_log.png b/docs/assert/img/user_operator_log.png index d24991d4..63f2fa71 100644 Binary files a/docs/assert/img/user_operator_log.png and b/docs/assert/img/user_operator_log.png differ diff --git a/docs/assert/img/workplace.png b/docs/assert/img/workplace.png index a7ebea62..7547b4f5 100644 Binary files a/docs/assert/img/workplace.png and b/docs/assert/img/workplace.png differ diff --git a/docs/index.html b/docs/index.html index d543b7d4..e2d921d0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - 关于orion-ops-pro + 关于 orion-ops-pro diff --git a/docs/operator/host_audit.md b/docs/operator/asset-audit.md similarity index 91% rename from docs/operator/host_audit.md rename to docs/operator/asset-audit.md index 329f194c..7a05e31d 100644 --- a/docs/operator/host_audit.md +++ b/docs/operator/asset-audit.md @@ -3,7 +3,7 @@ 在主机终端页面打开的 `SSH` `SFTP` 连接都会记录下来。 * 详情: 查看连接详情 -* 断开: 断开连接 +* 断开: 断开会话连接 * 删除: 删除连接记录 * 清理: 根据条件清理数据 diff --git a/docs/operator/host-ops.md b/docs/operator/host-ops.md new file mode 100644 index 00000000..f9059b41 --- /dev/null +++ b/docs/operator/host-ops.md @@ -0,0 +1,111 @@ +### 主机终端 + +主机终端页面 支持 SSH, SFTP。 +打开后默认会进入新建连接页面, 页面的主机数据是用户授权的资产数据。 +鼠标移入列表内的主机上时, 右侧会出现 `打开 SSH` `打开 SFTP` `主机设置` `收藏` 的按钮。 + +> 主机设置 + +* SSH 配置: 可以自定义配置连接主机的 密码/秘钥/身份, 仅对自己生效, 不会修改全局配置, `秘钥` `身份` 数据是用户授权的资产数据 +* 标签颜色: 自定义配置标签的颜色, 可以用来区分环境等 + +> 顶部状态栏 + +* 全屏: 开启或关闭全屏 + +> 左侧状态栏 + +* 新建连接: 新建主机连接 `SSH` `SFTP` +* 快捷键设置: 配置 `全局` `会话` `终端` 的快捷键 +* 显示设置: 配置终端 `显示偏好` `操作栏按钮` `右键菜单` 设置 +* 主题设置: 修改终端主题配色 +* 终端设置: 配置终端 `交互` `插件` `会话` 设置 + +> 右侧状态栏 + +* 命令片段: 自定义快速执行的命令片段, 双击直接执行 +* 传输列表: 打开文件传输列表, 当前会话下, 所有的文件上传下载传输都会显示在这里 +* 截图: 截屏终端并且自动下载 + +> 文件传输 + +点击上传或者下载后会自动添加到传输列表。 + +* 上传: 关闭页面自动清除 +* 下载: 下载完成后自动下载, 关闭页面自动清除 + +> SFTP + +* 预览: 默认只能预览 2MB 以内的普通文件, 这个大小可以在前端 env 文件中修改 `VITE_SFTP_PREVIEW_MB` +* 上传: 如果文件已存在则自动重命名之前的文件 + +> 终端面板 + +⭐ 双击终端标签可快速复制会话 + +### 批量执行 + +批量执行 ssh 主机 shell 脚本。 + +##### 日志面板中有几个内置的快捷键 + +* 回车: `Enter` +* 向上滚动一行: `↑` +* 向上滚动一页: `Home` +* 向下滚动一行: `↓` +* 向下滚动一页: `End` +* 全选: `ctrl` `A` +* 复制: `ctrl` `C` +* 搜索: `ctrl` `F` +* 清空: `ctrl` `L` + +⭐ 内置参数同执行模板参数 + +* 重置: 重置全部参数 +* 执行: 执行所输入的命令 +* 返回: 返回到执行命令页面 +* 从模板中选择: 从模板中选择需要执行的命令 +* 执行历史: 点击历史命令可以快速填入 + +### 执行记录 + +查看批量执行任务记录。 + +* 执行命令: 跳转到批量执行页面 +* 清空: 清空执行记录 +* 删除: 删除执行记录 +* 重新执行: 重新执行此命令 +* 命令: 查看执行时的命令 +* 参数: 查看执行时的参数 +* 日志: 查看执行日志, ctrl + 左键点击会用新页面打开 +* 下载: 下载执行日志 + +### 执行模板 + +用来维护批量执行的命令模板, 支持动态参数, 使用 `@{{ xxx }}` 来替换命令参数。 + +* 新增: 新增执行模板 +* 执行: 打开命令执行框并且带入模板参数 +* 修改: 修改执行模板 +* 删除: 删除执行模板 + +> 内置参数 + +| 参数 | 描述 | +|:----------------|:-------------------------| +| execId | 执行记录id | +| hostId | 执行主机id | +| hostName | 执行主机名称 | +| hostCode | 执行主机编码 | +| hostAddress | 执行主机地址 | +| userId | 执行用户id | +| username | 执行用户名 | +| uuid | 生成任务维度 uuid | +| uuidShort | 生成任务维度 uuid 无 '-' | +| hostUuid | 生成机器维度 uuid | +| hostUuidShort | 生成机器维度 uuid 无 '-' | +| timestampMillis | 时间戳毫秒 | +| timestamp | 时间戳 | +| date | 执行时间 yyyy-MM-dd | +| datetime | 执行时间 yyyy-MM-dd HH:mm:ss | + diff --git a/docs/operator/host_ops.md b/docs/operator/host_ops.md deleted file mode 100644 index c30f8295..00000000 --- a/docs/operator/host_ops.md +++ /dev/null @@ -1,39 +0,0 @@ -### 主机终端 - -主机终端页面 支持 SSH, SFTP。 -打开后默认会进入新建连接页面, 页面的主机数据是用户授权的资产数据。 -鼠标移入列表内的主机上时, 右侧会出现 `打开 SSH` `打开 SFTP` `主机设置` `收藏` 的按钮。 - -> 主机设置 - -* SSH 配置: 可以自定义配置连接主机的 密码/秘钥/身份, 仅对自己生效, 不会修改全局配置, `秘钥` `身份` 数据是用户授权的资产数据 -* 标签颜色: 自定义配置标签的颜色, 可以用来区分环境等 - -> 顶部状态栏 - -* 全屏: 开启或关闭全屏 - -> 左侧状态栏 - -* 新建连接: 新建主机连接 `SSH` `SFTP` -* 快捷键设置: 配置 `全局` `会话` `终端` 的快捷键 -* 显示设置: 配置终端 `显示偏好` `操作栏按钮` `右键菜单` 设置 -* 主题设置: 修改终端主题配色 -* 终端设置: 配置终端 `交互` `插件` `会话` 设置 - -> 右侧状态栏 - -* 命令片段: 自定义快速执行的命令片段, 双击直接执行 -* 传输列表: 打开文件传输列表, 当前会话下, 所有的文件上传下载传输都会显示在这里 -* 截图: 截屏终端并且自动下载 - -> 文件传输 - -点击上传或者下载后会自动添加到传输列表。 - -* 上传: 关闭页面自动清除 -* 下载: 下载完成后自动下载, 关闭页面自动清除 - -> SFTP - -* 预览: 默认只能预览 2MB 以内的普通文件, 这个大小可以在前端 env 文件中修改 `VITE_SFTP_PREVIEW_MB` diff --git a/orion-ops-dependencies/pom.xml b/orion-ops-dependencies/pom.xml index a9fa3653..efaf54b2 100644 --- a/orion-ops-dependencies/pom.xml +++ b/orion-ops-dependencies/pom.xml @@ -14,7 +14,7 @@ https://github.com/lijiahangmax/orion-ops-pro - 1.0.1 + 1.0.2 2.7.17 2.7.15 1.5.0 diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/Const.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/Const.java index 310b86ff..1a7648dd 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/Const.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/Const.java @@ -31,4 +31,6 @@ public interface Const extends com.orion.lang.constant.Const, FieldConst, CnCons Integer DEFAULT_VERSION = 1; + String ERROR_LOG = "error.log"; + } diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ErrorMessage.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ErrorMessage.java index 163be171..6b12efe5 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ErrorMessage.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ErrorMessage.java @@ -75,8 +75,6 @@ public interface ErrorMessage { String SESSION_ABSENT = "会话不存在"; - String CONNECT_ERROR = "连接失败"; - String PATH_NOT_NORMALIZE = "路径不合法"; String OPERATE_ERROR = "操作失败"; @@ -89,4 +87,8 @@ public interface ErrorMessage { String ILLEGAL_STATUS = "当前状态不支持此操作"; + String CHECK_AUTHORIZED_HOST = "请选择已授权的主机"; + + String FILE_READ_ERROR = "文件读取失败"; + } diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ExtraFieldConst.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ExtraFieldConst.java index 90eb93ce..ae955d69 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ExtraFieldConst.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/ExtraFieldConst.java @@ -41,4 +41,6 @@ public interface ExtraFieldConst extends FieldConst { String HOST_NAME = "hostName"; + String LOG_ID = "logId"; + } diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/FieldConst.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/FieldConst.java index 85f0cfa6..2acbaf58 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/FieldConst.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/FieldConst.java @@ -29,6 +29,8 @@ public interface FieldConst { String STATUS = "status"; + String INFO = "info"; + String REL_ID = "relId"; String BEFORE = "before"; @@ -39,6 +41,8 @@ public interface FieldConst { String TARGET = "target"; + String CHARSET = "charset"; + String TOKEN = "token"; String PATH = "path"; diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/OrionOpsProConst.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/OrionOpsProConst.java index 521b02fd..b16037bf 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/OrionOpsProConst.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/constant/OrionOpsProConst.java @@ -12,7 +12,7 @@ public interface OrionOpsProConst { /** * 同 ${orion.version} 迭代时候需要手动更改 */ - String VERSION = "1.0.1"; + String VERSION = "1.0.2"; String GITHUB = "https://github.com/lijiahangmax/orion-ops-pro"; diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/file/FileClient.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/file/FileClient.java index 0da9c6bc..4d807513 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/file/FileClient.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/file/FileClient.java @@ -1,6 +1,7 @@ package com.orion.ops.framework.common.file; import java.io.InputStream; +import java.io.OutputStream; /** * 文件客户端 @@ -65,8 +66,6 @@ public interface FileClient { */ String upload(String path, InputStream in, boolean autoClose, boolean overrideIfExist) throws Exception; - // TODO getOutputStream - /** * 检查文件是否存在 * @@ -102,4 +101,39 @@ public interface FileClient { */ InputStream getContentInputStream(String path) throws Exception; + /** + * 获取文件输出流 + * + * @param path path + * @return stream + * @throws Exception Exception + */ + OutputStream getContentOutputStream(String path) throws Exception; + + /** + * 获取文件输出流 + * + * @param path path + * @param append append + * @return stream + * @throws Exception Exception + */ + OutputStream getContentOutputStream(String path, boolean append) throws Exception; + + /** + * 获取返回路径 用于客户端返回 + * + * @param path path + * @return returnPath + */ + String getReturnPath(String path); + + /** + * 获取实际存储路径 用于服务端的存储 + * + * @param returnPath returnPath + * @return absolutePath + */ + String getAbsolutePath(String returnPath); + } diff --git a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/utils/FileClientUtils.java b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/utils/FileClientUtils.java index 8dec81bd..e0b0f3cf 100644 --- a/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/utils/FileClientUtils.java +++ b/orion-ops-framework/orion-ops-framework-common/src/main/java/com/orion/ops/framework/common/utils/FileClientUtils.java @@ -4,6 +4,7 @@ import com.orion.lang.utils.Exceptions; import com.orion.ops.framework.common.file.FileClient; import java.io.InputStream; +import java.io.OutputStream; /** * 文件客户端工具 @@ -85,8 +86,6 @@ public class FileClientUtils { return delegate.upload(path, in, autoClose, overrideIfExist); } - // TODO getOutputStream - /** * 检查文件是否存在 * @@ -130,6 +129,49 @@ public class FileClientUtils { return delegate.getContentInputStream(path); } + /** + * 获取文件输出流 + * + * @param path path + * @return stream + * @throws Exception Exception + */ + public static OutputStream getContentOutputStream(String path) throws Exception { + return delegate.getContentOutputStream(path); + } + + /** + * 获取文件输出流 + * + * @param path path + * @param append append + * @return stream + * @throws Exception Exception + */ + public static OutputStream getContentOutputStream(String path, boolean append) throws Exception { + return delegate.getContentOutputStream(path, append); + } + + /** + * 获取返回路径 用于客户端返回 + * + * @param path path + * @return returnPath + */ + public static String getReturnPath(String path) { + return delegate.getReturnPath(path); + } + + /** + * 获取实际存储路径 用于服务端的存储 + * + * @param returnPath returnPath + * @return absolutePath + */ + public static String getAbsolutePath(String returnPath) { + return delegate.getAbsolutePath(returnPath); + } + public static void setDelegate(FileClient delegate) { if (FileClientUtils.delegate != null) { // unmodified diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/CodeGenerators.java b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/CodeGenerators.java index 450262ed..5b718a7d 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/CodeGenerators.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/CodeGenerators.java @@ -10,7 +10,6 @@ import com.orion.ops.framework.mybatis.core.generator.template.Table; import com.orion.ops.framework.mybatis.core.generator.template.Template; import java.io.File; -import java.util.concurrent.TimeUnit; /** * 代码生成器 @@ -45,12 +44,28 @@ public class CodeGenerators { // .color("blue", "gray", "red", "green", "white") // .valueUseFields() // .build(), - Template.create("command_snippet", "命令片段", "command") + Template.create("exec_log", "执行记录", "exec") .disableUnitTest() - .cache("command:snippet:group:{}", "命令片段 ${userId}") - .expire(1, TimeUnit.DAYS) - .vue("asset", "command-snippet") - .enableDrawerForm() + .vue("exec", "exec-log") + .enableRowSelection() + .dict("execLogStatus", "status") + .keyName("execStatus") + .field("execStatus") + .fields("WAITING", "RUNNING", "COMPLETED", "FAILED") + .labels("等待中", "运行中", "执行完成", "执行失败") + .color("gray", "green", "arcoblue", "red") + .valueUseFields() + .build(), + Template.create("exec_host_log", "主机执行记录", "exec") + .disableUnitTest() + .vue("exec", "exec-host-log") + .dict("execHostLogStatus", "status") + .keyName("execHostStatus") + .field("execHostStatus") + .fields("WAITING", "RUNNING", "COMPLETED", "FAILED", "INTERRUPTED") + .labels("等待中", "运行中", "执行完成", "执行失败", "已中断") + .color("gray", "green", "arcoblue", "red", "purple") + .valueUseFields() .build(), }; // jdbc 配置 - 使用配置文件 diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGenerator.java b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGenerator.java index eabfd817..bb85f65d 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGenerator.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGenerator.java @@ -346,7 +346,7 @@ public class CodeGenerator implements Executable { // api 文件 new String[]{"/templates/orion-vue-api.ts.vm", "${feature}.ts", "vue/api/${module}"}, // router 文件 - new String[]{"/templates/orion-vue-router.ts.vm", "${module}.${feature}.ts", "vue/router/routes/modules"}, + new String[]{"/templates/orion-vue-router.ts.vm", "${feature}.ts", "vue/router/routes/modules"}, // views index.ts 文件 new String[]{"/templates/orion-vue-views-index.vue.vm", "index.vue", "vue/views/${module}/${feature}"}, // form-modal.vue 文件 diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGeneratorEngine.java b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGeneratorEngine.java index f81f2ea7..3e6d1506 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGeneratorEngine.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/generator/core/CodeGeneratorEngine.java @@ -97,7 +97,7 @@ public class CodeGeneratorEngine extends VelocityTemplateEngine { // http 注释标识 objectMap.put("httpComment", "###"); // 版本 - objectMap.put("since", OrionOpsProConst.VERSION); + objectMap.put("version", OrionOpsProConst.VERSION); // api 注释 Map apiComment = new HashMap<>(12); String comment = tableInfo.getComment(); diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/query/DataQuery.java b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/query/DataQuery.java index ca8ad9c6..afd84b72 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/query/DataQuery.java +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/java/com/orion/ops/framework/mybatis/core/query/DataQuery.java @@ -106,6 +106,10 @@ public class DataQuery { return then; } + public DataQuery limit(IPageRequest page) { + return this.last(Pager.of(page).getSql()); + } + public DataQuery limit(int limit) { return this.last(Const.LIMIT + Const.SPACE + limit); } diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-dto.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-dto.java.vm index 771f8e88..3d86b457 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-dto.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-dto.java.vm @@ -12,7 +12,7 @@ import java.math.*; * $!{table.comment} 缓存对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-key-define.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-key-define.java.vm index 699d5af0..11584b8d 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-key-define.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-cache-key-define.java.vm @@ -13,7 +13,7 @@ import java.util.concurrent.TimeUnit; * $!{table.comment}缓存 key * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ public interface ${type}CacheKeyDefine { diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-controller.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-controller.java.vm index 35611c56..291e3b50 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-controller.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-controller.java.vm @@ -32,7 +32,7 @@ import java.util.List; * $!{table.comment} api * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Tag(name = "${package.ModuleName} - $!{table.comment}服务") diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-convert.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-convert.java.vm index 2c815ac6..f4fb8c3a 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-convert.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-convert.java.vm @@ -13,7 +13,7 @@ import java.util.List; * $!{table.comment} 内部对象转换器 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Mapper diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm index a2057425..b3aa2d5a 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm @@ -12,7 +12,7 @@ import java.math.*; * $!{table.comment} 实体对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-export.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-export.java.vm index 64adece0..0ddc30ed 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-export.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-export.java.vm @@ -15,7 +15,7 @@ import java.math.*; * $!{table.comment} 导出对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-create.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-create.java.vm index 99ac467a..f58ffba9 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-create.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-create.java.vm @@ -18,7 +18,7 @@ import java.math.*; * $!{table.comment} 创建请求对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm index f4a3cbd6..51da4ef1 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm @@ -13,7 +13,7 @@ import java.math.*; * $!{table.comment} 查询请求对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-update.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-update.java.vm index 8e2e91d1..07990061 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-update.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-update.java.vm @@ -18,7 +18,7 @@ import java.math.*; * $!{table.comment} 更新请求对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-vo.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-vo.java.vm index c64f48c4..acce9e4c 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-vo.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-vo.java.vm @@ -11,7 +11,7 @@ import java.math.*; * $!{table.comment} 视图响应对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-mapper.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-mapper.java.vm index 8119cac1..770e9abe 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-mapper.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-mapper.java.vm @@ -11,7 +11,7 @@ import ${mapperAnnotationClass.name}; * $!{table.comment} Mapper 接口 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ #if(${mapperAnnotationClass}) diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-operator-key-define.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-operator-key-define.java.vm index a15138a9..fcd023c0 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-operator-key-define.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-operator-key-define.java.vm @@ -10,7 +10,7 @@ import static com.orion.ops.framework.biz.operator.log.core.enums.OperatorRiskLe * $!{table.comment} 操作日志类型 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Module("${package.ModuleName}:${typeHyphen}") diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm index f76335cd..e4a93487 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm @@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.IOException; #end +import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; @@ -42,7 +43,7 @@ import java.util.stream.Collectors; * $!{table.comment} 服务实现类 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Slf4j @@ -154,6 +155,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} { // 转换 return list.stream() .map(${type}Convert.MAPPER::to) + .sorted(Comparator.comparing(${type}VO::getId).reversed()) .collect(Collectors.toList()); } @@ -276,7 +278,8 @@ public class ${table.serviceImplName} implements ${table.serviceName} { #foreach($field in ${table.fields}) .eq(${type}DO::get${field.capitalName}, searchValue)#if($foreach.hasNext).or()#end #end - ); + ) + .orderByDesc(${type}DO::getId); } } diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service.java.vm index 4b0328e7..09325bf2 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service.java.vm @@ -13,7 +13,7 @@ import java.util.List; * $!{table.comment} 服务类 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ public interface ${table.serviceName} { diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api-impl.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api-impl.java.vm index aff13a6d..b2c9e3c9 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api-impl.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api-impl.java.vm @@ -26,7 +26,7 @@ import java.util.stream.Collectors; * $!{table.comment} 对外服务实现类 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Slf4j diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api.java.vm index efaf4f90..fc139baf 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-api.java.vm @@ -10,7 +10,7 @@ import java.util.List; * $!{table.comment} 对外服务类 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ public interface ${type}Api { diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-convert.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-convert.java.vm index ba1a8c3b..cf59ae28 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-convert.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-convert.java.vm @@ -16,7 +16,7 @@ import java.util.List; * $!{table.comment} 对外服务对象转换器 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Mapper diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-create.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-create.java.vm index 4610872a..114d6da7 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-create.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-create.java.vm @@ -17,7 +17,7 @@ import java.math.*; * $!{table.comment} 创建请求业务对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-query.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-query.java.vm index b2fa3549..3c874142 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-query.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-query.java.vm @@ -15,7 +15,7 @@ import java.math.*; * $!{table.comment} 查询请求业务对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-update.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-update.java.vm index 4f555dc0..56fb99da 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-update.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto-update.java.vm @@ -17,7 +17,7 @@ import java.math.*; * $!{table.comment} 更新请求业务对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto.java.vm index 86a21838..1e43b43d 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-provider-entity-dto.java.vm @@ -11,7 +11,7 @@ import java.math.*; * $!{table.comment} 业务对象 * * @author ${author} - * @version ${since} + * @version ${version} * @since ${date} */ @Data diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-api-impl-tests.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-api-impl-tests.java.vm index fa06a360..9363ef7e 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-api-impl-tests.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-api-impl-tests.java.vm @@ -20,9 +20,9 @@ import static org.junit.jupiter.api.Assertions.*; /** * $!{table.comment} 对外服务单元测试 * - * @author Jiahang Li - * @version 1.0.0 - * @since 2023/8/23 10:36 + * @author ${author} + * @version ${version} + * @since ${date} */ @Slf4j @Import({${type}ApiImpl.class, ${type}ServiceImpl.class}) diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-service-impl-tests.java.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-service-impl-tests.java.vm index 826d4642..4bb0728c 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-service-impl-tests.java.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-test-service-impl-tests.java.vm @@ -21,9 +21,9 @@ import static org.junit.jupiter.api.Assertions.*; /** * $!{table.comment} 服务单元测试 * - * @author Jiahang Li - * @version 1.0.0 - * @since 2023/8/23 10:36 + * @author ${author} + * @version ${version} + * @since ${date} */ @Slf4j @Import(${type}ServiceImpl.class) diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-sql-menu.sql.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-sql-menu.sql.vm index a6cbc96a..ea55ea5b 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-sql-menu.sql.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-sql-menu.sql.vm @@ -2,31 +2,31 @@ -- 父菜单 INSERT INTO system_menu - (parent_id, name, type, sort, visible, status, cache, component) + (parent_id, name, type, sort, visible, status, cache, creator, updater, deleted) VALUES - (0, '${table.comment}管理', 1, 10, 1, 1, 1, '$vue.moduleEntityFirstLower'); + (0, '${table.comment}管理', 1, 10, 1, 1, 1, '1', '1', 0); -- 设置临时父菜单id SELECT @TMP_PARENT_ID:=LAST_INSERT_ID(); -- 子菜单 INSERT INTO system_menu - (parent_id, name, type, sort, visible, status, cache, component) + (parent_id, name, type, sort, visible, status, cache, component, creator, updater, deleted) VALUES - (@TMP_PARENT_ID, '$table.comment', 2, 10, 1, 1, 1, '$vue.moduleEntityFirstLower$vue.featureEntity'); + (@TMP_PARENT_ID, '$table.comment', 2, 10, 1, 1, 1, '$vue.featureEntityFirstLower', '1', '1', 0); -- 设置临时子菜单id SELECT @TMP_SUB_ID:=LAST_INSERT_ID(); -- 功能 INSERT INTO system_menu - (parent_id, name, permission, type, sort) + (parent_id, name, permission, type, sort, creator, updater, deleted) VALUES - (@TMP_SUB_ID, '查询$table.comment', '${package.ModuleName}:${typeHyphen}:query', 3, 10), - (@TMP_SUB_ID, '创建$table.comment', '${package.ModuleName}:${typeHyphen}:create', 3, 20), - (@TMP_SUB_ID, '修改$table.comment', '${package.ModuleName}:${typeHyphen}:update', 3, 30), - (@TMP_SUB_ID, '删除$table.comment', '${package.ModuleName}:${typeHyphen}:delete', 3, 40); + (@TMP_SUB_ID, '查询$table.comment', '${package.ModuleName}:${typeHyphen}:query', 3, 10, '1', '1', 0), + (@TMP_SUB_ID, '创建$table.comment', '${package.ModuleName}:${typeHyphen}:create', 3, 20, '1', '1', 0), + (@TMP_SUB_ID, '修改$table.comment', '${package.ModuleName}:${typeHyphen}:update', 3, 30, '1', '1', 0), + (@TMP_SUB_ID, '删除$table.comment', '${package.ModuleName}:${typeHyphen}:delete', 3, 40, '1', '1', 0); #if(false) - (@TMP_SUB_ID, '导出$table.comment', '${package.ModuleName}:${typeHyphen}:export', 3, 50), - (@TMP_SUB_ID, '导入$table.comment', '${package.ModuleName}:${typeHyphen}:import', 3, 60); + (@TMP_SUB_ID, '导出$table.comment', '${package.ModuleName}:${typeHyphen}:export', 3, 50, '1', '1', 0), + (@TMP_SUB_ID, '导入$table.comment', '${package.ModuleName}:${typeHyphen}:import', 3, 60, '1', '1', 0); #end diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-router.ts.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-router.ts.vm index fdb2d039..22c2d775 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-router.ts.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-router.ts.vm @@ -2,13 +2,13 @@ import type { AppRouteRecordRaw } from '../types'; import { DEFAULT_LAYOUT } from '../base'; const $vue.moduleConst: AppRouteRecordRaw = { - name: '$vue.moduleEntityFirstLower', - path: '/$vue.module', + name: '${vue.moduleEntityFirstLower}Module', + path: '/${vue.moduleEntityFirstLower}-module', component: DEFAULT_LAYOUT, children: [ { - name: '$vue.moduleEntityFirstLower$vue.featureEntity', - path: '/$vue.module/$vue.feature', + name: '$vue.featureEntityFirstLower', + path: '/$vue.feature', component: () => import('@/views/$vue.module/$vue.feature/index.vue'), }, ], diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm index e4bd436e..cdc0e27f 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm @@ -20,7 +20,6 @@ size="small" ref="formRef" label-align="right" - :style="{ width: '320px' }" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }" @keyup.enter="() => fetchCardData()"> @@ -111,7 +110,7 @@ @@ -135,8 +134,6 @@ const emits = defineEmits(['openAdd', 'openUpdate']); - const list = ref<${vue.featureEntity}QueryResponse[]>([]); - const cardColLayout = useColLayout(); const pagination = usePagination(); const { loading, setLoading } = useLoading(); @@ -144,6 +141,7 @@ const { toOptions, getDictValue } = useDictStore(); #end + const list = ref<${vue.featureEntity}QueryResponse[]>([]); const formRef = ref(); const formModel = reactive<${vue.featureEntity}QueryRequest>({ searchValue: undefined, diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm index 437a9410..b5e4c98c 100644 --- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm +++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm @@ -1,19 +1,18 @@ @@ -147,7 +148,7 @@ import { useRowSelection } from '@/types/table'; import { dateFormat } from '@/utils'; import { setAutoFocus } from '@/utils/dom'; - import useCopy from '@/hooks/copy'; + import { copy } from '@/hooks/copy'; import columns from './types/table.columns'; import { FILE_TYPE, openSftpChmodModalKey, openSftpMoveModalKey } from '../../types/terminal.const'; @@ -166,7 +167,6 @@ const openSftpChmodModal = inject(openSftpChmodModalKey) as (sessionId: string, path: string, permission: number) => void; const rowSelection = useRowSelection({ width: 40 }); - const { copy } = useCopy(); // 切换页面自动清空过滤 watch(() => props.list, () => { diff --git a/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue b/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue index cdc2cd4c..a080883c 100644 --- a/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue +++ b/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-view.vue @@ -190,10 +190,10 @@ // 关闭回调 const onClose = (forceClose: string, msg: string) => { - console.log(forceClose); - console.log(msg); closed.value = true; closeMessage.value = msg; + setTableLoading(false); + setEditorLoading(false); }; // 接收列表回调 diff --git a/orion-ops-ui/src/views/host/terminal/components/ssh/ssh-view.vue b/orion-ops-ui/src/views/host/terminal/components/ssh/ssh-view.vue index cc1f8d67..a85534cf 100644 --- a/orion-ops-ui/src/views/host/terminal/components/ssh/ssh-view.vue +++ b/orion-ops-ui/src/views/host/terminal/components/ssh/ssh-view.vue @@ -44,9 +44,10 @@

- +
@@ -70,18 +71,17 @@ import type { ISshSession, TerminalTabItem, SidebarAction } from '../../types/terminal.type'; import { computed, onMounted, onUnmounted, ref } from 'vue'; import { useDictStore, useTerminalStore } from '@/store'; - import useCopy from '@/hooks/copy'; + import { copy } from '@/hooks/copy'; import { ActionBarItems, connectStatusKey } from '../../types/terminal.const'; + import ShellEditorModal from '@/components/view/shell-editor/modal/index.vue'; import IconActions from '../layout/icon-actions.vue'; - import ShellEditorModal from '@/components/view/shell-editor/shell-editor-modal.vue'; - import SshSearchModal from './ssh-search-modal.vue'; import SshContextMenu from './ssh-context-menu.vue'; + import XtermSearchModal from '@/components/xtrem/search-modal/index.vue'; const props = defineProps<{ tab: TerminalTabItem }>(); - const { copy } = useCopy(); const { getDictValue } = useDictStore(); const { preference, sessionManager } = useTerminalStore(); @@ -252,4 +252,15 @@ } } + .search-modal { + --bg-focus: var(--search-bg-focus); + --bg: var(--search-bg); + --color-text: var(--search-color-text); + --color-text-focus: var(--search-color-text-focus); + --bg-icon-hover: var(--search-bg-icon-hover); + --bg-icon-hover-focus: var(--search-bg-icon-hover-focus); + --bg-icon-selected: var(--search-bg-icon-selected); + --bg-icon-selected-focus: var(--search-bg-icon-selected-focus); + } + diff --git a/orion-ops-ui/src/views/host/terminal/handler/sftp-transfer-manager.ts b/orion-ops-ui/src/views/host/terminal/handler/sftp-transfer-manager.ts index fb1a68de..ec26b22e 100644 --- a/orion-ops-ui/src/views/host/terminal/handler/sftp-transfer-manager.ts +++ b/orion-ops-ui/src/views/host/terminal/handler/sftp-transfer-manager.ts @@ -3,7 +3,7 @@ import { ISftpTransferDownloader, SftpFile, TransferOperatorResponse } from '../ import { TransferReceiverType, TransferStatus, TransferType } from '../types/terminal.const'; import { Message } from '@arco-design/web-vue'; import { getTerminalAccessToken } from '@/api/asset/host-terminal'; -import { nextId } from '@/utils'; +import { createWebSocket, nextId } from '@/utils'; import { webSocketBaseUrl } from '@/utils/env'; import SftpTransferUploader from './sftp-transfer-uploader'; import SftpTransferDownloader from './sftp-transfer-downloader'; @@ -98,11 +98,12 @@ export default class SftpTransferManager implements ISftpTransferManager { // 获取 access const { data: accessToken } = await getTerminalAccessToken(); // 打开会话 - this.client = new WebSocket(`${webSocketBaseUrl}/host/transfer/${accessToken}`); - this.client.onerror = event => { + try { + this.client = await createWebSocket(`${webSocketBaseUrl}/host/transfer/${accessToken}`); + } catch (e) { // 打开失败将传输列表置为失效 Message.error('会话打开失败'); - console.error('error', event); + console.error('transfer error', e); // 将等待中和传输中任务修改为失败状态 this.transferList.filter(s => { return s.status === TransferStatus.WAITING @@ -110,17 +111,18 @@ export default class SftpTransferManager implements ISftpTransferManager { }).forEach(s => { s.status = TransferStatus.ERROR; }); - }; + // 关闭会话重置 run + this.run = false; + return; + } this.client.onclose = event => { // 关闭会话重置 run this.run = false; - console.warn('close', event); - }; - this.client.onopen = () => { - // 打开后自动传输下一个任务 - this.transferNextItem(); + console.warn('transfer close', event); }; this.client.onmessage = this.resolveMessage.bind(this); + // 打开后自动传输下一个任务 + this.transferNextItem(); } // 传输下一条任务 diff --git a/orion-ops-ui/src/views/host/terminal/handler/ssh-session.ts b/orion-ops-ui/src/views/host/terminal/handler/ssh-session.ts index 3de8329d..aa39e2a0 100644 --- a/orion-ops-ui/src/views/host/terminal/handler/ssh-session.ts +++ b/orion-ops-ui/src/views/host/terminal/handler/ssh-session.ts @@ -176,7 +176,9 @@ export default class SshSession implements ISshSession { } // 加载插件 for (const addon of Object.values(this.addons)) { - this.inst.loadAddon(addon); + if (addon) { + this.inst.loadAddon(addon); + } } } @@ -244,6 +246,7 @@ export default class SshSession implements ISshSession { // 卸载终端 this.inst.dispose(); } catch (e) { + // 卸载可能会报错 } } diff --git a/orion-ops-ui/src/views/host/terminal/handler/terminal-channel.ts b/orion-ops-ui/src/views/host/terminal/handler/terminal-channel.ts index 5a4a665f..de2881d5 100644 --- a/orion-ops-ui/src/views/host/terminal/handler/terminal-channel.ts +++ b/orion-ops-ui/src/views/host/terminal/handler/terminal-channel.ts @@ -2,7 +2,7 @@ import type { InputPayload, ITerminalChannel, ITerminalOutputProcessor, ITermina import { OutputProtocol } from '../types/terminal.protocol'; import { getTerminalAccessToken } from '@/api/asset/host-terminal'; import { Message } from '@arco-design/web-vue'; -import { sleep } from '@/utils'; +import { createWebSocket } from '@/utils'; import { webSocketBaseUrl } from '@/utils/env'; import TerminalOutputProcessor from './terminal-output-processor'; @@ -22,22 +22,17 @@ export default class TerminalChannel implements ITerminalChannel { // 获取 access const { data: accessToken } = await getTerminalAccessToken(); // 打开会话 - this.client = new WebSocket(`${webSocketBaseUrl}/host/terminal/${accessToken}`); - this.client.onerror = event => { + try { + this.client = await createWebSocket(`${webSocketBaseUrl}/host/terminal/${accessToken}`); + } catch (e) { Message.error('无法连接至服务器'); - console.error('error', event); - }; + console.error('terminal error', e); + throw e; + } this.client.onclose = event => { - console.warn('close', event); + console.warn('terminal close', event); }; this.client.onmessage = this.handlerMessage.bind(this); - // 等待会话连接 - for (let i = 0; i < 100; i++) { - await sleep(50); - if (this.client.readyState !== WebSocket.CONNECTING) { - break; - } - } } // 是否已连接 diff --git a/orion-ops-ui/src/views/host/terminal/handler/terminal-output-processor.ts b/orion-ops-ui/src/views/host/terminal/handler/terminal-output-processor.ts index def2aa51..5dadd999 100644 --- a/orion-ops-ui/src/views/host/terminal/handler/terminal-output-processor.ts +++ b/orion-ops-ui/src/views/host/terminal/handler/terminal-output-processor.ts @@ -47,6 +47,7 @@ export default class TerminalOutputProcessor implements ITerminalOutputProcessor }); } else { // 未成功提示错误信息 + session.resolver?.onClose('0', msg); Message.error(msg || '建立 SFTP 失败'); } } @@ -75,6 +76,7 @@ export default class TerminalOutputProcessor implements ITerminalOutputProcessor session.connect(); } else { // 未成功提示错误信息 + session.resolver?.onClose('0', msg); Message.error(msg || '打开 SFTP 失败'); } } diff --git a/orion-ops-ui/src/views/host/terminal/index.vue b/orion-ops-ui/src/views/host/terminal/index.vue index 08bc5d86..e86be55d 100644 --- a/orion-ops-ui/src/views/host/terminal/index.vue +++ b/orion-ops-ui/src/views/host/terminal/index.vue @@ -27,7 +27,7 @@ @@ -70,7 +70,7 @@ // 加载字典值 onBeforeMount(async () => { - await dictStore.loadKeys([...dictKeys]); + await dictStore.loadKeys(dictKeys); }); // 加载主机信息 diff --git a/orion-ops-ui/src/views/system/dict-key/components/dict-key-form-modal.vue b/orion-ops-ui/src/views/system/dict-key/components/dict-key-form-modal.vue index 1f841b34..2b5348d7 100644 --- a/orion-ops-ui/src/views/system/dict-key/components/dict-key-form-modal.vue +++ b/orion-ops-ui/src/views/system/dict-key/components/dict-key-form-modal.vue @@ -1,7 +1,5 @@