Add advanced request usage query to display remaining quota via the web version.#48
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR integrates a web-based Copilot Usage Viewer with real-time monitoring and token display features to enhance API usability.
- Added a batch file to bootstrap the server and automatically open the usage viewer page
- Created new endpoints and services for fetching and displaying Copilot usage statistics and tokens
- Updated the server routing and documentation to support these new features
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| start.bat | Adds a batch script to install dependencies and launch the server |
| src/services/github/get-copilot-usage.ts | Implements API call for Copilot usage data retrieval |
| src/server.ts | Updates server configuration with additional static and API routes |
| src/routes/usage/route.ts | Defines new API endpoint for fetching usage data |
| src/routes/token/route.ts | Defines new API endpoint for fetching token information |
| src/main.ts | Modifies startup sequence to include token setup and adds log details |
| src/lib/token.ts | Logs token retrieval and refresh events |
| README.md | Documents the new usage viewer and monitoring endpoints |
|
|
||
| await setupCopilotToken() | ||
| await cacheModels() | ||
| } await setupCopilotToken() |
There was a problem hiding this comment.
Consider placing the 'await setupCopilotToken()' call on a new line for improved readability and to avoid any potential parsing ambiguities.
| } await setupCopilotToken() | |
| } | |
| await setupCopilotToken() |
|
Hey this looks cool, thank you! I'm not sure about displaying the token automatically though Also, do you mind if I spice up the HTML a bit? Other than that, looks good! |
Of course it can! I also happened to see the author of this project share on Reddit, and thought it could be incorporated into this project to facilitate real-time viewing of advanced request consumption. If I can help you, I am very happy! |
Add advanced request usage query to display remaining quota via the web version.
Referenced the project at https://github.com/uheej0625/copilot-usage-viewer and merged it into this project.
You can view the webpage at http://localhost:4141/public/usage.html.