mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-18 16:17:16 +00:00
feat(sub): redesign the subscription page around usage, tabs and app imports
The info page was a long key/value table followed by every link and two app dropdowns, and it rendered left-to-right even for Persian and Arabic. It now leads with a usage ring, the remaining quota and a stats grid, and splits the rest into Subscription / Apps / Configs tabs. - Status tells expired, data-used-up and disabled apart instead of one "Inactive", replacing the hard-coded English expiry chip. - The Apps tab keeps every Android and iOS app with its existing deep link, preselects the visitor's platform and adds Windows: Hiddify and Clash Verge Rev import directly, v2rayN copies the link. - fa-IR and ar-EG render right-to-left; URLs, IDs and sizes stay LTR. - The footer shows the support link and the client refresh interval, so subPageContext now carries subUpdates (also in ?format=info). - Status, days-left and app deep-link logic lives in subPageModel.ts, with unit tests pinning the deep links the page already shipped.
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -660,6 +661,8 @@ func (a *SUBController) subPageContext(page PageData) map[string]any {
|
||||
if datepicker == "" {
|
||||
datepicker = "gregorian"
|
||||
}
|
||||
subUpdates, _ := a.settingService.GetSubUpdates()
|
||||
updateHours, _ := strconv.Atoi(subUpdates)
|
||||
|
||||
return map[string]any{
|
||||
"sId": page.SId,
|
||||
@@ -680,6 +683,7 @@ func (a *SUBController) subPageContext(page PageData) map[string]any {
|
||||
"subClashUrl": page.SubClashUrl,
|
||||
"subTitle": page.SubTitle,
|
||||
"subSupportUrl": page.SubSupportUrl,
|
||||
"subUpdates": updateHours,
|
||||
"links": page.Result,
|
||||
"emails": page.Emails,
|
||||
"datepicker": datepicker,
|
||||
|
||||
@@ -76,6 +76,9 @@ func TestSubInfoEndpoint_ServesStatusJSONEvenForBrowsers(t *testing.T) {
|
||||
t.Fatalf("info payload missing %q; body=%s", key, w.Body.String())
|
||||
}
|
||||
}
|
||||
if info["subUpdates"] != float64(12) {
|
||||
t.Fatalf("subUpdates = %v, want the default 12-hour interval", info["subUpdates"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubInfoEndpoint_UnknownSubIs404(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user