diff --git a/packages/umi-build-dev/src/plugins/commands/block/ui/ui/Adder/ResultPanel.tsx b/packages/umi-build-dev/src/plugins/commands/block/ui/ui/Adder/ResultPanel.tsx index c1ca2b74db1d..487a430242ac 100644 --- a/packages/umi-build-dev/src/plugins/commands/block/ui/ui/Adder/ResultPanel.tsx +++ b/packages/umi-build-dev/src/plugins/commands/block/ui/ui/Adder/ResultPanel.tsx @@ -1,11 +1,22 @@ -import React, { useContext } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { Result, Button } from 'antd'; import Context from '../UIApiContext'; import styles from './ResultPanel.module.less'; export default ({ name, url, onFinish }: { name: string; url: string; onFinish: () => void }) => { const { api } = useContext(Context); + const [alive, setAlive] = useState(false); const isMini = api.isMini(); + useEffect(() => { + (async () => { + const msg = (await api.callRemote({ + type: 'tasks/is_dev_server_alive', + })) as { + alive: boolean; + }; + setAlive(msg.alive); + })(); + }, []); return (
onFinish()}> 完成