mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-04 17:35:15 +00:00
User table polishing, user delete modal
This commit is contained in:
@@ -66,7 +66,9 @@ export function SiteHeader() {
|
||||
<div className="d-none d-xl-block ps-2">
|
||||
<div>{currentUser?.nickname}</div>
|
||||
<div className="mt-1 small text-secondary">
|
||||
{intl.formatMessage({ id: isAdmin ? "administrator" : "standard-user" })}
|
||||
{intl.formatMessage({
|
||||
id: isAdmin ? "role.admin" : "role.standard-user",
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -10,9 +10,9 @@ export function DomainsFormatter({ domains, createdOn }: Props) {
|
||||
<div className="flex-fill">
|
||||
<div className="font-weight-medium">
|
||||
{domains.map((domain: string) => (
|
||||
<span key={domain} className="badge badge-lg domain-name">
|
||||
<a key={domain} href={`http://${domain}`} className="badge bg-yellow-lt domain-name">
|
||||
{domain}
|
||||
</span>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
{createdOn ? (
|
||||
|
||||
10
frontend/src/components/Table/Formatter/EmailFormatter.tsx
Normal file
10
frontend/src/components/Table/Formatter/EmailFormatter.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
interface Props {
|
||||
email: string;
|
||||
}
|
||||
export function EmailFormatter({ email }: Props) {
|
||||
return (
|
||||
<a href={`mailto:${email}`} className="badge bg-yellow-lt">
|
||||
{email}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
20
frontend/src/components/Table/Formatter/RolesFormatter.tsx
Normal file
20
frontend/src/components/Table/Formatter/RolesFormatter.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { intl } from "src/locale";
|
||||
|
||||
interface Props {
|
||||
roles: string[];
|
||||
}
|
||||
export function RolesFormatter({ roles }: Props) {
|
||||
const r = roles || [];
|
||||
if (r.length === 0) {
|
||||
r[0] = "standard-user";
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{r.map((role: string) => (
|
||||
<span key={role} className="badge bg-yellow-lt me-1">
|
||||
{intl.formatMessage({ id: `role.${role}` })}
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4,16 +4,19 @@ import { intl } from "src/locale";
|
||||
interface Props {
|
||||
value: string;
|
||||
createdOn?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
export function ValueWithDateFormatter({ value, createdOn }: Props) {
|
||||
export function ValueWithDateFormatter({ value, createdOn, disabled }: Props) {
|
||||
return (
|
||||
<div className="flex-fill">
|
||||
<div className="font-weight-medium">
|
||||
<div className="font-weight-medium">{value}</div>
|
||||
<div className={`font-weight-medium ${disabled ? "text-red" : ""}`}>{value}</div>
|
||||
</div>
|
||||
{createdOn ? (
|
||||
<div className="text-secondary mt-1">
|
||||
{intl.formatMessage({ id: "created-on" }, { date: intlFormat(parseISO(createdOn)) })}
|
||||
<div className={`text-secondary mt-1 ${disabled ? "text-red" : ""}`}>
|
||||
{disabled
|
||||
? intl.formatMessage({ id: "disabled" })
|
||||
: intl.formatMessage({ id: "created-on" }, { date: intlFormat(parseISO(createdOn)) })}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
export * from "./CertificateFormatter";
|
||||
export * from "./DomainsFormatter";
|
||||
export * from "./EmailFormatter";
|
||||
export * from "./GravatarFormatter";
|
||||
export * from "./RolesFormatter";
|
||||
export * from "./StatusFormatter";
|
||||
export * from "./ValueWithDateFormatter";
|
||||
|
||||
Reference in New Issue
Block a user