subpage: enabled state

Track and surface a subscription's enabled state from backend to frontend so the UI can show inactive subscriptions and use it in active-state logic.

Changes:
- sub/subService.go: track hasEnabledClient, set traffic.Enable, add Enabled to PageData and populate it in BuildPageData.
- sub/subController.go: include enabled in the page context.
- web/html/settings/panel/subscription/subpage.html: emit data-enabled attribute and render an "inactive" tag when disabled.
- web/assets/js/subscription.js: read data-enabled and include it in isActive() checks.

This ensures subscriptions with no enabled clients are marked inactive in the UI and excluded from being considered active.
This commit is contained in:
MHSanaei
2026-05-04 23:27:57 +02:00
parent 6099a07ff0
commit 32b7ada549
4 changed files with 16 additions and 3 deletions

View File

@@ -138,6 +138,7 @@ func (a *SUBController) subs(c *gin.Context) {
"host": page.Host,
"base_path": page.BasePath,
"sId": page.SId,
"enabled": page.Enabled,
"download": page.Download,
"upload": page.Upload,
"total": page.Total,