3x-ui/sub
MHSanaei 64122ad80f
fix(expiry): show delayed-start countdown in subscribe and client info (#4535)
A client with "start after first use" expiry stores the duration as a
negative number of milliseconds (e.g. -86400000 = 1 day after first
connect). The clients page row already renders this correctly as
"Delayed start: 1d", but two other surfaces treated negative values as
zero and rendered them as unlimited:

- Subscription header: the index==0 / index>0 branches in subService,
  subClashService and subJsonService only carried ExpiryTime forward
  when > 0, so traffic.ExpiryTime stayed at zero and the header sent
  expire=0. Every imported client appeared to have no expiry, and the
  built-in subscribe page rendered the "unlimited" tag.

- ClientInfoModal: both the expiryLabel helper and the rendering check
  treated <= 0 as the "no expiry" branch, so the modal showed an
  infinity tag instead of "Delayed start: Nd".

Add subscriptionExpiryFromClient to map negative durations onto a
"now + |value|" timestamp so subscription clients see an actual expiry
they can count down from. Update ClientInfoModal's helper and render
to match the clients-page convention.

Regression test in subService_test.go covers the helper.

Refs #4535
2026-05-24 23:15:44 +02:00
..
default.json dokodemo-door, socks renamed to mixed, tunnel 2025-09-09 13:57:40 +02:00
dist.go feat(inbounds): add sub/client link endpoints; hide panel version on login 2026-05-11 15:03:47 +02:00
links.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
links_test.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
sub.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
subClashService.go fix(expiry): show delayed-start countdown in subscribe and client info (#4535) 2026-05-24 23:15:44 +02:00
subController.go Frontend rewrite: React + TypeScript with AntD v6 (#4498) 2026-05-23 15:21:45 +02:00
subJsonService.go fix(expiry): show delayed-start countdown in subscribe and client info (#4535) 2026-05-24 23:15:44 +02:00
subService.go fix(expiry): show delayed-start countdown in subscribe and client info (#4535) 2026-05-24 23:15:44 +02:00
subService_test.go fix(expiry): show delayed-start countdown in subscribe and client info (#4535) 2026-05-24 23:15:44 +02:00