feat(executors): Improved UI components for displaying provider limits and usage statistics in the dashboard.

This commit is contained in:
decolua
2026-02-05 18:38:50 +07:00
parent 249fc28c49
commit 32aefe5a76
21 changed files with 1112 additions and 310 deletions
+7 -1
View File
@@ -37,9 +37,15 @@ export async function getUsageForProvider(connection) {
*/
async function getGitHubUsage(accessToken, providerSpecificData) {
try {
// Use copilotToken for copilot_internal API, not GitHub OAuth accessToken
const copilotToken = providerSpecificData?.copilotToken;
if (!copilotToken) {
throw new Error("Copilot token not found. Please refresh token first.");
}
const response = await fetch("https://api.github.com/copilot_internal/user", {
headers: {
Authorization: `Bearer ${accessToken}`,
Authorization: `Bearer ${copilotToken}`,
Accept: "application/json",
"X-GitHub-Api-Version": GITHUB_CONFIG.apiVersion,
"User-Agent": GITHUB_CONFIG.userAgent,