feat: Add lastUsedAt to API keys (#7082)
* feat: Add lastUsedAt to API keys * rename column to lastActiveAt * switch order
This commit is contained in:
@@ -24,6 +24,12 @@ class ApiKey extends Model {
|
||||
@observable
|
||||
expiresAt?: string;
|
||||
|
||||
/**
|
||||
* An optional datetime that the API key was last used at.
|
||||
*/
|
||||
@observable
|
||||
lastActiveAt?: string;
|
||||
|
||||
secret: string;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,12 @@ const ApiKeyListItem = ({ apiKey, isCopied, onCopy }: Props) => {
|
||||
<Text type="tertiary">
|
||||
{t(`Created`)} <Time dateTime={apiKey.createdAt} addSuffix /> ·{" "}
|
||||
</Text>
|
||||
{apiKey.lastActiveAt && (
|
||||
<Text type={"tertiary"}>
|
||||
{t("Last used")} <Time dateTime={apiKey.lastActiveAt} addSuffix />{" "}
|
||||
·{" "}
|
||||
</Text>
|
||||
)}
|
||||
<Text type={apiKey.isExpired ? "danger" : "tertiary"}>
|
||||
{apiKey.expiresAt
|
||||
? dateToExpiry(apiKey.expiresAt, t, userLocale)
|
||||
|
||||
Reference in New Issue
Block a user