Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

fix: minor fixes (#104)

Aman Agarwal49b9f4b48b8f
diff --git a/src/client/public/images/doku-logo-with-name-black.png b/src/client/public/images/doku-logo-with-name-black.png
new file mode 100644
index 00000000..4de6c082
Binary files /dev/null and b/src/client/public/images/doku-logo-with-name-black.png differ
diff --git a/src/client/src/app/(auth)/auth-form.tsx b/src/client/src/app/(auth)/auth-form.tsx
index 168e25ad..09b465b7 100644
--- a/src/client/src/app/(auth)/auth-form.tsx
+++ b/src/client/src/app/(auth)/auth-form.tsx
@@ -72,7 +72,7 @@ export function AuthForm({ type }: { type: "login" | "register" }) {
return (
<div className="flex min-h-screen items-center justify-center bg-secondary p-8">
- <div className="z-10 w-full max-w-md overflow-hidden rounded bg-tertiary text-secondary">
+ <div className="z-10 w-full max-w-md overflow-hidden rounded-xl bg-tertiary text-secondary">
<div className="flex flex-col items-center justify-center space-y-3 px-4 py-6 pt-8 text-center">
<Image
alt="doku"
diff --git a/src/client/src/app/(playground)/requests/request-details.tsx b/src/client/src/app/(playground)/requests/request-details.tsx
index 6e10d19b..38a6bb1e 100644
--- a/src/client/src/app/(playground)/requests/request-details.tsx
+++ b/src/client/src/app/(playground)/requests/request-details.tsx
@@ -18,6 +18,7 @@ import { useRequest } from "@/app/(playground)/requests/request-context";
import Image from "next/image";
import { round } from "lodash";
import { format } from "date-fns";
+import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/solid";
export default function RequestDetails() {
const [request, updateRequest] = useRequest();
@@ -114,14 +115,14 @@ export default function RequestDetails() {
<span>Usage cost : </span>
<span>{round(request.usageCost, 6)}</span>
</div>
- {request.promptTokens && (
+ {request.promptTokens > 0 && (
<div className="flex items-center justify-center space-x-1 px-3 py-1 rounded-full text-xs bg-primary/[0.1] text-primary font-medium">
<ClipboardDocumentCheckIcon className="w-3" />
<span>Prompt tokens : </span>
<span>{request.promptTokens}</span>
</div>
)}
- {request.totalTokens && (
+ {request.totalTokens > 0 && (
<div className="flex items-center justify-center space-x-1 px-3 py-1 rounded-full text-xs bg-primary/[0.1] text-primary font-medium">
<ClipboardDocumentListIcon className="w-3" />
<span>Total tokens : </span>
@@ -182,7 +183,11 @@ export default function RequestDetails() {
</div>
)}
{request.image && request.imageSize && (
- <div className="flex items-center justify-center aspect-h-1 aspect-w-1 w-full overflow-hidden rounded-md bg-tertiary/[0.1] lg:aspect-none group-hover:opacity-75 lg:h-80 mt-4">
+ <a
+ href={request.image}
+ target="_blank"
+ className="flex items-center justify-center aspect-h-1 aspect-w-1 w-full overflow-hidden rounded-md bg-secondary/[0.3] lg:aspect-none lg:h-80 mt-4 group relative p-4 text-center text-tertiary/[0.5]"
+ >
<Image
src={request.image}
alt={request.applicationName}
@@ -196,7 +201,10 @@ export default function RequestDetails() {
10
)}
/>
- </div>
+ <span className="flex items-center justify-center opacity-0 group-hover:opacity-100 absolute top-0 left-0 w-full h-full text-primary bg-primary/[0.1]">
+ <ArrowTopRightOnSquareIcon className="w-6 h-6 ml-2 shrink-0" />
+ </span>
+ </a>
)}
</div>
</div>
diff --git a/src/client/src/app/(playground)/requests/request-filter.tsx b/src/client/src/app/(playground)/requests/request-filter.tsx
index a98cace7..a385036b 100644
--- a/src/client/src/app/(playground)/requests/request-filter.tsx
+++ b/src/client/src/app/(playground)/requests/request-filter.tsx
@@ -5,9 +5,9 @@ import { ceil } from "lodash";
export type FilterConfigProps = {
endpoints: string[];
- maxusagecost: number;
+ maxUsageCost: number;
models: string[];
- totalrows: number;
+ totalRows: number;
};
export default function RequestFilter({
@@ -32,7 +32,7 @@ export default function RequestFilter({
<Pagination
currentPage={filter.offset / filter.limit + 1}
currentSize={filter.limit}
- totalPage={ceil((config.totalrows || 0) / filter.limit)}
+ totalPage={ceil((config.totalRows || 0) / filter.limit)}
onClickPageAction={onClickPageAction}
onClickPageLimit={onClickPageLimit}
/>
diff --git a/src/client/src/app/(playground)/settings/profile.tsx b/src/client/src/app/(playground)/settings/profile.tsx
index 92cde209..1145b80d 100644
--- a/src/client/src/app/(playground)/settings/profile.tsx
+++ b/src/client/src/app/(playground)/settings/profile.tsx
@@ -12,27 +12,15 @@ import toast from "react-hot-toast";
const PROFILE_TOAST_ID = "profile-details";
-function ModifyProfileDetails() {
- const { data: user, fireRequest: getUser } = useFetchWrapper();
+function ModifyProfileDetails({
+ user,
+ fetchUser,
+}: {
+ user: User | null;
+ fetchUser: () => void;
+}) {
const { fireRequest, isLoading } = useFetchWrapper();
- const fetchUser = () => {
- getUser({
- requestType: "GET",
- url: "/api/user/profile",
- responseDataKey: "data",
- failureCb: (err?: string) => {
- toast.error(err || "Unauthorized access!", {
- id: PROFILE_TOAST_ID,
- });
- },
- });
- };
-
- useEffect(() => {
- fetchUser();
- }, []);
-
const modifyDetails: FormEventHandler<HTMLFormElement> = (event) => {
event.preventDefault();
const formElement = event.target as HTMLFormElement;
@@ -76,8 +64,6 @@ function ModifyProfileDetails() {
});
};
- const updatedUser = user as User;
-
return (
<FormBuilder
fields={[
@@ -86,29 +72,29 @@ function ModifyProfileDetails() {
type: "text",
name: "name",
placeholder: "db-config",
- defaultValue: updatedUser?.name || "",
- inputKey: `${updatedUser?.id}-name`,
+ defaultValue: user?.name || "",
+ inputKey: `${user?.id}-name`,
},
{
label: "Current Password",
type: "password",
name: "currentPassword",
placeholder: "*******",
- inputKey: `${updatedUser?.id}-currentPassword`,
+ inputKey: `${user?.id}-currentPassword`,
},
{
label: "New Password",
type: "password",
name: "newPassword",
placeholder: "*******",
- inputKey: `${updatedUser?.id}-newPassword`,
+ inputKey: `${user?.id}-newPassword`,
},
{
label: "Confirm New Password",
type: "password",
name: "confirmNewPassword",
placeholder: "*******",
- inputKey: `${updatedUser?.id}-confirmNewPassword`,
+ inputKey: `${user?.id}-confirmNewPassword`,
},
]}
heading={`Update profile details`}
@@ -120,6 +106,21 @@ function ModifyProfileDetails() {
}
export default function Profile() {
+ const { data: user, fireRequest: getUser } = useFetchWrapper();
+
+ const fetchUser = () => {
+ getUser({
+ requestType: "GET",
+ url: "/api/user/profile",
+ responseDataKey: "data",
+ failureCb: (err?: string) => {
+ toast.error(err || "Unauthorized access!", {
+ id: PROFILE_TOAST_ID,
+ });
+ },
+ });
+ };
+
const items: SideTabItemProps[] = [
{
id: "details",
@@ -136,15 +137,25 @@ export default function Profile() {
setSelectedTabId(itemId);
};
+ useEffect(() => {
+ fetchUser();
+ }, []);
+
+ const updatedItems = items.map((item) =>
+ item.id === "details" ? { ...item, badge: (user as User)?.email } : item
+ );
+
return (
<div className="flex flex-1 h-full border-t border-secondary relative">
<SideTabs
- items={items}
+ items={updatedItems}
onClickTab={onClickDB}
selectedTabId={selectedTabId}
/>
<div className="flex flex-1 w-full h-full">
- {selectedTabId === "details" ? <ModifyProfileDetails /> : null}
+ {selectedTabId === "details" ? (
+ <ModifyProfileDetails user={user as User} fetchUser={fetchUser} />
+ ) : null}
</div>
</div>
);
diff --git a/src/client/src/components/(landing-page)/components/footer.tsx b/src/client/src/components/(landing-page)/components/footer.tsx
index 5b8782a0..df73e4ba 100644
--- a/src/client/src/components/(landing-page)/components/footer.tsx
+++ b/src/client/src/components/(landing-page)/components/footer.tsx
@@ -10,7 +10,7 @@ export default function Footer() {
<Image
alt="doku"
className="w-40"
- src="/images/doku-logo-with-name.png"
+ src="/images/doku-logo-with-name-black.png"
width={836}
height={298}
/>
@@ -40,29 +40,6 @@ export default function Footer() {
</li>
</ul>
</div>
- <div>
- <h2 className="mb-6 text-sm font-semibold text-tertiary dark:text-white">
- Follow us
- </h2>
- <ul className="text-sm">
- <li className="mb-3">
- <a
- href="https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA"
- className="hover:text-primary text-tertiary"
- >
- Slack
- </a>
- </li>
- <li>
- <a
- href="https://twitter.com/doku_labs"
- className="hover:text-primary text-tertiary"
- >
- X
- </a>
- </li>
- </ul>
- </div>
</div>
</div>
<hr className="my-6 border-primary/[0.2] sm:mx-auto lg:my-8" />
@@ -75,9 +52,37 @@ export default function Footer() {
. All Rights Reserved.
</span>
<div className="flex mt-4 sm:justify-center sm:mt-0 justify-center md:justify-end">
+ <a
+ href="https://join.slack.com/t/dokulabs/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ"
+ className="text-tertiary hover:text-tertiary dark:hover:text-white ms-5"
+ target="_blank"
+ >
+ <svg viewBox="0 0 2447.6 2452.5" className="w-4 h-4">
+ <g clipRule="evenodd" fillRule="evenodd">
+ <path
+ d="m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z"
+ fill="#36c5f0"
+ />
+ <path
+ d="m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z"
+ fill="#2eb67d"
+ />
+ <path
+ d="m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z"
+ fill="#ecb22e"
+ />
+ <path
+ d="m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0"
+ fill="#e01e5a"
+ />
+ </g>
+ </svg>
+ <span className="sr-only">Slack page</span>
+ </a>
<a
href="https://twitter.com/doku_labs"
className="text-tertiary hover:text-tertiary dark:hover:text-white ms-5"
+ target="_blank"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -95,6 +100,7 @@ export default function Footer() {
<a
href="https://github.com/dokulabs"
className="text-tertiary hover:text-tertiary dark:hover:text-white ms-5"
+ target="_blank"
>
<svg
className="w-4 h-4"
diff --git a/src/client/src/components/(landing-page)/components/navbar.tsx b/src/client/src/components/(landing-page)/components/navbar.tsx
index 8613fa65..41bb8142 100644
--- a/src/client/src/components/(landing-page)/components/navbar.tsx
+++ b/src/client/src/components/(landing-page)/components/navbar.tsx
@@ -8,7 +8,7 @@ export default function Navbar() {
<Image
alt="doku"
className="w-24"
- src="/images/doku-logo-with-name.png"
+ src="/images/doku-logo-with-name-black.png"
width={836}
height={298}
/>
diff --git a/src/client/src/components/(playground)/sidebar.tsx b/src/client/src/components/(playground)/sidebar.tsx
index 477f6ffd..4278e3f1 100644
--- a/src/client/src/components/(playground)/sidebar.tsx
+++ b/src/client/src/components/(playground)/sidebar.tsx
@@ -3,6 +3,7 @@
import { ReactElement } from "react";
import {
AcademicCapIcon,
+ ArrowTopRightOnSquareIcon,
CircleStackIcon,
HomeModernIcon,
KeyIcon,
@@ -13,11 +14,12 @@ import { WrenchScrewdriverIcon } from "@heroicons/react/24/outline";
type SidebarItemProps = {
className?: string;
- icon?: ReactElement;
+ leftIcon?: ReactElement;
text: string;
link?: string;
onClick?: any;
target?: string;
+ rightIcon?: ReactElement;
};
const ICON_CLASSES =
@@ -25,27 +27,27 @@ const ICON_CLASSES =
const SIDEBAR_ITEMS: SidebarItemProps[] = [
{
- icon: <AcademicCapIcon className={ICON_CLASSES} />,
+ leftIcon: <AcademicCapIcon className={ICON_CLASSES} />,
text: "Getting started",
link: "/getting-started",
},
{
- icon: <HomeModernIcon className={ICON_CLASSES} />,
+ leftIcon: <HomeModernIcon className={ICON_CLASSES} />,
text: "Dashboard",
link: "/dashboard",
},
{
- icon: <CircleStackIcon className={ICON_CLASSES} />,
+ leftIcon: <CircleStackIcon className={ICON_CLASSES} />,
text: "Requests",
link: "/requests",
},
{
- icon: <KeyIcon className={ICON_CLASSES} />,
+ leftIcon: <KeyIcon className={ICON_CLASSES} />,
text: "API keys",
link: "/api-keys",
},
{
- icon: <WrenchScrewdriverIcon className={ICON_CLASSES} />,
+ leftIcon: <WrenchScrewdriverIcon className={ICON_CLASSES} />,
text: "Settings",
link: "/settings",
},
@@ -56,7 +58,14 @@ const SIDEBAR_BOTTOM_ITEMS: SidebarItemProps[] = [
text: "Documentation",
link: "https://docs.dokulabs.com/",
target: "_blank",
- className: "justify-center text-sm text-primary hover:bg-primary/[0.1]"
+ className: "justify-center text-sm text-primary hover:bg-primary/[0.1]",
+ rightIcon: (
+ <ArrowTopRightOnSquareIcon
+ className={
+ "flex-shrink-0 w-3 h-3 transition duration-75 transition duration-75 ml-3"
+ }
+ />
+ ),
},
];
@@ -64,16 +73,17 @@ const SidebarItem = (props: SidebarItemProps) => {
return (
<a
href={props.link}
- className={`flex items-center p-2 text-base cursor-pointer ${
+ className={`flex items-center p-2 cursor-pointer ${
props.className || ""
}`}
onClick={props.onClick}
target={props.target}
>
- {props.icon}
- <span className={`${props.icon && "ml-5"} text-nowrap`}>
+ {props.leftIcon}
+ <span className={`${props.leftIcon && "ml-5"} text-nowrap`}>
{props.text}
</span>
+ {props.rightIcon}
</a>
);
};
@@ -89,11 +99,11 @@ export default function Sidebar() {
<div className="relative flex flex-col flex-1 min-h-0 gap-2">
<div className="flex shrink-0 pt-2 relative items-center">
<SidebarItem
- className="w-full text-tertiary font-bold"
+ className="w-full text-tertiary font-bold text-2xl"
link="/"
- icon={
+ leftIcon={
<Image
- className="flex-shrink-0 w-8 h-8 transition duration-75 -mr-2"
+ className="flex-shrink-0 w-10 h-10 transition duration-75"
src="/images/logo.png"
alt="Doku's Logo"
priority