Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions scripts/test-requests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const endpoints = [
'/hello',
'/demo',
'/test',
'/message'
];

await Bun.sleep(5000);

let count = 0;
while (count < 10) {
const endpoint = endpoints[count % endpoints.length];
const response = await fetch(`http://localhost:8787${endpoint}`);
console.log(response);
await Bun.sleep(1000);
count++;
}
11 changes: 6 additions & 5 deletions src/components/AppSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ const items = [
identifier: "dashboard",
icon: LayoutDashboard,
},
// {
// title: "Requests",
// identifier: "requests",
// icon: Inbox,
// },
{
title: "Requests",
href: "/requests",
identifier: "requests",
icon: Inbox,
},
{
title: "D1",
href: "/d1",
Expand Down
46 changes: 46 additions & 0 deletions src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const badgeVariants = cva(
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
{
variants: {
variant: {
default:
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
secondary:
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
destructive:
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
},
},
defaultVariants: {
variant: "default",
},
}
)

function Badge({
className,
variant,
asChild = false,
...props
}: React.ComponentProps<"span"> &
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
const Comp = asChild ? Slot : "span"

return (
<Comp
data-slot="badge"
className={cn(badgeVariants({ variant }), className)}
{...props}
/>
)
}

export { Badge, badgeVariants }
150 changes: 121 additions & 29 deletions src/dist.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
--color-red-500: oklch(63.7% 0.237 25.331);
--color-orange-500: oklch(70.5% 0.213 47.604);
--color-orange-600: oklch(64.6% 0.222 41.116);
--color-yellow-500: oklch(79.5% 0.184 86.047);
--color-green-500: oklch(72.3% 0.219 149.579);
--color-blue-500: oklch(62.3% 0.214 259.815);
--color-gray-500: oklch(55.1% 0.027 264.364);
--color-black: #000;
--color-white: #fff;
--spacing: 0.25rem;
Expand Down Expand Up @@ -281,15 +286,15 @@
.mt-4 {
margin-top: calc(var(--spacing) * 4);
}
.mt-20 {
margin-top: calc(var(--spacing) * 20);
}
.mt-auto {
margin-top: auto;
}
.mr-auto {
margin-right: auto;
}
.mb-1 {
margin-bottom: calc(var(--spacing) * 1);
}
.mb-2 {
margin-bottom: calc(var(--spacing) * 2);
}
Expand Down Expand Up @@ -533,20 +538,6 @@
.gap-4 {
gap: calc(var(--spacing) * 4);
}
.space-y-2 {
:where(& > :not(:last-child)) {
--tw-space-y-reverse: 0;
margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));
margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
}
}
.space-y-4 {
:where(& > :not(:last-child)) {
--tw-space-y-reverse: 0;
margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
}
}
.gap-x-2 {
column-gap: calc(var(--spacing) * 2);
}
Expand All @@ -571,6 +562,9 @@
.rounded-\[2px\] {
border-radius: 2px;
}
.rounded-full {
border-radius: calc(infinity * 1px);
}
.rounded-lg {
border-radius: var(--radius);
}
Expand Down Expand Up @@ -609,6 +603,9 @@
.border-input {
border-color: var(--input);
}
.border-muted-foreground {
border-color: var(--muted-foreground);
}
.border-sidebar-border {
border-color: var(--sidebar-border);
}
Expand All @@ -627,6 +624,12 @@
background-color: color-mix(in oklab, var(--color-black) 50%, transparent);
}
}
.bg-blue-500\/10 {
background-color: color-mix(in srgb, oklch(62.3% 0.214 259.815) 10%, transparent);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--color-blue-500) 10%, transparent);
}
}
.bg-border {
background-color: var(--border);
}
Expand All @@ -639,6 +642,15 @@
.bg-foreground {
background-color: var(--foreground);
}
.bg-gray-500 {
background-color: var(--color-gray-500);
}
.bg-green-500\/10 {
background-color: color-mix(in srgb, oklch(72.3% 0.219 149.579) 10%, transparent);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--color-green-500) 10%, transparent);
}
}
.bg-muted {
background-color: var(--muted);
}
Expand All @@ -657,6 +669,12 @@
.bg-primary {
background-color: var(--primary);
}
.bg-red-500\/10 {
background-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 10%, transparent);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--color-red-500) 10%, transparent);
}
}
.bg-secondary {
background-color: var(--secondary);
}
Expand All @@ -669,6 +687,12 @@
.bg-transparent {
background-color: transparent;
}
.bg-yellow-500\/10 {
background-color: color-mix(in srgb, oklch(79.5% 0.184 86.047) 10%, transparent);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--color-yellow-500) 10%, transparent);
}
}
.fill-foreground {
fill: var(--foreground);
}
Expand Down Expand Up @@ -784,18 +808,15 @@
.text-balance {
text-wrap: balance;
}
.wrap-break-word {
overflow-wrap: break-word;
}
.whitespace-nowrap {
white-space: nowrap;
}
.whitespace-pre-wrap {
white-space: pre-wrap;
}
.text-background {
color: var(--background);
}
.text-blue-500 {
color: var(--color-blue-500);
}
.text-card-foreground {
color: var(--card-foreground);
}
Expand All @@ -805,6 +826,12 @@
.text-foreground {
color: var(--foreground);
}
.text-gray-500 {
color: var(--color-gray-500);
}
.text-green-500 {
color: var(--color-green-500);
}
.text-muted-foreground {
color: var(--muted-foreground);
}
Expand All @@ -820,6 +847,9 @@
.text-primary-foreground {
color: var(--primary-foreground);
}
.text-red-500 {
color: var(--color-red-500);
}
.text-secondary-foreground {
color: var(--secondary-foreground);
}
Expand All @@ -835,6 +865,9 @@
.text-white {
color: var(--color-white);
}
.text-yellow-500 {
color: var(--color-yellow-500);
}
.tabular-nums {
--tw-numeric-spacing: tabular-nums;
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
Expand Down Expand Up @@ -2118,6 +2151,17 @@
white-space: nowrap;
}
}
.\[\&\>svg\]\:pointer-events-none {
&>svg {
pointer-events: none;
}
}
.\[\&\>svg\]\:size-3 {
&>svg {
width: calc(var(--spacing) * 3);
height: calc(var(--spacing) * 3);
}
}
.\[\&\>svg\]\:size-4 {
&>svg {
width: calc(var(--spacing) * 4);
Expand Down Expand Up @@ -2167,6 +2211,60 @@
cursor: w-resize;
}
}
.\[a\&\]\:hover\:bg-accent {
a& {
&:hover {
@media (hover: hover) {
background-color: var(--accent);
}
}
}
}
.\[a\&\]\:hover\:bg-destructive\/90 {
a& {
&:hover {
@media (hover: hover) {
background-color: var(--destructive);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--destructive) 90%, transparent);
}
}
}
}
}
.\[a\&\]\:hover\:bg-primary\/90 {
a& {
&:hover {
@media (hover: hover) {
background-color: var(--primary);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--primary) 90%, transparent);
}
}
}
}
}
.\[a\&\]\:hover\:bg-secondary\/90 {
a& {
&:hover {
@media (hover: hover) {
background-color: var(--secondary);
@supports (color: color-mix(in lab, red, red)) {
background-color: color-mix(in oklab, var(--secondary) 90%, transparent);
}
}
}
}
}
.\[a\&\]\:hover\:text-accent-foreground {
a& {
&:hover {
@media (hover: hover) {
color: var(--accent-foreground);
}
}
}
}
}
:root {
--background: hsl(0 0% 100%);
Expand Down Expand Up @@ -2294,11 +2392,6 @@
inherits: false;
initial-value: 0;
}
@property --tw-space-y-reverse {
syntax: "*";
inherits: false;
initial-value: 0;
}
@property --tw-border-style {
syntax: "*";
inherits: false;
Expand Down Expand Up @@ -2446,7 +2539,6 @@
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-translate-z: 0;
--tw-space-y-reverse: 0;
--tw-border-style: solid;
--tw-leading: initial;
--tw-font-weight: initial;
Expand Down
3 changes: 2 additions & 1 deletion src/frontend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import { kvRoute } from "./views/kv";
import { dashboardRoute } from "./views/dashboard";
import { d1Route } from "./views/d1";
import { durableObjectsRoute } from "./views/durable-objects";
import { requestsRoute } from "./views/requests";

const routeTree = rootRoute.addChildren([dashboardRoute, kvRoute, d1Route, durableObjectsRoute])
const routeTree = rootRoute.addChildren([dashboardRoute, kvRoute, d1Route, durableObjectsRoute, requestsRoute])

const router = createRouter({ routeTree })

Expand Down
Loading