MCPcopy
hub / github.com/xpf0000/FlyEnv / stop

Method stop

src/render/components/MCP/setup.ts:133–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131 }
132
133 stop(): Promise<boolean> {
134 return new Promise((resolve) => {
135 if (this.starting) {
136 resolve(false)
137 return
138 }
139 this.starting = true
140 IPC.send('mcp:stop').then((key: string, res: any) => {
141 IPC.off(key)
142 this.starting = false
143 if (res?.code === 0) {
144 this.running = false
145 MessageSuccess(I18nT('mcp.stopped'))
146 resolve(true)
147 } else {
148 MessageError(res?.msg ?? I18nT('base.fail'))
149 resolve(false)
150 }
151 })
152 })
153 }
154
155 toggleTool(tool: string, on: boolean) {
156 const set = new Set(this.config.enabledTools)

Callers 15

taskCancelFunction · 0.45
groupStopFunction · 0.45
passwordChangeFunction · 0.45
onCancelMethod · 0.45
serviceDoFunction · 0.45
delVersionFunction · 0.45
taskCancelFunction · 0.45
taskCancelFunction · 0.45
taskCancelFunction · 0.45
setFunction · 0.45
groupDoFunction · 0.45
taskCancelMethod · 0.45

Calls 7

MessageSuccessFunction · 0.90
I18nTFunction · 0.90
MessageErrorFunction · 0.90
resolveFunction · 0.85
offMethod · 0.80
thenMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected