mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-24 22:15:45 +03:00
client: import querylog fix
This commit is contained in:
parent
5c6bb33e3a
commit
c7d8b9ede1
3 changed files with 9 additions and 16 deletions
|
@ -33,7 +33,7 @@ NOTE: Add new changes ABOVE THIS COMMENT.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [v0.107.52] - 2024-07-03
|
## [v0.107.52] - 2024-07-04
|
||||||
|
|
||||||
See also the [v0.107.52 GitHub milestone][ms-v0.107.52].
|
See also the [v0.107.52 GitHub milestone][ms-v0.107.52].
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
import { Field, reduxForm } from 'redux-form';
|
import { Field, type InjectedFormProps, reduxForm } from 'redux-form';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
@ -104,14 +104,13 @@ const FORM_NAMES = {
|
||||||
response_status: 'response_status',
|
response_status: 'response_status',
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FiltersFormProps {
|
type FiltersFormProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
responseStatusClass?: string;
|
responseStatusClass?: string;
|
||||||
change: (...args: unknown[]) => unknown;
|
setIsLoading: (...args: unknown[]) => unknown;
|
||||||
setIsLoading?: (...args: unknown[]) => unknown;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
const Form = (props: FiltersFormProps) => {
|
const Form = (props: FiltersFormProps & InjectedFormProps) => {
|
||||||
const { className = '', responseStatusClass, setIsLoading, change } = props;
|
const { className = '', responseStatusClass, setIsLoading, change } = props;
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
@ -142,7 +141,6 @@ const Form = (props: FiltersFormProps) => {
|
||||||
|
|
||||||
const onInputClear = async () => {
|
const onInputClear = async () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
change(FORM_NAMES.search, DEFAULT_LOGS_FILTER[FORM_NAMES.search]);
|
change(FORM_NAMES.search, DEFAULT_LOGS_FILTER[FORM_NAMES.search]);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
};
|
};
|
||||||
|
@ -195,7 +193,7 @@ const Form = (props: FiltersFormProps) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default reduxForm({
|
export const FiltersForm = reduxForm<Record<string, any>, FiltersFormProps>({
|
||||||
form: FORM_NAME.LOGS_FILTER,
|
form: FORM_NAME.LOGS_FILTER,
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
})(Form);
|
})(Form);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
|
|
||||||
import Form from './Form';
|
import { FiltersForm } from './Form';
|
||||||
import { refreshFilteredLogs } from '../../../actions/queryLogs';
|
import { refreshFilteredLogs } from '../../../actions/queryLogs';
|
||||||
import { addSuccessToast } from '../../../actions/toasts';
|
import { addSuccessToast } from '../../../actions/toasts';
|
||||||
|
|
||||||
|
@ -38,12 +38,7 @@ const Filters = ({ filter, setIsLoading }: FiltersProps) => {
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</h1>
|
</h1>
|
||||||
|
<FiltersForm responseStatusClass="d-sm-block" setIsLoading={setIsLoading} initialValues={filter} />
|
||||||
<Form
|
|
||||||
// responseStatusClass="d-sm-block"
|
|
||||||
// setIsLoading={setIsLoading}
|
|
||||||
initialValues={filter}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue