Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

refactor: update layout styles across admin pages to improve consistency and remove unnecessary background classes

Victor Hugo dos Santos00630be2415b
diff --git a/frontend/src/layouts/AdminLayout/AdminLayout.tsx b/frontend/src/layouts/AdminLayout/AdminLayout.tsx
index d3f1872b58..8e65621b33 100644
--- a/frontend/src/layouts/AdminLayout/AdminLayout.tsx
+++ b/frontend/src/layouts/AdminLayout/AdminLayout.tsx
@@ -24,7 +24,7 @@ export const AdminLayout = () => {
<>
<Banner />
<SidebarProvider
- className={`dark ${containerHeight} flex !min-h-0 w-full flex-col overflow-hidden bg-background transition-all`}
+ className={`dark ${containerHeight} flex !min-h-0 w-full flex-col overflow-hidden bg-page transition-all`}
>
<Navbar />
{!isLoading && !serverDetails?.redisConfigured && <RedisBanner />}
@@ -33,7 +33,7 @@ export const AdminLayout = () => {
{!window.isSecureContext && <InsecureConnectionBanner />}
<div className="flex min-h-0 flex-1">
<AdminSidebar />
- <div className="min-h-0 flex-1 overflow-y-auto bg-background px-4 pt-6 pb-4 text-foreground md:px-8 md:pt-8 xl:px-12 xl:pt-10 dark:scheme-dark">
+ <div className="min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-4 text-foreground md:px-8 md:pt-8 xl:px-12 xl:pt-10 dark:scheme-dark">
<SignupDisabledBanner />
<Outlet />
</div>
diff --git a/frontend/src/pages/admin/AccessManagementPage/AccessManagementPage.tsx b/frontend/src/pages/admin/AccessManagementPage/AccessManagementPage.tsx
index 29838fdd10..fcdb100a83 100644
--- a/frontend/src/pages/admin/AccessManagementPage/AccessManagementPage.tsx
+++ b/frontend/src/pages/admin/AccessManagementPage/AccessManagementPage.tsx
@@ -9,7 +9,7 @@ export const AccessManagementPage = () => {
const { t } = useTranslation();
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Access Control" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/AuthenticationPage/AuthenticationPage.tsx b/frontend/src/pages/admin/AuthenticationPage/AuthenticationPage.tsx
index 2f0e65128b..5dfab7c16d 100644
--- a/frontend/src/pages/admin/AuthenticationPage/AuthenticationPage.tsx
+++ b/frontend/src/pages/admin/AuthenticationPage/AuthenticationPage.tsx
@@ -9,7 +9,7 @@ export const AuthenticationPage = () => {
const { t } = useTranslation();
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Admin" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/CachingPage/CachingPage.tsx b/frontend/src/pages/admin/CachingPage/CachingPage.tsx
index f5a50a9b86..beb95e9d9f 100644
--- a/frontend/src/pages/admin/CachingPage/CachingPage.tsx
+++ b/frontend/src/pages/admin/CachingPage/CachingPage.tsx
@@ -9,7 +9,7 @@ export const CachingPage = () => {
const { t } = useTranslation();
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Admin" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/EncryptionPage/EncryptionPage.tsx b/frontend/src/pages/admin/EncryptionPage/EncryptionPage.tsx
index df1a4b6b79..17be2b9c0a 100644
--- a/frontend/src/pages/admin/EncryptionPage/EncryptionPage.tsx
+++ b/frontend/src/pages/admin/EncryptionPage/EncryptionPage.tsx
@@ -9,7 +9,7 @@ export const EncryptionPage = () => {
const { t } = useTranslation();
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Admin" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/EncryptionPage/components/EncryptionKeyRotationSection.tsx b/frontend/src/pages/admin/EncryptionPage/components/EncryptionKeyRotationSection.tsx
index 584a78cd21..941b895a49 100644
--- a/frontend/src/pages/admin/EncryptionPage/components/EncryptionKeyRotationSection.tsx
+++ b/frontend/src/pages/admin/EncryptionPage/components/EncryptionKeyRotationSection.tsx
@@ -41,6 +41,7 @@ import {
DialogFooter,
DialogHeader,
DialogTitle,
+ IconButton,
Label,
Pagination,
Table,
@@ -74,6 +75,7 @@ export const EncryptionKeyRotationSection = () => {
const [generatedKey, setGeneratedKey] = useState<TCreatedEncryptionKeyRotation | null>(null);
const [isDeactivateOpen, setIsDeactivateOpen] = useState(false);
+ const [acceptsKeyReplacement, setAcceptsKeyReplacement] = useState(false);
const [acknowledged, setAcknowledged] = useState(false);
const [overrideStraggler, setOverrideStraggler] = useState(false);
const [page, setPage] = useState(1);
@@ -109,6 +111,7 @@ export const EncryptionKeyRotationSection = () => {
const handleGenerate = async () => {
const rotation = await createRotation({ replaceStaged: Boolean(rootKey.staged) });
+ setAcceptsKeyReplacement(false);
setGeneratedKey(rotation);
};
@@ -175,20 +178,19 @@ export const EncryptionKeyRotationSection = () => {
<AlertTitle>Root encryption key rotation in progress</AlertTitle>
<AlertDescription>
<p>
- The old key still opens this database, the rotation has not reduced exposure yet.
- Deactivating it is safe and causes no service interruption, as long as every
- instance has restarted onto the new key.
+ The previous key is still active. Once all instances have been migrated to the new
+ encryption key it is safe to remove this key.
</p>
<p className="mt-2">
- It is removed automatically on{" "}
- {new Date(rootKey.expiring.expiresAt).toLocaleString()}, or later if an instance
- starts with it again.{" "}
+ This key will be automatically removed on{" "}
+ {new Date(rootKey.expiring.expiresAt).toLocaleDateString()} at{" "}
+ {new Date(rootKey.expiring.expiresAt).toLocaleTimeString()}.{" "}
<button
type="button"
className="cursor-pointer underline underline-offset-4 hover:text-foreground"
onClick={() => setIsDeactivateOpen(true)}
>
- Deactivate old key
+ Deactivate now
</button>
</p>
</AlertDescription>
@@ -226,17 +228,17 @@ export const EncryptionKeyRotationSection = () => {
<TableCell variant="action" className="pr-3">
<Tooltip>
<TooltipTrigger asChild>
- <Button
- className="min-w-25 justify-start text-foreground/70 hover:border-danger/25 hover:bg-danger/10 hover:text-danger"
- size="xs"
+ <IconButton
+ className="text-foreground/70 hover:bg-danger/10 hover:text-danger"
+ size="sm"
variant="ghost"
+ aria-label="Discard generated key"
isDisabled={!rootKey.staged.label}
isPending={isDiscarding}
onClick={handleDiscard}
>
<Trash2Icon />
- <span className="flex-1 text-center">Discard</span>
- </Button>
+ </IconButton>
</TooltipTrigger>
<TooltipContent className="max-w-xs">
Delete this generated key. It has never encrypted anything, so nothing
@@ -281,19 +283,20 @@ export const EncryptionKeyRotationSection = () => {
{rootKey.expiring?.label === entry.label && (
<Tooltip>
<TooltipTrigger asChild>
- <Button
- className="min-w-25 justify-start text-foreground/70 hover:border-warning/25 hover:bg-warning/10 hover:text-warning"
- size="xs"
+ <IconButton
+ className="text-foreground/70 hover:bg-warning/10 hover:text-warning"
+ size="sm"
variant="ghost"
+ aria-label="Deactivate old key"
onClick={() => setIsDeactivateOpen(true)}
>
<ShieldOffIcon />
- <span className="flex-1 text-center">Deactivate</span>
- </Button>
+ </IconButton>
</TooltipTrigger>
<TooltipContent className="max-w-xs">
- Stop this key from opening the database. Backups taken before the
- rotation will still need it.
+ Deactivate the old key, removing its access to the database. Backups
+ taken before the rotation can still only be opened with it, so keep it
+ archived.
</TooltipContent>
</Tooltip>
)}
@@ -426,10 +429,12 @@ export const EncryptionKeyRotationSection = () => {
</DialogDescription>
</DialogHeader>
<DialogBody className="flex flex-col gap-4">
- <div>
- <p className="mb-1.5 text-sm font-medium">Set this environment variable</p>
- <div className="flex items-center gap-2 rounded-md border border-border bg-container px-3 py-2 font-mono text-sm">
- <span className="flex-1 break-all">ENCRYPTION_KEY={generatedKey?.key}</span>
+ <div className="flex flex-col gap-1">
+ <span className="text-xs text-accent">Set this environment variable</span>
+ <div className="flex items-center gap-2 rounded-md border border-border bg-container p-2">
+ <p className="grow font-mono text-sm break-all text-foreground">
+ ENCRYPTION_KEY={generatedKey?.key}
+ </p>
<CopyButton
value={`ENCRYPTION_KEY=${generatedKey?.key}`}
ariaLabel="Copy encryption key"
@@ -437,35 +442,50 @@ export const EncryptionKeyRotationSection = () => {
</div>
</div>
- <div>
- <p className="mb-1.5 text-sm font-medium">Label</p>
- <div className="flex items-center gap-1">
- <p className="font-mono text-xs text-foreground/70">{generatedKey?.label}</p>
+ <div className="flex flex-col gap-1">
+ <span className="text-xs text-accent">Label</span>
+ <div className="flex items-center gap-2 rounded-md border border-border bg-container p-2">
+ <p className="grow font-mono text-sm break-all text-foreground">
+ {generatedKey?.label}
+ </p>
<CopyButton value={generatedKey?.label ?? ""} ariaLabel="Copy key label" />
</div>
- <p className="mt-1 text-xs text-foreground/60">
+ <p className="mt-1 text-xs text-accent">
Store this alongside the key. It is how you identify which key a database backup
needs.
</p>
</div>
{generatedKey?.removesExpiringKey && (
- <Alert variant="warning">
- <AlertTriangleIcon />
- <AlertTitle>This will remove your previous key</AlertTitle>
- <AlertDescription>
- <p>
- The key from your last rotation has not been removed yet. Applying this new key
- removes it immediately, and any instance still running it will fail to restart.
- </p>
- {generatedKey.removesExpiringKey.lastResolvedAt && (
- <p className="mt-2">
- An instance started on it{" "}
- {new Date(generatedKey.removesExpiringKey.lastResolvedAt).toLocaleString()}.
- </p>
- )}
- </AlertDescription>
- </Alert>
+ <div className="flex items-start gap-2 rounded-md border border-warning/20 bg-warning/5 p-3">
+ <Checkbox
+ id="ack-replaces-expiring-key"
+ variant="warning"
+ isChecked={acceptsKeyReplacement}
+ onCheckedChange={(value) => setAcceptsKeyReplacement(value === true)}
+ />
+ <Label
+ htmlFor="ack-replaces-expiring-key"
+ className="text-xs font-normal text-label"
+ >
+ <span>
+ Applying this key removes{" "}
+ {generatedKey.removesExpiringKey.label ? (
+ <span className="font-mono text-foreground">
+ {generatedKey.removesExpiringKey.label}
+ </span>
+ ) : (
+ "the key still expiring from an earlier rotation"
+ )}
+ , already expiring from an earlier rotation. My active key is not removed, it
+ becomes the new expiring key.
+ {generatedKey.removesExpiringKey.lastResolvedAt &&
+ ` An instance last started on the removed key ${new Date(
+ generatedKey.removesExpiringKey.lastResolvedAt
+ ).toLocaleString()} and would fail its next restart, if not updated.`}
+ </span>
+ </Label>
+ </div>
)}
<Alert variant="info">
@@ -477,7 +497,12 @@ export const EncryptionKeyRotationSection = () => {
</Alert>
</DialogBody>
<DialogFooter>
- <Button onClick={() => setGeneratedKey(null)}>I have stored the key</Button>
+ <Button
+ isDisabled={Boolean(generatedKey?.removesExpiringKey) && !acceptsKeyReplacement}
+ onClick={() => setGeneratedKey(null)}
+ >
+ I have stored the key
+ </Button>
</DialogFooter>
</DialogContent>
</Dialog>
diff --git a/frontend/src/pages/admin/EnvironmentPage/EnvironmentPage.tsx b/frontend/src/pages/admin/EnvironmentPage/EnvironmentPage.tsx
index 9a4b4ee62d..a9e65680c0 100644
--- a/frontend/src/pages/admin/EnvironmentPage/EnvironmentPage.tsx
+++ b/frontend/src/pages/admin/EnvironmentPage/EnvironmentPage.tsx
@@ -9,7 +9,7 @@ export const EnvironmentPage = () => {
const { t } = useTranslation();
return (
- <div className="bg-background text-foreground">
+ <div className="text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Admin" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/GeneralPage/GeneralPage.tsx b/frontend/src/pages/admin/GeneralPage/GeneralPage.tsx
index 94d4060143..3848520836 100644
--- a/frontend/src/pages/admin/GeneralPage/GeneralPage.tsx
+++ b/frontend/src/pages/admin/GeneralPage/GeneralPage.tsx
@@ -11,7 +11,7 @@ export const GeneralPage = () => {
const { data: serverConfig } = useGetServerConfig();
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Admin" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/IntegrationsPage/IntegrationsPage.tsx b/frontend/src/pages/admin/IntegrationsPage/IntegrationsPage.tsx
index 9c1dcdd10b..d183590f9b 100644
--- a/frontend/src/pages/admin/IntegrationsPage/IntegrationsPage.tsx
+++ b/frontend/src/pages/admin/IntegrationsPage/IntegrationsPage.tsx
@@ -9,7 +9,7 @@ export const IntegrationsPage = () => {
const { t } = useTranslation();
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Admin" })}</title>
</Helmet>
diff --git a/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx b/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx
index 43c5aa69d1..b09d84a8fc 100644
--- a/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx
+++ b/frontend/src/pages/admin/ResourceOverviewPage/ResourceOverviewPage.tsx
@@ -20,7 +20,7 @@ export const ResourceOverviewPage = () => {
const activeTab = selectedTab || "organizations";
return (
- <div className="h-full bg-background text-foreground">
+ <div className="h-full text-foreground">
<Helmet>
<title>{t("common.head-title", { title: "Resource Overview" })}</title>
</Helmet>