From 323cf09d100f1a62d116ed14ed475c5bf1298296 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 3 Jul 2026 09:38:37 +0200 Subject: [PATCH] feat(sub): show the announcement on the subscription info page The subAnnounce setting was only emitted as a base64 Announce response header, which most client apps ignore and browsers never see. Pass it into the sub page view-model and render it as an info alert at the top of the card; custom themes get the announce key for free. Closes #5276 --- frontend/src/env.d.ts | 1 + frontend/src/pages/sub/SubPage.tsx | 5 +++++ internal/sub/controller.go | 1 + 3 files changed, 7 insertions(+) diff --git a/frontend/src/env.d.ts b/frontend/src/env.d.ts index b6f85e4ab..732af9719 100644 --- a/frontend/src/env.d.ts +++ b/frontend/src/env.d.ts @@ -18,6 +18,7 @@ interface SubPageData { links?: string[]; emails?: string[]; datepicker?: 'gregorian' | 'jalalian'; + announce?: string; downloadByte?: string | number; uploadByte?: string | number; usedByte?: string | number; diff --git a/frontend/src/pages/sub/SubPage.tsx b/frontend/src/pages/sub/SubPage.tsx index a7467c023..feb659bf9 100644 --- a/frontend/src/pages/sub/SubPage.tsx +++ b/frontend/src/pages/sub/SubPage.tsx @@ -1,6 +1,7 @@ import { Fragment, useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { + Alert, Button, Card, Col, @@ -61,6 +62,7 @@ const links: string[] = Array.isArray(subData.links) ? subData.links : []; const linkEmails: string[] = Array.isArray(subData.emails) ? subData.emails : []; const subEmail = [...new Set(linkEmails.filter(Boolean))].join(', '); const datepicker = subData.datepicker || 'gregorian'; +const announce = subData.announce || ''; const isUnlimited = totalByte <= 0 && expireMs === 0; const isActive = (() => { @@ -283,6 +285,9 @@ export default function SubPage() { + {announce && ( + + )}