diff --git a/src/web/project/component/file/component/LogViewer.tsx b/src/web/project/component/file/component/LogViewer.tsx index 5a7d035..8fcd2f0 100644 --- a/src/web/project/component/file/component/LogViewer.tsx +++ b/src/web/project/component/file/component/LogViewer.tsx @@ -55,7 +55,6 @@ import {deleteList} from "../../../../../common/ListUtil"; const history_max_line = 300; // 最多创建多少个dom对象 -let open_watch_timer; let open_watch = false; let last_position = 0; @@ -170,11 +169,6 @@ export default function LogViewer(props) { if(open_watch)return; open_watch = true; set_progress(100); - if (open_watch_timer) { - clearTimeout(open_watch_timer); - open_watch_timer = null; - return; - } ws.addMsg(CmdType.log_viewer_watch,(wsData: WsData)=>{ const pojo = wsData.context as LogViewerPojo; if(!pojo) { @@ -195,11 +189,8 @@ export default function LogViewer(props) { const cancel_watch = ()=>{ if (!open_watch)return; open_watch = false; - open_watch_timer = setTimeout(()=>{ - ws.unConnect(); - set_tip(false) - open_watch_timer = null; - },5000) + ws.unConnect(); + set_tip(false) // console.log('取消实时监听') } @@ -223,7 +214,7 @@ export default function LogViewer(props) { if (position >= req.max_size) { // if (!top_alert) { // top_alert = true; - watch(position); + watch(position); // NotyInfo('到达底部开始实时监听'); // } // console.log(position,req.max_size) @@ -288,7 +279,6 @@ export default function LogViewer(props) { // set_go_progress(0) set_tip(false); - open_watch_timer = null; open_watch = false; last_position = 0; dom_children_list = [];