added clear all cache button
This commit is contained in:
parent
5c6b419452
commit
d6cbf18dce
@ -1,9 +1,10 @@
|
|||||||
import Background from '../../Layout/Background';
|
import Background from '../../Layout/Background';
|
||||||
import { useFilteredQueries } from './lib/hooks';
|
import { useFilteredQueries } from './lib/hooks';
|
||||||
import { QueryList } from './QueryList';
|
import { QueryList } from './QueryList';
|
||||||
|
import { reset } from '@/api/cache/query';
|
||||||
import { min } from '@/styles/mq';
|
import { min } from '@/styles/mq';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Collapse, Divider, Input } from 'ui/elements';
|
import { Button, Collapse, Divider, Input } from 'ui/elements';
|
||||||
|
|
||||||
const Wrapper = styled(Background)`
|
const Wrapper = styled(Background)`
|
||||||
padding: 4px 6px;
|
padding: 4px 6px;
|
||||||
@ -27,7 +28,12 @@ const Flex = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export function Cache() {
|
export function Cache() {
|
||||||
const { filteredQueries, setFilterString } = useFilteredQueries();
|
const { filteredQueries, refetch, setFilterString } = useFilteredQueries();
|
||||||
|
|
||||||
|
async function handleDeleteQuery() {
|
||||||
|
await reset();
|
||||||
|
refetch();
|
||||||
|
}
|
||||||
|
|
||||||
if (!filteredQueries) {
|
if (!filteredQueries) {
|
||||||
return <div>Загрузка...</div>;
|
return <div>Загрузка...</div>;
|
||||||
@ -51,6 +57,11 @@ export function Cache() {
|
|||||||
label: queryGroupName,
|
label: queryGroupName,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
|
<Flex style={{ justifyContent: 'end', marginTop: '10px' }}>
|
||||||
|
<Button type="primary" danger disabled={false} onClick={() => handleDeleteQuery()}>
|
||||||
|
Удалить все запросы
|
||||||
|
</Button>
|
||||||
|
</Flex>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user