* 启用或禁用某个host配置
(name: string, checked: boolean)
| 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 配置 |
no test coverage detected