实现可执行文件检测和运行功能:支持终端集成和右键菜单操作
主要更新: - 后端添加可执行文件检测逻辑,支持脚本、二进制文件和权限检测 - 文件列表API返回executable字段标识可执行文件 - 右键菜单新增"打开终端"和"运行"功能 - 终端组件支持初始路径和自动执行命令 - 创建TerminalWindow组件提供完整窗口体验 - 运行功能通过终端执行,支持实时输出和交互 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -21,12 +21,21 @@ interface SSHTerminalProps {
|
||||
showTitle?: boolean;
|
||||
splitScreen?: boolean;
|
||||
onClose?: () => void;
|
||||
initialPath?: string;
|
||||
executeCommand?: string;
|
||||
}
|
||||
|
||||
export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
||||
{ hostConfig, isVisible, splitScreen = false, onClose },
|
||||
{ hostConfig, isVisible, splitScreen = false, onClose, initialPath, executeCommand },
|
||||
ref,
|
||||
) {
|
||||
console.log('Terminal component props:', {
|
||||
hasHostConfig: !!hostConfig,
|
||||
isVisible,
|
||||
initialPath,
|
||||
executeCommand,
|
||||
hasExecuteCommand: !!executeCommand
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
const { instance: terminal, ref: xtermRef } = useXTerm();
|
||||
const fitAddonRef = useRef<FitAddon | null>(null);
|
||||
@@ -249,10 +258,13 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
||||
}
|
||||
}, 10000);
|
||||
|
||||
const connectionData = { cols, rows, hostConfig, initialPath, executeCommand };
|
||||
console.log('Sending terminal connection data:', connectionData);
|
||||
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: "connectToHost",
|
||||
data: { cols, rows, hostConfig },
|
||||
data: connectionData,
|
||||
}),
|
||||
);
|
||||
terminal.onData((data) => {
|
||||
|
||||
Reference in New Issue
Block a user