From 4a0914cb1e271ab4f076cb1bd68c9f07cc025e92 Mon Sep 17 00:00:00 2001 From: Ali Golzar <57574919+aliglzr@users.noreply.github.com> Date: Sun, 31 Aug 2025 20:03:50 +0330 Subject: feat: add "Last Online" column to client list and modal (Closes #3402) (#3405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: persist client last online and expose API * feat(ui): show client last online in table and info modal * i18n: add “Last Online” across locales * chore: format timestamps as HH:mm:ss --- web/controller/api.go | 1 + web/controller/inbound.go | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'web/controller') diff --git a/web/controller/api.go b/web/controller/api.go index 636035ba..32af934e 100644 --- a/web/controller/api.go +++ b/web/controller/api.go @@ -47,6 +47,7 @@ func (a *APIController) initRouter(g *gin.RouterGroup) { {"POST", "/resetAllClientTraffics/:id", a.inboundController.resetAllClientTraffics}, {"POST", "/delDepletedClients/:id", a.inboundController.delDepletedClients}, {"POST", "/onlines", a.inboundController.onlines}, + {"POST", "/lastOnline", a.inboundController.lastOnline}, {"POST", "/updateClientTraffic/:email", a.inboundController.updateClientTraffic}, } diff --git a/web/controller/inbound.go b/web/controller/inbound.go index 851b4b6f..9ff2f302 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -340,6 +340,11 @@ func (a *InboundController) onlines(c *gin.Context) { jsonObj(c, a.inboundService.GetOnlineClients(), nil) } +func (a *InboundController) lastOnline(c *gin.Context) { + data, err := a.inboundService.GetClientsLastOnline() + jsonObj(c, data, err) +} + func (a *InboundController) updateClientTraffic(c *gin.Context) { email := c.Param("email") -- cgit v1.2.3