mirror of
https://github.com/andrey271192/amnezia_web.git
synced 2026-09-20 14:41:59 +00:00
fix(ui): hide cascade in FREE even when state fetch fails
/api/protocols now returns uiHidden alongside edition; client applies both so cascade/warp stay hidden if /api/clients errors out (e.g. missing clientsTable in tunnel container). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "amnezia-admin",
|
"name": "amnezia-admin",
|
||||||
"version": "1.2.14",
|
"version": "1.2.15",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "amnezia_web — базовая панель AmneziaWG (FREE: просмотр и удаление клиентов; полная версия — PRO).",
|
"description": "amnezia_web — базовая панель AmneziaWG (FREE: просмотр и удаление клиентов; полная версия — PRO).",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -575,6 +575,7 @@ async function loadProtocols() {
|
|||||||
try {
|
try {
|
||||||
const data = await api("/api/protocols");
|
const data = await api("/api/protocols");
|
||||||
applyEditionPayload(data);
|
applyEditionPayload(data);
|
||||||
|
applyUiHiddenFromPayload(data);
|
||||||
protoLabel.textContent = `Протокол: ${data.currentLabel || "AmneziaWG"}`;
|
protoLabel.textContent = `Протокол: ${data.currentLabel || "AmneziaWG"}`;
|
||||||
if (profileHintEl) {
|
if (profileHintEl) {
|
||||||
if (data.singleProfile && typeof data.profilesPersistHint === "string" && data.profilesPersistHint) {
|
if (data.singleProfile && typeof data.profilesPersistHint === "string" && data.profilesPersistHint) {
|
||||||
|
|||||||
@@ -2169,6 +2169,7 @@ app.get("/api/protocols", requireAuth, (req, res) => {
|
|||||||
singleProfile: PROFILES.length < 2,
|
singleProfile: PROFILES.length < 2,
|
||||||
profilesPersistHint: hintSingle,
|
profilesPersistHint: hintSingle,
|
||||||
edition: editionPayload(),
|
edition: editionPayload(),
|
||||||
|
uiHidden: { ...effectiveUiHidden() },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user