🐛 修复终端大小适配失效.
This commit is contained in:
@@ -324,11 +324,6 @@ public class TerminalPreferenceModel implements GenericsDataModel {
|
||||
*/
|
||||
private Boolean disconnect;
|
||||
|
||||
/**
|
||||
* 关闭终端
|
||||
*/
|
||||
private Boolean closeTab;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -115,7 +115,6 @@ public class TerminalPreferenceStrategy extends AbstractGenericsDataStrategy<Ter
|
||||
.openSftp(true)
|
||||
.clear(true)
|
||||
.disconnect(false)
|
||||
.closeTab(true)
|
||||
.build()
|
||||
.toJsonString();
|
||||
// 默认配置
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
}
|
||||
// 获取会话
|
||||
const session = sessionManager.getSession<ISftpSession>(sessionId.value);
|
||||
if (session.type === PanelSessionType.SFTP.type) {
|
||||
if (session?.type === PanelSessionType.SFTP.type) {
|
||||
session.chmod(formModel.value.path, formModel.value.mod);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
}
|
||||
// 获取会话
|
||||
const session = sessionManager.getSession<ISftpSession>(sessionId.value);
|
||||
if (session.type === PanelSessionType.SFTP.type) {
|
||||
if (session?.type === PanelSessionType.SFTP.type) {
|
||||
if (touch.value) {
|
||||
// 创建文件
|
||||
session.touch(formModel.value.path);
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
}
|
||||
// 获取会话
|
||||
const session = sessionManager.getSession<ISftpSession>(sessionId.value);
|
||||
if (session.type === PanelSessionType.SFTP.type) {
|
||||
if (session?.type === PanelSessionType.SFTP.type) {
|
||||
session.move(formModel.value.path, formModel.value.target);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -201,10 +201,10 @@ export default class TerminalOutputProcessor implements ITerminalOutputProcessor
|
||||
private processWithType(session: ITerminalSession,
|
||||
sshProcess: (ssh: ISshSession) => any | void,
|
||||
sftpProcess: (ssh: ISftpSession) => any | void) {
|
||||
if (session.type === PanelSessionType.SSH.type) {
|
||||
if (session?.type === PanelSessionType.SSH.type) {
|
||||
// SSH 操作
|
||||
return sshProcess(session as ISshSession);
|
||||
} else if (session.type === PanelSessionType.SFTP.type) {
|
||||
} else if (session?.type === PanelSessionType.SFTP.type) {
|
||||
// SFTP 操作
|
||||
return sftpProcess(session as ISftpSession);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ export default class TerminalSessionManager implements ITerminalSessionManager {
|
||||
private dispatchResize() {
|
||||
// 对所有已连接的会话重置大小
|
||||
Object.values(this.sessions)
|
||||
.filter(s => s.type === PanelSessionType.SSH.type)
|
||||
.filter(s => s?.type === PanelSessionType.SSH.type)
|
||||
.map(s => s as SshSession)
|
||||
.filter(h => h.connected)
|
||||
.forEach(h => h.fit());
|
||||
|
||||
@@ -177,10 +177,6 @@ export const ActionBarItems = [
|
||||
item: 'disconnect',
|
||||
icon: 'icon-poweroff',
|
||||
content: '断开连接',
|
||||
}, {
|
||||
item: 'closeTab',
|
||||
icon: 'icon-close',
|
||||
content: '关闭终端',
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user