10 changed files with 28 additions and 26 deletions
+1 -2
View File
@@ -57,5 +57,4 @@ node_modules/
.sentryclirc
.direnv
!.envrc
.env*
!.envrc
+4 -2
View File
@@ -4,7 +4,8 @@ import { auditLog, user } from "@/lib/db/schema";
import AuditLogViewer from "./client";
export default async function AuditLogViewerPage() {
const logs = (await db.execute(sql`
const logs = (
await db.execute(sql`
SELECT *
FROM (
SELECT *
@@ -13,7 +14,8 @@ export default async function AuditLogViewerPage() {
LIMIT 1000
) t
ORDER BY id ASC;
`)) as (typeof auditLog.$inferSelect)[];
`)
).rows as (typeof auditLog.$inferSelect)[];
const users = await db
.select({ name: user.name, email: user.email })
.from(user);
+4 -2
View File
@@ -42,7 +42,8 @@ export default async function AdminLayout({
}) {
if (!(await adminCheck()))
redirect(`/login?next=${encodeURIComponent("/artifact/admin")}`);
const subs = (await db.execute(sql`
const subs = (
await db.execute(sql`
WITH max_checked AS (
SELECT MAX(queue) AS max_queue
FROM artifact.submissions
@@ -62,7 +63,8 @@ export default async function AdminLayout({
ELSE s.queue
END,
s.id;`)) as (typeof submissions.$inferSelect)[];
s.id;`)
).rows as (typeof submissions.$inferSelect)[];
const config = await getArtifactConfig();
const count = await db
.select({ a: sql`NULL` })
+10 -11
View File
@@ -17,17 +17,16 @@ export default function Home() {
<div className="mx-auto flex min-h-dvh w-full max-w-6xl flex-col">
<section>
<center>
{/* TEMPORARY: Hacked channel */}
{/* <Link href="https://www.youtube.com/@Genshinmaichaigamemurtur"> */}
<Image
src={Banner}
alt="Banner"
className="mt-24 w-3/4 rounded-t-xl sm:w-125"
width={500}
height={100}
fetchPriority="high"
/>
{/* </Link> */}
<Link href="https://www.youtube.com/@Genshinmaichaigamemurtur">
<Image
src={Banner}
alt="Banner"
className="mt-24 w-3/4 rounded-t-xl sm:w-125"
width={500}
height={100}
fetchPriority="high"
/>
</Link>
</center>
</section>
+1 -1
View File
@@ -40,7 +40,7 @@ export async function GET() {
);
return Response.json(
{ red, ...res },
{ status: res.database && red ? 200 : 201 },
{ status: red ? (res.database ? 200 : 201) : 503 },
);
}
+1 -2
View File
@@ -63,8 +63,7 @@ export async function GET(req: NextRequest) {
const channelId = process.env.YOUTUBE_CHANNEL_ID;
const apiKey = process.env.YOUTUBE_API_KEY;
// TEMPORARY: Hacked channel
if (!apiKey || !channelId && true) return NextResponse.json<YoutubeLiveInfo>("none");
if (!apiKey || !channelId) return NextResponse.json<YoutubeLiveInfo>("none");
const response = await youtubeCache.fetch(
`https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${channelId}&eventType=live&type=video&maxResults=1&key=${apiKey}`,
+3
View File
@@ -12,6 +12,7 @@
"@headless-tree/core": "^1.6.0",
"@headless-tree/react": "^1.6.0",
"@hookform/resolvers": "^5.2.2",
"@neondatabase/serverless": "^1.1.0",
"@next/bundle-analyzer": "16.2.6",
"@origin-space/image-cropper": "^0.1.9",
"@radix-ui/react-accordion": "^1.2.12",
@@ -384,6 +385,8 @@
"@mrleebo/prisma-ast": ["@mrleebo/[email protected]", "", { "dependencies": { "chevrotain": "^10.5.0", "lilconfig": "^2.1.0" } }, "sha512-VxS+okLpNp6YUDLz3rAXv6sE8G4W5cX039bumkPub65xRr9BFxjHaT5ebX4DsiixIGaBwitjWTvx3mAbyI2EUQ=="],
"@neondatabase/serverless": ["@neondatabase/[email protected]", "", {}, "sha512-r3ZZhRjEcfEdKIZnoB1RusNgvHuaBRqfCzV4Gi+5A9yUX0S4HTws/ASWqt13wL4y4I+0rqsWGdA2w7EQXHi3+Q=="],
"@next/bundle-analyzer": ["@next/[email protected]", "", { "dependencies": { "webpack-bundle-analyzer": "4.10.1" } }, "sha512-amPkVtHCTJAdBwyhhl5+qztHk24O4JlASgrWqh15AmnYi74apfZR46NGC0u4pM6BMAU1mYld4WdzD3cRBP3dOA=="],
"@next/env": ["@next/[email protected]", "", {}, "sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw=="],
+1 -1
View File
@@ -1,4 +1,4 @@
import { drizzle } from "drizzle-orm/bun-sql";
import { drizzle } from "drizzle-orm/neon-http";
import * as schema from "./schema";
import { withReplicas } from "drizzle-orm/pg-core";
+2 -5
View File
@@ -1,10 +1,7 @@
import ReconnectingEventSource from "reconnecting-eventsource";
import type z from "zod";
export const redis =
typeof Bun !== "undefined"
? new Bun.RedisClient(undefined, { maxRetries: 0xffffffff })
: null;
export const redis = typeof Bun !== "undefined" ? Bun.redis : null;
type PubPayload = { event?: string; data: unknown };
@@ -129,7 +126,7 @@ export class EventSourceEndpoint<T extends EventSourceEventMap> {
throw new Error(
"EventSourceEndpoint.pub(...) can only be called on the server.",
);
this.manager.publish(this.eventMap[event].parse(data), {
return this.manager.publish(this.eventMap[event].parse(data), {
topic: this.endpoint,
event: String(event),
});
+1
View File
@@ -26,6 +26,7 @@
"@headless-tree/core": "^1.6.0",
"@headless-tree/react": "^1.6.0",
"@hookform/resolvers": "^5.2.2",
"@neondatabase/serverless": "^1.1.0",
"@next/bundle-analyzer": "16.2.6",
"@origin-space/image-cropper": "^0.1.9",
"@radix-ui/react-accordion": "^1.2.12",