清理调试信息,保持代码整洁
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -108,14 +108,6 @@ wss.on("connection", (ws: WebSocket) => {
|
|||||||
executeCommand?: string;
|
executeCommand?: string;
|
||||||
}) {
|
}) {
|
||||||
const { cols, rows, hostConfig, initialPath, executeCommand } = data;
|
const { cols, rows, hostConfig, initialPath, executeCommand } = data;
|
||||||
|
|
||||||
sshLogger.debug("Terminal connection data received", {
|
|
||||||
operation: "terminal_connect_data",
|
|
||||||
hasInitialPath: !!initialPath,
|
|
||||||
initialPath,
|
|
||||||
hasExecuteCommand: !!executeCommand,
|
|
||||||
executeCommand
|
|
||||||
});
|
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
ip,
|
ip,
|
||||||
|
|||||||
@@ -1145,7 +1145,6 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Opening terminal at path:', path);
|
|
||||||
|
|
||||||
// 创建终端窗口
|
// 创建终端窗口
|
||||||
const windowCount = Date.now() % 10;
|
const windowCount = Date.now() % 10;
|
||||||
@@ -1188,20 +1187,11 @@ function FileManagerContent({ initialHost, onClose }: FileManagerModernProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Running executable file:', file.path);
|
|
||||||
|
|
||||||
// 获取文件所在目录
|
// 获取文件所在目录
|
||||||
const fileDir = file.path.substring(0, file.path.lastIndexOf('/'));
|
const fileDir = file.path.substring(0, file.path.lastIndexOf('/'));
|
||||||
const fileName = file.name;
|
const fileName = file.name;
|
||||||
const executeCmd = `./${fileName}`;
|
const executeCmd = `./${fileName}`;
|
||||||
|
|
||||||
console.log('Execute command details:', {
|
|
||||||
filePath: file.path,
|
|
||||||
fileDir,
|
|
||||||
fileName,
|
|
||||||
executeCommand: executeCmd
|
|
||||||
});
|
|
||||||
|
|
||||||
// 创建执行用的终端窗口
|
// 创建执行用的终端窗口
|
||||||
const windowCount = Date.now() % 10;
|
const windowCount = Date.now() % 10;
|
||||||
const offsetX = 250 + (windowCount * 40);
|
const offsetX = 250 + (windowCount * 40);
|
||||||
|
|||||||
@@ -34,12 +34,6 @@ export function TerminalWindow({
|
|||||||
initialY = 150,
|
initialY = 150,
|
||||||
executeCommand
|
executeCommand
|
||||||
}: TerminalWindowProps) {
|
}: TerminalWindowProps) {
|
||||||
console.log('TerminalWindow props:', {
|
|
||||||
windowId,
|
|
||||||
initialPath,
|
|
||||||
executeCommand,
|
|
||||||
hasExecuteCommand: !!executeCommand
|
|
||||||
});
|
|
||||||
const { closeWindow, minimizeWindow, maximizeWindow, focusWindow, windows } = useWindowManager();
|
const { closeWindow, minimizeWindow, maximizeWindow, focusWindow, windows } = useWindowManager();
|
||||||
|
|
||||||
// 获取当前窗口状态
|
// 获取当前窗口状态
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
|||||||
{ hostConfig, isVisible, splitScreen = false, onClose, initialPath, executeCommand },
|
{ hostConfig, isVisible, splitScreen = false, onClose, initialPath, executeCommand },
|
||||||
ref,
|
ref,
|
||||||
) {
|
) {
|
||||||
console.log('Terminal component props:', {
|
|
||||||
hasHostConfig: !!hostConfig,
|
|
||||||
isVisible,
|
|
||||||
initialPath,
|
|
||||||
executeCommand,
|
|
||||||
hasExecuteCommand: !!executeCommand
|
|
||||||
});
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { instance: terminal, ref: xtermRef } = useXTerm();
|
const { instance: terminal, ref: xtermRef } = useXTerm();
|
||||||
const fitAddonRef = useRef<FitAddon | null>(null);
|
const fitAddonRef = useRef<FitAddon | null>(null);
|
||||||
@@ -258,13 +251,10 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
|||||||
}
|
}
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
const connectionData = { cols, rows, hostConfig, initialPath, executeCommand };
|
|
||||||
console.log('Sending terminal connection data:', connectionData);
|
|
||||||
|
|
||||||
ws.send(
|
ws.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: "connectToHost",
|
type: "connectToHost",
|
||||||
data: connectionData,
|
data: { cols, rows, hostConfig, initialPath, executeCommand },
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
terminal.onData((data) => {
|
terminal.onData((data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user