MCPcopy
hub / github.com/youzan/zan-proxy / toggleHost

Method toggleHost

src/core/services/host.ts:167–175  ·  view source on GitHub ↗

* 启用或禁用某个host配置

(name: string, checked: boolean)

Source from the content-addressed store, hash-verified

165 * 启用或禁用某个host配置
166 */
167 public async toggleHost(name: string, checked: boolean) {
168 if (!this.exist(name)) {
169 throw new NotFoundError('找不到对应名称的Host配置');
170 }
171
172 const hostFile = this.hostFilesMap[name];
173 hostFile.checked = checked;
174 await this.saveHostFile(name, hostFile);
175 }
176
177 /**
178 * 获取某个 host 配置

Callers 2

toggleMethod · 0.80
activateWorkspaceFunction · 0.80

Calls 2

existMethod · 0.95
saveHostFileMethod · 0.95

Tested by

no test coverage detected