mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Fix endpoint usage parsing to show actual endpoints instead of HTTP methods
- Parse column 3 (endpoint path) instead of column 2 (HTTP method)
- Combine method and endpoint for clarity (e.g., 'GET users/{userId}')
- Now shows meaningful endpoint statistics instead of just GET/POST counts
This commit is contained in:
@@ -2700,7 +2700,11 @@ public class AdminController : ControllerBase
|
|||||||
if (parts.Length >= 3)
|
if (parts.Length >= 3)
|
||||||
{
|
{
|
||||||
var timestamp = parts[0];
|
var timestamp = parts[0];
|
||||||
var endpoint = parts[1];
|
var method = parts[1];
|
||||||
|
var endpoint = parts[2];
|
||||||
|
|
||||||
|
// Combine method and endpoint for better clarity
|
||||||
|
var fullEndpoint = $"{method} {endpoint}";
|
||||||
|
|
||||||
// Filter by date if specified
|
// Filter by date if specified
|
||||||
if (sinceDate.HasValue && DateTime.TryParse(timestamp, out var logDate))
|
if (sinceDate.HasValue && DateTime.TryParse(timestamp, out var logDate))
|
||||||
@@ -2709,7 +2713,7 @@ public class AdminController : ControllerBase
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
usage[endpoint] = usage.GetValueOrDefault(endpoint, 0) + 1;
|
usage[fullEndpoint] = usage.GetValueOrDefault(fullEndpoint, 0) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user