Skip to content

Commit

Permalink
Merge pull request #15 from lijiahangmax/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lijiahangmax authored May 21, 2024
2 parents 4523138 + cce511c commit 0656c18
Show file tree
Hide file tree
Showing 66 changed files with 9,986 additions and 9,714 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.3'
services:
orion-visor-service:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.0
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.1
ports:
- 1081:80
environment:
Expand All @@ -19,7 +19,7 @@ services:
- orion-visor-mysql
- orion-visor-redis
orion-visor-mysql:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.0
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.1
privileged: true
ports:
- 3307:3306
Expand All @@ -33,7 +33,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/etc-mysql:/etc/mysql
orion-visor-redis:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.0
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.1
privileged: true
ports:
- 6380:6379
Expand Down
2 changes: 1 addition & 1 deletion docker/orion-visor-mysql/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
version=2.0.0
version=2.0.1
cp -r ../../sql ./sql
docker build -t orion-visor-mysql:${version} .
rm -rf ./sql
Expand Down
2 changes: 1 addition & 1 deletion docker/orion-visor-redis/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
version=2.0.0
version=2.0.1
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}
2 changes: 1 addition & 1 deletion docker/orion-visor-service/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
version=2.0.0
version=2.0.1
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} .
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# orion-visor <small>2.0.0</small>
# orion-visor <small>2.0.1</small>

> 一款开箱即用的运维平台。
Expand Down
8 changes: 8 additions & 0 deletions docs/about/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
* 执行 升级的 `bash` 脚本
* 进入 代码目录执行 `sh docker-upgrade.sh` 进行容器升级 `down` > `pull` > `up -d`

### v2.0.1

`2024-05-21` `release`

* ⭐ 添加 cron 组件
* 🐞 修复 批量执行后日志偶尔不展示的问题
* 🐞 修复 批量上传进度条显示异常的问题

### v2.0.0

`2024-05-17` `release`
Expand Down
2 changes: 0 additions & 2 deletions docs/about/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

* 终端背景图片
* 资产授权 UI 改版
* RDP 远程桌面
* 接入 config 后端动态配置
* 文档中巡检模板
* 导入快捷命令
* 导入命令模板
* 使用 vite press 开发文档

## 已知问题

Expand Down
12 changes: 7 additions & 5 deletions docs/quickstart/dev.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
### 所需环境

* JDK 1.8
* Mysql 8.0(+)
* Redis 5.0.5(+)
* Node 16.16.0(+)
* Maven 3.5.4(+)
* jdk 1.8
* mysql 8.0.+
* redis 6.0.+
* maven 3.5.+
* node 18.12.+
* pnpm 9.1.+

⚡ maven 推荐使用阿里云 mirror
⚡ npm 建议使用淘宝镜像 `npm config set registry https://registry.npmmirror.com/`
⚡ pnpm 建议使用淘宝镜像 `pnpm config set registry https://registry.npmmirror.com/`

### 配置

Expand Down
16 changes: 9 additions & 7 deletions docs/quickstart/install.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
### 所需环境

* JDK 1.8
* Mysql 8.0(+)
* Redis 5.0.5(+)
* Node 16.16.0(+)
* Maven 3.5.4(+)
* Nginx
* jdk 1.8
* mysql 8.0.+
* redis 6.0.+
* maven 3.5.+
* node 18.12.+
* pnpm 9.1.+
* nginx

⚡ maven 推荐使用阿里云 mirror
⚡ 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/`

### 构建

Expand Down
2 changes: 1 addition & 1 deletion orion-visor-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>https://github.com/lijiahangmax/orion-visor</url>

<properties>
<revision>2.0.0</revision>
<revision>2.0.1</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface AppConst extends OrionConst {
/**
* 同 ${orion.version} 迭代时候需要手动更改
*/
String VERSION = "2.0.0";
String VERSION = "2.0.1";

String ORION_VISOR = "orion-visor";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:cancel-button-props="{ disabled: loading }"
:on-before-ok="handlerOk"
@cancel="handleClose">
<a-spin class="full modal-form-small" :loading="loading">
<a-spin class="full drawer-form-small" :loading="loading">
<a-form :model="formModel"
ref="formRef"
label-align="right"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package com.orion.visor.framework.websocket.core.session;

import org.springframework.http.HttpHeaders;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketExtension;
import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.security.Principal;
import java.util.List;
import java.util.Map;

/**
* web socket 同步会话
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/5/20 10:12
*/
public class WebSocketSyncSession implements WebSocketSession {

private final WebSocketSession delegate;

public WebSocketSyncSession(WebSocketSession delegate) {
this.delegate = delegate;
}

@Override
public String getId() {
return this.delegate.getId();
}

@Override
public URI getUri() {
return this.delegate.getUri();
}

@Override
public HttpHeaders getHandshakeHeaders() {
return this.delegate.getHandshakeHeaders();
}

@Override
public Map<String, Object> getAttributes() {
return this.delegate.getAttributes();
}

@Override
public Principal getPrincipal() {
return this.delegate.getPrincipal();
}

@Override
public InetSocketAddress getLocalAddress() {
return this.delegate.getLocalAddress();
}

@Override
public InetSocketAddress getRemoteAddress() {
return this.delegate.getRemoteAddress();
}

@Override
public String getAcceptedProtocol() {
return this.delegate.getAcceptedProtocol();
}

@Override
public void setTextMessageSizeLimit(int messageSizeLimit) {
this.delegate.setTextMessageSizeLimit(messageSizeLimit);
}

@Override
public int getTextMessageSizeLimit() {
return this.delegate.getTextMessageSizeLimit();
}

@Override
public void setBinaryMessageSizeLimit(int messageSizeLimit) {
this.delegate.setBinaryMessageSizeLimit(messageSizeLimit);
}

@Override
public int getBinaryMessageSizeLimit() {
return this.delegate.getBinaryMessageSizeLimit();
}

@Override
public List<WebSocketExtension> getExtensions() {
return this.delegate.getExtensions();
}

@Override
public void sendMessage(WebSocketMessage<?> message) throws IOException {
synchronized (this.delegate) {
this.delegate.sendMessage(message);
}
}

@Override
public boolean isOpen() {
return this.delegate.isOpen();
}

@Override
public void close() throws IOException {
this.delegate.close();
}

@Override
public void close(CloseStatus status) throws IOException {
this.delegate.close(status);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.alibaba.fastjson.JSON;
import com.orion.lang.utils.Exceptions;
import com.orion.lang.utils.Threads;
import com.orion.visor.framework.common.constant.Const;
import com.orion.visor.framework.websocket.core.constant.WsCloseCode;
import com.orion.visor.framework.websocket.core.session.WebSocketSyncSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
Expand All @@ -24,6 +26,16 @@ public class WebSockets {
private WebSockets() {
}

/**
* 创建同步会话
*
* @param session session
* @return session
*/
public static WebSocketSession createSyncSession(WebSocketSession session) {
return new WebSocketSyncSession(session);
}

/**
* 获取属性
*
Expand Down Expand Up @@ -58,13 +70,20 @@ public static void sendText(WebSocketSession session, String message) {
return;
}
try {
// 发重消息
session.sendMessage(new TextMessage(message));
if (session instanceof WebSocketSyncSession) {
// 发送消息
session.sendMessage(new TextMessage(message));
} else {
synchronized (session) {
// 发送消息
session.sendMessage(new TextMessage(message));
}
}
} catch (IllegalStateException e) {
// 并发异常
log.error("发送消息失败, 准备进行重试 {}", Exceptions.getDigest(e));
// 并发重试
retrySendText(session, message, 50);
retrySendText(session, message, Const.MS_100);
} catch (IOException e) {
throw Exceptions.ioRuntime(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public void afterConnectionEstablished(WebSocketSession session) {
String trackerId = this.getTrackerId(id, info, host);
String absolutePath = logsFileClient.getAbsolutePath(host.getPath());
// 追踪器
ExecLogTracker tracker = new ExecLogTracker(trackerId, absolutePath, session, host);
ExecLogTracker tracker = new ExecLogTracker(trackerId,
absolutePath,
WebSockets.createSyncSession(session),
host);
// 执行
AssetThreadPools.EXEC_LOG.execute(tracker);
// 添加追踪器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ public String getPath() {

@Override
public void read(byte[] bytes, int len, Tracker tracker) {
WebSockets.sendText(session, config.getId() + LogConst.SEPARATOR + new String(bytes, 0, len));
// 发送消息
String message = config.getId() + LogConst.SEPARATOR + new String(bytes, 0, len);
try {
WebSockets.sendText(session, message);
} catch (Exception e) {
log.error("ExecLogTracker.send error", e);
}
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion orion-visor-ui/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_API_BASE_URL= 'http://127.0.0.1:9200/orion-visor/api'
VITE_WS_BASE_URL= 'ws://127.0.0.1:9200/orion-visor/keep-alive'
VITE_APP_VERSION= '2.0.0'
VITE_APP_VERSION= '2.0.1'
VITE_SFTP_PREVIEW_MB= 2
2 changes: 1 addition & 1 deletion orion-visor-ui/.env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_API_BASE_URL= '/orion-visor/api'
VITE_WS_BASE_URL= '/orion-visor/keep-alive'
VITE_APP_VERSION= '2.0.0'
VITE_APP_VERSION= '2.0.1'
VITE_SFTP_PREVIEW_MB= 2
2 changes: 1 addition & 1 deletion orion-visor-ui/config/plugin/arcoResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ArcoResolver } from 'unplugin-vue-components/resolvers';
* 按需引入
* https://github.com/antfu/unplugin-vue-components
* https://arco.design/vue/docs/start
* 虽然Pro项目中是全量引入组件但此插件会默认使用
* 虽然Pro项目中是全量引入组件, 但此插件会默认使用
*/
export default function configArcoResolverPlugin() {
const arcoResolverPlugin = Components({
Expand Down
3 changes: 2 additions & 1 deletion orion-visor-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "orion-visor-ui",
"description": "Orion Visor UI",
"version": "2.0.0",
"version": "2.0.1",
"private": true,
"author": "Jiahang Li",
"license": "Apache 2.0",
Expand Down Expand Up @@ -35,6 +35,7 @@
"@sanqi377/arco-vue-icon-picker": "^1.0.7",
"@vueuse/core": "^9.3.0",
"axios": "^0.24.0",
"cron-parser": "^4.9.0",
"dayjs": "^1.11.5",
"echarts": "^5.4.0",
"file-saver": "^2.0.5",
Expand Down
Loading

0 comments on commit 0656c18

Please sign in to comment.