-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d472a8
commit 9d7dcbf
Showing
69 changed files
with
1,704 additions
and
1,329 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ yarn-error.log* | |
next-env.d.ts | ||
.tmp | ||
docker/ | ||
.assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"style": { | ||
"backgroundImage": "https://raw.githubusercontent.com/zhichaoh/catppuccin-wallpapers/main/waves/cat-waves.png" | ||
"backgroundImage": "https://raw.githubusercontent.com/zhichaoh/catppuccin-wallpapers/main/landscapes/yosemite.png" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ module.exports = { | |
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
"use server" | ||
import { getAuthSession } from "@/lib/auth" | ||
import { deleteSession as deleteSessionBase, manageSession as manageSessionBase } from "@/lib/util/session" | ||
import type Dockerode from "dockerode" | ||
import { revalidatePath } from "next/cache" | ||
import { redirect } from "next/navigation" | ||
"use server"; | ||
import { getAuthSession } from "@/lib/auth"; | ||
import { deleteSession as deleteSessionBase, manageSession as manageSessionBase } from "@/lib/util/session"; | ||
import type Dockerode from "dockerode"; | ||
import { revalidatePath } from "next/cache"; | ||
import { redirect } from "next/navigation"; | ||
async function deleteSession(id: string) { | ||
const userSession = await getAuthSession() | ||
if (!userSession || !userSession.user) return | ||
await deleteSessionBase(id, userSession) | ||
revalidatePath("/") | ||
redirect("/") | ||
const userSession = await getAuthSession(); | ||
if (!userSession || !userSession.user) return; | ||
await deleteSessionBase(id, userSession); | ||
revalidatePath("/"); | ||
redirect("/"); | ||
} | ||
async function manageSession(id: string, action: keyof Dockerode.Container, navigate = true) { | ||
const userSession = await getAuthSession() | ||
if (!userSession || !userSession.user) return | ||
await manageSessionBase(id, action, userSession) | ||
revalidatePath("/") | ||
if (navigate) redirect("/") | ||
const userSession = await getAuthSession(); | ||
if (!userSession || !userSession.user) return; | ||
await manageSessionBase(id, action, userSession); | ||
revalidatePath("/"); | ||
if (navigate) redirect("/"); | ||
} | ||
export { deleteSession, manageSession } | ||
export { deleteSession, manageSession }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { getAuthSession } from "@/lib/auth" | ||
import { db, user } from "@/lib/drizzle/db" | ||
import { eq } from "drizzle-orm" | ||
import { redirect } from "next/navigation" | ||
import { getAuthSession } from "@/lib/auth"; | ||
import { db, user } from "@/lib/drizzle/db"; | ||
import { eq } from "drizzle-orm"; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default async function AdminLayout({ children }: { children: React.ReactNode }) { | ||
const userSession = await getAuthSession() | ||
const userSession = await getAuthSession(); | ||
const { isAdmin } = ( | ||
await db | ||
.select({ isAdmin: user.isAdmin }) | ||
.from(user) | ||
.where(eq(user.email, userSession?.user?.email as string)) | ||
)[0] | ||
)[0]; | ||
if (!isAdmin) { | ||
return redirect("/") | ||
return redirect("/"); | ||
} | ||
return children | ||
return children; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function AdminPage() { | ||
return <div className="flex min-h-screen items-center justify-center">coming soon (hopefully)</div> | ||
return <div className="flex min-h-screen items-center justify-center">coming soon (hopefully)</div>; | ||
} |
Oops, something went wrong.