mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 05:04:22 +00:00
fix: single inbound traffic reset resets all inbounds (#4334)
This commit is contained in:
parent
5fb36d34c9
commit
a7dbbb18a9
15 changed files with 33 additions and 1 deletions
|
|
@ -396,7 +396,7 @@ function confirmResetTraffic(dbInbound) {
|
||||||
okText: 'Reset',
|
okText: 'Reset',
|
||||||
cancelText: 'Cancel',
|
cancelText: 'Cancel',
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const msg = await HttpUtil.post(`/panel/api/inbounds/resetAllTraffics`);
|
const msg = await HttpUtil.post(`/panel/api/inbounds/${dbInbound.id}/resetTraffic`);
|
||||||
if (msg?.success) await refresh();
|
if (msg?.success) await refresh();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) {
|
||||||
g.POST("/:id/copyClients", a.copyInboundClients)
|
g.POST("/:id/copyClients", a.copyInboundClients)
|
||||||
g.POST("/:id/delClient/:clientId", a.delInboundClient)
|
g.POST("/:id/delClient/:clientId", a.delInboundClient)
|
||||||
g.POST("/updateClient/:clientId", a.updateInboundClient)
|
g.POST("/updateClient/:clientId", a.updateInboundClient)
|
||||||
|
g.POST("/:id/resetTraffic", a.resetInboundTraffic)
|
||||||
g.POST("/:id/resetClientTraffic/:email", a.resetClientTraffic)
|
g.POST("/:id/resetClientTraffic/:email", a.resetClientTraffic)
|
||||||
g.POST("/resetAllTraffics", a.resetAllTraffics)
|
g.POST("/resetAllTraffics", a.resetAllTraffics)
|
||||||
g.POST("/resetAllClientTraffics/:id", a.resetAllClientTraffics)
|
g.POST("/resetAllClientTraffics/:id", a.resetAllClientTraffics)
|
||||||
|
|
@ -441,6 +442,24 @@ func (a *InboundController) resetClientTraffic(c *gin.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// resetInboundTraffic resets traffic counters for a specific inbound.
|
||||||
|
func (a *InboundController) resetInboundTraffic(c *gin.Context) {
|
||||||
|
id, err := strconv.Atoi(c.Param("id"))
|
||||||
|
if err != nil {
|
||||||
|
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = a.inboundService.ResetInboundTraffic(id)
|
||||||
|
if err != nil {
|
||||||
|
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
a.xrayService.SetToNeedRestart()
|
||||||
|
}
|
||||||
|
jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.resetInboundTrafficSuccess"), nil)
|
||||||
|
}
|
||||||
|
|
||||||
// resetAllTraffics resets all traffic counters across all inbounds.
|
// resetAllTraffics resets all traffic counters across all inbounds.
|
||||||
func (a *InboundController) resetAllTraffics(c *gin.Context) {
|
func (a *InboundController) resetAllTraffics(c *gin.Context) {
|
||||||
err := a.inboundService.ResetAllTraffics()
|
err := a.inboundService.ResetAllTraffics()
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "تم إعادة تعيين كل حركة المرور من العميل",
|
"resetAllClientTrafficSuccess": "تم إعادة تعيين كل حركة المرور من العميل",
|
||||||
"resetAllTrafficSuccess": "تم إعادة تعيين كل حركة المرور",
|
"resetAllTrafficSuccess": "تم إعادة تعيين كل حركة المرور",
|
||||||
"resetInboundClientTrafficSuccess": "تم إعادة تعيين حركة المرور",
|
"resetInboundClientTrafficSuccess": "تم إعادة تعيين حركة المرور",
|
||||||
|
"resetInboundTrafficSuccess": "تم إعادة تعيين حركة مرور الداخل",
|
||||||
"trafficGetError": "خطأ في الحصول على حركات المرور",
|
"trafficGetError": "خطأ في الحصول على حركات المرور",
|
||||||
"getNewX25519CertError": "حدث خطأ أثناء الحصول على شهادة X25519.",
|
"getNewX25519CertError": "حدث خطأ أثناء الحصول على شهادة X25519.",
|
||||||
"getNewmldsa65Error": "حدث خطاء في الحصول على mldsa65.",
|
"getNewmldsa65Error": "حدث خطاء في الحصول على mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "All traffic from the client has been reset.",
|
"resetAllClientTrafficSuccess": "All traffic from the client has been reset.",
|
||||||
"resetAllTrafficSuccess": "All traffic has been reset.",
|
"resetAllTrafficSuccess": "All traffic has been reset.",
|
||||||
"resetInboundClientTrafficSuccess": "Traffic has been reset.",
|
"resetInboundClientTrafficSuccess": "Traffic has been reset.",
|
||||||
|
"resetInboundTrafficSuccess": "Inbound traffic has been reset.",
|
||||||
"trafficGetError": "Error getting traffics.",
|
"trafficGetError": "Error getting traffics.",
|
||||||
"getNewX25519CertError": "Error while obtaining the X25519 certificate.",
|
"getNewX25519CertError": "Error while obtaining the X25519 certificate.",
|
||||||
"getNewmldsa65Error": "Error while obtaining mldsa65.",
|
"getNewmldsa65Error": "Error while obtaining mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "Todo el tráfico del cliente ha sido reiniciado",
|
"resetAllClientTrafficSuccess": "Todo el tráfico del cliente ha sido reiniciado",
|
||||||
"resetAllTrafficSuccess": "Todo el tráfico ha sido reiniciado",
|
"resetAllTrafficSuccess": "Todo el tráfico ha sido reiniciado",
|
||||||
"resetInboundClientTrafficSuccess": "El tráfico ha sido reiniciado",
|
"resetInboundClientTrafficSuccess": "El tráfico ha sido reiniciado",
|
||||||
|
"resetInboundTrafficSuccess": "El tráfico de entrada ha sido reiniciado",
|
||||||
"trafficGetError": "Error al obtener los tráficos",
|
"trafficGetError": "Error al obtener los tráficos",
|
||||||
"getNewX25519CertError": "Error al obtener el certificado X25519.",
|
"getNewX25519CertError": "Error al obtener el certificado X25519.",
|
||||||
"getNewmldsa65Error": "Error al obtener el certificado mldsa65.",
|
"getNewmldsa65Error": "Error al obtener el certificado mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "تمام ترافیک کلاینت بازنشانی شد",
|
"resetAllClientTrafficSuccess": "تمام ترافیک کلاینت بازنشانی شد",
|
||||||
"resetAllTrafficSuccess": "تمام ترافیکها بازنشانی شدند",
|
"resetAllTrafficSuccess": "تمام ترافیکها بازنشانی شدند",
|
||||||
"resetInboundClientTrafficSuccess": "ترافیک بازنشانی شد",
|
"resetInboundClientTrafficSuccess": "ترافیک بازنشانی شد",
|
||||||
|
"resetInboundTrafficSuccess": "ترافیک ورودی بازنشانی شد",
|
||||||
"trafficGetError": "خطا در دریافت ترافیکها",
|
"trafficGetError": "خطا در دریافت ترافیکها",
|
||||||
"getNewX25519CertError": "خطا در دریافت گواهی X25519.",
|
"getNewX25519CertError": "خطا در دریافت گواهی X25519.",
|
||||||
"getNewmldsa65Error": "خطا در دریافت گواهی mldsa65.",
|
"getNewmldsa65Error": "خطا در دریافت گواهی mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "Semua lalu lintas klien telah direset",
|
"resetAllClientTrafficSuccess": "Semua lalu lintas klien telah direset",
|
||||||
"resetAllTrafficSuccess": "Semua lalu lintas telah direset",
|
"resetAllTrafficSuccess": "Semua lalu lintas telah direset",
|
||||||
"resetInboundClientTrafficSuccess": "Lalu lintas telah direset",
|
"resetInboundClientTrafficSuccess": "Lalu lintas telah direset",
|
||||||
|
"resetInboundTrafficSuccess": "Lalu lintas masuk telah direset",
|
||||||
"trafficGetError": "Gagal mendapatkan data lalu lintas",
|
"trafficGetError": "Gagal mendapatkan data lalu lintas",
|
||||||
"getNewX25519CertError": "Terjadi kesalahan saat mendapatkan sertifikat X25519.",
|
"getNewX25519CertError": "Terjadi kesalahan saat mendapatkan sertifikat X25519.",
|
||||||
"getNewmldsa65Error": "Terjadi kesalahan saat mendapatkan sertifikat mldsa65.",
|
"getNewmldsa65Error": "Terjadi kesalahan saat mendapatkan sertifikat mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "クライアントのすべてのトラフィックがリセットされました",
|
"resetAllClientTrafficSuccess": "クライアントのすべてのトラフィックがリセットされました",
|
||||||
"resetAllTrafficSuccess": "すべてのトラフィックがリセットされました",
|
"resetAllTrafficSuccess": "すべてのトラフィックがリセットされました",
|
||||||
"resetInboundClientTrafficSuccess": "トラフィックがリセットされました",
|
"resetInboundClientTrafficSuccess": "トラフィックがリセットされました",
|
||||||
|
"resetInboundTrafficSuccess": "受信トラフィックがリセットされました",
|
||||||
"trafficGetError": "トラフィックの取得中にエラーが発生しました",
|
"trafficGetError": "トラフィックの取得中にエラーが発生しました",
|
||||||
"getNewX25519CertError": "X25519証明書の取得中にエラーが発生しました。",
|
"getNewX25519CertError": "X25519証明書の取得中にエラーが発生しました。",
|
||||||
"getNewmldsa65Error": "mldsa65証明書の取得中にエラーが発生しました。",
|
"getNewmldsa65Error": "mldsa65証明書の取得中にエラーが発生しました。",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "Todo o tráfego do cliente foi reiniciado",
|
"resetAllClientTrafficSuccess": "Todo o tráfego do cliente foi reiniciado",
|
||||||
"resetAllTrafficSuccess": "Todo o tráfego foi reiniciado",
|
"resetAllTrafficSuccess": "Todo o tráfego foi reiniciado",
|
||||||
"resetInboundClientTrafficSuccess": "O tráfego foi reiniciado",
|
"resetInboundClientTrafficSuccess": "O tráfego foi reiniciado",
|
||||||
|
"resetInboundTrafficSuccess": "O tráfego de entrada foi reiniciado",
|
||||||
"trafficGetError": "Erro ao obter tráfegos",
|
"trafficGetError": "Erro ao obter tráfegos",
|
||||||
"getNewX25519CertError": "Erro ao obter o certificado X25519.",
|
"getNewX25519CertError": "Erro ao obter o certificado X25519.",
|
||||||
"getNewmldsa65Error": "Erro ao obter o certificado mldsa65.",
|
"getNewmldsa65Error": "Erro ao obter o certificado mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "Весь трафик клиента сброшен",
|
"resetAllClientTrafficSuccess": "Весь трафик клиента сброшен",
|
||||||
"resetAllTrafficSuccess": "Весь трафик сброшен",
|
"resetAllTrafficSuccess": "Весь трафик сброшен",
|
||||||
"resetInboundClientTrafficSuccess": "Трафик сброшен",
|
"resetInboundClientTrafficSuccess": "Трафик сброшен",
|
||||||
|
"resetInboundTrafficSuccess": "Входящий трафик сброшен",
|
||||||
"trafficGetError": "Ошибка получения данных о трафике",
|
"trafficGetError": "Ошибка получения данных о трафике",
|
||||||
"getNewX25519CertError": "Ошибка при получении сертификата X25519.",
|
"getNewX25519CertError": "Ошибка при получении сертификата X25519.",
|
||||||
"getNewmldsa65Error": "Ошибка при получении сертификата mldsa65.",
|
"getNewmldsa65Error": "Ошибка при получении сертификата mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "İstemcinin tüm trafiği sıfırlandı",
|
"resetAllClientTrafficSuccess": "İstemcinin tüm trafiği sıfırlandı",
|
||||||
"resetAllTrafficSuccess": "Tüm trafik sıfırlandı",
|
"resetAllTrafficSuccess": "Tüm trafik sıfırlandı",
|
||||||
"resetInboundClientTrafficSuccess": "Trafik sıfırlandı",
|
"resetInboundClientTrafficSuccess": "Trafik sıfırlandı",
|
||||||
|
"resetInboundTrafficSuccess": "Gelen trafik sıfırlandı",
|
||||||
"trafficGetError": "Trafik bilgisi alınırken hata oluştu",
|
"trafficGetError": "Trafik bilgisi alınırken hata oluştu",
|
||||||
"getNewX25519CertError": "X25519 sertifikası alınırken hata oluştu.",
|
"getNewX25519CertError": "X25519 sertifikası alınırken hata oluştu.",
|
||||||
"getNewmldsa65Error": "mldsa65 sertifikası alınırken hata oluştu.",
|
"getNewmldsa65Error": "mldsa65 sertifikası alınırken hata oluştu.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "Весь трафік клієнта скинуто",
|
"resetAllClientTrafficSuccess": "Весь трафік клієнта скинуто",
|
||||||
"resetAllTrafficSuccess": "Весь трафік скинуто",
|
"resetAllTrafficSuccess": "Весь трафік скинуто",
|
||||||
"resetInboundClientTrafficSuccess": "Трафік скинуто",
|
"resetInboundClientTrafficSuccess": "Трафік скинуто",
|
||||||
|
"resetInboundTrafficSuccess": "Трафік вхідного потоку скинуто",
|
||||||
"trafficGetError": "Помилка отримання даних про трафік",
|
"trafficGetError": "Помилка отримання даних про трафік",
|
||||||
"getNewX25519CertError": "Помилка при отриманні сертифіката X25519.",
|
"getNewX25519CertError": "Помилка при отриманні сертифіката X25519.",
|
||||||
"getNewmldsa65Error": "Помилка при отриманні сертифіката mldsa65.",
|
"getNewmldsa65Error": "Помилка при отриманні сертифіката mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "Đã đặt lại toàn bộ lưu lượng client",
|
"resetAllClientTrafficSuccess": "Đã đặt lại toàn bộ lưu lượng client",
|
||||||
"resetAllTrafficSuccess": "Đã đặt lại toàn bộ lưu lượng",
|
"resetAllTrafficSuccess": "Đã đặt lại toàn bộ lưu lượng",
|
||||||
"resetInboundClientTrafficSuccess": "Đã đặt lại lưu lượng",
|
"resetInboundClientTrafficSuccess": "Đã đặt lại lưu lượng",
|
||||||
|
"resetInboundTrafficSuccess": "Đã đặt lại lưu lượng Inbound",
|
||||||
"trafficGetError": "Lỗi khi lấy thông tin lưu lượng",
|
"trafficGetError": "Lỗi khi lấy thông tin lưu lượng",
|
||||||
"getNewX25519CertError": "Lỗi khi lấy chứng chỉ X25519.",
|
"getNewX25519CertError": "Lỗi khi lấy chứng chỉ X25519.",
|
||||||
"getNewmldsa65Error": "Lỗi khi lấy chứng chỉ mldsa65.",
|
"getNewmldsa65Error": "Lỗi khi lấy chứng chỉ mldsa65.",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "客户端所有流量已重置",
|
"resetAllClientTrafficSuccess": "客户端所有流量已重置",
|
||||||
"resetAllTrafficSuccess": "所有流量已重置",
|
"resetAllTrafficSuccess": "所有流量已重置",
|
||||||
"resetInboundClientTrafficSuccess": "流量已重置",
|
"resetInboundClientTrafficSuccess": "流量已重置",
|
||||||
|
"resetInboundTrafficSuccess": "入站流量已重置",
|
||||||
"trafficGetError": "获取流量数据时出错",
|
"trafficGetError": "获取流量数据时出错",
|
||||||
"getNewX25519CertError": "获取X25519证书时出错。",
|
"getNewX25519CertError": "获取X25519证书时出错。",
|
||||||
"getNewmldsa65Error": "获取mldsa65证书时出错。",
|
"getNewmldsa65Error": "获取mldsa65证书时出错。",
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,7 @@
|
||||||
"resetAllClientTrafficSuccess": "客戶端所有流量已重置",
|
"resetAllClientTrafficSuccess": "客戶端所有流量已重置",
|
||||||
"resetAllTrafficSuccess": "所有流量已重置",
|
"resetAllTrafficSuccess": "所有流量已重置",
|
||||||
"resetInboundClientTrafficSuccess": "流量已重置",
|
"resetInboundClientTrafficSuccess": "流量已重置",
|
||||||
|
"resetInboundTrafficSuccess": "入站流量已重置",
|
||||||
"trafficGetError": "取得流量資料時發生錯誤",
|
"trafficGetError": "取得流量資料時發生錯誤",
|
||||||
"getNewX25519CertError": "取得X25519憑證時發生錯誤。",
|
"getNewX25519CertError": "取得X25519憑證時發生錯誤。",
|
||||||
"getNewmldsa65Error": "取得mldsa65憑證時發生錯誤。",
|
"getNewmldsa65Error": "取得mldsa65憑證時發生錯誤。",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue