(id, enabled)
| 1186 | |
| 1187 | // 切换代理状态 |
| 1188 | async function toggleProxyItem(id, enabled) { |
| 1189 | try { |
| 1190 | const endpoint = enabled ? 'enable' : 'disable'; |
| 1191 | await api.post(`/settings/proxies/${id}/${endpoint}`); |
| 1192 | toast.success(enabled ? '代理已启用' : '代理已禁用'); |
| 1193 | loadProxies(); |
| 1194 | } catch (error) { |
| 1195 | toast.error('操作失败: ' + error.message); |
| 1196 | } |
| 1197 | } |
| 1198 | |
| 1199 | // 删除代理 |
| 1200 | async function deleteProxyItem(id) { |
nothing calls this directly
no test coverage detected