Show cert status

This commit is contained in:
Owen
2026-04-22 20:36:00 -07:00
parent 245755a140
commit fc69364feb
2 changed files with 48 additions and 25 deletions

View File

@@ -54,6 +54,7 @@ import { CaretSortIcon } from "@radix-ui/react-icons";
import { MachinesSelector } from "./machines-selector"; import { MachinesSelector } from "./machines-selector";
import DomainPicker from "@app/components/DomainPicker"; import DomainPicker from "@app/components/DomainPicker";
import { SwitchInput } from "@app/components/SwitchInput"; import { SwitchInput } from "@app/components/SwitchInput";
import CertificateStatus from "@app/components/CertificateStatus";
// --- Helpers (shared) --- // --- Helpers (shared) ---
@@ -1072,28 +1073,48 @@ export function InternalResourceForm({
}} }}
/> />
</div> </div>
<FormField <div className="flex items-start justify-between gap-4">
control={form.control} <FormField
name="ssl" control={form.control}
render={({ field }) => ( name="ssl"
<FormItem> render={({ field }) => (
<FormControl> <FormItem className="flex-1">
<SwitchInput <FormControl>
id="internal-resource-ssl" <SwitchInput
label={t(enableSslLabelKey)} id="internal-resource-ssl"
description={t( label={t(enableSslLabelKey)}
enableSslDescriptionKey description={t(
)} enableSslDescriptionKey
checked={!!field.value} )}
onCheckedChange={ checked={!!field.value}
field.onChange onCheckedChange={
} field.onChange
disabled={httpSectionDisabled} }
disabled={httpSectionDisabled}
/>
</FormControl>
</FormItem>
)}
/>
{variant === "edit" &&
resource?.domainId &&
httpConfigFullDomain &&
form.watch("ssl") && (
<div className="flex items-center gap-1 pt-1">
<span className="text-sm font-medium text-muted-foreground">
{t("certificateStatus")}:
</span>
<CertificateStatus
orgId={resource.orgId}
domainId={resource.domainId}
fullDomain={httpConfigFullDomain}
autoFetch={true}
showLabel={false}
polling={true}
/> />
</FormControl> </div>
</FormItem> )}
)} </div>
/>
</div> </div>
) : ( ) : (
<div className="space-y-4"> <div className="space-y-4">

View File

@@ -30,7 +30,7 @@ export default function ResourceInfoBox({}: ResourceInfoBoxType) {
<AlertDescription> <AlertDescription>
{/* 4 cols because of the certs */} {/* 4 cols because of the certs */}
<InfoSections <InfoSections
cols={resource.http && env.flags.usePangolinDns ? 5 : 4} cols={resource.http ? 5 : 4}
> >
<InfoSection> <InfoSection>
<InfoSectionTitle>{t("identifier")}</InfoSectionTitle> <InfoSectionTitle>{t("identifier")}</InfoSectionTitle>
@@ -43,7 +43,10 @@ export default function ResourceInfoBox({}: ResourceInfoBoxType) {
<InfoSection> <InfoSection>
<InfoSectionTitle>URL</InfoSectionTitle> <InfoSectionTitle>URL</InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
<CopyToClipboard text={fullUrl} isLink={true} /> <CopyToClipboard
text={fullUrl}
isLink={true}
/>
</InfoSectionContent> </InfoSectionContent>
</InfoSection> </InfoSection>
<InfoSection> <InfoSection>
@@ -133,8 +136,7 @@ export default function ResourceInfoBox({}: ResourceInfoBoxType) {
{/* Certificate Status Column */} {/* Certificate Status Column */}
{resource.http && {resource.http &&
resource.domainId && resource.domainId &&
resource.fullDomain && resource.fullDomain && (
env.flags.usePangolinDns && (
<InfoSection> <InfoSection>
<InfoSectionTitle> <InfoSectionTitle>
{t("certificateStatus", { {t("certificateStatus", {