|
|
@ -26,6 +26,7 @@ export const ApiKeysTable: FC<Props> = ({ apiKeys, timeZone, onDelete, onMigrate |
|
|
|
<th>Name</th> |
|
|
|
<th>Name</th> |
|
|
|
<th>Role</th> |
|
|
|
<th>Role</th> |
|
|
|
<th>Expires</th> |
|
|
|
<th>Expires</th> |
|
|
|
|
|
|
|
<th>Last used at</th> |
|
|
|
<th style={{ width: '34px' }} /> |
|
|
|
<th style={{ width: '34px' }} /> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
@ -47,6 +48,7 @@ export const ApiKeysTable: FC<Props> = ({ apiKeys, timeZone, onDelete, onMigrate |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
|
|
|
|
<td>{formatLastUsedAtDate(timeZone, key.lastUsedAt)}</td> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<HorizontalGroup justify="flex-end"> |
|
|
|
<HorizontalGroup justify="flex-end"> |
|
|
|
<Button size="sm" onClick={() => onMigrate(key)}> |
|
|
|
<Button size="sm" onClick={() => onMigrate(key)}> |
|
|
@ -69,6 +71,13 @@ export const ApiKeysTable: FC<Props> = ({ apiKeys, timeZone, onDelete, onMigrate |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function formatLastUsedAtDate(timeZone: TimeZone, lastUsedAt?: string): string { |
|
|
|
|
|
|
|
if (!lastUsedAt) { |
|
|
|
|
|
|
|
return 'Never'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return dateTimeFormat(lastUsedAt, { timeZone }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function formatDate(expiration: string | undefined, timeZone: TimeZone): string { |
|
|
|
function formatDate(expiration: string | undefined, timeZone: TimeZone): string { |
|
|
|
if (!expiration) { |
|
|
|
if (!expiration) { |
|
|
|
return 'No expiration date'; |
|
|
|
return 'No expiration date'; |
|
|
|