diff options
| author | Ali Golzar <57574919+aliglzr@users.noreply.github.com> | 2025-08-27 20:30:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-27 20:30:49 +0300 |
| commit | 21983971971b14377b36c8db92c8603f723f955d (patch) | |
| tree | 1bdc1838e95c52f6a87b96c1d0b0708dcde806f2 /web/assets | |
| parent | d10c312e62e0abf6da64e21a55c51151e23d9929 (diff) | |
Created / Updated fields for clients (#3384)
* feat(backend): add created_at/updated_at to clients and maintain on create/update
backfill existing clients and set updated_at on mutations
* feat(frontend): carry created_at/updated_at in client models and round-trip via JSON
* feat(frontend): display Created and Updated columns in client table with proper date formatting
* i18n: add pages.inbounds.createdAt/updatedAt across all locales
* Update inbound.go
Remove duplicate code
Diffstat (limited to 'web/assets')
| -rw-r--r-- | web/assets/js/model/inbound.js | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 803b5d94..33aa24e0 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -1817,7 +1817,9 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass { tgId = '', subId = RandomUtil.randomLowerAndNum(16), comment = '', - reset = 0 + reset = 0, + created_at = undefined, + updated_at = undefined ) { super(); this.id = id; @@ -1831,6 +1833,8 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass { this.subId = subId; this.comment = comment; this.reset = reset; + this.created_at = created_at; + this.updated_at = updated_at; } static fromJson(json = {}) { @@ -1846,6 +1850,8 @@ Inbound.VmessSettings.VMESS = class extends XrayCommonClass { json.subId, json.comment, json.reset, + json.created_at, + json.updated_at, ); } get _expiryTime() { @@ -1926,7 +1932,9 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass { tgId = '', subId = RandomUtil.randomLowerAndNum(16), comment = '', - reset = 0 + reset = 0, + created_at = undefined, + updated_at = undefined ) { super(); this.id = id; @@ -1940,6 +1948,8 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass { this.subId = subId; this.comment = comment; this.reset = reset; + this.created_at = created_at; + this.updated_at = updated_at; } static fromJson(json = {}) { @@ -1955,6 +1965,8 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass { json.subId, json.comment, json.reset, + json.created_at, + json.updated_at, ); } @@ -2065,7 +2077,9 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass { tgId = '', subId = RandomUtil.randomLowerAndNum(16), comment = '', - reset = 0 + reset = 0, + created_at = undefined, + updated_at = undefined ) { super(); this.password = password; @@ -2078,6 +2092,8 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass { this.subId = subId; this.comment = comment; this.reset = reset; + this.created_at = created_at; + this.updated_at = updated_at; } toJson() { @@ -2092,6 +2108,8 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass { subId: this.subId, comment: this.comment, reset: this.reset, + created_at: this.created_at, + updated_at: this.updated_at, }; } @@ -2107,6 +2125,8 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass { json.subId, json.comment, json.reset, + json.created_at, + json.updated_at, ); } @@ -2226,7 +2246,9 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass { tgId = '', subId = RandomUtil.randomLowerAndNum(16), comment = '', - reset = 0 + reset = 0, + created_at = undefined, + updated_at = undefined ) { super(); this.method = method; @@ -2240,6 +2262,8 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass { this.subId = subId; this.comment = comment; this.reset = reset; + this.created_at = created_at; + this.updated_at = updated_at; } toJson() { @@ -2255,6 +2279,8 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass { subId: this.subId, comment: this.comment, reset: this.reset, + created_at: this.created_at, + updated_at: this.updated_at, }; } @@ -2271,6 +2297,8 @@ Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass { json.subId, json.comment, json.reset, + json.created_at, + json.updated_at, ); } |
