mirror of
https://github.com/owntracks/recorder.git
synced 2026-02-13 20:49:51 +00:00
http: surface LAST to /last
This commit is contained in:
8
http.c
8
http.c
@@ -182,6 +182,14 @@ static int dispatch(struct mg_connection *conn, const char *uri)
|
||||
fprintf(stderr, "%d = %s\n", ret, uparts[ret]);
|
||||
}
|
||||
|
||||
if (nparts == 1 && !strcmp(uparts[0], "last")) {
|
||||
JsonNode *user_array;
|
||||
|
||||
if ((user_array = last_users()) != NULL) {
|
||||
return (json_response(conn, user_array));
|
||||
}
|
||||
}
|
||||
|
||||
u = field(conn, "user");
|
||||
d = field(conn, "device");
|
||||
time_from = field(conn, "from");
|
||||
|
||||
Reference in New Issue
Block a user