10 changed files with 26 additions and 28 deletions
+1
View File
@@ -58,3 +58,4 @@ node_modules/
.direnv
!.envrc
.env*
+2 -4
View File
@@ -4,8 +4,7 @@ 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 *
@@ -14,8 +13,7 @@ export default async function AuditLogViewerPage() {
LIMIT 1000
) t
ORDER BY id ASC;
`)
).rows as (typeof auditLog.$inferSelect)[];
`)) as (typeof auditLog.$inferSelect)[];
const users = await db
.select({ name: user.name, email: user.email })
.from(user);
+2 -4
View File
@@ -42,8 +42,7 @@ 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
@@ -63,8 +62,7 @@ export default async function AdminLayout({
ELSE s.queue
END,
s.id;`)
).rows as (typeof submissions.$inferSelect)[];
s.id;`)) as (typeof submissions.$inferSelect)[];
const config = await getArtifactConfig();
const count = await db
.select({ a: sql`NULL` })
+11 -10
View File
@@ -17,16 +17,17 @@ export default function Home() {
<div className="mx-auto flex min-h-dvh w-full max-w-6xl flex-col">
<section>
<center>
<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>
{/* 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> */}
</center>
</section>
+1 -1
View File
@@ -40,7 +40,7 @@ export async function GET() {
);
return Response.json(
{ red, ...res },
{ status: red ? (res.database ? 200 : 201) : 503 },
{ status: res.database && red ? 200 : 201 },
);
}
+2 -1
View File
@@ -63,7 +63,8 @@ export async function GET(req: NextRequest) {
const channelId = process.env.YOUTUBE_CHANNEL_ID;
const apiKey = process.env.YOUTUBE_API_KEY;
if (!apiKey || !channelId) return NextResponse.json<YoutubeLiveInfo>("none");
// TEMPORARY: Hacked channel
if (!apiKey || !channelId && true) 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,7 +12,6 @@
"@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",
@@ -385,8 +384,6 @@
"@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/neon-http";
import { drizzle } from "drizzle-orm/bun-sql";
import * as schema from "./schema";
import { withReplicas } from "drizzle-orm/pg-core";
+5 -2
View File
@@ -1,7 +1,10 @@
import ReconnectingEventSource from "reconnecting-eventsource";
import type z from "zod";
export const redis = typeof Bun !== "undefined" ? Bun.redis : null;
export const redis =
typeof Bun !== "undefined"
? new Bun.RedisClient(undefined, { maxRetries: 0xffffffff })
: null;
type PubPayload = { event?: string; data: unknown };
@@ -126,7 +129,7 @@ export class EventSourceEndpoint<T extends EventSourceEventMap> {
throw new Error(
"EventSourceEndpoint.pub(...) can only be called on the server.",
);
return this.manager.publish(this.eventMap[event].parse(data), {
this.manager.publish(this.eventMap[event].parse(data), {
topic: this.endpoint,
event: String(event),
});
-1
View File
@@ -26,7 +26,6 @@
"@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",