Merge PR #1300: tailscale Windows fix, quota pagination, SSE abort handling
- fix(tunnel): cross-platform tailscale probes without shell redirection - feat(usage): paginate provider limits with page size controls - feat(providers): stop control for one-by-one connection testing - fix(sse): close stream gracefully on abort/disconnect instead of pipe errors - ui(quota): simplify header, always show pagination in one row Co-authored-by: philau2512 <dplau25122002@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e84ab7857a
commit
6b0dc09239
8 files changed
+1183
-295
No files matched your search
@@ -75,6 +75,23 @@ export function calculatePercentage(used, total) {
|
||||
return Math.round(((total - used) / total) * 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get remaining percentage from a normalized quota row
|
||||
* @param {Object} quota - Normalized quota object
|
||||
* @returns {number} Remaining percentage (0-100)
|
||||
*/
|
||||
export function getRemainingPercentage(quota) {
|
||||
if (quota?.remaining !== undefined) {
|
||||
return Math.max(0, Math.round(quota.remaining));
|
||||
}
|
||||
|
||||
if (quota?.remainingPercentage !== undefined) {
|
||||
return Math.round(quota.remainingPercentage);
|
||||
}
|
||||
|
||||
return calculatePercentage(quota?.used, quota?.total);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse provider-specific quota structures into normalized array
|
||||
* @param {string} provider - Provider name (github, antigravity, codex, kiro, claude)
|
||||
@@ -123,6 +140,7 @@ export function parseQuotaData(provider, data) {
|
||||
name: quotaType,
|
||||
used: quota.used || 0,
|
||||
total: quota.total || 0,
|
||||
remaining: quota.remaining,
|
||||
resetAt: quota.resetAt || null,
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user