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:
Андрей Бобырев
2026-05-15 03:11:18 +03:00
parent 11c753c010
commit 485fea7ef7
3 changed files with 3 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "amnezia-admin",
"version": "1.2.14",
"version": "1.2.15",
"private": true,
"description": "amnezia_web — базовая панель AmneziaWG (FREE: просмотр и удаление клиентов; полная версия — PRO).",
"license": "MIT",

View File

@@ -575,6 +575,7 @@ async function loadProtocols() {
try {
const data = await api("/api/protocols");
applyEditionPayload(data);
applyUiHiddenFromPayload(data);
protoLabel.textContent = `Протокол: ${data.currentLabel || "AmneziaWG"}`;
if (profileHintEl) {
if (data.singleProfile && typeof data.profilesPersistHint === "string" && data.profilesPersistHint) {

View File

@@ -2169,6 +2169,7 @@ app.get("/api/protocols", requireAuth, (req, res) => {
singleProfile: PROFILES.length < 2,
profilesPersistHint: hintSingle,
edition: editionPayload(),
uiHidden: { ...effectiveUiHidden() },
});
});