Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
249946b
Add new animation for switching themes.
BramSuurdje Nov 6, 2024
5abb3cc
Remove unused metadata files from testing
BramSuurdje Nov 6, 2024
a1cce93
increase duration on theme switch
BramSuurdje Nov 6, 2024
26c29f5
Reduce animation duration for view transition effect to improve respo…
BramSuurdje Nov 6, 2024
6c6ffc1
Merge branch 'main' of github.com:BramSuurdje/ProxmoxVE
BramSuurdje Nov 6, 2024
1ef3c5a
Fetch categories and scripts from external sources, updating `GET` en…
BramSuurdje Nov 6, 2024
76cf852
Refactor all components to use data from new API
BramSuurdje Nov 6, 2024
5a633a1
Refactor `InterFaces` component to use updated `Script` type and stre…
BramSuurdje Nov 6, 2024
2261790
Refactor `CommandMenu` component to utilize updated `Category` and `S…
BramSuurdje Nov 6, 2024
62ef9ec
Fix animation duration in `globals.css` to ensure proper view transit…
BramSuurdje Nov 6, 2024
c9b639a
Remove unnecessary console log for file name in `fetchAllMetaDataFile…
BramSuurdje Nov 6, 2024
c700d04
Refactor category fetching in `ScriptContent` and `CommandMenu` to ut…
BramSuurdje Nov 6, 2024
440d3b6
Use `formattedBadge` in `ScriptAccordion` and `CommandMenu` for consi…
BramSuurdje Nov 6, 2024
994e958
Refactor source URL generation in `Buttons` component to enhance clar…
BramSuurdje Nov 6, 2024
db82fe8
Check default settings availability in `DefaultSettings` component an…
BramSuurdje Nov 6, 2024
36b0691
Fix install command generation to handle optional script parameter an…
BramSuurdje Nov 6, 2024
974b31b
Add most popular scripts feature and update script rendering logic in…
BramSuurdje Nov 6, 2024
96bc5ad
Enhance `ScriptItem` component to display correct type naming alongsi…
BramSuurdje Nov 6, 2024
07e4620
Add conversion utility to display RAM in GB for better readability in…
BramSuurdje Nov 6, 2024
4bfd0e1
Merge branch 'community-scripts:main' into main
BramSuurdje Nov 6, 2024
860186e
Refactor Next.js config to use dynamic basePath and update sitemap UR…
BramSuurdje Nov 6, 2024
b6ab3dd
Refactor site configuration to utilize centralized settings for analy…
BramSuurdje Nov 6, 2024
9b20f49
Refactor sitemap generation to use centralized basePath from config, …
BramSuurdje Nov 6, 2024
ec12789
Refactor to replace PocketBase with a new data module across components
BramSuurdje Nov 6, 2024
d59af11
Refactor layout to use centralized analytics configuration
BramSuurdje Nov 6, 2024
e28d5f4
Update deployment workflow to include JSON files for GitHub Pages pub…
BramSuurdje Nov 6, 2024
ee91f7e
Remove caching step from GitHub Pages deploy workflow to avoid caching
BramSuurdje Nov 6, 2024
d9a6b8b
Remove basePath from Next.js config to simplify configuration and avo…
BramSuurdje Nov 6, 2024
70ae6ae
Add category sorting and fetching logic in data.ts
BramSuurdje Nov 6, 2024
d7accce
Add analytics configuration and basePath to siteConfig
BramSuurdje Nov 6, 2024
d3007c1
Remove obsolete environment files for analytics and PocketBase
BramSuurdje Nov 6, 2024
e67b1c5
Update sitemap to use a fixed domain for the generated sitemap instea…
BramSuurdje Nov 6, 2024
49527dd
Refactor layout to utilize basePath for metadata base URL and image l…
BramSuurdje Nov 6, 2024
1c4321c
use cleaner `basePath` variable around codebase for easier management
BramSuurdje Nov 6, 2024
3b59f5b
Update frontend/src/app/api/categories/route.ts
BramSuurdje Nov 6, 2024
bdaea5a
Update frontend/src/app/api/categories/route.ts
BramSuurdje Nov 6, 2024
9eeba52
Update frontend/src/app/api/categories/route.ts
BramSuurdje Nov 6, 2024
dd50c04
Update frontend/src/components/CommandMenu.tsx
BramSuurdje Nov 6, 2024
8b59207
Update frontend/src/components/ui/theme-toggle.tsx
BramSuurdje Nov 6, 2024
9c55665
Update frontend/src/components/CommandMenu.tsx
BramSuurdje Nov 6, 2024
16657ec
Update frontend/src/app/api/categories/route.ts
BramSuurdje Nov 6, 2024
e8ff285
Update frontend/src/app/api/categories/route.ts
BramSuurdje Nov 6, 2024
ada264e
Update frontend/src/app/scripts/_components/ScriptItems/DefaultPasswo…
BramSuurdje Nov 6, 2024
739e4f5
Update frontend/src/app/scripts/_components/ScriptItems/DefaultSettin…
BramSuurdje Nov 6, 2024
e5c7df8
Update src/lib/data.ts with necessary changes.
BramSuurdje Nov 6, 2024
e63236b
Update src/app/api/categories/route.ts with necessary modifications
BramSuurdje Nov 6, 2024
11ddcc6
Update frontend/src/app/scripts/_components/ScriptItems/InstallComman…
BramSuurdje Nov 6, 2024
1a44c1e
Update src/components/CommandMenu.tsx with necessary improvements
BramSuurdje Nov 6, 2024
463cd4c
Merge branch 'main' of github.com:BramSuurdje/ProxmoxVE
BramSuurdje Nov 6, 2024
f98a5f2
Add renamed themetoggle
BramSuurdje Nov 6, 2024
043e95b
Update frontend/src/app/scripts/_components/ScriptInfoBlocks.tsx
BramSuurdje Nov 6, 2024
8485932
Update frontend/src/app/scripts/_components/ScriptItems/DefaultSettin…
BramSuurdje Nov 6, 2024
9356830
Update frontend/src/app/scripts/_components/ScriptItems/DefaultSettin…
BramSuurdje Nov 6, 2024
8bdc41f
Update src/app/scripts/_components/ScriptInfoBlocks.tsx with enhancem…
BramSuurdje Nov 6, 2024
274abee
Update src/app/scripts/_components/ScriptItems/InstallCommand.tsx
BramSuurdje Nov 6, 2024
a08e1e3
Update src/app/scripts/_components/ScriptItem.tsx
BramSuurdje Nov 6, 2024
69d10ff
Update src/app/scripts/_components/ScriptAccordion.tsx with necessary…
BramSuurdje Nov 6, 2024
84086df
Update Interfaces to use strict check
BramSuurdje Nov 6, 2024
595de37
updated interfaces to use normal string label instead of jsx
BramSuurdje Nov 6, 2024
339aa93
Update configuration to use environment variable for BASE_PATH and re…
BramSuurdje Nov 6, 2024
11197af
force static base path
BramSuurdje Nov 6, 2024
c6c5d57
Update CommandMenu.tsx
BramSuurdje Nov 6, 2024
4051752
Update DefaultSettings.tsx
BramSuurdje Nov 6, 2024
c74a7c5
Update DefaultSettings.tsx
BramSuurdje Nov 6, 2024
810d63e
Ensure fetchScripts returns a typed Script array by specifying return…
BramSuurdje Nov 6, 2024
17600d1
Remove commented-out import for unused Category type in CommandMenu c…
BramSuurdje Nov 6, 2024
3372927
Merge branch 'main' of github.com:BramSuurdje/ProxmoxVE
BramSuurdje Nov 6, 2024
2169131
Fix fetch URLs by removing unnecessary slashes and ensure proper retu…
BramSuurdje Nov 6, 2024
306fd8e
Refactor MostViewedScripts to ensure proper type annotations and impr…
BramSuurdje Nov 6, 2024
562ba92
Update BASE_PATH handling in next.config and fix fetch URLs to ensure…
BramSuurdje Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches: ["main"]
paths:
- frontend/**
- json/**

workflow_dispatch:

Expand Down Expand Up @@ -57,14 +58,6 @@ jobs:
uses: actions/configure-pages@v5
with:
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('frontend/**/package-lock.json', 'frontend/**/yarn.lock') }}-${{ hashFiles('frontend/**.[jt]s', 'frontend/**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('frontend/**/package-lock.json', 'frontend/**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} --legacy-peer-deps
- name: Build with Next.js
Expand Down
3 changes: 0 additions & 3 deletions frontend/.env.local

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/example.env

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const nextConfig = {
},

env: {
NEXT_PUBLIC_BUILD_TIME: `${Date.now()}`,
BASE_PATH: "ProxmoxVE",
},

output: "export",
basePath: "/ProxmoxVE",
basePath: `/${process.env.BASE_PATH}`,
};

export default nextConfig;
11 changes: 10 additions & 1 deletion frontend/package-lock.json

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

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
Expand All @@ -31,7 +32,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",
"framer-motion": "^11.11.10",
"framer-motion": "^11.11.11",
"fuse.js": "^7.0.0",
"lucide-react": "^0.453.0",
"mini-svg-data-uri": "^1.4.4",
Expand Down
23 changes: 0 additions & 23 deletions frontend/public/metadata/docker.json

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/public/metadata/nginxproxymanager.json

This file was deleted.

42 changes: 32 additions & 10 deletions frontend/src/app/api/categories/route.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
import { pb } from "@/lib/pocketbase";
import { Category } from "@/lib/types";
import { basePath } from "@/config/siteConfig";
import { Category, Script } from "@/lib/types";
import { NextResponse } from "next/server";

export const dynamic = "force-static";

const fetchCategories = async (): Promise<Category[]> => {
const response = await fetch(
`https://raw.githubusercontent.com/community-scripts/${basePath}/refs/heads/main/json/metadata.json`,
);
const data = await response.json();
return data.categories;
};

const fetchScripts = async (): Promise<Script[]> => {
const response = await fetch(
`https://api.github.com/repos/community-scripts/${basePath}/contents/json`,
);
const files: { download_url: string }[] = await response.json();
const scripts = await Promise.all(
files.map(async (file) : Promise<Script> => {
const response = await fetch(file.download_url);
const script = await response.json();
return script;
}),
);
return scripts;
};

export async function GET() {
try {
const response = await pb.collection("categories").getFullList<Category>({
expand: "items.alerts,items.alpine_script,items.default_login",
sort: "order",
});

return NextResponse.json(response);
const categories = await fetchCategories();
const scripts = await fetchScripts();
for (const category of categories) {
category.scripts = scripts.filter((script) => script.categories.includes(category.id));
}
return NextResponse.json(categories);
} catch (error) {
console.error("Error fetching categories:", error);
console.error(error as Error);
return NextResponse.json(
{ error: "Failed to fetch categories" },
{ status: 500 },
);
}
}

16 changes: 11 additions & 5 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "@/styles/globals.css";
import { Inter } from "next/font/google";
import React from "react";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import { analytics, basePath } from "@/config/siteConfig";

const inter = Inter({ subsets: ["latin"] });

Expand Down Expand Up @@ -34,15 +35,15 @@ export const metadata = {
address: false,
telephone: false,
},
metadataBase: new URL("https://community-scripts.github.io/Proxmox/"),
metadataBase: new URL(`https://community-scripts.github.io/${basePath}/`),
openGraph: {
title: "Proxmox VE Helper-Scripts",
description:
"A Front-end for the Proxmox VE Helper-Scripts (Community) Repository. Featuring over 200+ scripts to help you manage your Proxmox VE environment.",
url: "/defaultimg.png",
images: [
{
url: "https://community-scripts.github.io/Proxmox/defaultimg.png",
url: `https://community-scripts.github.io/${basePath}/defaultimg.png`,
},
],
locale: "en_US",
Expand All @@ -60,15 +61,20 @@ export default function RootLayout({
<head>
<script
defer
src={`https://${process.env.NEXT_PUBLIC_ANALYTICS_URL}/script.js`}
data-website-id={process.env.NEXT_PUBLIC_ANALYTICS_TOKEN}
src={`https://${analytics.url}/script.js`}
data-website-id={analytics.token}
></script>
<link rel="manifest" href="manifest.webmanifest" />
<link rel="preconnect" href={process.env.NEXT_PUBLIC_POCKETBASE_URL} />
<link rel="preconnect" href="https://api.github.com" />
</head>
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
<div className="flex w-full flex-col justify-center">
<Navbar />
<div className="flex min-h-screen flex-col justify-center">
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/app/manifest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { basePath } from "@/config/siteConfig";
import type { MetadataRoute } from "next";

export const generateStaticParams = () => {
Expand All @@ -9,13 +10,13 @@ export default function manifest(): MetadataRoute.Manifest {
name: "Proxmox VE Helper-Scripts",
short_name: "Proxmox VE Helper-Scripts",
description:
"A Re-designed Front-end for the Proxmox VE Helper-Scripts Repository. Featuring over 150+ scripts to help you manage your Proxmox VE environment.",
"A Re-designed Front-end for the Proxmox VE Helper-Scripts Repository. Featuring over 200+ scripts to help you manage your Proxmox VE environment.",
theme_color: "#030712",
background_color: "#030712",
display: "standalone",
orientation: "portrait",
scope: "/Proxmox/",
start_url: "/Proxmox/",
scope: `${basePath}`,
start_url: `${basePath}`,
icons: [
{
src: "logo.png",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useEffect, useState } from "react";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { CardFooter } from "@/components/ui/card";
import { FaGithub } from "react-icons/fa";
import { basePath } from "@/config/siteConfig";

function CustomArrowRightIcon() {
return <ArrowRightIcon className="h-4 w-4" width={1} />;
Expand Down Expand Up @@ -80,7 +81,7 @@ export default function Page() {
</Button>
<Button className="w-full" asChild>
<a
href="https://github.com/community-scripts/ProxmoxVE"
href={`https://github.com/community-scripts/${basePath}`}
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-center"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { basePath } from "@/config/siteConfig";
import type { MetadataRoute } from "next";

export const dynamic = "force-static";
Expand All @@ -8,6 +9,6 @@ export default function robots(): MetadataRoute.Robots {
userAgent: "*",
allow: "/",
},
sitemap: "https://community-scripts.github.io/Proxmox/sitemap.xml",
sitemap: `https://community-scripts.github.io/${basePath}/sitemap.xml`,
};
}
Loading