From aafd4262108c941222391f0551c0d0ed5d9e7d21 Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Fri, 1 Nov 2024 21:40:03 +0100 Subject: [PATCH 1/7] Update README.md --- README.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/README.md b/README.md index d7b8970..e4c8c8e 100644 --- a/README.md +++ b/README.md @@ -2,28 +2,9 @@ Proxmox Helper Scripts -

- User count - License - Contributors -

- -

Redesign of the Proxmox VE Helper Scripts website. optimized for readablity and security

- > [!WARNING] > always check the source code of the scripts before running them. Copying random scripts without understanding what they do can lead to data loss or other security issues. -## 👀 Why even use the Re-design? - -### Overview - -This repository contains a collection of helper scripts for Proxmox VE, designed to enhance and simplify the user experience. The scripts include various functionalities such as easier access to source code for improved security and a redesigned website for better script viewing. - -### Features - -- **Script Source Access**: Easily access the source code of each script to review and enhance security. -- **Redesigned Website**: Improved layout for easier script viewing. - ### Tech Stack - [Next.js](https://nextjs.org/) with Typescript for the frontend - [Tailwind CSS](https://tailwindcss.com/) for styling From bf429b7d8b3d1682550d903b2e654148ee1f0a6b Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Sat, 2 Nov 2024 00:06:14 +0100 Subject: [PATCH 2/7] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 672c947..aa06d79 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "private": true, "author": { "name": "Bram Suurd", - "url": "https://github.com/BramSuurdje" + "url": "https://github.com/community-scripts" }, "type": "module", "scripts": { From 217a734f0e4214183c37c2d620ee9a0c2f1729e8 Mon Sep 17 00:00:00 2001 From: Bram Suurd Date: Sat, 2 Nov 2024 10:38:48 +0100 Subject: [PATCH 3/7] Add fallback logo handling for scripts in ScriptBrowser, ScriptItem, and CommandMenu components --- src/app/scripts/_components/ScriptBrowser.tsx | 108 +++++++++--------- src/app/scripts/_components/ScriptItem.tsx | 4 + src/components/CommandMenu.tsx | 4 + 3 files changed, 64 insertions(+), 52 deletions(-) diff --git a/src/app/scripts/_components/ScriptBrowser.tsx b/src/app/scripts/_components/ScriptBrowser.tsx index 6544f97..3ceda3b 100644 --- a/src/app/scripts/_components/ScriptBrowser.tsx +++ b/src/app/scripts/_components/ScriptBrowser.tsx @@ -115,59 +115,63 @@ const ScriptBrowser = ({ } className="pt-0" > - {category.expand.items - .slice() - .sort((a, b) => a.title.localeCompare(b.title)) - .map((script, index) => ( -
- handleSelected(script.title)} - ref={(el) => { - linkRefs.current[script.title] = el; - }} - > - {script.title} - - {script.title} - {script.isMostViewed && ( - - )} - - a.title.localeCompare(b.title)) + .map((script, index) => ( +
+ handleSelected(script.title)} + ref={(el) => { + linkRefs.current[script.title] = el; + }} > - {script.item_type} - - -
- ))} + + ((e.currentTarget as HTMLImageElement).src = + "/logo.png") + } + alt={script.title} + className="mr-1 w-4 h-4 rounded-full" + /> + + {script.title} + {script.isMostViewed && ( + + )} + + + {script.item_type} + + +
+ ))} ))} diff --git a/src/app/scripts/_components/ScriptItem.tsx b/src/app/scripts/_components/ScriptItem.tsx index 2b350b6..abdb99e 100644 --- a/src/app/scripts/_components/ScriptItem.tsx +++ b/src/app/scripts/_components/ScriptItem.tsx @@ -66,6 +66,10 @@ function ScriptItem({ className="h-32 w-32 rounded-lg bg-accent/60 object-contain p-3 shadow-md" src={item.logo} width={400} + onError={(e) => + ((e.currentTarget as HTMLImageElement).src = + "/logo.png") + } height={400} alt={item.title} unoptimized diff --git a/src/components/CommandMenu.tsx b/src/components/CommandMenu.tsx index e29486f..98fa94a 100644 --- a/src/components/CommandMenu.tsx +++ b/src/components/CommandMenu.tsx @@ -106,6 +106,10 @@ export default function CommandMenu() { src={script.logo} unoptimized height={16} + onError={(e) => + ((e.currentTarget as HTMLImageElement).src = + "/logo.png") + } width={16} alt="" className="h-5 w-5" From 6425d32556dc84907bd294e2bda3e21458c4b475 Mon Sep 17 00:00:00 2001 From: Bram Suurd Date: Sat, 2 Nov 2024 10:43:55 +0100 Subject: [PATCH 4/7] Update GitHub links to point to the community scripts repository for ProxmoxVE across multiple components and configurations --- src/app/page.tsx | 2 +- src/components/Footer.tsx | 4 ++-- src/components/ui/codeblock.tsx | 2 +- src/config/siteConfig.tsx | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 4b38907..28781d6 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -80,7 +80,7 @@ export default function Page() { + Search scripts No scripts found. {links.map((category) => ( {category.expand.items.map((script) => ( { setOpen(false); From b5cac563767eaf19af163572cba0c7ea49723390 Mon Sep 17 00:00:00 2001 From: Bram Suurd Date: Sat, 2 Nov 2024 11:24:30 +0100 Subject: [PATCH 7/7] Refactor copy button implementation to use ClipboardIcon and enhance styling in ScriptItems and TextCopyBlock components --- .../_components/ScriptItems/InterFaces.tsx | 16 +++++++++------- src/lib/TextCopyBlock.tsx | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/scripts/_components/ScriptItems/InterFaces.tsx b/src/app/scripts/_components/ScriptItems/InterFaces.tsx index 43779cd..8c2c5ab 100644 --- a/src/app/scripts/_components/ScriptItems/InterFaces.tsx +++ b/src/app/scripts/_components/ScriptItems/InterFaces.tsx @@ -1,5 +1,7 @@ -import { Button } from "@/components/ui/button"; +import { Button, buttonVariants } from "@/components/ui/button"; import handleCopy from "@/lib/handleCopy"; +import { cn } from "@/lib/utils"; +import { ClipboardIcon } from "lucide-react"; interface Item { interface?: string; @@ -13,13 +15,13 @@ const CopyButton = ({ label: string; value: string | number; }) => ( - + handleCopy(label, String(value))} + className="size-4 cursor-pointer" + /> + ); export default function InterFaces({ item }: { item: Item }) { diff --git a/src/lib/TextCopyBlock.tsx b/src/lib/TextCopyBlock.tsx index 9bd89a8..0f2e22e 100644 --- a/src/lib/TextCopyBlock.tsx +++ b/src/lib/TextCopyBlock.tsx @@ -1,6 +1,6 @@ import { Button } from "@/components/ui/button"; import handleCopy from "./handleCopy"; -import { Copy } from "lucide-react"; +import { ClipboardIcon, Copy } from "lucide-react"; export default function TextCopyBlock(description: string) { const pattern = /`([^`]*)`/g; @@ -14,7 +14,7 @@ export default function TextCopyBlock(description: string) { className="bg-secondary py-1 px-2 rounded-lg inline-flex items-center gap-2" > {part} - handleCopy("command", part)} />