diff --git a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx index a55a75651..4d6494d39 100644 --- a/apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx +++ b/apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx @@ -1,7 +1,7 @@ "use client"; import { ArrayInput } from "@/components/array-input"; import { cn } from "@/lib/utils"; -import { Button } from "@unkey/ui"; +import { Button, buttonVariants } from "@unkey/ui"; import { CalendarIcon, CalendarRange, @@ -193,20 +193,22 @@ export const Filters: React.FC = () => { } timeInputLabel="Select Time" calendarProps={{ - disabled: { before: new Date() }, + disabled: { after: new Date() }, showOutsideDays: true, }} timeInputProps={{ className: "w-[100px]", }} > - +
{ className: "w-[130px]", }} > - +
diff --git a/internal/clickhouse/src/ratelimits.ts b/internal/clickhouse/src/ratelimits.ts index 57d41b63b..78649b877 100644 --- a/internal/clickhouse/src/ratelimits.ts +++ b/internal/clickhouse/src/ratelimits.ts @@ -163,6 +163,7 @@ const getRatelimitLogsParameters = z.object({ .optional() .default(() => Date.now()), limit: z.number().optional().default(100), + passed: z.boolean().optional(), }); export function getRatelimitLogs(ch: Querier) { @@ -180,6 +181,8 @@ export function getRatelimitLogs(ch: Querier) { ${args.identifier ? "AND multiSearchAny(identifier, {identifier: Array(String)}) > 0" : ""} AND time >= {start: Int64} AND time <= {end: Int64} + ${typeof args.passed !== "undefined" ? "passed = {passed:Boolean}" : ""} + ORDER BY time DESC LIMIT {limit: Int64} ;`, params: getRatelimitLogsParameters, diff --git a/packages/api/package.json b/packages/api/package.json index 95020dad7..c6fef3285 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -9,19 +9,12 @@ "publishConfig": { "access": "public" }, - "keywords": [ - "unkey", - "client", - "api" - ], + "keywords": ["unkey", "client", "api"], "bugs": { "url": "https://github.com/unkeyed/unkey/issues" }, "homepage": "https://github.com/unkeyed/unkey#readme", - "files": [ - "./dist/**", - "README.md" - ], + "files": ["./dist/**", "README.md"], "author": "Andreas Thomas ", "scripts": { "generate": "openapi-typescript https://api.unkey.dev/openapi.json -o ./src/openapi.d.ts", diff --git a/packages/hono/package.json b/packages/hono/package.json index d5b421df2..eaba9a4e8 100644 --- a/packages/hono/package.json +++ b/packages/hono/package.json @@ -8,19 +8,12 @@ "publishConfig": { "access": "public" }, - "keywords": [ - "unkey", - "client", - "api", - "hono" - ], + "keywords": ["unkey", "client", "api", "hono"], "bugs": { "url": "https://github.com/unkeyed/unkey/issues" }, "homepage": "https://github.com/unkeyed/unkey#readme", - "files": [ - "./dist/**" - ], + "files": ["./dist/**"], "author": "Andreas Thomas ", "scripts": { "build": "tsup", diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index fc63e2e1e..4786b6ec4 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -8,19 +8,12 @@ "publishConfig": { "access": "public" }, - "keywords": [ - "unkey", - "client", - "api" - ], + "keywords": ["unkey", "client", "api"], "bugs": { "url": "https://github.com/unkeyed/unkey/issues" }, "homepage": "https://github.com/unkeyed/unkey#readme", - "files": [ - "./dist/**", - "README.md" - ], + "files": ["./dist/**", "README.md"], "author": "Andreas Thomas ", "scripts": { "build": "tsup" diff --git a/packages/ratelimit/package.json b/packages/ratelimit/package.json index dee44c38e..dbedb47d4 100644 --- a/packages/ratelimit/package.json +++ b/packages/ratelimit/package.json @@ -9,20 +9,12 @@ "publishConfig": { "access": "public" }, - "keywords": [ - "unkey", - "ratelimit", - "global", - "serverless" - ], + "keywords": ["unkey", "ratelimit", "global", "serverless"], "bugs": { "url": "https://github.com/unkeyed/unkey/issues" }, "homepage": "https://github.com/unkeyed/unkey#readme", - "files": [ - "./dist/**", - "README.md" - ], + "files": ["./dist/**", "README.md"], "author": "Andreas Thomas ", "scripts": { "build": "tsup"