mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 14:41:29 +00:00
fix(Terminal):修复开始执行命令时可能刷新页面的问题
This commit is contained in:
parent
9c7c24d0fb
commit
226ddadbd1
@ -80,9 +80,11 @@ export const useTerminal = defineStore(
|
||||
}
|
||||
|
||||
function taskCompleted(idx: number) {
|
||||
if (typeof state.taskList[idx].callback != 'function') {
|
||||
return
|
||||
}
|
||||
// 命令执行完毕,重新打开热更新
|
||||
if (import.meta.hot) import.meta.hot.send('custom:open-hot', { type: 'terminal' })
|
||||
|
||||
if (typeof state.taskList[idx].callback != 'function') return
|
||||
|
||||
const status = state.taskList[idx].status
|
||||
if (status == taskStatus.Failed || status == taskStatus.Unknown) {
|
||||
state.taskList[idx].callback(taskStatus.Failed)
|
||||
@ -179,6 +181,9 @@ export const useTerminal = defineStore(
|
||||
}
|
||||
|
||||
function startEventSource(taskKey: number) {
|
||||
// 命令执行期间禁用热更新
|
||||
if (import.meta.hot) import.meta.hot.send('custom:close-hot', { type: 'terminal' })
|
||||
|
||||
window.eventSource = new EventSource(
|
||||
buildTerminalUrl(state.taskList[taskKey].command, state.taskList[taskKey].uuid, state.taskList[taskKey].extend)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user