mirror of
https://github.com/telemt/telemt.git
synced 2026-04-21 04:24:10 +03:00
feat(api): add GET /v1/stats/users/active-ips endpoint
Lightweight endpoint that returns only users with active TCP connections and their IP addresses. Calls only get_active_ips_for_users() without collecting recent IPs or building full UserInfo, significantly reducing CPU and memory overhead compared to /v1/stats/users.
This commit is contained in:
@@ -442,6 +442,12 @@ pub(super) struct UserInfo {
|
||||
pub(super) links: UserLinks,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub(super) struct UserActiveIps {
|
||||
pub(super) username: String,
|
||||
pub(super) active_ips: Vec<IpAddr>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub(super) struct CreateUserResponse {
|
||||
pub(super) user: UserInfo,
|
||||
|
||||
Reference in New Issue
Block a user