mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-17 06:54:34 +00:00
Improvements for certificates table, adds expansion object to certificates
This commit is contained in:
11
frontend/src/components/Monospace.tsx
Normal file
11
frontend/src/components/Monospace.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import { Text, TextProps } from "@chakra-ui/react";
|
||||
|
||||
function Monospace(props: TextProps) {
|
||||
return (
|
||||
<Text as="span" className="monospace" {...props}>
|
||||
{props.children}
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
|
||||
export { Monospace };
|
@ -1,5 +1,5 @@
|
||||
import { Avatar, Badge, Text, Tooltip } from "@chakra-ui/react";
|
||||
import { RowAction, RowActionsMenu } from "components";
|
||||
import { Monospace, RowAction, RowActionsMenu } from "components";
|
||||
import { intl } from "locale";
|
||||
import getNiceDNSProvider from "modules/Acmesh";
|
||||
|
||||
@ -73,13 +73,19 @@ function CapabilitiesFormatter() {
|
||||
|
||||
function CertificateStatusFormatter() {
|
||||
const formatCell = ({ value }: any) => {
|
||||
return (
|
||||
<Badge color={value ? "cyan.500" : "red.400"}>
|
||||
{value
|
||||
? intl.formatMessage({ id: "ready" })
|
||||
: intl.formatMessage({ id: "setup-required" })}
|
||||
</Badge>
|
||||
);
|
||||
let color = "cyan.500";
|
||||
switch (value) {
|
||||
case "failed":
|
||||
color = "red.400";
|
||||
break;
|
||||
case "provided":
|
||||
color = "green.400";
|
||||
break;
|
||||
case "requesting":
|
||||
color = "yellow.400";
|
||||
break;
|
||||
}
|
||||
return <Badge color={color}>{intl.formatMessage({ id: value })}</Badge>;
|
||||
};
|
||||
|
||||
return formatCell;
|
||||
@ -185,6 +191,14 @@ function HostStatusFormatter() {
|
||||
return formatCell;
|
||||
}
|
||||
|
||||
function MonospaceFormatter() {
|
||||
const formatCell = ({ value }: any) => {
|
||||
return <Monospace>{value}</Monospace>;
|
||||
};
|
||||
|
||||
return formatCell;
|
||||
}
|
||||
|
||||
function UpstreamStatusFormatter() {
|
||||
const formatCell = ({ value, row }: any) => {
|
||||
if (value === "ready") {
|
||||
@ -245,6 +259,7 @@ export {
|
||||
HostStatusFormatter,
|
||||
HostTypeFormatter,
|
||||
IDFormatter,
|
||||
MonospaceFormatter,
|
||||
SecondsFormatter,
|
||||
UpstreamStatusFormatter,
|
||||
};
|
||||
|
@ -5,6 +5,7 @@ export * from "./HelpDrawer";
|
||||
export * from "./Loader";
|
||||
export * from "./Loading";
|
||||
export * from "./LocalePicker";
|
||||
export * from "./Monospace";
|
||||
export * from "./Navigation";
|
||||
export * from "./Permissions";
|
||||
export * from "./PrettyButton";
|
||||
|
Reference in New Issue
Block a user