mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 02:36:38 +00:00
♻️ set export logs limits to 50 000 everywhere
This commit is contained in:
@@ -22,9 +22,11 @@ import logger from "@server/logger";
|
|||||||
import {
|
import {
|
||||||
queryActionAuditLogsParams,
|
queryActionAuditLogsParams,
|
||||||
queryActionAuditLogsQuery,
|
queryActionAuditLogsQuery,
|
||||||
queryAction
|
queryAction,
|
||||||
|
countActionQuery
|
||||||
} from "./queryActionAuditLog";
|
} from "./queryActionAuditLog";
|
||||||
import { generateCSV } from "@server/routers/auditLogs/generateCSV";
|
import { generateCSV } from "@server/routers/auditLogs/generateCSV";
|
||||||
|
import { MAX_EXPORT_LIMIT } from "@server/routers/auditLogs";
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: "get",
|
method: "get",
|
||||||
@@ -65,6 +67,15 @@ export async function exportActionAuditLogs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = { ...parsedQuery.data, ...parsedParams.data };
|
const data = { ...parsedQuery.data, ...parsedParams.data };
|
||||||
|
const [{ count }] = await countActionQuery(data);
|
||||||
|
if (count > MAX_EXPORT_LIMIT) {
|
||||||
|
return next(
|
||||||
|
createHttpError(
|
||||||
|
HttpCode.BAD_REQUEST,
|
||||||
|
`Export limit exceeded. Your selection contains ${count} rows, but the maximum is [${MAX_EXPORT_LIMIT}] rows. Please select a shorter time range to reduce the data.`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const baseQuery = queryAction(data);
|
const baseQuery = queryAction(data);
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { Button } from "@app/components/ui/button";
|
import { Button } from "@app/components/ui/button";
|
||||||
import { toast } from "@app/hooks/useToast";
|
import { toast } from "@app/hooks/useToast";
|
||||||
import { useState, useRef, useEffect } from "react";
|
import { useState, useRef, useEffect, useTransition } from "react";
|
||||||
import { createApiClient } from "@app/lib/api";
|
import { createApiClient } from "@app/lib/api";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import {
|
import { LogDataTable } from "@app/components/LogDataTable";
|
||||||
getStoredPageSize,
|
|
||||||
LogDataTable,
|
|
||||||
setStoredPageSize
|
|
||||||
} from "@app/components/LogDataTable";
|
|
||||||
import { ColumnDef } from "@tanstack/react-table";
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
import { DateTimeValue } from "@app/components/DateTimePicker";
|
import { DateTimeValue } from "@app/components/DateTimePicker";
|
||||||
import { ArrowUpRight, Key, User } from "lucide-react";
|
import { ArrowUpRight, Key, User } from "lucide-react";
|
||||||
@@ -22,6 +18,8 @@ import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
|||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
||||||
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
||||||
|
import axios from "axios";
|
||||||
|
import { useStoredPageSize } from "@app/hooks/useStoredPageSize";
|
||||||
|
|
||||||
export default function GeneralPage() {
|
export default function GeneralPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -34,7 +32,7 @@ export default function GeneralPage() {
|
|||||||
|
|
||||||
const [rows, setRows] = useState<any[]>([]);
|
const [rows, setRows] = useState<any[]>([]);
|
||||||
const [isRefreshing, setIsRefreshing] = useState(false);
|
const [isRefreshing, setIsRefreshing] = useState(false);
|
||||||
const [isExporting, setIsExporting] = useState(false);
|
const [isExporting, startTransition] = useTransition();
|
||||||
const [filterAttributes, setFilterAttributes] = useState<{
|
const [filterAttributes, setFilterAttributes] = useState<{
|
||||||
actors: string[];
|
actors: string[];
|
||||||
resources: {
|
resources: {
|
||||||
@@ -69,9 +67,7 @@ export default function GeneralPage() {
|
|||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
// Initialize page size from storage or default
|
// Initialize page size from storage or default
|
||||||
const [pageSize, setPageSize] = useState<number>(() => {
|
const [pageSize, setPageSize] = useStoredPageSize("access-audit-logs", 20);
|
||||||
return getStoredPageSize("access-audit-logs", 20);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Set default date range to last 24 hours
|
// Set default date range to last 24 hours
|
||||||
const getDefaultDateRange = () => {
|
const getDefaultDateRange = () => {
|
||||||
@@ -147,7 +143,6 @@ export default function GeneralPage() {
|
|||||||
// Handle page size changes
|
// Handle page size changes
|
||||||
const handlePageSizeChange = (newPageSize: number) => {
|
const handlePageSizeChange = (newPageSize: number) => {
|
||||||
setPageSize(newPageSize);
|
setPageSize(newPageSize);
|
||||||
setStoredPageSize(newPageSize, "access-audit-logs");
|
|
||||||
setCurrentPage(0); // Reset to first page when changing page size
|
setCurrentPage(0); // Reset to first page when changing page size
|
||||||
queryDateTime(dateRange.startDate, dateRange.endDate, 0, newPageSize);
|
queryDateTime(dateRange.startDate, dateRange.endDate, 0, newPageSize);
|
||||||
};
|
};
|
||||||
@@ -308,8 +303,6 @@ export default function GeneralPage() {
|
|||||||
|
|
||||||
const exportData = async () => {
|
const exportData = async () => {
|
||||||
try {
|
try {
|
||||||
setIsExporting(true);
|
|
||||||
|
|
||||||
// Prepare query params for export
|
// Prepare query params for export
|
||||||
const params: any = {
|
const params: any = {
|
||||||
timeStart: dateRange.startDate?.date
|
timeStart: dateRange.startDate?.date
|
||||||
@@ -338,11 +331,21 @@ export default function GeneralPage() {
|
|||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
link.parentNode?.removeChild(link);
|
link.parentNode?.removeChild(link);
|
||||||
setIsExporting(false);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
let apiErrorMessage: string | null = null;
|
||||||
|
if (axios.isAxiosError(error) && error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
|
||||||
|
if (data instanceof Blob && data.type === "application/json") {
|
||||||
|
// Parse the Blob as JSON
|
||||||
|
const text = await data.text();
|
||||||
|
const errorData = JSON.parse(text);
|
||||||
|
apiErrorMessage = errorData.message;
|
||||||
|
}
|
||||||
|
}
|
||||||
toast({
|
toast({
|
||||||
title: t("error"),
|
title: t("error"),
|
||||||
description: t("exportError"),
|
description: apiErrorMessage ?? t("exportError"),
|
||||||
variant: "destructive"
|
variant: "destructive"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -630,7 +633,7 @@ export default function GeneralPage() {
|
|||||||
title={t("accessLogs")}
|
title={t("accessLogs")}
|
||||||
onRefresh={refreshData}
|
onRefresh={refreshData}
|
||||||
isRefreshing={isRefreshing}
|
isRefreshing={isRefreshing}
|
||||||
onExport={exportData}
|
onExport={() => startTransition(exportData)}
|
||||||
isExporting={isExporting}
|
isExporting={isExporting}
|
||||||
onDateRangeChange={handleDateRangeChange}
|
onDateRangeChange={handleDateRangeChange}
|
||||||
dateRange={{
|
dateRange={{
|
||||||
|
|||||||
@@ -1,25 +1,23 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { ColumnFilter } from "@app/components/ColumnFilter";
|
import { ColumnFilter } from "@app/components/ColumnFilter";
|
||||||
import { DateTimeValue } from "@app/components/DateTimePicker";
|
import { DateTimeValue } from "@app/components/DateTimePicker";
|
||||||
import {
|
import { LogDataTable } from "@app/components/LogDataTable";
|
||||||
getStoredPageSize,
|
|
||||||
LogDataTable,
|
|
||||||
setStoredPageSize
|
|
||||||
} from "@app/components/LogDataTable";
|
|
||||||
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||||
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
import { Alert, AlertDescription } from "@app/components/ui/alert";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
||||||
|
import { useStoredPageSize } from "@app/hooks/useStoredPageSize";
|
||||||
import { useSubscriptionStatusContext } from "@app/hooks/useSubscriptionStatusContext";
|
import { useSubscriptionStatusContext } from "@app/hooks/useSubscriptionStatusContext";
|
||||||
import { toast } from "@app/hooks/useToast";
|
import { toast } from "@app/hooks/useToast";
|
||||||
import { createApiClient } from "@app/lib/api";
|
import { createApiClient } from "@app/lib/api";
|
||||||
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
import { getSevenDaysAgo } from "@app/lib/getSevenDaysAgo";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { ColumnDef } from "@tanstack/react-table";
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
|
import axios from "axios";
|
||||||
import { Key, User } from "lucide-react";
|
import { Key, User } from "lucide-react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState, useTransition } from "react";
|
||||||
|
|
||||||
export default function GeneralPage() {
|
export default function GeneralPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -32,7 +30,7 @@ export default function GeneralPage() {
|
|||||||
|
|
||||||
const [rows, setRows] = useState<any[]>([]);
|
const [rows, setRows] = useState<any[]>([]);
|
||||||
const [isRefreshing, setIsRefreshing] = useState(false);
|
const [isRefreshing, setIsRefreshing] = useState(false);
|
||||||
const [isExporting, setIsExporting] = useState(false);
|
const [isExporting, startTransition] = useTransition();
|
||||||
const [filterAttributes, setFilterAttributes] = useState<{
|
const [filterAttributes, setFilterAttributes] = useState<{
|
||||||
actors: string[];
|
actors: string[];
|
||||||
actions: string[];
|
actions: string[];
|
||||||
@@ -56,9 +54,7 @@ export default function GeneralPage() {
|
|||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
// Initialize page size from storage or default
|
// Initialize page size from storage or default
|
||||||
const [pageSize, setPageSize] = useState<number>(() => {
|
const [pageSize, setPageSize] = useStoredPageSize("action-audit-logs", 20);
|
||||||
return getStoredPageSize("action-audit-logs", 20);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Set default date range to last 24 hours
|
// Set default date range to last 24 hours
|
||||||
const getDefaultDateRange = () => {
|
const getDefaultDateRange = () => {
|
||||||
@@ -134,7 +130,6 @@ export default function GeneralPage() {
|
|||||||
// Handle page size changes
|
// Handle page size changes
|
||||||
const handlePageSizeChange = (newPageSize: number) => {
|
const handlePageSizeChange = (newPageSize: number) => {
|
||||||
setPageSize(newPageSize);
|
setPageSize(newPageSize);
|
||||||
setStoredPageSize(newPageSize, "action-audit-logs");
|
|
||||||
setCurrentPage(0); // Reset to first page when changing page size
|
setCurrentPage(0); // Reset to first page when changing page size
|
||||||
queryDateTime(dateRange.startDate, dateRange.endDate, 0, newPageSize);
|
queryDateTime(dateRange.startDate, dateRange.endDate, 0, newPageSize);
|
||||||
};
|
};
|
||||||
@@ -291,8 +286,6 @@ export default function GeneralPage() {
|
|||||||
|
|
||||||
const exportData = async () => {
|
const exportData = async () => {
|
||||||
try {
|
try {
|
||||||
setIsExporting(true);
|
|
||||||
|
|
||||||
// Prepare query params for export
|
// Prepare query params for export
|
||||||
const params: any = {
|
const params: any = {
|
||||||
timeStart: dateRange.startDate?.date
|
timeStart: dateRange.startDate?.date
|
||||||
@@ -321,11 +314,21 @@ export default function GeneralPage() {
|
|||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
link.parentNode?.removeChild(link);
|
link.parentNode?.removeChild(link);
|
||||||
setIsExporting(false);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
let apiErrorMessage: string | null = null;
|
||||||
|
if (axios.isAxiosError(error) && error.response) {
|
||||||
|
const data = error.response.data;
|
||||||
|
|
||||||
|
if (data instanceof Blob && data.type === "application/json") {
|
||||||
|
// Parse the Blob as JSON
|
||||||
|
const text = await data.text();
|
||||||
|
const errorData = JSON.parse(text);
|
||||||
|
apiErrorMessage = errorData.message;
|
||||||
|
}
|
||||||
|
}
|
||||||
toast({
|
toast({
|
||||||
title: t("error"),
|
title: t("error"),
|
||||||
description: t("exportError"),
|
description: apiErrorMessage ?? t("exportError"),
|
||||||
variant: "destructive"
|
variant: "destructive"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -482,7 +485,7 @@ export default function GeneralPage() {
|
|||||||
searchColumn="action"
|
searchColumn="action"
|
||||||
onRefresh={refreshData}
|
onRefresh={refreshData}
|
||||||
isRefreshing={isRefreshing}
|
isRefreshing={isRefreshing}
|
||||||
onExport={exportData}
|
onExport={() => startTransition(exportData)}
|
||||||
isExporting={isExporting}
|
isExporting={isExporting}
|
||||||
onDateRangeChange={handleDateRangeChange}
|
onDateRangeChange={handleDateRangeChange}
|
||||||
dateRange={{
|
dateRange={{
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { ColumnFilter } from "@app/components/ColumnFilter";
|
import { ColumnFilter } from "@app/components/ColumnFilter";
|
||||||
import { DateTimeValue } from "@app/components/DateTimePicker";
|
import { DateTimeValue } from "@app/components/DateTimePicker";
|
||||||
import {
|
import { LogDataTable } from "@app/components/LogDataTable";
|
||||||
getStoredPageSize,
|
|
||||||
LogDataTable,
|
|
||||||
setStoredPageSize
|
|
||||||
} from "@app/components/LogDataTable";
|
|
||||||
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||||
import { Button } from "@app/components/ui/button";
|
import { Button } from "@app/components/ui/button";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
@@ -19,6 +15,7 @@ import { ArrowUpRight, Key, Lock, Unlock, User } from "lucide-react";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
||||||
import { useEffect, useState, useTransition } from "react";
|
import { useEffect, useState, useTransition } from "react";
|
||||||
|
import { useStoredPageSize } from "@app/hooks/useStoredPageSize";
|
||||||
|
|
||||||
export default function GeneralPage() {
|
export default function GeneralPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -37,9 +34,7 @@ export default function GeneralPage() {
|
|||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
// Initialize page size from storage or default
|
// Initialize page size from storage or default
|
||||||
const [pageSize, setPageSize] = useState<number>(() => {
|
const [pageSize, setPageSize] = useStoredPageSize("request-audit-logs", 20);
|
||||||
return getStoredPageSize("request-audit-logs", 20);
|
|
||||||
});
|
|
||||||
|
|
||||||
const [filterAttributes, setFilterAttributes] = useState<{
|
const [filterAttributes, setFilterAttributes] = useState<{
|
||||||
actors: string[];
|
actors: string[];
|
||||||
@@ -153,7 +148,6 @@ export default function GeneralPage() {
|
|||||||
// Handle page size changes
|
// Handle page size changes
|
||||||
const handlePageSizeChange = (newPageSize: number) => {
|
const handlePageSizeChange = (newPageSize: number) => {
|
||||||
setPageSize(newPageSize);
|
setPageSize(newPageSize);
|
||||||
setStoredPageSize(newPageSize, "request-audit-logs");
|
|
||||||
setCurrentPage(0); // Reset to first page when changing page size
|
setCurrentPage(0); // Reset to first page when changing page size
|
||||||
queryDateTime(dateRange.startDate, dateRange.endDate, 0, newPageSize);
|
queryDateTime(dateRange.startDate, dateRange.endDate, 0, newPageSize);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
|
||||||
ColumnDef,
|
|
||||||
flexRender,
|
|
||||||
getCoreRowModel,
|
|
||||||
useReactTable,
|
|
||||||
getPaginationRowModel,
|
|
||||||
SortingState,
|
|
||||||
getSortedRowModel,
|
|
||||||
ColumnFiltersState,
|
|
||||||
getFilteredRowModel
|
|
||||||
} from "@tanstack/react-table";
|
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
TableBody,
|
TableBody,
|
||||||
@@ -19,75 +8,30 @@ import {
|
|||||||
TableHeader,
|
TableHeader,
|
||||||
TableRow
|
TableRow
|
||||||
} from "@/components/ui/table";
|
} from "@/components/ui/table";
|
||||||
import { Button } from "@app/components/ui/button";
|
|
||||||
import { useEffect, useMemo, useState } from "react";
|
|
||||||
import { Input } from "@app/components/ui/input";
|
|
||||||
import { DataTablePagination } from "@app/components/DataTablePagination";
|
import { DataTablePagination } from "@app/components/DataTablePagination";
|
||||||
import {
|
|
||||||
Plus,
|
|
||||||
Search,
|
|
||||||
RefreshCw,
|
|
||||||
Filter,
|
|
||||||
X,
|
|
||||||
Download,
|
|
||||||
ChevronRight,
|
|
||||||
ChevronDown
|
|
||||||
} from "lucide-react";
|
|
||||||
import {
|
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
CardHeader,
|
|
||||||
CardTitle
|
|
||||||
} from "@app/components/ui/card";
|
|
||||||
import { Tabs, TabsList, TabsTrigger } from "@app/components/ui/tabs";
|
|
||||||
import { useTranslations } from "next-intl";
|
|
||||||
import { DateRangePicker, DateTimeValue } from "@app/components/DateTimePicker";
|
import { DateRangePicker, DateTimeValue } from "@app/components/DateTimePicker";
|
||||||
|
import { Button } from "@app/components/ui/button";
|
||||||
|
import { Card, CardContent, CardHeader } from "@app/components/ui/card";
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
ColumnDef,
|
||||||
TooltipContent,
|
ColumnFiltersState,
|
||||||
TooltipProvider,
|
flexRender,
|
||||||
TooltipTrigger
|
getCoreRowModel,
|
||||||
} from "./ui/tooltip";
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
const STORAGE_KEYS = {
|
getSortedRowModel,
|
||||||
PAGE_SIZE: "datatable-page-size",
|
SortingState,
|
||||||
getTablePageSize: (tableId?: string) =>
|
useReactTable
|
||||||
tableId ? `${tableId}-size` : STORAGE_KEYS.PAGE_SIZE
|
} from "@tanstack/react-table";
|
||||||
};
|
import {
|
||||||
|
ChevronDown,
|
||||||
export const getStoredPageSize = (
|
ChevronRight,
|
||||||
tableId?: string,
|
Download,
|
||||||
|
Loader,
|
||||||
defaultSize = 20
|
RefreshCw
|
||||||
): number => {
|
} from "lucide-react";
|
||||||
if (typeof window === "undefined") return defaultSize;
|
import { useTranslations } from "next-intl";
|
||||||
|
import { useEffect, useMemo, useState } from "react";
|
||||||
try {
|
|
||||||
const key = STORAGE_KEYS.getTablePageSize(tableId);
|
|
||||||
const stored = localStorage.getItem(key);
|
|
||||||
if (stored) {
|
|
||||||
const parsed = parseInt(stored, 10);
|
|
||||||
// Validate that it's a reasonable page size
|
|
||||||
if (parsed > 0 && parsed <= 1000) {
|
|
||||||
return parsed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.warn("Failed to read page size from localStorage:", error);
|
|
||||||
}
|
|
||||||
return defaultSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const setStoredPageSize = (pageSize: number, tableId?: string): void => {
|
|
||||||
if (typeof window === "undefined") return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const key = STORAGE_KEYS.getTablePageSize(tableId);
|
|
||||||
localStorage.setItem(key, pageSize.toString());
|
|
||||||
} catch (error) {
|
|
||||||
console.warn("Failed to save page size to localStorage:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
type TabFilter = {
|
type TabFilter = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -411,9 +355,11 @@ export function LogDataTable<TData, TValue>({
|
|||||||
onClick={() => !disabled && onExport()}
|
onClick={() => !disabled && onExport()}
|
||||||
disabled={isExporting || disabled}
|
disabled={isExporting || disabled}
|
||||||
>
|
>
|
||||||
<Download
|
{isExporting ? (
|
||||||
className={`mr-2 h-4 w-4 ${isExporting ? "animate-spin" : ""}`}
|
<Loader className="mr-2 size-4 animate-spin" />
|
||||||
/>
|
) : (
|
||||||
|
<Download className="mr-2 size-4" />
|
||||||
|
)}
|
||||||
{t("exportCsv")}
|
{t("exportCsv")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user