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