Skip to content

Commit

Permalink
change formatter file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Apr 23, 2024
1 parent 9d472a8 commit 9d7dcbf
Show file tree
Hide file tree
Showing 69 changed files with 1,704 additions and 1,329 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ yarn-error.log*
next-env.d.ts
.tmp
docker/
.assets
18 changes: 13 additions & 5 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@
"$schema": "https://biomejs.dev/schemas/1.7.0/schema.json",
"formatter": {
"enabled": true,
"formatWithErrors": false,
"formatWithErrors": true,
"indentStyle": "tab",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "auto",
"ignore": ["**/pnpm-lock.yaml", "**/.next/**"]
"ignore": ["**/pnpm-lock.yaml", "**/.next/**", "**/node_modules/**"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
},
"ignore": ["**/pnpm-lock.yaml", "**/.next/**", "**/node_modules/**"]
},
"organizeImports": { "enabled": true },
"linter": { "enabled": true, "rules": { "recommended": true }, "ignore": ["**/pnpm-lock.yaml", "**/.next/**"] },
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingComma": "all",
"semicolons": "asNeeded",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
Expand Down
2 changes: 1 addition & 1 deletion config.json
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"
}
}
8 changes: 4 additions & 4 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "dotenv/config"
import type { Config } from "drizzle-kit"
import "dotenv/config";
import type { Config } from "drizzle-kit";

const config: Config = {
driver: "pg",
Expand All @@ -10,5 +10,5 @@ const config: Config = {
},
verbose: true,
strict: true,
}
export default config
};
export default config;
23 changes: 9 additions & 14 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
// @ts-check
import { verifyPatch } from "next-ws/server/index.js"
import { verifyPatch } from "next-ws/server/index.js";

verifyPatch()
verifyPatch();
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "http.cat",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "raw.githubusercontent.com",
hostname: "*",
port: "",
pathname: "/**",
},
],
},
experimental: {
typedRoutes: true,
serverActions: {
allowedOrigins: ["localhost:3000", "*.use.devtunnels.ms"],
},
Expand All @@ -32,15 +27,15 @@ const nextConfig = {
destination: "/auth/error",
permanent: true,
},
]
];
},
webpack(config) {
config.module.rules.push({
test: /\.node$/,
loader: "node-loader",
})
return config
});
return config;
},
}
};

export default nextConfig
export default nextConfig;
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@novnc/novnc": "^1.4.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-aspect-ratio": "^1.0.3",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-context-menu": "^2.1.5",
"@radix-ui/react-dialog": "^1.0.5",
Expand All @@ -28,6 +29,7 @@
"@radix-ui/react-slider": "^1.1.2",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"@types/dockerode": "^3.3.26",
"class-variance-authority": "^0.7.0",
Expand All @@ -48,6 +50,7 @@
"react-dom": "^18.2.0",
"server-only": "^0.0.1",
"sonner": "^1.4.41",
"swr": "^2.2.5",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7",
"ws": "^8.16.0"
Expand All @@ -61,7 +64,7 @@
"@types/react-dom": "^18.2.22",
"@types/ws": "^8.5.10",
"autoprefixer": "^10.4.19",
"drizzle-kit": "^0.20.16",
"drizzle-kit": "^0.20.17",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.1",
"tailwindcss-dotted-background": "^1.1.0",
Expand Down
84 changes: 80 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
}
};
34 changes: 17 additions & 17 deletions src/actions/client-session.ts
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 };
16 changes: 8 additions & 8 deletions src/app/(main)/admin/layout.tsx
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;
}
2 changes: 1 addition & 1 deletion src/app/(main)/admin/page.tsx
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>;
}
Loading

0 comments on commit 9d7dcbf

Please sign in to comment.