Compare commits

..

4 Commits

Author SHA1 Message Date
github-actions[bot]
c63e1dc78a
Update CHANGELOG.md (#372)
Some checks are pending
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Deploy Next.js site to Pages / deploy (push) Blocked by required conditions
Deploy Next.js site to Pages / build (push) Waiting to run
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-19 22:31:13 +01:00
CanbiZ
06fd1aee26
Add *Arr Suite category for Website (#370)
* Update metadata.json

* add bazarr to category 18

* add lidarr to category 18

* add notifarr to category 18

* add prowlarr to category 18

* add radarr to category 18

* add readarr to category 18

* add recyclarr to category 18

* add sonarr to category 18

* add tdarr to category 18

* add whisparr to category 18

* add homarr to category 18

* add category 18 to autobrr

* change sort order

---------

Co-authored-by: Håvard Thom <haavardthom91@hotmail.com>
2024-11-19 22:26:46 +01:00
Bram Suurd
6e71047570
Refactor Buttons component to use a ButtonLink for cleaner code, simplifying the source URL generation and layout (#371)
* Refactor Buttons component to use a ButtonLink for cleaner code, simplifying the source URL generation and layout

* Refactor DefaultPassword component to simplify credential handling and enhance code readability with map function

* Refactor DefaultSettings component to improve resource display logic and enhance readability using a new ResourceDisplay subcomponent
2024-11-19 22:21:00 +01:00
github-actions[bot]
9f80cec2d9
Update CHANGELOG.md (#369)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-19 22:18:15 +01:00
17 changed files with 150 additions and 157 deletions

View File

@ -25,12 +25,18 @@ Do not break established syntax in this file, as it is automatically updated by
### 🚀 Updated Scripts
- Fix Wallos Update [@MickLesk](https://github.com/MickLesk) ([#339](https://github.com/community-scripts/ProxmoxVE/pull/339))
- Linkwarden: Move Secret Key above in install.sh [@MickLesk](https://github.com/MickLesk) ([#356](https://github.com/community-scripts/ProxmoxVE/pull/356))
- Linkwarden: add gnupg to installed dependencies [@erfansamandarian](https://github.com/erfansamandarian) ([#349](https://github.com/community-scripts/ProxmoxVE/pull/349))
- Fix Wallos Update [@MickLesk](https://github.com/MickLesk) ([#339](https://github.com/community-scripts/ProxmoxVE/pull/339))
### 🌐 Website
- Add *Arr Suite category for Website [@MickLesk](https://github.com/MickLesk) ([#370](https://github.com/community-scripts/ProxmoxVE/pull/370))
- Refactor Buttons component to use a ButtonLink for cleaner code, simplifying the source URL generation and layout [@BramSuurdje](https://github.com/BramSuurdje) ([#371](https://github.com/community-scripts/ProxmoxVE/pull/371))
### 🧰 Maintenance
- [github]: add new Frontend_Report / Issue_Report & optimize config.yml [@MickLesk](https://github.com/MickLesk) ([#226](https://github.com/community-scripts/ProxmoxVE/pull/226))
- [chore] Update FUNDING.yml [@MickLesk](https://github.com/MickLesk) ([#352](https://github.com/community-scripts/ProxmoxVE/pull/352))
## 2024-11-18

View File

@ -5,45 +5,53 @@ import { BookOpenText, Code, Globe } from "lucide-react";
import Link from "next/link";
const generateSourceUrl = (slug: string, type: string) => {
if (type === "ct") {
return `https://raw.githubusercontent.com/community-scripts/${basePath}/main/install/${slug}-install.sh`;
} else {
return `https://raw.githubusercontent.com/community-scripts/${basePath}/main/${type}/${slug}.sh`;
}
const baseUrl = `https://raw.githubusercontent.com/community-scripts/${basePath}/main`;
return type === "ct"
? `${baseUrl}/install/${slug}-install.sh`
: `${baseUrl}/${type}/${slug}.sh`;
};
interface ButtonLinkProps {
href: string;
icon: React.ReactNode;
text: string;
}
const ButtonLink = ({ href, icon, text }: ButtonLinkProps) => (
<Button variant="secondary" asChild>
<Link target="_blank" href={href}>
<span className="flex items-center gap-2">
{icon}
{text}
</span>
</Link>
</Button>
);
export default function Buttons({ item }: { item: Script }) {
const buttons = [
item.website && {
href: item.website,
icon: <Globe className="h-4 w-4" />,
text: "Website",
},
item.documentation && {
href: item.documentation,
icon: <BookOpenText className="h-4 w-4" />,
text: "Documentation",
},
{
href: generateSourceUrl(item.slug, item.type),
icon: <Code className="h-4 w-4" />,
text: "Source Code",
},
].filter(Boolean) as ButtonLinkProps[];
return (
<div className="flex flex-wrap justify-end gap-2">
{item.website && (
<Button variant="secondary" asChild>
<Link target="_blank" href={item.website}>
<span className="flex items-center gap-2">
<Globe className="h-4 w-4" /> Website
</span>
</Link>
</Button>
)}
{item.documentation && (
<Button variant="secondary" asChild>
<Link target="_blank" href={item.documentation}>
<span className="flex items-center gap-2">
<BookOpenText className="h-4 w-4" />
Documentation
</span>
</Link>
</Button>
)}
{
<Button variant="secondary" asChild>
<Link target="_blank" href={generateSourceUrl(item.slug, item.type)}>
<span className="flex items-center gap-2">
<Code className="h-4 w-4" />
Source Code
</span>
</Link>
</Button>
}
{buttons.map((props, index) => (
<ButtonLink key={index} {...props} />
))}
</div>
);
}

View File

@ -4,55 +4,39 @@ import { Separator } from "@/components/ui/separator";
import { Script } from "@/lib/types";
export default function DefaultPassword({ item }: { item: Script }) {
const hasDefaultLogin =
item.default_credentials.username && item.default_credentials.password;
const { username, password } = item.default_credentials;
const hasDefaultLogin = username && password;
if (!hasDefaultLogin) return null;
const copyCredential = (type: "username" | "password") => {
handleCopy(type, item.default_credentials[type] ?? "");
};
return (
<div>
{hasDefaultLogin && (
<div className="mt-4 rounded-lg border bg-accent/50">
<div className="flex gap-3 px-4 py-2">
<h2 className="text-lg font-semibold">Default Login Credentials</h2>
<div className="mt-4 rounded-lg border bg-accent/50">
<div className="flex gap-3 px-4 py-2">
<h2 className="text-lg font-semibold">Default Login Credentials</h2>
</div>
<Separator className="w-full" />
<div className="flex flex-col gap-2 p-4">
<p className="mb-2 text-sm">
You can use the following credentials to login to the {item.name}{" "}
{item.type}.
</p>
{["username", "password"].map((type) => (
<div key={type} className="text-sm">
{type.charAt(0).toUpperCase() + type.slice(1)}:{" "}
<Button
variant="secondary"
size="null"
onClick={() => copyCredential(type as "username" | "password")}
>
{item.default_credentials[type as "username" | "password"]}
</Button>
</div>
<Separator className="w-full"></Separator>
<div className="flex flex-col gap-2 p-4">
<p className="mb-2 text-sm">
You can use the following credentials to login to the {""}
{item.name} {item.type}.
</p>
<div className="text-sm">
Username:{" "}
<Button
variant={"secondary"}
size={"null"}
onClick={() =>
handleCopy(
"username",
item.default_credentials.username ?? "",
)
}
>
{item.default_credentials.username}
</Button>
</div>
<div className="text-sm">
Password:{" "}
<Button
variant={"secondary"}
size={"null"}
onClick={() =>
handleCopy(
"password",
item.default_credentials.password ?? "",
)
}
>
{item.default_credentials.password}
</Button>
</div>
</div>
</div>
)}
))}
</div>
</div>
);
}

View File

@ -1,56 +1,50 @@
import { Script } from "@/lib/types";
export default function DefaultSettings({ item }: { item: Script }) {
const getDisplayValueFromRAM = (ram: number) =>
ram >= 1024 ? `${Math.floor(ram / 1024)}GB` : `${ram}MB`;
const ResourceDisplay = ({
settings,
title,
}: {
settings: (typeof item.install_methods)[0];
title: string;
}) => {
const { cpu, ram, hdd } = settings.resources;
return (
<div>
<h2 className="text-md font-semibold">{title}</h2>
<p className="text-sm text-muted-foreground">CPU: {cpu}vCPU</p>
<p className="text-sm text-muted-foreground">
RAM: {getDisplayValueFromRAM(ram ?? 0)}
</p>
<p className="text-sm text-muted-foreground">HDD: {hdd}GB</p>
</div>
);
};
const defaultSettings = item.install_methods.find(
(method) => method.type === "default",
);
const defaultSettingsAvailable =
defaultSettings?.resources.cpu ||
defaultSettings?.resources.ram ||
defaultSettings?.resources.hdd;
const defaultAlpineSettings = item.install_methods.find(
(method) => method.type === "alpine",
);
const getDisplayValueFromRAM = (ram: number) => {
if (ram >= 1024) {
return (ram / 1024).toFixed(0) + "GB";
}
return ram + "MB";
};
const hasDefaultSettings =
defaultSettings?.resources &&
Object.values(defaultSettings.resources).some(Boolean);
return (
<>
{defaultSettingsAvailable && (
<div>
<h2 className="text-md font-semibold">Default settings</h2>
<p className="text-sm text-muted-foreground">
CPU: {defaultSettings?.resources.cpu}vCPU
</p>
<p className="text-sm text-muted-foreground">
RAM: {getDisplayValueFromRAM(defaultSettings?.resources.ram ?? 0)}
</p>
<p className="text-sm text-muted-foreground">
HDD: {defaultSettings?.resources.hdd}GB
</p>
</div>
{hasDefaultSettings && (
<ResourceDisplay settings={defaultSettings} title="Default settings" />
)}
{defaultAlpineSettings && (
<div>
<h2 className="text-md font-semibold">Default Alpine settings</h2>
<p className="text-sm text-muted-foreground">
CPU: {defaultAlpineSettings?.resources.cpu}vCPU
</p>
<p className="text-sm text-muted-foreground">
RAM:{" "}
{getDisplayValueFromRAM(defaultAlpineSettings?.resources.ram ?? 0)}
</p>
<p className="text-sm text-muted-foreground">
HDD: {defaultAlpineSettings?.resources.hdd}GB
</p>
</div>
<ResourceDisplay
settings={defaultAlpineSettings}
title="Default Alpine settings"
/>
)}
</>
);

View File

@ -2,7 +2,7 @@
"name": "Autobrr",
"slug": "autobrr",
"categories": [
16
18
],
"date_created": "2024-05-02",
"type": "ct",

View File

@ -2,7 +2,7 @@
"name": "Bazarr",
"slug": "bazarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Homarr",
"slug": "homarr",
"categories": [
15
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Lidarr",
"slug": "lidarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -3,21 +3,22 @@
[
{"name": "Proxmox VE Tools", "id": 1, "sort_order": 1.0},
{"name": "AdBlocker - DNS", "id": 13, "sort_order": 2.0},
{"name": "Automation", "id": 3, "sort_order": 3.0},
{"name": "Dashboards", "id": 15, "sort_order": 4.0},
{"name": "Database", "id": 5, "sort_order": 5.0},
{"name": "Docker - Kubernetes", "id": 8, "sort_order": 6.0},
{"name": "Document - Notes", "id": 14, "sort_order": 7.0},
{"name": "File - Code", "id": 16, "sort_order": 8.0},
{"name": "Home Assistant", "id": 2, "sort_order": 9.0},
{"name": "Media - Photo", "id": 12, "sort_order": 10.0},
{"name": "Monitoring - Analytics", "id": 7, "sort_order": 11.0},
{"name": "MQTT", "id": 4, "sort_order": 12.0},
{"name": "NVR - DVR", "id": 17, "sort_order": 13.0},
{"name": "Operating System", "id": 9, "sort_order": 14.0},
{"name": "Server - Networking", "id": 11, "sort_order": 15.0},
{"name": "TurnKey", "id": 10, "sort_order": 16.0},
{"name": "Zigbee - Zwave", "id": 6, "sort_order": 17.0},
{"name": "*Arr Suite", "id": 18, "sort_order": 3.0},
{"name": "Automation", "id": 3, "sort_order": 4.0},
{"name": "Dashboards", "id": 15, "sort_order": 5.0},
{"name": "Database", "id": 5, "sort_order": 6.0},
{"name": "Docker - Kubernetes", "id": 8, "sort_order": 7.0},
{"name": "Document - Notes", "id": 14, "sort_order": 8.0},
{"name": "File - Code", "id": 16, "sort_order": 9.0},
{"name": "Home Assistant", "id": 2, "sort_order": 10.0},
{"name": "Media - Photo", "id": 12, "sort_order": 11.0},
{"name": "Monitoring - Analytics", "id": 7, "sort_order": 12.0},
{"name": "MQTT", "id": 4, "sort_order": 13.0},
{"name": "NVR - DVR", "id": 17, "sort_order": 14.0},
{"name": "Operating System", "id": 9, "sort_order": 15.0},
{"name": "Server - Networking", "id": 11, "sort_order": 16.0},
{"name": "TurnKey", "id": 10, "sort_order": 17.0},
{"name": "Matter/Zigbee/ZWave", "id": 6, "sort_order": 18.0},
{"name": "Miscellaneous", "id": 0, "sort_order": 99.0}
]
}

View File

@ -2,7 +2,7 @@
"name": "Notifiarr",
"slug": "notifiarr",
"categories": [
7
18
],
"date_created": "2024-06-12",
"type": "ct",
@ -36,4 +36,4 @@
"type": "warning"
}
]
}
}

View File

@ -2,7 +2,7 @@
"name": "Prowlarr",
"slug": "prowlarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Radarr",
"slug": "radarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Readarr",
"slug": "readarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Recyclarr",
"slug": "recyclarr",
"categories": [
12
18
],
"date_created": "2024-11-15",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Sonarr",
"slug": "sonarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}

View File

@ -2,7 +2,7 @@
"name": "Tdarr",
"slug": "tdarr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -36,4 +36,4 @@
"type": "warning"
}
]
}
}

View File

@ -2,7 +2,7 @@
"name": "Whisparr",
"slug": "whisparr",
"categories": [
12
18
],
"date_created": "2024-05-02",
"type": "ct",
@ -31,4 +31,4 @@
"password": null
},
"notes": []
}
}