commitshow 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/render.js +12 -3
- package/package.json +1 -1
package/dist/lib/render.js
CHANGED
|
@@ -1156,10 +1156,19 @@ function timeUntil(isoTarget) {
|
|
|
1156
1156
|
return `${m}m`;
|
|
1157
1157
|
}
|
|
1158
1158
|
export function renderQuotaFooter(q) {
|
|
1159
|
+
// Normalize: GitHub lane returns q.url, Site lane returns q.domain.
|
|
1160
|
+
// Server defends · client treats whichever exists as the "per-target"
|
|
1161
|
+
// tier (label changes from 'repo' to 'site' to match the audit kind).
|
|
1162
|
+
const perTarget = q.url ?? q.domain;
|
|
1163
|
+
const perTargetLabel = q.url ? 'repo' : 'site';
|
|
1164
|
+
if (!perTarget) {
|
|
1165
|
+
// Defensive · never reached if either url or domain is present.
|
|
1166
|
+
return ' ' + c.muted(`quota: IP ${q.ip.remaining}/${q.ip.limit} · resets in ${timeUntil(q.reset_at)}`);
|
|
1167
|
+
}
|
|
1159
1168
|
// Pick the tier closest to its cap so the user sees the most relevant pressure.
|
|
1160
1169
|
const tiers = [
|
|
1161
1170
|
{ name: 'IP', count: q.ip.count, limit: q.ip.limit, remaining: q.ip.remaining },
|
|
1162
|
-
{ name:
|
|
1171
|
+
{ name: perTargetLabel, count: perTarget.count, limit: perTarget.limit, remaining: perTarget.remaining },
|
|
1163
1172
|
{ name: 'global', count: q.global.count, limit: q.global.limit, remaining: q.global.remaining },
|
|
1164
1173
|
];
|
|
1165
1174
|
const tightest = tiers.slice().sort((a, b) => a.remaining - b.remaining)[0];
|
|
@@ -1168,10 +1177,10 @@ export function renderQuotaFooter(q) {
|
|
|
1168
1177
|
c.muted;
|
|
1169
1178
|
const reset = timeUntil(q.reset_at);
|
|
1170
1179
|
const ipPart = `IP ${q.ip.remaining}/${q.ip.limit}`;
|
|
1171
|
-
const
|
|
1180
|
+
const perTargetPart = `${perTargetLabel} ${perTarget.remaining}/${perTarget.limit}`;
|
|
1172
1181
|
return ' ' + c.muted('quota: ') +
|
|
1173
1182
|
tone(ipPart) + c.muted(' · ') +
|
|
1174
|
-
tone(
|
|
1183
|
+
tone(perTargetPart) + c.muted(' · ') +
|
|
1175
1184
|
c.dim(`resets in ${reset}`);
|
|
1176
1185
|
}
|
|
1177
1186
|
// ── Rate-limit panel (deny path) ────────────────────────────────
|