Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement: revamp audit logs and streams UI
Scott Wilson42e69ab8fb5a
diff --git a/frontend/src/pages/organization/AuditLogsPage/AuditLogsPage.tsx b/frontend/src/pages/organization/AuditLogsPage/AuditLogsPage.tsxindex 1fda83b6e4..c8f4a6daad 100644--- a/frontend/src/pages/organization/AuditLogsPage/AuditLogsPage.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/AuditLogsPage.tsx@@ -2,7 +2,8 @@ import { Helmet } from "react-helmet";import { Link, useNavigate, useSearch } from "@tanstack/react-router";import { InfoIcon } from "lucide-react";-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";+import { PageHeader } from "@app/components/v2";+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization } from "@app/context";@@ -67,21 +68,17 @@ export const AuditLogsPage = () => {)}</PageHeader><Tabs value={activeTab} onValueChange={updateSelectedTab}>- <TabList>+ <TabsList variant={isSubOrganization ? "sub-org" : "org"}>{tabs.map(({ key, label }) => (- <Tab- variant={isSubOrganization ? "namespace" : "org"}- value={key}- key={`tab-${key}`}- >+ <TabsTrigger value={key} key={`tab-${key}`}>{label}- </Tab>+ </TabsTrigger>))}- </TabList>+ </TabsList>{tabs.map(({ key, component: Component }) => (- <TabPanel value={key} key={`tab-panel-${key}`}>+ <TabsContent value={key} key={`tab-panel-${key}`}><Component />- </TabPanel>+ </TabsContent>))}</Tabs></div>diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogDetailsSheet.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogDetailsSheet.tsxnew file mode 100644index 0000000000..89f7472fcf--- /dev/null+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogDetailsSheet.tsx@@ -0,0 +1,32 @@+import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "@app/components/v3";+import { formatDateTime, Timezone } from "@app/helpers/datetime";+import { AuditLog } from "@app/hooks/api/auditLogs/types";++import { JsonHighlight } from "./JsonHighlight";++type Props = {+ isOpen: boolean;+ onOpenChange: (isOpen: boolean) => void;+ auditLog?: AuditLog;+ timezone: Timezone;+};++export const AuditLogDetailsSheet = ({ isOpen, onOpenChange, auditLog, timezone }: Props) => {+ if (!auditLog) return null;++ return (+ <Sheet open={isOpen} onOpenChange={onOpenChange}>+ <SheetContent className="flex h-full max-h-full flex-col gap-y-0 sm:max-w-2xl">+ <SheetHeader className="border-b">+ <SheetTitle className="font-mono">{auditLog.event.type}</SheetTitle>+ <SheetDescription>+ {formatDateTime({ timestamp: auditLog.createdAt, timezone })}+ </SheetDescription>+ </SheetHeader>+ <div className="min-h-0 flex-1 p-4">+ <JsonHighlight value={auditLog} className="h-full" />+ </div>+ </SheetContent>+ </Sheet>+ );+};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamForm.tsxindex 203fa341cb..b2fa248cce 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamForm.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamForm.tsx@@ -1,3 +1,5 @@+import { useMemo } from "react";+import { createNotification } from "@app/components/notifications";import { AUDIT_LOG_STREAM_PROVIDER_MAP } from "@app/helpers/auditLogStreams";import { useCreateAuditLogStream, useUpdateAuditLogStream } from "@app/hooks/api";@@ -6,7 +8,7 @@ import { TAuditLogStreamFilters } from "@app/hooks/api/auditLogStreams/types";import { TAuditLogStream } from "@app/hooks/api/types";import { DiscriminativePick } from "@app/types";-import { AuditLogStreamHeader } from "../components/AuditLogStreamHeader";+import { AuditLogStreamFormProvider } from "./AuditLogStreamFormContext";import { AzureProviderAuditLogStreamForm } from "./AzureProviderAuditLogStreamForm";import { CriblProviderAuditLogStreamForm } from "./CriblProviderAuditLogStreamForm";import { CustomProviderAuditLogStreamForm } from "./CustomProviderAuditLogStreamForm";@@ -109,26 +111,25 @@ const UpdateForm = ({ auditLogStream, onComplete }: UpdateFormProps) => {}};-type Props = { onBack?: () => void } & Pick<FormProps, "onComplete"> &+type Props = { onCancel: () => void } & Pick<FormProps, "onComplete"> &(| { provider: LogProvider; auditLogStream?: undefined }| { provider?: undefined; auditLogStream: TAuditLogStream });-export const AuditLogStreamForm = ({ onBack, ...props }: Props) => {+export const AuditLogStreamForm = ({ onCancel, ...props }: Props) => {const { provider, auditLogStream } = props;+ const contextValue = useMemo(() => ({ onCancel }), [onCancel]);+return (- <div>- <AuditLogStreamHeader- logStreamExists={Boolean(auditLogStream)}- provider={auditLogStream ? auditLogStream.provider : provider}- onBack={onBack}- />- {auditLogStream ? (- <UpdateForm {...props} auditLogStream={auditLogStream} />- ) : (- <CreateForm {...props} provider={provider} />- )}- </div>+ <AuditLogStreamFormProvider value={contextValue}>+ <div className="flex flex-1 flex-col [&>form]:flex [&>form]:flex-1 [&>form]:flex-col [&>form]:px-4 [&>form]:pt-4">+ {auditLogStream ? (+ <UpdateForm {...props} auditLogStream={auditLogStream} />+ ) : (+ <CreateForm {...props} provider={provider} />+ )}+ </div>+ </AuditLogStreamFormProvider>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamFormContext.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamFormContext.tsxnew file mode 100644index 0000000000..8810e71950--- /dev/null+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamFormContext.tsx@@ -0,0 +1,17 @@+import { createContext, useContext } from "react";++type AuditLogStreamFormContextValue = {+ /**+ * Closes the surrounding Sheet. Used by each provider form's Cancel button so the footer does not+ * have to thread a prop through every provider form.+ */+ onCancel: () => void;+};++const AuditLogStreamFormContext = createContext<AuditLogStreamFormContextValue>({+ onCancel: () => {}+});++export const AuditLogStreamFormProvider = AuditLogStreamFormContext.Provider;++export const useAuditLogStreamForm = () => useContext(AuditLogStreamFormContext);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamFormFooter.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamFormFooter.tsxnew file mode 100644index 0000000000..69c9d8cef6--- /dev/null+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamFormFooter.tsx@@ -0,0 +1,45 @@+import { useFormContext } from "react-hook-form";++import { Button, SheetFooter } from "@app/components/v3";+import { useScopeVariant } from "@app/hooks";++import { useAuditLogStreamForm } from "./AuditLogStreamFormContext";++type Props = {+ submitLabel: string;+ /** OR-ed with the default `isSubmitting || !isDirty` disabled logic. */+ isDisabled?: boolean;+ /**+ * When true, the submit button does not require the form to be dirty. Used by forms that blank+ * out credentials on edit and must allow re-submitting an unchanged form.+ */+ allowPristineSubmit?: boolean;+};++export const AuditLogStreamFormFooter = ({+ submitLabel,+ isDisabled,+ allowPristineSubmit+}: Props) => {+ const { onCancel } = useAuditLogStreamForm();+ const {+ formState: { isSubmitting, isDirty }+ } = useFormContext();+ const scopeVariant = useScopeVariant();++ return (+ <SheetFooter className="sticky bottom-0 -mx-4 items-center border-t bg-popover">+ <Button+ type="submit"+ variant={scopeVariant}+ isPending={isSubmitting}+ isDisabled={isSubmitting || (!isDirty && !allowPristineSubmit) || isDisabled}+ >+ {submitLabel}+ </Button>+ <Button type="button" variant="outline" onClick={onCancel} isDisabled={isSubmitting}>+ Cancel+ </Button>+ </SheetFooter>+ );+};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamProductsField.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamProductsField.tsxindex 4d84f7c911..a6e5dfb0e3 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamProductsField.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AuditLogStreamProductsField.tsx@@ -1,21 +1,20 @@import { useEffect, useRef, useState } from "react";import { useController, useFormContext } from "react-hook-form";import { components, MultiValue, OptionProps } from "react-select";-import {- Building2Icon,- CheckIcon,- GlobeIcon,- KeyIcon,- LockIcon,- type LucideIcon,- ScanSearchIcon,- ShieldCheckIcon,- UsersIcon-} from "lucide-react";+import { Building2Icon, CheckIcon, GlobeIcon, Info, type LucideIcon } from "lucide-react";import { z } from "zod";-import { FilterableSelect, FormControl } from "@app/components/v2";+import {+ Field,+ FieldLabel,+ FilterableSelect,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { getProjectLucideIcon } from "@app/helpers/project";import { AuditLogStreamProduct } from "@app/hooks/api/auditLogStreams/enums";+import { ProjectType } from "@app/hooks/api/projects/types";// Shared across every provider form so product scoping stays consistent. Re-exported into each// provider's form schema (`...auditLogStreamFiltersSchema.shape`) and rendered via <ProductsField />.@@ -37,12 +36,14 @@ export const AUDIT_LOG_STREAM_PRODUCT_LABELS: Record<AuditLogStreamProduct, stri[AuditLogStreamProduct.Organization]: "Organization"};-const PRODUCT_ICONS: Record<AuditLogStreamProduct, LucideIcon> = {- [AuditLogStreamProduct.SecretManager]: KeyIcon,- [AuditLogStreamProduct.CertificateManager]: ShieldCheckIcon,- [AuditLogStreamProduct.KMS]: LockIcon,- [AuditLogStreamProduct.SecretScanning]: ScanSearchIcon,- [AuditLogStreamProduct.PAM]: UsersIcon,+// Reuse the shared project icons so the select (and the stream table) match the Projects pages.+// Organization isn't a project type, so it keeps its own org-level icon.+export const PRODUCT_ICONS: Record<AuditLogStreamProduct, LucideIcon> = {+ [AuditLogStreamProduct.SecretManager]: getProjectLucideIcon(ProjectType.SecretManager),+ [AuditLogStreamProduct.CertificateManager]: getProjectLucideIcon(ProjectType.CertificateManager),+ [AuditLogStreamProduct.KMS]: getProjectLucideIcon(ProjectType.KMS),+ [AuditLogStreamProduct.SecretScanning]: getProjectLucideIcon(ProjectType.SecretScanning),+ [AuditLogStreamProduct.PAM]: getProjectLucideIcon(ProjectType.PAM),[AuditLogStreamProduct.Organization]: Building2Icon};@@ -82,12 +83,12 @@ const ProductOptionItem = ({ isSelected, children, ...props }: OptionProps<Produconst isAllProducts = (props.getValue() as ProductOption[]).length === 0;return (- <div className="border-b border-mineshaft-600">+ <div className="border-b border-border"><components.Option {...props} isSelected={isAllProducts}><div className="flex flex-row items-center gap-2">- <GlobeIcon className="size-4 shrink-0 text-mineshaft-300" />+ <GlobeIcon className="size-4 shrink-0 text-muted" /><p className="mr-auto truncate">{children}</p>- {isAllProducts && <CheckIcon className="ml-2 size-4 shrink-0 text-primary" />}+ {isAllProducts && <CheckIcon className="ml-2 size-4 shrink-0" />}</div></components.Option></div>@@ -99,9 +100,9 @@ const ProductOptionItem = ({ isSelected, children, ...props }: OptionProps<Produreturn (<components.Option isSelected={isSelected} {...props}><div className="flex flex-row items-center gap-2">- <Icon className="size-4 shrink-0 text-mineshaft-300" />+ <Icon className="size-4 shrink-0 text-muted" /><p className="mr-auto truncate">{children}</p>- {isSelected && <CheckIcon className="ml-2 size-4 shrink-0 text-primary" />}+ {isSelected && <CheckIcon className="ml-2 size-4 shrink-0" />}</div></components.Option>);@@ -126,13 +127,23 @@ export const ProductsField = () => {);return (- <FormControl- label="Products"- isOptional- tooltipText="Only stream audit logs for the selected products. Leave empty to stream every product. Select 'Organization' to include org-level events (e.g. SSO, members, settings)."- >+ <Field>+ <FieldLabel htmlFor="products">+ Products <span className="text-muted">(optional)</span>+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ Only stream audit logs for the selected products. Leave empty to stream every product.+ Select 'Organization' to include org-level events (e.g. SSO, members,+ settings).+ </TooltipContent>+ </Tooltip>+ </FieldLabel><div ref={containerRef}><FilterableSelect+ inputId="products"isMultivalue={value}options={[ALL_OPTION, ...PRODUCT_OPTIONS]}@@ -155,12 +166,12 @@ export const ProductsField = () => {placeholder="All products"getOptionValue={(option) => option.value}getOptionLabel={(option) => option.label}- menuListClassName="max-h-[18rem] overflow-y-auto thin-scrollbar"components={{ Option: ProductOptionItem }}menuPortalTarget={menuPortalTarget ?? undefined}+ menuPosition="fixed"menuPlacement="auto"/></div>- </FormControl>+ </Field>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AzureProviderAuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AzureProviderAuditLogStreamForm.tsxindex b888f5493f..02b95c1b6b 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AzureProviderAuditLogStreamForm.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/AzureProviderAuditLogStreamForm.tsx@@ -2,10 +2,11 @@ import { Controller, FormProvider, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";-import { Button, FormControl, Input, ModalClose, SecretInput } from "@app/components/v2";+import { Field, FieldError, FieldLabel, Input, SecretInput } from "@app/components/v3";import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";import { TAzureProviderLogStream } from "@app/hooks/api/auditLogStreams/types/providers/azure-provider";+import { AuditLogStreamFormFooter } from "./AuditLogStreamFormFooter";import { auditLogStreamFiltersSchema, ProductsField } from "./AuditLogStreamProductsField";type Props = {@@ -41,11 +42,7 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pr}});- const {- handleSubmit,- control,- formState: { isSubmitting, isDirty }- } = form;+ const { handleSubmit, control } = form;return (<FormProvider {...form}>@@ -55,13 +52,16 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Tenant ID"- >- <Input {...field} placeholder="00000000-0000-0000-0000-000000000000" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="tenantId">Tenant ID</FieldLabel>+ <Input+ id="tenantId"+ {...field}+ placeholder="00000000-0000-0000-0000-000000000000"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -69,13 +69,16 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Client ID"- >- <Input {...field} placeholder="00000000-0000-0000-0000-000000000000" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="clientId">Client ID</FieldLabel>+ <Input+ id="clientId"+ {...field}+ placeholder="00000000-0000-0000-0000-000000000000"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -83,17 +86,11 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Client Secret"- >- <SecretInput- containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"- value={value}- onChange={(e) => onChange(e.target.value)}- />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="clientSecret">Client Secret</FieldLabel>+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -101,13 +98,16 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Data Collection Endpoint URL"- >- <Input {...field} placeholder="https://example.eastus-1.ingest.monitor.azure.com" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="dceUrl">Data Collection Endpoint URL</FieldLabel>+ <Input+ id="dceUrl"+ {...field}+ placeholder="https://example.eastus-1.ingest.monitor.azure.com"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -115,13 +115,16 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Data Collection Rule Immutable ID"- >- <Input {...field} placeholder="dcr-00000000000000000000000000000000" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="dcrId">Data Collection Rule Immutable ID</FieldLabel>+ <Input+ id="dcrId"+ {...field}+ placeholder="dcr-00000000000000000000000000000000"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -129,35 +132,24 @@ export const AzureProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Custom Log Table Name"- >- <Input {...field} placeholder="InfisicalLogs" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="cltName">Custom Log Table Name</FieldLabel>+ <Input+ id="cltName"+ {...field}+ placeholder="InfisicalLogs"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/><div className="mt-6"><ProductsField /></div>- <div className="mt-8 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isDirty}- >- {isUpdate ? "Update Credentials" : "Create Log Stream"}- </Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ <AuditLogStreamFormFooter+ submitLabel={isUpdate ? "Update" : "Create Log Stream"}+ /></form></FormProvider>);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CriblProviderAuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CriblProviderAuditLogStreamForm.tsxindex d0d706fa4e..772ec328e7 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CriblProviderAuditLogStreamForm.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CriblProviderAuditLogStreamForm.tsx@@ -1,21 +1,24 @@import { Controller, FormProvider, useForm } from "react-hook-form";-import { faQuestionCircle } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { zodResolver } from "@hookform/resolvers/zod";+import { CircleHelp, Info } from "lucide-react";import { z } from "zod";import {- Button,- FormControl,+ Field,+ FieldError,+ FieldLabel,Input,- ModalClose,SecretInput,Switch,- Tooltip-} from "@app/components/v2";+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { useScopeVariant } from "@app/hooks";import { LogProvider, StreamMode } from "@app/hooks/api/auditLogStreams/enums";import { TCriblProviderLogStream } from "@app/hooks/api/auditLogStreams/types/providers/cribl-provider";+import { AuditLogStreamFormFooter } from "./AuditLogStreamFormFooter";import { auditLogStreamFiltersSchema, ProductsField } from "./AuditLogStreamProductsField";type Props = {@@ -39,6 +42,7 @@ export const CriblProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prconst isUpdate = Boolean(auditLogStream);// Only streams already on "single" (legacy) can change mode — and only to "batch".const isSingleStream = auditLogStream?.streamMode === StreamMode.Single;+ const scopeVariant = useScopeVariant();const form = useForm<FormData>({resolver: zodResolver(formSchema),@@ -55,11 +59,7 @@ export const CriblProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pr}});- const {- handleSubmit,- control,- formState: { isSubmitting, isDirty }- } = form;+ const { handleSubmit, control } = form;return (<FormProvider {...form}>@@ -69,26 +69,31 @@ export const CriblProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Cribl Stream URL"- tooltipText={- <>- To derive your Stream URL: Obtain your Cribl hostname (e.g. cribl.example.com),- Infisical HTTP data source port (e.g. 20000), and HTTP event API path (e.g.- /infisical).- <br />- <br />- If your Infisical Data Source has TLS enabled, then use the https protocol.- </>- }- >+ <Field className="mb-4">+ <FieldLabel htmlFor="cribl-url">+ Cribl Stream URL+ <Tooltip>+ <TooltipTrigger asChild>+ <Info />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ To derive your Stream URL: Obtain your Cribl hostname (e.g. cribl.example.com),+ Infisical HTTP data source port (e.g. 20000), and HTTP event API path (e.g.+ /infisical).+ <br />+ <br />+ If your Infisical Data Source has TLS enabled, then use the https protocol.+ </TooltipContent>+ </Tooltip>+ </FieldLabel><Input+ id="cribl-url"{...field}placeholder="http://default.main.example.cribl.cloud:20000/infisical/_bulk"+ isError={Boolean(error?.message)}/>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -96,17 +101,11 @@ export const CriblProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prcontrol={control}shouldUnregisterrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Cribl Stream Token"- >- <SecretInput- containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"- value={value}- onChange={(e) => onChange(e.target.value)}- />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="cribl-token">Cribl Stream Token</FieldLabel>+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />+ <FieldError errors={[error]} />+ </Field>)}/>{isUpdate && (@@ -118,32 +117,36 @@ export const CriblProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Prconst isBatch = field.value === StreamMode.Batch;return (<div>- <Switch- id="stream-batch-mode"- isChecked={isBatch}- isDisabled={!isSingleStream}- onCheckedChange={(checked) =>- field.onChange(checked ? StreamMode.Batch : StreamMode.Single)- }- >- <p className="text-sm">+ <Field orientation="horizontal">+ <FieldLabel htmlFor="stream-batch-mode" className="text-sm">Batch delivery- <Tooltip- className="max-w-md"- content={<p>Send events as a newline-delimited JSON (NDJSON) batch.</p>}- >- <FontAwesomeIcon icon={faQuestionCircle} size="sm" className="ml-1" />+ <Tooltip>+ <TooltipTrigger asChild>+ <CircleHelp />+ </TooltipTrigger>+ <TooltipContent className="max-w-md">+ Send events as a newline-delimited JSON (NDJSON) batch.+ </TooltipContent></Tooltip>- </p>- </Switch>+ </FieldLabel>+ <Switch+ id="stream-batch-mode"+ variant={scopeVariant}+ checked={isBatch}+ disabled={!isSingleStream}+ onCheckedChange={(checked) =>+ field.onChange(checked ? StreamMode.Batch : StreamMode.Single)+ }+ />+ </Field>{isSingleStream &&(isBatch ? (- <p className="mt-2 text-xs text-yellow">+ <p className="mt-2 text-xs text-warning">Switching from single to batch delivery cannot be undone. Make sure yourCribl source accepts newline-delimited JSON (NDJSON) batches.</p>) : (- <p className="mt-2 text-xs text-mineshaft-400">+ <p className="mt-2 text-xs text-muted">This stream uses legacy single-event delivery (one event per request).Enable batch delivery to send events as a newline-delimited JSON (NDJSON)batch.@@ -160,23 +163,9 @@ export const CriblProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pr<ProductsField /></div>- <div className="mt-8 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isDirty}- >- {isUpdate ? "Update Credentials" : "Create Log Stream"}- </Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ <AuditLogStreamFormFooter+ submitLabel={isUpdate ? "Update" : "Create Log Stream"}+ /></form></FormProvider>);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CustomProviderAuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CustomProviderAuditLogStreamForm.tsxindex d642f5cadb..f0139939d2 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CustomProviderAuditLogStreamForm.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/CustomProviderAuditLogStreamForm.tsx@@ -1,23 +1,26 @@import { useState } from "react";import { Controller, FormProvider, useFieldArray, useForm } from "react-hook-form";-import { faPlus, faQuestionCircle, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { zodResolver } from "@hookform/resolvers/zod";+import { CircleHelp, Plus, Trash2 } from "lucide-react";import { z } from "zod";import {Button,- FormControl,- FormLabel,+ Field,+ FieldError,+ FieldLabel,IconButton,Input,- ModalClose,Switch,- Tooltip-} from "@app/components/v2";+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { useScopeVariant } from "@app/hooks";import { LogProvider, StreamMode } from "@app/hooks/api/auditLogStreams/enums";import { TCustomProviderLogStream } from "@app/hooks/api/auditLogStreams/types/providers/custom-provider";+import { AuditLogStreamFormFooter } from "./AuditLogStreamFormFooter";import { auditLogStreamFiltersSchema, ProductsField } from "./AuditLogStreamProductsField";type Props = {@@ -31,8 +34,8 @@ const formSchema = z.object({url: z.string().url().trim().min(1).max(255),headers: z.object({- key: z.string().min(1),- value: z.string().min(1)+ key: z.string().min(1, "Required"),+ value: z.string().min(1, "Required")}).array()}),@@ -48,6 +51,7 @@ export const CustomProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pconst isUpdate = Boolean(auditLogStream);// Only streams already on "single" (legacy) can change mode — and only to "batch".const isSingleStream = auditLogStream?.streamMode === StreamMode.Single;+ const scopeVariant = useScopeVariant();const form = useForm<FormData>({resolver: zodResolver(formSchema),@@ -60,17 +64,12 @@ export const CustomProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: PstreamMode: auditLogStream.streamMode ?? StreamMode.Batch}: {- provider: LogProvider.Custom+ provider: LogProvider.Custom,+ credentials: { headers: [] }}});- const {- handleSubmit,- control,- formState: { isSubmitting, isDirty },- getValues,- setValue- } = form;+ const { handleSubmit, control } = form;const headerFields = useFieldArray({control,@@ -85,46 +84,45 @@ export const CustomProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Endpoint URL"- >- <Input {...field} placeholder="https://example.com" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="custom-url">Endpoint URL</FieldLabel>+ <Input+ id="custom-url"+ {...field}+ placeholder="https://example.com"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/>- <FormLabel label="Headers" isOptional />+ <FieldLabel className="mb-2">+ Headers <span className="text-muted">(optional)</span>+ </FieldLabel>{headerFields.fields.map(({ id: headerFieldId }, i) => (- <div key={headerFieldId} className="flex space-x-2">+ <div key={headerFieldId} className="flex items-start gap-2"><Controllercontrol={control}name={`credentials.headers.${i}.key`}render={({ field, fieldState: { error } }) => (- <FormControl- isError={Boolean(error?.message)}- errorText={error?.message}- className="w-1/3"- >- <Input {...field} placeholder="Authorization" />- </FormControl>+ <Field className="mb-2 w-1/3">+ <Input {...field} placeholder="Authorization" isError={Boolean(error?.message)} />+ <FieldError errors={[error]} />+ </Field>)}/><Controllercontrol={control}name={`credentials.headers.${i}.value`}render={({ field, fieldState: { error } }) => (- <FormControl- isError={Boolean(error?.message)}- errorText={error?.message}- className="grow"- >+ <Field className="mb-2 grow"><Input{...field}type={showPassword ? "text" : "password"}autoComplete="new-password"placeholder="Bearer <token>"+ isError={Boolean(error?.message)}onFocus={() => {if (auditLogStream &&@@ -148,33 +146,32 @@ export const CustomProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: PsetShowPassword(false);}}/>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/>- <IconButton- ariaLabel="delete key"- className="h-9"- variant="outline_bg"- onClick={() => {- const header = getValues("credentials.headers");- if (header && header?.length > 1) {- headerFields.remove(i);- } else {- setValue("credentials.headers", [{ key: "", value: "" }]);- }- }}- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>+ <Tooltip>+ <TooltipTrigger asChild>+ <IconButton+ aria-label="delete key"+ variant="outline"+ className="hover:text-danger"+ onClick={() => headerFields.remove(i)}+ >+ <Trash2 />+ </IconButton>+ </TooltipTrigger>+ <TooltipContent>Remove header</TooltipContent>+ </Tooltip></div>))}<div><Button- leftIcon={<FontAwesomeIcon icon={faPlus} />}+ variant="outline"size="xs"- variant="outline_bg"onClick={() => headerFields.append({ value: "", key: "" })}>+ <Plus />Add Key</Button></div>@@ -188,29 +185,36 @@ export const CustomProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pconst isBatch = field.value === StreamMode.Batch;return (<div>- <Switch- id="stream-batch-mode"- isChecked={isBatch}- isDisabled={!isSingleStream}- onCheckedChange={(checked) =>- field.onChange(checked ? StreamMode.Batch : StreamMode.Single)- }- >- <p className="text-sm">+ <Field orientation="horizontal">+ <FieldLabel htmlFor="stream-batch-mode" className="text-sm">Batch delivery- <Tooltip className="max-w-md" content={<p>Send events as a JSON array.</p>}>- <FontAwesomeIcon icon={faQuestionCircle} size="sm" className="ml-1" />+ <Tooltip>+ <TooltipTrigger asChild>+ <CircleHelp />+ </TooltipTrigger>+ <TooltipContent className="max-w-md">+ Send events as a JSON array.+ </TooltipContent></Tooltip>- </p>- </Switch>+ </FieldLabel>+ <Switch+ id="stream-batch-mode"+ variant={scopeVariant}+ checked={isBatch}+ disabled={!isSingleStream}+ onCheckedChange={(checked) =>+ field.onChange(checked ? StreamMode.Batch : StreamMode.Single)+ }+ />+ </Field>{isSingleStream &&(isBatch ? (- <p className="mt-2 text-xs text-yellow">+ <p className="mt-2 text-xs text-warning">Switching from single to batch delivery cannot be undone. Make sure yourendpoint accepts a JSON array of events.</p>) : (- <p className="mt-2 text-xs text-mineshaft-400">+ <p className="mt-2 text-xs text-muted">This stream uses legacy single-event delivery (one event per request).Enable batch delivery to send events as a JSON array.</p>@@ -226,23 +230,7 @@ export const CustomProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: P<ProductsField /></div>- <div className="mt-8 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isDirty}- >- {isUpdate ? "Update Credentials" : "Create Log Stream"}- </Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ <AuditLogStreamFormFooter submitLabel={isUpdate ? "Update" : "Create Log Stream"} /></form></FormProvider>);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/DatadogProviderAuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/DatadogProviderAuditLogStreamForm.tsxindex f812a75b6f..d4c48d95db 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/DatadogProviderAuditLogStreamForm.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/DatadogProviderAuditLogStreamForm.tsx@@ -3,16 +3,21 @@ import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";import {- Button,- FormControl,- ModalClose,+ Field,+ FieldDescription,+ FieldError,+ FieldLabel,SecretInput,Select,- SelectItem-} from "@app/components/v2";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";import { TDatadogProviderLogStream } from "@app/hooks/api/auditLogStreams/types/providers/datadog-provider";+import { AuditLogStreamFormFooter } from "./AuditLogStreamFormFooter";import { auditLogStreamFiltersSchema, ProductsField } from "./AuditLogStreamProductsField";type Props = {@@ -57,11 +62,7 @@ export const DatadogProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }:}});- const {- handleSubmit,- control,- formState: { isSubmitting, isDirty }- } = form;+ const { handleSubmit, control } = form;return (<FormProvider {...form}>@@ -70,28 +71,27 @@ export const DatadogProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }:name="credentials.url"control={control}render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Datadog Region"- helperText={value}- >- <Select- value={value}- onValueChange={(val) => onChange(val)}- className="w-full border border-mineshaft-500"- position="popper"- dropdownContainerClassName="max-w-none"- >- {Object.entries(DATADOG_ENDPOINTS).map(([k, v]) => {- return (+ <Field className="mb-4">+ <FieldLabel htmlFor="datadog-region">Datadog Region</FieldLabel>+ <Select value={value} onValueChange={(val) => onChange(val)}>+ <SelectTrigger+ id="datadog-region"+ className="w-full"+ isError={Boolean(error?.message)}+ >+ <SelectValue placeholder="Select a region" />+ </SelectTrigger>+ <SelectContent position="popper">+ {Object.entries(DATADOG_ENDPOINTS).map(([k, v]) => (<SelectItem value={v} key={k}>{k}</SelectItem>- );- })}+ ))}+ </SelectContent></Select>- </FormControl>+ {!error && value && <FieldDescription>{value}</FieldDescription>}+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -99,39 +99,19 @@ export const DatadogProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }:control={control}shouldUnregisterrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Datadog Token"- >- <SecretInput- containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"- value={value}- onChange={(e) => onChange(e.target.value)}- />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="datadog-token">Datadog Token</FieldLabel>+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />+ <FieldError errors={[error]} />+ </Field>)}/><div className="mt-6"><ProductsField /></div>- <div className="mt-8 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isDirty}- >- {isUpdate ? "Update Credentials" : "Create Log Stream"}- </Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ <AuditLogStreamFormFooter+ submitLabel={isUpdate ? "Update" : "Create Log Stream"}+ /></form></FormProvider>);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SplunkProviderAuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SplunkProviderAuditLogStreamForm.tsxindex e344ee0374..4be8138e64 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SplunkProviderAuditLogStreamForm.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SplunkProviderAuditLogStreamForm.tsx@@ -2,10 +2,11 @@ import { Controller, FormProvider, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";-import { Button, FormControl, Input, ModalClose, SecretInput } from "@app/components/v2";+import { Field, FieldError, FieldLabel, Input, SecretInput } from "@app/components/v3";import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";import { TSplunkProviderLogStream } from "@app/hooks/api/auditLogStreams/types/providers/splunk-provider";+import { AuditLogStreamFormFooter } from "./AuditLogStreamFormFooter";import { auditLogStreamFiltersSchema, ProductsField } from "./AuditLogStreamProductsField";type Props = {@@ -59,11 +60,7 @@ export const SplunkProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: P}});- const {- handleSubmit,- control,- formState: { isSubmitting, isDirty }- } = form;+ const { handleSubmit, control } = form;return (<FormProvider {...form}>@@ -73,13 +70,16 @@ export const SplunkProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pcontrol={control}shouldUnregisterrender={({ field, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Hostname"- >- <Input {...field} placeholder="splunk.example.com" />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="hostname">Hostname</FieldLabel>+ <Input+ id="hostname"+ {...field}+ placeholder="splunk.example.com"+ isError={Boolean(error?.message)}+ />+ <FieldError errors={[error]} />+ </Field>)}/><Controller@@ -87,39 +87,19 @@ export const SplunkProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }: Pcontrol={control}shouldUnregisterrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error?.message)}- label="Splunk Token"- >- <SecretInput- containerClassName="text-gray-400 group-focus-within:border-primary-400/50! border border-mineshaft-500 bg-mineshaft-900 px-2.5 py-1.5"- value={value}- onChange={(e) => onChange(e.target.value)}- />- </FormControl>+ <Field className="mb-4">+ <FieldLabel htmlFor="token">Splunk Token</FieldLabel>+ <SecretInput value={value} onChange={(e) => onChange(e.target.value)} />+ <FieldError errors={[error]} />+ </Field>)}/><div className="mt-6"><ProductsField /></div>- <div className="mt-8 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- colorSchema="secondary"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isDirty}- >- {isUpdate ? "Update Credentials" : "Create Log Stream"}- </Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ <AuditLogStreamFormFooter+ submitLabel={isUpdate ? "Update" : "Create Log Stream"}+ /></form></FormProvider>);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamTab.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamTab.tsxindex d8dca7401d..5a1005f567 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamTab.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamTab.tsx@@ -1,12 +1,20 @@-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { PlusIcon } from "lucide-react";import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";import { OrgPermissionCan } from "@app/components/permissions";-import { Button } from "@app/components/v2";+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ DocumentationLinkBadge+} from "@app/components/v3";import { OrgPermissionActions, OrgPermissionSubjects, useSubscription } from "@app/context";import { withPermission } from "@app/hoc";-import { usePopUp } from "@app/hooks";+import { usePopUp, useScopeVariant } from "@app/hooks";import { AuditLogStreamTable } from "./components/AuditLogStreamTable";import { AddAuditLogStreamModal } from "./components";@@ -14,6 +22,7 @@ import { AddAuditLogStreamModal } from "./components";export const AuditLogStreamsTab = withPermission(() => {const { subscription } = useSubscription();+ const scopeVariant = useScopeVariant();const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["auditLogStreamForm",@@ -21,35 +30,43 @@ export const AuditLogStreamsTab = withPermission(] as const);return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="flex justify-between">- <p className="text-xl font-medium text-mineshaft-100">Audit Log Streams</p>- <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Settings}>- {(isAllowed) => (- <Button- onClick={() => {- if (subscription && !subscription?.auditLogStreams) {- handlePopUpOpen("upgradePlan", {- isEnterpriseFeature: true- });- return;- }- handlePopUpOpen("auditLogStreamForm");- }}- leftIcon={<FontAwesomeIcon icon={faPlus} />}- isDisabled={!isAllowed}- variant="outline_bg"- colorSchema="secondary"- >- Add Log Stream- </Button>- )}- </OrgPermissionCan>- </div>- <p className="mb-8 text-gray-400">- Send audit logs from Infisical to external logging providers via HTTP- </p>- <AuditLogStreamTable />+ <>+ <Card>+ <CardHeader>+ <CardTitle>+ Audit Log Streams+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/audit-log-streams/audit-log-streams" />+ </CardTitle>+ <CardDescription>+ Send audit logs from Infisical to external logging providers via HTTP+ </CardDescription>+ <CardAction>+ <OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Settings}>+ {(isAllowed) => (+ <Button+ variant={scopeVariant}+ isDisabled={!isAllowed}+ onClick={() => {+ if (subscription && !subscription?.auditLogStreams) {+ handlePopUpOpen("upgradePlan", {+ isEnterpriseFeature: true+ });+ return;+ }+ handlePopUpOpen("auditLogStreamForm");+ }}+ >+ <PlusIcon />+ Add Log Stream+ </Button>+ )}+ </OrgPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <AuditLogStreamTable />+ </CardContent>+ </Card><AddAuditLogStreamModalisOpen={popUp.auditLogStreamForm.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("auditLogStreamForm", isOpen)}@@ -60,7 +77,7 @@ export const AuditLogStreamsTab = withPermission(text="Your current plan does not include access to audit log streams. To unlock this feature, please upgrade to Infisical Enterprise plan."isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature}/>- </div>+ </>);},{ action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.Settings }diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AddAuditLogStreamModal.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AddAuditLogStreamModal.tsxindex 5a6892a49f..4e9e151b94 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AddAuditLogStreamModal.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AddAuditLogStreamModal.tsx@@ -1,10 +1,11 @@-import { Dispatch, SetStateAction, useState } from "react";+import { useState } from "react";+import { ArrowLeftIcon } from "lucide-react";-import { Modal, ModalContent } from "@app/components/v2";+import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "@app/components/v3";import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";-import { TAuditLogStream } from "@app/hooks/api/types";import { AuditLogStreamForm } from "../AuditLogStreamForm/AuditLogStreamForm";+import { AuditLogStreamHeader } from "./AuditLogStreamHeader";import { LogStreamProviderSelect } from "./LogStreamProviderSelect";type Props = {@@ -12,58 +13,71 @@ type Props = {onOpenChange: (isOpen: boolean) => void;};-type ContentProps = {- onComplete: (auditLogStream: TAuditLogStream) => void;- selectedProvider: LogProvider | null;- setSelectedProvider: Dispatch<SetStateAction<LogProvider | null>>;-};--const Content = ({ onComplete, selectedProvider, setSelectedProvider }: ContentProps) => {- if (selectedProvider) {- return (- <AuditLogStreamForm- onComplete={onComplete}- onBack={() => setSelectedProvider(null)}- provider={selectedProvider}- />- );- }-- return <LogStreamProviderSelect onSelect={setSelectedProvider} />;-};-export const AddAuditLogStreamModal = ({ isOpen, onOpenChange }: Props) => {const [selectedProvider, setSelectedProvider] = useState<LogProvider | null>(null);+ const closeSheet = () => {+ setSelectedProvider(null);+ onOpenChange(false);+ };+return (- <Modal- isOpen={isOpen}- onOpenChange={(e) => {- onOpenChange(e);- if (!e) setSelectedProvider(null);+ <Sheet+ open={isOpen}+ onOpenChange={(open) => {+ if (!open) setSelectedProvider(null);+ onOpenChange(open);}}>- <ModalContent- className="max-w-2xl"- title="Log Provider"- subTitle=<>- Select a log provider or{" "}- <button- type="button"- className="underline"- onClick={() => setSelectedProvider(LogProvider.Custom)}- >- input a custom URL- </button>{" "}- to stream logs to.- </>- >- <Content- onComplete={() => onOpenChange(false)}- selectedProvider={selectedProvider}- setSelectedProvider={setSelectedProvider}- />- </ModalContent>- </Modal>+ <SheetContent className="flex h-full max-h-full flex-col gap-y-0 sm:max-w-2xl">+ <SheetHeader className="border-b">+ {selectedProvider ? (+ <>+ <button+ type="button"+ onClick={() => setSelectedProvider(null)}+ className="mb-1 flex w-fit cursor-pointer items-center gap-1 text-xs text-muted transition-colors hover:text-foreground hover:underline"+ >+ <ArrowLeftIcon className="size-3" />+ Select another provider+ </button>+ <SheetTitle>+ <AuditLogStreamHeader provider={selectedProvider} logStreamExists={false} />+ </SheetTitle>+ </>+ ) : (+ <>+ <SheetTitle>Add Log Stream</SheetTitle>+ <SheetDescription asChild>+ <div>+ Select a log provider or{" "}+ <button+ type="button"+ className="underline underline-offset-2 hover:text-foreground"+ onClick={() => setSelectedProvider(LogProvider.Custom)}+ >+ input a custom URL+ </button>{" "}+ to stream logs to.+ </div>+ </SheetDescription>+ </>+ )}+ </SheetHeader>+ {selectedProvider ? (+ <div className="flex min-h-0 flex-1 flex-col overflow-y-auto">+ <AuditLogStreamForm+ provider={selectedProvider}+ onComplete={closeSheet}+ onCancel={closeSheet}+ />+ </div>+ ) : (+ <div className="flex min-h-0 flex-1 flex-col overflow-y-auto p-4">+ <LogStreamProviderSelect onSelect={setSelectedProvider} />+ </div>+ )}+ </SheetContent>+ </Sheet>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamHeader.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamHeader.tsxindex 2d473892a0..5acdb66f12 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamHeader.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamHeader.tsx@@ -7,52 +7,37 @@ import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";type Props = {provider: LogProvider;logStreamExists: boolean;- onBack?: () => void;};-export const AuditLogStreamHeader = ({ provider, logStreamExists, onBack }: Props) => {+export const AuditLogStreamHeader = ({ provider, logStreamExists }: Props) => {const providerDetails = AUDIT_LOG_STREAM_PROVIDER_MAP[provider];return (- <div className="mb-4 flex w-full items-center gap-2 border-b border-mineshaft-500 pb-4">- <div className="relative">+ <div className="flex w-full items-start gap-2">+ <div className="relative flex h-10 w-10 items-center justify-center rounded-md bg-container">{providerDetails.image ? (<imgalt={providerDetails.name}src={`/images/integrations/${providerDetails.image}`}- className="size-12 rounded-md bg-bunker-500 p-2"+ className="h-7 w-7 object-contain"/>) : (providerDetails.icon && (- <div className="size-12 rounded-md bg-bunker-500 p-2">- <FontAwesomeIcon- icon={providerDetails.icon}- className="h-full w-full text-mineshaft-300"- />- </div>+ <FontAwesomeIcon icon={providerDetails.icon} className="text-accent" />))}</div><div>- <div className="mb-1 flex items-center gap-x-2 text-mineshaft-300">+ <div className="flex items-center gap-x-2 text-accent">{providerDetails.name}<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/audit-log-streams/audit-log-streams#example-providers" /></div>- <p className="text-sm leading-4 text-mineshaft-400">+ <p className="text-sm leading-4 font-normal text-muted">{logStreamExists? `${providerDetails.name} Log Stream`: `Create a ${providerDetails.name} Log Stream`}</p></div>- {onBack && (- <button- type="button"- className="mt-1 ml-auto text-xs text-mineshaft-400 underline underline-offset-2 hover:text-mineshaft-300"- onClick={onBack}- >- Select another provider- </button>- )}</div>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamProductBadges.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamProductBadges.tsxindex 984063f599..62ad5d45b5 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamProductBadges.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamProductBadges.tsx@@ -11,7 +11,10 @@ import {} from "@app/components/v3";import { AuditLogStreamProduct } from "@app/hooks/api/auditLogStreams/enums";-import { AUDIT_LOG_STREAM_PRODUCT_LABELS } from "../AuditLogStreamForm/AuditLogStreamProductsField";+import {+ AUDIT_LOG_STREAM_PRODUCT_LABELS,+ PRODUCT_ICONS+} from "../AuditLogStreamForm/AuditLogStreamProductsField";type Props = {products: AuditLogStreamProduct[];@@ -27,11 +30,16 @@ const ProductBadge = ({}: {product: AuditLogStreamProduct;className?: string;-}) => (- <Badge variant="neutral" isTruncatable className={twMerge("max-w-[10rem]", className)}>- {AUDIT_LOG_STREAM_PRODUCT_LABELS[product]}- </Badge>-);+}) => {+ const Icon = PRODUCT_ICONS[product];++ return (+ <Badge variant="neutral" isTruncatable className={twMerge("max-w-[10rem]", className)}>+ <Icon />+ <span>{AUDIT_LOG_STREAM_PRODUCT_LABELS[product]}</span>+ </Badge>+ );+};export const AuditLogStreamProductBadges = ({products,@@ -39,7 +47,7 @@ export const AuditLogStreamProductBadges = ({}: Props) => {// No products configured means the stream receives every product.if (products.length === 0) {- return <span className="text-sm text-mineshaft-400">All products</span>;+ return <span className="text-sm text-muted">All products</span>;}// Sort by displayed label so order is stable regardless of how the list was stored.diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsxindex 6df5e303b3..a8ea5f3935 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsx@@ -1,6 +1,5 @@-import { faAsterisk, faEllipsisV, faTrash } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { twMerge } from "tailwind-merge";+import { Ellipsis, PencilIcon, Trash2Icon } from "lucide-react";import { OrgPermissionCan } from "@app/components/permissions";import {@@ -9,10 +8,9 @@ import {DropdownMenuItem,DropdownMenuTrigger,IconButton,- Td,- Tooltip,- Tr-} from "@app/components/v2";+ TableCell,+ TableRow+} from "@app/components/v3";import { OrgPermissionSubjects } from "@app/context";import { OrgPermissionActions } from "@app/context/OrgPermissionContext/types";import { AUDIT_LOG_STREAM_PROVIDER_MAP, getProviderUrl } from "@app/helpers/auditLogStreams";@@ -35,11 +33,8 @@ export const AuditLogStreamRow = ({ logStream, onDelete, onEditCredentials }: Prconst products = logStream.filters?.products ?? [];return (- <Tr- className={twMerge("group h-12 transition-colors duration-100 hover:bg-mineshaft-700")}- key={`log-stream-${id}`}- >- <Td>+ <TableRow className="group" key={`log-stream-${id}`}>+ <TableCell><div className="flex items-center gap-2"><div className="relative">{providerDetails.image ? (@@ -50,69 +45,57 @@ export const AuditLogStreamRow = ({ logStream, onDelete, onEditCredentials }: Pr/>) : (providerDetails.icon && (- <FontAwesomeIcon- icon={providerDetails.icon}- className="size-5 text-mineshaft-300"- />+ <FontAwesomeIcon icon={providerDetails.icon} className="size-5 text-muted" />))}</div><span className="hidden lg:inline">{providerDetails.name}</span></div>- </Td>- <Td className="max-w-0 min-w-32!">+ </TableCell>+ <TableCell className="max-w-0 min-w-32!"><div className="flex w-full items-center gap-2"><p className="truncate">{url}</p></div>- </Td>- <Td>+ </TableCell>+ <TableCell><AuditLogStreamProductBadges products={products} />- </Td>- <Td>+ </TableCell>+ <TableCell><div className="flex items-center justify-end gap-2">- <Tooltip className="max-w-sm text-center" content="Options">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <IconButton- ariaLabel="Options"- colorSchema="secondary"- className="w-6"- variant="plain"- >- <FontAwesomeIcon icon={faEllipsisV} />- </IconButton>- </DropdownMenuTrigger>- <DropdownMenuContent sideOffset={2} align="end">- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>- {(isAllowed: boolean) => (- <DropdownMenuItem- isDisabled={!isAllowed}- icon={<FontAwesomeIcon icon={faAsterisk} />}- onClick={() => onEditCredentials(logStream)}- >- Edit Credentials- </DropdownMenuItem>- )}- </OrgPermissionCan>- <OrgPermissionCan- I={OrgPermissionActions.Delete}- a={OrgPermissionSubjects.Settings}- >- {(isAllowed: boolean) => (- <DropdownMenuItem- isDisabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- onClick={() => onDelete(logStream)}- >- Delete Stream- </DropdownMenuItem>- )}- </OrgPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Tooltip>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <IconButton aria-label="Options" variant="ghost" size="xs">+ <Ellipsis />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent sideOffset={2} align="end">+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>+ {(isAllowed: boolean) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => onEditCredentials(logStream)}+ >+ <PencilIcon />+ Edit+ </DropdownMenuItem>+ )}+ </OrgPermissionCan>+ <OrgPermissionCan I={OrgPermissionActions.Delete} a={OrgPermissionSubjects.Settings}>+ {(isAllowed: boolean) => (+ <DropdownMenuItem+ variant="danger"+ isDisabled={!isAllowed}+ onClick={() => onDelete(logStream)}+ >+ <Trash2Icon />+ Delete Stream+ </DropdownMenuItem>+ )}+ </OrgPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu></div>- </Td>- </Tr>+ </TableCell>+ </TableRow>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamTable.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamTable.tsxindex ce0c8102e2..c8c19b4320 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamTable.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/AuditLogStreamTable.tsx@@ -1,40 +1,38 @@import { useMemo, useState } from "react";-import {- faArrowDown,- faArrowUp,- faFilter,- faMagnifyingGlass,- faPlug,- faSearch-} from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { ChevronDownIcon, FilterIcon, SearchIcon } from "lucide-react";import { twMerge } from "tailwind-merge";import {DropdownMenu,+ DropdownMenuCheckboxItem,DropdownMenuContent,- DropdownMenuItem,DropdownMenuLabel,DropdownMenuTrigger,- EmptyState,+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,IconButton,- Input,+ InputGroup,+ InputGroupAddon,+ InputGroupInput,Pagination,+ Skeleton,Table,- TableContainer,- TableSkeleton,- TBody,- Th,- THead,- Tr-} from "@app/components/v2";+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import { AUDIT_LOG_STREAM_PROVIDER_MAP, getProviderUrl } from "@app/helpers/auditLogStreams";import {getUserTablePreference,PreferenceKey,setUserTablePreference} from "@app/helpers/userTablePreferences";-import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";+import { usePagination, usePopUp, useResetPageHelper, useScopeVariant } from "@app/hooks";import { useListAuditLogStreams } from "@app/hooks/api";import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";import { OrderByDirection } from "@app/hooks/api/generic/types";@@ -55,6 +53,7 @@ type LogStreamFilters = {export const AuditLogStreamTable = () => {const { isPending, data: logStreams = [] } = useListAuditLogStreams();+ const scopeVariant = useScopeVariant();const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["delete",@@ -133,11 +132,15 @@ export const AuditLogStreamTable = () => {setOrderDirection(OrderByDirection.ASC);};- const getClassName = (col: LogStreamsOrderBy) =>- twMerge("ml-2", orderBy === col ? "" : "opacity-30");-- const getColSortIcon = (col: LogStreamsOrderBy) =>- orderDirection === OrderByDirection.DESC && orderBy === col ? faArrowUp : faArrowDown;+ const renderSortIcon = (col: LogStreamsOrderBy) =>+ orderBy === col ? (+ <ChevronDownIcon+ className={twMerge(+ "ml-1 size-3.5 transition-transform",+ orderDirection === OrderByDirection.DESC && "rotate-180"+ )}+ />+ ) : null;const isTableFiltered = Boolean(filters.providers.length);@@ -147,38 +150,44 @@ export const AuditLogStreamTable = () => {handlePopUpOpen("editCredentials", logStream);};+ const visibleLogStreams = filteredLogStreams.slice(offset, perPage * page);+return (- <div>- <div className="flex gap-2">- <Input- value={search}- onChange={(e) => setSearch(e.target.value)}- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}- placeholder="Search audit log streams..."- className="flex-1"- />+ <>+ <div className="flex items-center gap-2">+ <InputGroup className="flex-1">+ <InputGroupAddon align="inline-start">+ <SearchIcon />+ </InputGroupAddon>+ <InputGroupInput+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ placeholder="Search audit log streams..."+ />+ </InputGroup><DropdownMenu><DropdownMenuTrigger asChild><IconButton- ariaLabel="Filter Log Streams"- variant="plain"- size="sm"- className={twMerge(- "flex h-10 w-11 items-center justify-center overflow-hidden border border-mineshaft-600 bg-mineshaft-800 p-0 transition-all hover:border-primary/60 hover:bg-primary/10",- isTableFiltered && "border-primary/50 text-primary"- )}+ aria-label="Filter Log Streams"+ variant={isTableFiltered ? scopeVariant : "outline"}>- <FontAwesomeIcon icon={faFilter} />+ <FilterIcon /></IconButton></DropdownMenuTrigger>- <DropdownMenuContent className="max-h-[70vh] thin-scrollbar overflow-y-auto" align="end">+ <DropdownMenuContent+ sideOffset={2}+ className="max-h-[70vh] thin-scrollbar overflow-y-auto"+ align="end"+ ><DropdownMenuLabel>Filter by Provider</DropdownMenuLabel>{logStreams.length ? ([...new Set(logStreams.map(({ provider }) => provider))].map((provider) => {const providerDetails = AUDIT_LOG_STREAM_PROVIDER_MAP[provider];return (- <DropdownMenuItem+ <DropdownMenuCheckboxItem+ key={provider}+ checked={filters.providers.includes(provider)}onClick={(e) => {e.preventDefault();setFilters((prev) => ({@@ -188,8 +197,6 @@ export const AuditLogStreamTable = () => {: [...prev.providers, provider]}));}}- key={provider}- iconPos="right"><div className="flex items-center gap-2">{providerDetails.image ? (@@ -202,95 +209,104 @@ export const AuditLogStreamTable = () => {providerDetails.icon && (<FontAwesomeIconicon={providerDetails.icon}- className="size-4 text-mineshaft-300"+ className="size-4 text-muted"/>))}<span>{providerDetails.name}</span></div>- </DropdownMenuItem>+ </DropdownMenuCheckboxItem>);})) : (- <DropdownMenuItem isDisabled>No Providers Configured</DropdownMenuItem>+ <DropdownMenuLabel className="font-normal text-muted">+ No Providers Configured+ </DropdownMenuLabel>)}</DropdownMenuContent></DropdownMenu></div>- <TableContainer className="mt-4">- <Table>- <THead>- <Tr>- <Th className="w-1/4">- <div className="flex items-center">- Provider- <IconButton- variant="plain"- className={getClassName(LogStreamsOrderBy.Provider)}- ariaLabel="sort"+ <div className="mt-4">+ {!isPending && !filteredLogStreams.length ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>+ {logStreams.length+ ? "No log streams match search"+ : "No log streams have been configured"}+ </EmptyTitle>+ <EmptyDescription>+ {logStreams.length+ ? "Adjust your search or filters to view log streams."+ : "Add a log stream to send audit logs to an external destination."}+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ ) : (+ <>+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead+ className="cursor-pointer"onClick={() => handleSort(LogStreamsOrderBy.Provider)}>- <FontAwesomeIcon icon={getColSortIcon(LogStreamsOrderBy.Provider)} />- </IconButton>- </div>- </Th>- <Th className="w-1/3">- <div className="flex items-center">- Endpoint URL- <IconButton- variant="plain"- className={getClassName(LogStreamsOrderBy.Url)}- ariaLabel="sort"+ Provider+ {renderSortIcon(LogStreamsOrderBy.Provider)}+ </TableHead>+ <TableHead+ className="w-full cursor-pointer"onClick={() => handleSort(LogStreamsOrderBy.Url)}>- <FontAwesomeIcon icon={getColSortIcon(LogStreamsOrderBy.Url)} />- </IconButton>- </div>- </Th>-- <Th>Products</Th>-- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isPending && (- <TableSkeleton- innerKey="audit-log-streams-table"- columns={4}- key="audit-log-streams"+ Endpoint URL+ {renderSortIcon(LogStreamsOrderBy.Url)}+ </TableHead>+ <TableHead>Products</TableHead>+ <TableHead className="w-5" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {isPending &&+ Array.from({ length: 5 }).map((_, i) => (+ // eslint-disable-next-line react/no-array-index-key+ <TableRow key={`log-stream-skeleton-${i + 1}`}>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ <TableCell>+ <Skeleton className="h-4 w-4" />+ </TableCell>+ </TableRow>+ ))}+ {!isPending &&+ visibleLogStreams.map((stream) => (+ <AuditLogStreamRow+ logStream={stream}+ key={stream.id}+ onDelete={handleDelete}+ onEditCredentials={handleEditCredentials}+ />+ ))}+ </TableBody>+ </Table>+ {!isPending && (+ <Pagination+ count={filteredLogStreams.length}+ page={page}+ perPage={perPage}+ onChangePage={setPage}+ onChangePerPage={handlePerPageChange}/>)}- {filteredLogStreams.slice(offset, perPage * page).map((stream) => (- <AuditLogStreamRow- logStream={stream}- key={stream.id}- onDelete={handleDelete}- onEditCredentials={handleEditCredentials}- />- ))}- </TBody>- </Table>- {Boolean(filteredLogStreams.length) && (- <Pagination- count={filteredLogStreams.length}- page={page}- perPage={perPage}- onChangePage={setPage}- onChangePerPage={handlePerPageChange}- />+ </>)}- {!isPending && !filteredLogStreams?.length && (- <EmptyState- title={- logStreams.length- ? "No log streams match search..."- : "No log streams have been configured"- }- icon={logStreams.length ? faSearch : faPlug}- />- )}- </TableContainer>+ </div><DeleteAuditLogStreamModalisOpen={popUp.delete.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("delete", isOpen)}@@ -301,6 +317,6 @@ export const AuditLogStreamTable = () => {onOpenChange={(isOpen) => handlePopUpToggle("editCredentials", isOpen)}auditLogStream={popUp.editCredentials.data}/>- </div>+ </>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/DeleteAuditLogStreamModal.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/DeleteAuditLogStreamModal.tsxindex 74eb19af3a..0f71ea6746 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/DeleteAuditLogStreamModal.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/DeleteAuditLogStreamModal.tsx@@ -1,5 +1,17 @@+import { Trash2Icon } from "lucide-react";+import { createNotification } from "@app/components/notifications";-import { DeleteActionModal } from "@app/components/v2";+import {+ AlertDialog,+ AlertDialogCancel,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogMedia,+ AlertDialogTitle,+ Button+} from "@app/components/v3";import { AUDIT_LOG_STREAM_PROVIDER_MAP } from "@app/helpers/auditLogStreams";import { useDeleteAuditLogStream } from "@app/hooks/api";import { TAuditLogStream } from "@app/hooks/api/types";@@ -20,26 +32,50 @@ export const DeleteAuditLogStreamModal = ({ isOpen, onOpenChange, auditLogStreamconst providerDetails = AUDIT_LOG_STREAM_PROVIDER_MAP[provider];const handleDelete = async () => {- await deleteAuditLogStream.mutateAsync({- auditLogStreamId,- provider- });+ if (deleteAuditLogStream.isPending) return;++ try {+ await deleteAuditLogStream.mutateAsync({+ auditLogStreamId,+ provider+ });- createNotification({- text: `Successfully deleted ${providerDetails.name} stream`,- type: "success"- });+ createNotification({+ text: `Successfully deleted ${providerDetails.name} stream`,+ type: "success"+ });- onOpenChange(false);+ onOpenChange(false);+ } catch {+ // Error is handled by the mutation's onError handler+ }};return (- <DeleteActionModal- isOpen={isOpen}- onChange={onOpenChange}- title="Are you sure you want to delete this log stream?"- deleteKey="delete"- onDeleteApproved={handleDelete}- />+ <AlertDialog open={isOpen} onOpenChange={onOpenChange}>+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogMedia>+ <Trash2Icon />+ </AlertDialogMedia>+ <AlertDialogTitle>Delete {providerDetails.name} log stream?</AlertDialogTitle>+ <AlertDialogDescription>+ This will stop audit logs from being sent to this destination. This action cannot be+ undone.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogFooter>+ <AlertDialogCancel>Cancel</AlertDialogCancel>+ <Button+ variant="danger"+ isPending={deleteAuditLogStream.isPending}+ isDisabled={deleteAuditLogStream.isPending}+ onClick={handleDelete}+ >+ Delete+ </Button>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/EditAuditLogStreamCredentialsModal.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/EditAuditLogStreamCredentialsModal.tsxindex 6e21b10feb..fb0ae0f26c 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/EditAuditLogStreamCredentialsModal.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/EditAuditLogStreamCredentialsModal.tsx@@ -1,8 +1,8 @@-import { Modal, ModalContent } from "@app/components/v2";-import { AUDIT_LOG_STREAM_PROVIDER_MAP } from "@app/helpers/auditLogStreams";+import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@app/components/v3";import { TAuditLogStream } from "@app/hooks/api/types";import { AuditLogStreamForm } from "../AuditLogStreamForm/AuditLogStreamForm";+import { AuditLogStreamHeader } from "./AuditLogStreamHeader";type Props = {isOpen: boolean;@@ -18,17 +18,21 @@ export const EditAuditLogStreamCredentialsModal = ({if (!auditLogStream) return null;return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- className="max-w-2xl"- title="Edit Log Stream Credentials"- subTitle={`Update the credentials for this ${AUDIT_LOG_STREAM_PROVIDER_MAP[auditLogStream.provider].name} Log Stream.`}- >- <AuditLogStreamForm- onComplete={() => onOpenChange(false)}- auditLogStream={auditLogStream}- />- </ModalContent>- </Modal>+ <Sheet open={isOpen} onOpenChange={onOpenChange}>+ <SheetContent className="flex h-full max-h-full flex-col gap-y-0 sm:max-w-2xl">+ <SheetHeader className="border-b">+ <SheetTitle>+ <AuditLogStreamHeader provider={auditLogStream.provider} logStreamExists />+ </SheetTitle>+ </SheetHeader>+ <div className="flex min-h-0 flex-1 flex-col overflow-y-auto">+ <AuditLogStreamForm+ auditLogStream={auditLogStream}+ onComplete={() => onOpenChange(false)}+ onCancel={() => onOpenChange(false)}+ />+ </div>+ </SheetContent>+ </Sheet>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/LogStreamProviderSelect.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/LogStreamProviderSelect.tsxindex 6d1be65311..10089a00aa 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/LogStreamProviderSelect.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/components/LogStreamProviderSelect.tsx@@ -1,11 +1,10 @@import { useMemo } from "react";-import { faSearch } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { Loader2Icon } from "lucide-react";import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";-import { EmptyState, Spinner } from "@app/components/v2";import { AUDIT_LOG_STREAM_PROVIDER_MAP } from "@app/helpers/auditLogStreams";-import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";+import { usePopUp } from "@app/hooks";import { useGetAuditLogStreamOptions } from "@app/hooks/api";import { LogProvider } from "@app/hooks/api/auditLogStreams/enums";@@ -13,60 +12,43 @@ type Props = {onSelect: (provider: LogProvider) => void;};-// TODO: When we have more than 1 page of providers, uncomment the search components-export const LogStreamProviderSelect = ({ onSelect }: Props) => {const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"]);const { isPending, data: logStreamOptions } = useGetAuditLogStreamOptions();- const { search, setPage, page, perPage, offset } = usePagination("", {- initPerPage: 16- });-- const filteredOptions = useMemo(+ const options = useMemo(() =>[...(logStreamOptions || []),// QRadar is a planned provider{ name: "IBM QRadar", provider: LogProvider.QRadar }- ]- .filter(- ({ name, provider }) =>- name.toLowerCase().includes(search.trim().toLowerCase()) ||- provider.toLowerCase().includes(search.trim().toLowerCase())- )- .sort((a, b) => {- if (a.provider === LogProvider.Custom) return 1;- if (b.provider === LogProvider.Custom) return -1;- return 0;- }),- [logStreamOptions, search]+ ].sort((a, b) => {+ if (a.provider === LogProvider.Custom) return 1;+ if (b.provider === LogProvider.Custom) return -1;+ return 0;+ }),+ [logStreamOptions]);- useResetPageHelper({- totalCount: filteredOptions.length,- offset,- setPage- });-if (isPending) {return (- <div className="flex h-full flex-col items-center justify-center py-2.5">- <Spinner size="lg" className="text-mineshaft-500" />- <p className="mt-4 text-sm text-mineshaft-400">Loading options...</p>+ <div className="flex h-full flex-col items-center justify-center py-10">+ <Loader2Icon className="size-8 animate-spin text-accent" />+ <p className="mt-4 text-sm text-muted">Loading options...</p></div>);}return (<div className="flex flex-col gap-4">- <div className="grid h-118 grid-cols-4 content-start gap-2">- {filteredOptions.slice(offset, perPage * page)?.map((option) => {+ <div className="grid grid-cols-2 gap-3 sm:grid-cols-3">+ {options.map((option) => {const { image, icon, name, size = 50 } = AUDIT_LOG_STREAM_PROVIDER_MAP[option.provider];return (<button+ key={option.provider}type="button"onClick={() => {if (option.provider === LogProvider.QRadar) {@@ -77,36 +59,28 @@ export const LogStreamProviderSelect = ({ onSelect }: Props) => {onSelect(option.provider);}}}- className={`group relative flex h-28 cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 ${option.provider === LogProvider.Custom ? "bg-mineshaft-700/30 hover:bg-mineshaft-600/30" : "bg-mineshaft-700 hover:bg-mineshaft-600"} p-4 duration-200`}+ className="group flex h-28 cursor-pointer flex-col items-center justify-center gap-3 rounded-md border border-border bg-card p-4 transition-colors hover:border-foreground/20 hover:bg-container-hover">{image && (- <div className="relative">- <img- src={`/images/integrations/${image}`}- style={{- width: `${size}px`- }}- className="mt-auto"- alt={`${name} logo`}- />- </div>+ <img+ src={`/images/integrations/${image}`}+ style={{+ width: `${size}px`+ }}+ alt={`${name} logo`}+ />)}{icon && (- <FontAwesomeIcon className="mt-auto size-10 text-mineshaft-300" icon={icon} />+ <FontAwesomeIcon+ className="text-accent"+ icon={icon}+ style={{ width: `${size * 0.8}px`, height: `${size * 0.8}px` }}+ />)}- <div className="mt-auto max-w-xs text-center text-xs font-medium text-gray-300 duration-200 group-hover:text-gray-200">- {name}- </div>+ <div className="max-w-xs text-center text-xs font-medium text-foreground">{name}</div></button>);})}- {!filteredOptions.length && (- <EmptyState- className="col-span-full mt-40"- title="No providers match search"- icon={faSearch}- />- )}</div><UpgradePlanModalisOpen={popUp.upgradePlan.isOpen}diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditSearchFilter.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditSearchFilter.tsxindex 4f08d48a06..1b194b395c 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditSearchFilter.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditSearchFilter.tsx@@ -1,8 +1,7 @@import React, { useEffect, useMemo, useRef, useState } from "react";-import { faClose, faMagnifyingGlass, faPlus, faWarning } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { Plus, Search, TriangleAlert, X } from "lucide-react";-import { Tooltip } from "@app/components/v2";+import { Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";import { eventToNameMap, userAgentTypeToNameMap } from "@app/hooks/api/auditLogs/constants";import { ActorType, EventType, UserAgentType } from "@app/hooks/api/auditLogs/enums";import {@@ -281,19 +280,19 @@ export const AuditSearchFilter = ({const dropdownRowClass = (active: boolean) =>`flex w-full items-center gap-3 px-3 py-1.5 text-sm transition-colors ${- active ? "bg-mineshaft-600" : "hover:bg-mineshaft-700"+ active ? "bg-foreground/10" : "hover:bg-foreground/5"}`;const composingInput = (<spankey="composing"- className="inline-flex shrink-0 items-center gap-1 rounded-md border border-mineshaft-400 py-1 pr-1 pl-1.5 font-mono text-xs"+ className="inline-flex shrink-0 items-center gap-1 rounded-md border border-border py-1 pr-1 pl-1.5 font-mono text-xs">- <span className="text-mineshaft-400">{getDisplayLabel(propertyKey || "")}:</span>+ <span className="text-muted">{getDisplayLabel(propertyKey || "")}:</span><inputref={inputRef}type="text"- className="w-auto bg-transparent font-mono text-xs text-bunker-200 outline-none"+ className="w-auto bg-transparent font-mono text-xs text-foreground outline-none"style={{ width: `${Math.max(typedValue.length, 1)}ch` }}value={typedValue}onChange={(inputEvent) => {@@ -309,9 +308,9 @@ export const AuditSearchFilter = ({clickEvent.stopPropagation();resetQuery();}}- className="ml-0.5 text-mineshaft-400 transition-colors hover:text-mineshaft-200"+ className="ml-0.5 text-muted transition-colors hover:text-foreground">- <FontAwesomeIcon icon={faClose} className="h-2.5 w-2.5" />+ <X className="size-2.5" /></button></span>);@@ -346,21 +345,19 @@ export const AuditSearchFilter = ({<spankey={`${filter.property}-${filter.value}`}className={`inline-flex shrink-0 items-center gap-1 rounded-md border px-2.5 py-1 font-mono text-xs ${- warning- ? "border-yellow-700/60 bg-yellow-900/20"- : "border-mineshaft-500 bg-mineshaft-700"+ warning ? "border-warning/40 bg-warning/10" : "border-border bg-container"}`}>- {warning && <FontAwesomeIcon icon={faWarning} className="h-2.5 w-2.5 text-yellow-600" />}+ {warning && <TriangleAlert className="size-2.5 text-warning" />}<buttontype="button"- className="text-bunker-200 transition-colors hover:text-mineshaft-100"+ className="text-foreground transition-colors hover:text-foreground"onClick={(clickEvent) => {clickEvent.stopPropagation();editFilter(index);}}>- <span className="text-mineshaft-400">{getDisplayLabel(filter.property)}:</span>+ <span className="text-muted">{getDisplayLabel(filter.property)}:</span>{filter.label || filter.value}</button><button@@ -369,17 +366,18 @@ export const AuditSearchFilter = ({clickEvent.stopPropagation();removeFilter(index);}}- className="ml-0.5 text-mineshaft-400 transition-colors hover:text-mineshaft-200"+ className="ml-0.5 text-muted transition-colors hover:text-foreground">- <FontAwesomeIcon icon={faClose} className="h-2.5 w-2.5" />+ <X className="size-2.5" /></button></span>);if (warning) {return (- <Tooltip key={`${filter.property}-${filter.value}`} content={warning} size="sm">- {chip}+ <Tooltip key={`${filter.property}-${filter.value}`}>+ <TooltipTrigger asChild>{chip}</TooltipTrigger>+ <TooltipContent>{warning}</TooltipContent></Tooltip>);}@@ -390,7 +388,7 @@ export const AuditSearchFilter = ({return (<div ref={containerRef} className="relative w-full"><div- className="flex cursor-text flex-wrap items-center gap-2 rounded-md border border-mineshaft-500 bg-mineshaft-900 px-3 py-2 transition-colors focus-within:border-mineshaft-400"+ className="flex cursor-text flex-wrap items-center gap-2 rounded-md border border-border bg-card px-3 py-2 transition-colors focus-within:border-foreground/30"role="button"tabIndex={-1}onClick={() => inputRef.current?.focus()}@@ -398,10 +396,7 @@ export const AuditSearchFilter = ({if (wrapperEvent.key === "Enter" || wrapperEvent.key === " ") inputRef.current?.focus();}}>- <FontAwesomeIcon- icon={faMagnifyingGlass}- className="h-3.5 w-3.5 shrink-0 text-mineshaft-400"- />+ <Search className="size-3.5 shrink-0 text-muted" />{filters.map((filter, index) =>isComposing && editingIndex === index ? composingInput : renderChip(filter, index)@@ -414,7 +409,7 @@ export const AuditSearchFilter = ({ref={inputRef}type="text"placeholder={filters.length > 0 ? "Add filter..." : "Search audit logs..."}- className="min-w-[120px] flex-1 bg-transparent text-sm text-bunker-200 outline-none placeholder:text-mineshaft-400"+ className="min-w-[120px] flex-1 bg-transparent text-sm text-foreground outline-none placeholder:text-muted"value={query}onChange={(inputEvent) => {setQuery(inputEvent.target.value);@@ -428,9 +423,9 @@ export const AuditSearchFilter = ({</div>{showPropertyDropdown && (- <div className="absolute top-full right-0 left-0 z-50 mt-1 overflow-hidden rounded-md border border-mineshaft-600 bg-mineshaft-800 shadow-lg">+ <div className="absolute top-full right-0 left-0 z-50 mt-1 overflow-hidden rounded-md border border-border bg-popover shadow-lg"><div className="py-2">- <div className="px-3 py-1.5 text-xs font-medium text-mineshaft-400">Add a filter</div>+ <div className="px-3 py-1.5 text-xs font-medium text-muted">Add a filter</div>{filteredProperties.map((prop, index) => (<buttonkey={prop.key}@@ -440,27 +435,27 @@ export const AuditSearchFilter = ({onMouseMove={handleMouseMove}onMouseEnter={() => handleMouseEnter(index)}>- <FontAwesomeIcon icon={faPlus} className="h-3 w-3 shrink-0 text-mineshaft-400" />- <span className="font-mono text-xs font-medium text-bunker-200">+ <Plus className="size-3 shrink-0 text-muted" />+ <span className="font-mono text-xs font-medium text-foreground">{prop.displayLabel || prop.key}:</span>- <span className="truncate text-xs text-mineshaft-400">{prop.hints}</span>+ <span className="truncate text-xs text-muted">{prop.hints}</span></button>))}</div>- <div className="flex items-center justify-end gap-4 border-t border-mineshaft-600 px-3 py-2">- <span className="text-xs text-mineshaft-400">+ <div className="flex items-center justify-end gap-4 border-t border-border px-3 py-2">+ <span className="text-xs text-muted">Press{" "}- <kbd className="rounded border border-mineshaft-500 bg-mineshaft-700 px-1.5 py-0.5 font-mono text-[10px] text-bunker-200">+ <kbd className="rounded border border-border bg-container px-1.5 py-0.5 font-mono text-[10px] text-foreground">enter</kbd>{" "}to select</span>- <span className="text-xs text-mineshaft-400">- <kbd className="rounded border border-mineshaft-500 bg-mineshaft-700 px-1 py-0.5 font-mono text-[10px] text-bunker-200">+ <span className="text-xs text-muted">+ <kbd className="rounded border border-border bg-container px-1 py-0.5 font-mono text-[10px] text-foreground">↑</kbd>{" "}- <kbd className="rounded border border-mineshaft-500 bg-mineshaft-700 px-1 py-0.5 font-mono text-[10px] text-bunker-200">+ <kbd className="rounded border border-border bg-container px-1 py-0.5 font-mono text-[10px] text-foreground">↓</kbd>{" "}to navigate@@ -472,7 +467,7 @@ export const AuditSearchFilter = ({{showSuggestionDropdown && (<divref={dropdownRef}- className="absolute top-full right-0 left-0 z-50 mt-1 max-h-64 thin-scrollbar overflow-hidden overflow-y-auto rounded-md border border-mineshaft-600 bg-mineshaft-800 shadow-lg"+ className="absolute top-full right-0 left-0 z-50 mt-1 max-h-64 thin-scrollbar overflow-hidden overflow-y-auto rounded-md border border-border bg-popover shadow-lg"><div className="py-2">{propertyKey === "actor_id" && !currentActorType ? (@@ -481,7 +476,7 @@ export const AuditSearchFilter = ({(s) => s.actorType === ActorType.USER) && (<>- <div className="px-3 py-1.5 text-xs font-medium text-mineshaft-400">Users</div>+ <div className="px-3 py-1.5 text-xs font-medium text-muted">Users</div>{(valueSuggestions as ActorSuggestion[]).map((suggestion, index) =>suggestion.actorType === ActorType.USER ? (<button@@ -493,11 +488,8 @@ export const AuditSearchFilter = ({onMouseMove={handleMouseMove}onMouseEnter={() => handleMouseEnter(index)}>- <FontAwesomeIcon- icon={faPlus}- className="h-3 w-3 shrink-0 text-mineshaft-400"- />- <span className="font-mono text-xs text-bunker-200">+ <Plus className="size-3 shrink-0 text-muted" />+ <span className="font-mono text-xs text-foreground"><span className="font-medium">{getDisplayLabel(propertyKey || "")}:</span>@@ -512,9 +504,7 @@ export const AuditSearchFilter = ({(s) => s.actorType === ActorType.IDENTITY) && (<>- <div className="px-3 py-1.5 text-xs font-medium text-mineshaft-400">- Identities- </div>+ <div className="px-3 py-1.5 text-xs font-medium text-muted">Identities</div>{(valueSuggestions as ActorSuggestion[]).map((suggestion, index) =>suggestion.actorType === ActorType.IDENTITY ? (<button@@ -526,11 +516,8 @@ export const AuditSearchFilter = ({onMouseMove={handleMouseMove}onMouseEnter={() => handleMouseEnter(index)}>- <FontAwesomeIcon- icon={faPlus}- className="h-3 w-3 shrink-0 text-mineshaft-400"- />- <span className="font-mono text-xs text-bunker-200">+ <Plus className="size-3 shrink-0 text-muted" />+ <span className="font-mono text-xs text-foreground"><span className="font-medium">{getDisplayLabel(propertyKey || "")}:</span>@@ -544,9 +531,7 @@ export const AuditSearchFilter = ({</>) : (<>- <div className="px-3 py-1.5 text-xs font-medium text-mineshaft-400">- Suggestions- </div>+ <div className="px-3 py-1.5 text-xs font-medium text-muted">Suggestions</div>{valueSuggestions.map((suggestion, index) => (<buttonkey={suggestion.value}@@ -557,11 +542,8 @@ export const AuditSearchFilter = ({onMouseMove={handleMouseMove}onMouseEnter={() => handleMouseEnter(index)}>- <FontAwesomeIcon- icon={faPlus}- className="h-3 w-3 shrink-0 text-mineshaft-400"- />- <span className="font-mono text-xs text-bunker-200">+ <Plus className="size-3 shrink-0 text-muted" />+ <span className="font-mono text-xs text-foreground"><span className="font-medium">{getDisplayLabel(propertyKey || "")}:</span><span className="ml-0.5">{suggestion.label}</span></span>diff --git a/frontend/src/pages/organization/AuditLogsPage/components/JsonHighlight.tsx b/frontend/src/pages/organization/AuditLogsPage/components/JsonHighlight.tsxnew file mode 100644index 0000000000..88785b8321--- /dev/null+++ b/frontend/src/pages/organization/AuditLogsPage/components/JsonHighlight.tsx@@ -0,0 +1,45 @@+/* eslint-disable react/no-danger */+import { twMerge } from "tailwind-merge";++// Lightweight, dependency-free JSON syntax highlighter for read-only display.+// The input is escaped before any markup is injected, so values that happen to+// contain HTML (e.g. an actor name or secret path) are rendered as plain text.+const HTML_ESCAPES: Record<string, string> = {+ "&": "&",+ "<": "<",+ ">": ">"+};++const TOKEN_REGEX =+ /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g;++const highlightJson = (json: string) =>+ json+ .replace(/[&<>]/g, (char) => HTML_ESCAPES[char])+ .replace(TOKEN_REGEX, (match) => {+ let className = "text-info/85"; // number+ if (/^"/.test(match)) {+ className = /:$/.test(match) ? "text-foreground/85" : "text-success/85"; // key vs string+ } else if (/true|false/.test(match)) {+ className = "text-warning/85"; // boolean+ } else if (/null/.test(match)) {+ className = "text-muted/85"; // null+ }+ return `<span class="${className}">${match}</span>`;+ });++type Props = {+ value: unknown;+ className?: string;+};++export const JsonHighlight = ({ value, className }: Props) => (+ <pre+ className={twMerge(+ "thin-scrollbar overflow-auto rounded-md border border-border bg-card p-4 font-mono text-xs leading-relaxed whitespace-pre-wrap text-mineshaft-400",+ className+ )}+ >+ <code dangerouslySetInnerHTML={{ __html: highlightJson(JSON.stringify(value, null, 2)) }} />+ </pre>+);diff --git a/frontend/src/pages/organization/AuditLogsPage/components/LogFilterItem.tsx b/frontend/src/pages/organization/AuditLogsPage/components/LogFilterItem.tsxindex cc87489530..1e996432c9 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/LogFilterItem.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/LogFilterItem.tsx@@ -1,8 +1,7 @@-import { faInfoCircle } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { Info } from "lucide-react";import { twMerge } from "tailwind-merge";-import { Button, Tooltip } from "@app/components/v2";+import { Button, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";type Props = {hoverTooltip?: string;@@ -24,27 +23,34 @@ export const LogFilterItem = ({return (<div className={twMerge("flex flex-col justify-between", className)}><div className="flex items-center pr-1">- <p className="text-xs opacity-60">{label}</p>+ <p className="text-xs text-muted">{label}</p>{tooltipText && (- <Tooltip content={tooltipText} className="max-w-sm">- <FontAwesomeIcon- icon={faInfoCircle}- className="-mt-[0.05rem] ml-1 text-[11px] text-mineshaft-400"- />+ <Tooltip>+ <TooltipTrigger asChild>+ <Info className="ml-1 size-3 text-muted" />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">{tooltipText}</TooltipContent></Tooltip>)}<ButtononClick={() => onClear()}- variant="link"- className="ml-auto font-normal text-mineshaft-400 transition-all duration-75 hover:text-mineshaft-300"+ variant="ghost"size="xs"+ className="ml-auto h-auto px-1.5 py-0.5 text-xs font-normal text-muted hover:text-foreground">Clear</Button></div>- <Tooltip className="relative top-4" content={hoverTooltip} isDisabled={!hoverTooltip}>+ {hoverTooltip ? (+ <Tooltip>+ <TooltipTrigger asChild>+ <div>{children}</div>+ </TooltipTrigger>+ <TooltipContent>{hoverTooltip}</TooltipContent>+ </Tooltip>+ ) : (<div>{children}</div>- </Tooltip>+ )}</div>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/LogsFilter.tsx b/frontend/src/pages/organization/AuditLogsPage/components/LogsFilter.tsxindex ece7b522a3..aac400dcf5 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/LogsFilter.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/LogsFilter.tsx@@ -2,23 +2,24 @@import { useMemo } from "react";import { Controller, useForm } from "react-hook-form";import { MultiValue, SingleValue } from "react-select";-import { faFilterCircleXmark } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { zodResolver } from "@hookform/resolvers/zod";import { AnimatePresence, motion } from "framer-motion";+import { ListFilter } from "lucide-react";import { twMerge } from "tailwind-merge";import {+ Badge,Button,DropdownMenu,DropdownMenuContent,DropdownMenuTrigger,+ Field,+ FieldError,FilterableSelect,- FormControl,Input-} from "@app/components/v2";-import { Badge } from "@app/components/v3";+} from "@app/components/v3";import { useOrganization } from "@app/context";+import { useScopeVariant } from "@app/hooks";import { useGetUserProjects } from "@app/hooks/api";import {eventToNameMap,@@ -73,6 +74,7 @@ const getActiveFilterCount = (filter: TAuditLogFilterFormData) => {export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {const { data: workspaces = [] } = useGetUserProjects();const { currentOrg } = useOrganization();+ const scopeVariant = useScopeVariant();const workspacesInOrg = workspaces.filter((ws) => ws.orgId === currentOrg?.id);@@ -119,8 +121,8 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {return (<DropdownMenu><DropdownMenuTrigger asChild>- <Button variant="outline_bg" colorSchema="primary" className="relative">- <FontAwesomeIcon icon={faFilterCircleXmark} />+ <Button variant="outline" className="relative">+ <ListFilter />{activeFilterCount > 0 && (<Badge className="absolute -top-2 -right-2" variant="info">{activeFilterCount}@@ -128,10 +130,10 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {)}</Button></DropdownMenuTrigger>- <DropdownMenuContent align="end" className="mt-4 overflow-visible py-4">+ <DropdownMenuContent align="end" className="overflow-x-visible overflow-y-visible py-2"><form onSubmit={handleSubmit(setFilter)}><div className="flex max-w-96 min-w-96 flex-col font-inter">- <div className="mb-3 flex items-center border-b border-b-mineshaft-500 px-3 pb-2">+ <div className="mb-3 flex items-center border-b border-b-border px-3 pb-2"><div className="flex w-full items-center justify-between"><div className="flex items-center gap-2"><span>Filters</span>@@ -150,8 +152,8 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {secretKey: undefined});}}- variant="link"- className="text-mineshaft-400"+ variant="ghost"+ className="h-auto px-1.5 py-0.5 font-normal text-muted hover:text-foreground"size="xs">Clear filters@@ -170,7 +172,7 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {control={control}name="eventType"render={({ field }) => (- <FormControl>+ <Field><FilterableSelectvalue={filteredEventTypes.filter((eventType) =>field.value.includes(eventType.value as EventType)@@ -189,7 +191,7 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {getOptionValue={(option) => option.value}getOptionLabel={(option) => option.label}/>- </FormControl>+ </Field>)}/></LogFilterItem>@@ -203,11 +205,7 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {control={control}name="userAgentType"render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="w-full"- >+ <Field><FilterableSelectvalue={userAgentTypes.find(@@ -222,8 +220,10 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {options={userAgentTypes}getOptionValue={(option) => option.value}getOptionLabel={(option) => option.label}+ isError={Boolean(error)}/>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/></LogFilterItem>@@ -241,11 +241,7 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {control={control}name="project"render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="mb-0 w-full"- >+ <Field><FilterableSelectvalue={value}isClearable@@ -265,8 +261,10 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {}))}getOptionValue={(option) => option.id}getOptionLabel={(option) => option.name}+ isError={Boolean(error)}/>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/></LogFilterItem>@@ -280,8 +278,8 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {transition={{ duration: 0.3 }}><div className="mt-2 mb-3">- <p className="text-xs opacity-60">Secrets</p>- <div className="h-px w-full rounded-full bg-mineshaft-500" />+ <p className="text-xs text-muted">Secrets</p>+ <div className="h-px w-full rounded-full bg-border" /></div><LogFilterItemlabel="Environment"@@ -299,11 +297,7 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {control={control}name="environment"render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="w-full"- >+ <Field><FilterableSelectvalue={value}menuPlacement="top"@@ -318,8 +312,10 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {}))}getOptionValue={(option) => option.slug}getOptionLabel={(option) => option.name}+ isError={Boolean(error)}/>- </FormControl>+ <FieldError errors={[error]} />+ </Field>)}/></LogFilterItem>@@ -340,16 +336,15 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {control={control}name="secretPath"render={({ field: { onChange, value, ...field } }) => (- <FormControl className="w-full">+ <Field><Inputplaceholder="Enter secret path"- className="disabled:cursor-not-allowed"- isDisabled={!selectedProject}+ disabled={!selectedProject}{...field}value={value}onChange={(e) => onChange(e.target.value)}/>- </FormControl>+ </Field>)}/></LogFilterItem>@@ -371,18 +366,17 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {control={control}name="secretKey"render={({ field: { onChange, value, ...field } }) => (- <FormControl className="w-full">+ <Field><Input- isDisabled={!selectedProject}+ disabled={!selectedProject}{...field}placeholder="Enter secret key"- className="disabled:cursor-not-allowed"value={value}onChange={(e) =>setValue("secretKey", e.target.value, { shouldDirty: true })}/>- </FormControl>+ </Field>)}/></LogFilterItem>@@ -391,7 +385,12 @@ export const LogsFilter = ({ presets, setFilter, filter, project }: Props) => {</AnimatePresence></div><div className="mt-2 px-3">- <Button size="xs" type="submit" isDisabled={!formState.isDirty}>+ <Button+ size="xs"+ type="submit"+ variant={scopeVariant}+ isDisabled={!formState.isDirty}+ >Apply</Button></div>diff --git a/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx b/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsxindex f1d2a4f47d..4a4d084cac 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx@@ -5,6 +5,12 @@ import {Alert,AlertDescription,ButtonGroup,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,DateRangeFilter,type DateRangeFilterResult,DateRangeFilterType,@@ -103,9 +109,9 @@ const LogsSectionComponent = ({if (pageView)return (- <div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">+ <Card>{showClickHouseWarning && (- <Alert variant="warning" className="mb-4">+ <Alert variant="warning"><AlertDescription><p>Your audit log volume is growing. To keep searches fast and reduce database load, we@@ -132,15 +138,17 @@ const LogsSectionComponent = ({</AlertDescription></Alert>)}- <div className="mb-4 flex flex-wrap items-center justify-between gap-y-2">- <div>- <div className="flex items-center gap-x-2 whitespace-nowrap">- <p className="text-xl font-medium text-mineshaft-100">Audit History</p>- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/audit-logs" />- </div>- </div>- <div className="flex flex-wrap items-center gap-2 lg:justify-end">- {showFilters && (+ <CardHeader>+ <CardTitle>+ Audit History+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/audit-logs" />+ </CardTitle>+ <CardDescription>+ Search and review a detailed history of events{" "}+ {project ? "in this project" : "across your organization"}.+ </CardDescription>+ {showFilters && (+ <CardAction><ButtonGroup><DateRangeQuickPresetsvalue={activePreset}@@ -160,25 +168,25 @@ const LogsSectionComponent = ({accent={dateRangeAccent}/></ButtonGroup>- )}- </div>- </div>- {showFilters && (- <div className="mb-4">- <AuditSearchFilter- filters={searchFilters}- onFiltersChange={setSearchFilters}- hasProjectContext={Boolean(project)}- projectId={project?.id}- />- {searchFilters.length > 0 && (- <p className="mt-2 text-xs text-mineshaft-400">- {searchFilters.length} active filter{searchFilters.length !== 1 ? "s" : ""}- </p>- )}- </div>- )}- <div className="space-y-2">+ </CardAction>+ )}+ </CardHeader>+ <CardContent className="space-y-4">+ {showFilters && (+ <div>+ <AuditSearchFilter+ filters={searchFilters}+ onFiltersChange={setSearchFilters}+ hasProjectContext={Boolean(project)}+ projectId={project?.id}+ />+ {searchFilters.length > 0 && (+ <p className="mt-2 text-xs text-muted">+ {searchFilters.length} active filter{searchFilters.length !== 1 ? "s" : ""}+ </p>+ )}+ </div>+ )}<LogsTablerefetchInterval={refetchInterval}filter={{@@ -198,15 +206,15 @@ const LogsSectionComponent = ({}}timezone={timezone}/>- <UpgradePlanModal- isOpen={popUp.upgradePlan.isOpen}- onOpenChange={(isOpen) => {- handlePopUpToggle("upgradePlan", isOpen);- }}- text="Your current plan does not include access to audit logs. To unlock this feature, please upgrade to Infisical Pro plan."- />- </div>- </div>+ </CardContent>+ <UpgradePlanModal+ isOpen={popUp.upgradePlan.isOpen}+ onOpenChange={(isOpen) => {+ handlePopUpToggle("upgradePlan", isOpen);+ }}+ text="Your current plan does not include access to audit logs. To unlock this feature, please upgrade to Infisical Pro plan."+ />+ </Card>);return (diff --git a/frontend/src/pages/organization/AuditLogsPage/components/LogsTable.tsx b/frontend/src/pages/organization/AuditLogsPage/components/LogsTable.tsxindex 5b38047230..39e284ac14 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/LogsTable.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/LogsTable.tsx@@ -1,24 +1,26 @@import { Fragment } from "react";-import { faCancel, faFile } from "@fortawesome/free-solid-svg-icons";-import { twMerge } from "tailwind-merge";+import { Ban, FileText, Loader2Icon } from "lucide-react";import {Button,- EmptyState,- Spinner,+ Empty,+ EmptyHeader,+ EmptyMedia,+ EmptyTitle,+ Skeleton,Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import { Timezone } from "@app/helpers/datetime";+import { usePopUp, useScopeVariant } from "@app/hooks";import { useFetchServerStatus, useGetAuditLogs } from "@app/hooks/api";import { TGetAuditLogsFilter } from "@app/hooks/api/auditLogs/types";+import { AuditLogDetailsSheet } from "./AuditLogDetailsSheet";import { LogsTableRow } from "./LogsTableRow";type Props = {@@ -31,6 +33,8 @@ const AUDIT_LOG_LIMIT = 30;export const LogsTable = ({ filter, refetchInterval, timezone }: Props) => {const { data: status } = useFetchServerStatus();+ const scopeVariant = useScopeVariant();+ const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["logDetails"] as const);// Determine the project ID for filteringconst filterProjectId =@@ -52,60 +56,89 @@ export const LogsTable = ({ filter, refetchInterval, timezone }: Props) => {const isEmpty = !isPending && !data?.pages?.[0].length;const totalLoaded = data?.pages?.reduce((sum, page) => sum + page.length, 0) ?? 0;+ if (isEmpty) {+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyMedia variant="icon">+ {status?.auditLogStorageDisabled ? <Ban /> : <FileText />}+ </EmptyMedia>+ <EmptyTitle>+ {status?.auditLogStorageDisabled+ ? "Audit log storage is disabled"+ : "No audit logs on file"}+ </EmptyTitle>+ </EmptyHeader>+ </Empty>+ );+ }+return (<div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-24">- <Spinner size="xs" className={twMerge(isLoading ? "opacity-100" : "opacity-0")} />- </Th>- <Th className="w-64">Timestamp</Th>- <Th>Event</Th>- </Tr>- </THead>- <TBody>- {!isPending &&- data?.pages?.map((group, i) => (- <Fragment key={`audit-log-fragment-${i + 1}`}>- {group.map((auditLog, index) => (- <LogsTableRow- rowNumber={index + i * AUDIT_LOG_LIMIT + 1}- auditLog={auditLog}- key={`audit-log-${auditLog.id}`}- timezone={timezone}- />- ))}- </Fragment>- ))}- {isPending && <TableSkeleton innerKey="logs-table" columns={3} key="logs-loading" />}- {isEmpty && (- <Tr>- <Td colSpan={3}>- {status?.auditLogStorageDisabled ? (- <EmptyState title="Audit log storage is disabled" icon={faCancel} />- ) : (- <EmptyState title="No audit logs on file" icon={faFile} />- )}- </Td>- </Tr>- )}- </TBody>- </Table>- </TableContainer>- {!isEmpty && (- <Button- className="mt-4 px-4 py-3 text-sm"- isFullWidth- variant="outline_bg"- isLoading={isFetchingNextPage}- isDisabled={isFetchingNextPage || !hasNextPage}- onClick={() => fetchNextPage()}- >- {hasNextPage ? `Load More (${totalLoaded} loaded)` : `End of logs (${totalLoaded} total)`}- </Button>- )}+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead className="w-16">+ <span>+ {isLoading && <Loader2Icon className="size-3.5 animate-spin text-muted" />}+ </span>+ </TableHead>+ <TableHead className="w-64">Timestamp</TableHead>+ <TableHead>Event</TableHead>+ <TableHead className="w-12" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {!isPending &&+ data?.pages?.map((group, i) => (+ <Fragment key={`audit-log-fragment-${i + 1}`}>+ {group.map((auditLog, index) => (+ <LogsTableRow+ rowNumber={index + i * AUDIT_LOG_LIMIT + 1}+ auditLog={auditLog}+ key={`audit-log-${auditLog.id}`}+ timezone={timezone}+ onClick={(log) => handlePopUpOpen("logDetails", log)}+ />+ ))}+ </Fragment>+ ))}+ {isPending &&+ Array.from({ length: 8 }).map((_, i) => (+ // eslint-disable-next-line react/no-array-index-key+ <TableRow key={`logs-skeleton-${i + 1}`}>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ <TableCell>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>+ <Button+ className="mt-4"+ isFullWidth+ variant={scopeVariant}+ isPending={isFetchingNextPage}+ isDisabled={isFetchingNextPage || !hasNextPage}+ onClick={() => fetchNextPage()}+ >+ {hasNextPage ? `Load More (${totalLoaded} loaded)` : `End of logs (${totalLoaded} total)`}+ </Button>+ <AuditLogDetailsSheet+ isOpen={popUp.logDetails.isOpen}+ onOpenChange={(open) => handlePopUpToggle("logDetails", open)}+ auditLog={popUp.logDetails.data}+ timezone={timezone}+ /></div>);};diff --git a/frontend/src/pages/organization/AuditLogsPage/components/LogsTableRow.tsx b/frontend/src/pages/organization/AuditLogsPage/components/LogsTableRow.tsxindex a42847cc96..af49339a1f 100644--- a/frontend/src/pages/organization/AuditLogsPage/components/LogsTableRow.tsx+++ b/frontend/src/pages/organization/AuditLogsPage/components/LogsTableRow.tsx@@ -1,10 +1,15 @@-import { faCaretDown, faCaretRight } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { InfoIcon } from "lucide-react";+import { ChevronRight, InfoIcon } from "lucide-react";-import { Td, Tooltip, Tr } from "@app/components/v2";+import {+ Badge,+ ButtonGroup,+ TableCell,+ TableRow,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { formatDateTime, Timezone } from "@app/helpers/datetime";-import { useToggle } from "@app/hooks";import { ActorType } from "@app/hooks/api/auditLogs/enums";import { AuditLog } from "@app/hooks/api/auditLogs/types";@@ -12,6 +17,7 @@ type Props = {auditLog: AuditLog;rowNumber: number;timezone: Timezone;+ onClick: (auditLog: AuditLog) => void;};type TagProps = {@@ -22,73 +28,64 @@ const Tag = ({ label, value }: TagProps) => {if (!value) return null;return (- <div className="flex items-center space-x-1.5">- <div className="rounded-sm bg-mineshaft-600 p-0.5 pl-1 font-mono">{label}:</div>- <div>{value}</div>- {value === "unknownUser" && (- <Tooltip- side="right"- className="max-w-sm"- content="This action doesn't require authentication, so the requesting actor cannot be identified."- >- <InfoIcon size={14} className="text-mineshaft-300" />- </Tooltip>- )}- </div>+ <ButtonGroup>+ <Badge variant="neutral" isTruncatable className="max-w-[12rem] shrink-0">+ <span>{label}</span>+ </Badge>+ <Badge variant="neutral" isTruncatable className="border-l-transparent bg-neutral/5">+ <span>{value}</span>+ {value === "unknownUser" && (+ <Tooltip>+ <TooltipTrigger asChild>+ <InfoIcon />+ </TooltipTrigger>+ <TooltipContent side="right" className="max-w-sm">+ This action doesn't require authentication, so the requesting actor cannot be+ identified.+ </TooltipContent>+ </Tooltip>+ )}+ </Badge>+ </ButtonGroup>);};-export const LogsTableRow = ({ auditLog, rowNumber, timezone }: Props) => {- const [isOpen, setIsOpen] = useToggle();-+export const LogsTableRow = ({ auditLog, rowNumber, timezone, onClick }: Props) => {return (- <>- <Tr- className="h-10 cursor-pointer border-x-0 border-t-0 border-b hover:bg-mineshaft-700"- role="button"- tabIndex={0}- onClick={() => setIsOpen.toggle()}- onKeyDown={(evt) => {- if (evt.key === "Enter") setIsOpen.toggle();- }}- isHoverable- >- <Td className="flex items-center gap-2 pr-0 align-top">- <FontAwesomeIcon icon={isOpen ? faCaretDown : faCaretRight} />- {rowNumber}- </Td>- <Td className="align-top">{formatDateTime({ timestamp: auditLog.createdAt, timezone })}</Td>- <Td>- <div className="flex flex-wrap items-center gap-2 text-sm">- <Tag label="event" value={auditLog.event.type} />- <Tag label="actor" value={auditLog.actor.type} />- {auditLog.actor.type === ActorType.USER && (- <Tag label="user_email" value={auditLog.actor.metadata.email} />- )}- {auditLog.actor.type === ActorType.IDENTITY && (- <Tag label="identity_name" value={auditLog.actor.metadata.name} />- )}- {auditLog.actor.type === ActorType.ACME_PROFILE && (- <Tag label="acme_profile_id" value={auditLog.actor.metadata.profileId} />- )}- {auditLog.actor.type === ActorType.ACME_ACCOUNT && (- <Tag label="acme_account_id" value={auditLog.actor.metadata.accountId} />- )}- {auditLog.actor.type === ActorType.EST_ACCOUNT && (- <Tag label="est_profile_id" value={auditLog.actor.metadata.profileId} />- )}- </div>- </Td>- </Tr>- {isOpen && (- <Tr className={`log-${auditLog.id} h-10 border-x-0 border-t-0 border-b`}>- <Td colSpan={3} className="px-3 py-2">- <div className="my-1 max-h-96 thin-scrollbar overflow-auto rounded-sm border border-mineshaft-600 bg-bunker-800 p-2 font-mono leading-6 whitespace-pre-wrap">- {JSON.stringify(auditLog, null, 4)}- </div>- </Td>- </Tr>- )}- </>+ <TableRow+ role="button"+ tabIndex={0}+ onClick={() => onClick(auditLog)}+ onKeyDown={(evt) => {+ if (evt.key === "Enter") onClick(auditLog);+ }}+ >+ <TableCell className="text-muted">{rowNumber}</TableCell>+ <TableCell>{formatDateTime({ timestamp: auditLog.createdAt, timezone })}</TableCell>+ <TableCell>+ <div className="flex flex-wrap items-center gap-2 text-sm">+ <Tag label="event" value={auditLog.event.type} />+ <Tag label="actor" value={auditLog.actor.type} />+ {auditLog.actor.type === ActorType.USER && (+ <Tag label="user_email" value={auditLog.actor.metadata.email} />+ )}+ {auditLog.actor.type === ActorType.IDENTITY && (+ <Tag label="identity_name" value={auditLog.actor.metadata.name} />+ )}+ {auditLog.actor.type === ActorType.ACME_PROFILE && (+ <Tag label="acme_profile_id" value={auditLog.actor.metadata.profileId} />+ )}+ {auditLog.actor.type === ActorType.ACME_ACCOUNT && (+ <Tag label="acme_account_id" value={auditLog.actor.metadata.accountId} />+ )}+ {auditLog.actor.type === ActorType.EST_ACCOUNT && (+ <Tag label="est_profile_id" value={auditLog.actor.metadata.profileId} />+ )}+ </div>+ </TableCell>+ <TableCell className="text-right">+ <ChevronRight className="inline-block size-4 text-muted" />+ </TableCell>+ </TableRow>);};