Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a5d3dfa
workspace nav changes
MichaelUnkey Apr 11, 2025
069ca79
Merge branch 'main' into workspace-settings
MichaelUnkey Apr 14, 2025
0b40599
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 14, 2025
ee20fe9
vercel comments
MichaelUnkey Apr 15, 2025
b98b96e
test
MichaelUnkey Apr 15, 2025
391f231
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 15, 2025
e040cfa
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 15, 2025
31f0eb5
saved
MichaelUnkey Apr 16, 2025
bd732d7
Merge branch 'workspace-settings' of https://github.com/unkeyed/unkey…
MichaelUnkey Apr 16, 2025
a39ba6d
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 16, 2025
bbd353c
responsive bits
MichaelUnkey Apr 16, 2025
ab6029b
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 16, 2025
013210d
vercel comment changes
MichaelUnkey Apr 16, 2025
945bff1
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 16, 2025
0c4d23b
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 17, 2025
842480b
more pull items
MichaelUnkey Apr 17, 2025
78dc451
card width
MichaelUnkey Apr 17, 2025
f440ee4
remove www and play
MichaelUnkey Apr 17, 2025
21b374f
Update apps/dashboard/components/ui/input.tsx
MichaelUnkey Apr 17, 2025
9a361a3
Update apps/dashboard/app/(app)/settings/workspace-navbar.tsx
MichaelUnkey Apr 17, 2025
4dc97b5
rabbit
MichaelUnkey Apr 17, 2025
dcc91f3
Merge branch 'main' into workspace-settings
MichaelUnkey Apr 18, 2025
352bac1
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 18, 2025
be77e48
fix nav issue
MichaelUnkey Apr 18, 2025
2d2454d
Merge branch 'workspace-settings' of https://github.com/unkeyed/unkey…
MichaelUnkey Apr 18, 2025
10465a5
Merge branch 'main' into workspace-settings
ogzhanolguncu Apr 22, 2025
3d8f545
button loading fix
MichaelUnkey Apr 22, 2025
f3c6f41
button changes
MichaelUnkey Apr 23, 2025
43c8c14
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 24, 2025
0c601e8
Merge branch 'main' into workspace-settings
MichaelUnkey Apr 25, 2025
f6b8079
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 25, 2025
a3939a3
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 25, 2025
798a639
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 25, 2025
a87cb58
remove button styles
MichaelUnkey Apr 25, 2025
6b5b0ae
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 25, 2025
cfc88de
loading state broken by lack of asyunc/await
MichaelUnkey Apr 25, 2025
bb2b149
[autofix.ci] apply automated fixes
autofix-ci[bot] Apr 25, 2025
80e1be9
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 25, 2025
77db9e8
Merge branch 'workspace-settings' of https://github.com/unkeyed/unkey…
MichaelUnkey Apr 25, 2025
9c0703a
Merge branch 'main' into workspace-settings
MichaelUnkey Apr 25, 2025
47ac19e
Merge branch 'main' into workspace-settings
MichaelUnkey Apr 28, 2025
c1c40d0
fix imports bad merge
MichaelUnkey Apr 28, 2025
37ed258
removed pageContent comp
MichaelUnkey Apr 28, 2025
ab1fd9d
pr comment changes
MichaelUnkey Apr 28, 2025
98b1f06
nav fix
MichaelUnkey Apr 28, 2025
200a683
matching padding
MichaelUnkey Apr 28, 2025
194e9f9
Change input
MichaelUnkey Apr 28, 2025
f248c94
Merge branch 'main' of https://github.com/unkeyed/unkey into workspac…
MichaelUnkey Apr 29, 2025
d67c679
rework styles
MichaelUnkey Apr 29, 2025
127dd7c
comment
MichaelUnkey Apr 29, 2025
3fa9b00
Merge branch 'main' into workspace-settings
MichaelUnkey Apr 30, 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
@@ -1,43 +1,38 @@
import { toast } from "@/components/ui/toaster";
import { Clone } from "@unkey/icons";
import { SettingCard } from "@unkey/ui";
import { Input } from "@unkey/ui";
import { Input, SettingCard } from "@unkey/ui";

export const CopyApiId = ({ apiId }: { apiId: string }) => {
return (
<SettingCard
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">API ID</span>
</div>
}
title={"API ID"}
description={
<div className="font-normal text-[13px] max-w-[380px]">
An identifier for the API, used in some API calls.
</div>
<div className="max-w-[380px]">An identifier for the API, used in some API calls.</div>
}
border="bottom"
contentWidth="w-full lg:w-[320px]"
contentWidth="w-full lg:w-[320px] justify-end items-end"
>
<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>
}
/>
<div className="flex flex-row justify-end items-center gap-x-2 mt-1">
<Input
className="min-w-[315px] 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" />
</button>
}
/>
</div>
</SettingCard>
);
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use client";
import { Form, FormControl, FormField, FormItem, FormMessage } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { SettingCard } from "@unkey/ui";
import { Button } from "@unkey/ui";
import { Button, Input, SettingCard } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down Expand Up @@ -64,20 +62,17 @@ export const DefaultBytes: React.FC<Props> = ({ keyAuth }) => {
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<SettingCard
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">Default Bytes</span>
</div>
}
title={"Default Bytes"}
description={
<div className="font-normal text-[13px] max-w-[380px]">
<div className="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]"
className="border-b-1"
contentWidth="w-full lg:w-[320px] h-full"
>
<div className="flex flex-row justify-items-stretch items-center w-full gap-x-2">
<div className="flex flex-row justify-end items-center w-full gap-x-2 mt-2">
<input type="hidden" name="keyAuthId" value={keyAuth.id} />
<label htmlFor="defaultBytes" className="hidden sr-only">
Default Bytes
Expand All @@ -90,7 +85,7 @@ export const DefaultBytes: React.FC<Props> = ({ keyAuth }) => {
<FormControl>
<Input
id="defaultBytes"
className="w-[20rem] lg:w-[16rem] h-9"
className="w-[16rem]"
{...field}
autoComplete="off"
onChange={(e) => field.onChange(Number(e.target.value.replace(/\D/g, "")))}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use client";
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";
import { zodResolver } from "@hookform/resolvers/zod";
import { SettingCard } from "@unkey/ui";
import { Button } from "@unkey/ui";
import { Button, Input, SettingCard } from "@unkey/ui";
import { useRouter } from "next/navigation";
import { useForm } from "react-hook-form";
import { z } from "zod";
Expand Down Expand Up @@ -64,20 +62,17 @@ export const DefaultPrefix: React.FC<Props> = ({ keyAuth }) => {
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<SettingCard
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">Default Prefix</span>
</div>
}
title={"Default Prefix"}
description={
<div className="font-normal text-[13px] max-w-[380px]">
<div className="max-w-[380px]">
Sets the default prefix for keys under this API. A trailing underscore is added
automatically.
</div>
}
border="bottom"
contentWidth="w-full lg:w-[320px] h-full"
>
<div className="flex flex-row justify-items-stretch items-center w-full gap-x-2">
<div className="flex flex-row justify-end items-center w-full gap-x-2 mt-2">
<input type="hidden" name="keyAuthId" value={keyAuth.id} />
<label htmlFor="defaultPrefix" className="hidden sr-only">
Default Prefix
Expand All @@ -90,7 +85,7 @@ export const DefaultPrefix: React.FC<Props> = ({ keyAuth }) => {
<FormControl>
<Input
id="defaultPrefix"
className="w-[20rem] lg:w-[16rem] h-9"
className="w-[16rem]"
{...field}
autoComplete="off"
onBlur={(e) => {
Expand All @@ -104,7 +99,6 @@ export const DefaultPrefix: React.FC<Props> = ({ keyAuth }) => {
)}
/>
<Button
className="items-end"
variant="primary"
size="lg"
disabled={
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"use client";
import { DialogContainer } from "@/components/dialog-container";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { formatNumber } from "@/lib/fmt";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { Lock } from "@unkey/icons";
import { SettingCard } from "@unkey/ui";
import { Button } from "@unkey/ui";
import { Button, Input, SettingCard } from "@unkey/ui";
import { useRouter } from "next/navigation";
import type React from "react";
import { useState } from "react";
Expand Down Expand Up @@ -78,8 +76,8 @@ export const DeleteApi: React.FC<Props> = ({ api, keys }) => {
<div>
<SettingCard
title={
<div className=" flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">Delete API</span>
<div className="inline-flex gap-2">
<span>Delete API </span>
{api.deleteProtection && (
<StatusBadge variant={"locked"} text={"Locked"} icon={<Lock size="sm-thin" />} />
)}
Expand All @@ -105,9 +103,8 @@ export const DeleteApi: React.FC<Props> = ({ api, keys }) => {
border="bottom"
contentWidth="w-full lg:w-[320px]"
>
<div className="w-full flex justify-end">
<div className="w-full flex justify-end lg:mt-4">
<Button
className="w-fit rounded-lg"
variant="outline"
color="danger"
size="lg"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"use client";
import { DialogContainer } from "@/components/dialog-container";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { ArrowUpRight, TriangleWarning2 } from "@unkey/icons";
import { InlineLink, SettingCard } from "@unkey/ui";
import { InlineLink, Input, SettingCard } from "@unkey/ui";
import { Button } from "@unkey/ui";
import { useRouter } from "next/navigation";
import type React from "react";
Expand Down Expand Up @@ -78,8 +77,8 @@ export const DeleteProtection: React.FC<Props> = ({ api }) => {
return (
<SettingCard
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">Delete Protection</span>{" "}
<div className="inline-flex gap-2">
<span>Delete Protection</span>{" "}
<StatusBadge
variant={api.deleteProtection ? "enabled" : "disabled"}
text={api.deleteProtection ? "Enabled" : "Disabled"}
Expand All @@ -89,26 +88,22 @@ export const DeleteProtection: React.FC<Props> = ({ api }) => {
}
description={
api.deleteProtection ? (
<div className="font-normal text-[13px] max-w-[380px]">
Disabling this allows the API, along with all keys and data, to be deleted.
</div>
<div>Disabling this allows the API, along with all keys and data, to be deleted.</div>
) : (
<div className="font-normal text-[13px] max-w-[380px]">
Enabling this prevents the API from being deleted.
</div>
<div>Enabling this prevents the API from being deleted.</div>
)
}
border="top"
className="border-b-1"
contentWidth="w-full lg:w-[320px]"
>
<div className="flex w-full gap-2 lg:items-center lg:justify-end">
<div className="flex w-full gap-2 lg:items-center justify-end lg:mt-1">
{api.deleteProtection ? (
<Button
type="button"
variant="outline"
color="warning"
size="xlg"
className="w-[24rem] lg:w-[12rem]"
onClick={() => setOpen(true)}
>
Disable Delete Protection
Expand All @@ -119,7 +114,6 @@ export const DeleteProtection: React.FC<Props> = ({ api }) => {
variant="outline"
color="success"
size="xlg"
className="w-[24rem] lg:w-[12rem]"
onClick={() => setOpen(true)}
>
Enable Delete Protection
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
import { Separator } from "@/components/ui/separator";
import type { Api, KeyAuth, Workspace } from "@unkey/db";
import { CopyApiId } from "./copy-api-id";
import { DefaultBytes } from "./default-bytes";
Expand All @@ -18,28 +17,25 @@ type Props = {
export const SettingsClient = ({ api, workspace, keyAuth }: Props) => {
return (
<>
<div className="flex items-center justify-center w-full py-3 ">
<div className="lg:w-[760px] flex-col justify-center items-center">
<div className="w-full text-accent-12 font-semibold text-lg pt-[22px] pb-[20px] text-left border-b border-gray-4 px-2">
<div className="py-3 w-full flex items-center justify-center">
<div className="w-[760px] flex flex-col justify-center items-center gap-5 mx-6">
<div className="w-full text-accent-12 font-semibold text-lg py-6 text-left border-b border-gray-4">
API Settings
</div>
<div className="flex flex-col gap-6 mt-6">
<div className="flex flex-col w-full gap-6">
<div>
<UpdateApiName api={api} />
<Separator className="bg-gray-4" orientation="horizontal" />
<CopyApiId apiId={api.id} />
</div>
<div>
<DefaultBytes keyAuth={keyAuth} />
<Separator className="bg-gray-4" orientation="horizontal" />
<DefaultPrefix keyAuth={keyAuth} />
</div>
<div>
<UpdateIpWhitelist api={api} workspace={workspace} />
</div>
<div>
<DeleteProtection api={api} />
<Separator className="bg-gray-4" orientation="horizontal" />
<DeleteApi api={api} keys={keyAuth.sizeApprox} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"use client";
import { Form, FormControl, FormField, FormItem } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { toast } from "@/components/ui/toaster";
import { tags } from "@/lib/cache";
import { trpc } from "@/lib/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { SettingCard } from "@unkey/ui";
import { Button } from "@unkey/ui";
import { Button, Input, SettingCard } from "@unkey/ui";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { revalidateTag } from "../../../../../actions";
Expand Down Expand Up @@ -72,20 +70,13 @@ export const UpdateApiName: React.FC<Props> = ({ api }) => {
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<SettingCard
title={
<div className="flex items-center justify-start gap-2.5">
<span className="text-sm font-medium text-accent-12">API Name</span>
</div>
}
description={
<div className="font-normal text-[13px] max-w-[380px]">
Not customer-facing. Choose a name that is easy to recognize.
</div>
}
title={"API Name"}
description={"Not customer-facing. Choose a name that is easy to recognize."}
border="top"
contentWidth="w-full lg:w-[320px]"
className="border-b-1"
contentWidth="w-full lg:w-[320px] h-full"
>
<div className="flex flex-row justify-items-stretch items-center w-full gap-x-2">
<div className="flex flex-row justify-end items-center w-full gap-x-2 mt-2">
<input type="hidden" name="workspaceId" value={api.workspaceId} />
<input type="hidden" name="apiId" value={api.id} />
<label htmlFor="apiName" className="hidden sr-only">
Expand All @@ -100,7 +91,7 @@ export const UpdateApiName: React.FC<Props> = ({ api }) => {
<Input
type="text"
id="apiName"
className="w-[20rem] lg:w-[16rem] h-9"
className="min-w-[16rem]"
{...field}
autoComplete="off"
onBlur={(e) => {
Expand All @@ -115,7 +106,6 @@ export const UpdateApiName: React.FC<Props> = ({ api }) => {
/>
<Button
size="lg"
className="items-end"
variant="primary"
disabled={
!form.formState.isValid ||
Expand Down
Loading
Loading