Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2025-09-10 17:36:12 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-10 17:36:12 +0300
commit2f36a4047c7c32ca17aaea8875bb5c087430b40d (patch)
tree543f20817f8be31c6d55351a58980e964c5f176e /web/controller/inbound.go
parentdc3b0d218a743a51c088ed90fe006d130e3fff87 (diff)
API: delClientByEmail
Diffstat (limited to 'web/controller/inbound.go')
-rw-r--r--web/controller/inbound.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/web/controller/inbound.go b/web/controller/inbound.go
index 10a58daa..8d610e7d 100644
--- a/web/controller/inbound.go
+++ b/web/controller/inbound.go
@@ -46,6 +46,7 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) {
g.POST("/onlines", a.onlines)
g.POST("/lastOnline", a.lastOnline)
g.POST("/updateClientTraffic/:email", a.updateClientTraffic)
+ g.POST("/:id/delClientByEmail/:email", a.delInboundClientByEmail)
}
func (a *InboundController) getInbounds(c *gin.Context) {
@@ -374,3 +375,23 @@ func (a *InboundController) updateClientTraffic(c *gin.Context) {
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.inboundClientUpdateSuccess"), nil)
}
+
+func (a *InboundController) delInboundClientByEmail(c *gin.Context) {
+ inboundId, err := strconv.Atoi(c.Param("id"))
+ if err != nil {
+ jsonMsg(c, "Invalid inbound ID", err)
+ return
+ }
+
+ email := c.Param("email")
+ needRestart, err := a.inboundService.DelInboundClientByEmail(inboundId, email)
+ if err != nil {
+ jsonMsg(c, "Failed to delete client by email", err)
+ return
+ }
+
+ jsonMsg(c, "Client deleted successfully", nil)
+ if needRestart {
+ a.xrayService.SetToNeedRestart()
+ }
+}