mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-31 01:16:01 +02:00
feat: add authentication as a table filter (#3206)
Adds `auth` as a table filter. Also fixes the hook to correctly fetch the events based on the new return type. <img width="1046" alt="image" src="https://user-images.githubusercontent.com/14320932/221603312-a40055a8-4c23-4f1f-9a87-7fbd03e7b49e.png">
This commit is contained in:
parent
8e79820783
commit
c0124371ca
@ -79,6 +79,7 @@ export const SignOnLogTable = () => {
|
|||||||
maxWidth: 150,
|
maxWidth: 150,
|
||||||
Cell: HighlightCell,
|
Cell: HighlightCell,
|
||||||
searchable: true,
|
searchable: true,
|
||||||
|
filterName: 'auth',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'IP address',
|
Header: 'IP address',
|
||||||
@ -87,11 +88,11 @@ export const SignOnLogTable = () => {
|
|||||||
searchable: true,
|
searchable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Successful',
|
Header: 'Success',
|
||||||
accessor: 'successful',
|
accessor: 'successful',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
Cell: SignOnLogSuccessfulCell,
|
Cell: SignOnLogSuccessfulCell,
|
||||||
filterName: 'successful',
|
filterName: 'success',
|
||||||
filterParsing: (value: boolean) => value.toString(),
|
filterParsing: (value: boolean) => value.toString(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -12,14 +12,14 @@ export const useSignOnLog = () => {
|
|||||||
|
|
||||||
const { data, error, mutate } = useConditionalSWR(
|
const { data, error, mutate } = useConditionalSWR(
|
||||||
signOnLog && isEnterprise(),
|
signOnLog && isEnterprise(),
|
||||||
[],
|
{ events: [] },
|
||||||
formatApiPath(`api/admin/signons`),
|
formatApiPath(`api/admin/signons`),
|
||||||
fetcher
|
fetcher
|
||||||
);
|
);
|
||||||
|
|
||||||
return useMemo(
|
return useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
events: (data ?? []) as ISignOnEvent[],
|
events: (data?.events ?? []) as ISignOnEvent[],
|
||||||
loading: !error && !data,
|
loading: !error && !data,
|
||||||
refetch: () => mutate(),
|
refetch: () => mutate(),
|
||||||
error,
|
error,
|
||||||
|
Loading…
Reference in New Issue
Block a user