mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Added download functionality.
This commit is contained in:
parent
0debe89d05
commit
7670ec4136
17 changed files with 216 additions and 5 deletions
|
|
@ -32,6 +32,7 @@ export function EventsTable({ onLabelClick, ...props }: EventsTableProps) {
|
|||
metric={formatMessage(labels.actions)}
|
||||
onDataLoad={handleDataLoad}
|
||||
renderLabel={renderLabel}
|
||||
allowDownload={false}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,13 @@
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
import Icons from '@/components/icons';
|
||||
import ListTable, { ListTableProps } from './ListTable';
|
||||
import styles from './MetricsTable.module.css';
|
||||
import { DownloadButton } from '@/components/input/DownloadButton';
|
||||
|
||||
export interface MetricsTableProps extends ListTableProps {
|
||||
websiteId: string;
|
||||
|
|
@ -29,6 +30,7 @@ export interface MetricsTableProps extends ListTableProps {
|
|||
searchFormattedValues?: boolean;
|
||||
showMore?: boolean;
|
||||
params?: { [key: string]: any };
|
||||
allowDownload?: boolean;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
|
|
@ -44,6 +46,7 @@ export function MetricsTable({
|
|||
searchFormattedValues = false,
|
||||
showMore = true,
|
||||
params,
|
||||
allowDownload = true,
|
||||
children,
|
||||
...props
|
||||
}: MetricsTableProps) {
|
||||
|
|
@ -104,7 +107,10 @@ export function MetricsTable({
|
|||
autoFocus={true}
|
||||
/>
|
||||
)}
|
||||
{children}
|
||||
<div className={styles.buttons}>
|
||||
{children}
|
||||
{allowDownload && <DownloadButton filename={type} data={filteredData} />}
|
||||
</div>
|
||||
</div>
|
||||
{data && !error && (
|
||||
<ListTable {...(props as ListTableProps)} data={filteredData} className={className} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue