mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-07 21:19:03 +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 def = AI_CAPABILITY_DEFS[capability];
|
||||||
|
|
||||||
const host = (
|
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 ||
|
req.headers.host ||
|
||||||
""
|
""
|
||||||
).split(":")[0];
|
).split(":")[0];
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { fetchSiteResourceByNiceId } from "@app/lib/fetchSiteResourceByNiceId";
|
|||||||
import { getCachedOrg } from "@app/lib/api/getCachedOrg";
|
import { getCachedOrg } from "@app/lib/api/getCachedOrg";
|
||||||
import OrgProvider from "@app/providers/OrgProvider";
|
import OrgProvider from "@app/providers/OrgProvider";
|
||||||
import SiteResourceProvider from "@app/providers/SiteResourceProvider";
|
import SiteResourceProvider from "@app/providers/SiteResourceProvider";
|
||||||
import SiteResourceInfoBox from "@app/components/SiteResourceInfoBox";
|
import SiteResourceInfoBox from "@app/components/PrivateResourceInfoBox";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { getTranslations } from "next-intl/server";
|
import { getTranslations } from "next-intl/server";
|
||||||
import { redirect } from "next/navigation";
|
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({
|
navItems.push({
|
||||||
title: t("maintenanceMode"),
|
title: t("maintenanceMode"),
|
||||||
href: `/{orgId}/settings/resources/public/{niceId}/maintenance`
|
href: `/{orgId}/settings/resources/public/{niceId}/maintenance`
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ function AccessMethodContent({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SiteResourceInfoSections({
|
export function PrivateResourceInfoSections({
|
||||||
siteResource,
|
siteResource,
|
||||||
access,
|
access,
|
||||||
variant,
|
variant,
|
||||||
@@ -109,12 +109,16 @@ export function SiteResourceInfoSections({
|
|||||||
udpPortRangeString: siteResource.udpPortRangeString ?? "*"
|
udpPortRangeString: siteResource.udpPortRangeString ?? "*"
|
||||||
});
|
});
|
||||||
const showAlias =
|
const showAlias =
|
||||||
siteResource.mode !== "cidr" && siteResource.mode !== "http";
|
siteResource.mode !== "cidr" &&
|
||||||
const showDestination = !(
|
siteResource.mode !== "http" &&
|
||||||
siteResource.mode === "ssh" && siteResource.authDaemonMode === "native"
|
siteResource.mode !== "inference";
|
||||||
);
|
const showDestination =
|
||||||
|
!(
|
||||||
|
siteResource.mode === "ssh" &&
|
||||||
|
siteResource.authDaemonMode === "native"
|
||||||
|
) && siteResource.mode !== "inference";
|
||||||
const showCertificate = !!(
|
const showCertificate = !!(
|
||||||
siteResource.mode === "http" &&
|
(siteResource.mode === "http" || siteResource.mode === "inference") &&
|
||||||
siteResource.ssl &&
|
siteResource.ssl &&
|
||||||
siteResource.domainId &&
|
siteResource.domainId &&
|
||||||
siteResource.fullDomain &&
|
siteResource.fullDomain &&
|
||||||
@@ -258,7 +262,7 @@ export default function SiteResourceInfoBox({
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SiteResourceInfoSections
|
<PrivateResourceInfoSections
|
||||||
siteResource={siteResource}
|
siteResource={siteResource}
|
||||||
access={access}
|
access={access}
|
||||||
variant={variant}
|
variant={variant}
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
InfoSections,
|
InfoSections,
|
||||||
InfoSectionTitle
|
InfoSectionTitle
|
||||||
} from "@app/components/InfoSection";
|
} from "@app/components/InfoSection";
|
||||||
import { SiteResourceInfoSections } from "@app/components/SiteResourceInfoBox";
|
import { PrivateResourceInfoSections } from "@app/components/PrivateResourceInfoBox";
|
||||||
import {
|
import {
|
||||||
SettingsSection,
|
SettingsSection,
|
||||||
SettingsSectionBody,
|
SettingsSectionBody,
|
||||||
@@ -353,7 +353,7 @@ function PrivateResourceDetails({
|
|||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
<SiteResourceInfoSections
|
<PrivateResourceInfoSections
|
||||||
siteResource={resource}
|
siteResource={resource}
|
||||||
access={{
|
access={{
|
||||||
accessDisplay: launcherResource.accessDisplay,
|
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}`;
|
const url = `${resource.ssl ? "https" : "http"}://${resource.fullDomain}`;
|
||||||
return {
|
return {
|
||||||
accessDisplay: url,
|
accessDisplay: url,
|
||||||
|
|||||||
Reference in New Issue
Block a user