mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix(usage): show edited connection names consistently across views
Prefer edited name over provider email/displayName in Providers and Quota Tracker; surface the provider-sourced email/display as secondary text. Keeps fallbacks for legacy or unnamed connections. Closes #1699 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
4078f36ced
commit
df37bb3468
@@ -57,6 +57,18 @@ function kiroMethodLabel(conn) {
|
||||
return conn.authType === "api_key" ? "API Key" : "OAuth";
|
||||
}
|
||||
|
||||
function getConnectionSecondaryLabel(connection) {
|
||||
if (connection.name?.trim() && connection.email?.trim() && connection.name.trim() !== connection.email.trim()) {
|
||||
return connection.email.trim();
|
||||
}
|
||||
|
||||
if (connection.name?.trim() && connection.displayName?.trim() && connection.name.trim() !== connection.displayName.trim()) {
|
||||
return connection.displayName.trim();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Region is stored for builder-id/idc/api_key flows; social and imported flows
|
||||
// omit it, so fall back to the region segment of the profileArn
|
||||
// (arn:aws:codewhisperer:<region>:...).
|
||||
@@ -918,6 +930,11 @@ export default function ProviderLimits() {
|
||||
{getConnectionLabel(conn)}
|
||||
</p>
|
||||
) : null}
|
||||
{getConnectionSecondaryLabel(conn) ? (
|
||||
<p className="text-[11px] text-text-muted/80 truncate">
|
||||
{getConnectionSecondaryLabel(conn)}
|
||||
</p>
|
||||
) : null}
|
||||
{isCodex && (
|
||||
<p className="text-[11px] text-text-muted truncate">
|
||||
Reset eligible: {resetCreditCount}
|
||||
|
||||
Reference in New Issue
Block a user