Skip to content
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b71756f
api settings page changes
MichaelUnkey Apr 2, 2025
9d27f0f
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 2, 2025
4a76ce0
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Apr 2, 2025
dbbaa5e
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 2, 2025
7d3d1cd
[autofix.ci] apply automated fixes (attempt 3/3)
autofix-ci[bot] Apr 2, 2025
faf5349
Merge branch 'new-ratelimit-settings-page' of https://github.com/unke…
MichaelUnkey Apr 2, 2025
4870fc8
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 2, 2025
71dc68f
fixed failing test
MichaelUnkey Apr 2, 2025
2ed3568
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 2, 2025
07c0006
rabbit suggetions
MichaelUnkey Apr 2, 2025
25a7e1a
Merge branch 'main' into new-ratelimit-settings-page
MichaelUnkey Apr 3, 2025
e5dbd0c
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 3, 2025
9a3b684
add link to James cal link
MichaelUnkey Apr 3, 2025
9800c4a
Merge branch 'new-ratelimit-settings-page' of https://github.com/unke…
MichaelUnkey Apr 3, 2025
79da2db
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 3, 2025
bfc8c81
Merge branch 'main' into new-ratelimit-settings-page
MichaelUnkey Apr 10, 2025
831d1dd
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 10, 2025
e290729
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 10, 2025
531124a
Merge branch 'new-ratelimit-settings-page' of https://github.com/unke…
MichaelUnkey Apr 10, 2025
988f512
pnpm i
MichaelUnkey Apr 10, 2025
826c5e7
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 10, 2025
a2ca5a1
changes from meeting notes
MichaelUnkey Apr 10, 2025
4ab28c5
Merge branch 'new-ratelimit-settings-page' of https://github.com/unke…
MichaelUnkey Apr 10, 2025
a147006
fix ai fix
MichaelUnkey Apr 10, 2025
ae7665b
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 10, 2025
0587153
Merge branch 'main' into new-ratelimit-settings-page
MichaelUnkey Apr 10, 2025
65611a2
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 14, 2025
4d53324
lock file
MichaelUnkey Apr 14, 2025
63b7323
icon color
MichaelUnkey Apr 14, 2025
4754f33
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 14, 2025
eccffe4
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Apr 14, 2025
7e1ee1c
[autofix.ci] apply automated fixes (attempt 3/3)
autofix-ci[bot] Apr 14, 2025
8a4dfe4
Merge branch 'main' into new-ratelimit-settings-page
MichaelUnkey Apr 15, 2025
cbfd8a6
styles
MichaelUnkey Apr 15, 2025
6079af2
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 16, 2025
84a71c8
style changes
MichaelUnkey Apr 16, 2025
032fd2d
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 17, 2025
1e2ecc2
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 22, 2025
ed48693
vercel comment changes
MichaelUnkey Apr 22, 2025
8b6cd53
wording
MichaelUnkey Apr 22, 2025
da2d376
button loading
MichaelUnkey Apr 22, 2025
0a669f9
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 22, 2025
026d825
link to docs
MichaelUnkey Apr 22, 2025
92f08c6
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 23, 2025
ea566d5
style changes
MichaelUnkey Apr 23, 2025
bbc4203
Changes from meeting
MichaelUnkey Apr 23, 2025
1e51864
Button info color to UI package
MichaelUnkey Apr 23, 2025
dd8e5c9
design doc for info color
MichaelUnkey Apr 23, 2025
e0ab75a
Update internal/ui/src/components/button.tsx
MichaelUnkey Apr 23, 2025
bf2870b
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 24, 2025
6384eb7
comment revisions
MichaelUnkey Apr 24, 2025
b237242
Merge branch 'main' of https://github.com/unkeyed/unkey into new-rate…
MichaelUnkey Apr 24, 2025
620467d
Merge branch 'main' into new-ratelimit-settings-page
MichaelUnkey Apr 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { SettingCard } from "@/components/settings-card";
import { toast } from "@/components/ui/toaster";
import { Clone } from "@unkey/icons";
import { Input } from "@unkey/ui";

export const CopyApiId = ({ apiId }: { apiId: string }) => {
return (
<SettingCard
className="pt-8 pb-8 mx-0"
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">API ID</span>
</div>
}
description={
<div className="font-normal text-[13px] max-w-[380px]">
An identifier for the API, used in some API calls.
</div>
}
border="bottom"
contentWidth="w-full lg:w-[320px]"
>
<Input
className="w-full lg:w-[320px] focus:ring-0 focus:ring-offset-0"
readOnly
defaultValue={apiId}
placeholder="API ID"
rightIcon={
<button
type="button"
onClick={() => {
navigator.clipboard.writeText(apiId);
toast.success("Copied to clipboard", {
description: apiId,
});
}}
>
<Clone size="md-regular" className="text-accent-8" />
</button>
}
/>
</SettingCard>
);
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
"use client";
import { Loading } from "@/components/dashboard/loading";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { SettingCard } from "@/components/settings-card";
import { Form, FormControl, FormField, FormItem, FormMessage } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
Expand Down Expand Up @@ -71,50 +63,59 @@ export const DefaultBytes: React.FC<Props> = ({ keyAuth }) => {
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<Card>
<CardHeader>
<CardTitle>Default Bytes</CardTitle>
<CardDescription>
Set default Bytes for the keys under this API. Default byte size must be between{" "}
<span className="font-bold">8 to 255</span>
</CardDescription>
</CardHeader>
<CardContent>
<div className="flex flex-col space-y-2">
<input type="hidden" name="keyAuthId" value={keyAuth.id} />
<label htmlFor="defaultBytes" className="hidden sr-only">
Default Bytes
</label>
<FormField
control={form.control}
name="defaultBytes"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
id="defaultBytes"
className="max-w-sm"
{...field}
autoComplete="off"
onChange={(e) => field.onChange(Number(e.target.value.replace(/\D/g, "")))}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<SettingCard
className="mt-5 pt-[19px] pb-[20px]"
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">Default Bytes</span>
</div>
</CardContent>
<CardFooter className="justify-end">
}
description={
<div className="font-normal text-[13px] max-w-[380px]">
Sets the default byte size for keys under this API. Must be between 8 and 255.
</div>
}
border="top"
contentWidth="w-full lg:w-[320px]"
>
<div className="flex flex-row justify-items-stretch items-center w-full gap-x-2">
<input type="hidden" name="keyAuthId" value={keyAuth.id} />
<label htmlFor="defaultBytes" className="hidden sr-only">
Default Bytes
</label>
<FormField
control={form.control}
name="defaultBytes"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
id="defaultBytes"
className="w-[20rem] lg:w-[16rem] h-9"
{...field}
autoComplete="off"
onChange={(e) => field.onChange(Number(e.target.value.replace(/\D/g, "")))}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>

<Button
Comment thread
MichaelUnkey marked this conversation as resolved.
variant="primary"
disabled={!form.formState.isValid || form.formState.isSubmitting}
size="lg"
className="rounded-lg px-2.5 items-end"
disabled={
!form.formState.isValid ||
form.formState.isSubmitting ||
keyAuth.defaultBytes === form.watch("defaultBytes")
}
type="submit"
>
{form.formState.isSubmitting ? <Loading /> : "Save"}
Save
</Button>
</CardFooter>
</Card>
</div>
</SettingCard>
</form>
</Form>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
"use client";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Form, FormControl, FormField, FormItem, FormMessage } from "@/components/ui/form";
import { SettingCard } from "@/components/settings-card";
import { Form, FormControl, FormField, FormItem } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
Expand Down Expand Up @@ -69,54 +62,63 @@ export const DefaultPrefix: React.FC<Props> = ({ keyAuth }) => {
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<Card>
<CardHeader>
<CardTitle>Default Prefix</CardTitle>
<CardDescription>
Set default prefix for the keys under this API. Don't add a trailing underscore, we'll
do that automatically
</CardDescription>
</CardHeader>
<CardContent>
<div className="flex flex-col space-y-2">
<input type="hidden" name="keyAuthId" value={keyAuth.id} />
<label htmlFor="defaultPrefix" className="hidden sr-only">
Default Prefix
</label>
<FormField
control={form.control}
name="defaultPrefix"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
id="defaultPrefix"
className="max-w-sm"
{...field}
onBlur={(e) => {
if (e.target.value === "") {
return;
}
}}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<SettingCard
className="py-5"
title={
<div className=" flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">Default Prefix</span>
</div>
</CardContent>
<CardFooter className="justify-end">
}
description={
<div className="font-normal text-[13px] max-w-[380px]">
Sets the default prefix for keys under this API. A trailing underscore is added
automatically.
</div>
}
border="bottom"
>
<div className="flex flex-row justify-items-stretch items-center w-full gap-x-2">
<input type="hidden" name="keyAuthId" value={keyAuth.id} />
<label htmlFor="defaultPrefix" className="hidden sr-only">
Default Prefix
</label>
<FormField
control={form.control}
name="defaultPrefix"
render={({ field }) => (
<FormItem>
<FormControl>
<Input
id="defaultPrefix"
className="w-[20rem] lg:w-[16rem] h-9"
{...field}
autoComplete="off"
onBlur={(e) => {
if (e.target.value === "") {
return;
}
}}
/>
</FormControl>
</FormItem>
)}
/>

<Button
variant="primary"
disabled={!form.formState.isValid || form.formState.isSubmitting}
className="rounded-lg px-2.5 items-end"
size="lg"
disabled={
!form.formState.isValid ||
form.formState.isSubmitting ||
keyAuth.defaultPrefix === form.getValues("defaultPrefix")
}
type="submit"
loading={form.formState.isSubmitting}
>
Save
</Button>
</CardFooter>
</Card>
</div>
</SettingCard>
</form>
</Form>
);
Expand Down
Loading