mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-15 08:49:59 +02:00
Add initial advantech install commands
This commit is contained in:
@@ -10,7 +10,14 @@ import {
|
|||||||
import { CheckboxWithLabel } from "./ui/checkbox";
|
import { CheckboxWithLabel } from "./ui/checkbox";
|
||||||
import { OptionSelect, type OptionSelectOption } from "./OptionSelect";
|
import { OptionSelect, type OptionSelectOption } from "./OptionSelect";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { FaApple, FaCubes, FaDocker, FaLinux, FaWindows } from "react-icons/fa";
|
import {
|
||||||
|
FaApple,
|
||||||
|
FaCubes,
|
||||||
|
FaDocker,
|
||||||
|
FaHdd,
|
||||||
|
FaLinux,
|
||||||
|
FaWindows
|
||||||
|
} from "react-icons/fa";
|
||||||
import { SiKubernetes, SiNixos } from "react-icons/si";
|
import { SiKubernetes, SiNixos } from "react-icons/si";
|
||||||
|
|
||||||
export type CommandItem = string | { title: string; command: string };
|
export type CommandItem = string | { title: string; command: string };
|
||||||
@@ -20,6 +27,7 @@ const PLATFORMS = [
|
|||||||
"macos",
|
"macos",
|
||||||
"docker",
|
"docker",
|
||||||
"kubernetes",
|
"kubernetes",
|
||||||
|
"advantech",
|
||||||
"podman",
|
"podman",
|
||||||
"nixos",
|
"nixos",
|
||||||
"windows"
|
"windows"
|
||||||
@@ -49,6 +57,7 @@ export function NewtSiteInstallCommands({
|
|||||||
() => getArchitectures(platform)[0]
|
() => getArchitectures(platform)[0]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const showSiteConfiguration = platform !== "advantech";
|
||||||
const supportsSshOption = platform === "linux" || platform === "nixos";
|
const supportsSshOption = platform === "linux" || platform === "nixos";
|
||||||
|
|
||||||
const acceptClientsFlag = !acceptClients ? " --disable-clients" : "";
|
const acceptClientsFlag = !acceptClients ? " --disable-clients" : "";
|
||||||
@@ -193,6 +202,9 @@ sudo systemctl enable --now newt`
|
|||||||
--set-string newtInstances[0].auth.existingSecretName="newt-main-tunnel-auth"${acceptClientsHelmValue}`
|
--set-string newtInstances[0].auth.existingSecretName="newt-main-tunnel-auth"${acceptClientsHelmValue}`
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
advantech: {
|
||||||
|
Documentation: []
|
||||||
|
},
|
||||||
podman: {
|
podman: {
|
||||||
"Podman Quadlet": [
|
"Podman Quadlet": [
|
||||||
`[Unit]
|
`[Unit]
|
||||||
@@ -270,50 +282,52 @@ WantedBy=default.target`
|
|||||||
className="mt-4"
|
className="mt-4"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="pt-4">
|
{showSiteConfiguration && (
|
||||||
<p className="font-semibold mb-3">
|
<div className="pt-4">
|
||||||
{t("siteConfiguration")}
|
<p className="font-semibold mb-3">
|
||||||
</p>
|
{t("siteConfiguration")}
|
||||||
<div className="flex items-center space-x-2 mb-2">
|
</p>
|
||||||
<CheckboxWithLabel
|
<div className="flex items-center space-x-2 mb-2">
|
||||||
id="acceptClients"
|
<CheckboxWithLabel
|
||||||
aria-describedby="acceptClients-desc"
|
id="acceptClients"
|
||||||
checked={acceptClients}
|
aria-describedby="acceptClients-desc"
|
||||||
onCheckedChange={(checked) => {
|
checked={acceptClients}
|
||||||
const value = checked as boolean;
|
onCheckedChange={(checked) => {
|
||||||
setAcceptClients(value);
|
const value = checked as boolean;
|
||||||
}}
|
setAcceptClients(value);
|
||||||
label={t("siteAcceptClientConnections")}
|
}}
|
||||||
/>
|
label={t("siteAcceptClientConnections")}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p
|
||||||
|
id="acceptClients-desc"
|
||||||
|
className="text-sm text-muted-foreground"
|
||||||
|
>
|
||||||
|
{t("siteAcceptClientConnectionsDescription")}
|
||||||
|
</p>
|
||||||
|
{supportsSshOption && (
|
||||||
|
<>
|
||||||
|
<div className="flex items-center space-x-2 mb-2 mt-2">
|
||||||
|
<CheckboxWithLabel
|
||||||
|
id="allowPangolinSsh"
|
||||||
|
checked={allowPangolinSsh}
|
||||||
|
onCheckedChange={(checked) => {
|
||||||
|
const value = checked as boolean;
|
||||||
|
setAllowPangolinSsh(value);
|
||||||
|
}}
|
||||||
|
label="Allow Pangolin SSH"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p
|
||||||
|
id="allowPangolinSsh-desc"
|
||||||
|
className="text-sm text-muted-foreground"
|
||||||
|
>
|
||||||
|
{t("sitePangolinSshDescription")}
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<p
|
)}
|
||||||
id="acceptClients-desc"
|
|
||||||
className="text-sm text-muted-foreground"
|
|
||||||
>
|
|
||||||
{t("siteAcceptClientConnectionsDescription")}
|
|
||||||
</p>
|
|
||||||
{supportsSshOption && (
|
|
||||||
<>
|
|
||||||
<div className="flex items-center space-x-2 mb-2 mt-2">
|
|
||||||
<CheckboxWithLabel
|
|
||||||
id="allowPangolinSsh"
|
|
||||||
checked={allowPangolinSsh}
|
|
||||||
onCheckedChange={(checked) => {
|
|
||||||
const value = checked as boolean;
|
|
||||||
setAllowPangolinSsh(value);
|
|
||||||
}}
|
|
||||||
label="Allow Pangolin SSH"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<p
|
|
||||||
id="allowPangolinSsh-desc"
|
|
||||||
className="text-sm text-muted-foreground"
|
|
||||||
>
|
|
||||||
{t("sitePangolinSshDescription")}
|
|
||||||
</p>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="pt-4">
|
<div className="pt-4">
|
||||||
<p className="font-semibold mb-3">{t("commands")}</p>
|
<p className="font-semibold mb-3">{t("commands")}</p>
|
||||||
@@ -332,6 +346,20 @@ WantedBy=default.target`
|
|||||||
.
|
.
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
{platform === "advantech" && (
|
||||||
|
<p className="text-sm text-muted-foreground mb-3">
|
||||||
|
For Advantech modem installation instructions, see{" "}
|
||||||
|
<a
|
||||||
|
href="https://docs.pangolin.net/manage/sites/install-advantech"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="underline"
|
||||||
|
>
|
||||||
|
docs.pangolin.net/manage/sites/install-advantech
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<div className="mt-2 space-y-3">
|
<div className="mt-2 space-y-3">
|
||||||
{commands.map((item, index) => {
|
{commands.map((item, index) => {
|
||||||
const commandText =
|
const commandText =
|
||||||
@@ -376,6 +404,8 @@ function getPlatformIcon(platformName: Platform) {
|
|||||||
return <FaDocker className="h-4 w-4 mr-2" />;
|
return <FaDocker className="h-4 w-4 mr-2" />;
|
||||||
case "kubernetes":
|
case "kubernetes":
|
||||||
return <SiKubernetes className="h-4 w-4 mr-2" />;
|
return <SiKubernetes className="h-4 w-4 mr-2" />;
|
||||||
|
case "advantech":
|
||||||
|
return <FaHdd className="h-4 w-4 mr-2" />;
|
||||||
case "podman":
|
case "podman":
|
||||||
return <FaCubes className="h-4 w-4 mr-2" />;
|
return <FaCubes className="h-4 w-4 mr-2" />;
|
||||||
case "nixos":
|
case "nixos":
|
||||||
@@ -397,6 +427,8 @@ function getPlatformName(platformName: Platform) {
|
|||||||
return "Docker";
|
return "Docker";
|
||||||
case "kubernetes":
|
case "kubernetes":
|
||||||
return "Kubernetes";
|
return "Kubernetes";
|
||||||
|
case "advantech":
|
||||||
|
return "Advantech";
|
||||||
case "podman":
|
case "podman":
|
||||||
return "Podman";
|
return "Podman";
|
||||||
case "nixos":
|
case "nixos":
|
||||||
@@ -418,6 +450,8 @@ function getArchitectures(platform: Platform) {
|
|||||||
return ["Docker Compose", "Docker Run"];
|
return ["Docker Compose", "Docker Run"];
|
||||||
case "kubernetes":
|
case "kubernetes":
|
||||||
return ["Helm Chart"];
|
return ["Helm Chart"];
|
||||||
|
case "advantech":
|
||||||
|
return ["Documentation"];
|
||||||
case "podman":
|
case "podman":
|
||||||
return ["Podman Quadlet", "Podman Run"];
|
return ["Podman Quadlet", "Podman Run"];
|
||||||
case "nixos":
|
case "nixos":
|
||||||
|
|||||||
Reference in New Issue
Block a user