update: dev keys state for expiry.

This commit is contained in:
Darshan committed 2025-05-15 18:57:18 +05:30
1 parent 57e4bff99b
commit 3247a53ffc
4 files changed
+9 -17

No files matched your search

@@ -184,7 +184,7 @@
<CardGrid>
<svelte:fragment slot="title">Delete {label} key</svelte:fragment>
The Dev key will be permanently deleted. This action is irreversible.
The {label} key will be permanently deleted. This action is irreversible.
<svelte:fragment slot="aside">
<Box>
<div class="u-flex u-gap-16">
@@ -34,8 +34,8 @@
const isExpiring = key.expire && diffDays(new Date(), new Date(key.expire)) < 14;
return {
status: isExpired ? 'error' : isExpiring ? 'warning' : null,
message: isExpired ? 'Expired' : isExpiring ? 'Expires soon' : null
message: isExpired ? 'Expired' : isExpiring ? 'Expires soon' : null,
status: isExpired ? (isApiKey ? 'error' : 'warning') : isExpiring ? 'warning' : null
};
}
@@ -48,7 +48,7 @@
if (isApiKey)
return 'Use API keys to authenticate your app’s requests in production, granting secure access to live data and services.';
else
return 'Dev keys allow bypassing rate limits and accessing more detailed error messages while in development.';
return 'Dev keys allow bypassing rate limits and CORS errors in your development environment.';
}
const columns = isApiKey ? $keyColumns : $devKeyColumns;
@@ -75,20 +75,12 @@
<svelte:fragment slot="title">Expiration date</svelte:fragment>
Set a date after which your {label} key will expire.
<svelte:fragment slot="aside">
{#if isExpired}
{#if isExpired || isExpiring}
<Alert.Inline
status="error"
status={isExpired && isApiKey ? 'error' : 'warning'}
on:dismiss={() => (alertsDismissed = true)}
title="Your {label} key has expired">
For security reasons, we recommend you delete your expired key and create a new
one.
</Alert.Inline>
{:else if isExpiring}
<Alert.Inline
status="warning"
on:dismiss={() => (alertsDismissed = true)}
title="Your {label} key is about to expire">
Update the expiration date to keep the key active
title={`Your ${label} key ${isExpired ? 'has expired' : 'is about to expire'}`}>
Update the expiration date to keep the key active{isExpired ? '.' : ''}
</Alert.Inline>
{/if}
<ExpirationInput bind:value={expiration} {expiryOptions} />
@@ -58,7 +58,7 @@
<Form onSubmit={create} isModal>
<Modal title="Create dev key" bind:open={$showDevKeysCreateModal}>
<span slot="description">
Test your app without rate limits and more detailed error messages.
Bypass Appwrite rate limits and CORS errors in your development environment.
</span>
<Layout.Stack>