From f605085021f2aea12d3bd574cbef38f94256b5cb Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:00:01 +0200 Subject: [PATCH] fix bug in tooltip that would always render 'updateable' (#5552) * fix bug in tooltip that would always render 'updateable' * Remove double InstallCommand component from ScriptItems --- .../ScriptItems/install-command.tsx | 148 ------------------ .../_components/script-items/tool-tips.tsx | 2 +- 2 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 frontend/src/app/scripts/_components/ScriptItems/install-command.tsx diff --git a/frontend/src/app/scripts/_components/ScriptItems/install-command.tsx b/frontend/src/app/scripts/_components/ScriptItems/install-command.tsx deleted file mode 100644 index 6d9ca12e3..000000000 --- a/frontend/src/app/scripts/_components/ScriptItems/install-command.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import { Info } from "lucide-react"; - -import type { Script } from "@/lib/types"; - -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { Alert, AlertDescription } from "@/components/ui/alert"; -import CodeCopyButton from "@/components/ui/code-copy-button"; -import { basePath } from "@/config/site-config"; - -import { getDisplayValueFromType } from "../script-info-blocks"; - -function getInstallCommand(scriptPath = "", isAlpine = false, useGitea = false) { - const githubUrl = `https://raw.githubusercontent.com/community-scripts/${basePath}/main/${scriptPath}`; - const giteaUrl = `https://git.community-scripts.org/community-scripts/${basePath}/raw/branch/main/${scriptPath}`; - const url = useGitea ? giteaUrl : githubUrl; - return isAlpine ? `bash -c "$(curl -fsSL ${url})"` : `bash -c "$(curl -fsSL ${url})"`; -} -export default function InstallCommand({ item }: { item: Script }) { - const alpineScript = item.install_methods.find(method => method.type === "alpine"); - const defaultScript = item.install_methods.find(method => method.type === "default"); - - const renderInstructions = (isAlpine = false) => ( - <> -
- {isAlpine - ? ( - <> - As an alternative option, you can use Alpine Linux and the - {" "} - {item.name} - {" "} - package to create a - {" "} - {item.name} - {" "} - {getDisplayValueFromType(item.type)} - {" "} - container with faster creation time and minimal system resource usage. - You are also obliged to adhere to updates provided by the package maintainer. - > - ) - : item.type === "pve" - ? ( - <> - To use the - {" "} - {item.name} - {" "} - script, run the command below **only** in the Proxmox VE Shell. This script is - intended for managing or enhancing the host system directly. - > - ) - : item.type === "addon" - ? ( - <> - This script enhances an existing setup. You can use it inside a running LXC container or directly on the - Proxmox VE host to extend functionality with - {" "} - {item.name} - . - > - ) - : ( - <> - To create a new Proxmox VE - {" "} - {item.name} - {" "} - {getDisplayValueFromType(item.type)} - , run the command below in the - Proxmox VE Shell. - > - )} -
- {isAlpine && ( -- To create a new Proxmox VE Alpine- - {item.name} - {" "} - {getDisplayValueFromType(item.type)} - , run the command below in - the Proxmox VE Shell. -
- )} - > - ); - - const renderGiteaInfo = () => ( -