Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
318e9f30b8 | ||
|
|
39a1001510 | ||
|
|
5e7b7ebfa7 | ||
|
|
8d85cdf173 | ||
|
|
79d95d1997 | ||
|
|
1eb07d0b24 | ||
|
|
601564b573 | ||
|
|
41384fab17 | ||
|
|
f0a122d862 | ||
|
|
b08d75be62 | ||
|
|
02f5bef6b4 | ||
|
|
ef10c8b8b6 | ||
|
|
6c4e9cd5c6 | ||
|
|
8dec40553d | ||
|
|
9ae5a6c627 | ||
|
|
2ec1678f01 | ||
|
|
f9e436e885 | ||
|
|
2a49e7670d | ||
|
|
95d8988f11 | ||
|
|
e04a972df5 | ||
|
|
1ca9311625 | ||
|
|
630a1fd3cd | ||
|
|
0f6d84dab2 | ||
|
|
f64eb395a8 | ||
|
|
2e69c67de0 | ||
|
|
7747b4e52e | ||
|
|
830622aafb | ||
|
|
2919950c5b | ||
|
|
d56cfbba82 | ||
|
|
cfe1924f11 | ||
|
|
dfd2ec45f4 | ||
|
|
19c7e31f53 | ||
|
|
f618aef988 | ||
|
|
af97f752f5 | ||
|
|
bfb80afee2 | ||
|
|
72695af0f0 | ||
|
|
3a5b84eec4 | ||
|
|
387ed53328 | ||
|
|
c9cbc5fd55 | ||
|
|
ae03460a33 | ||
|
|
4b060a864a | ||
|
|
07e8e63ee6 | ||
|
|
ab1d4ed97f | ||
|
|
2bd7dfd5b8 | ||
|
|
c39049e5f5 | ||
|
|
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 |
22
.github/workflows/e2e.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: E2E
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}} - ${{github.ref}}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
testing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: E2E Testing
|
||||
run: |
|
||||
sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
|
||||
sudo chmod u+x /usr/local/bin/docker-compose
|
||||
docker compose -f docker-compose-testing.yml up --build testing --exit-code-from testing --remove-orphans
|
||||
64
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 align="center">
|
||||
<a target="_blank"
|
||||
@@ -13,27 +13,27 @@
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/lijiahangmax/orion-visor/releases">
|
||||
href="https://github.com/dromara/orion-visor/releases">
|
||||
<img src="https://img.shields.io/github/v/release/lijiahangmax/orion-visor" alt="release" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitee.com/lijiahangmax/orion-visor/stargazers">
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/star.svg?theme=dark" alt="star" />
|
||||
href="https://gitee.com/dromara/orion-visor/stargazers">
|
||||
<img src="https://gitee.com/dromara/orion-visor/badge/star.svg?theme=dark" alt="star" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitee.com/lijiahangmax/orion-visor/members">
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/fork.svg?theme=dark" alt="fork" />
|
||||
href="https://gitee.com/dromara/orion-visor/members">
|
||||
<img src="https://gitee.com/dromara/orion-visor/badge/fork.svg?theme=dark" alt="fork" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/lijiahangmax/orion-visor">
|
||||
href="https://github.com/dromara/orion-visor">
|
||||
<img src="https://img.shields.io/github/stars/lijiahangmax/orion-visor" alt="star" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/lijiahangmax/orion-visor">
|
||||
href="https://github.com/dromara/orion-visor">
|
||||
<img src="https://img.shields.io/github/forks/lijiahangmax/orion-visor" alt="star" />
|
||||
</a>
|
||||
</p>
|
||||
@@ -43,38 +43,40 @@
|
||||
**`orion-visor`** 提供一站式服务器运维解决方案。
|
||||
|
||||
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
||||
* **在线终端**:提供在线 Terminal 服务,支持快捷命令、大文件上传、在线编辑等操作。
|
||||
* **在线终端**:提供在线终端 SSH 服务,支持快捷命令、自定义快捷键和主题风格。
|
||||
* **文件管理**:支持远程主机 SFTP 大文件的批量上传、下载和在线编辑等操作。
|
||||
* **批量操作**:支持批量执行主机命令、多主机文件分发等功能。
|
||||
* **计划任务**:支持配置 cron 表达式,定时执行主机命令。
|
||||
* **安全可靠**:动态配置权限,记录用户操作日志,提供简单的审计功能。
|
||||
|
||||
## 演示环境
|
||||
|
||||
演示地址: http://101.43.254.243:1081/
|
||||
演示账号: admin/admin
|
||||
|
||||
⭐ 体验后可以点一下 `star` 这对我很重要!
|
||||
🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
||||
[github](https://github.com/lijiahangmax/orion-visor) [gitee](https://gitee.com/lijiahangmax/orion-visor)
|
||||
* 🔗 演示地址: http://101.43.254.243:1081/
|
||||
* 🔏 演示账号: admin/admin
|
||||
* ⭐ 体验后可以点一下 `star` 这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor)
|
||||
* 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
||||
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
||||
* 📛 演示环境请不要随便删除数据!
|
||||
* 📧 如果演示环境不可用请联系我!
|
||||
|
||||
## 快速开始
|
||||
|
||||
```bash
|
||||
# clone
|
||||
git clone https://github.com/lijiahangmax/orion-visor
|
||||
git clone https://github.com/dromara/orion-visor
|
||||
cd orion-visor
|
||||
# 启动
|
||||
docker compose up -d
|
||||
# 等待后端服务启动后 (2min±) 访问 http://localhost:1081/
|
||||
```
|
||||
|
||||
## 项目文档
|
||||
|
||||
* [文档地址](https://lijiahangmax.github.io/orion-visor/#/)
|
||||
* [docker安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/docker-install)
|
||||
* [普通安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/install)
|
||||
* [更新日志](https://lijiahangmax.github.io/orion-visor/#/about/change-log)
|
||||
* [操作手册](https://lijiahangmax.github.io/orion-visor/#/operator/asset)
|
||||
* [常见问题](https://lijiahangmax.github.io/orion-visor/#/quickstart/faq)
|
||||
* [文档地址](https://lijiahangmax.github.io/open-orion/orion-visor/)
|
||||
* [安装文档](https://lijiahangmax.github.io/open-orion/orion-visor/quickstart/docker.html)
|
||||
* [更新日志](https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html)
|
||||
* [操作手册](https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html)
|
||||
* [常见问题](https://lijiahangmax.github.io/open-orion/orion-visor/support/faq.html)
|
||||
|
||||
## 技术栈
|
||||
|
||||
@@ -88,22 +90,22 @@ docker compose up -d
|
||||
|
||||
#### 主机终端
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

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

|
||||

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

|
||||

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

|
||||

|
||||
|
||||
## Star History
|
||||
|
||||
@@ -129,8 +131,8 @@ docker compose up -d
|
||||
|
||||
## 免责声明
|
||||
|
||||
在使用本项目之前, 请确保您已经了解并同意相关的使用协议和隐私政策。[免责声明](https://github.com/lijiahangmax/orion-visor/blob/main/DISCLAIMER.md)
|
||||
在使用本项目之前, 请确保您已经了解并同意相关的使用协议和隐私政策。[免责声明](https://github.com/dromara/orion-visor/blob/main/DISCLAIMER.md)
|
||||
|
||||
## License
|
||||
|
||||
本项目遵循 [Apache-2.0](https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE) 开源许可证。
|
||||
本项目遵循 [Apache-2.0](https://github.com/dromara/orion-visor/blob/main/LICENSE) 开源许可证。
|
||||
|
||||
79
docker-compose-testing.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
orion-visor-service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.10
|
||||
privileged: true
|
||||
ports:
|
||||
- 1081:80
|
||||
environment:
|
||||
- MYSQL_HOST=orion-visor-mysql
|
||||
- MYSQL_PORT=3306
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- REDIS_HOST=orion-visor-redis
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
- SECRET_KEY=uQeacXV8b3isvKLK
|
||||
- DEMO_MODE=false
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/service/root-orion:/root/orion
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
||||
interval: 3s
|
||||
timeout: 300s
|
||||
retries: 200
|
||||
start_period: 3s
|
||||
depends_on:
|
||||
orion-visor-mysql:
|
||||
condition: service_healthy
|
||||
orion-visor-redis:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- orion-visor-mysql
|
||||
- orion-visor-redis
|
||||
orion-visor-mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.10
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
environment:
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
- MYSQL_USER=orion
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- MYSQL_ROOT_PASSWORD=Data@123456
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql:/var/lib/mysql
|
||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||
- /data/orion-visor-space/docker-volumes/mysql/etc-mysql:/etc/mysql
|
||||
healthcheck:
|
||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
orion-visor-redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.10
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
environment:
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/redis/data:/data
|
||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
testing:
|
||||
build:
|
||||
context: ./docker/e2e
|
||||
environment:
|
||||
SERVER: http://orion-visor-service:80
|
||||
depends_on:
|
||||
orion-visor-service:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- orion-visor-service
|
||||
@@ -1,7 +1,8 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
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.10
|
||||
privileged: true
|
||||
ports:
|
||||
- 1081:80
|
||||
environment:
|
||||
@@ -15,12 +16,23 @@ services:
|
||||
- SECRET_KEY=uQeacXV8b3isvKLK
|
||||
- DEMO_MODE=false
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-service/root-orion:/root/orion
|
||||
- /data/orion-visor-space/docker-volumes/service/root-orion:/root/orion
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
||||
interval: 3s
|
||||
timeout: 300s
|
||||
retries: 200
|
||||
start_period: 3s
|
||||
depends_on:
|
||||
orion-visor-mysql:
|
||||
condition: service_healthy
|
||||
orion-visor-redis:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- orion-visor-mysql
|
||||
- orion-visor-redis
|
||||
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.10
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
@@ -30,19 +42,31 @@ services:
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- MYSQL_ROOT_PASSWORD=Data@123456
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql:/var/lib/mysql
|
||||
- /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/mysql/var-lib-mysql:/var/lib/mysql
|
||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||
- /data/orion-visor-space/docker-volumes/mysql/etc-mysql:/etc/mysql
|
||||
healthcheck:
|
||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
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.10
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
environment:
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-redis/data:/data
|
||||
- /data/orion-visor-space/docker-volumes/redis/data:/data
|
||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
orion-visor-adminer:
|
||||
image: adminer
|
||||
ports:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#/bin/bash
|
||||
docker compose down
|
||||
sh ./pull.sh
|
||||
# demo 启动
|
||||
if [ "$1" == "demo" ]; then
|
||||
sed -i 's/DEMO_MODE=false/DEMO_MODE=true/g' docker-compose.yml
|
||||
|
||||
7
docker/e2e/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM ghcr.io/linuxsuren/api-testing:v0.0.17
|
||||
|
||||
WORKDIR /workspace
|
||||
COPY . .
|
||||
RUN chmod 777 *
|
||||
|
||||
CMD [ "/workspace/entrypoint.sh" ]
|
||||
3
docker/e2e/entrypoint.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
atest run -p testsuite.yaml --report md
|
||||
57
docker/e2e/testsuite.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
#!api-testing
|
||||
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json
|
||||
name: orion-visor
|
||||
api: |
|
||||
{{default "http://orion-visor-service:80" (env "SERVER")}}
|
||||
items:
|
||||
- name: login
|
||||
request:
|
||||
api: /orion-visor/api/infra/auth/login
|
||||
method: POST
|
||||
header:
|
||||
Content-type: application/json
|
||||
body: |
|
||||
{"username":"admin","password":"21232f297a57a5a743894a0e4a801fc3"}
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
- name: userPermission
|
||||
request:
|
||||
api: /orion-visor/api/infra/permission/user
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
msg: "success"
|
||||
- name: menu
|
||||
request:
|
||||
api: /orion-visor/api/infra/permission/menu
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
msg: "success"
|
||||
- name: haveUnRead
|
||||
request:
|
||||
api: /orion-visor/api/infra/system-message/has-unread
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
- name: queryOperatorLog
|
||||
request:
|
||||
api: /orion-visor/api/infra/mine/query-operator-log
|
||||
method: POST
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
- name: hostList
|
||||
request:
|
||||
api: /orion-visor/api/infra/tag/list?type=HOST
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
- name: queryHost
|
||||
request:
|
||||
api: /orion-visor/api/asset/host/query
|
||||
method: POST
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
@@ -1,9 +1,17 @@
|
||||
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-2-schema-tables.sql /tmp
|
||||
COPY ./sql/init-3-schema-quartz.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 && \
|
||||
cat /tmp/init-2-schema-tables.sql >> /tmp/init.sql && \
|
||||
cat /tmp/init-3-schema-quartz.sql >> /tmp/init.sql && \
|
||||
@@ -1,5 +1,5 @@
|
||||
#/bin/bash
|
||||
version=2.0.2
|
||||
version=2.0.10
|
||||
cp -r ../../sql ./sql
|
||||
docker build -t orion-visor-mysql:${version} .
|
||||
rm -rf ./sql
|
||||
@@ -1,4 +0,0 @@
|
||||
FROM redis:6.0.16-alpine
|
||||
WORKDIR /data
|
||||
COPY ./redis.conf /tmp
|
||||
RUN cat /tmp/redis.conf > /usr/local/redis.conf
|
||||
@@ -1,15 +0,0 @@
|
||||
FROM nginx:alpine
|
||||
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
|
||||
COPY ./orion-visor-launch.jar /app/app.jar
|
||||
COPY ./dist /usr/share/nginx/html
|
||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||
COPY ./nginx.conf /etc/nginx/conf.d
|
||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
||||
15
docker/redis/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM redis:6.0.16-alpine
|
||||
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
|
||||
RUN cat /tmp/redis.conf > /usr/local/redis.conf
|
||||
@@ -1,5 +1,5 @@
|
||||
#/bin/bash
|
||||
version=2.0.2
|
||||
version=2.0.10
|
||||
docker build -t 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}
|
||||
24
docker/service/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM nginx:alpine
|
||||
USER root
|
||||
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 dmidecode && \
|
||||
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 ./dist /usr/share/nginx/html
|
||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||
COPY ./nginx.conf /etc/nginx/conf.d
|
||||
# 启动
|
||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
||||
@@ -1,5 +1,5 @@
|
||||
#/bin/bash
|
||||
version=2.0.2
|
||||
version=2.0.10
|
||||
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
||||
mv ../../orion-visor-ui/dist ./dist
|
||||
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`** 提供一站式服务器运维解决方案。
|
||||
|
||||
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
||||
* **在线终端**:提供在线 Terminal 服务,支持快捷命令、大文件上传、在线编辑等操作。
|
||||
* **在线终端**:提供在线终端 SSH 服务,支持快捷命令、自定义快捷键和主题风格。
|
||||
* **文件管理**:支持远程主机 SFTP 大文件的批量上传、下载和在线编辑等操作。
|
||||
* **批量操作**:支持批量执行主机命令、多主机文件分发等功能。
|
||||
* **计划任务**:支持配置 cron 表达式,定时执行主机命令。
|
||||
* **安全可靠**:动态配置权限,记录用户操作日志,提供简单的审计功能。
|
||||
@@ -69,9 +76,8 @@ docker compose up -d
|
||||
|
||||
## 项目文档
|
||||
|
||||
* [文档地址](https://lijiahangmax.github.io/orion-visor/#/)
|
||||
* [docker安装](/quickstart/docker-install)
|
||||
* [普通安装](/quickstart/install)
|
||||
* [文档地址](/)
|
||||
* [安装文档](/quickstart/docker-install)
|
||||
* [更新日志](/about/change-log)
|
||||
* [操作手册](/operator/asset)
|
||||
* [常见问题](/quickstart/faq)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# orion-visor <small>2.0.2</small>
|
||||
# orion-visor
|
||||
|
||||
> 一款开箱即用的运维平台。
|
||||
> 一款高颜值、现代化的智能运维&轻量堡垒机平台。
|
||||
|
||||
- 友好 易用
|
||||
- 安全 稳定
|
||||
|
||||
@@ -14,6 +14,16 @@
|
||||
* 执行 升级的 `bash` 脚本
|
||||
* 进入 代码目录执行 `sh docker-upgrade.sh` 进行容器升级 `down` > `pull` > `up -d`
|
||||
|
||||
### v2.0.3
|
||||
|
||||
`2024-05-29` `release`
|
||||
|
||||
* 🐞 修复 部分 ui 显示错误
|
||||
* 🐞 修复 计划任务编辑时报错
|
||||
* 🐞 修复 计划任务手动触发时报错
|
||||
* 🩰 修改 logo
|
||||
* 🔨 修改 docker 时区
|
||||
|
||||
### v2.0.2
|
||||
|
||||
`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">
|
||||
<defs>
|
||||
<style>.cls-1{fill:url(#未命名的渐变_4);}.cls-2{fill:url(#未命名的渐变_6);}</style>
|
||||
<linearGradient id="未命名的渐变_4" x1="0.32" y1="15.03" x2="20.16" y2="15.03" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#23b6b6"/>
|
||||
<stop offset="1" stop-color="#189c98"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="未命名的渐变_6" x1="11.84" y1="16.97" x2="31.68" y2="16.97" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#08589b"/>
|
||||
<stop offset="1" stop-color="#2167b2"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path class="cls-1"
|
||||
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"/>
|
||||
<path class="cls-2"
|
||||
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"/>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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"
|
||||
viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:url(#SVGID_1_);}
|
||||
.st1{fill:#3B28CC;}
|
||||
</style>
|
||||
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="27.1802" y1="7.7935" x2="15.2269" y2="25.137">
|
||||
<stop offset="0" style="stop-color:#ADD7F6"/>
|
||||
<stop offset="0.2512" style="stop-color:#AAD5F6"/>
|
||||
<stop offset="0.4195" style="stop-color:#A1CDF7"/>
|
||||
<stop offset="0.5636" style="stop-color:#92C1F8"/>
|
||||
<stop offset="0.694" style="stop-color:#7DAFF9"/>
|
||||
<stop offset="0.8152" style="stop-color:#6198FB"/>
|
||||
<stop offset="0.9279" style="stop-color:#407CFD"/>
|
||||
<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>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -2,10 +2,10 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>关于 orion-visor</title>
|
||||
<title>orion-visor</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<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">
|
||||
<!-- Theme: Defaults -->
|
||||
<link rel="stylesheet" href="./assert/font.css">
|
||||
|
||||
@@ -34,7 +34,3 @@
|
||||
### 资产授权
|
||||
|
||||
给用户/角色授权资产数据, 若无授权则无法访问资产。
|
||||
|
||||
给用户授权时: 若当前选择的用户有管理员角色(admin)则无需配置, 管理员拥有全部权限。
|
||||
给角色授权时: 无需给管理员(admin)配置, 管理员拥有全部权限。
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* 命令: 查看执行时的命令
|
||||
* 参数: 查看执行时的参数
|
||||
* 中断: 中断命令执行
|
||||
* 日志: 查看执行日志, ctrl + 左键点击会用新页面打开
|
||||
* 日志: 查看执行日志 `ctrl + 左键` 点击会用新页面打开
|
||||
* 下载: 下载执行日志
|
||||
|
||||
### 批量上传
|
||||
@@ -65,14 +65,14 @@
|
||||
### 日志面板快捷键
|
||||
|
||||
* 回车: `Enter`
|
||||
* 向上滚动一行: `↑`
|
||||
* 向上滚动一页: `Home`
|
||||
* 向下滚动一行: `↓`
|
||||
* 向下滚动一页: `End`
|
||||
* 全选: `ctrl` `A`
|
||||
* 复制: `ctrl` `C`
|
||||
* 搜索: `ctrl` `F`
|
||||
* 清空: `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/`
|
||||
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`
|
||||
|
||||
### 配置
|
||||
|
||||
1. 拉取代码
|
||||
### 拉取代码
|
||||
|
||||
```
|
||||
# github
|
||||
@@ -22,7 +20,7 @@ git clone https://github.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
|
||||
```
|
||||
|
||||
3. 修改后端配置
|
||||
### 修改后端配置
|
||||
|
||||
```
|
||||
# 修改配置文件 (mysql, redis, secret-key)
|
||||
@@ -46,9 +44,9 @@ mvn -U clean install -DskipTests
|
||||
com.orion.visor.launch.LaunchApplication
|
||||
```
|
||||
|
||||
4. 修改前端配置
|
||||
### 修改前端配置
|
||||
|
||||
```
|
||||
```shell
|
||||
# 进入代码目录
|
||||
cd orion-visor/orion-visor-ui
|
||||
# 下载 pnpm
|
||||
|
||||
@@ -19,7 +19,7 @@ Dashboard 修改)
|
||||
|
||||
### 拉取代码
|
||||
|
||||
```
|
||||
```shell
|
||||
# github
|
||||
git clone https://github.com/lijiahangmax/orion-visor
|
||||
# gitee
|
||||
@@ -41,18 +41,18 @@ cd orion-visor
|
||||
|
||||
### 启动
|
||||
|
||||
```
|
||||
```shell
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### 连接 mysql (如果需要在 navicat 中连接)
|
||||
### 修改加密方式
|
||||
|
||||
```
|
||||
访问 adminer: http://localhost:8081
|
||||
服务器: orion-visor-mysql
|
||||
用户名: root
|
||||
密码: Data@123456
|
||||
数据库: orion-visor
|
||||
密 码: Data@123456
|
||||
数据库: orion_visor
|
||||
|
||||
点击左侧 SQL命令 输入:
|
||||
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/ 访问
|
||||
账号: 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`
|
||||
如果不知道数据是哪一条, 可以查询用户操作日志, 点击 `参数` 寻找操作的id
|
||||
|
||||
> ##### 2. 执行命令时为什么会找不到环境变量?
|
||||
### 执行命令时为什么会找不到环境变量?
|
||||
|
||||
可以在执行命令的第一行设置 `source /etc/profile` 来加载环境变量
|
||||
|
||||
> ##### 3. 命令中途执行失败如何设置中断执行?
|
||||
### 命令中途执行失败如何设置中断执行?
|
||||
|
||||
可以在执行命令的第一行设置 `set -e`
|
||||
作用是: 当执行出现意料之外的情况时, 立即退出
|
||||
|
||||
> ##### 4. 在调度任务、批量执行 命令执行成功的依据是什么?
|
||||
### 在调度任务、批量执行 命令执行成功的依据是什么?
|
||||
|
||||
是获取命令的 `exitcode` 判断是否为 `0` 如果非0则代表命令执行失败
|
||||
同理, 在命令的最后一行设置 `exit 1` 结果将会是失败, 可以用此来中断后续流程
|
||||
|
||||
> ##### 5. 调度任务、批量执行 的日志文件中如何只保存原始输出?
|
||||
### 调度任务、批量执行 的日志文件中如何只保存原始输出?
|
||||
|
||||
修改 `application.yaml` `app.exec-log.append-ansi` 为 `false`
|
||||
|
||||
> ##### 6. 为什么使用密钥认证还是无法连接机器?
|
||||
### SFTP 为什么有些文件无法编辑?
|
||||
|
||||
只有普通文件可以在线编辑, 也就是 attr 为 `-` 开头的文件, 且文件大小不超过 `2MB` (默认)
|
||||
修改 `.env.production` `VITE_SFTP_PREVIEW_MB` 改为一个合适的大小(MB) 重新构建
|
||||
|
||||
### 为什么使用密钥认证还是无法连接机器?
|
||||
|
||||
```
|
||||
# 升级 openssh
|
||||
@@ -41,9 +56,3 @@ AuthorizedKeysFile .ssh/authorized_keys
|
||||
# 重启 sshd 服务
|
||||
service sshd restart
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||
⚡ 详细使用请参考操作手册~
|
||||
|
||||
<br/>
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
⚡ npm 建议使用淘宝镜像 `npm config set registry https://registry.npmmirror.com/`
|
||||
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`
|
||||
|
||||
### 构建
|
||||
|
||||
1. 拉取代码
|
||||
### 拉取代码
|
||||
|
||||
```
|
||||
# github
|
||||
@@ -23,7 +21,7 @@ git clone https://github.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
|
||||
```
|
||||
|
||||
3. 构建后端代码
|
||||
### 构建后端代码
|
||||
|
||||
```
|
||||
# 修改配置文件 (mysql, redis, secret-key)
|
||||
@@ -45,7 +43,7 @@ cd orion-visor
|
||||
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-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 &
|
||||
# 启动 nginx
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.0
|
||||
### v1.0.0
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 字典配置项
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## v1.0.1
|
||||
### v1.0.1
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
DROP TABLE IF EXISTS `command_template`;
|
||||
ALTER TABLE `operator_log` ADD INDEX `idx_type`(`type`);
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 菜单配置
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.2
|
||||
### v1.0.2
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
ALTER TABLE `host_connect_log`
|
||||
@@ -83,7 +83,7 @@ CREATE TABLE `exec_template`
|
||||
ROW_FORMAT = Dynamic;
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 菜单配置
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.3
|
||||
### v1.0.3
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
DELETE FROM preference WHERE type = 'TERMINAL';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.4
|
||||
### v1.0.4
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
-- 修改字段
|
||||
@@ -260,7 +260,7 @@ CREATE TABLE `QRTZ_SCHEDULER_STATE`
|
||||
ROW_FORMAT = Dynamic;
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 操作日志修改
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.5
|
||||
### v1.0.5
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
ALTER TABLE `system_user`
|
||||
@@ -22,7 +22,7 @@ ALTER TABLE `exec_host_log`
|
||||
ADD COLUMN `script_path` varchar(512) NULL COMMENT '脚本路径' AFTER `log_path`;
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 初始化主机身份类型
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.6
|
||||
### v1.0.6
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
-- 数据分组添加 userId
|
||||
@@ -58,10 +58,9 @@ CREATE TABLE `path_bookmark`
|
||||
CHARACTER SET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT = '路径书签'
|
||||
ROW_FORMAT = Dynamic;
|
||||
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 设置数据分组 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);
|
||||
```
|
||||
|
||||
> sql 脚本 - 命令分组初始化
|
||||
### sql 脚本 - 命令分组初始化
|
||||
|
||||
```sql
|
||||
-- 插入命令片段分组
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.7
|
||||
### v1.0.7
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
ALTER TABLE `data_permission` COMMENT = '数据权限表';
|
||||
@@ -57,7 +57,7 @@ CREATE TABLE `upload_task_file`
|
||||
ROW_FORMAT = Dynamic;
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 字典项
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## v1.0.8
|
||||
### v1.0.8
|
||||
|
||||
> sql 脚本 - DDL
|
||||
### sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
-- 修改字段名称
|
||||
@@ -32,7 +32,7 @@ CREATE TABLE `system_message`
|
||||
ROW_FORMAT = Dynamic;
|
||||
```
|
||||
|
||||
> sql 脚本 - DML
|
||||
### sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 菜单
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
## v2.0.0
|
||||
### v2.0.0
|
||||
|
||||
### ⚡ **本次升级提示 本次更新较大 请仔细查阅** ⚡
|
||||
|
||||
##### 本次升级思路:
|
||||
|
||||
* 先执行以下 **`7`** 个脚本
|
||||
* 容器下线 `docker compose down`
|
||||
* 删除原代码目录 `rm -rf orion-ops-pro`
|
||||
* 克隆改名后的项目 `git clone https://github.com/lijiahangmax/orion-visor.git` or `gitee`
|
||||
* 启动容器 `docker compose up -d`
|
||||
|
||||
```readme
|
||||
```text
|
||||
sql 在 adminer/navicat 中执行, bash 脚本直接修改后粘贴执行 不要保存为文件执行否则会出错
|
||||
本次升级包含数据库重命名操作。#3 创建新数据库, #4 进行数据迁移, #5 删除旧数据库。
|
||||
[不推荐] 如果不想重命名可以修改 docker-compose.yml, 将 MYSQL_DATABASE 改为 orion-ops-pro 并且跳过步骤 #3 #4 #5
|
||||
```
|
||||
|
||||
> #1 sql 脚本 - DDL
|
||||
### 1. sql 脚本 - DDL
|
||||
|
||||
```sql
|
||||
-- 修改默认值
|
||||
@@ -29,7 +27,7 @@ MODIFY COLUMN `key_id` bigint(0) NULL DEFAULT NULL COMMENT '密钥id' AFTER `pas
|
||||
ALTER TABLE `host_key` COMMENT = '主机密钥';
|
||||
```
|
||||
|
||||
> #2 sql 脚本 - DML
|
||||
### 2. sql 脚本 - DML
|
||||
|
||||
```sql
|
||||
-- 删除 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);
|
||||
```
|
||||
|
||||
> #3 sql 脚本 - 创建数据库 orion_visor
|
||||
### 3. sql 脚本 - 创建数据库 orion_visor
|
||||
|
||||
```sql
|
||||
-- 创建数据库
|
||||
CREATE DATABASE IF NOT EXISTS `orion_visor` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
```
|
||||
|
||||
> #4 bash 脚本 - 数据迁移
|
||||
### 4. bash 脚本 - 数据迁移
|
||||
|
||||
```bash
|
||||
# 可以使用 navicat 的数据迁移功能, 下面描述的是 bash 中执行, 注意下面的变量替换
|
||||
@@ -97,14 +95,14 @@ rm -f /tmp/orion-ops-pro_dump.sql
|
||||
exit
|
||||
```
|
||||
|
||||
> #5 sql 脚本 - 删除数据库
|
||||
### 5. sql 脚本 - 删除数据库
|
||||
|
||||
```sql
|
||||
-- 删除数据库
|
||||
DROP DATABASE `orion-ops-pro`;
|
||||
```
|
||||
|
||||
> #6 bash 脚本 - 修改 nginx 配置
|
||||
### 6. bash 脚本 - 修改 nginx 配置
|
||||
|
||||
```bash
|
||||
pro_container_id=41dfd6aff736;
|
||||
@@ -118,7 +116,7 @@ nginx -s reload
|
||||
exit
|
||||
```
|
||||
|
||||
> #7 bash 脚本 - 工作空间迁移
|
||||
### 7. 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
|
||||
```
|
||||
@@ -11,14 +11,14 @@
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<description>项目所有依赖</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<properties>
|
||||
<revision>2.0.2</revision>
|
||||
<revision>2.0.10</revision>
|
||||
<spring.boot.version>2.7.17</spring.boot.version>
|
||||
<spring.boot.admin.version>2.7.15</spring.boot.admin.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>
|
||||
<lombok.version>1.18.26</lombok.version>
|
||||
<springdoc.version>1.6.15</springdoc.version>
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>io.github.lijiahangmax</groupId>
|
||||
<artifactId>orion-all</artifactId>
|
||||
<version>${orion.kit.revision}</version>
|
||||
<version>${orion.kit.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>orion-log</artifactId>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目公共基准包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.orion.visor.framework.common.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 保留
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/6 15:26
|
||||
*/
|
||||
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Keep {
|
||||
|
||||
}
|
||||
@@ -14,14 +14,17 @@ public interface AppConst extends OrionConst {
|
||||
/**
|
||||
* 同 ${orion.version} 迭代时候需要手动更改
|
||||
*/
|
||||
String VERSION = "2.0.2";
|
||||
String VERSION = "2.0.10";
|
||||
|
||||
String ORION_VISOR = "orion-visor";
|
||||
/**
|
||||
* 同 ${spring.application.name}
|
||||
*/
|
||||
String APP_NAME = "orion-visor";
|
||||
|
||||
String GITHUB = "https://github.com/lijiahangmax/orion-visor";
|
||||
String GITHUB = "https://github.com/dromara/orion-visor";
|
||||
|
||||
String GITEE = "https://gitee.com/lijiahangmax/orion-visor";
|
||||
String GITEE = "https://gitee.com/dromara/orion-visor";
|
||||
|
||||
String ISSUES = "https://github.com/lijiahangmax/orion-visor/issues";
|
||||
String ISSUES = "https://github.com/dromara/orion-visor/issues";
|
||||
|
||||
}
|
||||
|
||||
@@ -13,4 +13,8 @@ public interface CnConst {
|
||||
|
||||
String CN_ROLE = "角色";
|
||||
|
||||
String CN_UNKNOWN = "未知";
|
||||
|
||||
String CN_INTRANET_IP = "内网IP";
|
||||
|
||||
}
|
||||
|
||||
@@ -17,16 +17,10 @@ public interface Const extends com.orion.lang.constant.Const, FieldConst, CnCons
|
||||
|
||||
int MD5_LEN = 32;
|
||||
|
||||
String UNKNOWN = "未知";
|
||||
|
||||
String INTRANET_IP = "内网IP";
|
||||
|
||||
Long ROOT_PARENT_ID = 0L;
|
||||
|
||||
Integer DEFAULT_SORT = 10;
|
||||
|
||||
int LOGIN_HISTORY_COUNT = 30;
|
||||
|
||||
Long NONE_ID = -1L;
|
||||
|
||||
Integer DEFAULT_VERSION = 1;
|
||||
|
||||
@@ -83,8 +83,12 @@ public interface ErrorMessage {
|
||||
|
||||
String UNKNOWN_TYPE = "未知类型";
|
||||
|
||||
String ERROR_TYPE = "错误的类型";
|
||||
|
||||
String FILE_ABSENT = "文件不存在";
|
||||
|
||||
String FILE_ABSENT_CLEAR = "文件不存在 (可能已被清理)";
|
||||
|
||||
String LOG_ABSENT = "日志不存在";
|
||||
|
||||
String TASK_ABSENT = "任务不存在";
|
||||
@@ -95,6 +99,10 @@ public interface ErrorMessage {
|
||||
|
||||
String FILE_READ_ERROR = "文件读取失败";
|
||||
|
||||
String FILE_READ_ERROR_CLEAR = "文件读取失败 (可能已被清理)";
|
||||
|
||||
String PLEASE_CHECK_HOST_SSH = "请检查主机 {} 是否存在/权限/SSH配置";
|
||||
|
||||
String CLIENT_ABORT = "手动中断";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.orion.visor.framework.common.constant;
|
||||
|
||||
/**
|
||||
* 路径常量
|
||||
* 文件常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/17 10:35
|
||||
*/
|
||||
public interface PathConst {
|
||||
public interface FileConst {
|
||||
|
||||
String ERROR_LOG = "error.log";
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.orion.visor.framework.common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自动清理配置
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/24 15:03
|
||||
*/
|
||||
@Data
|
||||
public class AutoClearConfig {
|
||||
|
||||
/**
|
||||
* 是否开启
|
||||
*/
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 保留周期 (天)
|
||||
*/
|
||||
private Integer keepPeriod;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.orion.visor.framework.common.enums;
|
||||
|
||||
import com.orion.lang.utils.Strings;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 端点定义
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/21 19:15
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EndpointDefine {
|
||||
|
||||
/**
|
||||
* 上传临时分区
|
||||
*/
|
||||
UPLOAD_SWAP("/upload/swap/{}"),
|
||||
|
||||
/**
|
||||
* 批量执行日志
|
||||
*/
|
||||
EXEC_LOG("/exec/{}/{}.log"),
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 端点
|
||||
*/
|
||||
private final String endpoint;
|
||||
|
||||
/**
|
||||
* 格式化
|
||||
*
|
||||
* @param params params
|
||||
* @return path
|
||||
*/
|
||||
public String format(Object... params) {
|
||||
return Strings.format(this.endpoint, params);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,13 +14,19 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum MovePosition {
|
||||
|
||||
// 拖拽到目标元素上
|
||||
/**
|
||||
* 拖拽到目标元素上
|
||||
*/
|
||||
TOP(-1),
|
||||
|
||||
// 拖拽到目标元素中
|
||||
/**
|
||||
* 拖拽到目标元素中
|
||||
*/
|
||||
IN(0),
|
||||
|
||||
// 拖拽到目标元素下
|
||||
/**
|
||||
* 拖拽到目标元素下
|
||||
*/
|
||||
BOTTOM(1),
|
||||
|
||||
;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.orion.visor.framework.common.handler.data;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orion.spring.SpringHolder;
|
||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||
import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy;
|
||||
import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy;
|
||||
|
||||
/**
|
||||
* 标准数据定义
|
||||
@@ -12,45 +11,50 @@ import com.orion.visor.framework.common.handler.data.strategy.MapDataStrategy;
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/21 0:07
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface GenericsDataDefinition {
|
||||
|
||||
/**
|
||||
* 获取数据模型类型
|
||||
*
|
||||
* @return class
|
||||
*/
|
||||
Class<? extends GenericsDataModel> getModel();
|
||||
|
||||
/**
|
||||
* 获取数据处理策略
|
||||
*
|
||||
* @return class
|
||||
*/
|
||||
Class<? extends MapDataStrategy<? extends GenericsDataModel>> getStrategy();
|
||||
Class<? extends GenericsDataStrategy<? extends GenericsDataModel>> getStrategyClass();
|
||||
|
||||
/**
|
||||
* 获取数据模型策略处理器
|
||||
*
|
||||
* @param <Model> Model
|
||||
* @param <Strategy> Strategy
|
||||
* @return StrategyBean
|
||||
* @param <M> Model
|
||||
* @param <S> Strategy
|
||||
* @return Strategy Bean
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
default <Model extends GenericsDataModel, Strategy extends MapDataStrategy<Model>> Strategy getStrategyBean() {
|
||||
return (Strategy) SpringHolder.getBean(this.getStrategy());
|
||||
default <M extends GenericsDataModel, S extends GenericsDataStrategy<M>> S getStrategy() {
|
||||
return (S) SpringHolder.getBean(this.getStrategyClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* 反序列化对象
|
||||
*
|
||||
* @param json json
|
||||
* @param <Model> Model
|
||||
* @param serialModel serialModel
|
||||
* @param <M> Model
|
||||
* @return object
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
default <Model extends GenericsDataModel> Model parse(String json) {
|
||||
return (Model) JSON.parseObject(json, this.getModel());
|
||||
default <M extends GenericsDataModel> M parse(String serialModel) {
|
||||
return (M) this.getStrategy().parse(serialModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转为视图对象
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @param <M> Model
|
||||
* @return viewModel
|
||||
*/
|
||||
default <M extends GenericsDataModel> M toView(String serialModel) {
|
||||
GenericsDataStrategy<GenericsDataModel> strategy = this.getStrategy();
|
||||
GenericsDataModel model = strategy.parse(serialModel);
|
||||
strategy.toView(model);
|
||||
return (M) model;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.orion.visor.framework.common.handler.data.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 标准数据模型
|
||||
*
|
||||
@@ -20,4 +22,14 @@ public interface GenericsDataModel {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 转为 map
|
||||
*
|
||||
* @return map
|
||||
*/
|
||||
default Map<String, Object> toMap() {
|
||||
return JSON.parseObject(this.serial());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.orion.visor.framework.common.handler.data.strategy;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||
|
||||
/**
|
||||
* 标准数据处理策略 基类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/11 21:44
|
||||
*/
|
||||
public abstract class AbstractGenericsDataStrategy<M extends GenericsDataModel> implements GenericsDataStrategy<M> {
|
||||
|
||||
protected final Class<M> modelClass;
|
||||
|
||||
public AbstractGenericsDataStrategy(Class<M> modelClass) {
|
||||
this.modelClass = modelClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新填充
|
||||
*
|
||||
* @param beforeModel 修改前的配置
|
||||
* @param afterModel 修改后的配置
|
||||
*/
|
||||
protected void updateFill(M beforeModel, M afterModel) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 预校验参数
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
protected void preValid(M model) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
protected void valid(M model) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doValid(M beforeModel, M afterModel) {
|
||||
// 预校验参数
|
||||
this.preValid(afterModel);
|
||||
// 更新填充
|
||||
this.updateFill(beforeModel, afterModel);
|
||||
// 校验参数
|
||||
this.valid(afterModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public M parse(String serialModel) {
|
||||
return JSON.parseObject(serialModel, modelClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toView(M model) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,60 +9,38 @@ import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/20 22:09
|
||||
*/
|
||||
public interface GenericsDataStrategy<Model extends GenericsDataModel, View> {
|
||||
public interface GenericsDataStrategy<M extends GenericsDataModel> {
|
||||
|
||||
/**
|
||||
* 获取默认值
|
||||
*
|
||||
* @return 默认值
|
||||
*/
|
||||
Model getDefault();
|
||||
|
||||
/**
|
||||
* 更新填充
|
||||
*
|
||||
* @param beforeModel 修改前的配置
|
||||
* @param afterModel 修改后的配置
|
||||
*/
|
||||
void updateFill(Model beforeModel, Model afterModel);
|
||||
|
||||
/**
|
||||
* 预校验参数
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
void preValid(Model model);
|
||||
|
||||
/**
|
||||
* 校验参数
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
void valid(Model model);
|
||||
M getDefault();
|
||||
|
||||
/**
|
||||
* 执行完整验证链
|
||||
* <p>
|
||||
* preValid > updateFill > preValid
|
||||
* preValid > updateFill > valid
|
||||
*
|
||||
* @param beforeModel beforeModel
|
||||
* @param afterModel afterModel
|
||||
*/
|
||||
default void doValidChain(Model beforeModel, Model afterModel) {
|
||||
// 预校验参数
|
||||
this.preValid(afterModel);
|
||||
// 更新填充
|
||||
this.updateFill(beforeModel, afterModel);
|
||||
// 校验参数
|
||||
this.valid(afterModel);
|
||||
}
|
||||
void doValid(M beforeModel, M afterModel);
|
||||
|
||||
/**
|
||||
* 解析数据
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @return model
|
||||
*/
|
||||
M parse(String serialModel);
|
||||
|
||||
/**
|
||||
* 转为视图配置
|
||||
*
|
||||
* @param model model
|
||||
* @return 视图配置
|
||||
*/
|
||||
View toView(String model);
|
||||
void toView(M model);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.orion.visor.framework.common.handler.data.strategy;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* map 数据处理策略
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/20 22:11
|
||||
*/
|
||||
public interface MapDataStrategy<Model extends GenericsDataModel> extends GenericsDataStrategy<Model, Map<String, Object>> {
|
||||
|
||||
@Override
|
||||
default Map<String, Object> toView(String model) {
|
||||
return JSONObject.parseObject(model);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,12 @@ package com.orion.visor.framework.common.utils;
|
||||
|
||||
import com.orion.ext.location.Region;
|
||||
import com.orion.ext.location.region.LocationRegions;
|
||||
import com.orion.lang.constant.StandardHttpHeader;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import com.orion.web.servlet.web.Servlets;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -21,6 +25,22 @@ public class IpUtils {
|
||||
private IpUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求地址
|
||||
*
|
||||
* @param request request
|
||||
* @return addr
|
||||
*/
|
||||
public static String getRemoteAddr(HttpServletRequest request) {
|
||||
// 获取实际地址
|
||||
String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP);
|
||||
if (!Strings.isBlank(realIp)) {
|
||||
return realIp;
|
||||
}
|
||||
// 获取请求地址
|
||||
return Servlets.getRemoteAddr(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 ip 位置
|
||||
*
|
||||
@@ -29,7 +49,7 @@ public class IpUtils {
|
||||
*/
|
||||
public static String getLocation(String ip) {
|
||||
if (ip == null) {
|
||||
return Const.UNKNOWN;
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
// 查询缓存
|
||||
return CACHE.computeIfAbsent(ip, IpUtils::queryLocation);
|
||||
@@ -43,21 +63,21 @@ public class IpUtils {
|
||||
*/
|
||||
private static String queryLocation(String ip) {
|
||||
if (ip == null) {
|
||||
return Const.UNKNOWN;
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
Region region;
|
||||
try {
|
||||
region = LocationRegions.getRegion(ip, 3);
|
||||
} catch (Exception e) {
|
||||
return Const.UNKNOWN;
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
if (region != null) {
|
||||
String net = region.getNet();
|
||||
String province = region.getProvince();
|
||||
if (net.equals(Const.INTRANET_IP)) {
|
||||
if (net.equals(Const.CN_INTRANET_IP)) {
|
||||
return net;
|
||||
}
|
||||
if (province.equals(Const.UNKNOWN)) {
|
||||
if (province.equals(Const.CN_UNKNOWN)) {
|
||||
return province;
|
||||
}
|
||||
StringBuilder location = new StringBuilder()
|
||||
@@ -69,7 +89,7 @@ public class IpUtils {
|
||||
location.append(" (").append(net).append(')');
|
||||
return location.toString();
|
||||
}
|
||||
return Const.UNKNOWN;
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Arrays1;
|
||||
import com.orion.lang.utils.crypto.Caesars;
|
||||
|
||||
/**
|
||||
* 混淆工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/17 18:27
|
||||
*/
|
||||
public class Mixes {
|
||||
|
||||
private Mixes() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 混淆
|
||||
* <p>
|
||||
* 此方法不可修改
|
||||
*
|
||||
* @param str str
|
||||
* @return str
|
||||
*/
|
||||
public static String obfuscate(String str) {
|
||||
char[] chars = str.toCharArray();
|
||||
Arrays1.reverse(chars);
|
||||
for (int i = 0; i < chars.length; i += 2) {
|
||||
char temp = chars[i];
|
||||
chars[i] = chars[i + 1];
|
||||
chars[i + 1] = temp;
|
||||
}
|
||||
String res = new String(chars);
|
||||
return new Caesars().encrypt(res);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class PathUtils {
|
||||
public static String getAppPath(boolean isWindows, String username) {
|
||||
return getHomePath(isWindows, username)
|
||||
+ "/" + AppConst.ORION
|
||||
+ "/" + AppConst.ORION_VISOR;
|
||||
+ "/" + AppConst.APP_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Requests {
|
||||
.map(s -> (ServletRequestAttributes) s)
|
||||
.map(ServletRequestAttributes::getRequest)
|
||||
.ifPresent(request -> {
|
||||
String address = Servlets.getRemoteAddr(request);
|
||||
String address = IpUtils.getRemoteAddr(request);
|
||||
identity.setAddress(address);
|
||||
identity.setLocation(IpUtils.getLocation(address));
|
||||
identity.setUserAgent(Servlets.getUserAgent(request));
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{
|
||||
"name": "orion.async.executor.core-pool-size",
|
||||
"type": "java.lang.Integer",
|
||||
"description": "核心线程数量",
|
||||
"description": "核心线程数量.",
|
||||
"defaultValue": "8"
|
||||
},
|
||||
{
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目 banner 打印包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -36,24 +36,47 @@ public class BannerApplicationRunner implements ApplicationRunner {
|
||||
@Value("${management.endpoints.web.base-path:''}")
|
||||
private String managementEndpoints;
|
||||
|
||||
@Value("${springdoc.api-docs.enabled}")
|
||||
private Boolean apiDocsEnabled;
|
||||
|
||||
@Value("${spring.datasource.druid.stat-view-servlet.enabled}")
|
||||
private Boolean druidConsoleEnabled;
|
||||
|
||||
@Value("#{'${management.endpoints.web.exposure.include}' != 'shutdown'}")
|
||||
private Boolean springBootActuatorEnabled;
|
||||
|
||||
@Value("${spring.boot.admin.client.enabled}")
|
||||
private Boolean springBootAdminClientEnabled;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
String line = AnsiAppender.create()
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: orion-visor-launch v" + version + " 服务已启动(" + env + ") ::\n")
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: swagger 文档 ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/doc.html\n")
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: druid console ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/druid/index.html\n")
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: actuator endpoint ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + managementEndpoints + "\n")
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: admin console ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + adminSeverContextPath + "\n")
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: server 健康检测 ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "curl -X GET --location \"http://127.0.0.1:" + port + apiPrefix + "/server/bootstrap/health\"")
|
||||
.toString();
|
||||
AnsiAppender appender = AnsiAppender.create()
|
||||
.append(AnsiForeground.BRIGHT_GREEN, ":: orion-visor v" + version + " 服务已启动(" + env + ") ::\n");
|
||||
// swagger 地址
|
||||
if (apiDocsEnabled) {
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN, ":: swagger 文档 ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/doc.html\n");
|
||||
}
|
||||
// druid 控制台
|
||||
if (druidConsoleEnabled) {
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN, ":: druid console ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + "/druid/index.html\n");
|
||||
}
|
||||
// admin actuator 端点
|
||||
if (springBootActuatorEnabled) {
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN, ":: actuator endpoint ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + managementEndpoints + "\n");
|
||||
}
|
||||
// admin server 控制台
|
||||
if (springBootAdminClientEnabled) {
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN, ":: admin console ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "http://127.0.0.1:" + port + adminSeverContextPath + "\n");
|
||||
}
|
||||
appender.append(AnsiForeground.BRIGHT_GREEN, ":: server 健康检测 ")
|
||||
.append(AnsiForeground.BRIGHT_BLUE, "curl -X GET --location \"http://127.0.0.1:" + port + apiPrefix + "/server/bootstrap/health\"");
|
||||
Threads.start(() -> {
|
||||
Threads.sleep(1000L);
|
||||
System.out.println(line);
|
||||
System.out.println(appender);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,5 @@ ${AnsiColor.BRIGHT_GREEN}:: Application Name ${AnsiColor.BLUE}${spring.appli
|
||||
${AnsiColor.BRIGHT_GREEN}:: Application Version ${AnsiColor.BLUE}${orion.version}
|
||||
${AnsiColor.BRIGHT_GREEN}:: SpringBoot Version ${AnsiColor.BLUE}${spring-boot.version}
|
||||
${AnsiColor.BRIGHT_GREEN}:: Active Profile ${AnsiColor.BLUE}${spring.profiles.active}
|
||||
${AnsiColor.BRIGHT_GREEN}:: Demo Mode ${AnsiColor.BLUE}${orion.demo}
|
||||
${AnsiColor.DEFAULT}
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目操作日志包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目数据源配置包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目数据脱敏包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目定时任务配置包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目日志配置包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.orion.visor.framework.log.configuration.config;
|
||||
|
||||
import com.orion.visor.framework.common.utils.ConfigUtils;
|
||||
import com.orion.visor.framework.log.core.enums.LogPrinterMode;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@@ -17,6 +18,11 @@ import java.util.List;
|
||||
@ConfigurationProperties("orion.logging.printer")
|
||||
public class LogPrinterConfig {
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private LogPrinterMode mode;
|
||||
|
||||
/**
|
||||
* 字段配置
|
||||
*/
|
||||
@@ -32,12 +38,31 @@ public class LogPrinterConfig {
|
||||
*/
|
||||
private String expression;
|
||||
|
||||
public void setField(LogPrinterFieldConfig field) {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public void setHeaders(List<String> headers) {
|
||||
this.headers = ConfigUtils.parseStringList(headers, String::toLowerCase);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class LogPrinterFieldConfig {
|
||||
|
||||
/**
|
||||
* 忽略的字段
|
||||
*/
|
||||
private List<String> ignore;
|
||||
|
||||
/**
|
||||
* 脱敏的字段
|
||||
*/
|
||||
private List<String> desensitize;
|
||||
|
||||
public void setIgnore(List<String> ignore) {
|
||||
this.ignore = ConfigUtils.parseStringList(ignore);
|
||||
}
|
||||
|
||||
public void setDesensitize(List<String> desensitize) {
|
||||
this.desensitize = ConfigUtils.parseStringList(desensitize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.orion.visor.framework.log.configuration.config;
|
||||
|
||||
import com.orion.visor.framework.common.utils.ConfigUtils;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日志打印字段配置
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/28 22:36
|
||||
*/
|
||||
@Data
|
||||
public class LogPrinterFieldConfig {
|
||||
|
||||
/**
|
||||
* 忽略的字段
|
||||
*/
|
||||
private List<String> ignore;
|
||||
|
||||
/**
|
||||
* 脱敏的字段
|
||||
*/
|
||||
private List<String> desensitize;
|
||||
|
||||
public void setIgnore(List<String> ignore) {
|
||||
this.ignore = ConfigUtils.parseStringList(ignore);
|
||||
}
|
||||
|
||||
public void setDesensitize(List<String> desensitize) {
|
||||
this.desensitize = ConfigUtils.parseStringList(desensitize);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.orion.visor.framework.log.core.interceptor;
|
||||
import com.orion.lang.utils.Exceptions;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.lang.utils.time.Dates;
|
||||
import com.orion.visor.framework.common.utils.IpUtils;
|
||||
import com.orion.visor.framework.common.utils.SwaggerUtils;
|
||||
import com.orion.visor.framework.log.configuration.config.LogPrinterConfig;
|
||||
import com.orion.web.servlet.web.Servlets;
|
||||
@@ -60,7 +61,7 @@ public class PrettyLogPrinterInterceptor extends AbstractLogPrinterInterceptor {
|
||||
// http
|
||||
if (request != null) {
|
||||
// remoteAddr
|
||||
requestLog.append("\tremoteAddr: ").append(Servlets.getRemoteAddr(request)).append('\n');
|
||||
requestLog.append("\tremoteAddr: ").append(IpUtils.getRemoteAddr(request)).append('\n');
|
||||
// header
|
||||
Servlets.getHeaderMap(request).forEach((hk, hv) -> {
|
||||
if (headerFilter.test(hk.toLowerCase())) {
|
||||
@@ -72,9 +73,9 @@ public class PrettyLogPrinterInterceptor extends AbstractLogPrinterInterceptor {
|
||||
}
|
||||
Method method = invocation.getMethod();
|
||||
// 方法签名
|
||||
requestLog.append("\tmethodSign: ").append(method.getDeclaringClass().getName()).append('#')
|
||||
.append(method.getName()).append("\n");
|
||||
// 参数
|
||||
// requestLog.append("\tmethodSign: ").append(method.getDeclaringClass().getName()).append('#')
|
||||
// .append(method.getName()).append("\n");
|
||||
// 方法参数
|
||||
requestLog.append("\tparameter: ").append(this.requestToString(method, invocation.getArguments()));
|
||||
log.info(requestLog.toString());
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.orion.lang.utils.Exceptions;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.lang.utils.time.Dates;
|
||||
import com.orion.visor.framework.common.utils.IpUtils;
|
||||
import com.orion.visor.framework.common.utils.SwaggerUtils;
|
||||
import com.orion.visor.framework.log.configuration.config.LogPrinterConfig;
|
||||
import com.orion.visor.framework.log.core.enums.LogFieldConst;
|
||||
@@ -61,7 +62,7 @@ public class RowLogPrinterInterceptor extends AbstractLogPrinterInterceptor impl
|
||||
// http
|
||||
if (request != null) {
|
||||
// remoteAddr
|
||||
fields.put(REMOTE_ADDR, Servlets.getRemoteAddr(request));
|
||||
fields.put(REMOTE_ADDR, IpUtils.getRemoteAddr(request));
|
||||
// header
|
||||
Map<String, Object> headers = new LinkedHashMap<>();
|
||||
Servlets.getHeaderMap(request).forEach((hk, hv) -> {
|
||||
@@ -73,8 +74,8 @@ public class RowLogPrinterInterceptor extends AbstractLogPrinterInterceptor impl
|
||||
}
|
||||
Method method = invocation.getMethod();
|
||||
// 方法签名
|
||||
fields.put(METHOD_SIGN, method.getDeclaringClass().getName() + "#" + method.getName());
|
||||
// 参数
|
||||
// fields.put(METHOD_SIGN, method.getDeclaringClass().getName() + "#" + method.getName());
|
||||
// 方法参数
|
||||
fields.put(PARAMETER, this.requestToString(method, invocation.getArguments()));
|
||||
log.info("api请求-开始 {}", JSON.toJSONString(fields));
|
||||
fields.clear();
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目监控配置包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<description>项目 mybatis 配置包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -62,10 +62,6 @@ public class CustomFileFilter {
|
||||
if (!table.isEnableCache()) {
|
||||
files.removeIf(file -> isServerCacheFile(file.getTemplatePath()));
|
||||
}
|
||||
// 不生成导出文件
|
||||
if (!table.isEnableExport()) {
|
||||
files.removeIf(file -> isExportFile(file.getTemplatePath()));
|
||||
}
|
||||
// 不生成操作日志文件
|
||||
if (!table.isEnableOperatorLog()) {
|
||||
files.removeIf(file -> isOperatorLogFile(file.getTemplatePath()));
|
||||
|
||||
@@ -73,16 +73,6 @@ public class ServerTemplate extends Template {
|
||||
return this;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 生成导出
|
||||
// *
|
||||
// * @return this
|
||||
// */
|
||||
// public ServerTemplate enableExport() {
|
||||
// table.enableExport = true;
|
||||
// return this;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 不生成单元测试
|
||||
*
|
||||
|
||||