protocol-proxy 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/app.js +12 -2
package/package.json
CHANGED
package/public/app.js
CHANGED
|
@@ -444,8 +444,18 @@ async function deleteProxy(id) {
|
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
function editProxy(id) {
|
|
448
|
-
|
|
447
|
+
async function editProxy(id) {
|
|
448
|
+
try {
|
|
449
|
+
const res = await fetch(`/api/proxies/${id}`);
|
|
450
|
+
if (!res.ok) throw new Error('加载失败');
|
|
451
|
+
const full = await res.json();
|
|
452
|
+
// 用完整数据替换列表中的掩码数据
|
|
453
|
+
const idx = proxies.findIndex(p => p.id === id);
|
|
454
|
+
if (idx !== -1) proxies[idx] = { ...proxies[idx], ...full };
|
|
455
|
+
openModal(id);
|
|
456
|
+
} catch (err) {
|
|
457
|
+
showToast('加载代理配置失败: ' + err.message, true);
|
|
458
|
+
}
|
|
449
459
|
}
|
|
450
460
|
|
|
451
461
|
// ==================== 工具函数 ====================
|