"use client"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { InfoIcon, ShieldCheck, ShieldOff } from "lucide-react"; import { useResourceContext } from "@app/hooks/useResourceContext"; import CopyToClipboard from "@app/components/CopyToClipboard"; import { InfoSection, InfoSectionContent, InfoSections, InfoSectionTitle } from "@app/components/InfoSection"; import { useTranslations } from "next-intl"; import { build } from "@server/build"; import CertificateStatus from "@app/components/private/CertificateStatus"; import { toUnicode } from "punycode"; import { useEnvContext } from "@app/hooks/useEnvContext"; type ResourceInfoBoxType = {}; export default function ResourceInfoBox({}: ResourceInfoBoxType) { const { resource, authInfo } = useResourceContext(); const { env } = useEnvContext(); const t = useTranslations(); const fullUrl = `${resource.ssl ? "https" : "http"}://${toUnicode(resource.fullDomain || "")}`; return ( {/* 4 cols because of the certs */} {resource.http ? ( <> {t("authentication")} {authInfo.password || authInfo.pincode || authInfo.sso || authInfo.whitelist ? (
{t("protected")}
) : (
{t("notProtected")}
)}
URL {/* {isEnabled && ( Socket {isAvailable ? (
Online
) : (
Offline
)}
)} */} ) : ( <> {t("protocol")} {resource.protocol.toUpperCase()} {t("port")} {/* {build == "oss" && ( {t("externalProxyEnabled")} {resource.enableProxy ? t("enabled") : t("disabled")} )} */} )} {/* */} {/* {t('visibility')} */} {/* */} {/* */} {/* {resource.enabled ? t('enabled') : t('disabled')} */} {/* */} {/* */} {/* */} {/* Certificate Status Column */} {resource.http && resource.domainId && resource.fullDomain && build != "oss" && ( {t("certificateStatus", { defaultValue: "Certificate" })} )} {t("visibility")} {resource.enabled ? t("enabled") : t("disabled")}
); }