Skip to content

Commit d29a66c

Browse files
committed
Merge branch 'main' of github.com:community-scripts/proxmox-helper-scripts
2 parents c52a118 + b5cac56 commit d29a66c

File tree

12 files changed

+90
-93
lines changed

12 files changed

+90
-93
lines changed

README.md

-19
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,9 @@
22
<a href="https://proxmoxve-scripts.com" target="_blank"><img src="https://proxmoxve-scripts.com/defaultimg.png" alt="Proxmox Helper Scripts" width="800"></a>
33
</h1>
44

5-
<p align="center">
6-
<a href="https://proxmoxve-scripts.com/"><img alt="User count" src="https://img.shields.io/badge/Weekly_Users-6000-blue?style=for-the-badge&color=1A91FF"/></a>
7-
<a href="https://github.com/BramSuurdje/proxmox-helper-scripts/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/BramSuurdje/proxmox-helper-scripts?style=for-the-badge&logo=github&color=1A91FF"/></a>
8-
<a href="https://github.com/BramSuurdje/proxmox-helper-scripts/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/BramSuurdje/proxmox-helper-scripts?style=for-the-badge&color=1A91FF" /></a>
9-
</p>
10-
11-
<p align="center">Redesign of the Proxmox VE Helper Scripts website. optimized for readablity and security</p>
12-
135
> [!WARNING]
146
> 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.
157
16-
## 👀 Why even use the Re-design?
17-
18-
### Overview
19-
20-
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.
21-
22-
### Features
23-
24-
- **Script Source Access**: Easily access the source code of each script to review and enhance security.
25-
- **Redesigned Website**: Improved layout for easier script viewing.
26-
278
### Tech Stack
289
- [Next.js](https://nextjs.org/) with Typescript for the frontend
2910
- [Tailwind CSS](https://tailwindcss.com/) for styling

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"author": {
77
"name": "Bram Suurd",
8-
"url": "https://github.com/BramSuurdje"
8+
"url": "https://github.com/community-scripts"
99
},
1010
"type": "module",
1111
"scripts": {

src/app/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default function Page() {
8080
</Button>
8181
<Button className="w-full" asChild>
8282
<a
83-
href="https://github.com/tteck/Proxmox"
83+
href="https://github.com/community-scripts/ProxmoxVE"
8484
target="_blank"
8585
rel="noopener noreferrer"
8686
className="flex items-center justify-center"

src/app/scripts/_components/ScriptBrowser.tsx

+56-52
Original file line numberDiff line numberDiff line change
@@ -115,59 +115,63 @@ const ScriptBrowser = ({
115115
}
116116
className="pt-0"
117117
>
118-
{category.expand.items
119-
.slice()
120-
.sort((a, b) => a.title.localeCompare(b.title))
121-
.map((script, index) => (
122-
<div key={index}>
123-
<Link
124-
href={{
125-
pathname: "/scripts",
126-
query: { id: script.title },
127-
}}
128-
prefetch={false}
129-
className={`flex cursor-pointer items-center justify-between gap-1 px-1 py-1 text-muted-foreground hover:rounded-lg hover:bg-accent/60 hover:dark:bg-accent/20 ${
130-
selectedScript === script.title
131-
? "rounded-lg bg-accent font-semibold dark:bg-accent/30 dark:text-white"
132-
: ""
133-
}`}
134-
onClick={() => handleSelected(script.title)}
135-
ref={(el) => {
136-
linkRefs.current[script.title] = el;
137-
}}
138-
>
139-
<Image
140-
src={script.logo}
141-
height={16}
142-
width={16}
143-
unoptimized
144-
alt={script.title}
145-
className="mr-1 w-4 h-4 rounded-full"
146-
/>
147-
<span className="flex items-center gap-2">
148-
{script.title}
149-
{script.isMostViewed && (
150-
<Star className="h-3 w-3 text-yellow-500"></Star>
151-
)}
152-
</span>
153-
<Badge
154-
className={classNames(
155-
"ml-auto w-[37.69px] justify-center text-center",
156-
{
157-
"text-primary/75": script.item_type === "VM",
158-
"text-yellow-500/75": script.item_type === "LXC",
159-
"border-none": script.item_type === "",
160-
hidden: !["VM", "LXC", ""].includes(
161-
script.item_type,
162-
),
163-
},
164-
)}
118+
{category.expand.items
119+
.slice()
120+
.sort((a, b) => a.title.localeCompare(b.title))
121+
.map((script, index) => (
122+
<div key={index}>
123+
<Link
124+
href={{
125+
pathname: "/scripts",
126+
query: { id: script.title },
127+
}}
128+
prefetch={false}
129+
className={`flex cursor-pointer items-center justify-between gap-1 px-1 py-1 text-muted-foreground hover:rounded-lg hover:bg-accent/60 hover:dark:bg-accent/20 ${
130+
selectedScript === script.title
131+
? "rounded-lg bg-accent font-semibold dark:bg-accent/30 dark:text-white"
132+
: ""
133+
}`}
134+
onClick={() => handleSelected(script.title)}
135+
ref={(el) => {
136+
linkRefs.current[script.title] = el;
137+
}}
165138
>
166-
{script.item_type}
167-
</Badge>
168-
</Link>
169-
</div>
170-
))}
139+
<Image
140+
src={script.logo}
141+
height={16}
142+
width={16}
143+
unoptimized
144+
onError={(e) =>
145+
((e.currentTarget as HTMLImageElement).src =
146+
"/logo.png")
147+
}
148+
alt={script.title}
149+
className="mr-1 w-4 h-4 rounded-full"
150+
/>
151+
<span className="flex items-center gap-2">
152+
{script.title}
153+
{script.isMostViewed && (
154+
<Star className="h-3 w-3 text-yellow-500"></Star>
155+
)}
156+
</span>
157+
<Badge
158+
className={classNames(
159+
"ml-auto w-[37.69px] justify-center text-center",
160+
{
161+
"text-primary/75": script.item_type === "VM",
162+
"text-yellow-500/75": script.item_type === "LXC",
163+
"border-none": script.item_type === "",
164+
hidden: !["VM", "LXC", ""].includes(
165+
script.item_type,
166+
),
167+
},
168+
)}
169+
>
170+
{script.item_type}
171+
</Badge>
172+
</Link>
173+
</div>
174+
))}
171175
</AccordionContent>
172176
</AccordionItem>
173177
))}

src/app/scripts/_components/ScriptItem.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ function ScriptItem({
6666
className="h-32 w-32 rounded-lg bg-accent/60 object-contain p-3 shadow-md"
6767
src={item.logo}
6868
width={400}
69+
onError={(e) =>
70+
((e.currentTarget as HTMLImageElement).src =
71+
"/logo.png")
72+
}
6973
height={400}
7074
alt={item.title}
7175
unoptimized

src/app/scripts/_components/ScriptItems/InterFaces.tsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { Button } from "@/components/ui/button";
1+
import { Button, buttonVariants } from "@/components/ui/button";
22
import handleCopy from "@/lib/handleCopy";
3+
import { cn } from "@/lib/utils";
4+
import { ClipboardIcon } from "lucide-react";
35

46
interface Item {
57
interface?: string;
@@ -13,13 +15,13 @@ const CopyButton = ({
1315
label: string;
1416
value: string | number;
1517
}) => (
16-
<Button
17-
variant="secondary"
18-
size="sm"
19-
onClick={() => handleCopy(label, String(value))}
20-
>
18+
<span className={cn(buttonVariants({size: "sm", variant: "secondary"}), "flex items-center gap-2")}>
2119
{value}
22-
</Button>
20+
<ClipboardIcon
21+
onClick={() => handleCopy(label, String(value))}
22+
className="size-4 cursor-pointer"
23+
/>
24+
</span>
2325
);
2426

2527
export default function InterFaces({ item }: { item: Item }) {

src/components/CommandMenu.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Image from "next/image";
1212
import { useRouter } from "next/navigation";
1313
import React from "react";
1414
import { Button } from "./ui/button";
15+
import { DialogTitle } from "./ui/dialog";
1516

1617
const sortCategories = (categories: Category[]): Category[] => {
1718
return categories.sort((a: Category, b: Category) => {
@@ -84,17 +85,18 @@ export default function CommandMenu() {
8485
</kbd>
8586
</Button>
8687
<CommandDialog open={open} onOpenChange={setOpen}>
88+
<DialogTitle className="sr-only">Search scripts</DialogTitle>
8789
<CommandInput placeholder="search for a script..." />
8890
<CommandList>
8991
<CommandEmpty>No scripts found.</CommandEmpty>
9092
{links.map((category) => (
9193
<CommandGroup
92-
key={"category:" + category.categoryId}
94+
key={"category:" + category.catagoryName}
9395
heading={category.catagoryName}
9496
>
9597
{category.expand.items.map((script) => (
9698
<CommandItem
97-
key={"script:"+script.id}
99+
key={"script:" + script.id}
98100
value={script.title}
99101
onSelect={() => {
100102
setOpen(false);
@@ -106,6 +108,10 @@ export default function CommandMenu() {
106108
src={script.logo}
107109
unoptimized
108110
height={16}
111+
onError={(e) =>
112+
((e.currentTarget as HTMLImageElement).src =
113+
"/logo.png")
114+
}
109115
width={16}
110116
alt=""
111117
className="h-5 w-5"

src/components/Footer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import Link from "next/link";
22

33
export default function Footer() {
44
return (
5-
<div className="supports-backdrop-blur:bg-background/90 justify-betw mt-auto flex border-t border-border bg-background/40 py-6 backdrop-blur-lg">
5+
<div className="supports-backdrop-blur:bg-background/90 mt-auto flex border-t border-border bg-background/40 py-6 backdrop-blur-lg">
66
<div className="flex w-full justify-between">
7-
<div className="mx-6 w-full max-w-7xl text-sm">
7+
<div className="mx-6 w-full max-w-7xl text-sm text-muted-foreground">
88
Website build by{" "}
99
<Link
1010
href="https://github.com/BramSuurdje"

src/components/ui/codeblock.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const handleCopy = (type: string, value: string) => {
6767
<div>
6868
<Button className="text-white">
6969
<Link
70-
href="https://github.com/tteck/Proxmox"
70+
href="https://github.com/community-scripts/ProxmoxVE"
7171
data-umami-event="Star on Github"
7272
target="_blank"
7373
>

src/components/ui/star-on-github-button.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import NumberTicker from "../magicui/number-ticker";
66
import { buttonVariants } from "./button";
77

88
export default function StarOnGithubButton() {
9-
const [stars, setStars] = useState(13000);
9+
const [stars, setStars] = useState(0);
1010

1111
useEffect(() => {
1212
const fetchStars = async () => {
1313
try {
14-
const res = await fetch("https://api.github.com/repos/tteck/Proxmox", {
14+
const res = await fetch("https://api.github.com/repos/community-scripts/ProxmoxVE", {
1515
next: { revalidate: 60 * 60 * 24 },
1616
});
1717

@@ -34,7 +34,7 @@ export default function StarOnGithubButton() {
3434
"group relative justify-center gap-2 rounded-md transition-all duration-300 ease-out hover:ring-2 hover:ring-primary hover:ring-offset-2",
3535
)}
3636
target="_blank"
37-
href="https://github.com/tteck/Proxmox"
37+
href="https://github.com/community-scripts/ProxmoxVE"
3838
>
3939
<span className="absolute right-0 -mt-12 h-32 translate-x-12 rotate-12 bg-white opacity-10 transition-all duration-1000 ease-out group-hover:-translate-x-40" />
4040
<div className="flex items-center">

src/config/siteConfig.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { FaGithub } from "react-icons/fa";
33

44
export const navbarLinks = [
55
{
6-
href: "https://github.com/tteck/Proxmox",
6+
href: "https://github.com/community-scripts/ProxmoxVE",
77
event: "Github",
88
icon: <FaGithub className="h-4 w-4" />,
99
text: "Github",
1010
},
1111
{
12-
href: "https://github.com/tteck/Proxmox/blob/main/CHANGELOG.md",
12+
href: "https://github.com/community-scripts/ProxmoxVE/blob/main/CHANGELOG.md",
1313
event: "Change Log",
1414
icon: <Scroll className="h-4 w-4" />,
1515
text: "Change Log",
1616
},
1717
{
18-
href: "https://github.com/tteck/Proxmox/discussions",
18+
href: "https://github.com/community-scripts/ProxmoxVE/discussions",
1919
event: "Discussions",
2020
icon: <MessagesSquare className="h-4 w-4" />,
2121
text: "Discussions",

src/lib/TextCopyBlock.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button } from "@/components/ui/button";
22
import handleCopy from "./handleCopy";
3-
import { Copy } from "lucide-react";
3+
import { ClipboardIcon, Copy } from "lucide-react";
44

55
export default function TextCopyBlock(description: string) {
66
const pattern = /`([^`]*)`/g;
@@ -14,7 +14,7 @@ export default function TextCopyBlock(description: string) {
1414
className="bg-secondary py-1 px-2 rounded-lg inline-flex items-center gap-2"
1515
>
1616
{part}
17-
<Copy
17+
<ClipboardIcon
1818
className="size-3 cursor-pointer"
1919
onClick={() => handleCopy("command", part)}
2020
/>

0 commit comments

Comments
 (0)