1
0
mirror of https://github.com/NginxProxyManager/nginx-proxy-manager.git synced 2025-11-15 22:41:05 +03:00
This commit is contained in:
Jamie Curnow
2025-09-02 23:56:00 +10:00
parent 330993f028
commit fadec9751e
355 changed files with 9308 additions and 17813 deletions

View File

@@ -0,0 +1,13 @@
import type { Certificate } from "src/api/backend";
import { intl } from "src/locale";
interface Props {
certificate?: Certificate;
}
export function CertificateFormatter({ certificate }: Props) {
if (certificate) {
return intl.formatMessage({ id: "lets-encrypt" });
}
return intl.formatMessage({ id: "http-only" });
}

View File

@@ -0,0 +1,25 @@
import { intlFormat, parseISO } from "date-fns";
import { intl } from "src/locale";
interface Props {
domains: string[];
createdOn?: string;
}
export function DomainsFormatter({ domains, createdOn }: Props) {
return (
<div className="flex-fill">
<div className="font-weight-medium">
{domains.map((domain: string) => (
<span key={domain} className="badge badge-lg domain-name">
{domain}
</span>
))}
</div>
{createdOn ? (
<div className="text-secondary mt-1">
{intl.formatMessage({ id: "created-on" }, { date: intlFormat(parseISO(createdOn)) })}
</div>
) : null}
</div>
);
}

View File

@@ -0,0 +1,17 @@
interface Props {
url: string;
name?: string;
}
export function GravatarFormatter({ url, name }: Props) {
return (
<div className="d-flex py-1 align-items-center">
<span
title={name}
className="avatar avatar-2 me-2"
style={{
backgroundImage: `url(${url})`,
}}
/>
</div>
);
}

View File

@@ -0,0 +1,11 @@
import { intl } from "src/locale";
interface Props {
enabled: boolean;
}
export function StatusFormatter({ enabled }: Props) {
if (enabled) {
return <span className="badge bg-lime-lt">{intl.formatMessage({ id: "online" })}</span>;
}
return <span className="badge bg-red-lt">{intl.formatMessage({ id: "offline" })}</span>;
}

View File

@@ -0,0 +1,21 @@
import { intlFormat, parseISO } from "date-fns";
import { intl } from "src/locale";
interface Props {
value: string;
createdOn?: string;
}
export function ValueWithDateFormatter({ value, createdOn }: Props) {
return (
<div className="flex-fill">
<div className="font-weight-medium">
<div className="font-weight-medium">{value}</div>
</div>
{createdOn ? (
<div className="text-secondary mt-1">
{intl.formatMessage({ id: "created-on" }, { date: intlFormat(parseISO(createdOn)) })}
</div>
) : null}
</div>
);
}

View File

@@ -0,0 +1,5 @@
export * from "./CertificateFormatter";
export * from "./DomainsFormatter";
export * from "./GravatarFormatter";
export * from "./StatusFormatter";
export * from "./ValueWithDateFormatter";