🐛 修复会话打开黑屏.
This commit is contained in:
@@ -13,7 +13,7 @@ spring:
|
|||||||
host: ${REDIS_HOST:127.0.0.1}
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PASSWORD:Data@123456}
|
password: ${REDIS_PASSWORD:Data@123456}
|
||||||
database: ${REDIS_DATABASE:10}
|
database: ${REDIS_DATABASE:1}
|
||||||
data-version: ${REDIS_DATA_VERSION:1}
|
data-version: ${REDIS_DATA_VERSION:1}
|
||||||
mock: false
|
mock: false
|
||||||
redisson:
|
redisson:
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public class HostVncConfigStrategy extends AbstractHostConfigStrategy<HostVncCon
|
|||||||
.authType(HostAuthTypeEnum.PASSWORD.name())
|
.authType(HostAuthTypeEnum.PASSWORD.name())
|
||||||
.noUsername(false)
|
.noUsername(false)
|
||||||
.noPassword(false)
|
.noPassword(false)
|
||||||
|
.timezone("Asia/Shanghai")
|
||||||
.clipboardEncoding(Const.UTF_8)
|
.clipboardEncoding(Const.UTF_8)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
@@ -94,7 +95,11 @@ public class HostVncConfigStrategy extends AbstractHostConfigStrategy<HostVncCon
|
|||||||
afterModel.setAuthType(HostAuthTypeEnum.PASSWORD.name());
|
afterModel.setAuthType(HostAuthTypeEnum.PASSWORD.name());
|
||||||
}
|
}
|
||||||
// 加密密码
|
// 加密密码
|
||||||
this.checkEncryptPassword(afterModel.getAuthType(), beforeModel, afterModel);
|
if (Booleans.isTrue(afterModel.getNoPassword())) {
|
||||||
|
afterModel.setPassword(beforeModel.getPassword());
|
||||||
|
} else {
|
||||||
|
this.checkEncryptPassword(afterModel.getAuthType(), beforeModel, afterModel);
|
||||||
|
}
|
||||||
afterModel.setHasPassword(null);
|
afterModel.setHasPassword(null);
|
||||||
afterModel.setUseNewPassword(null);
|
afterModel.setUseNewPassword(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -277,6 +277,9 @@ public class TerminalConnectHandler extends AbstractTerminalHandler<ITerminalSen
|
|||||||
} else if (TerminalConnectTypeEnum.RDP.name().equals(connectType)) {
|
} else if (TerminalConnectTypeEnum.RDP.name().equals(connectType)) {
|
||||||
// RDP
|
// RDP
|
||||||
connectConfig = hostConnectApi.getRdpConnectConfig(host, userId);
|
connectConfig = hostConnectApi.getRdpConnectConfig(host, userId);
|
||||||
|
} else if (TerminalConnectTypeEnum.VNC.name().equals(connectType)) {
|
||||||
|
// VNC
|
||||||
|
connectConfig = hostConnectApi.getVncConnectConfig(host, userId);
|
||||||
} else {
|
} else {
|
||||||
throw Exceptions.unsupported();
|
throw Exceptions.unsupported();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ body[terminal-theme='dark'] .arco-modal-container {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
:deep(> div) {
|
& > div {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 8;
|
z-index: 8;
|
||||||
}
|
}
|
||||||
@@ -647,7 +647,7 @@ body[terminal-theme='dark'] .arco-modal-container {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
z-index: 9999;
|
z-index: 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
// guacd 工具栏
|
// guacd 工具栏
|
||||||
|
|||||||
@@ -96,12 +96,10 @@ export function formatSecond(second: number, p = 'HH:mm') {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化持续时间
|
* 格式化持续时间
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
*/
|
*/
|
||||||
export function formatDuration(start: number, end?: number): string {
|
export function formatDuration(start: number, end?: number, none: string = ''): string {
|
||||||
if (!end) {
|
if (!end) {
|
||||||
return '';
|
return none;
|
||||||
}
|
}
|
||||||
const duration = (end - start) / 1000;
|
const duration = (end - start) / 1000;
|
||||||
if (duration < 1) {
|
if (duration < 1) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { TableColumnData } from '@arco-design/web-vue';
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
|
import { formatDuration } from '@/utils';
|
||||||
|
|
||||||
export const logColumns = [
|
export const logColumns = [
|
||||||
{
|
{
|
||||||
@@ -46,6 +47,16 @@ export const logColumns = [
|
|||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
default: true,
|
default: true,
|
||||||
|
}, {
|
||||||
|
title: '持续时间',
|
||||||
|
dataIndex: 'duration',
|
||||||
|
slotName: 'duration',
|
||||||
|
align: 'left',
|
||||||
|
width: 142,
|
||||||
|
render: ({ record }) => {
|
||||||
|
return formatDuration(record.startTime, record.endTime, '-');
|
||||||
|
},
|
||||||
|
default: true,
|
||||||
}, {
|
}, {
|
||||||
title: '连接时间',
|
title: '连接时间',
|
||||||
dataIndex: 'connectTime',
|
dataIndex: 'connectTime',
|
||||||
|
|||||||
@@ -11,10 +11,18 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary"
|
<a-button type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
title="仅将文本发送到远程剪切板"
|
||||||
:disabled="!clipboardData"
|
:disabled="!clipboardData"
|
||||||
@click="sendClipboardData">
|
@click="sendClipboardData(false)">
|
||||||
发送
|
发送
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button type="primary"
|
||||||
|
size="small"
|
||||||
|
title="将文本发送到远程剪切板并执行粘贴操作"
|
||||||
|
:disabled="!clipboardData"
|
||||||
|
@click="sendClipboardData(true)">
|
||||||
|
粘贴
|
||||||
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -38,8 +46,8 @@
|
|||||||
const clipboardData = ref('');
|
const clipboardData = ref('');
|
||||||
|
|
||||||
// 发送剪切板数据
|
// 发送剪切板数据
|
||||||
const sendClipboardData = () => {
|
const sendClipboardData = (sendPaste: boolean) => {
|
||||||
props.session.paste(clipboardData.value);
|
props.session.paste(clipboardData.value, sendPaste);
|
||||||
emits('close');
|
emits('close');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ export interface IGuacdSession extends ITerminalSession<GuacdReactiveSessionStat
|
|||||||
// 发送键
|
// 发送键
|
||||||
sendKeys: (keys: Array<number>) => void;
|
sendKeys: (keys: Array<number>) => void;
|
||||||
// 粘贴
|
// 粘贴
|
||||||
paste: (data: string) => void;
|
paste: (data: string, sendPaste: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RDP 会话定义
|
// RDP 会话定义
|
||||||
|
|||||||
@@ -141,16 +141,18 @@ export default abstract class BaseGuacdSession extends BaseSession<GuacdReactive
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 粘贴
|
// 粘贴
|
||||||
paste(data: string): void {
|
paste(data: string, sendPaste: boolean): void {
|
||||||
if (!this.isWriteable()) {
|
if (!this.isWriteable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 发送至远程剪切板
|
// 发送至远程剪切板
|
||||||
this.clipboardHandler?.sendDataToRemoteClipboard(data);
|
this.clipboardHandler?.sendDataToRemoteClipboard(data);
|
||||||
// 发送粘贴命令
|
// 发送粘贴命令
|
||||||
setTimeout(() => {
|
if (sendPaste) {
|
||||||
this.sendKeys([65507, 118]);
|
setTimeout(() => {
|
||||||
}, 100);
|
this.sendKeys([65507, 118]);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 聚焦
|
// 聚焦
|
||||||
|
|||||||
Reference in New Issue
Block a user