性能优化
This commit is contained in:
@@ -59,20 +59,20 @@ export const useProcessStore = defineStore('process', () => {
|
||||
maxRestarts: pc.maxRestarts
|
||||
}
|
||||
|
||||
const info = await invoke<ProcessInfo>('start_process', { params })
|
||||
const info = await invoke<ProcessInfo>('process_start', { params })
|
||||
processes.value.set(moduleId, info)
|
||||
return info
|
||||
}
|
||||
|
||||
/** 通过模块 ID 停止进程 */
|
||||
const stopByModule = async (moduleId: string): Promise<void> => {
|
||||
await invoke('stop_process', { id: moduleId })
|
||||
await invoke('process_stop', { id: moduleId })
|
||||
processes.value.delete(moduleId)
|
||||
}
|
||||
|
||||
/** 获取单个进程状态(从 Rust 端查询最新值) */
|
||||
const refreshStatus = async (moduleId: string): Promise<ProcessInfo | null> => {
|
||||
const info = await invoke<ProcessInfo | null>('get_process_status', { id: moduleId })
|
||||
const info = await invoke<ProcessInfo | null>('process_status', { id: moduleId })
|
||||
if (info) {
|
||||
processes.value.set(moduleId, info)
|
||||
} else {
|
||||
@@ -83,7 +83,7 @@ export const useProcessStore = defineStore('process', () => {
|
||||
|
||||
/** 刷新所有进程状态 */
|
||||
const refreshAll = async (): Promise<void> => {
|
||||
const all = await invoke<ProcessInfo[]>('get_all_process_status')
|
||||
const all = await invoke<ProcessInfo[]>('process_all_status')
|
||||
processes.value.clear()
|
||||
all.forEach((info) => {
|
||||
processes.value.set(info.id, info)
|
||||
@@ -97,7 +97,7 @@ export const useProcessStore = defineStore('process', () => {
|
||||
|
||||
/** 停止所有进程 */
|
||||
const stopAll = async (): Promise<void> => {
|
||||
await invoke('stop_all_processes')
|
||||
await invoke('process_stop_all')
|
||||
processes.value.clear()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user