优化,贴图
This commit is contained in:
@@ -41,6 +41,14 @@ export const useProcessStore = defineStore('process', () => {
|
||||
})
|
||||
}
|
||||
|
||||
/** 释放进程状态事件监听(应用退出或热重载时调用) */
|
||||
const destroyListener = () => {
|
||||
if (unlistenFn) {
|
||||
unlistenFn()
|
||||
unlistenFn = null
|
||||
}
|
||||
}
|
||||
|
||||
/** 通过模块 ID 启动进程(自动从注册表读取进程配置) */
|
||||
const startByModule = async (moduleId: string): Promise<ProcessInfo> => {
|
||||
const config = moduleRegistry.getConfig(moduleId)
|
||||
@@ -104,6 +112,7 @@ export const useProcessStore = defineStore('process', () => {
|
||||
return {
|
||||
processes,
|
||||
initListener,
|
||||
destroyListener,
|
||||
startByModule,
|
||||
stopByModule,
|
||||
refreshStatus,
|
||||
|
||||
Reference in New Issue
Block a user