diff --git a/app/main/handlers/yakRunnerTerminal.js b/app/main/handlers/yakRunnerTerminal.js index adc7a8b19f..d06b8a7042 100644 --- a/app/main/handlers/yakRunnerTerminal.js +++ b/app/main/handlers/yakRunnerTerminal.js @@ -24,6 +24,14 @@ module.exports = (win, getClient) => { }) } }) + ipcMain.handle("runner-terminal-size", async (e, path, size) => { + const stream = getStreamByPort(path) + if (stream) { + stream.write({ + ...size + }) + } + }) ipcMain.handle("runner-terminal-cancel", async (e, path) => { removeStreamPort(path) }) diff --git a/app/protos/grpc.proto b/app/protos/grpc.proto index 55b7627416..98afb2cce8 100644 --- a/app/protos/grpc.proto +++ b/app/protos/grpc.proto @@ -5011,6 +5011,8 @@ message Input { string host = 2; uint32 port = 3; string path = 4; + uint32 width = 5; + uint32 height = 6; } message Output { diff --git a/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx b/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx index 765df29e79..1363d6387e 100644 --- a/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx @@ -8,7 +8,7 @@ const {ipcRenderer} = window.require("electron") export const AuditCode: React.FC = (props) => { useEffect(() => { - console.log("我是audit-code") + // console.log("我是audit-code") }, []) return
我是audit-code
} diff --git a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.module.scss b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.module.scss index 39e296463c..f35fe61259 100644 --- a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.module.scss +++ b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.module.scss @@ -55,6 +55,7 @@ .extra { margin-right: 8px; display: flex; + align-items: center; gap: 8px; } } @@ -83,3 +84,40 @@ } } } + + +.codec-menu-popover { + .codec-menu-cont-wrapper { + .codec-menu-item { + display: flex; + justify-content: space-between; + padding: 6px 8px; + cursor: pointer; + color: #000000; + font-size: 14px; + line-height: 20px; + width: 130px; + &.active { + color: var(--yakit-primary-5); + } + &:hover { + background-color: var(--yakit-primary-1); + } + .check-icon { + svg { + color: var(--yakit-primary-5); + } + } + } + } + :global { + .ant-popover-inner { + border: 1px solid var(--yakit-border-color); + box-shadow: 0px 8px 16px rgba(133, 137, 158, 0.1); + border-radius: 4px; + .ant-popover-inner-content { + padding: 6px 4px 4px 4px; + } + } + } +} \ No newline at end of file diff --git a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.tsx b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.tsx index cf8d6c597d..0ab6a4c723 100644 --- a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/BottomEditorDetails.tsx @@ -24,12 +24,15 @@ import {XTerm} from "xterm-for-react" import {YakitSystem} from "@/yakitGVDefine" import {TerminalBox} from "./TerminalBox/TerminalBox" import {System, SystemInfo, handleFetchSystem} from "@/constants/hardware" +import {YakitPopover} from "@/components/yakitUI/YakitPopover/YakitPopover" +import {SolidCheckIcon} from "@/assets/icon/solid" +import {ChevronDownIcon, ChevronUpIcon} from "@/assets/newIcon" const {ipcRenderer} = window.require("electron") // 编辑器区域 展示详情(输出/语法检查/终端/帮助信息) export const BottomEditorDetails: React.FC = (props) => { - const {isShowEditorDetails,setEditorDetails, showItem, setShowItem} = props + const {isShowEditorDetails, setEditorDetails, showItem, setShowItem} = props const systemRef = useRef(SystemInfo.system) useEffect(() => { @@ -38,16 +41,20 @@ export const BottomEditorDetails: React.FC = (props) = } }, []) - const {activeFile,fileTree} = useStore() + const {activeFile, fileTree} = useStore() // 不再重新加载的元素 const [showType, setShowType] = useState([]) + // 终端编码 + const [codeKey, setCodeKey] = useState("") + const [codeShow, setCodeShow] = useState(false) + // 数组去重 const filterItem = (arr) => arr.filter((item, index) => arr.indexOf(item) === index) useEffect(() => { if (showItem && isShowEditorDetails) { - if(showType.includes(showItem)) return + if (showType.includes(showItem)) return setShowType((arr) => filterItem([...arr, showItem])) } }, [showItem, isShowEditorDetails]) @@ -74,7 +81,7 @@ export const BottomEditorDetails: React.FC = (props) = try { const {type}: {type: ShowItemType} = JSON.parse(v) // 执行时需要清空输出 - if(type === "output"){ + if (type === "output") { xtermClear(xtermRef) } setEditorDetails(true) @@ -110,15 +117,31 @@ export const BottomEditorDetails: React.FC = (props) = } }, [xtermRef]) - // 终端path为文件树根路径 - const folderPath = useMemo(() => { + // 终端路径 + const [folderPath, setFolderPath] = useState("") + + useEffect(() => { if (fileTree.length > 0) { - return fileTree[0].path + setFolderPath(fileTree[0].path) } else { - return "" + setFolderPath("") } }, [fileTree]) + const onOpenTernimalFun = useMemoizedFn((path) => { + setEditorDetails(true) + setShowItem("terminal") + setFolderPath(path) + }) + + // 监听终端更改 + useEffect(() => { + emiter.on("onOpenTernimal", onOpenTernimalFun) + return () => { + emiter.off("onOpenTernimal", onOpenTernimalFun) + } + }, []) + return (
@@ -162,12 +185,62 @@ export const BottomEditorDetails: React.FC = (props) =
+ {showItem === "terminal" && ( + + {[ + {label: "gb18030", codeKey: "gb18030"}, + {label: "windows-1252", codeKey: "windows-1252"}, + {label: "iso-8859-1", codeKey: "iso-8859-1"}, + {label: "big5", codeKey: "big5"}, + {label: "utf-16", codeKey: "utf-16"} + ].map((item) => ( +
{ + // handleClickCoding(item.codeKey) + if (codeKey === item.codeKey) { + setCodeKey("") + } else { + setCodeKey(item.codeKey) + } + }} + > + {item.label} + {codeKey === item.codeKey && ( + + )} +
+ ))} +
+ } + visible={codeShow} + onVisibleChange={(visible) => setCodeShow(visible)} + > + e.preventDefault()} + > + 编码 + {codeShow ? : } + + + )} {showItem === "terminal" && ( } onClick={() => { - ipcRenderer.invoke("runner-terminal-cancel",folderPath).finally(() => { + ipcRenderer.invoke("runner-terminal-cancel", folderPath).finally(() => { setEditorDetails(false) // 重新渲染 setShowType(showType.filter((item) => item !== "terminal")) @@ -217,7 +290,11 @@ export const BottomEditorDetails: React.FC = (props) = {/* {systemRef.current === "Windows_NT" ? (
终端监修中
) : ( */} - + {/* )} */} )} diff --git a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/SyntaxCheckList/SyntaxCheckList.module.scss b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/SyntaxCheckList/SyntaxCheckList.module.scss index 195a139f8e..cae20ea36f 100644 --- a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/SyntaxCheckList/SyntaxCheckList.module.scss +++ b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/SyntaxCheckList/SyntaxCheckList.module.scss @@ -1,6 +1,6 @@ .syntax-check-list { height: 100%; - overflow: hidden; + overflow: auto; .syntax-check-item { display: flex; flex-direction: row; diff --git a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/TerminalBox/TerminalBox.tsx b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/TerminalBox/TerminalBox.tsx index 82efc14dbf..cad158ce63 100644 --- a/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/TerminalBox/TerminalBox.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/BottomEditorDetails/TerminalBox/TerminalBox.tsx @@ -12,16 +12,18 @@ import {writeXTerm, xtermClear, xtermFit} from "@/utils/xtermUtils" import {TERMINAL_INPUT_KEY, YakitCVXterm} from "@/components/yakitUI/YakitCVXterm/YakitCVXterm" import useStore from "../../hooks/useStore" import {YakitHint} from "@/components/yakitUI/YakitHint/YakitHint" -import { StringToUint8Array, Uint8ArrayToString } from "@/utils/str" +import {StringToUint8Array, Uint8ArrayToString} from "@/utils/str" +import {number} from "echarts" const {ipcRenderer} = window.require("electron") export interface TerminalBoxProps { isShowEditorDetails: boolean folderPath: string + codeKey: string } export const TerminalBox: React.FC = (props) => { - const {isShowEditorDetails,folderPath} = props + const {isShowEditorDetails, folderPath, codeKey} = props const xtermRef = useRef(null) // 是否允许输入及不允许输入的原因 const [allowInput, setAllowInput] = useState(true) @@ -34,6 +36,56 @@ export const TerminalBox: React.FC = (props) => { ipcRenderer.invoke("runner-terminal-input", folderPath, cmd) }) + // 行列变化 + const onChangeSize = useMemoizedFn((height, width) => { + if (height && width && folderPath) { + ipcRenderer.invoke("runner-terminal-size", folderPath, { + height, + width + }) + } + }) + + const fetchNewCodec = useMemoizedFn((data: Uint8Array, codeKey: string) => { + const newCodecParams = { + InputBytes: data, + WorkFlow: [ + { + CodecType: "CharsetToUTF8", + Params: [ + { + Key: "charset", + Value: codeKey + } + ] + } + ] + } + ipcRenderer + .invoke("NewCodec", newCodecParams) + .then((data: {Result: string; RawResult: Uint8Array}) => { + let outPut = Uint8ArrayToString(data.RawResult) + writeXTerm(xtermRef, outPut) + // onSetCodeValue(data.RawResult) + }) + .catch((e) => { + let outPut = Uint8ArrayToString(data) + writeXTerm(xtermRef, outPut) + failed(e) + }) + .finally(() => {}) + }) + + // 输出 + const onWriteXTerm = useMemoizedFn((data: Uint8Array) => { + let outPut = Uint8ArrayToString(data) + if (codeKey) { + fetchNewCodec(data, codeKey) + } else { + writeXTerm(xtermRef, outPut) + } + }) + // 终端启用路径 const startTerminalPath = useRef() @@ -41,8 +93,8 @@ export const TerminalBox: React.FC = (props) => { if (!xtermRef) { return } - if(startTerminalPath.current){ - ipcRenderer.invoke("runner-terminal-cancel",startTerminalPath.current) + if (startTerminalPath.current) { + ipcRenderer.invoke("runner-terminal-cancel", startTerminalPath.current) startTerminalPath.current = undefined } setAllowInput(true) @@ -53,7 +105,7 @@ export const TerminalBox: React.FC = (props) => { }) .then(() => { startTerminalPath.current = folderPath - isShowEditorDetails&&success(`终端${folderPath}监听成功`) + isShowEditorDetails && success(`终端${folderPath}监听成功`) }) .catch((e: any) => { failed(`ERROR: ${JSON.stringify(e)}`) @@ -68,10 +120,7 @@ export const TerminalBox: React.FC = (props) => { } if (data?.raw && xtermRef?.current && xtermRef.current?.terminal) { - // let str = String.fromCharCode.apply(null, data.raw); - let str = Uint8ArrayToString(data.raw) - - writeXTerm(xtermRef, str) + onWriteXTerm(data.raw) } }) @@ -83,10 +132,10 @@ export const TerminalBox: React.FC = (props) => { // grpc通知关闭 const errorKey = "client-listening-terminal-end" ipcRenderer.on(errorKey, (e: any, data: any) => { - if(startTerminalPath.current === data){ + if (startTerminalPath.current === data) { setAllowInput(false) } - isShowEditorDetails&&warn(`终端${data}被关闭`) + isShowEditorDetails && warn(`终端${data}被关闭`) }) return () => { // 移除 @@ -108,6 +157,7 @@ export const TerminalBox: React.FC = (props) => { if (!width || !height) return const row = Math.floor(height / 18.5) const col = Math.floor(width / 10) + onChangeSize(row, col) if (xtermRef) xtermFit(xtermRef, col, row) }} handleWidth={true} diff --git a/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.module.scss b/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.module.scss index 905024656f..b55e73a823 100644 --- a/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.module.scss +++ b/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.module.scss @@ -9,6 +9,15 @@ overflow: hidden auto; } +.to-end { + text-align: center; + color: var(--yakit-disable-text-color); + font-size: 11px; + line-height: 14px; + padding-top: 24px; + padding-bottom: 24px; +} + .collapse-list-base { :global { .ant-collapse-item > .ant-collapse-header { diff --git a/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.tsx b/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.tsx index 6b3eec7c1b..64ee4119df 100644 --- a/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseList.tsx @@ -23,7 +23,7 @@ const {ipcRenderer} = window.require("electron") const {Panel} = Collapse export const CollapseList: (props: CollapseListProp) => ReactElement | null = memo((props) => { - const {type = "sideBar", onlyKey, list, titleRender, renderItem,collapseProps} = props + const {type = "sideBar", onlyKey, list, titleRender, renderItem, collapseProps, isShowBottom} = props const wrapperClassName = useMemo(() => { if (type === "sideBar") return styles["collapse-list-side-bar"] @@ -60,6 +60,7 @@ export const CollapseList: (props: CollapseListProp) => ReactElement | nul ) })} + {isShowBottom &&
已经到底啦~
} ) @@ -77,8 +78,6 @@ export const HelpInfoList: React.FC = memo((props) => { // 选中光标位置 const onJumpEditorDetailFun = useMemoizedFn((range) => { - console.log("range", range) - try { if (helpEditor && helpMonaco) { helpEditor.setSelection(range) @@ -236,7 +235,6 @@ export const HelpInfoList: React.FC = memo((props) => { ) } }) - console.log("Definition-xxx", newDefinitionList) setDefinitionList(newDefinitionList) }) } diff --git a/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseListType.ts b/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseListType.ts index f1969fa13a..5ff48cfd1f 100644 --- a/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseListType.ts +++ b/app/renderer/src/main/src/pages/YakRunner/CollapseList/CollapseListType.ts @@ -14,6 +14,7 @@ export interface CollapseListProp { titleRender: (info: T) => ReactNode renderItem: (info: T) => ReactNode collapseProps?: CollapseProps + isShowBottom?: boolean } export interface HelpInfoListProps {} diff --git a/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.module.scss b/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.module.scss index 348e3b8465..84071224c7 100644 --- a/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.module.scss +++ b/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.module.scss @@ -49,6 +49,15 @@ } } +.tree-bottom{ + position: relative; + height: 22px; + text-align: center; + color: var(--yakit-disable-text-color); + font-size: 11px; + line-height: 22px; +} + /* ---------- FileTreeNode ----------*/ .file-tree-node { padding: 3px 12px 3px 8px; diff --git a/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.tsx b/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.tsx index 445aaf72fe..a1e73d68ef 100644 --- a/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/FileTree/FileTree.tsx @@ -148,8 +148,6 @@ export const FileTree: React.FC = memo((props) => { // 打开扩展项 scrollExpandedKeysFun(path) setExpandedKeys(filter([...expandedKeys, ...scrollExpandedKeys.current])) - console.log("niuniu---", filter([...expandedKeys, ...scrollExpandedKeys.current])) - setFoucsedKey(path) // 调用 scrollTo 方法滚动到指定节点 setTimeout(() => { @@ -323,12 +321,16 @@ const FileTreeNode: React.FC = (props) => { if (info.isLeaf) { handleSelect() } else { - console.log("isDownCtrlCmd", isDownCtrlCmd) if (isDownCtrlCmd) handleSelect() else handleExpand() } }) + // 在终端中打开 + const openTernimalFun = useMemoizedFn((path)=>{ + emiter.emit("onOpenTernimal",path) + }) + // 复制 const onCopy = useMemoizedFn(() => { setCopyPath(info.path) @@ -387,8 +389,6 @@ const FileTreeNode: React.FC = (props) => { if (value.length !== 0 && value !== info.name) { // 重命名 调用接口成功后更新tree const result = await grpcFetchRenameFileTree(info.path, value, info.parent) - console.log("更新", result) - if (result.length === 0) return const {path, name, icon} = result[0] // 文件夹重命名 @@ -640,7 +640,6 @@ const FileTreeNode: React.FC = (props) => { type: "grey", data: [...menuData], onClick: ({key, keyPath}) => { - console.log("handleContextMenu", key, keyPath) switch (key) { case "closeFolder": closeFolder() @@ -652,9 +651,11 @@ const FileTreeNode: React.FC = (props) => { onNewFolder(info.path) break case "openFileSystem": - console.log("文件夹中显示", info.path) openABSFileLocated(info.path) break + case "openTernimal": + openTernimalFun(info.path) + break case "copy": onCopy() break @@ -679,6 +680,9 @@ const FileTreeNode: React.FC = (props) => { }, [info.isFolder]) const iconImage = useMemo(() => { + if (info.isBottom) { + return "" + } if (isFolder) { if (isExpanded) { return KeyToIcon[FolderDefaultExpanded].iconPath @@ -688,56 +692,60 @@ const FileTreeNode: React.FC = (props) => { } else { return KeyToIcon[info.icon].iconPath } - }, [info.icon, isFolder, isExpanded]) + }, [info.icon, isFolder, isExpanded, info.isBottom]) return ( <> -
- {!info.isLeaf && ( -
- + {info.isBottom ? ( +
{info.name}
+ ) : ( +
+ {!info.isLeaf && ( +
+ +
+ )} + +
+
- )} - -
- -
-
-
- -
-
- {isEdit ? ( - { - setValue(e.target.value) - }} - autoFocus - onBlur={onSave} - onPressEnter={onSave} - size='small' - /> - ) : ( - info.name - )} +
+
+ +
+
+ {isEdit ? ( + { + setValue(e.target.value) + }} + autoFocus + onBlur={onSave} + onPressEnter={onSave} + size='small' + /> + ) : ( + info.name + )} +
-
+ )} = (props) => { [styles["left-side-bar-item-advanced-config-unShow"]]: active === "file-tree" && isUnShow })} onClick={() => { + if (active !== "file-tree") { + setUnShow(false) + } if (active === "file-tree") { setUnShow(!isUnShow) } @@ -63,7 +66,7 @@ export const LeftSideBar: React.FC = (props) => { [styles["left-side-bar-item-advanced-config-unShow"]]: active === "help-doc" && isUnShow })} onClick={() => { - if(active === "file-tree"){ + if (active !== "help-doc") { setUnShow(false) } if (active === "help-doc") { @@ -79,19 +82,19 @@ export const LeftSideBar: React.FC = (props) => { {/* 侧边栏对应展示内容 */}
- {rendered.current.has("file-tree") && !isUnShow && ( + {rendered.current.has("file-tree") && (
)} - {rendered.current.has("help-doc") && !isUnShow && ( + {rendered.current.has("help-doc") && (
diff --git a/app/renderer/src/main/src/pages/YakRunner/RunnerFileTree/RunnerFileTree.tsx b/app/renderer/src/main/src/pages/YakRunner/RunnerFileTree/RunnerFileTree.tsx index 1703158fb9..910f183947 100644 --- a/app/renderer/src/main/src/pages/YakRunner/RunnerFileTree/RunnerFileTree.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/RunnerFileTree/RunnerFileTree.tsx @@ -71,7 +71,6 @@ export const RunnerFileTree: React.FC = (props) => { const [isShowFileHint,setShowFileHint] = useState(false) const [historyList, setHistoryList] = useState([]) - // 选中的文件或文件夹 const [foucsedKey, setFoucsedKey] = React.useState("") // 将文件详情注入文件树结构中 并 根据foldersMap修正其子项 @@ -91,7 +90,6 @@ export const RunnerFileTree: React.FC = (props) => { const [refreshTree, setRefreshTree] = useState(false) const onRefreshFileTreeFun = useMemoizedFn(() => { - console.log("刷新文件树", fileTree) setRefreshTree(!refreshTree) }) @@ -104,7 +102,19 @@ export const RunnerFileTree: React.FC = (props) => { }, []) const fileDetailTree = useMemo(() => { - return initFileTree(fileTree, 1) + const initTree = initFileTree(fileTree, 1) + if(initTree.length>0){ + initTree.push({ + parent:null, + name:"已经到底啦~", + path:"", + isFolder:false, + icon:"", + depth:1, + isBottom:true + }) + } + return initTree }, [fileTree, refreshTree]) const getHistoryList = useMemoizedFn(async (data?: string) => { @@ -129,8 +139,6 @@ export const RunnerFileTree: React.FC = (props) => { }, []) const onLoadData = useMemoizedFn((node: FileNodeProps) => { - console.log("onLoadData", node) - // 删除最外层文件夹时无需加载 if (node.parent === null) return Promise.reject() if (handleFileLoadData) return handleFileLoadData(node.path) @@ -276,13 +284,10 @@ export const RunnerFileTree: React.FC = (props) => { setActiveFile && setActiveFile(undefined) } const newAreaInfo = removeAreaFilesInfo(areaInfo, removePath) - console.log("移除的newAreaInfo", newAreaInfo) setAreaInfo && setAreaInfo(newAreaInfo) } // 文件删除 else { - console.log("info---", info) - if (info.parent) { const newFolderDetail = getMapFolderDetail(info.parent).filter((item) => item !== info.path) // 如果删除文件后变为空文件夹 则需更改其父文件夹isLeaf为true(不可展开) diff --git a/app/renderer/src/main/src/pages/YakRunner/YakHelpDoc/YakHelpDoc.tsx b/app/renderer/src/main/src/pages/YakRunner/YakHelpDoc/YakHelpDoc.tsx index 7ec4d7af2b..71c57615db 100644 --- a/app/renderer/src/main/src/pages/YakRunner/YakHelpDoc/YakHelpDoc.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/YakHelpDoc/YakHelpDoc.tsx @@ -100,7 +100,6 @@ export const YakHelpDoc: React.FC = (props) => { const update = useMemoizedFn(() => { loadFromYakURLRaw(`yakdocument://${searchRef.current}`, (rsp) => { - console.log("rsp", rsp) setData( rsp.Resources.map((i, index) => ({ title: i.VerboseName, @@ -152,6 +151,7 @@ export const YakHelpDoc: React.FC = (props) => { list={data} titleRender={titleRender} renderItem={renderItem} + isShowBottom={true} />
diff --git a/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx b/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx index 36f2e03874..1038573548 100644 --- a/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx @@ -360,7 +360,6 @@ export const YakRunner: React.FC = (props) => { // 校验其子项是否存在 const childArr = getMapFolderDetail(path) if (childArr.length > 0) { - console.log("缓存加载") emiter.emit("onRefreshFileTree") resolve("") } else { @@ -375,7 +374,6 @@ export const YakRunner: React.FC = (props) => { }) setMapFolderDetail(path, childArr) setTimeout(() => { - console.log("接口加载") emiter.emit("onRefreshFileTree") resolve("") }, 300) @@ -436,7 +434,6 @@ export const YakRunner: React.FC = (props) => { const addFileTab = useThrottleFn( () => { // 新建临时文件 - console.log("ctrl_n") const scratchFile: FileDetailInfo = { name: `Untitle-${unTitleCountRef.current}.yak`, code: "# input your yak code\nprintln(`Hello Yak World!`)", @@ -518,7 +515,6 @@ export const YakRunner: React.FC = (props) => { // 关闭文件 const ctrl_w = useMemoizedFn(() => { - console.log("ctrl_w") if (activeFile) { emiter.emit("onCloseFile", activeFile.path) } @@ -692,7 +688,6 @@ export const YakRunner: React.FC = (props) => { newAreaInfo[indexArr[0]].elements[indexArr[1]].files.splice(destination.index, 0, element) } } - console.log("onDragEnd-0_0", newAreaInfo) setAreaInfo(newAreaInfo) } catch (error) {} }) diff --git a/app/renderer/src/main/src/pages/YakRunner/utils.ts b/app/renderer/src/main/src/pages/YakRunner/utils.ts index eab51ede44..6b2b7e17b8 100644 --- a/app/renderer/src/main/src/pages/YakRunner/utils.ts +++ b/app/renderer/src/main/src/pages/YakRunner/utils.ts @@ -91,7 +91,7 @@ export const grpcFetchRenameFileTree: ( } try { const list: RequestYakURLResponse = await ipcRenderer.invoke("RequestYakURL", params) - console.log("文件树重命名", params, list) + // console.log("文件树重命名", params, list) const data: FileNodeMapProps[] = initFileTreeData(list, parentPath) resolve(data) } catch (error) { @@ -117,7 +117,7 @@ export const grpcFetchSaveFile: (path: string, code: string) => Promise Promise } try { const list: RequestYakURLResponse = await ipcRenderer.invoke("RequestYakURL", params) - console.log("删除文件", params, list) + // console.log("删除文件", params, list) const data: FileNodeMapProps[] = initFileTreeData(list, path) resolve(data) } catch (error) { diff --git a/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts b/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts index 5a167c74e8..59ac37dfe0 100644 --- a/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts +++ b/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts @@ -19,4 +19,6 @@ export type YakRunnerEventProps = { onCloseFile: string // 定位文件树 onScrollToFileTree: string + // 终端中打开 + onOpenTernimal: string } \ No newline at end of file diff --git a/app/renderer/src/main/src/utils/xtermUtils.ts b/app/renderer/src/main/src/utils/xtermUtils.ts index ec0b07a417..773eff338f 100644 --- a/app/renderer/src/main/src/utils/xtermUtils.ts +++ b/app/renderer/src/main/src/utils/xtermUtils.ts @@ -14,6 +14,8 @@ export const writeExecResultXTerm = (xterm: any, result: ExecResult, encoding?: export const xtermFit = (xtermRef: any, columns?: number, rows?: number) => { if (xtermRef && xtermRef?.current && xtermRef.current.terminal) { + console.log("xtermRef",rows,columns); + xtermRef.current.terminal.resize(columns || 100, rows || 10); } };