mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-22 00:35:22 +00:00
Cleaning up ui
This commit is contained in:
@@ -1848,8 +1848,8 @@
|
||||
"retryAttempts": "Retry Attempts",
|
||||
"expectedResponseCodes": "Expected Response Codes",
|
||||
"expectedResponseCodesDescription": "HTTP status code that indicates healthy status. If left blank, 200-300 is considered healthy.",
|
||||
"customHeaders": "Custom Headers",
|
||||
"customHeadersDescription": "Headers new line separated: Header-Name: value",
|
||||
"customHeaders": "Custom Request Headers",
|
||||
"customHeadersDescription": "Request headers sent to the downstream targets. Headers new line separated: Header-Name: value",
|
||||
"headersValidationError": "Headers must be in the format: Header-Name: value",
|
||||
"saveHealthCheck": "Save Health Check",
|
||||
"healthCheckSaved": "Health Check Saved",
|
||||
|
||||
39
src/components/ContactSalesBanner.tsx
Normal file
39
src/components/ContactSalesBanner.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
"use client";
|
||||
|
||||
import { KeyRound, ExternalLink } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
|
||||
export function ContactSalesBanner() {
|
||||
return (
|
||||
<div className="rounded-md border border-black-500/30 bg-linear-to-br from-black-500/10 via-background to-background overflow-hidden">
|
||||
<div className="py-3 px-4">
|
||||
<div className="flex items-center gap-2.5 text-sm text-muted-foreground">
|
||||
<KeyRound className="size-4 shrink-0 text-black-500" />
|
||||
<span>
|
||||
Contact sales to enable this feature.{" "}
|
||||
<Link
|
||||
href="https://click.fossorial.io/ep922"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
Book a demo
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
{" or "}
|
||||
<Link
|
||||
href="https://pangolin.net/contact"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
contact us
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -12,8 +12,7 @@ import {
|
||||
CredenzaTitle
|
||||
} from "@app/components/Credenza";
|
||||
import { Button } from "@app/components/ui/button";
|
||||
import { Plus, X, KeyRound, ExternalLink } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { ContactSalesBanner } from "@app/components/ContactSalesBanner";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
export interface DatadogDestinationCredenzaProps {
|
||||
@@ -50,36 +49,7 @@ export function DatadogDestinationCredenza({
|
||||
</CredenzaHeader>
|
||||
|
||||
<CredenzaBody>
|
||||
<div className="rounded-md border border-black-500/30 bg-linear-to-br from-black-500/10 via-background to-background overflow-hidden">
|
||||
<div className="py-3 px-4">
|
||||
<div className="flex items-center gap-2.5 text-sm text-muted-foreground">
|
||||
<KeyRound className="size-4 shrink-0 text-black-500" />
|
||||
<span>
|
||||
Contact sales to enable this feature.{" "}
|
||||
<Link
|
||||
href="https://click.fossorial.io/ep922"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
Book a demo
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
{" or "}
|
||||
<Link
|
||||
href="https://pangolin.net/contact"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
contact us
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ContactSalesBanner />
|
||||
</CredenzaBody>
|
||||
|
||||
<CredenzaFooter>
|
||||
|
||||
@@ -40,8 +40,7 @@ import { toast } from "@app/hooks/useToast";
|
||||
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { ExternalLink, KeyRound } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { ContactSalesBanner } from "@app/components/ContactSalesBanner";
|
||||
|
||||
export type HealthCheckConfig = {
|
||||
hcEnabled: boolean;
|
||||
@@ -273,12 +272,10 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
hcUnhealthyInterval:
|
||||
initialValues.hcUnhealthyInterval ?? 30,
|
||||
hcTimeout: initialValues.hcTimeout ?? 5,
|
||||
hcHealthyThreshold:
|
||||
initialValues.hcHealthyThreshold ?? 1,
|
||||
hcHealthyThreshold: initialValues.hcHealthyThreshold ?? 1,
|
||||
hcUnhealthyThreshold:
|
||||
initialValues.hcUnhealthyThreshold ?? 1,
|
||||
hcFollowRedirects:
|
||||
initialValues.hcFollowRedirects ?? true,
|
||||
hcFollowRedirects: initialValues.hcFollowRedirects ?? true,
|
||||
hcTlsServerName: initialValues.hcTlsServerName ?? "",
|
||||
hcStatus: initialValues.hcStatus ?? null,
|
||||
hcHeaders: parsedHeaders
|
||||
@@ -415,25 +412,6 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<HorizontalTabs
|
||||
clientSide
|
||||
items={[
|
||||
{
|
||||
title: t("healthCheckTabStrategy"),
|
||||
href: ""
|
||||
},
|
||||
{
|
||||
title: t("healthCheckTabConnection"),
|
||||
href: ""
|
||||
},
|
||||
{
|
||||
title: t("healthCheckTabAdvanced"),
|
||||
href: ""
|
||||
}
|
||||
]}
|
||||
>
|
||||
{/* ── Strategy tab ──────────────────────── */}
|
||||
<div className="space-y-4 mt-4 p-1">
|
||||
{/* Name (submit mode only) */}
|
||||
{mode === "submit" && (
|
||||
<FormField
|
||||
@@ -442,14 +420,14 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
"standaloneHcNameLabel"
|
||||
)}
|
||||
{t("standaloneHcNameLabel")}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
value={field.value as string}
|
||||
value={
|
||||
field.value as string
|
||||
}
|
||||
placeholder={t(
|
||||
"standaloneHcNamePlaceholder"
|
||||
)}
|
||||
@@ -461,6 +439,29 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="mt-5">
|
||||
<HorizontalTabs
|
||||
clientSide
|
||||
items={[
|
||||
{
|
||||
title: t("healthCheckTabStrategy"),
|
||||
|
||||
href: ""
|
||||
},
|
||||
{
|
||||
title: t(
|
||||
"healthCheckTabConnection"
|
||||
),
|
||||
href: ""
|
||||
},
|
||||
{
|
||||
title: t("healthCheckTabAdvanced"),
|
||||
href: ""
|
||||
}
|
||||
]}
|
||||
>
|
||||
{/* ── Strategy tab ──────────────────────── */}
|
||||
<div className="space-y-4 mt-4 p-1">
|
||||
{/* Enable toggle (autoSave mode only) */}
|
||||
{mode === "autoSave" && (
|
||||
<FormField
|
||||
@@ -540,7 +541,9 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)
|
||||
}
|
||||
]}
|
||||
value={field.value}
|
||||
value={
|
||||
field.value
|
||||
}
|
||||
onChange={(
|
||||
value
|
||||
) =>
|
||||
@@ -557,41 +560,6 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Contact-sales banner for SNMP / ICMP */}
|
||||
{showFields && isSnmpOrIcmp && (
|
||||
<div className="rounded-md border border-black-500/30 bg-linear-to-br from-black-500/10 via-background to-background overflow-hidden">
|
||||
<div className="py-3 px-4">
|
||||
<div className="flex items-center gap-2.5 text-sm text-muted-foreground">
|
||||
<KeyRound className="size-4 shrink-0 text-black-500" />
|
||||
<span>
|
||||
Contact sales to enable
|
||||
this feature.{" "}
|
||||
<Link
|
||||
href="https://click.fossorial.io/ep922"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
Book a demo
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
{" or "}
|
||||
<Link
|
||||
href="https://pangolin.net/contact"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
contact us
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* ── Connection tab ────────────────────── */}
|
||||
@@ -602,15 +570,24 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Contact-sales banner for SNMP / ICMP */}
|
||||
{showFields && isSnmpOrIcmp && (
|
||||
<ContactSalesBanner />
|
||||
)}
|
||||
|
||||
{showFields && !isSnmpOrIcmp && (
|
||||
<>
|
||||
{/* Scheme / Hostname / Port */}
|
||||
{isTcp ? (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcHostname"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -641,9 +618,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcPort"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -654,7 +635,9 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
<Input
|
||||
{...field}
|
||||
type="number"
|
||||
min={1}
|
||||
min={
|
||||
1
|
||||
}
|
||||
max={
|
||||
65535
|
||||
}
|
||||
@@ -679,9 +662,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
) : (
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcScheme"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -725,9 +712,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcHostname"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -758,9 +749,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcPort"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -771,7 +766,9 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
<Input
|
||||
{...field}
|
||||
type="number"
|
||||
min={1}
|
||||
min={
|
||||
1
|
||||
}
|
||||
max={
|
||||
65535
|
||||
}
|
||||
@@ -799,9 +796,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
{!isTcp && (
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcMethod"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -854,9 +855,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcPath"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -887,9 +892,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcTimeout"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -960,12 +969,6 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{showFields && isSnmpOrIcmp && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("healthCheckStrategyNotAvailable")}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* ── Advanced tab ──────────────────────── */}
|
||||
@@ -976,6 +979,11 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Contact-sales banner for SNMP / ICMP */}
|
||||
{showFields && isSnmpOrIcmp && (
|
||||
<ContactSalesBanner />
|
||||
)}
|
||||
|
||||
{showFields && !isSnmpOrIcmp && (
|
||||
<>
|
||||
{/* Healthy interval + threshold */}
|
||||
@@ -1210,9 +1218,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
|
||||
{/* Follow redirects */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcFollowRedirects"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-3">
|
||||
<FormLabel className="cursor-pointer">
|
||||
{t(
|
||||
@@ -1241,9 +1253,13 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
|
||||
{/* Custom headers */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={
|
||||
form.control
|
||||
}
|
||||
name="hcHeaders"
|
||||
render={({ field }) => (
|
||||
render={({
|
||||
field
|
||||
}) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t(
|
||||
@@ -1264,7 +1280,9 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
field.onChange
|
||||
)
|
||||
}
|
||||
rows={4}
|
||||
rows={
|
||||
4
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
@@ -1280,14 +1298,9 @@ export function HealthCheckCredenza(props: HealthCheckCredenzaProps) {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
{showFields && isSnmpOrIcmp && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{t("healthCheckStrategyNotAvailable")}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</HorizontalTabs>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
</CredenzaBody>
|
||||
|
||||
@@ -150,7 +150,7 @@ export default function HealthChecksTable({
|
||||
</Button>
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<span>{row.original.name}</span>
|
||||
<span>{row.original.name ? row.original.name : "-"}</span>
|
||||
)
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import {
|
||||
Credenza,
|
||||
CredenzaBody,
|
||||
@@ -12,8 +12,7 @@ import {
|
||||
CredenzaTitle
|
||||
} from "@app/components/Credenza";
|
||||
import { Button } from "@app/components/ui/button";
|
||||
import { Plus, X, KeyRound, ExternalLink } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { ContactSalesBanner } from "@app/components/ContactSalesBanner";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
export interface S3DestinationCredenzaProps {
|
||||
@@ -50,36 +49,7 @@ export function S3DestinationCredenza({
|
||||
</CredenzaHeader>
|
||||
|
||||
<CredenzaBody>
|
||||
<div className="rounded-md border border-black-500/30 bg-linear-to-br from-black-500/10 via-background to-background overflow-hidden">
|
||||
<div className="py-3 px-4">
|
||||
<div className="flex items-center gap-2.5 text-sm text-muted-foreground">
|
||||
<KeyRound className="size-4 shrink-0 text-black-500" />
|
||||
<span>
|
||||
Contact sales to enable this feature.{" "}
|
||||
<Link
|
||||
href="https://click.fossorial.io/ep922"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
Book a demo
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
{" or "}
|
||||
<Link
|
||||
href="https://pangolin.net/contact"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1 font-medium text-black-600 underline"
|
||||
>
|
||||
contact us
|
||||
<ExternalLink className="size-3.5 shrink-0" />
|
||||
</Link>
|
||||
.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ContactSalesBanner />
|
||||
</CredenzaBody>
|
||||
|
||||
<CredenzaFooter>
|
||||
|
||||
Reference in New Issue
Block a user