mirror of
https://github.com/andrey271192/amnezia_web-PRO.git
synced 2026-09-20 14:42:00 +00:00
fix: show distinct awg instance labels
This commit is contained in:
@@ -2900,6 +2900,13 @@ function detectVariantFromHead(head, iface) {
|
||||
return "awg";
|
||||
}
|
||||
|
||||
function inferVariantFromProfile(prof) {
|
||||
const raw = `${prof.variant || ""} ${prof.id || ""} ${prof.container || ""} ${prof.label || ""}`.toLowerCase();
|
||||
if (raw.includes("legacy") || prof.iface === "wg0") return "legacy";
|
||||
if (raw.includes("awg2") || raw.includes("2.0")) return "awg2";
|
||||
return "awg";
|
||||
}
|
||||
|
||||
app.get("/api/instances", requireAuth, async (_req, res) => {
|
||||
const managedIds = new Set(loadManagedProfiles().map((m) => m.id));
|
||||
const profiles = getProfiles();
|
||||
@@ -2912,7 +2919,7 @@ app.get("/api/instances", requireAuth, async (_req, res) => {
|
||||
let runningNow = false;
|
||||
let peers = null;
|
||||
let port = prof.port || null;
|
||||
let variant = prof.variant || "awg2";
|
||||
let variant = prof.variant || inferVariantFromProfile(prof);
|
||||
try {
|
||||
const rt = createRuntime(prof);
|
||||
container = await rt.resolveContainer();
|
||||
|
||||
Reference in New Issue
Block a user