mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-07 04:58:44 +02:00
Fix info box ui
This commit is contained in:
@@ -461,7 +461,7 @@ export async function handleAiGatewayProxy(
|
||||
const def = AI_CAPABILITY_DEFS[capability];
|
||||
|
||||
const host = (
|
||||
(req.headers["p-host"] as string | undefined) ||
|
||||
(req.headers["p-host"] as string | undefined) || // p-host is only used sometimes when overriding the host header for some middleware proxy
|
||||
req.headers.host ||
|
||||
""
|
||||
).split(":")[0];
|
||||
|
||||
@@ -4,7 +4,7 @@ import { fetchSiteResourceByNiceId } from "@app/lib/fetchSiteResourceByNiceId";
|
||||
import { getCachedOrg } from "@app/lib/api/getCachedOrg";
|
||||
import OrgProvider from "@app/providers/OrgProvider";
|
||||
import SiteResourceProvider from "@app/providers/SiteResourceProvider";
|
||||
import SiteResourceInfoBox from "@app/components/SiteResourceInfoBox";
|
||||
import SiteResourceInfoBox from "@app/components/PrivateResourceInfoBox";
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
@@ -105,7 +105,7 @@ export default async function ResourceLayout(props: ResourceLayoutProps) {
|
||||
}
|
||||
);
|
||||
|
||||
if (!env.flags.disableEnterpriseFeatures) {
|
||||
if (!env.flags.disableEnterpriseFeatures && resource.mode !== "inference") {
|
||||
navItems.push({
|
||||
title: t("maintenanceMode"),
|
||||
href: `/{orgId}/settings/resources/public/{niceId}/maintenance`
|
||||
|
||||
@@ -80,7 +80,7 @@ function AccessMethodContent({
|
||||
);
|
||||
}
|
||||
|
||||
export function SiteResourceInfoSections({
|
||||
export function PrivateResourceInfoSections({
|
||||
siteResource,
|
||||
access,
|
||||
variant,
|
||||
@@ -109,12 +109,16 @@ export function SiteResourceInfoSections({
|
||||
udpPortRangeString: siteResource.udpPortRangeString ?? "*"
|
||||
});
|
||||
const showAlias =
|
||||
siteResource.mode !== "cidr" && siteResource.mode !== "http";
|
||||
const showDestination = !(
|
||||
siteResource.mode === "ssh" && siteResource.authDaemonMode === "native"
|
||||
);
|
||||
siteResource.mode !== "cidr" &&
|
||||
siteResource.mode !== "http" &&
|
||||
siteResource.mode !== "inference";
|
||||
const showDestination =
|
||||
!(
|
||||
siteResource.mode === "ssh" &&
|
||||
siteResource.authDaemonMode === "native"
|
||||
) && siteResource.mode !== "inference";
|
||||
const showCertificate = !!(
|
||||
siteResource.mode === "http" &&
|
||||
(siteResource.mode === "http" || siteResource.mode === "inference") &&
|
||||
siteResource.ssl &&
|
||||
siteResource.domainId &&
|
||||
siteResource.fullDomain &&
|
||||
@@ -258,7 +262,7 @@ export default function SiteResourceInfoBox({
|
||||
});
|
||||
|
||||
return (
|
||||
<SiteResourceInfoSections
|
||||
<PrivateResourceInfoSections
|
||||
siteResource={siteResource}
|
||||
access={access}
|
||||
variant={variant}
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
InfoSections,
|
||||
InfoSectionTitle
|
||||
} from "@app/components/InfoSection";
|
||||
import { SiteResourceInfoSections } from "@app/components/SiteResourceInfoBox";
|
||||
import { PrivateResourceInfoSections } from "@app/components/PrivateResourceInfoBox";
|
||||
import {
|
||||
SettingsSection,
|
||||
SettingsSectionBody,
|
||||
@@ -353,7 +353,7 @@ function PrivateResourceDetails({
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
<SiteResourceInfoSections
|
||||
<PrivateResourceInfoSections
|
||||
siteResource={resource}
|
||||
access={{
|
||||
accessDisplay: launcherResource.accessDisplay,
|
||||
|
||||
@@ -74,7 +74,10 @@ export function formatSiteResourceAccess(
|
||||
};
|
||||
}
|
||||
|
||||
if (resource.mode === "http" && resource.fullDomain) {
|
||||
if (
|
||||
(resource.mode === "http" || resource.mode == "inference") &&
|
||||
resource.fullDomain
|
||||
) {
|
||||
const url = `${resource.ssl ? "https" : "http"}://${resource.fullDomain}`;
|
||||
return {
|
||||
accessDisplay: url,
|
||||
|
||||
Reference in New Issue
Block a user