@@ -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
> 工作台
-
+
> 资产管理
-
-
+
+
> 主机终端
-
-
-
-
-
-
+
+
+
+
+
+
+
+> 批量执行
+
+
+
+
> 用户管理
-
-
-
+
+
+
> 系统管理
-
-
+
+
## 联系我
@@ -112,7 +117,8 @@ roadmap: https://lijiahangmax.gitee.io/orion-ops-pro/#/about/roadmap
-📧 微信添加备注: 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


+> 批量执行
+
+
+
+
+
> 用户管理

@@ -112,7 +116,8 @@ roadmap: https://lijiahangmax.gitee.io/orion-ops-pro/#/about/roadmap
-📧 微信添加备注: 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 @@
-
+
#foreach($field in ${table.fields})
@@ -37,7 +36,7 @@
#else
+ allow-clear />
#end
#end
@@ -50,7 +49,7 @@
@@ -71,6 +70,8 @@
import { useDictStore } from '@/store';
#end
+ const emits = defineEmits(['added', 'updated']);
+
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
#if($dictMap.entrySet().size() > 0)
@@ -79,6 +80,8 @@
const title = ref();
const isAddHandle = ref(true);
+ const formRef = ref();
+ const formModel = ref<${vue.featureEntity}UpdateRequest>({});
const defaultForm = (): ${vue.featureEntity}UpdateRequest => {
return {
@@ -88,11 +91,6 @@
};
};
- const formRef = ref();
- const formModel = ref<${vue.featureEntity}UpdateRequest>({});
-
- const emits = defineEmits(['added', 'updated']);
-
// 打开新增
const openAdd = () => {
title.value = '添加${table.comment}';
diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm
index 336cd890..ebda1055 100644
--- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm
+++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm
@@ -16,8 +16,7 @@
#foreach($field in ${table.fields})
@@ -54,7 +53,7 @@
@@ -75,6 +74,8 @@
import { useDictStore } from '@/store';
#end
+ const emits = defineEmits(['added', 'updated']);
+
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
#if($dictMap.entrySet().size() > 0)
@@ -83,6 +84,8 @@
const title = ref();
const isAddHandle = ref(true);
+ const formRef = ref();
+ const formModel = ref<${vue.featureEntity}UpdateRequest>({});
const defaultForm = (): ${vue.featureEntity}UpdateRequest => {
return {
@@ -92,11 +95,6 @@
};
};
- const formRef = ref();
- const formModel = ref<${vue.featureEntity}UpdateRequest>({});
-
- const emits = defineEmits(['added', 'updated']);
-
// 打开新增
const openAdd = () => {
title.value = '添加${table.comment}';
diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm
index 24d32c87..6426aa76 100644
--- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm
+++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-table.vue.vm
@@ -8,7 +8,7 @@
@keyup.enter="() => fetchTableData()">
#foreach($field in ${table.fields})
-
+
#if(${dictMap.containsKey(${field.propertyName})})
fetchTableData(page, pagination.pageSize)"
- @page-size-change="(size) => fetchTableData(1, size)"
- :bordered="false">
+ @page-size-change="(size) => fetchTableData(1, size)">
#foreach($field in ${table.fields})
#if(${dictMap.containsKey(${field.propertyName})})
- {{ getDictValue($dictMap.get(${field.propertyName}).keyField, record.${field.propertyName}}) }}
+ {{ getDictValue($dictMap.get(${field.propertyName}).keyField, record.${field.propertyName}) }}
#end
#end
@@ -130,7 +130,7 @@
@@ -157,11 +157,6 @@
const emits = defineEmits(['openAdd', 'openUpdate']);
- #if($vue.enableRowSelection)
- const selectedKeys = ref([]);
- #end
- const tableRenderData = ref<${vue.featureEntity}QueryResponse[]>([]);
-
const pagination = usePagination();
#if($vue.enableRowSelection)
const rowSelection = useRowSelection();
@@ -171,6 +166,10 @@
const { toOptions, getDictValue } = useDictStore();
#end
+ #if($vue.enableRowSelection)
+ const selectedKeys = ref([]);
+ #end
+ const tableRenderData = ref<${vue.featureEntity}QueryResponse[]>([]);
const formModel = reactive<${vue.featureEntity}QueryRequest>({
#foreach($field in ${table.fields})
${field.propertyName}: undefined,
diff --git a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-index.vue.vm b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-index.vue.vm
index 40d5aa41..06ce09e3 100644
--- a/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-index.vue.vm
+++ b/orion-ops-framework/orion-ops-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-index.vue.vm
@@ -4,18 +4,18 @@
<${vue.feature}-table v-if="renderTable"
ref="table"
- @openAdd="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
- @openUpdate="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
+ @open-add="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
+ @open-update="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
<${vue.feature}-card-list v-else
ref="card"
- @openAdd="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
- @openUpdate="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
+ @open-add="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
+ @open-update="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
#else
<${vue.feature}-table ref="table"
- @openAdd="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
- @openUpdate="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
+ @open-add="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
+ @open-update="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
#end
#if($vue.enableDrawerForm)
@@ -33,20 +33,11 @@
+
+
+
+
diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue b/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue
new file mode 100644
index 00000000..d1606791
--- /dev/null
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/components/host-table.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+ {{ emptyMessage }}
+
+
+
+
+ {{ record.name }}
+
+
+
+ {{ record.code }}
+
+
+
+ {{ record.address }}
+
+
+
+
+
+ {{ tag.name }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue b/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
new file mode 100644
index 00000000..c0e35a8e
--- /dev/null
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ label }}
+
+
+
+ {{ label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/types/const.ts b/orion-ops-ui/src/components/asset/host/authorized-host-modal/types/const.ts
new file mode 100644
index 00000000..ef57d029
--- /dev/null
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/types/const.ts
@@ -0,0 +1,15 @@
+// 新建连接类型
+export const NewConnectionType = {
+ GROUP: 'group',
+ LIST: 'list',
+ FAVORITE: 'favorite',
+ LATEST: 'latest'
+};
+
+// 新建连接类型
+export const newConnectionTypeKey = 'hostNewConnectionType';
+
+// 加载的字典值
+export const dictKeys = [
+ newConnectionTypeKey,
+];
diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/types/table.columns.ts b/orion-ops-ui/src/components/asset/host/authorized-host-modal/types/table.columns.ts
new file mode 100644
index 00000000..d0ee6680
--- /dev/null
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/types/table.columns.ts
@@ -0,0 +1,22 @@
+import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
+
+const columns = [
+ {
+ title: '主机名称',
+ dataIndex: 'name',
+ slotName: 'name',
+ ellipsis: true,
+ tooltip: true
+ }, {
+ title: '主机地址',
+ dataIndex: 'address',
+ slotName: 'address',
+ }, {
+ title: '主机标签',
+ dataIndex: 'tags',
+ slotName: 'tags',
+ align: 'left',
+ },
+] as TableColumnData[];
+
+export default columns;
diff --git a/orion-ops-ui/src/components/asset/host/host-selector.vue b/orion-ops-ui/src/components/asset/host/selector/index.vue
similarity index 100%
rename from orion-ops-ui/src/components/asset/host/host-selector.vue
rename to orion-ops-ui/src/components/asset/host/selector/index.vue
diff --git a/orion-ops-ui/src/components/exec/log/panel-modal/index.vue b/orion-ops-ui/src/components/exec/log/panel-modal/index.vue
new file mode 100644
index 00000000..2a3de79b
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel-modal/index.vue
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/exec/log/panel/const.ts b/orion-ops-ui/src/components/exec/log/panel/const.ts
new file mode 100644
index 00000000..0d5ab27b
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel/const.ts
@@ -0,0 +1,140 @@
+import type { IDisposable, ITerminalInitOnlyOptions, ITerminalOptions, Terminal } from 'xterm';
+import type { FitAddon } from 'xterm-addon-fit';
+import type { SearchAddon } from 'xterm-addon-search';
+import type { WebLinksAddon } from 'xterm-addon-web-links';
+import type { WebglAddon } from 'xterm-addon-webgl';
+
+// appender 配置
+export const AppenderOptions: ITerminalOptions & ITerminalInitOnlyOptions = {
+ theme: {
+ foreground: '#FFFFFF',
+ background: '#202020',
+ selectionBackground: '#B5D5FF',
+ },
+ cols: 30,
+ rows: 8,
+ rightClickSelectsWord: true,
+ disableStdin: true,
+ cursorStyle: 'bar',
+ cursorBlink: false,
+ fastScrollModifier: 'alt',
+ fontSize: 14,
+ lineHeight: 1.08,
+ convertEol: true,
+};
+
+// dom 引用
+export interface LogDomRef {
+ id: number;
+ el: HTMLElement;
+ openSearch: () => {};
+}
+
+// appender 配置
+export interface LogAppenderConf {
+ id: number;
+ el: HTMLElement;
+ openSearch: () => {};
+ terminal: Terminal;
+ addons: LogAddons;
+}
+
+// appender 插件
+export interface LogAddons extends Record {
+ fit: FitAddon;
+ webgl: WebglAddon;
+ search: SearchAddon;
+ weblink: WebLinksAddon;
+}
+
+// 执行日志 appender 定义
+export interface ILogAppender {
+ // 初始化
+ init(refs: Array): Promise;
+
+ // 设置当前元素
+ setCurrent(id: number): void;
+
+ // 打开搜索
+ openSearch(): void;
+
+ // 查找关键字
+ find(word: string, next: boolean, options: any): void;
+
+ // 聚焦
+ focus(): void;
+
+ // 自适应
+ fitAll(): void;
+
+ // 去顶部
+ toTop(): void;
+
+ // 去底部
+ toBottom(): void;
+
+ // 添加字体大小
+ addFontSize(addSize: number): void;
+
+ // 复制
+ copy(): void;
+
+ // 复制全部
+ copyAll(): void;
+
+ // 选中全部
+ selectAll(): void;
+
+ // 清空
+ clear(): void;
+
+ // 关闭 client
+ closeClient(): void;
+
+ // 关闭 view
+ closeView(): void;
+
+ // 关闭
+ close(): void;
+}
+
+/**
+ * 批量执行状态
+ */
+export const execStatus = {
+ // 等待中
+ WAITING: 'WAITING',
+ // 运行中
+ RUNNING: 'RUNNING',
+ // 执行完成
+ COMPLETED: 'COMPLETED',
+ // 执行失败
+ FAILED: 'FAILED',
+};
+
+/**
+ * 主机执行状态
+ */
+export const execHostStatus = {
+ // 等待中
+ WAITING: 'WAITING',
+ // 运行中
+ RUNNING: 'RUNNING',
+ // 执行完成
+ COMPLETED: 'COMPLETED',
+ // 执行失败
+ FAILED: 'FAILED',
+ // 执行超时
+ TIMEOUT: 'TIMEOUT',
+ // 已中断
+ INTERRUPTED: 'INTERRUPTED',
+};
+
+// 执行状态 字典项
+export const execStatusKey = 'execStatus';
+
+// 执行状态 字典项
+export const execHostStatusKey = 'execHostStatus';
+
+// 加载的字典值
+export const dictKeys = [execStatusKey, execHostStatusKey];
diff --git a/orion-ops-ui/src/components/exec/log/panel/exec-host.vue b/orion-ops-ui/src/components/exec/log/panel/exec-host.vue
new file mode 100644
index 00000000..210ba3df
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel/exec-host.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+ {{ item.hostName }}
+ {{ item.hostAddress }}
+
+
+
+
+ {{ getDictValue(execHostStatusKey, item.status) }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/exec/log/panel/index.vue b/orion-ops-ui/src/components/exec/log/panel/index.vue
new file mode 100644
index 00000000..f828b4be
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel/index.vue
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/exec/log/panel/log-appender.ts b/orion-ops-ui/src/components/exec/log/panel/log-appender.ts
new file mode 100644
index 00000000..3551201b
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel/log-appender.ts
@@ -0,0 +1,305 @@
+import type { ILogAppender, LogAddons, LogAppenderConf, LogDomRef } from './const';
+import { AppenderOptions } from './const';
+import type { ExecTailRequest } from '@/api/exec/exec';
+import { getExecLogTailToken } from '@/api/exec/exec';
+import { webSocketBaseUrl } from '@/utils/env';
+import { Message } from '@arco-design/web-vue';
+import { createWebSocket } from '@/utils';
+import { useDebounceFn } from '@vueuse/core';
+import { addEventListen, removeEventListen } from '@/utils/event';
+import { copy as copyText } from '@/hooks/copy';
+import { Terminal } from 'xterm';
+import { FitAddon } from 'xterm-addon-fit';
+import { SearchAddon } from 'xterm-addon-search';
+import { WebLinksAddon } from 'xterm-addon-web-links';
+import { WebglAddon } from 'xterm-addon-webgl';
+
+// 执行日志 appender 实现
+export default class LogAppender implements ILogAppender {
+
+ private current: LogAppenderConf;
+
+ private client?: WebSocket;
+
+ private readonly config: ExecTailRequest;
+
+ private readonly appenderRel: Record;
+
+ private keepAliveTask?: number;
+
+ private readonly fitAllFn: () => {};
+
+ constructor(config: ExecTailRequest) {
+ this.current = undefined as unknown as LogAppenderConf;
+ this.config = config;
+ this.appenderRel = {};
+ this.fitAllFn = useDebounceFn(this.fitAll).bind(this);
+ }
+
+ // 初始化
+ async init(logDomRefs: Array) {
+ // 初始化 appender
+ this.initAppender(logDomRefs);
+ // 初始化 client
+ await this.openClient();
+ }
+
+ // 初始化 appender
+ initAppender(logDomRefs: Array) {
+ // 打开 log-view
+ for (let logDomRef of logDomRefs) {
+ // 初始化 terminal
+ const terminal = new Terminal(AppenderOptions);
+ // 初始化快捷键
+ this.initCustomKey(terminal);
+ // 初始化插件
+ const addons = this.initAddons(terminal);
+ // 打开终端
+ terminal.open(logDomRef.el);
+ // 自适应
+ addons.fit.fit();
+ this.appenderRel[logDomRef.id] = {
+ ...logDomRef,
+ terminal,
+ addons
+ };
+ }
+ // 设置当前对象
+ this.current = this.appenderRel[logDomRefs[0].id];
+ // 注册自适应事件
+ addEventListen(window, 'resize', this.fitAllFn);
+ }
+
+ // 初始化快捷键操作
+ initCustomKey(terminal: Terminal) {
+ terminal.attachCustomKeyEventHandler((e: KeyboardEvent) => {
+ if (e.type !== 'keydown') {
+ return true;
+ }
+ if (e.code === 'Enter') {
+ // 新起一行
+ e.preventDefault();
+ terminal.write('\r\n');
+ } else if (e.code === 'Home') {
+ // 上移一页
+ e.preventDefault();
+ terminal.scrollPages(-1);
+ } else if (e.code === 'ArrowUp') {
+ // 上移
+ e.preventDefault();
+ terminal.scrollLines(-1);
+ } else if (e.code === 'End') {
+ // 下移一页
+ e.preventDefault();
+ terminal.scrollPages(1);
+ } else if (e.code === 'ArrowDown') {
+ // 下移
+ e.preventDefault();
+ terminal.scrollLines(1);
+ } else if (e.ctrlKey && e.code === 'KeyA') {
+ // 全选
+ e.preventDefault();
+ this.selectAll();
+ return false;
+ } else if (e.ctrlKey && e.code === 'KeyC') {
+ // 复制
+ e.preventDefault();
+ this.copy();
+ return false;
+ } else if (e.ctrlKey && e.code === 'KeyF') {
+ // 搜索
+ e.preventDefault();
+ this.current.openSearch();
+ return false;
+ } else if (e.ctrlKey && e.code === 'KeyL') {
+ // 清空
+ e.preventDefault();
+ this.clear();
+ return false;
+ }
+ return true;
+ });
+ }
+
+ // 初始化插件
+ initAddons(terminal: Terminal): LogAddons {
+ const fit = new FitAddon();
+ const search = new SearchAddon();
+ const webgl = new WebglAddon();
+ const weblink = new WebLinksAddon();
+ terminal.loadAddon(fit);
+ terminal.loadAddon(search);
+ terminal.loadAddon(webgl);
+ terminal.loadAddon(weblink);
+ return {
+ fit,
+ search,
+ webgl,
+ weblink
+ };
+ }
+
+ // 初始化 client
+ async openClient() {
+ // 获取 token
+ const { data } = await getExecLogTailToken(this.config);
+ // 打开会话
+ try {
+ this.client = await createWebSocket(`${webSocketBaseUrl}/exec/log/${data}`);
+ } catch (e) {
+ Message.error('连接失败');
+ console.error('log error', e);
+ return;
+ }
+ this.client.onclose = event => {
+ console.warn('log close', event);
+ };
+ this.client.onmessage = this.processMessage.bind(this);
+ // 注册持久化
+ this.keepAliveTask = setInterval(() => {
+ if (this.client?.readyState === WebSocket.OPEN) {
+ this.client?.send('p');
+ }
+ }, 15000);
+ }
+
+ // 设置当前元素
+ setCurrent(id: number): void {
+ const rel = this.appenderRel[id];
+ if (!rel) {
+ return;
+ }
+ this.current = rel;
+ // 自适应
+ rel.addons.fit.fit();
+ this.focus();
+ }
+
+ // 打开搜索
+ openSearch() {
+ this.current.openSearch();
+ }
+
+ // 查找关键字
+ find(word: string, next: boolean, options: any) {
+ if (next) {
+ this.current.addons.search.findNext(word, options);
+ } else {
+ this.current.addons.search.findPrevious(word, options);
+ }
+ }
+
+ // 去顶部
+ toTop(): void {
+ this.current.terminal.scrollToTop();
+ this.focus();
+ }
+
+ // 去底部
+ toBottom(): void {
+ this.current.terminal.scrollToBottom();
+ this.focus();
+ }
+
+ // 添加字体大小
+ addFontSize(addSize: number): void {
+ this.current.terminal.options['fontSize'] = this.current.terminal.options['fontSize'] as number + addSize;
+ this.current.addons.fit.fit();
+ this.focus();
+ }
+
+ // 复制
+ copy(): void {
+ copyText(this.current.terminal.getSelection(), '已复制');
+ this.focus();
+ }
+
+ // 复制全部
+ copyAll(): void {
+ this.selectAll();
+ this.copy();
+ this.current.terminal.clearSelection();
+ this.focus();
+ }
+
+ // 选中全部
+ selectAll(): void {
+ this.current.terminal.selectAll();
+ this.focus();
+ }
+
+ // 清空
+ clear(): void {
+ this.current.terminal.clear();
+ this.current.terminal.clearSelection();
+ this.focus();
+ }
+
+ // 聚焦
+ focus(): void {
+ this.current.terminal.focus();
+ }
+
+ // 自适应全部
+ fitAll(): void {
+ Object.values(this.appenderRel).forEach(s => {
+ s.addons.fit.fit();
+ });
+ }
+
+ // 关闭 client
+ closeClient(): void {
+ try {
+ // 清理持久化
+ clearInterval(this.keepAliveTask);
+ // 关闭 ws
+ if (this.client && this.client.readyState === WebSocket.OPEN) {
+ this.client.close();
+ }
+ } catch (e) {
+ }
+ }
+
+ // 关闭 view
+ closeView(): void {
+ // 移除自适应事件
+ removeEventListen(window, 'resize', this.fitAllFn);
+ // 关闭 terminal
+ Object.values(this.appenderRel).forEach(s => {
+ try {
+ // 卸载插件
+ Object.values(s.addons)
+ .filter(Boolean)
+ .forEach(s => s.dispose());
+ // 卸载终端
+ s.terminal?.dispose();
+ } catch (e) {
+ // 卸载可能会报错
+ }
+ });
+ }
+
+ // 关闭
+ close(): void {
+ this.closeClient();
+ this.closeView();
+ }
+
+ // 处理消息
+ processMessage({ data }: MessageEvent) {
+ // pong
+ if (data === 'p') {
+ return;
+ }
+ const separatorIndex = data.indexOf('|');
+ const id = data.substring(0, separatorIndex);
+ const text = data.substring(separatorIndex + 1, data.length);
+ // 获取 appender
+ const appender = this.appenderRel[id];
+ if (!appender) {
+ return;
+ }
+ appender.terminal.write(text);
+ }
+
+}
diff --git a/orion-ops-ui/src/components/exec/log/panel/log-item.vue b/orion-ops-ui/src/components/exec/log/panel/log-item.vue
new file mode 100644
index 00000000..7ef96bd6
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel/log-item.vue
@@ -0,0 +1,271 @@
+
+
+
+
+
+
+
+
+
+
+
+ appender?.toTop()">
+
+
+
+ 去顶部
+
+
+ appender?.toBottom()">
+
+
+
+ 去底部
+
+
+ appender?.selectAll()">
+
+
+
+ 全选
+
+
+ appender?.copy()">
+
+
+
+ 复制
+
+
+ appender?.clear()">
+
+
+
+ 清空
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/exec/log/panel/log-view.vue b/orion-ops-ui/src/components/exec/log/panel/log-view.vue
new file mode 100644
index 00000000..4bf2e293
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/log/panel/log-view.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/exec/template/modal/index.vue b/orion-ops-ui/src/components/exec/template/modal/index.vue
new file mode 100644
index 00000000..53d32f3d
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/template/modal/index.vue
@@ -0,0 +1,164 @@
+
+
+
+
+ fetchTableData()">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fetchTableData(page, pagination.pageSize)"
+ @page-size-change="(size) => fetchTableData(1, size)"
+ :bordered="false">
+
+
+ {{ record.name }}
+
+
+
+
+
+
+ {{ record.command }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/exec/template/modal/table.columns.ts b/orion-ops-ui/src/components/exec/template/modal/table.columns.ts
new file mode 100644
index 00000000..33697fef
--- /dev/null
+++ b/orion-ops-ui/src/components/exec/template/modal/table.columns.ts
@@ -0,0 +1,33 @@
+import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
+
+const columns = [
+ {
+ title: 'id',
+ dataIndex: 'id',
+ slotName: 'id',
+ width: 70,
+ align: 'left',
+ fixed: 'left',
+ }, {
+ title: '模板名称',
+ dataIndex: 'name',
+ slotName: 'name',
+ align: 'left',
+ width: 250,
+ ellipsis: true,
+ }, {
+ title: '模板命令',
+ dataIndex: 'command',
+ slotName: 'command',
+ align: 'left',
+ ellipsis: true,
+ }, {
+ title: '操作',
+ slotName: 'handle',
+ width: 80,
+ align: 'center',
+ fixed: 'right',
+ },
+] as TableColumnData[];
+
+export default columns;
diff --git a/orion-ops-ui/src/components/meta/history/history-value-modal.vue b/orion-ops-ui/src/components/meta/history/modal/index.vue
similarity index 77%
rename from orion-ops-ui/src/components/meta/history/history-value-modal.vue
rename to orion-ops-ui/src/components/meta/history/modal/index.vue
index 15f6ab1f..db4cd655 100644
--- a/orion-ops-ui/src/components/meta/history/history-value-modal.vue
+++ b/orion-ops-ui/src/components/meta/history/modal/index.vue
@@ -1,6 +1,5 @@
-
+
{{ record.beforeValue }}
-
+
{{ record.afterValue }}
@@ -77,69 +80,22 @@
diff --git a/orion-ops-ui/src/components/view/editor/languages/shell-suggestions.ts b/orion-ops-ui/src/components/view/editor/languages/shell-suggestions.ts
new file mode 100644
index 00000000..781c525e
--- /dev/null
+++ b/orion-ops-ui/src/components/view/editor/languages/shell-suggestions.ts
@@ -0,0 +1,27 @@
+import * as monaco from 'monaco-editor';
+import { language as shellLanguage } from 'monaco-editor/esm/vs/basic-languages/shell/shell.js';
+
+const provideCompletionItems = () => {
+ const suggestions: any = [];
+ shellLanguage.keywords?.forEach((item: any) => {
+ suggestions.push({
+ label: item,
+ kind: monaco.languages.CompletionItemKind.Keyword,
+ insertText: item,
+ });
+ });
+ shellLanguage.builtins?.forEach((item: any) => {
+ suggestions.push({
+ label: item,
+ kind: monaco.languages.CompletionItemKind.Function,
+ insertText: item,
+ });
+ });
+ return {
+ suggestions: [...new Set(suggestions)],
+ };
+};
+
+export default {
+ provideCompletionItems
+};
diff --git a/orion-ops-ui/src/components/view/exec-editor/const.ts b/orion-ops-ui/src/components/view/exec-editor/const.ts
new file mode 100644
index 00000000..403785a5
--- /dev/null
+++ b/orion-ops-ui/src/components/view/exec-editor/const.ts
@@ -0,0 +1,57 @@
+// 模板参数
+export interface TemplateParam {
+ name?: string;
+ desc?: string;
+ defaultValue?: any;
+ value?: any;
+}
+
+// 内置参数
+export const builtinsParams: Array = [
+ {
+ name: 'hostId',
+ desc: '执行主机id'
+ }, {
+ name: 'hostName',
+ desc: '执行主机名称'
+ }, {
+ name: 'hostCode',
+ desc: '执行主机编码'
+ }, {
+ name: 'hostAddress',
+ desc: '执行主机地址'
+ }, {
+ name: 'userId',
+ desc: '执行用户id'
+ }, {
+ name: 'username',
+ desc: '执行用户名'
+ }, {
+ name: 'execId',
+ desc: '执行记录id'
+ }, {
+ name: 'uuid',
+ desc: '生成任务维度 uuid'
+ }, {
+ name: 'uuidShort',
+ desc: '生成任务维度 uuid 无 \'-\''
+ }, {
+ name: 'hostUuid',
+ desc: '生成机器维度 uuid'
+ }, {
+ name: 'hostUuidShort',
+ desc: '生成机器维度 uuid 无 \'-\''
+ }, {
+ name: 'timestampMillis',
+ desc: '时间戳毫秒'
+ }, {
+ name: 'timestamp',
+ desc: '时间戳'
+ }, {
+ name: 'date',
+ desc: '执行时间 yyyy-MM-dd'
+ }, {
+ name: 'datetime',
+ desc: '执行时间 yyyy-MM-dd HH:mm:ss'
+ },
+];
diff --git a/orion-ops-ui/src/components/view/exec-editor/index.vue b/orion-ops-ui/src/components/view/exec-editor/index.vue
new file mode 100644
index 00000000..72c42ed7
--- /dev/null
+++ b/orion-ops-ui/src/components/view/exec-editor/index.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/components/view/json-editor/json-editor-modal.vue b/orion-ops-ui/src/components/view/json-editor/modal/index.vue
similarity index 89%
rename from orion-ops-ui/src/components/view/json-editor/json-editor-modal.vue
rename to orion-ops-ui/src/components/view/json-editor/modal/index.vue
index c26abb8f..5fb224ba 100644
--- a/orion-ops-ui/src/components/view/json-editor/json-editor-modal.vue
+++ b/orion-ops-ui/src/components/view/json-editor/modal/index.vue
@@ -2,7 +2,7 @@
-
+
@@ -36,6 +36,10 @@
height: {
type: String,
default: 'calc(100vh - 240px)'
+ },
+ readonly: {
+ type: Boolean,
+ default: true
}
});
diff --git a/orion-ops-ui/src/components/view/shell-editor/shell-editor-modal.vue b/orion-ops-ui/src/components/view/shell-editor/modal/index.vue
similarity index 60%
rename from orion-ops-ui/src/components/view/shell-editor/shell-editor-modal.vue
rename to orion-ops-ui/src/components/view/shell-editor/modal/index.vue
index 29aa77c6..f3cd3891 100644
--- a/orion-ops-ui/src/components/view/shell-editor/shell-editor-modal.vue
+++ b/orion-ops-ui/src/components/view/shell-editor/modal/index.vue
@@ -2,7 +2,7 @@
+ :theme="dark ? 'vs-dark' : 'vs'"
+ :readonly="readonly" />
@@ -27,10 +29,8 @@
diff --git a/orion-ops-ui/src/views/asset-audit/connect-log/index.vue b/orion-ops-ui/src/views/asset-audit/connect-log/index.vue
index 23b69d2c..390012eb 100644
--- a/orion-ops-ui/src/views/asset-audit/connect-log/index.vue
+++ b/orion-ops-ui/src/views/asset-audit/connect-log/index.vue
@@ -7,7 +7,7 @@
diff --git a/orion-ops-ui/src/views/asset-audit/sftp-log/components/sftp-log-table.vue b/orion-ops-ui/src/views/asset-audit/sftp-log/components/sftp-log-table.vue
index cc89095e..a4678ca3 100644
--- a/orion-ops-ui/src/views/asset-audit/sftp-log/components/sftp-log-table.vue
+++ b/orion-ops-ui/src/views/asset-audit/sftp-log/components/sftp-log-table.vue
@@ -8,35 +8,34 @@
@reset="fetchTableData"
@keyup.enter="() => fetchTableData()">
-
+
-
+
-
+
-
+
-
+
@@ -92,11 +91,11 @@
-
+
{{ record.hostName }}
-
{{ record.hostAddress }}
@@ -116,11 +115,11 @@
{{ path }}
-
+
移动到 {{ record.extra?.target }}
-
+
提权 {{ record.extra?.mod }} {{ permission10toString(record.extra?.mod as number) }}
@@ -133,11 +132,11 @@
-
+
{{ record.location }}
-
{{ record.address }}
@@ -166,7 +165,7 @@
@@ -180,10 +179,10 @@
import { Message } from '@arco-design/web-vue';
import columns from '../types/table.columns';
import useLoading from '@/hooks/loading';
- import useCopy from '@/hooks/copy';
- import UserSelector from '@/components/user/user/user-selector.vue';
- import HostSelector from '@/components/asset/host/host-selector.vue';
+ import { copy } from '@/hooks/copy';
import { permission10toString } from '@/utils/file';
+ import UserSelector from '@/components/user/user/selector/index.vue';
+ import HostSelector from '@/components/asset/host/selector/index.vue';
const tableRenderData = ref([]);
const selectedKeys = ref([]);
@@ -192,7 +191,6 @@
const rowSelection = useRowSelection();
const { loading, setLoading } = useLoading();
const { toOptions, getDictValue } = useDictStore();
- const { copy } = useCopy();
const formModel = reactive({
userId: undefined,
@@ -264,16 +262,6 @@
diff --git a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
index 072fa848..c5ee97ca 100644
--- a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
+++ b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
@@ -7,22 +7,22 @@
@reset="fetchTableData"
@keyup.enter="() => fetchTableData()">
-
+
-
+
-
+
-
+
@@ -82,11 +82,9 @@
:bordered="false">
-
-
- {{ record.username }}
-
-
+
+ {{ record.username }}
+
@@ -136,7 +134,7 @@
@@ -145,19 +143,18 @@
import { reactive, ref, onMounted } from 'vue';
import { deleteHostIdentity, getHostIdentityPage } from '@/api/asset/host-identity';
import { Message } from '@arco-design/web-vue';
- import useLoading from '@/hooks/loading';
import columns from '../types/table.columns';
- import { usePagination } from '@/types/table';
- import HostKeySelector from '@/components/asset/host-key/host-key-selector.vue';
- import useCopy from '@/hooks/copy';
+ import useLoading from '@/hooks/loading';
import usePermission from '@/hooks/permission';
+ import { copy } from '@/hooks/copy';
+ import { usePagination } from '@/types/table';
import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
+ import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
const emits = defineEmits(['openAdd', 'openUpdate', 'openKeyView']);
const tableRenderData = ref([]);
- const { copy } = useCopy();
const pagination = usePagination();
const { loading, setLoading } = useLoading();
const { hasAnyPermission } = usePermission();
diff --git a/orion-ops-ui/src/views/asset/host-identity/index.vue b/orion-ops-ui/src/views/asset/host-identity/index.vue
index 9351c694..96fc99ba 100644
--- a/orion-ops-ui/src/views/asset/host-identity/index.vue
+++ b/orion-ops-ui/src/views/asset/host-identity/index.vue
@@ -3,15 +3,15 @@
modal.openAdd()"
- @openUpdate="(e) => modal.openUpdate(e)"
- @openKeyView="(e) => keyDrawer.openView(e) " />
+ @open-add="() => modal.openAdd()"
+ @open-update="(e) => modal.openUpdate(e)"
+ @open-key-view="(e) => keyDrawer.openView(e) " />
modal.openAdd()"
- @openUpdate="(e) => modal.openUpdate(e)"
- @openKeyView="(e) => keyDrawer.openView(e) " />
+ @open-add="() => modal.openAdd()"
+ @open-update="(e) => modal.openUpdate(e)"
+ @open-key-view="(e) => keyDrawer.openView(e) " />
export default {
- name: 'assetHostIdentity'
+ name: 'hostIdentity'
};
diff --git a/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts b/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts
index 55ab626b..e98ec07e 100644
--- a/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts
+++ b/orion-ops-ui/src/views/asset/host-identity/types/table.columns.ts
@@ -21,15 +21,6 @@ const columns = [
title: '主机秘钥',
dataIndex: 'keyId',
slotName: 'keyId',
- }, {
- title: '创建时间',
- dataIndex: 'createTime',
- slotName: 'createTime',
- align: 'center',
- width: 180,
- render: ({ record }) => {
- return dateFormat(new Date(record.createTime));
- },
}, {
title: '修改时间',
dataIndex: 'updateTime',
diff --git a/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue b/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue
index d2491309..650c8b15 100644
--- a/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue
@@ -94,7 +94,7 @@
diff --git a/orion-ops-ui/src/views/asset/host-key/components/host-key-form-drawer.vue b/orion-ops-ui/src/views/asset/host-key/components/host-key-form-drawer.vue
index f0dfa626..1695143c 100644
--- a/orion-ops-ui/src/views/asset/host-key/components/host-key-form-drawer.vue
+++ b/orion-ops-ui/src/views/asset/host-key/components/host-key-form-drawer.vue
@@ -8,14 +8,13 @@
:cancel-button-props="{ disabled: loading }"
:on-before-ok="handlerOk"
@cancel="handleClose">
-
+
请使用 ssh-keygen -m PEM -t rsa 生成秘钥
@@ -61,7 +60,6 @@
export default {
- name: 'assetHostKeyFormDrawer'
+ name: 'hostKeyFormDrawer'
};
@@ -234,6 +232,8 @@
diff --git a/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue b/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue
index 6eda09b7..534aaef0 100644
--- a/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue
+++ b/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue
@@ -7,14 +7,14 @@
@reset="fetchTableData"
@keyup.enter="() => fetchTableData()">
-
+
-
+
@@ -109,7 +109,7 @@
diff --git a/orion-ops-ui/src/views/asset/host-key/index.vue b/orion-ops-ui/src/views/asset/host-key/index.vue
index 4c50ec52..352115ff 100644
--- a/orion-ops-ui/src/views/asset/host-key/index.vue
+++ b/orion-ops-ui/src/views/asset/host-key/index.vue
@@ -3,15 +3,15 @@
drawer.openView(e)"
- @openAdd="() => drawer.openAdd()"
- @openUpdate="(e) => drawer.openUpdate(e)" />
+ @open-view="(e) => drawer.openView(e)"
+ @open-add="() => drawer.openAdd()"
+ @open-update="(e) => drawer.openUpdate(e)" />
drawer.openView(e)"
- @openAdd="() => drawer.openAdd()"
- @openUpdate="(e) => drawer.openUpdate(e)" />
+ @open-view="(e) => drawer.openView(e)"
+ @open-add="() => drawer.openAdd()"
+ @open-update="(e) => drawer.openUpdate(e)" />
export default {
- name: 'assetHostKey'
+ name: 'hostKey'
};
diff --git a/orion-ops-ui/src/views/asset/host-list/components/config/host-config-drawer.vue b/orion-ops-ui/src/views/asset/host-list/components/config/host-config-drawer.vue
index 7de6cd56..df339321 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/config/host-config-drawer.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/config/host-config-drawer.vue
@@ -58,7 +58,7 @@
setVisible(true);
// 加载字典值
const dictStore = useDictStore();
- await dictStore.loadKeys([...sshDictKeys]);
+ await dictStore.loadKeys(sshDictKeys);
// 加载配置
const { data } = await getHostConfigList(record.value.id);
data.forEach(s => {
diff --git a/orion-ops-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue b/orion-ops-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue
index 21eb5fb2..5e0b9591 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/config/ssh/ssh-config-form.vue
@@ -120,8 +120,15 @@
@@ -146,8 +153,8 @@
import { useDictStore } from '@/store';
import { EnabledStatus } from '@/types/const';
import { HostConfigType } from '../../../types/const';
- import HostKeySelector from '@/components/asset/host-key/host-key-selector.vue';
- import HostIdentitySelector from '@/components/asset/host-identity/host-identity-selector.vue';
+ import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
+ import HostIdentitySelector from '@/components/asset/host-identity/selector/index.vue';
const { loading, setLoading } = useLoading();
const { toRadioOptions } = useDictStore();
@@ -260,7 +267,7 @@
setLoading(false);
Message.success('修改成功');
// 回调 props
- emits('submitted', { ...props.content, config: { ...formModel.value } });
+ emits('submitted', { ...props.content, ...config, config: { ...formModel.value } });
} catch (e) {
} finally {
setLoading(false);
diff --git a/orion-ops-ui/src/views/asset/host-list/components/group/host-group-drawer.vue b/orion-ops-ui/src/views/asset/host-list/components/group/host-group-drawer.vue
index 827fbc04..7ad474af 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/group/host-group-drawer.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/group/host-group-drawer.vue
@@ -72,7 +72,7 @@
import { Message } from '@arco-design/web-vue';
import { updateHostGroupRel } from '@/api/asset/host-group';
import HostTransfer from './host-transfer.vue';
- import HostGroupTree from '@/components/asset/host-group/host-group-tree.vue';
+ import HostGroupTree from '@/components/asset/host-group/tree/index.vue';
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
diff --git a/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue b/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
index dff17c73..6826b9f1 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
@@ -49,7 +49,6 @@
size="small"
ref="formRef"
label-align="right"
- :style="{ width: '320px' }"
:label-col-props="{ span: 6 }"
:wrapper-col-props="{ span: 18 }"
@keyup.enter="() => fetchCardData()">
@@ -89,15 +88,13 @@
- {{ record.code }}
+ {{ record.code }}
-
-
- {{ record.address }}
-
-
+
+ {{ record.address }}
+
@@ -166,7 +163,7 @@
@@ -176,13 +173,13 @@
import { computed, reactive, ref, onMounted } from 'vue';
import useLoading from '@/hooks/loading';
import { dataColor, objectTruthKeyCount, resetObject } from '@/utils';
- import fieldConfig from '../types/host.card.fields';
+ import fieldConfig from '../types/card.fields';
import { deleteHost, getHostPage } from '@/api/asset/host';
import { Message, Modal } from '@arco-design/web-vue';
import { tagColor } from '../types/const';
- import TagMultiSelector from '@/components/meta/tag/tag-multi-selector.vue';
- import useCopy from '@/hooks/copy';
+ import { copy } from '@/hooks/copy';
import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
+ import TagMultiSelector from '@/components/meta/tag/multi-selector/index.vue';
const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig', 'openHostGroup']);
@@ -190,7 +187,6 @@
const cardColLayout = useColLayout();
const pagination = usePagination();
- const { copy } = useCopy();
const { loading, setLoading } = useLoading();
const formRef = ref();
diff --git a/orion-ops-ui/src/views/asset/host-list/components/host-form-modal.vue b/orion-ops-ui/src/views/asset/host-list/components/host-form-modal.vue
index d13b6504..cd41683c 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/host-form-modal.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/host-form-modal.vue
@@ -16,8 +16,7 @@
@@ -45,7 +44,7 @@
type="HOST"
:tagColor="tagColor"
placeholder="请选择主机标签"
- @onLimited="onLimitedTag" />
+ @on-limited="onLimitedTag" />
@@ -54,7 +53,7 @@
@@ -63,13 +62,13 @@
import { ref } from 'vue';
import useLoading from '@/hooks/loading';
import useVisible from '@/hooks/visible';
- import formRules from '../types/host.form.rules';
+ import formRules from '../types/form.rules';
import { createHost, getHost, updateHost } from '@/api/asset/host';
import { Message } from '@arco-design/web-vue';
import { pick } from 'lodash';
- import TagMultiSelector from '@/components/meta/tag/tag-multi-selector.vue';
- import HostGroupTreeSelector from '@/components/asset/host-group/host-group-tree-selector.vue';
import { tagColor } from '@/views/asset/host-list/types/const';
+ import TagMultiSelector from '@/components/meta/tag/multi-selector/index.vue';
+ import HostGroupTreeSelector from '@/components/asset/host-group/tree-selector/index.vue';
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
diff --git a/orion-ops-ui/src/views/asset/host-list/components/host-table.vue b/orion-ops-ui/src/views/asset/host-list/components/host-table.vue
index 687dd99e..9d8372c2 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/host-table.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/host-table.vue
@@ -7,26 +7,26 @@
@reset="fetchTableData"
@keyup.enter="() => fetchTableData()">
-
+
-
+
-
+
-
+
-
+
-
-
+
+ {{ record.address }}
- {{ record.address }}
-
+
@@ -157,7 +160,7 @@
@@ -166,22 +169,20 @@
import { reactive, ref, onMounted } from 'vue';
import { deleteHost, getHostPage } from '@/api/asset/host';
import { Message } from '@arco-design/web-vue';
- import useLoading from '@/hooks/loading';
- import columns from '../types/host.table.columns';
import { tagColor } from '../types/const';
import { usePagination } from '@/types/table';
- import useCopy from '@/hooks/copy';
+ import useLoading from '@/hooks/loading';
+ import { copy } from '@/hooks/copy';
+ import columns from '../types/table.columns';
import { dataColor } from '@/utils';
- import TagMultiSelector from '@/components/meta/tag/tag-multi-selector.vue';
import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
+ import TagMultiSelector from '@/components/meta/tag/multi-selector/index.vue';
const tagSelector = ref();
const tableRenderData = ref([]);
const { loading, setLoading } = useLoading();
const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig', 'openHostGroup']);
- const { copy } = useCopy();
-
const pagination = usePagination();
const formModel = reactive({
diff --git a/orion-ops-ui/src/views/asset/host-list/index.vue b/orion-ops-ui/src/views/asset/host-list/index.vue
index d92a3ea4..e4dc3136 100644
--- a/orion-ops-ui/src/views/asset/host-list/index.vue
+++ b/orion-ops-ui/src/views/asset/host-list/index.vue
@@ -3,17 +3,17 @@
hostGroup.open()"
- @openAdd="() => modal.openAdd()"
- @openUpdate="(e) => modal.openUpdate(e.id)"
- @openUpdateConfig="(e) => hostConfig.open(e)" />
+ @open-host-group="() => hostGroup.open()"
+ @open-add="() => modal.openAdd()"
+ @open-update="(e) => modal.openUpdate(e.id)"
+ @open-update-config="(e) => hostConfig.open(e)" />
hostGroup.open()"
- @openAdd="() => modal.openAdd()"
- @openUpdate="(e) => modal.openUpdate(e.id)"
- @openUpdateConfig="(e) => hostConfig.open(e)" />
+ @open-host-group="() => hostGroup.open()"
+ @open-add="() => modal.openAdd()"
+ @open-update="(e) => modal.openUpdate(e.id)"
+ @open-update-config="(e) => hostConfig.open(e)" />
export default {
- name: 'assetHostList'
+ name: 'hostList'
};
diff --git a/orion-ops-ui/src/views/asset/host-list/types/host.card.fields.ts b/orion-ops-ui/src/views/asset/host-list/types/card.fields.ts
similarity index 100%
rename from orion-ops-ui/src/views/asset/host-list/types/host.card.fields.ts
rename to orion-ops-ui/src/views/asset/host-list/types/card.fields.ts
diff --git a/orion-ops-ui/src/views/asset/host-list/types/host.form.rules.ts b/orion-ops-ui/src/views/asset/host-list/types/form.rules.ts
similarity index 100%
rename from orion-ops-ui/src/views/asset/host-list/types/host.form.rules.ts
rename to orion-ops-ui/src/views/asset/host-list/types/form.rules.ts
diff --git a/orion-ops-ui/src/views/asset/host-list/types/host.table.columns.ts b/orion-ops-ui/src/views/asset/host-list/types/table.columns.ts
similarity index 100%
rename from orion-ops-ui/src/views/asset/host-list/types/host.table.columns.ts
rename to orion-ops-ui/src/views/asset/host-list/types/table.columns.ts
diff --git a/orion-ops-ui/src/views/dashboard/workplace/components/quick-operation.vue b/orion-ops-ui/src/views/dashboard/workplace/components/quick-operation.vue
index 8a61ecf4..0c0e81e4 100644
--- a/orion-ops-ui/src/views/dashboard/workplace/components/quick-operation.vue
+++ b/orion-ops-ui/src/views/dashboard/workplace/components/quick-operation.vue
@@ -23,8 +23,8 @@
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-form.vue b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-form.vue
new file mode 100644
index 00000000..d91c9a0f
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-form.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-history.vue b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-history.vue
new file mode 100644
index 00000000..1b7844a6
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel-history.vue
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ record.hostIdList?.length || 0 }}
+
+
+
+ {{ record.description }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-command/components/exec-panel.vue b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel.vue
new file mode 100644
index 00000000..6ec4f0db
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-command/components/exec-panel.vue
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 已选择{{ formModel.hostIdList?.length }}台主机
+
+
+ {{ formModel.hostIdList?.length ? '重新选择' : '选择主机' }}
+
+
+
+
+
+
+
+
+
+
+
+ 秒
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-command/index.vue b/orion-ops-ui/src/views/exec/exec-command/index.vue
new file mode 100644
index 00000000..f6cfad9b
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-command/index.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-command/types/const.ts b/orion-ops-ui/src/views/exec/exec-command/types/const.ts
new file mode 100644
index 00000000..b88ef694
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-command/types/const.ts
@@ -0,0 +1,2 @@
+// 执行
+export const historyCount = 20;
diff --git a/orion-ops-ui/src/views/exec/exec-command/types/form.rules.ts b/orion-ops-ui/src/views/exec/exec-command/types/form.rules.ts
new file mode 100644
index 00000000..89914126
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-command/types/form.rules.ts
@@ -0,0 +1,33 @@
+import type { FieldRule } from '@arco-design/web-vue';
+
+export const description = [{
+ maxLength: 128,
+ message: '执行描述长度不能大于128位'
+}] as FieldRule[];
+
+export const hostIdList = [{
+ required: true,
+ message: '请选择执行主机'
+}] as FieldRule[];
+
+export const command = [{
+ required: true,
+ message: '请输入执行命令'
+}] as FieldRule[];
+
+export const timeout = [{
+ required: true,
+ message: '请输入超时时间'
+}, {
+ type: 'number',
+ min: 0,
+ max: 100000,
+ message: '超时时间需要在 0 - 100000 之间'
+}] as FieldRule[];
+
+export default {
+ description,
+ hostIdList,
+ command,
+ timeout,
+} as Record;
diff --git a/orion-ops-ui/src/views/exec/exec-log-view/index.vue b/orion-ops-ui/src/views/exec/exec-log-view/index.vue
new file mode 100644
index 00000000..ac874112
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log-view/index.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-log/components/exec-host-log-table.vue b/orion-ops-ui/src/views/exec/exec-log/components/exec-host-log-table.vue
new file mode 100644
index 00000000..fbbfdb2c
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/components/exec-host-log-table.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+ {{ record.hostName }}
+
+
+
+ {{ record.hostAddress }}
+
+
+
+
+
+ {{ record.errorMessage }}
+
+
+
+
+
+ {{ getDictValue(execHostStatusKey, record.status) }}
+
+
+
+
+
+ {{ (record.startTime && dateFormat(new Date(record.startTime))) || '-' }}
+
+
+
+ 持续时间: {{ formatDuration(record.startTime, record.finishTime) || '-' }}
+
+
+
+
+
+
+
+ 命令
+
+
+
+ 参数
+
+
+
+ 下载
+
+
+
+
+ 中断
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-log/components/exec-log-clear-modal.vue b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-clear-modal.vue
new file mode 100644
index 00000000..39d8f378
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-clear-modal.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-log/components/exec-log-table.vue b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-table.vue
new file mode 100644
index 00000000..7548a5bf
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/components/exec-log-table.vue
@@ -0,0 +1,406 @@
+
+
+
+ fetchTableData()">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 执行命令
+
+
+
+
+
+
+ 清空
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+ fetchTableData(page, pagination.pageSize)"
+ @page-size-change="(size) => fetchTableData(1, size)"
+ @expand="loadHostExecData">
+
+
+ emits('viewCommand', s)"
+ @view-params="s => emits('viewParams', s)" />
+
+
+
+
+ {{ record.command }}
+
+
+
+
+
+ {{ getDictValue(execStatusKey, record.status) }}
+
+
+
+
+
+ {{ (record.startTime && dateFormat(new Date(record.startTime))) || '-' }}
+
+
+
+ 持续时间: {{ formatDuration(record.startTime, record.finishTime) || '-' }}
+
+
+
+
+
+
+
+
+ 重新执行
+
+
+
+
+ 命令
+
+
+
emits('viewLog', record.id, e.ctrlKey)">
+ 日志
+
+
+
+
+ 中断
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-log/index.vue b/orion-ops-ui/src/views/exec/exec-log/index.vue
new file mode 100644
index 00000000..c3f4bcc2
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/index.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-log/types/const.ts b/orion-ops-ui/src/views/exec/exec-log/types/const.ts
new file mode 100644
index 00000000..a0e26822
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/types/const.ts
@@ -0,0 +1,40 @@
+/**
+ * 批量执行状态
+ */
+export const execStatus = {
+ // 等待中
+ WAITING: 'WAITING',
+ // 运行中
+ RUNNING: 'RUNNING',
+ // 执行完成
+ COMPLETED: 'COMPLETED',
+ // 执行失败
+ FAILED: 'FAILED',
+};
+
+/**
+ * 主机执行状态
+ */
+export const execHostStatus = {
+ // 等待中
+ WAITING: 'WAITING',
+ // 运行中
+ RUNNING: 'RUNNING',
+ // 执行完成
+ COMPLETED: 'COMPLETED',
+ // 执行失败
+ FAILED: 'FAILED',
+ // 执行超时
+ TIMEOUT: 'TIMEOUT',
+ // 已中断
+ INTERRUPTED: 'INTERRUPTED',
+};
+
+// 执行状态 字典项
+export const execStatusKey = 'execStatus';
+
+// 执行状态 字典项
+export const execHostStatusKey = 'execHostStatus';
+
+// 加载的字典值
+export const dictKeys = [execStatusKey, execHostStatusKey];
diff --git a/orion-ops-ui/src/views/exec/exec-log/types/host-table.columns.ts b/orion-ops-ui/src/views/exec/exec-log/types/host-table.columns.ts
new file mode 100644
index 00000000..cb18fd99
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/types/host-table.columns.ts
@@ -0,0 +1,57 @@
+import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
+import { isNumber } from '@/utils/is';
+
+const columns = [
+ {
+ title: 'id',
+ dataIndex: 'id',
+ slotName: 'id',
+ width: 70,
+ align: 'left',
+ fixed: 'left',
+ }, {
+ title: '执行主机',
+ dataIndex: 'hostName',
+ slotName: 'hostName',
+ align: 'left',
+ ellipsis: true,
+ tooltip: true,
+ }, {
+ title: '退出码',
+ dataIndex: 'exitStatus',
+ slotName: 'exitStatus',
+ align: 'left',
+ width: 118,
+ render: ({ record }) => {
+ return isNumber(record.exitStatus) ? record.exitStatus : '-';
+ },
+ }, {
+ title: '执行状态',
+ dataIndex: 'status',
+ slotName: 'status',
+ align: 'left',
+ width: 118,
+ }, {
+ title: '错误信息',
+ dataIndex: 'errorMessage',
+ slotName: 'errorMessage',
+ align: 'left',
+ ellipsis: true,
+ tooltip: true,
+ width: 168,
+ }, {
+ title: '执行时间',
+ dataIndex: 'startTime',
+ slotName: 'startTime',
+ align: 'left',
+ width: 190,
+ }, {
+ title: '操作',
+ slotName: 'handle',
+ width: 258,
+ align: 'center',
+ fixed: 'right',
+ },
+] as TableColumnData[];
+
+export default columns;
diff --git a/orion-ops-ui/src/views/exec/exec-log/types/table.columns.ts b/orion-ops-ui/src/views/exec/exec-log/types/table.columns.ts
new file mode 100644
index 00000000..97ef8c48
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-log/types/table.columns.ts
@@ -0,0 +1,53 @@
+import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
+
+const columns = [
+ {
+ title: 'id',
+ dataIndex: 'id',
+ slotName: 'id',
+ width: 70,
+ align: 'left',
+ fixed: 'left',
+ }, {
+ title: '执行描述',
+ dataIndex: 'description',
+ slotName: 'description',
+ align: 'left',
+ width: 168,
+ ellipsis: true,
+ tooltip: true,
+ }, {
+ title: '执行命令',
+ dataIndex: 'command',
+ slotName: 'command',
+ align: 'left',
+ ellipsis: true,
+ }, {
+ title: '执行用户',
+ dataIndex: 'username',
+ slotName: 'username',
+ align: 'left',
+ width: 118,
+ ellipsis: true,
+ }, {
+ title: '执行状态',
+ dataIndex: 'status',
+ slotName: 'status',
+ align: 'left',
+ width: 118,
+ }, {
+ title: '执行时间',
+ dataIndex: 'startTime',
+ slotName: 'startTime',
+ align: 'left',
+ width: 190,
+ }, {
+ title: '操作',
+ slotName: 'handle',
+ width: 288,
+ align: 'center',
+ fixed: 'right',
+ },
+] as TableColumnData[];
+
+export default columns;
diff --git a/orion-ops-ui/src/views/exec/exec-template/components/exec-template-exec-drawer.vue b/orion-ops-ui/src/views/exec/exec-template/components/exec-template-exec-drawer.vue
new file mode 100644
index 00000000..1a2fd316
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-template/components/exec-template-exec-drawer.vue
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+ 已选择{{ formModel.hostIdList?.length }}台主机
+
+
+ {{ formModel.hostIdList?.length ? '重新选择' : '选择主机' }}
+
+
+
+
+
+
+
+
+
+
+
+ 秒
+
+
+
+
+
+
+
+
+
+
+ 命令参数
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-template/components/exec-template-form-drawer.vue b/orion-ops-ui/src/views/exec/exec-template/components/exec-template-form-drawer.vue
new file mode 100644
index 00000000..9532bbd2
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-template/components/exec-template-form-drawer.vue
@@ -0,0 +1,300 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 秒
+
+
+
+
+
+
+
+
+
+
+
+
+ 命令参数
+ 添加参数
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 无参数
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-template/components/exec-template-table.vue b/orion-ops-ui/src/views/exec/exec-template/components/exec-template-table.vue
new file mode 100644
index 00000000..72425439
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-template/components/exec-template-table.vue
@@ -0,0 +1,197 @@
+
+
+
+ fetchTableData()">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fetchTableData(page, pagination.pageSize)"
+ @page-size-change="(size) => fetchTableData(1, size)"
+ :bordered="false">
+
+
+ {{ record.name }}
+
+
+
+
+
+
+ {{ record.command }}
+
+
+
+
+
+ 执行
+
+
+
+ 修改
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-template/index.vue b/orion-ops-ui/src/views/exec/exec-template/index.vue
new file mode 100644
index 00000000..24cafbac
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-template/index.vue
@@ -0,0 +1,58 @@
+
+
+
+
execModal.open(e)"
+ @open-add="() => drawer.openAdd()"
+ @open-update="(e) => drawer.openUpdate(e)" />
+
+
+
+ execModal.setSelectedHost(e)" />
+
+ hostModal.open(e)" />
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts b/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts
new file mode 100644
index 00000000..202663e2
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts
@@ -0,0 +1,30 @@
+import type { FieldRule } from '@arco-design/web-vue';
+
+export const name = [{
+ required: true,
+ message: '请输入模板名称'
+}, {
+ maxLength: 64,
+ message: '模板名称长度不能大于64位'
+}] as FieldRule[];
+
+export const command = [{
+ required: true,
+ message: '请输入模板命令'
+}] as FieldRule[];
+
+export const timeout = [{
+ required: true,
+ message: '请输入超时时间'
+}, {
+ type: 'number',
+ min: 0,
+ max: 100000,
+ message: '超时时间需要在 0 - 100000 之间'
+}] as FieldRule[];
+
+export default {
+ name,
+ command,
+ timeout,
+} as Record;
diff --git a/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts b/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts
new file mode 100644
index 00000000..57411f77
--- /dev/null
+++ b/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts
@@ -0,0 +1,43 @@
+import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
+import { dateFormat } from '@/utils';
+
+const columns = [
+ {
+ title: 'id',
+ dataIndex: 'id',
+ slotName: 'id',
+ width: 70,
+ align: 'left',
+ fixed: 'left',
+ }, {
+ title: '模板名称',
+ dataIndex: 'name',
+ slotName: 'name',
+ align: 'left',
+ width: 200,
+ ellipsis: true,
+ }, {
+ title: '模板命令',
+ dataIndex: 'command',
+ slotName: 'command',
+ align: 'left',
+ ellipsis: true,
+ }, {
+ title: '修改时间',
+ dataIndex: 'updateTime',
+ slotName: 'updateTime',
+ align: 'center',
+ width: 180,
+ render: ({ record }) => {
+ return dateFormat(new Date(record.updateTime));
+ },
+ }, {
+ title: '操作',
+ slotName: 'handle',
+ width: 180,
+ align: 'center',
+ fixed: 'right',
+ },
+] as TableColumnData[];
+
+export default columns;
diff --git a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue
index 76876a22..467f5f6d 100644
--- a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue
+++ b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue
@@ -33,8 +33,9 @@
+ theme="vs-dark"
+ :suggestions="true"
+ :auto-focus="true" />
@@ -43,7 +44,7 @@
@@ -55,10 +56,8 @@
import { createCommandSnippet, updateCommandSnippet } from '@/api/asset/command-snippet';
import formRules from '../types/form.rules';
import { Message } from '@arco-design/web-vue';
- import { useTerminalStore } from '@/store';
import CommandSnippetGroupSelect from './command-snippet-group-select.vue';
- const { preference } = useTerminalStore();
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();
diff --git a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue
index 9a04180d..5d8d8742 100644
--- a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue
+++ b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-list-item.vue
@@ -14,33 +14,33 @@
{{ item.name }}
-
-
-
-
-
-
-
-
- 粘贴
-
-
-
-
-
-
- 执行
-
-
-
+
+
+
+
+
+
+
+
+ 粘贴
+
+
+
+
+
+
+ 执行
+
+
+
();
- const { copy } = useCopy();
const { getAndCheckCurrentSshSession } = useTerminalStore();
let clickCount = 0;
@@ -169,7 +168,7 @@
// 复制命令
const copyCommand = () => {
- copy(props.item.command, false);
+ copy(props.item.command, '已复制');
};
// 粘贴
diff --git a/orion-ops-ui/src/views/host/terminal/components/layout/terminal-panel.vue b/orion-ops-ui/src/views/host/terminal/components/layout/terminal-panel.vue
index 2f93ec22..8afad332 100644
--- a/orion-ops-ui/src/views/host/terminal/components/layout/terminal-panel.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/layout/terminal-panel.vue
@@ -21,8 +21,9 @@
:key="tab.key">
-
+
@@ -59,7 +60,7 @@
const emits = defineEmits(['close', 'openNewConnect']);
- const { sessionManager } = useTerminalStore();
+ const { sessionManager, copySession } = useTerminalStore();
// 监听 tab 切换
watch(() => props.panel.active, (active, before) => {
diff --git a/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue b/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue
index da20c56d..e3a8cfe2 100644
--- a/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/new-connection/host-group-view.vue
@@ -17,7 +17,7 @@
+ empty-value="当前分组内无授权主机/主机未启用 SSH 配置!" />
diff --git a/orion-ops-ui/src/views/host/terminal/components/new-connection/host-list-view.vue b/orion-ops-ui/src/views/host/terminal/components/new-connection/host-list-view.vue
index f97b0bb0..e988dfcc 100644
--- a/orion-ops-ui/src/views/host/terminal/components/new-connection/host-list-view.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/new-connection/host-list-view.vue
@@ -27,55 +27,55 @@
-
-
-
-
- {{ item.alias }}
-
-
- {{ `${item.name} (${item.code})` }}
-
-
-
+
+
+
+
+ {{ item.alias }}
+
+
+ {{ `${item.name} (${item.code})` }}
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue b/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue
index 2af34eb0..d248415e 100644
--- a/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue
@@ -8,19 +8,9 @@
:host-list="hostList"
:filter-value="filterValue" />
-
-
-
-
-
+
@@ -33,7 +23,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-action-bar-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-action-bar-block.vue
index 9339d3cc..b0ab1f6b 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-action-bar-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-action-bar-block.vue
@@ -41,7 +41,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-block.vue
index c992ed4f..78a99e88 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-block.vue
@@ -92,7 +92,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-setting.vue b/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-setting.vue
index e5160cc3..230c5dab 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-setting.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/display/terminal-display-setting.vue
@@ -15,7 +15,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/extra/ssh-setting-form.vue b/orion-ops-ui/src/views/host/terminal/components/setting/extra/ssh-setting-form.vue
index 9cd8faa7..bc949a31 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/extra/ssh-setting-form.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/extra/ssh-setting-form.vue
@@ -2,7 +2,6 @@
@@ -49,8 +48,8 @@
import { getHostExtraItem } from '@/api/asset/host-extra';
import { ExtraSshAuthType, extraSshAuthTypeKey } from '../../../types/terminal.const';
import { useDictStore } from '@/store';
- import HostKeySelector from '@/components/asset/host-key/host-key-selector.vue';
- import HostIdentitySelector from '@/components/asset/host-identity/host-identity-selector.vue';
+ import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
+ import HostIdentitySelector from '@/components/asset/host-identity/selector/index.vue';
const props = defineProps<{
hostId: number,
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-general-setting.vue b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-general-setting.vue
index 6ceae047..26db44b4 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-general-setting.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-general-setting.vue
@@ -15,7 +15,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-interact-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-interact-block.vue
index 1ff54370..83206f05 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-interact-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-interact-block.vue
@@ -78,7 +78,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-plugins-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-plugins-block.vue
index 8cf69294..74ef7776 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-plugins-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-plugins-block.vue
@@ -33,7 +33,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-session-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-session-block.vue
index e30a8f01..578bc625 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-session-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/general/terminal-session-block.vue
@@ -33,7 +33,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/shortcut/terminal-shortcut-keys-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/shortcut/terminal-shortcut-keys-block.vue
index d499f9e6..5ba20ee0 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/shortcut/terminal-shortcut-keys-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/shortcut/terminal-shortcut-keys-block.vue
@@ -60,7 +60,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-block.vue b/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-block.vue
index 5dcd3896..b1c2dfe2 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-block.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-block.vue
@@ -49,7 +49,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-setting.vue b/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-setting.vue
index c77fd5a4..ec244ab5 100644
--- a/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-setting.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/setting/theme/terminal-theme-setting.vue
@@ -11,7 +11,7 @@
diff --git a/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-chmod-modal.vue b/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-chmod-modal.vue
index 2f361371..0338e0c0 100644
--- a/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-chmod-modal.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/sftp/sftp-chmod-modal.vue
@@ -10,8 +10,7 @@