Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5113aa63bd | ||
|
|
518fd8c839 | ||
|
|
a046faaa07 | ||
|
|
dcf25392ff | ||
|
|
7f24948efa | ||
|
|
59d9739f36 | ||
|
|
26a6d08d96 | ||
|
|
cd59c51344 | ||
|
|
8dec98406d | ||
|
|
9386bfc5c1 | ||
|
|
370272ca43 | ||
|
|
5c6758c8e7 | ||
|
|
11606e25bb | ||
|
|
285f0532d3 | ||
|
|
7bfa8a73be | ||
|
|
d1c6e0cb1c | ||
|
|
fc34b24029 | ||
|
|
7e2269a040 | ||
|
|
55d4d9f7e5 | ||
|
|
06a45c9cf2 | ||
|
|
16dd34ef58 | ||
|
|
aed2436ec5 | ||
|
|
df0ec5b3f7 | ||
|
|
9c2b37ec29 | ||
|
|
47fdcad370 | ||
|
|
76295ba1e3 | ||
|
|
4c1f0ca2c0 | ||
|
|
48a53bc248 |
31
README.md
@@ -1,4 +1,4 @@
|
|||||||
<div align="center"><img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/2/27/8c687ef1-5711-4a93-9db0-79c010af7902.png" alt="logo" width="32" /></div>
|
<div align="center"><img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/5/29/cec03bbd-0eab-464d-9caf-d0b5a7ffc5a6.png" alt="logo" width="32" /></div>
|
||||||
<p style="margin-top: 12px" align="center"><b>一款高颜值、现代化的智能运维&轻量堡垒机平台。</b></p>
|
<p style="margin-top: 12px" align="center"><b>一款高颜值、现代化的智能运维&轻量堡垒机平台。</b></p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a target="_blank"
|
<a target="_blank"
|
||||||
@@ -43,7 +43,8 @@
|
|||||||
**`orion-visor`** 提供一站式服务器运维解决方案。
|
**`orion-visor`** 提供一站式服务器运维解决方案。
|
||||||
|
|
||||||
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
||||||
* **在线终端**:提供在线 Terminal 服务,支持快捷命令、大文件上传、在线编辑等操作。
|
* **在线终端**:提供在线终端 SSH 服务,支持快捷命令、自定义快捷键和主题风格。
|
||||||
|
* **文件管理**:支持远程主机 SFTP 大文件的批量上传、下载和在线编辑等操作。
|
||||||
* **批量操作**:支持批量执行主机命令、多主机文件分发等功能。
|
* **批量操作**:支持批量执行主机命令、多主机文件分发等功能。
|
||||||
* **计划任务**:支持配置 cron 表达式,定时执行主机命令。
|
* **计划任务**:支持配置 cron 表达式,定时执行主机命令。
|
||||||
* **安全可靠**:动态配置权限,记录用户操作日志,提供简单的审计功能。
|
* **安全可靠**:动态配置权限,记录用户操作日志,提供简单的审计功能。
|
||||||
@@ -65,16 +66,16 @@ git clone https://github.com/lijiahangmax/orion-visor
|
|||||||
cd orion-visor
|
cd orion-visor
|
||||||
# 启动
|
# 启动
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
# 等待后端服务启动后 (2min±) 访问 http://localhost:1081/
|
||||||
```
|
```
|
||||||
|
|
||||||
## 项目文档
|
## 项目文档
|
||||||
|
|
||||||
* [文档地址](https://lijiahangmax.github.io/orion-visor/#/)
|
* [文档地址](https://lijiahangmax.github.io/open-orion/orion-visor/)
|
||||||
* [docker安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/docker-install)
|
* [安装文档](https://lijiahangmax.github.io/open-orion/orion-visor/quickstart/docker.html)
|
||||||
* [普通安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/install)
|
* [更新日志](https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html)
|
||||||
* [更新日志](https://lijiahangmax.github.io/orion-visor/#/about/change-log)
|
* [操作手册](https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html)
|
||||||
* [操作手册](https://lijiahangmax.github.io/orion-visor/#/operator/asset)
|
* [常见问题](https://lijiahangmax.github.io/open-orion/orion-visor/support/faq.html)
|
||||||
* [常见问题](https://lijiahangmax.github.io/orion-visor/#/quickstart/faq)
|
|
||||||
|
|
||||||
## 技术栈
|
## 技术栈
|
||||||
|
|
||||||
@@ -88,22 +89,22 @@ docker compose up -d
|
|||||||
|
|
||||||
#### 主机终端
|
#### 主机终端
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
#### 批量执行
|
#### 批量执行
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 批量上传
|
#### 批量上传
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 计划任务
|
#### 计划任务
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
orion-visor-service:
|
orion-visor-service:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.2
|
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.5
|
||||||
ports:
|
ports:
|
||||||
- 1081:80
|
- 1081:80
|
||||||
environment:
|
environment:
|
||||||
@@ -20,7 +20,7 @@ services:
|
|||||||
- orion-visor-mysql
|
- orion-visor-mysql
|
||||||
- orion-visor-redis
|
- orion-visor-redis
|
||||||
orion-visor-mysql:
|
orion-visor-mysql:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.2
|
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.5
|
||||||
privileged: true
|
privileged: true
|
||||||
ports:
|
ports:
|
||||||
- 3307:3306
|
- 3307:3306
|
||||||
@@ -34,7 +34,7 @@ services:
|
|||||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files
|
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql
|
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql
|
||||||
orion-visor-redis:
|
orion-visor-redis:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.2
|
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.5
|
||||||
privileged: true
|
privileged: true
|
||||||
ports:
|
ports:
|
||||||
- 6380:6379
|
- 6380:6379
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
FROM mysql:8.0.28
|
FROM mysql:8.0.28
|
||||||
|
# 系统时区
|
||||||
|
ARG TZ=Asia/Shanghai
|
||||||
|
# 设置时区
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# 复制配置
|
||||||
|
COPY ./my.cnf /etc/mysql/conf.d/my.cnf
|
||||||
|
# 复制初始化脚本
|
||||||
COPY ./sql/init-1-schema-databases.sql /tmp
|
COPY ./sql/init-1-schema-databases.sql /tmp
|
||||||
COPY ./sql/init-2-schema-tables.sql /tmp
|
COPY ./sql/init-2-schema-tables.sql /tmp
|
||||||
COPY ./sql/init-3-schema-quartz.sql /tmp
|
COPY ./sql/init-3-schema-quartz.sql /tmp
|
||||||
COPY ./sql/init-4-data.sql /tmp
|
COPY ./sql/init-4-data.sql /tmp
|
||||||
COPY ./my.cnf /etc/mysql/conf.d/my.cnf
|
# 设置初始化脚本
|
||||||
RUN cat /tmp/init-1-schema-databases.sql >> /tmp/init.sql && \
|
RUN cat /tmp/init-1-schema-databases.sql >> /tmp/init.sql && \
|
||||||
cat /tmp/init-2-schema-tables.sql >> /tmp/init.sql && \
|
cat /tmp/init-2-schema-tables.sql >> /tmp/init.sql && \
|
||||||
cat /tmp/init-3-schema-quartz.sql >> /tmp/init.sql && \
|
cat /tmp/init-3-schema-quartz.sql >> /tmp/init.sql && \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.0.2
|
version=2.0.5
|
||||||
cp -r ../../sql ./sql
|
cp -r ../../sql ./sql
|
||||||
docker build -t orion-visor-mysql:${version} .
|
docker build -t orion-visor-mysql:${version} .
|
||||||
rm -rf ./sql
|
rm -rf ./sql
|
||||||
|
|||||||
@@ -1,4 +1,15 @@
|
|||||||
FROM redis:6.0.16-alpine
|
FROM redis:6.0.16-alpine
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
# 系统时区
|
||||||
|
ARG TZ=Asia/Shanghai
|
||||||
|
# 添加包
|
||||||
|
RUN \
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||||
|
apk update && \
|
||||||
|
apk add tzdata
|
||||||
|
# 设置时区
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# redis 配置
|
||||||
COPY ./redis.conf /tmp
|
COPY ./redis.conf /tmp
|
||||||
RUN cat /tmp/redis.conf > /usr/local/redis.conf
|
RUN cat /tmp/redis.conf > /usr/local/redis.conf
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.0.2
|
version=2.0.5
|
||||||
docker build -t orion-visor-redis:${version} .
|
docker build -t orion-visor-redis:${version} .
|
||||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
USER root
|
USER root
|
||||||
RUN \
|
|
||||||
echo "" > /etc/apk/repositories && \
|
|
||||||
echo "http://mirrors.aliyun.com/alpine/v3.8/main" >> /etc/apk/repositories && \
|
|
||||||
echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories && \
|
|
||||||
apk update
|
|
||||||
RUN apk add openjdk8
|
|
||||||
RUN rm -rf /etc/nginx/conf.d/*
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
# 系统时区
|
||||||
|
ARG TZ=Asia/Shanghai
|
||||||
|
# 添加包
|
||||||
|
RUN \
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||||
|
apk update && \
|
||||||
|
apk add tzdata && \
|
||||||
|
apk add openjdk8
|
||||||
|
# 设置时区
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# 删除原 nginx 配置
|
||||||
|
RUN rm -rf /etc/nginx/conf.d/*
|
||||||
|
# 复制包
|
||||||
COPY ./orion-visor-launch.jar /app/app.jar
|
COPY ./orion-visor-launch.jar /app/app.jar
|
||||||
COPY ./dist /usr/share/nginx/html
|
COPY ./dist /usr/share/nginx/html
|
||||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||||
COPY ./nginx.conf /etc/nginx/conf.d
|
COPY ./nginx.conf /etc/nginx/conf.d
|
||||||
|
# 启动
|
||||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.0.2
|
version=2.0.5
|
||||||
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
||||||
mv ../../orion-visor-ui/dist ./dist
|
mv ../../orion-visor-ui/dist ./dist
|
||||||
docker build -t orion-visor-service:${version} .
|
docker build -t orion-visor-service:${version} .
|
||||||
|
|||||||
@@ -40,10 +40,17 @@
|
|||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
<p><b>⛔⛔此页面已不再维护, 请跳转至
|
||||||
|
<a target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor">这里</a>
|
||||||
|
查看最新文档 ❗</b></p>
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
|
||||||
**`orion-visor`** 提供一站式服务器运维解决方案。
|
**`orion-visor`** 提供一站式服务器运维解决方案。
|
||||||
|
|
||||||
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
||||||
* **在线终端**:提供在线 Terminal 服务,支持快捷命令、大文件上传、在线编辑等操作。
|
* **在线终端**:提供在线终端 SSH 服务,支持快捷命令、自定义快捷键和主题风格。
|
||||||
|
* **文件管理**:支持远程主机 SFTP 大文件的批量上传、下载和在线编辑等操作。
|
||||||
* **批量操作**:支持批量执行主机命令、多主机文件分发等功能。
|
* **批量操作**:支持批量执行主机命令、多主机文件分发等功能。
|
||||||
* **计划任务**:支持配置 cron 表达式,定时执行主机命令。
|
* **计划任务**:支持配置 cron 表达式,定时执行主机命令。
|
||||||
* **安全可靠**:动态配置权限,记录用户操作日志,提供简单的审计功能。
|
* **安全可靠**:动态配置权限,记录用户操作日志,提供简单的审计功能。
|
||||||
@@ -69,9 +76,8 @@ docker compose up -d
|
|||||||
|
|
||||||
## 项目文档
|
## 项目文档
|
||||||
|
|
||||||
* [文档地址](https://lijiahangmax.github.io/orion-visor/#/)
|
* [文档地址](/)
|
||||||
* [docker安装](/quickstart/docker-install)
|
* [安装文档](/quickstart/docker-install)
|
||||||
* [普通安装](/quickstart/install)
|
|
||||||
* [更新日志](/about/change-log)
|
* [更新日志](/about/change-log)
|
||||||
* [操作手册](/operator/asset)
|
* [操作手册](/operator/asset)
|
||||||
* [常见问题](/quickstart/faq)
|
* [常见问题](/quickstart/faq)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# orion-visor <small>2.0.2</small>
|
# orion-visor
|
||||||
|
|
||||||
> 一款开箱即用的运维平台。
|
> 一款高颜值、现代化的智能运维&轻量堡垒机平台。
|
||||||
|
|
||||||
- 友好 易用
|
- 友好 易用
|
||||||
- 安全 稳定
|
- 安全 稳定
|
||||||
|
|||||||
@@ -14,6 +14,16 @@
|
|||||||
* 执行 升级的 `bash` 脚本
|
* 执行 升级的 `bash` 脚本
|
||||||
* 进入 代码目录执行 `sh docker-upgrade.sh` 进行容器升级 `down` > `pull` > `up -d`
|
* 进入 代码目录执行 `sh docker-upgrade.sh` 进行容器升级 `down` > `pull` > `up -d`
|
||||||
|
|
||||||
|
### v2.0.3
|
||||||
|
|
||||||
|
`2024-05-29` `release`
|
||||||
|
|
||||||
|
* 🐞 修复 部分 ui 显示错误
|
||||||
|
* 🐞 修复 计划任务编辑时报错
|
||||||
|
* 🐞 修复 计划任务手动触发时报错
|
||||||
|
* 🩰 修改 logo
|
||||||
|
* 🔨 修改 docker 时区
|
||||||
|
|
||||||
### v2.0.2
|
### v2.0.2
|
||||||
|
|
||||||
`2024-05-24` `release`
|
`2024-05-24` `release`
|
||||||
|
|||||||
BIN
docs/assert/favicon.ico
Normal file
|
After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 145 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 141 KiB |
@@ -1,17 +1,22 @@
|
|||||||
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<defs>
|
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
<style>.cls-1{fill:url(#未命名的渐变_4);}.cls-2{fill:url(#未命名的渐变_6);}</style>
|
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||||
<linearGradient id="未命名的渐变_4" x1="0.32" y1="15.03" x2="20.16" y2="15.03" gradientUnits="userSpaceOnUse">
|
<style type="text/css">
|
||||||
<stop offset="0" stop-color="#23b6b6"/>
|
.st0{fill:url(#SVGID_1_);}
|
||||||
<stop offset="1" stop-color="#189c98"/>
|
.st1{fill:#3B28CC;}
|
||||||
</linearGradient>
|
</style>
|
||||||
<linearGradient id="未命名的渐变_6" x1="11.84" y1="16.97" x2="31.68" y2="16.97" gradientUnits="userSpaceOnUse">
|
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="27.1802" y1="7.7935" x2="15.2269" y2="25.137">
|
||||||
<stop offset="0" stop-color="#08589b"/>
|
<stop offset="0" style="stop-color:#ADD7F6"/>
|
||||||
<stop offset="1" stop-color="#2167b2"/>
|
<stop offset="0.2512" style="stop-color:#AAD5F6"/>
|
||||||
</linearGradient>
|
<stop offset="0.4195" style="stop-color:#A1CDF7"/>
|
||||||
</defs>
|
<stop offset="0.5636" style="stop-color:#92C1F8"/>
|
||||||
<path class="cls-1"
|
<stop offset="0.694" style="stop-color:#7DAFF9"/>
|
||||||
d="M20,17.37a1.56,1.56,0,0,0-2.13-.65l-7.56,4.07A4.65,4.65,0,0,1,4,18.91H4a4.65,4.65,0,0,1,1.88-6.3L13.6,8.44a1.56,1.56,0,0,0,.64-2.1h0a1.56,1.56,0,0,0-2.13-.65l-8,4.3a7.24,7.24,0,0,0-2.94,9.82l.51.94a7.24,7.24,0,0,0,9.82,2.94l7.81-4.22a1.56,1.56,0,0,0,.65-2.1Z"/>
|
<stop offset="0.8152" style="stop-color:#6198FB"/>
|
||||||
<path class="cls-2"
|
<stop offset="0.9279" style="stop-color:#407CFD"/>
|
||||||
d="M12,14.63a1.56,1.56,0,0,0,2.13.65l7.56-4.07A4.65,4.65,0,0,1,28,13.09h0a4.65,4.65,0,0,1-1.88,6.3L18.4,23.56a1.56,1.56,0,0,0-.64,2.1h0a1.56,1.56,0,0,0,2.13.65l8-4.3a7.24,7.24,0,0,0,2.94-9.82l-.51-.94a7.24,7.24,0,0,0-9.82-2.94l-7.81,4.22a1.56,1.56,0,0,0-.65,2.1Z"/>
|
<stop offset="1" style="stop-color:#2667FF"/>
|
||||||
|
</linearGradient>
|
||||||
|
<path class="st0" d="M31.41,4.01h-8.04c-0.27,0-0.51,0.18-0.57,0.44c-0.64,2.56-4.19,15.45-11.86,20.81c0,0,9.5,13.77,21.03-20.47
|
||||||
|
C32.1,4.4,31.81,4.01,31.41,4.01z"/>
|
||||||
|
<path class="st1" d="M0.62,3.98h8.02c0.28,0,0.52,0.18,0.59,0.45c0.69,2.58,4.47,15.52,12.14,20.88c0,0-10.88,13.73-21.34-20.54
|
||||||
|
C-0.09,4.37,0.2,3.98,0.62,3.98z"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -2,10 +2,10 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>关于 orion-visor</title>
|
<title>orion-visor</title>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||||
<meta name="description" content="Description">
|
<meta name="description" content="Description">
|
||||||
<link rel="icon" href="./assert/logo.svg">
|
<link rel="icon" href="./assert/favicon.ico">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||||||
<!-- Theme: Defaults -->
|
<!-- Theme: Defaults -->
|
||||||
<link rel="stylesheet" href="./assert/font.css">
|
<link rel="stylesheet" href="./assert/font.css">
|
||||||
|
|||||||
@@ -34,7 +34,3 @@
|
|||||||
### 资产授权
|
### 资产授权
|
||||||
|
|
||||||
给用户/角色授权资产数据, 若无授权则无法访问资产。
|
给用户/角色授权资产数据, 若无授权则无法访问资产。
|
||||||
|
|
||||||
给用户授权时: 若当前选择的用户有管理员角色(admin)则无需配置, 管理员拥有全部权限。
|
|
||||||
给角色授权时: 无需给管理员(admin)配置, 管理员拥有全部权限。
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
* 命令: 查看执行时的命令
|
* 命令: 查看执行时的命令
|
||||||
* 参数: 查看执行时的参数
|
* 参数: 查看执行时的参数
|
||||||
* 中断: 中断命令执行
|
* 中断: 中断命令执行
|
||||||
* 日志: 查看执行日志, ctrl + 左键点击会用新页面打开
|
* 日志: 查看执行日志 `ctrl + 左键` 点击会用新页面打开
|
||||||
* 下载: 下载执行日志
|
* 下载: 下载执行日志
|
||||||
|
|
||||||
### 批量上传
|
### 批量上传
|
||||||
@@ -65,14 +65,14 @@
|
|||||||
### 日志面板快捷键
|
### 日志面板快捷键
|
||||||
|
|
||||||
* 回车: `Enter`
|
* 回车: `Enter`
|
||||||
* 向上滚动一行: `↑`
|
|
||||||
* 向上滚动一页: `Home`
|
|
||||||
* 向下滚动一行: `↓`
|
|
||||||
* 向下滚动一页: `End`
|
|
||||||
* 全选: `ctrl` `A`
|
* 全选: `ctrl` `A`
|
||||||
* 复制: `ctrl` `C`
|
* 复制: `ctrl` `C`
|
||||||
* 搜索: `ctrl` `F`
|
* 搜索: `ctrl` `F`
|
||||||
* 清空: `ctrl` `L`
|
* 清空: `ctrl` `L`
|
||||||
|
* 向上滚动一行: `↑`
|
||||||
|
* 向上滚动一页: `Home`
|
||||||
|
* 向下滚动一行: `↓`
|
||||||
|
* 向下滚动一页: `End`
|
||||||
|
|
||||||
### 命令内置参数
|
### 命令内置参数
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
> 右侧状态栏
|
> 右侧状态栏
|
||||||
|
|
||||||
* 命令片段: 自定义快速执行的命令片段, 双击直接执行
|
* 命令片段: 自定义快速执行的命令片段, 双击直接执行
|
||||||
|
* 路径书签: 自定义快速进入的目录
|
||||||
* 传输列表: 打开文件传输列表, 当前会话下, 所有的文件上传下载传输都会显示在这里
|
* 传输列表: 打开文件传输列表, 当前会话下, 所有的文件上传下载传输都会显示在这里
|
||||||
* 截图: 截屏终端并且自动下载
|
* 截图: 截屏终端并且自动下载
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
### 任务列表
|
### 任务列表
|
||||||
|
|
||||||
⚡ 内置参数同 `批量执行 > 命令执行` [查看](/operator/exec.md?id=命令内置参数)
|
⚡ 内置参数同 `批量执行` > `命令执行` [查看](/operator/exec.md?id=命令内置参数)
|
||||||
|
|
||||||
维护计划任务, 定时执行命令。
|
维护计划任务, 定时执行命令。
|
||||||
|
|
||||||
@@ -22,5 +22,5 @@
|
|||||||
* 命令: 查看执行时的命令
|
* 命令: 查看执行时的命令
|
||||||
* 参数: 查看执行时的参数
|
* 参数: 查看执行时的参数
|
||||||
* 中断: 中断命令执行
|
* 中断: 中断命令执行
|
||||||
* 日志: 查看执行日志, ctrl + 左键点击会用新页面打开
|
* 日志: 查看执行日志 `ctrl + 左键` 点击会用新页面打开
|
||||||
* 下载: 下载执行日志
|
* 下载: 下载执行日志
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
* 新增: 添加一个字典项
|
* 新增: 添加一个字典项
|
||||||
* 刷新缓存: 强制刷新服务器缓存, 一般是手动修改了数据库后需要点击此按钮
|
* 刷新缓存: 强制刷新服务器缓存, 一般是手动修改了数据库后需要点击此按钮
|
||||||
* 查看: 查看字典值的json
|
* 查看: 查看字典值的 json
|
||||||
* 修改: 修改字典项
|
* 修改: 修改字典项
|
||||||
* 删除: 删除字典项以及字典值
|
* 删除: 删除字典项以及字典值
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,7 @@
|
|||||||
⚡ npm 建议使用淘宝镜像 `npm config set registry https://registry.npmmirror.com/`
|
⚡ npm 建议使用淘宝镜像 `npm config set registry https://registry.npmmirror.com/`
|
||||||
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`
|
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`
|
||||||
|
|
||||||
### 配置
|
### 拉取代码
|
||||||
|
|
||||||
1. 拉取代码
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# github
|
# github
|
||||||
@@ -22,7 +20,7 @@ git clone https://github.com/lijiahangmax/orion-visor
|
|||||||
git clone https://gitee.com/lijiahangmax/orion-visor
|
git clone https://gitee.com/lijiahangmax/orion-visor
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 初始化数据库
|
### 初始化数据库
|
||||||
|
|
||||||
```
|
```
|
||||||
# 执行脚本
|
# 执行脚本
|
||||||
@@ -32,7 +30,7 @@ orion-visor/sql/init-3-schema-quartz.sql
|
|||||||
orion-visor/sql/init-4-data.sql
|
orion-visor/sql/init-4-data.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 修改后端配置
|
### 修改后端配置
|
||||||
|
|
||||||
```
|
```
|
||||||
# 修改配置文件 (mysql, redis, secret-key)
|
# 修改配置文件 (mysql, redis, secret-key)
|
||||||
@@ -46,9 +44,9 @@ mvn -U clean install -DskipTests
|
|||||||
com.orion.visor.launch.LaunchApplication
|
com.orion.visor.launch.LaunchApplication
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 修改前端配置
|
### 修改前端配置
|
||||||
|
|
||||||
```
|
```shell
|
||||||
# 进入代码目录
|
# 进入代码目录
|
||||||
cd orion-visor/orion-visor-ui
|
cd orion-visor/orion-visor-ui
|
||||||
# 下载 pnpm
|
# 下载 pnpm
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Dashboard 修改)
|
|||||||
|
|
||||||
### 拉取代码
|
### 拉取代码
|
||||||
|
|
||||||
```
|
```shell
|
||||||
# github
|
# github
|
||||||
git clone https://github.com/lijiahangmax/orion-visor
|
git clone https://github.com/lijiahangmax/orion-visor
|
||||||
# gitee
|
# gitee
|
||||||
@@ -41,18 +41,18 @@ cd orion-visor
|
|||||||
|
|
||||||
### 启动
|
### 启动
|
||||||
|
|
||||||
```
|
```shell
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
### 连接 mysql (如果需要在 navicat 中连接)
|
### 修改加密方式
|
||||||
|
|
||||||
```
|
```
|
||||||
访问 adminer: http://localhost:8081
|
访问 adminer: http://localhost:8081
|
||||||
服务器: orion-visor-mysql
|
服务器: orion-visor-mysql
|
||||||
用户名: root
|
用户名: root
|
||||||
密码: Data@123456
|
密 码: Data@123456
|
||||||
数据库: orion-visor
|
数据库: orion_visor
|
||||||
|
|
||||||
点击左侧 SQL命令 输入:
|
点击左侧 SQL命令 输入:
|
||||||
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Data@123456';
|
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Data@123456';
|
||||||
@@ -62,5 +62,5 @@ ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Data@123456';
|
|||||||
### 测试访问
|
### 测试访问
|
||||||
|
|
||||||
在浏览器中输入 http://localhost:1081/ 访问
|
在浏览器中输入 http://localhost:1081/ 访问
|
||||||
账号: admin
|
账号: `admin`
|
||||||
密码: admin
|
密码: `admin`
|
||||||
|
|||||||
@@ -1,27 +1,42 @@
|
|||||||
> ##### 1. 数据误删除怎么办?
|
### 日志文件在哪?
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 宿主机
|
||||||
|
tail -f -n 200 /data/orion-visor-space/docker-volumes/orion-visor-service/root-orion/logs/orion-visor/app.log
|
||||||
|
# 容器内
|
||||||
|
tail -f -n 200 /root/orion/logs/orion-visor/app.log
|
||||||
|
# 滚动日志 .../logs/orion-visor/rolling/*
|
||||||
|
```
|
||||||
|
|
||||||
|
### 数据误删除怎么办?
|
||||||
|
|
||||||
数据库的数据都采用了逻辑删除, 可以将已删除的数据中的 `deleted` 字段改为 `0`
|
数据库的数据都采用了逻辑删除, 可以将已删除的数据中的 `deleted` 字段改为 `0`
|
||||||
如果不知道数据是哪一条, 可以查询用户操作日志, 点击 `参数` 寻找操作的id
|
如果不知道数据是哪一条, 可以查询用户操作日志, 点击 `参数` 寻找操作的id
|
||||||
|
|
||||||
> ##### 2. 执行命令时为什么会找不到环境变量?
|
### 执行命令时为什么会找不到环境变量?
|
||||||
|
|
||||||
可以在执行命令的第一行设置 `source /etc/profile` 来加载环境变量
|
可以在执行命令的第一行设置 `source /etc/profile` 来加载环境变量
|
||||||
|
|
||||||
> ##### 3. 命令中途执行失败如何设置中断执行?
|
### 命令中途执行失败如何设置中断执行?
|
||||||
|
|
||||||
可以在执行命令的第一行设置 `set -e`
|
可以在执行命令的第一行设置 `set -e`
|
||||||
作用是: 当执行出现意料之外的情况时, 立即退出
|
作用是: 当执行出现意料之外的情况时, 立即退出
|
||||||
|
|
||||||
> ##### 4. 在调度任务、批量执行 命令执行成功的依据是什么?
|
### 在调度任务、批量执行 命令执行成功的依据是什么?
|
||||||
|
|
||||||
是获取命令的 `exitcode` 判断是否为 `0` 如果非0则代表命令执行失败
|
是获取命令的 `exitcode` 判断是否为 `0` 如果非0则代表命令执行失败
|
||||||
同理, 在命令的最后一行设置 `exit 1` 结果将会是失败, 可以用此来中断后续流程
|
同理, 在命令的最后一行设置 `exit 1` 结果将会是失败, 可以用此来中断后续流程
|
||||||
|
|
||||||
> ##### 5. 调度任务、批量执行 的日志文件中如何只保存原始输出?
|
### 调度任务、批量执行 的日志文件中如何只保存原始输出?
|
||||||
|
|
||||||
修改 `application.yaml` `app.exec-log.append-ansi` 为 `false`
|
修改 `application.yaml` `app.exec-log.append-ansi` 为 `false`
|
||||||
|
|
||||||
> ##### 6. 为什么使用密钥认证还是无法连接机器?
|
### SFTP 为什么有些文件无法编辑?
|
||||||
|
|
||||||
|
只有普通文件可以在线编辑, 也就是 attr 为 `-` 开头的文件, 且文件大小不超过 `2MB` (默认)
|
||||||
|
修改 `.env.production` `VITE_SFTP_PREVIEW_MB` 改为一个合适的大小(MB) 重新构建
|
||||||
|
|
||||||
|
### 为什么使用密钥认证还是无法连接机器?
|
||||||
|
|
||||||
```
|
```
|
||||||
# 升级 openssh
|
# 升级 openssh
|
||||||
@@ -41,9 +56,3 @@ AuthorizedKeysFile .ssh/authorized_keys
|
|||||||
# 重启 sshd 服务
|
# 重启 sshd 服务
|
||||||
service sshd restart
|
service sshd restart
|
||||||
```
|
```
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
⚡ 详细使用请参考操作手册~
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|||||||
@@ -12,9 +12,7 @@
|
|||||||
⚡ npm 建议使用淘宝镜像 `npm config set registry https://registry.npmmirror.com/`
|
⚡ npm 建议使用淘宝镜像 `npm config set registry https://registry.npmmirror.com/`
|
||||||
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`
|
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`
|
||||||
|
|
||||||
### 构建
|
### 拉取代码
|
||||||
|
|
||||||
1. 拉取代码
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# github
|
# github
|
||||||
@@ -23,7 +21,7 @@ git clone https://github.com/lijiahangmax/orion-visor
|
|||||||
git clone https://gitee.com/lijiahangmax/orion-visor
|
git clone https://gitee.com/lijiahangmax/orion-visor
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 初始化数据库
|
### 初始化数据库
|
||||||
|
|
||||||
```
|
```
|
||||||
# 执行脚本
|
# 执行脚本
|
||||||
@@ -33,7 +31,7 @@ orion-visor/sql/init-3-schema-quartz.sql
|
|||||||
orion-visor/sql/init-4-data.sql
|
orion-visor/sql/init-4-data.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 构建后端代码
|
### 构建后端代码
|
||||||
|
|
||||||
```
|
```
|
||||||
# 修改配置文件 (mysql, redis, secret-key)
|
# 修改配置文件 (mysql, redis, secret-key)
|
||||||
@@ -45,7 +43,7 @@ cd orion-visor
|
|||||||
mvn -U clean install -DskipTests
|
mvn -U clean install -DskipTests
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 构建前端代码
|
### 构建前端代码
|
||||||
|
|
||||||
```
|
```
|
||||||
# 进入代码目录
|
# 进入代码目录
|
||||||
@@ -122,7 +120,7 @@ server {
|
|||||||
|
|
||||||
```
|
```
|
||||||
复制 orion-visor/orion-visor-ui/dist 到 /usr/share/nginx/html
|
复制 orion-visor/orion-visor-ui/dist 到 /usr/share/nginx/html
|
||||||
复制 orion-visor/orion-visor-launch/target/orion-visor-launch.jar 到 /data/orion
|
复制 orion-visor/orion-visor-launch/target/orion-visor-launch.jar 到 /data/orion-visor-space
|
||||||
# 启动后台服务
|
# 启动后台服务
|
||||||
nohup java -jar orion-visor-launch.jar --spring.profiles.active=prod 2>&1 &
|
nohup java -jar orion-visor-launch.jar --spring.profiles.active=prod 2>&1 &
|
||||||
# 启动 nginx
|
# 启动 nginx
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.0
|
### v1.0.0
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 字典配置项
|
-- 字典配置项
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
## v1.0.1
|
### v1.0.1
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
DROP TABLE IF EXISTS `command_template`;
|
DROP TABLE IF EXISTS `command_template`;
|
||||||
ALTER TABLE `operator_log` ADD INDEX `idx_type`(`type`);
|
ALTER TABLE `operator_log` ADD INDEX `idx_type`(`type`);
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 菜单配置
|
-- 菜单配置
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.2
|
### v1.0.2
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
ALTER TABLE `host_connect_log`
|
ALTER TABLE `host_connect_log`
|
||||||
@@ -83,7 +83,7 @@ CREATE TABLE `exec_template`
|
|||||||
ROW_FORMAT = Dynamic;
|
ROW_FORMAT = Dynamic;
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 菜单配置
|
-- 菜单配置
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.3
|
### v1.0.3
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
DELETE FROM preference WHERE type = 'TERMINAL';
|
DELETE FROM preference WHERE type = 'TERMINAL';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.4
|
### v1.0.4
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 修改字段
|
-- 修改字段
|
||||||
@@ -260,7 +260,7 @@ CREATE TABLE `QRTZ_SCHEDULER_STATE`
|
|||||||
ROW_FORMAT = Dynamic;
|
ROW_FORMAT = Dynamic;
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 操作日志修改
|
-- 操作日志修改
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.5
|
### v1.0.5
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
ALTER TABLE `system_user`
|
ALTER TABLE `system_user`
|
||||||
@@ -22,7 +22,7 @@ ALTER TABLE `exec_host_log`
|
|||||||
ADD COLUMN `script_path` varchar(512) NULL COMMENT '脚本路径' AFTER `log_path`;
|
ADD COLUMN `script_path` varchar(512) NULL COMMENT '脚本路径' AFTER `log_path`;
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 初始化主机身份类型
|
-- 初始化主机身份类型
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.6
|
### v1.0.6
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 数据分组添加 userId
|
-- 数据分组添加 userId
|
||||||
@@ -58,10 +58,9 @@ CREATE TABLE `path_bookmark`
|
|||||||
CHARACTER SET = utf8mb4
|
CHARACTER SET = utf8mb4
|
||||||
COLLATE = utf8mb4_general_ci COMMENT = '路径书签'
|
COLLATE = utf8mb4_general_ci COMMENT = '路径书签'
|
||||||
ROW_FORMAT = Dynamic;
|
ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 设置数据分组 user_id
|
-- 设置数据分组 user_id
|
||||||
@@ -88,7 +87,7 @@ INSERT INTO `dict_value` VALUES (274, 39, 'pathBookmarkType', 'FILE', '文件',
|
|||||||
INSERT INTO `dict_value` VALUES (275, 39, 'pathBookmarkType', 'DIR', '文件夹', '{}', 20, '2024-04-24 13:43:39', '2024-04-24 13:43:39', '1', '1', 0);
|
INSERT INTO `dict_value` VALUES (275, 39, 'pathBookmarkType', 'DIR', '文件夹', '{}', 20, '2024-04-24 13:43:39', '2024-04-24 13:43:39', '1', '1', 0);
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - 命令分组初始化
|
### sql 脚本 - 命令分组初始化
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 插入命令片段分组
|
-- 插入命令片段分组
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.7
|
### v1.0.7
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
ALTER TABLE `data_permission` COMMENT = '数据权限表';
|
ALTER TABLE `data_permission` COMMENT = '数据权限表';
|
||||||
@@ -57,7 +57,7 @@ CREATE TABLE `upload_task_file`
|
|||||||
ROW_FORMAT = Dynamic;
|
ROW_FORMAT = Dynamic;
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 字典项
|
-- 字典项
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## v1.0.8
|
### v1.0.8
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 修改字段名称
|
-- 修改字段名称
|
||||||
@@ -32,7 +32,7 @@ CREATE TABLE `system_message`
|
|||||||
ROW_FORMAT = Dynamic;
|
ROW_FORMAT = Dynamic;
|
||||||
```
|
```
|
||||||
|
|
||||||
> sql 脚本 - DML
|
### sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 菜单
|
-- 菜单
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
## v2.0.0
|
### v2.0.0
|
||||||
|
|
||||||
### ⚡ **本次升级提示 本次更新较大 请仔细查阅** ⚡
|
### ⚡ **本次升级提示 本次更新较大 请仔细查阅** ⚡
|
||||||
|
|
||||||
##### 本次升级思路:
|
|
||||||
|
|
||||||
* 先执行以下 **`7`** 个脚本
|
* 先执行以下 **`7`** 个脚本
|
||||||
* 容器下线 `docker compose down`
|
* 容器下线 `docker compose down`
|
||||||
* 删除原代码目录 `rm -rf orion-ops-pro`
|
* 删除原代码目录 `rm -rf orion-ops-pro`
|
||||||
* 克隆改名后的项目 `git clone https://github.com/lijiahangmax/orion-visor.git` or `gitee`
|
* 克隆改名后的项目 `git clone https://github.com/lijiahangmax/orion-visor.git` or `gitee`
|
||||||
* 启动容器 `docker compose up -d`
|
* 启动容器 `docker compose up -d`
|
||||||
|
|
||||||
```readme
|
```text
|
||||||
sql 在 adminer/navicat 中执行, bash 脚本直接修改后粘贴执行 不要保存为文件执行否则会出错
|
sql 在 adminer/navicat 中执行, bash 脚本直接修改后粘贴执行 不要保存为文件执行否则会出错
|
||||||
本次升级包含数据库重命名操作。#3 创建新数据库, #4 进行数据迁移, #5 删除旧数据库。
|
本次升级包含数据库重命名操作。#3 创建新数据库, #4 进行数据迁移, #5 删除旧数据库。
|
||||||
[不推荐] 如果不想重命名可以修改 docker-compose.yml, 将 MYSQL_DATABASE 改为 orion-ops-pro 并且跳过步骤 #3 #4 #5
|
[不推荐] 如果不想重命名可以修改 docker-compose.yml, 将 MYSQL_DATABASE 改为 orion-ops-pro 并且跳过步骤 #3 #4 #5
|
||||||
```
|
```
|
||||||
|
|
||||||
> #1 sql 脚本 - DDL
|
### 1. sql 脚本 - DDL
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 修改默认值
|
-- 修改默认值
|
||||||
@@ -29,7 +27,7 @@ MODIFY COLUMN `key_id` bigint(0) NULL DEFAULT NULL COMMENT '密钥id' AFTER `pas
|
|||||||
ALTER TABLE `host_key` COMMENT = '主机密钥';
|
ALTER TABLE `host_key` COMMENT = '主机密钥';
|
||||||
```
|
```
|
||||||
|
|
||||||
> #2 sql 脚本 - DML
|
### 2. sql 脚本 - DML
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 删除 quartz 配置
|
-- 删除 quartz 配置
|
||||||
@@ -70,14 +68,14 @@ INSERT INTO `dict_value` VALUES (174, 26, 'hostExtraSshAuthType', 'CUSTOM_KEY',
|
|||||||
INSERT INTO `dict_value` VALUES (271, 37, 'hostIdentityType', 'KEY', '密钥', '{\"color\": \"arcoblue\"}', 20, '2024-04-16 17:18:12', '2024-05-17 12:49:16', '2', '2', 0);
|
INSERT INTO `dict_value` VALUES (271, 37, 'hostIdentityType', 'KEY', '密钥', '{\"color\": \"arcoblue\"}', 20, '2024-04-16 17:18:12', '2024-05-17 12:49:16', '2', '2', 0);
|
||||||
```
|
```
|
||||||
|
|
||||||
> #3 sql 脚本 - 创建数据库 orion_visor
|
### 3. sql 脚本 - 创建数据库 orion_visor
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 创建数据库
|
-- 创建数据库
|
||||||
CREATE DATABASE IF NOT EXISTS `orion_visor` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
CREATE DATABASE IF NOT EXISTS `orion_visor` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||||
```
|
```
|
||||||
|
|
||||||
> #4 bash 脚本 - 数据迁移
|
### 4. bash 脚本 - 数据迁移
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 可以使用 navicat 的数据迁移功能, 下面描述的是 bash 中执行, 注意下面的变量替换
|
# 可以使用 navicat 的数据迁移功能, 下面描述的是 bash 中执行, 注意下面的变量替换
|
||||||
@@ -97,14 +95,14 @@ rm -f /tmp/orion-ops-pro_dump.sql
|
|||||||
exit
|
exit
|
||||||
```
|
```
|
||||||
|
|
||||||
> #5 sql 脚本 - 删除数据库
|
### 5. sql 脚本 - 删除数据库
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
-- 删除数据库
|
-- 删除数据库
|
||||||
DROP DATABASE `orion-ops-pro`;
|
DROP DATABASE `orion-ops-pro`;
|
||||||
```
|
```
|
||||||
|
|
||||||
> #6 bash 脚本 - 修改 nginx 配置
|
### 6. bash 脚本 - 修改 nginx 配置
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pro_container_id=41dfd6aff736;
|
pro_container_id=41dfd6aff736;
|
||||||
@@ -118,7 +116,7 @@ nginx -s reload
|
|||||||
exit
|
exit
|
||||||
```
|
```
|
||||||
|
|
||||||
> #7 bash 脚本 - 工作空间迁移
|
### 7. bash 脚本 - 工作空间迁移
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 迁移工作空间
|
# 迁移工作空间
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
## v2.0.3
|
|
||||||
|
|
||||||
> sql 脚本 - DDL
|
|
||||||
|
|
||||||
```sql
|
|
||||||
```
|
|
||||||
|
|
||||||
> sql 脚本 - DML
|
|
||||||
|
|
||||||
```sql
|
|
||||||
```
|
|
||||||
11
docs/update/v2.0.x.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
### v2.0.x
|
||||||
|
|
||||||
|
### sql 脚本 - DDL
|
||||||
|
|
||||||
|
```sql
|
||||||
|
```
|
||||||
|
|
||||||
|
### sql 脚本 - DML
|
||||||
|
|
||||||
|
```sql
|
||||||
|
```
|
||||||
@@ -14,11 +14,11 @@
|
|||||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>2.0.2</revision>
|
<revision>2.0.5</revision>
|
||||||
<spring.boot.version>2.7.17</spring.boot.version>
|
<spring.boot.version>2.7.17</spring.boot.version>
|
||||||
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
||||||
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
||||||
<orion.kit.revision>1.0.7</orion.kit.revision>
|
<orion.kit.version>1.0.7</orion.kit.version>
|
||||||
<aspectj.version>1.9.7</aspectj.version>
|
<aspectj.version>1.9.7</aspectj.version>
|
||||||
<lombok.version>1.18.26</lombok.version>
|
<lombok.version>1.18.26</lombok.version>
|
||||||
<springdoc.version>1.6.15</springdoc.version>
|
<springdoc.version>1.6.15</springdoc.version>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.lijiahangmax</groupId>
|
<groupId>io.github.lijiahangmax</groupId>
|
||||||
<artifactId>orion-all</artifactId>
|
<artifactId>orion-all</artifactId>
|
||||||
<version>${orion.kit.revision}</version>
|
<version>${orion.kit.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>orion-log</artifactId>
|
<artifactId>orion-log</artifactId>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public interface AppConst extends OrionConst {
|
|||||||
/**
|
/**
|
||||||
* 同 ${orion.version} 迭代时候需要手动更改
|
* 同 ${orion.version} 迭代时候需要手动更改
|
||||||
*/
|
*/
|
||||||
String VERSION = "2.0.2";
|
String VERSION = "2.0.5";
|
||||||
|
|
||||||
String ORION_VISOR = "orion-visor";
|
String ORION_VISOR = "orion-visor";
|
||||||
|
|
||||||
|
|||||||
@@ -97,4 +97,6 @@ public interface ErrorMessage {
|
|||||||
|
|
||||||
String PLEASE_CHECK_HOST_SSH = "请检查主机 {} 是否存在/权限/SSH配置";
|
String PLEASE_CHECK_HOST_SSH = "请检查主机 {} 是否存在/权限/SSH配置";
|
||||||
|
|
||||||
|
String CLIENT_ABORT = "手动中断";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,10 +62,6 @@ public class CustomFileFilter {
|
|||||||
if (!table.isEnableCache()) {
|
if (!table.isEnableCache()) {
|
||||||
files.removeIf(file -> isServerCacheFile(file.getTemplatePath()));
|
files.removeIf(file -> isServerCacheFile(file.getTemplatePath()));
|
||||||
}
|
}
|
||||||
// 不生成导出文件
|
|
||||||
if (!table.isEnableExport()) {
|
|
||||||
files.removeIf(file -> isExportFile(file.getTemplatePath()));
|
|
||||||
}
|
|
||||||
// 不生成操作日志文件
|
// 不生成操作日志文件
|
||||||
if (!table.isEnableOperatorLog()) {
|
if (!table.isEnableOperatorLog()) {
|
||||||
files.removeIf(file -> isOperatorLogFile(file.getTemplatePath()));
|
files.removeIf(file -> isOperatorLogFile(file.getTemplatePath()));
|
||||||
|
|||||||
@@ -73,16 +73,6 @@ public class ServerTemplate extends Template {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 生成导出
|
|
||||||
// *
|
|
||||||
// * @return this
|
|
||||||
// */
|
|
||||||
// public ServerTemplate enableExport() {
|
|
||||||
// table.enableExport = true;
|
|
||||||
// return this;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不生成单元测试
|
* 不生成单元测试
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ public class Table {
|
|||||||
*/
|
*/
|
||||||
protected boolean enableUnitTest;
|
protected boolean enableUnitTest;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否生成导出
|
|
||||||
*/
|
|
||||||
protected boolean enableExport;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否可缓存
|
* 是否可缓存
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class VueTemplate extends Template {
|
|||||||
public VueTemplate(Table table, String module, String feature) {
|
public VueTemplate(Table table, String module, String feature) {
|
||||||
super(table);
|
super(table);
|
||||||
table.enableVue = true;
|
table.enableVue = true;
|
||||||
|
table.enableRowSelection = true;
|
||||||
table.module = module;
|
table.module = module;
|
||||||
table.feature = feature;
|
table.feature = feature;
|
||||||
}
|
}
|
||||||
@@ -54,12 +55,12 @@ public class VueTemplate extends Template {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表可多选
|
* 关闭列表可多选
|
||||||
*
|
*
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public VueTemplate enableRowSelection() {
|
public VueTemplate disableRowSelection() {
|
||||||
table.enableRowSelection = true;
|
table.enableRowSelection = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,19 +68,5 @@ Authorization: {{token}}
|
|||||||
${httpComment} ${apiComment.batchDelete}
|
${httpComment} ${apiComment.batchDelete}
|
||||||
DELETE {{baseUrl}}/${package.ModuleName}/${typeHyphen}/batch-delete?idList=1,2,3
|
DELETE {{baseUrl}}/${package.ModuleName}/${typeHyphen}/batch-delete?idList=1,2,3
|
||||||
Authorization: {{token}}
|
Authorization: {{token}}
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
|
|
||||||
${httpComment} ${apiComment.export}
|
|
||||||
POST {{baseUrl}}/${package.ModuleName}/${typeHyphen}/export
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: {{token}}
|
|
||||||
|
|
||||||
{
|
|
||||||
#foreach($field in ${table.fields})
|
|
||||||
"${field.propertyName}": ""#if($foreach.hasNext),#end
|
|
||||||
#end
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
|
|
||||||
${httpComment}
|
${httpComment}
|
||||||
|
|||||||
@@ -141,19 +141,6 @@ public class ${table.controllerName} {
|
|||||||
public Integer batchDelete${type}(@RequestParam("idList") List<Long> idList) {
|
public Integer batchDelete${type}(@RequestParam("idList") List<Long> idList) {
|
||||||
return ${typeLower}Service.delete${type}ByIdList(idList);
|
return ${typeLower}Service.delete${type}ByIdList(idList);
|
||||||
}
|
}
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
#if($meta.enableOperatorLog)
|
|
||||||
@OperatorLog(${type}OperatorType.EXPORT)
|
|
||||||
#end
|
|
||||||
@PostMapping("/export")
|
|
||||||
@Operation(summary = "${apiComment.export}")
|
|
||||||
@PreAuthorize("@ss.hasPermission('${package.ModuleName}:${typeHyphen}:export')")
|
|
||||||
public void export${type}(@Validated @RequestBody ${type}QueryRequest request,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
${typeLower}Service.export${type}(request, response);
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ public interface ${type}Convert {
|
|||||||
${type}DO to(${type}QueryRequest request);
|
${type}DO to(${type}QueryRequest request);
|
||||||
|
|
||||||
${type}VO to(${type}DO domain);
|
${type}VO to(${type}DO domain);
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
${type}Export toExport(${type}DO domain);
|
|
||||||
#end
|
|
||||||
|
|
||||||
List<${type}VO> to(List<${type}DO> list);
|
List<${type}VO> to(List<${type}DO> list);
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ public class ${type}OperatorType extends InitializingOperatorTypes {
|
|||||||
public static final String UPDATE = "${typeHyphen}:update";
|
public static final String UPDATE = "${typeHyphen}:update";
|
||||||
|
|
||||||
public static final String DELETE = "${typeHyphen}:delete";
|
public static final String DELETE = "${typeHyphen}:delete";
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
public static final String EXPORT = "${typeHyphen}:export";
|
|
||||||
#end
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OperatorType[] types() {
|
public OperatorType[] types() {
|
||||||
@@ -32,9 +28,6 @@ public class ${type}OperatorType extends InitializingOperatorTypes {
|
|||||||
new OperatorType(L, CREATE, "创建$!{table.comment}"),
|
new OperatorType(L, CREATE, "创建$!{table.comment}"),
|
||||||
new OperatorType(M, UPDATE, "更新$!{table.comment}"),
|
new OperatorType(M, UPDATE, "更新$!{table.comment}"),
|
||||||
new OperatorType(H, DELETE, "删除$!{table.comment}"),
|
new OperatorType(H, DELETE, "删除$!{table.comment}"),
|
||||||
#if($meta.enableExport)
|
|
||||||
new OperatorType(M, EXPORT, "导出$!{table.comment}"),
|
|
||||||
#end
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.orion.lang.define.wrapper.DataGrid;
|
import com.orion.lang.define.wrapper.DataGrid;
|
||||||
import com.orion.lang.utils.Strings;
|
import com.orion.lang.utils.Strings;
|
||||||
import com.orion.lang.utils.collect.Lists;
|
import com.orion.lang.utils.collect.Lists;
|
||||||
#if($meta.enableExport)
|
|
||||||
import com.orion.office.excel.writer.exporting.ExcelExport;
|
|
||||||
#end
|
|
||||||
import com.orion.visor.framework.common.constant.ErrorMessage;
|
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||||
#if($meta.enableExport)
|
|
||||||
import com.orion.visor.framework.common.utils.FileNames;
|
|
||||||
#end
|
|
||||||
import com.orion.visor.framework.common.utils.Valid;
|
import com.orion.visor.framework.common.utils.Valid;
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
import com.orion.visor.framework.redis.core.utils.RedisMaps;
|
import com.orion.visor.framework.redis.core.utils.RedisMaps;
|
||||||
@@ -23,18 +17,11 @@ import ${pkg}.*;
|
|||||||
import ${package.Entity}.${entity};
|
import ${package.Entity}.${entity};
|
||||||
import ${package.Mapper}.${table.mapperName};
|
import ${package.Mapper}.${table.mapperName};
|
||||||
import ${package.Service}.${table.serviceName};
|
import ${package.Service}.${table.serviceName};
|
||||||
#if($meta.enableExport)
|
|
||||||
import com.orion.web.servlet.web.Servlets;
|
|
||||||
#end
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
#if($meta.enableExport)
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
#end
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -54,6 +41,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
private ${type}DAO ${typeLower}DAO;
|
private ${type}DAO ${typeLower}DAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long create${type}(${type}CreateRequest request) {
|
public Long create${type}(${type}CreateRequest request) {
|
||||||
log.info("${type}Service-create${type} request: {}", JSON.toJSONString(request));
|
log.info("${type}Service-create${type} request: {}", JSON.toJSONString(request));
|
||||||
// 转换
|
// 转换
|
||||||
@@ -72,6 +60,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer update${type}ById(${type}UpdateRequest request) {
|
public Integer update${type}ById(${type}UpdateRequest request) {
|
||||||
Long id = Valid.notNull(request.getId(), ErrorMessage.ID_MISSING);
|
Long id = Valid.notNull(request.getId(), ErrorMessage.ID_MISSING);
|
||||||
log.info("${type}Service-update${type}ById id: {}, request: {}", id, JSON.toJSONString(request));
|
log.info("${type}Service-update${type}ById id: {}, request: {}", id, JSON.toJSONString(request));
|
||||||
@@ -93,6 +82,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer update${type}(${type}QueryRequest query, ${type}UpdateRequest update) {
|
public Integer update${type}(${type}QueryRequest query, ${type}UpdateRequest update) {
|
||||||
log.info("${type}Service.update${type} query: {}, update: {}", JSON.toJSONString(query), JSON.toJSONString(update));
|
log.info("${type}Service.update${type} query: {}, update: {}", JSON.toJSONString(query), JSON.toJSONString(update));
|
||||||
// 条件
|
// 条件
|
||||||
@@ -179,6 +169,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer delete${type}ById(Long id) {
|
public Integer delete${type}ById(Long id) {
|
||||||
log.info("${type}Service-delete${type}ById id: {}", id);
|
log.info("${type}Service-delete${type}ById id: {}", id);
|
||||||
// 检查数据是否存在
|
// 检查数据是否存在
|
||||||
@@ -195,6 +186,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer delete${type}ByIdList(List<Long> idList) {
|
public Integer delete${type}ByIdList(List<Long> idList) {
|
||||||
log.info("${type}Service-delete${type}ByIdList idList: {}", idList);
|
log.info("${type}Service-delete${type}ByIdList idList: {}", idList);
|
||||||
int effect = ${typeLower}DAO.deleteBatchIds(idList);
|
int effect = ${typeLower}DAO.deleteBatchIds(idList);
|
||||||
@@ -207,6 +199,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer delete${type}(${type}QueryRequest request) {
|
public Integer delete${type}(${type}QueryRequest request) {
|
||||||
log.info("${type}Service.delete${type} request: {}", JSON.toJSONString(request));
|
log.info("${type}Service.delete${type} request: {}", JSON.toJSONString(request));
|
||||||
// 条件
|
// 条件
|
||||||
@@ -220,26 +213,6 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
#end
|
#end
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void export${type}(${type}QueryRequest request, HttpServletResponse response) throws IOException {
|
|
||||||
log.info("${type}Service.export${type} request: {}", JSON.toJSONString(request));
|
|
||||||
// 条件
|
|
||||||
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request);
|
|
||||||
// 查询
|
|
||||||
List<${type}Export> rows = ${typeLower}DAO.of(wrapper).list(${type}Convert.MAPPER::toExport);
|
|
||||||
log.info("${type}Service.export${type} size: {}", rows.size());
|
|
||||||
// 导出
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
ExcelExport.create(${type}Export.class)
|
|
||||||
.addRows(rows)
|
|
||||||
.write(out)
|
|
||||||
.close();
|
|
||||||
// 传输
|
|
||||||
Servlets.transfer(response, out.toByteArray(), FileNames.exportName(${type}Export.TITLE));
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查对象是否存在
|
* 检查对象是否存在
|
||||||
|
|||||||
@@ -115,16 +115,5 @@ public interface ${table.serviceName} {
|
|||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
Integer delete${type}(${type}QueryRequest request);
|
Integer delete${type}(${type}QueryRequest request);
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ${apiComment.export}
|
|
||||||
*
|
|
||||||
* @param request request
|
|
||||||
* @param response response
|
|
||||||
* @throws IOException IOException
|
|
||||||
*/
|
|
||||||
void export${type}(${type}QueryRequest request, HttpServletResponse response) throws IOException;
|
|
||||||
#end
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,7 @@ VALUES
|
|||||||
(@MODULE_KEY_ID, 'operatorLogModule', '${package.ModuleName}:${typeHyphen}', '$!{table.comment}', '{}', @MODULE_KEY_MAX_SORT + 10, now(), now(), '1', '1', 0),
|
(@MODULE_KEY_ID, 'operatorLogModule', '${package.ModuleName}:${typeHyphen}', '$!{table.comment}', '{}', @MODULE_KEY_MAX_SORT + 10, now(), now(), '1', '1', 0),
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:create', '创建$!{table.comment}', '{}', 10, now(), now(), '1', '1', 0),
|
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:create', '创建$!{table.comment}', '{}', 10, now(), now(), '1', '1', 0),
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:update', '更新$!{table.comment}', '{}', 20, now(), now(), '1', '1', 0),
|
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:update', '更新$!{table.comment}', '{}', 20, now(), now(), '1', '1', 0),
|
||||||
#if($meta.enableExport)
|
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:delete', '删除$!{table.comment}', '{}', 30, now(), now(), '1', '1', 0),
|
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:export', '导出$!{table.comment}', '{}', 40, now(), now(), '1', '1', 0);
|
|
||||||
#else
|
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:delete', '删除$!{table.comment}', '{}', 30, now(), now(), '1', '1', 0);
|
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:delete', '删除$!{table.comment}', '{}', 30, now(), now(), '1', '1', 0);
|
||||||
#end
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
|
|||||||
@@ -133,12 +133,4 @@ export function batchDelete${vue.featureEntity}(idList: Array<number>) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#if($meta.enableExport)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* $apiComment.export
|
|
||||||
*/
|
|
||||||
export function export${vue.featureEntity}(request: ${vue.featureEntity}QueryRequest) {
|
|
||||||
return axios.post('/${package.ModuleName}/${typeHyphen}/export', request);
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
|
|||||||
@@ -79,12 +79,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- table -->
|
<!-- table -->
|
||||||
|
#if($vue.enableRowSelection)
|
||||||
|
<a-table v-model:selected-keys="selectedKeys"
|
||||||
|
row-key="id"
|
||||||
|
#else
|
||||||
<a-table row-key="id"
|
<a-table row-key="id"
|
||||||
|
#end
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
#if($vue.enableRowSelection)
|
#if($vue.enableRowSelection)
|
||||||
v-model:selected-keys="selectedKeys"
|
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
#end
|
#end
|
||||||
:data="tableRenderData"
|
:data="tableRenderData"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const columns = [
|
|||||||
title: 'id',
|
title: 'id',
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
slotName: 'id',
|
slotName: 'id',
|
||||||
width: 70,
|
width: 100,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){
|
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.orion.visor.framework.redis.configuration.config.RedissonConfig;
|
|||||||
import com.orion.visor.framework.redis.core.lock.RedisLocker;
|
import com.orion.visor.framework.redis.core.lock.RedisLocker;
|
||||||
import com.orion.visor.framework.redis.core.utils.RedisUtils;
|
import com.orion.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
|
import org.redisson.config.SingleServerConfig;
|
||||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||||
@@ -58,6 +59,9 @@ public class OrionRedisAutoConfiguration {
|
|||||||
return config -> {
|
return config -> {
|
||||||
config.setThreads(redissonConfig.getThreads());
|
config.setThreads(redissonConfig.getThreads());
|
||||||
config.setNettyThreads(redissonConfig.getNettyThreads());
|
config.setNettyThreads(redissonConfig.getNettyThreads());
|
||||||
|
// 单机配置
|
||||||
|
SingleServerConfig single = config.useSingleServer();
|
||||||
|
single.setConnectionMinimumIdleSize(redissonConfig.getMinimumIdleSize());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,15 @@ public class RedissonConfig {
|
|||||||
*/
|
*/
|
||||||
private Integer nettyThreads;
|
private Integer nettyThreads;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最小空闲连接数
|
||||||
|
*/
|
||||||
|
private Integer minimumIdleSize;
|
||||||
|
|
||||||
public RedissonConfig() {
|
public RedissonConfig() {
|
||||||
this.threads = 16;
|
this.threads = 16;
|
||||||
this.nettyThreads = 16;
|
this.nettyThreads = 16;
|
||||||
|
this.minimumIdleSize = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,12 @@
|
|||||||
"type": "java.lang.Integer",
|
"type": "java.lang.Integer",
|
||||||
"description": "netty 线程数.",
|
"description": "netty 线程数.",
|
||||||
"defaultValue": "16"
|
"defaultValue": "16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.redisson.minimum-idle-size",
|
||||||
|
"type": "java.lang.Integer",
|
||||||
|
"description": "最小空闲连接数.",
|
||||||
|
"defaultValue": "16"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,6 @@ import org.springframework.core.annotation.Order;
|
|||||||
@Order(BeanOrderConst.DEMO_DISABLE_API_ASPECT)
|
@Order(BeanOrderConst.DEMO_DISABLE_API_ASPECT)
|
||||||
public class DemoDisableApiAspect {
|
public class DemoDisableApiAspect {
|
||||||
|
|
||||||
public DemoDisableApiAspect() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Pointcut("@annotation(e)")
|
@Pointcut("@annotation(e)")
|
||||||
public void disableApi(DemoDisableApi e) {
|
public void disableApi(DemoDisableApi e) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ spring:
|
|||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
minimum-idle-size: 2
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ spring:
|
|||||||
redisson:
|
redisson:
|
||||||
threads: 4
|
threads: 4
|
||||||
netty-threads: 4
|
netty-threads: 4
|
||||||
|
minimum-idle-size: 4
|
||||||
quartz:
|
quartz:
|
||||||
properties:
|
properties:
|
||||||
org:
|
org:
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ spring:
|
|||||||
mvc:
|
mvc:
|
||||||
pathmatch:
|
pathmatch:
|
||||||
matching-strategy: ANT_PATH_MATCHER
|
matching-strategy: ANT_PATH_MATCHER
|
||||||
|
async:
|
||||||
|
# 异步请求时间 30min
|
||||||
|
request-timeout: 1800000
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@@ -195,7 +198,7 @@ orion:
|
|||||||
api:
|
api:
|
||||||
# 公共 api 前缀
|
# 公共 api 前缀
|
||||||
prefix: /orion-visor/api
|
prefix: /orion-visor/api
|
||||||
# 是否开启跨域
|
# 是否允许跨域
|
||||||
cors: true
|
cors: true
|
||||||
websocket:
|
websocket:
|
||||||
# 公共 websocket 前缀
|
# 公共 websocket 前缀
|
||||||
@@ -208,7 +211,7 @@ orion:
|
|||||||
session-idle-timeout: 1800000
|
session-idle-timeout: 1800000
|
||||||
swagger:
|
swagger:
|
||||||
# swagger 配置
|
# swagger 配置
|
||||||
author: lijiahang
|
author: Jiahang Li
|
||||||
title: orion-visor 运维平台
|
title: orion-visor 运维平台
|
||||||
description: 一站式运维服务平台
|
description: 一站式运维服务平台
|
||||||
version: ${orion.version}
|
version: ${orion.version}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.orion.visor.module.infra.api;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 命令片段 对外服务类
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/6/3 11:07
|
||||||
|
*/
|
||||||
|
public interface CommandSnippetApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 userId 删除
|
||||||
|
*
|
||||||
|
* @param userIdList userIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
Integer deleteByUserIdList(List<Long> userIdList);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.orion.visor.module.infra.api;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路径标签 对外服务类
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/6/3 11:07
|
||||||
|
*/
|
||||||
|
public interface PathBookmarkApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 userId 删除
|
||||||
|
*
|
||||||
|
* @param userIdList userIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
Integer deleteByUserIdList(List<Long> userIdList);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.orion.visor.module.asset.api.impl;
|
||||||
|
|
||||||
|
import com.orion.visor.module.asset.service.CommandSnippetService;
|
||||||
|
import com.orion.visor.module.infra.api.CommandSnippetApi;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 命令片段 对外服务实现类
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/6/3 11:11
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class CommandSnippetApiImpl implements CommandSnippetApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CommandSnippetService commandSnippetService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer deleteByUserIdList(List<Long> userIdList) {
|
||||||
|
return commandSnippetService.deleteByUserIdList(userIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.orion.visor.module.asset.api.impl;
|
||||||
|
|
||||||
|
import com.orion.visor.module.asset.service.PathBookmarkService;
|
||||||
|
import com.orion.visor.module.infra.api.PathBookmarkApi;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路径标签 对外服务实现类
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/6/3 11:11
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class PathBookmarkApiImpl implements PathBookmarkApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PathBookmarkService pathBookmarkService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer deleteByUserIdList(List<Long> userIdList) {
|
||||||
|
return pathBookmarkService.deleteByUserIdList(userIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -98,6 +98,15 @@ public class ExecJobController {
|
|||||||
return execJobService.deleteExecJobById(id);
|
return execJobService.deleteExecJobById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperatorLog(ExecJobOperatorType.DELETE)
|
||||||
|
@DeleteMapping("/batch-delete")
|
||||||
|
@Operation(summary = "批量删除计划任务")
|
||||||
|
@Parameter(name = "idList", description = "idList", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:exec-job:delete')")
|
||||||
|
public Integer batchDeleteExecJob(@RequestParam("idList") List<Long> idList) {
|
||||||
|
return execJobService.deleteExecJobByIdList(idList);
|
||||||
|
}
|
||||||
|
|
||||||
@OperatorLog(ExecJobOperatorType.TRIGGER)
|
@OperatorLog(ExecJobOperatorType.TRIGGER)
|
||||||
@PostMapping("/trigger")
|
@PostMapping("/trigger")
|
||||||
@Operation(summary = "手动触发计划任务")
|
@Operation(summary = "手动触发计划任务")
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行模板 api
|
* 执行模板 api
|
||||||
@@ -92,5 +93,14 @@ public class ExecTemplateController {
|
|||||||
return execTemplateService.deleteExecTemplateById(id);
|
return execTemplateService.deleteExecTemplateById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperatorLog(ExecTemplateOperatorType.DELETE)
|
||||||
|
@DeleteMapping("/batch-delete")
|
||||||
|
@Operation(summary = "批量删除执行模板")
|
||||||
|
@Parameter(name = "idList", description = "idList", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:exec-template:delete')")
|
||||||
|
public Integer batchDeleteExecTemplate(@RequestParam("idList") List<Long> idList) {
|
||||||
|
return execTemplateService.deleteExecTemplateByIdList(idList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,5 +96,15 @@ public class HostController {
|
|||||||
return hostService.deleteHostById(id);
|
return hostService.deleteHostById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DemoDisableApi
|
||||||
|
@OperatorLog(HostOperatorType.DELETE)
|
||||||
|
@DeleteMapping("/batch-delete")
|
||||||
|
@Operation(summary = "批量删除主机")
|
||||||
|
@Parameter(name = "idList", description = "idList", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host:delete')")
|
||||||
|
public Integer batchDeleteHost(@RequestParam("idList") List<Long> idList) {
|
||||||
|
return hostService.deleteHostByIdList(idList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,5 +97,15 @@ public class HostIdentityController {
|
|||||||
return hostIdentityService.deleteHostIdentityById(id);
|
return hostIdentityService.deleteHostIdentityById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DemoDisableApi
|
||||||
|
@OperatorLog(HostIdentityOperatorType.DELETE)
|
||||||
|
@DeleteMapping("/batch-delete")
|
||||||
|
@Operation(summary = "批量删除主机身份")
|
||||||
|
@Parameter(name = "idList", description = "idList", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host-identity:delete')")
|
||||||
|
public Integer batchDeleteHostIdentity(@RequestParam("idList") List<Long> idList) {
|
||||||
|
return hostIdentityService.deleteHostIdentityByIdList(idList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,5 +96,15 @@ public class HostKeyController {
|
|||||||
return hostKeyService.deleteHostKeyById(id);
|
return hostKeyService.deleteHostKeyById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DemoDisableApi
|
||||||
|
@OperatorLog(HostKeyOperatorType.DELETE)
|
||||||
|
@DeleteMapping("/batch-delete")
|
||||||
|
@Operation(summary = "批量删除主机密钥")
|
||||||
|
@Parameter(name = "idList", description = "idList", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host-key:delete')")
|
||||||
|
public Integer batchDeleteHostKey(@RequestParam("idList") List<Long> idList) {
|
||||||
|
return hostKeyService.deleteHostKeyByIdList(idList);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
### 分页查询 SFTP 操作日志
|
### 分页查询 SFTP 操作日志
|
||||||
POST {{baseUrl}}/asset/host-sftp-log/query
|
POST {{baseUrl}}/asset/host-sftp/query-log
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Authorization: {{token}}
|
Authorization: {{token}}
|
||||||
|
|
||||||
@@ -10,8 +10,12 @@ Authorization: {{token}}
|
|||||||
|
|
||||||
|
|
||||||
### 删除 SFTP 操作日志
|
### 删除 SFTP 操作日志
|
||||||
DELETE {{baseUrl}}/asset/host-sftp-log/delete?idList=1,2,3
|
DELETE {{baseUrl}}/asset/host-sftp/delete-log?idList=1,2,3
|
||||||
Authorization: {{token}}
|
Authorization: {{token}}
|
||||||
|
|
||||||
|
|
||||||
|
### 下载文件
|
||||||
|
GET {{baseUrl}}/asset/host-sftp/download?channelId=123&transferToken=123
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ import com.orion.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
|||||||
import com.orion.visor.framework.common.validator.group.Page;
|
import com.orion.visor.framework.common.validator.group.Page;
|
||||||
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
import com.orion.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
import com.orion.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
|
import com.orion.visor.framework.web.core.annotation.IgnoreWrapper;
|
||||||
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
import com.orion.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import com.orion.visor.module.asset.define.operator.HostTerminalOperatorType;
|
import com.orion.visor.module.asset.define.operator.HostTerminalOperatorType;
|
||||||
import com.orion.visor.module.asset.entity.request.host.HostSftpLogQueryRequest;
|
import com.orion.visor.module.asset.entity.request.host.HostSftpLogQueryRequest;
|
||||||
import com.orion.visor.module.asset.entity.vo.HostSftpLogVO;
|
import com.orion.visor.module.asset.entity.vo.HostSftpLogVO;
|
||||||
import com.orion.visor.module.asset.service.HostSftpLogService;
|
import com.orion.visor.module.asset.service.HostSftpService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@@ -17,44 +18,60 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SFTP 操作日志服务 api
|
* SFTP 操作服务 api
|
||||||
*
|
*
|
||||||
* @author Jiahang Li
|
* @author Jiahang Li
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023-12-26 22:09
|
* @since 2023-12-26 22:09
|
||||||
*/
|
*/
|
||||||
@Tag(name = "asset - SFTP 操作日志服务")
|
@Tag(name = "asset - SFTP 操作服务")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Validated
|
@Validated
|
||||||
@RestWrapper
|
@RestWrapper
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/asset/host-sftp-log")
|
@RequestMapping("/asset/host-sftp")
|
||||||
@SuppressWarnings({"ELValidationInJSP", "SpringElInspection"})
|
@SuppressWarnings({"ELValidationInJSP", "SpringElInspection"})
|
||||||
public class HostSftpLogController {
|
public class HostSftpLogController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private HostSftpLogService hostSftpLogService;
|
private HostSftpService hostSftpService;
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@PostMapping("/query")
|
@PostMapping("/query-log")
|
||||||
@Operation(summary = "分页查询 SFTP 操作日志")
|
@Operation(summary = "分页查询 SFTP 操作日志")
|
||||||
@PreAuthorize("@ss.hasAnyPermission('infra:operator-log:query', 'asset:host-sftp-log:management:query')")
|
@PreAuthorize("@ss.hasAnyPermission('infra:operator-log:query', 'asset:host-sftp-log:management:query')")
|
||||||
public DataGrid<HostSftpLogVO> getHostSftpLogPage(@Validated(Page.class) @RequestBody HostSftpLogQueryRequest request) {
|
public DataGrid<HostSftpLogVO> getHostSftpLogPage(@Validated(Page.class) @RequestBody HostSftpLogQueryRequest request) {
|
||||||
return hostSftpLogService.getHostSftpLogPage(request);
|
return hostSftpService.getHostSftpLogPage(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperatorLog(HostTerminalOperatorType.DELETE_SFTP_LOG)
|
@OperatorLog(HostTerminalOperatorType.DELETE_SFTP_LOG)
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete-log")
|
||||||
@Operation(summary = "删除 SFTP 操作日志")
|
@Operation(summary = "删除 SFTP 操作日志")
|
||||||
@Parameter(name = "idList", description = "idList", required = true)
|
@Parameter(name = "idList", description = "idList", required = true)
|
||||||
@PreAuthorize("@ss.hasAnyPermission('infra:operator-log:delete', 'asset:host-sftp-log:management:delete')")
|
@PreAuthorize("@ss.hasAnyPermission('infra:operator-log:delete', 'asset:host-sftp-log:management:delete')")
|
||||||
public Integer deleteHostSftpLog(@RequestParam("idList") List<Long> idList) {
|
public Integer deleteHostSftpLog(@RequestParam("idList") List<Long> idList) {
|
||||||
return hostSftpLogService.deleteHostSftpLog(idList);
|
return hostSftpService.deleteHostSftpLog(idList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PermitAll
|
||||||
|
@IgnoreWrapper
|
||||||
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
|
@GetMapping("/download")
|
||||||
|
@Operation(summary = "下载文件")
|
||||||
|
@Parameter(name = "channelId", description = "channelId", required = true)
|
||||||
|
@Parameter(name = "transferToken", description = "transferToken", required = true)
|
||||||
|
public StreamingResponseBody downloadWithTransferToken(@RequestParam("channelId") String channelId,
|
||||||
|
@RequestParam("transferToken") String transferToken,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
return hostSftpService.downloadWithTransferToken(channelId, transferToken, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.orion.visor.framework.mybatis.core.mapper.IMapper;
|
|||||||
import com.orion.visor.module.asset.entity.domain.CommandSnippetDO;
|
import com.orion.visor.module.asset.entity.domain.CommandSnippetDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 命令片段 Mapper 接口
|
* 命令片段 Mapper 接口
|
||||||
*
|
*
|
||||||
@@ -42,4 +44,16 @@ public interface CommandSnippetDAO extends IMapper<CommandSnippetDO> {
|
|||||||
return this.delete(wrapper);
|
return this.delete(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 userId 删除
|
||||||
|
*
|
||||||
|
* @param userIdList userIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
default int deleteByUserIdList(List<Long> userIdList) {
|
||||||
|
LambdaQueryWrapper<CommandSnippetDO> wrapper = this.lambda()
|
||||||
|
.in(CommandSnippetDO::getUserId, userIdList);
|
||||||
|
return this.delete(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,18 @@ public interface ExecJobHostDAO extends IMapper<ExecJobHostDO> {
|
|||||||
return this.delete(wrapper);
|
return this.delete(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 jobId 删除
|
||||||
|
*
|
||||||
|
* @param jobIdList jobIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
default Integer deleteByJobIdList(List<Long> jobIdList) {
|
||||||
|
LambdaQueryWrapper<ExecJobHostDO> wrapper = this.wrapper()
|
||||||
|
.in(ExecJobHostDO::getJobId, jobIdList);
|
||||||
|
return this.delete(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 hostId 删除
|
* 通过 hostId 删除
|
||||||
*
|
*
|
||||||
@@ -56,4 +68,16 @@ public interface ExecJobHostDAO extends IMapper<ExecJobHostDO> {
|
|||||||
return this.delete(wrapper);
|
return this.delete(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 hostId 删除
|
||||||
|
*
|
||||||
|
* @param hostIdList hostIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
default Integer deleteByHostIdList(List<Long> hostIdList) {
|
||||||
|
LambdaQueryWrapper<ExecJobHostDO> wrapper = this.wrapper()
|
||||||
|
.in(ExecJobHostDO::getHostId, hostIdList);
|
||||||
|
return this.delete(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,17 +95,17 @@ public interface HostConfigDAO extends IMapper<HostConfigDO> {
|
|||||||
/**
|
/**
|
||||||
* 设置 keyId 为 NULL
|
* 设置 keyId 为 NULL
|
||||||
*
|
*
|
||||||
* @param keyId keyId
|
* @param keyIdList keyIdList
|
||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
int setKeyIdWithNull(@Param("keyId") Long keyId);
|
int setKeyIdWithNull(@Param("keyIdList") List<Long> keyIdList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置 identityId 为 NULL
|
* 设置 identityId 为 NULL
|
||||||
*
|
*
|
||||||
* @param identityId identityId
|
* @param identityIdList identityIdList
|
||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
int setIdentityIdWithNull(@Param("identityId") Long identityId);
|
int setIdentityIdWithNull(@Param("identityIdList") List<Long> identityIdList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.orion.visor.framework.mybatis.core.mapper.IMapper;
|
import com.orion.visor.framework.mybatis.core.mapper.IMapper;
|
||||||
import com.orion.visor.module.asset.entity.domain.HostIdentityDO;
|
import com.orion.visor.module.asset.entity.domain.HostIdentityDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机身份 Mapper 接口
|
* 主机身份 Mapper 接口
|
||||||
@@ -20,13 +21,13 @@ public interface HostIdentityDAO extends IMapper<HostIdentityDO> {
|
|||||||
/**
|
/**
|
||||||
* 设置 keyId 为 null
|
* 设置 keyId 为 null
|
||||||
*
|
*
|
||||||
* @param keyId keyId
|
* @param keyIdList keyIdList
|
||||||
* @return effect
|
* @return effect
|
||||||
*/
|
*/
|
||||||
default int setKeyWithNull(@Param("keyId") Long keyId) {
|
default int setKeyWithNull(List<Long> keyIdList) {
|
||||||
LambdaUpdateWrapper<HostIdentityDO> updateWrapper = Wrappers.<HostIdentityDO>lambdaUpdate()
|
LambdaUpdateWrapper<HostIdentityDO> updateWrapper = Wrappers.<HostIdentityDO>lambdaUpdate()
|
||||||
.set(HostIdentityDO::getKeyId, null)
|
.set(HostIdentityDO::getKeyId, null)
|
||||||
.eq(HostIdentityDO::getKeyId, keyId);
|
.in(HostIdentityDO::getKeyId, keyIdList);
|
||||||
return this.update(null, updateWrapper);
|
return this.update(null, updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.orion.visor.framework.mybatis.core.mapper.IMapper;
|
|||||||
import com.orion.visor.module.asset.entity.domain.PathBookmarkDO;
|
import com.orion.visor.module.asset.entity.domain.PathBookmarkDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路径标签 Mapper 接口
|
* 路径标签 Mapper 接口
|
||||||
*
|
*
|
||||||
@@ -42,4 +44,16 @@ public interface PathBookmarkDAO extends IMapper<PathBookmarkDO> {
|
|||||||
return this.delete(wrapper);
|
return this.delete(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 userId 删除
|
||||||
|
*
|
||||||
|
* @param userIdList userIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
default int deleteByUserIdList(List<Long> userIdList) {
|
||||||
|
LambdaQueryWrapper<PathBookmarkDO> wrapper = this.lambda()
|
||||||
|
.in(PathBookmarkDO::getUserId, userIdList);
|
||||||
|
return this.delete(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.orion.visor.module.asset.handler.host.terminal;
|
|||||||
|
|
||||||
import com.orion.visor.module.asset.define.AssetThreadPools;
|
import com.orion.visor.module.asset.define.AssetThreadPools;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.enums.InputTypeEnum;
|
import com.orion.visor.module.asset.handler.host.terminal.enums.InputTypeEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.manager.TerminalManager;
|
import com.orion.visor.module.asset.handler.host.terminal.manager.HostTerminalManager;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.socket.CloseStatus;
|
import org.springframework.web.socket.CloseStatus;
|
||||||
@@ -24,7 +24,7 @@ import javax.annotation.Resource;
|
|||||||
public class TerminalMessageDispatcher extends AbstractWebSocketHandler {
|
public class TerminalMessageDispatcher extends AbstractWebSocketHandler {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TerminalManager terminalManager;
|
private HostTerminalManager hostTerminalManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleTextMessage(WebSocketSession session, TextMessage message) {
|
protected void handleTextMessage(WebSocketSession session, TextMessage message) {
|
||||||
@@ -65,7 +65,7 @@ public class TerminalMessageDispatcher extends AbstractWebSocketHandler {
|
|||||||
String id = session.getId();
|
String id = session.getId();
|
||||||
log.info("TerminalMessageDispatcher-afterConnectionClosed id: {}, code: {}, reason: {}", id, status.getCode(), status.getReason());
|
log.info("TerminalMessageDispatcher-afterConnectionClosed id: {}, code: {}, reason: {}", id, status.getCode(), status.getReason());
|
||||||
// 关闭会话
|
// 关闭会话
|
||||||
terminalManager.closeSession(id);
|
hostTerminalManager.closeSession(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
|||||||
import com.orion.visor.framework.common.constant.ErrorMessage;
|
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||||
import com.orion.visor.framework.websocket.core.utils.WebSockets;
|
import com.orion.visor.framework.websocket.core.utils.WebSockets;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.enums.OutputTypeEnum;
|
import com.orion.visor.module.asset.handler.host.terminal.enums.OutputTypeEnum;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.manager.TerminalManager;
|
import com.orion.visor.module.asset.handler.host.terminal.manager.HostTerminalManager;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalBasePayload;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalConfig;
|
import com.orion.visor.module.asset.handler.host.terminal.model.TerminalConfig;
|
||||||
import com.orion.visor.module.asset.handler.host.terminal.session.ITerminalSession;
|
import com.orion.visor.module.asset.handler.host.terminal.session.ITerminalSession;
|
||||||
@@ -27,7 +27,7 @@ import java.util.Map;
|
|||||||
public abstract class AbstractTerminalHandler<T extends TerminalBasePayload> implements ITerminalHandler<T> {
|
public abstract class AbstractTerminalHandler<T extends TerminalBasePayload> implements ITerminalHandler<T> {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
protected TerminalManager terminalManager;
|
protected HostTerminalManager hostTerminalManager;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OperatorLogFrameworkService operatorLogFrameworkService;
|
private OperatorLogFrameworkService operatorLogFrameworkService;
|
||||||
@@ -75,7 +75,7 @@ public abstract class AbstractTerminalHandler<T extends TerminalBasePayload> imp
|
|||||||
String channelId = channel.getId();
|
String channelId = channel.getId();
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
// 获取会话并且设置参数
|
// 获取会话并且设置参数
|
||||||
ITerminalSession session = terminalManager.getSession(channelId, sessionId);
|
ITerminalSession session = hostTerminalManager.getSession(channelId, sessionId);
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
TerminalConfig config = session.getConfig();
|
TerminalConfig config = session.getConfig();
|
||||||
extra.put(OperatorLogs.HOST_ID, config.getHostId());
|
extra.put(OperatorLogs.HOST_ID, config.getHostId());
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class SftpChangeModHandler extends AbstractTerminalHandler<SftpChangeModR
|
|||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
Integer mod = payload.getMod();
|
Integer mod = payload.getMod();
|
||||||
log.info("SftpChangeModHandler-handle start sessionId: {}, path: {}, mod: {}", sessionId, path, mod);
|
log.info("SftpChangeModHandler-handle start sessionId: {}, path: {}, mod: {}", sessionId, path, mod);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class SftpDownloadFlatDirectoryHandler extends AbstractTerminalHandler<Sf
|
|||||||
public void handle(WebSocketSession channel, SftpDownloadFlatDirectoryRequest payload) {
|
public void handle(WebSocketSession channel, SftpDownloadFlatDirectoryRequest payload) {
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String[] paths = payload.getPath().split("\\|");
|
String[] paths = payload.getPath().split("\\|");
|
||||||
log.info("SftpDownloadFlatDirectoryHandler-handle start sessionId: {}, paths: {}", sessionId, Arrays.toString(paths));
|
log.info("SftpDownloadFlatDirectoryHandler-handle start sessionId: {}, paths: {}", sessionId, Arrays.toString(paths));
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class SftpGetContentHandler extends AbstractTerminalHandler<SftpBaseReque
|
|||||||
public void handle(WebSocketSession channel, SftpBaseRequest payload) {
|
public void handle(WebSocketSession channel, SftpBaseRequest payload) {
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
log.info("SftpGetContentHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
log.info("SftpGetContentHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
||||||
String content = Const.EMPTY;
|
String content = Const.EMPTY;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class SftpListHandler extends AbstractTerminalHandler<SftpListRequest> {
|
|||||||
public void handle(WebSocketSession channel, SftpListRequest payload) {
|
public void handle(WebSocketSession channel, SftpListRequest payload) {
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
log.info("SftpListHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
log.info("SftpListHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class SftpMakeDirectoryHandler extends AbstractTerminalHandler<SftpBaseRe
|
|||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
log.info("SftpMakeDirectoryHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
log.info("SftpMakeDirectoryHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class SftpMoveHandler extends AbstractTerminalHandler<SftpMoveRequest> {
|
|||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
String target = payload.getTarget();
|
String target = payload.getTarget();
|
||||||
log.info("SftpMoveHandler-handle start sessionId: {}, path: {}, target: {}", sessionId, path, target);
|
log.info("SftpMoveHandler-handle start sessionId: {}, path: {}, target: {}", sessionId, path, target);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class SftpRemoveHandler extends AbstractTerminalHandler<SftpBaseRequest>
|
|||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String[] paths = payload.getPath().split("\\|");
|
String[] paths = payload.getPath().split("\\|");
|
||||||
log.info("SftpRemoveHandler-handle start sessionId: {}, path: {}", sessionId, Arrays.toString(paths));
|
log.info("SftpRemoveHandler-handle start sessionId: {}, path: {}", sessionId, Arrays.toString(paths));
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class SftpSetContentHandler extends AbstractTerminalHandler<SftpSetConten
|
|||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
log.info("SftpSetContentHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
log.info("SftpSetContentHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class SftpTouchHandler extends AbstractTerminalHandler<SftpBaseRequest> {
|
|||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// 获取会话
|
// 获取会话
|
||||||
String sessionId = payload.getSessionId();
|
String sessionId = payload.getSessionId();
|
||||||
ISftpSession session = terminalManager.getSession(channel.getId(), sessionId);
|
ISftpSession session = hostTerminalManager.getSession(channel.getId(), sessionId);
|
||||||
String path = payload.getPath();
|
String path = payload.getPath();
|
||||||
log.info("SftpTouchHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
log.info("SftpTouchHandler-handle start sessionId: {}, path: {}", sessionId, path);
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
|
|||||||