diff --git a/app/renderer/src/main/src/components/layout/PerformanceDisplay.tsx b/app/renderer/src/main/src/components/layout/PerformanceDisplay.tsx index f99aeeb7d1..302978e4b2 100644 --- a/app/renderer/src/main/src/components/layout/PerformanceDisplay.tsx +++ b/app/renderer/src/main/src/components/layout/PerformanceDisplay.tsx @@ -3,7 +3,7 @@ import {failed, info, success, yakitFailed, yakitNotify} from "@/utils/notificat import {showModal} from "@/utils/showModal" import {YaklangEngineMode} from "@/yakitGVDefine" import {LoadingOutlined} from "@ant-design/icons" -import {useInViewport, useMemoizedFn} from "ahooks" +import {useGetState, useInViewport, useMemoizedFn} from "ahooks" import {Popconfirm} from "antd" import {Sparklines, SparklinesCurve} from "react-sparklines" import {YakitButton} from "../yakitUI/YakitButton/YakitButton" @@ -117,7 +117,7 @@ const UIEngineList: React.FC = React.memo((props) => { const [psLoading, setPSLoading] = useState(false) const [process, setProcess] = useState([]) const {runNodeList} = useRunNodeStore() - const [port, setPort] = useState(0) + const [port, setPort, getPort] = useGetState(0) const fetchPSList = useMemoizedFn(() => { if (psLoading) return @@ -208,6 +208,7 @@ const UIEngineList: React.FC = React.memo((props) => { // 删除临时项目 await ipcRenderer.invoke("DeleteProject", {Id: +lastTemporaryProjectIdRef.current, IsDeleteLocal: true}) + yakitNotify("success", "删除临时项目成功") setTemporaryProjectId("") lastTemporaryProjectIdRef.current = "" } @@ -323,11 +324,13 @@ const UIEngineList: React.FC = React.memo((props) => { } onConfirm={async () => { - +i.port === port && await handleTemporaryProject() + console.log('是否执行', isLocal, +i.port, port, getPort()); + isLocal && +i.port === port && await handleTemporaryProject() ipcRenderer .invoke("kill-yak-grpc", i.pid) .then((val) => { if (!val) { + console.log('返回项目启动页', isLocal, +i.port, port, getPort()); isLocal && +i.port === port && typeCallback("break") success("引擎进程关闭中...") }